Skip to content

Add cross-contract guard for revenue_deposit_contract callable-only-by-offering allowlist #481

Description

@thlpkee20-wq

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
    • cargo test --all
  • 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

Metadata

Metadata

Assignees

Type

No type

Fields

No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions