Closes #1103 #1249 - #1358
Merged
greatest0fallt1me merged 3 commits intoOct 1, 2026
Merged
Closes #1103 #1249#1358greatest0fallt1me merged 3 commits into
greatest0fallt1me merged 3 commits into
Conversation
…ettlement caller matrix (CalloraOrg#1103, CalloraOrg#1249)
|
@mansur-codes Great news! 🎉 Based on an automated assessment of this PR, the linked Wave issue(s) no longer count against your application limits. You can now already apply to more issues while waiting for a review of this PR. Keep up the great work! 🚀 |
# Conflicts: # contracts/distribute/src/lib.rs # contracts/distribute/tests/auth_snap.rs # contracts/errors/src/test.rs # contracts/validators/src/migrate.rs # contracts/vault/src/lib.rs # contracts/vault/src/test_value_conservation.rs # contracts/vault/src/views.rs
…ccept a vault rotation) Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
fix(vault, settlement): cap timelocked sweep at surplus & document settlement caller matrix (#1103, #1249)
Closes #1103
Closes #1249
Description
This PR resolves Issue #1103 and Issue #1249 by capping timelocked vault sweep operations to unallocated surplus tokens and documenting the caller authorization matrix and security model for the settlement contract.
Key Changes
1. Timelocked Sweep Surplus Cap (Issue #1103)
propose_sweepandexecute_sweepinCalloraVaultto compute surplus as:surplus = on_ledger_token_balance - tracked_balancepropose_sweeprejects sweep amounts exceeding current surplus withVaultError::InsufficientBalance.execute_sweepvalidates that surplus remains >=proposal.amountat execution time.DataKey::Balance, timelock proposals, and cooldown state completely unmodified.contracts/vault/src/test_value_conservation.rs:propose_sweep_fails_when_amount_exceeds_current_surplusexecute_sweep_fails_when_surplus_drops_below_amount_after_proposalsuccessful_sweep_leaves_balance_untouchedwithdrawal_between_proposal_and_execution_specifically2. Settlement Caller Matrix & Security Docs (Issue #1249)
docs/ACCESS_CONTROL.md.receive_paymentandbatch_receive_payment(accessible by bothVaultandAdmin), including operational guidance for operator key sizing and threshold protections.require_authorized_callerandforce_credit_developerincontracts/settlement/src/lib.rs.Verification & Testing
cargo test -p callora-vault: All 158 tests passed (111 unit tests + 47 error stability tests).cargo clippy --package callora-vault --all-targets -- -D warnings: Passed cleanly with zero warnings.cargo fmt --package callora-vault --package callora-settlement -- --check: Passed with zero formatting diffs.