Repository navigation
Treasury rebalance with human approval + manager-withdraw denial proof (#358) - #443
Open
IVANLI2412 wants to merge 1 commit into
Open
IVANLI2412 wants to merge 1 commit into
IVANLI2412 wants to merge 1 commit into
Conversation
Closes nirium-protocol#358 - owner sets a dedicated rebalance manager; agent proposes; human y/N gates execution - fail-closed role guard proves the manager key cannot withdraw or transfer funds - offline demo, no-network tests, local secret redaction, testnet-only commands - Rust host-side role model verified with cargo test; no Soroban CLI available Co-Authored-By: Big Pickle <noreply@anthropic.com>
|
@IVANLI2412 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! 🚀 |
Eras256
reviewed
Nov 22, 2026
Eras256
left a comment
Member
There was a problem hiding this comment.
AI-assisted comment (Claude)
Thanks @IVANLI2412, the structure and the offline tests look good. Two things from #358's "Done when" are still missing before we can merge:
- A real testnet run with one command, with the transaction hashes on Stellar Expert (testnet) listed in the README. The PR says they're PENDING right now.
- The negative test on testnet: the manager key tries to withdraw or transfer funds out of a real vault and is refused, with the output pasted in the README. The local
VaultRolesmodel shows the idea, but the point of the issue is that the vault contract itself refuses it on-chain.
Use your own testnet keys (Friendbot + a DeFindex vault you deploy, like in your #371 run). Once both are in, we'll review again.
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.
Closes #358
What
Adds a self-contained
examples/treasury-rebalance-approval/example demonstrating a testnet treasury rebalance with explicit human approval, plus a reproducible local proof that the rebalance manager key cannot withdraw or transfer funds out of the vault.Security properties (verified locally)
VaultRoles.authorizerejectsWITHDRAW/TRANSFER/SET_REBALANCE_MANAGERunless the caller is the owner;deny_operation()runs before any XDR is built or any network call happens. Tests assertsigned == False,submitted == False, no state change and no agent events.aprobado=False ejecutado=False, zero manager signatures and zero rebalance submissions.{'xdr': ...}; keys are never logged.Verification
pytest -q→ 23 passedcargo test(host-side model) → 8 passedmain.py --demoandmain.py --demo --decline→ exit 0git diff --cached --check→ cleanScope / limitations
Stellar testnet only. Offline demos by default. No real funds, no real transaction signing, no deployment, no mainnet. No on-chain tx hashes are claimed (marked
PENDING/N/A);soroban/stellarCLIs are not available in this environment, so the Rust contract was validated host-side only. Testnet hashes and Stellar Expert links must be added by a maintainer with testnet credentials.Reviewer note: this is an example plus tests, not a change to production contract code.