Implement canonical asset whitelist with allow-list verification
Labels: security, feature, priority/medium
Difficulty: Medium · Effort: M
Backlog slot: 19
Problem Statement
accepted_assets is just a list at initialization; the contract trusts that every issuer is correct. There's no deep verification: confirm the token contract address is a real SEP-41 token, not a malicious address that simulates a token interface.
Why it Matters
- An attacker could deploy a malicious mock token, register it as accepted, and trick users into "donating" to the attacker.
Expected Outcome
- Implement
verify_token_contract(env, address) — calls token::Client::newforname, symbol, decimals` and asserts they exist.
- Optionally require an allow-list of pre-approved issuers at platform level.
Acceptance Criteria
Files Likely Affected
campaign/src/lib.rs, campaign/src/storage.rs
Dependencies
None.
Implement canonical asset whitelist with allow-list verification
Labels:
security,feature,priority/mediumDifficulty: Medium · Effort: M
Backlog slot: 19
Problem Statement
accepted_assetsis just a list at initialization; the contract trusts that every issuer is correct. There's no deep verification: confirm the token contract address is a real SEP-41 token, not a malicious address that simulates a token interface.Why it Matters
Expected Outcome
verify_token_contract(env, address) — callstoken::Client::newforname,symbol,decimals` and asserts they exist.Acceptance Criteria
accepted_assetsto avoid re-checking at every donate.Files Likely Affected
campaign/src/lib.rs,campaign/src/storage.rsDependencies
None.