Skip to content

Pull Request: Implement Treasury Fee Sharing Mechanism #728

Merged
Idrhas merged 11 commits into
Farm-credit:mainfrom
johdanike:feat/treasury-fee-sharing
Jul 5, 2026
Merged

Pull Request: Implement Treasury Fee Sharing Mechanism #728
Idrhas merged 11 commits into
Farm-credit:mainfrom
johdanike:feat/treasury-fee-sharing

Conversation

@johdanike

Copy link
Copy Markdown
Contributor

Closes #648
Summary
This PR adds an atomic fee-splitting mechanism to the Treasury contract. Transaction fees are now automatically distributed between Planters, Verifiers, and the Replanting Reserve based on configurable basis-point (bps) weights.

Key Changes

Atomic Fee Distribution: Added distribute_fees(env, from, amount) which performs all fee transfers in a single, atomic transaction. If any leg of the distribution fails, the entire transaction reverts to maintain treasury balance.

Governance-Adjustable Weights: Integrated weight management into the existing 2-of-3 multisig proposal flow. Weights are stored as basis points (sum = 10,000) and can be updated through the new governance proposal system.

Rounding Dust: Implemented logic to ensure that any integer-division dust is automatically absorbed by the Replanting Reserve pool.

Acceptance Criteria Checklist

[x] Configurable Weights: Governance can adjust planter, verifier, and reserve weights via multisig proposal.

[x] Atomic Processing: Fee division is processed atomically, ensuring no partial states.

Technical Notes

The contract utilizes the latest soroban-sdk 22.0.1 and registration syntax (env.register(Treasury, ())).

Governance paths remain consistent with the established withdrawal multisig design.

@drips-wave

drips-wave Bot commented Jun 29, 2026

Copy link
Copy Markdown

@johdanike 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! 🚀

Learn more about application limits

JohDan1 added 5 commits June 29, 2026 19:30
- Update mock Stellar addresses in carbon-impact tests to
  valid 56-character strings to pass assertions.
- Correct search query in tree-registry tests from
  'Mangrove' to 'Teak' to align with mock data.

Related to Farm-credit#542, Farm-credit#545
@Idrhas

Idrhas commented Jun 30, 2026

Copy link
Copy Markdown
Contributor

Fix merge conflict and dont forget to Offramp your USDC on https://fundable.finance when you receive your rewards

@johdanike

Copy link
Copy Markdown
Contributor Author

Conflicts resolved

@Idrhas Idrhas merged commit 10436e1 into Farm-credit:main Jul 5, 2026
6 of 9 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.

[Contract] Implement Treasury Fee Sharing Mechanism

4 participants