add_asset() and remove_asset() update the asset whitelist in persistent storage with no on-chain event. Indexers and clients cannot detect whitelist changes without polling is_supported_asset() for every token they care about.
Add two event structs:
#[contractevent]
pub struct AddAssetEvent {
#[topic]
pub asset: Address,
pub admin: Address,
}
#[contractevent]
pub struct RemoveAssetEvent {
#[topic]
pub asset: Address,
pub admin: Address,
}
Emit AddAssetEvent at the end of add_asset() and RemoveAssetEvent at the end of remove_asset(). Only these two functions are modified.
Acceptance criteria
Relevant files
contracts/agent-vault/src/lib.rs (only add_asset and remove_asset functions)
contracts/agent-vault/src/tests.rs
Notes for contributors
If you'd like to work on this, comment below so we can assign it to you.
Questions welcome — see CONTRIBUTING.md for setup
and workflow.
add_asset()andremove_asset()update the asset whitelist in persistent storage with no on-chain event. Indexers and clients cannot detect whitelist changes without pollingis_supported_asset()for every token they care about.Add two event structs:
Emit
AddAssetEventat the end ofadd_asset()andRemoveAssetEventat the end ofremove_asset(). Only these two functions are modified.Acceptance criteria
AddAssetEventandRemoveAssetEventare defined with#[contractevent]add_asset()emitsAddAssetEventafter writing to storageremove_asset()emitsRemoveAssetEventafter removing from storage (only if the key existed)env.events().all()cargo testandcargo clippy -- -D warningspassRelevant files
contracts/agent-vault/src/lib.rs(onlyadd_assetandremove_assetfunctions)contracts/agent-vault/src/tests.rsNotes for contributors
If you'd like to work on this, comment below so we can assign it to you.
Questions welcome — see CONTRIBUTING.md for setup
and workflow.