Skip to content

remove disburse_recurring and related proposal functions to streamlin… - #548

Merged
thegreatfeez merged 1 commit into
Ac0rdP:mainfrom
akprinciple:Require-the-contract-be-not-frozen
Aug 31, 2026
Merged

remove disburse_recurring and related proposal functions to streamlin…#548
thegreatfeez merged 1 commit into
Ac0rdP:mainfrom
akprinciple:Require-the-contract-be-not-frozen

Conversation

@akprinciple

Copy link
Copy Markdown
Contributor

closes #447

Summary

This PR resolves the recurring disbursement regression by enforcing strict pre-flight guardrails prior to executing token transfers, ensuring early and safe failure when the contract is frozen or insufficiently funded.


Changes

  • **Deleted duplicated codes
  • Freeze State Guard: Injected require_not_frozen at the very beginning of disburse_recurring.
  • Pre-Transfer Balance Validation: Added an explicit balance verification step against the contract's token reserves before transferring the period disbursement amount.
  • Non-Mutating Failure Mode: Returns Error::TransferFailed immediately when treasury balance is insufficient, preventing any mutations to recurring schedule state.
  • Error Contract Preservation: Preserved established contract error semantics for transfer failures across the codebase.
  • Source Hygiene & De-duplication: Removed a stale, duplicated code block in lib.rs that was causing duplicate method definitions and compiler collisions in the AccordContract implementation.

Why This Change

The recurring payout path must fail safely and deterministically under invalid conditions:

  • Contract Freeze Protection: Prevents disbursements from proceeding when administrative or emergency freezes are active.
  • Treasury Solvency & State Safety: Blocks execution and leaves schedule records intact when the treasury cannot cover the disbursement, avoiding partial or inconsistent state updates.
  • Build Integrity: Resolves compiler collisions to maintain a clean build across the contract implementation.

@vercel

vercel Bot commented Aug 31, 2026

Copy link
Copy Markdown

@akprinciple is attempting to deploy a commit to the thegreatfeez's projects Team on Vercel.

A member of the Team first needs to authorize it.

@thegreatfeez
thegreatfeez merged commit 0c99f8c into Ac0rdP:main Aug 31, 2026
2 of 4 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Require the contract be not-frozen for disburse_recurring, consistent with the existing execute guard

2 participants