π Description
Admin config entrypoints in quicklendx-contracts/src/init.rs/lib.rs β set_protocol_config (min invoice amount, max due-date days, grace-period seconds) and set_fee_config (fee bps) β must respect bounds: MAX_FEE_BPS = 1000, MAX_DUE_DATE_DAYS = 730, MAX_GRACE_PERIOD_SECONDS. Prior work added init invariants and a dry-run preview, but a focused bounds-enforcement matrix asserting each parameter is clamped/rejected at its exact limit is not present.
Why this matters: config bounds are the guardrails on protocol-critical economics. A fee bps above the cap would let an admin overcharge every settlement; a grace period beyond the max would strand investor remedy. Pinning rejection at exactly the boundary for each parameter makes the guardrails provable, not assumed.
π― Requirements & Context
Functional requirements
Context & constraints
π οΈ Suggested Execution
1. Fork & branch
git checkout -b test/config-bounds-matrix
2. Implement changes
- Build the at-limit / over-limit matrix for each parameter and the persistence assertions.
- Doc-comment each bound under test.
3. Test & commit
cargo test -p quicklendx-contracts test_config_bounds_matrix -- --nocapture
- Edge cases: fee bps of exactly 0 (min); min invoice amount at the lower bound; max due-date at exactly 730; all parameters set in one call.
Example commit message
test(governance): add config-bounds enforcement matrix for set_protocol_config/set_fee_config
Pins accept-at-max / reject-over-max for fee bps, due-date, grace period, and min amount.
β
Acceptance Criteria & Guidelines
| Requirement |
Target |
| At-limit accept / over-limit reject matrix |
Required |
| Non-admin rejected before mutation |
Required |
| Accepted values persisted + readable |
Required |
| Coverage of config branches |
β₯ 95% |
| Docs + doc comments |
Required |
cargo test + cargo clippy clean |
Required |
| Timeframe |
96 hours from assignment |
π¬ Community & Support
Questions, design discussion, and help getting your environment running β join the QuickLendX contributor community on Discord: https://discord.gg/VpngvTjWa
Please drop a note in the channel when you pick this up so we can avoid duplicate work and unblock you fast. Clear communication during the PR keeps the review fast and friction-free. π
π Description
Admin config entrypoints in
quicklendx-contracts/src/init.rs/lib.rsβset_protocol_config(min invoice amount, max due-date days, grace-period seconds) andset_fee_config(fee bps) β must respect bounds:MAX_FEE_BPS = 1000,MAX_DUE_DATE_DAYS = 730,MAX_GRACE_PERIOD_SECONDS. Prior work added init invariants and a dry-run preview, but a focused bounds-enforcement matrix asserting each parameter is clamped/rejected at its exact limit is not present.π― Requirements & Context
Functional requirements
quicklendx-contracts/src/test_config_bounds_matrix.rsassertingset_fee_configacceptsMAX_FEE_BPSand rejectsMAX_FEE_BPS + 1withInvalidFeeBasisPoints.set_protocol_configaccepts each parameter at its max and rejects one over (MAX_DUE_DATE_DAYS,MAX_GRACE_PERIOD_SECONDS, and the min-invoice-amount lower bound).Context & constraints
test_init.rsandtest_init_invariants.rs.25.1.1.π οΈ Suggested Execution
1. Fork & branch
2. Implement changes
3. Test & commit
cargo test -p quicklendx-contracts test_config_bounds_matrix -- --nocaptureExample commit message
β Acceptance Criteria & Guidelines
cargo test+cargo clippyclean㪠Community & Support
Questions, design discussion, and help getting your environment running β join the QuickLendX contributor community on Discord: https://discord.gg/VpngvTjWa
Please drop a note in the channel when you pick this up so we can avoid duplicate work and unblock you fast. Clear communication during the PR keeps the review fast and friction-free. π