fix: harden auxiliary share-token controls (#FIND-048 #FIND-063 #FIND-070)#452
Conversation
|
Important Review skippedAuto reviews are disabled on base/target branches other than the default branch. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: Organization UI Review profile: ASSERTIVE Plan: Pro Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
✨ Finishing Touches🧪 Generate unit tests (beta)
Comment |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: fe283e701c
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| extend_instance_ttl(e); | ||
| require_not_paused(e); | ||
| require_unrestricted(e, &from); | ||
| require_unrestricted(e, &to.address()); |
There was a problem hiding this comment.
Exempt vault-directed transfers from recipient restrictions
Applying require_unrestricted to the transfer recipient blocks protocol-internal share movements when whitelist mode is enabled and the vault address is not explicitly listed. The vault runtime enqueues TransferShares { from: owner, to: self_id } during withdrawal flow (contract/vault/kernel/src/actions/mod.rs), and the Soroban interpreter executes that as a token transfer; with this new check, a whitelisted user can still fail withdrawals because to is the vault contract, not a listed user. This introduces a functional regression in normal withdrawal processing whenever whitelist restrictions are configured without also adding the vault address.
Useful? React with 👍 / 👎.
…-070 Nexus b7bcf2b1-dc11-424a-99b0-d38192cb7e12 44e4e876-5816-47e7-baed-c830bad19f92 c3853d07-893a-4ea3-bffe-9e31d2ea1f70)
…eba-8873-ebed7fc1e367 Nexus e4f65e59-546c-43f2-8eb5-2ea02aefb732 Nexus 91031a48-56c5-4e00-94fb-a2dcb95536fc Nexus 28389781-7ddf-45b5-8e1c-6539da633b0c) Adds two-step admin rotation and OpenZeppelin-style upgrade support for auxiliary Soroban contracts, plus share-token constructor/config observability coverage.
e428348 to
5b03b63
Compare
Summary
Remediates Halborn/Nexus governance/audit follow-up findings for auxiliary share-token controls:
b7bcf2b1-dc11-424a-99b0-d38192cb7e12: clarify and prove share-tokenburnis a vault-only protocol settlement primitive; owner consent remains enforced at vault withdrawal entrypoints beforeBurnShareseffects are generated, and delegated burns useburn_fromallowance semantics.44e4e876-5816-47e7-baed-c830bad19f92: add admin/vault-gated pause/readback controls and fail-closed guards for share-token and Blend adapter state-changing paths.c3853d07-893a-4ea3-bffe-9e31d2ea1f70: propagate vault restriction policy to share-token transfers, including muxed recipient handling viaMuxedAddress::address().This stacks on
audit/share-token-admin-immutableand keeps broad lifecycle/upgrade policy questions out of scope.Verification
RUSTUP_TOOLCHAIN=1.89.0 cargo fmt -p templar-soroban-share-token -p templar-soroban-blend-adapter -- --checkgit diff --checkRUSTUP_TOOLCHAIN=1.89.0 CARGO_TARGET_DIR=/data/tmp/templar-share-token-controls/target cargo test -p templar-soroban-share-token -- --nocapture— 25 passedRUSTUP_TOOLCHAIN=1.89.0 CARGO_TARGET_DIR=/data/tmp/templar-share-token-controls/target cargo test -p templar-soroban-blend-adapter -- --nocapture— 22 unit + 7 integration passedRUSTUP_TOOLCHAIN=1.89.0 CARGO_TARGET_DIR=/data/tmp/templar-share-token-controls/target cargo test -p templar-soroban-runtime withdraw -- --nocapture— withdrawal-filtered runtime tests passedsize-budget-check— 93,961 bytesStack
audit/share-token-admin-immutableaudit/share-token-controls-a043-a048-a051This change is