diff --git a/README.md b/README.md index 0cef956..cb2d3a4 100644 --- a/README.md +++ b/README.md @@ -441,9 +441,9 @@ not automated by anything in this repo's scripts today. that race requires a structural change (an atomic deploy+init constructor) rather than an in-contract check. - **Fee mechanics.** `fee_bps` is basis points (1/100 of a percent) out of - 10000, validated `<= 10000` at `initialize`. It's deducted from the top - of every payout (`release`, `release_issue`, `withdraw`) before the - remainder is split among recipients — the treasury is paid in the same + 10000, validated `<= MAX_FEE_BPS` (1000 = 10%) at `initialize`. It's + deducted from the top of every payout (`release`, `release_issue`, + `withdraw`) before the remainder is split among recipients — the treasury is paid in the same transaction as the recipients, so there's no separate "sweep fees" step that could be skipped. - **Replay / double-spend protection.** Every escrow/milestone-issue diff --git a/contracts/escrow/src/lib.rs b/contracts/escrow/src/lib.rs index ef869a5..3f0f611 100644 --- a/contracts/escrow/src/lib.rs +++ b/contracts/escrow/src/lib.rs @@ -57,7 +57,7 @@ impl EscrowContract { if env.storage().instance().has(&DataKey::Admin) { return Err(Error::AlreadyInitialized); } - if fee_bps as i128 > BPS_DENOMINATOR { + if fee_bps > MAX_FEE_BPS { return Err(Error::InvalidFee); } if treasury == env.current_contract_address() { diff --git a/contracts/maintenance-pool/src/lib.rs b/contracts/maintenance-pool/src/lib.rs index fa83f7c..7083596 100644 --- a/contracts/maintenance-pool/src/lib.rs +++ b/contracts/maintenance-pool/src/lib.rs @@ -53,7 +53,7 @@ impl MaintenancePoolContract { if env.storage().instance().has(&DataKey::Admin) { return Err(Error::AlreadyInitialized); } - if fee_bps as i128 > BPS_DENOMINATOR { + if fee_bps > MAX_FEE_BPS { return Err(Error::InvalidFee); } if treasury == env.current_contract_address() { diff --git a/contracts/milestones/src/lib.rs b/contracts/milestones/src/lib.rs index 88c7401..ab3107c 100644 --- a/contracts/milestones/src/lib.rs +++ b/contracts/milestones/src/lib.rs @@ -60,7 +60,7 @@ impl MilestonesContract { if env.storage().instance().has(&DataKey::Admin) { return Err(Error::AlreadyInitialized); } - if fee_bps as i128 > BPS_DENOMINATOR { + if fee_bps > MAX_FEE_BPS { return Err(Error::InvalidFee); } if treasury == env.current_contract_address() {