Token metadata oracle: dynamic asset_code → contract address verification
Labels: feature, security, priority/medium
Difficulty: Medium · Effort: M
Backlog slot: 21
Problem Statement
Asset code + issuer rely on accepted_assets, but the contract has no on-chain oracle to validate that an Address matches the issuer's claimed asset_code. Two donations could be routed to the wrong asset entry if the maintainer passes the wrong issuer at registration time.
Why it Matters
- This is a persistent class of "wrong asset" bugs in token-based DeFi.
Expected Outcome
Implement a built-in lookup that proves (contract_address, asset_code) corresponds — fn verify_asset_metadata(env, contract, code) -> bool.
Acceptance Criteria
Files Likely Affected
campaign/src/asset_audit.rs, campaign/src/types.rs
Dependencies
Issue #19.
Token metadata oracle: dynamic asset_code → contract address verification
Labels:
feature,security,priority/mediumDifficulty: Medium · Effort: M
Backlog slot: 21
Problem Statement
Asset code + issuer rely on
accepted_assets, but the contract has no on-chain oracle to validate that anAddressmatches the issuer's claimed asset_code. Two donations could be routed to the wrong asset entry if the maintainer passes the wrong issuer at registration time.Why it Matters
Expected Outcome
Implement a built-in lookup that proves
(contract_address, asset_code)corresponds —fn verify_asset_metadata(env, contract, code) -> bool.Acceptance Criteria
types.rs.Files Likely Affected
campaign/src/asset_audit.rs,campaign/src/types.rsDependencies
Issue #19.