Deduplicate fees checks
Description
Multiple entrypoints repeat the same fees precondition inline. This issue extracts a shared helper.
Requirements and context
- Repository scope: Agentpay-Org/Agentpay-contracts only.
- Extract the repeated fees check into a private helper and route entrypoints through it.
- Behaviour unchanged; same rejections and typed codes.
- No ABI change.
Suggested execution
- Fork the repo and create a branch
git checkout -b refactor/fees-01-helper
- Implement changes
- Write code in: the relevant module.
- Write comprehensive tests in: cover the new behaviour and edge cases.
- Test and commit
Test and commit
- Run
cargo fmt, cargo clippy --all-targets -- -D warnings, and cargo test.
- Cover edge cases: each existing rejection still fires identically.
- Include the full test output in the PR description.
Example commit message
refactor(fees): extract shared check helper
Guidelines
- Minimum 95 percent test coverage for impacted modules.
- Clear, reviewer-focused documentation.
- Timeframe: 96 hours.
Community & contribution rewards
- 💬 Join the AgentPay community on Discord: https://discord.gg/eXvRKkgcv
- ⭐ This is a GrantFox OSS / Official Campaign task and may be rewarded. When your PR is merged you'll be prompted to rate the project — a 5-star rating is much appreciated.
Deduplicate fees checks
Description
Multiple entrypoints repeat the same fees precondition inline. This issue extracts a shared helper.
Requirements and context
Suggested execution
git checkout -b refactor/fees-01-helperTest and commit
cargo fmt,cargo clippy --all-targets -- -D warnings, andcargo test.Example commit message
refactor(fees): extract shared check helperGuidelines
Community & contribution rewards