Description
revenue_deposit_contract.rs accepts deposit calls from any caller. Add an allowlist of authorized offering contract addresses and reject deposits from unauthorized callers with UnauthorizedDepositor.
Requirements and context
- Must be secure, tested, and documented
- Should be efficient and easy to review
- Relevant code:
Revora-Contracts/src/revenue_deposit_contract.rs
- Allowlist managed by deposit-contract admin with two-step rotation
Suggested execution
- Fork the repo and create a branch
git checkout -b feat/deposit-contract-allowlist
- Implement changes
- Add
authorized_offerings: Vec<Address> storage
- Gate
deposit on caller-in-set and require_auth(caller)
- Emit
dep_allow_add, dep_allow_rm events
- Validate security and correctness assumptions
Test and commit
- Run tests
- Cover edge cases
- Empty allowlist must reject all deposits, not default-open
- Include test output and security notes
Example commit message
feat: gate revenue_deposit_contract.deposit on offering allowlist
Guidelines
- Minimum 95 percent test coverage
- Clear documentation
- Timeframe: 96 hours
Description
revenue_deposit_contract.rsaccepts deposit calls from any caller. Add an allowlist of authorized offering contract addresses and reject deposits from unauthorized callers withUnauthorizedDepositor.Requirements and context
Revora-Contracts/src/revenue_deposit_contract.rsSuggested execution
git checkout -b feat/deposit-contract-allowlistauthorized_offerings: Vec<Address>storagedepositon caller-in-set andrequire_auth(caller)dep_allow_add,dep_allow_rmeventsTest and commit
cargo test --allExample commit message
feat: gate revenue_deposit_contract.deposit on offering allowlistGuidelines