feat(script): author the follow-up authoriser swap for still-V3 vaults - #269
Conversation
|
Caution Review failedThe pull request is closed. ℹ️ Recent review info⚙️ Run configurationConfiguration used: Organization UI Review profile: ASSERTIVE Plan: Pro Plus Run ID: 📒 Files selected for processing (3)
📝 WalkthroughWalkthroughAdds a Solidity script that authorizes Safe transactions to migrate remaining production receipt vaults from the V3 to the pinned V4 authoriser clone, with validation, simulation, artifact emission, and forked failure-path tests. The workflow dispatcher exposes the script. ChangesVault authoriser migration
Estimated code review effort: 4 (Complex) | ~45 minutes Sequence Diagram(s)sequenceDiagram
participant Dispatcher
participant SwapRemainingVaultAuthorisers
participant Safe
participant ReceiptVaults
Dispatcher->>SwapRemainingVaultAuthorisers: invoke run()
SwapRemainingVaultAuthorisers->>ReceiptVaults: inspect authorizer()
SwapRemainingVaultAuthorisers->>Safe: simulate setAuthorizer(V4 clone)
Safe-->>SwapRemainingVaultAuthorisers: return simulation results
SwapRemainingVaultAuthorisers->>ReceiptVaults: verify V4 clone authorisers
Possibly related PRs
Poem
✨ Finishing Touches🧪 Generate unit tests (beta)
Warning There were issues while running some tools. Please review the errors and either fix the tool's configuration or disable the tool if it's a critical failure. 🔧 Checkov (3.3.8).github/workflows/run-script.yamlTraceback (most recent call last): Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
836b556 to
b147647
Compare
04f4cb5 to
529b402
Compare
da20cf9 to
0aae222
Compare
529b402 to
c272bde
Compare
The executed 20260623 batch covered every vault in the table at signing time; the six tokens deployed after it (MU/AMD/AVGO/AMAT/LRCX/TTWO) came up on the V3 authoriser and red-line the strict uniform-authoriser invariants until swapped. Add `20260722-swap-remaining-vault-authorisers`, a run-script Safe Tx Builder authoring that is deliberately SELF-SCOPING: it reads every production vault's live `authorizer()` and targets exactly the still-V3 ones — a later un-swapped vault is picked up by re-dispatch, an unknown authoriser aborts the authoring (`UnexpectedVaultAuthoriser`), and an all-swapped table refuses to author an empty bundle (`NoVaultsLeftToSwap`). Pre-flight pins the clone (codehash + full grant map incl. the seven auto-granted admins on the Safe); post-state asserts STRICT authoriser uniformity across the whole table plus uniform Safe ownership. Notable finding, proven by the n+1 walk: the swap is ONE-WAY. The V4 vault impl validates the incoming authoriser and reverts `AuthorizerMissingCorporateActionAdmin` for V3, so rollback is structurally impossible; recovery is forward-only (the Safe re-points at any V4-compatible authoriser). The n+1 leg proves that class clears the live threshold instead of simulating an impossible V3 rollback. Registered in run-script.yaml (append-only). Fork suite: happy path checks the authored bundle matches the live-derived target set tx-for-tx; inverted guards cover the empty-set and unknown-authoriser aborts. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01VPs1hCTxusmaSeFKvoc4Kr
c272bde to
3c5ac54
Compare
0aae222 to
2e2ae2c
Compare
Every production vault is on the V4 authoriser: MU, AMD, AVGO, AMAT, LRCX and TTWO all report authorizer() == STOX_PROD_AUTHORISER_V4_CLONE on Base as of 2026-07-23, so nothing remains on V3 and the bundle this script authors has been signed and executed. The header still said PENDING. Dated by verification rather than by the Safe tx -- the execution block is not recorded here, and stamping a date I have not established is the same defect as the stale marker. The happy path authored against a live-derived target set, so it went red the moment the set emptied; its own comment called for retiring it at exactly this point. The empty-set refusal and the unknown-authoriser abort remain, and those are the two that still carry weight for a script kept for re-dispatch. Kept rather than retired: it reads every vault's live authorizer() and targets whatever is still on V3, so re-dispatch is how a future vault that comes up on the wrong authoriser gets swapped. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
|
Reviewed f3951fd: approve Verified against the actual branch tip CI on
Both are inherited: The four run-once guard failures visible on the older |
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
|
Reviewed 9a941bd: approve Tip is |
Per review: the wallet is first-class state, not a drive-by grant. - LibAuthoriserInvariants.GRANTEE_SERVICE_MINTER_3D0C pinned + expectedGrants grows to 13 (DEPOSIT + WITHDRAW for the minter EOA; the address is chain-shared, the grants per-chain). Every existing consumer of the map now ENFORCES the provisioning: the per-chain clone-grant assertions (StoxProdV4PostSwap on Base, the Ethereum pin test) and the cross-chain parity authoriser leg (assertExpectedGrants per chain) go RED on each chain until its 20260723 bundle executes — the forcing function, exactly like every other migration in this repo. - 20260619 clone-deploy MIRROR_COUNT 6 -> 8 (slice guard + suite updated): future chain bootstraps (HyperEVM) auto-provision the minter wallet at authoriser-deploy time, no Safe signing needed there. - The 20260723 authoring script now references the canonical pin and its drift guard skips the wallet's own (deliberately not-yet-true) rows. - Stale hardcoded grant counts in docs made count-agnostic. Sequencing note: the pending authoriser-swap authorings (#269/#271) carry full-map drift guards, so re-dispatching them AFTER this merges and BEFORE the minter bundles execute reverts on the minter rows — dispatch order: execute the already-signed swap bundles and the minter bundles in any order on-chain, but author from the matching refs. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01VPs1hCTxusmaSeFKvoc4Kr

The executed 20260623 batch covered every vault in the table at signing
time; the six tokens deployed after it (MU/AMD/AVGO/AMAT/LRCX/TTWO) came up
on the V3 authoriser and red-line the strict uniform-authoriser invariants
until swapped. Add
20260722-swap-remaining-vault-authorisers, a run-scriptSafe Tx Builder authoring that is deliberately SELF-SCOPING: it reads every
production vault's live
authorizer()and targets exactly the still-V3ones — a later un-swapped vault is picked up by re-dispatch, an unknown
authoriser aborts the authoring (
UnexpectedVaultAuthoriser), and anall-swapped table refuses to author an empty bundle (
NoVaultsLeftToSwap).Pre-flight pins the clone (codehash + full grant map incl. the seven
auto-granted admins on the Safe); post-state asserts STRICT authoriser
uniformity across the whole table plus uniform Safe ownership.
Notable finding, proven by the n+1 walk: the swap is ONE-WAY. The V4 vault
impl validates the incoming authoriser and reverts
AuthorizerMissingCorporateActionAdminfor V3, so rollback is structurallyimpossible; recovery is forward-only (the Safe re-points at any
V4-compatible authoriser). The n+1 leg proves that class clears the live
threshold instead of simulating an impossible V3 rollback.
Registered in run-script.yaml (append-only). Fork suite: happy path checks
the authored bundle matches the live-derived target set tx-for-tx; inverted
guards cover the empty-set and unknown-authoriser aborts.
Co-Authored-By: Claude Opus 4.8 noreply@anthropic.com
Claude-Session: https://claude.ai/code/session_01VPs1hCTxusmaSeFKvoc4Kr
Summary by CodeRabbit
New Features
Tests