Adds structured contract events when treasury accounts, asset allowlists, or authorization settings are updated across contracts (payroll_registry and payment_executor). This ensures indexers, dashboards, and audit log monitoring systems receive real-time updates on critical treasury mutations.
contracts/payroll_registry/src/lib.rs:- Emits
TreasuryRotationProposedevent inpropose_treasury_rotationwith topics("TreasuryRotationProposed", company_id)and data(current_admin, new_treasury, timestamp). - Emits
TreasuryRotatedevent inaccept_treasury_rotationwith topics("TreasuryRotated", company_id)and data(old_treasury, new_treasury). - Implements
cancel_treasury_rotationinPayrollRegistryTraitandPayrollRegistryand emitsTreasuryRotationCancelledevent with topics("TreasuryRotationCancelled", company_id)and data(current_admin,).
- Emits
contracts/payroll_registry/src/tests.rs:- Added unit tests for
TreasuryRotationProposed,TreasuryRotated, andTreasuryRotationCancelledevent emissions and assertions.
- Added unit tests for
contracts/payment_executor/src/lib.rs:- Emits
TreasuryAssetAllowedUpdatedevent ininitializewhen setting the default allowed asset token. - Emits
TreasuryAssetAllowedUpdatedevent inset_asset_allowedwith topics("TreasuryAssetAllowedUpdated", asset)and data(allowed, timestamp). - Added unit test
test_asset_allowed_emits_eventsverifying event published oninitializeandset_asset_allowed.
- Emits
Closes #168