feat(script): grant new issuer DEPOSIT+WITHDRAW on shared authoriser - #221
Draft
alastairong1 wants to merge 1 commit into
Draft
feat(script): grant new issuer DEPOSIT+WITHDRAW on shared authoriser#221alastairong1 wants to merge 1 commit into
alastairong1 wants to merge 1 commit into
Conversation
Author Safe Tx Builder bundles that grant the new issuer EOA 0x3d0CD66EFA66c05d86c3d4316B03eAE87ab9E8aE the DEPOSIT (mint) and WITHDRAW (burn) roles on the live shared authoriser (STOX_PROD_AUTHORISER, 0x35f9...7456). Because every production receipt vault shares this authoriser and its role checks are not vault-scoped, the grants enable the issuer to mint/burn across every ST0x SFT. Follows the operational-scripts runbook / MigrateMultisigThreshold template: orchestrator pre-flight (Safe config, uniform vault ownership + authoriser, pinned authoriser grants), idempotency guard, single-tx bundle, canonical SafeTxHash, simulate + post-state assert, artifact emit, and n+1 reversibility (revoke). DEPOSIT and WITHDRAW are authored as two single-tx bundles, not one batch: LibSafeOps hashes a single SafeTx whereas the Tx Builder UI MultiSends a multi-tx bundle, so a 2-tx bundle's per-tx hash would not match what signers verify. Each grant authored in its own forge process (the n+1 check advances the Safe nonce). CI mirrors the existing multisig-artifact workflow pattern (run-script.yaml is not on main). 11 fork tests pass against live Base (happy path, verify round-trip, inverted pre-flight + verify rejections). Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
|
Important Review skippedDraft detected. 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)
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 |
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.
What
Adds an operational script that authors Safe Tx Builder bundles granting the new issuer EOA
0x3d0CD66EFA66c05d86c3d4316B03eAE87ab9E8aEtheDEPOSIT(mint) andWITHDRAW(burn) roles on the live shared authoriserSTOX_PROD_AUTHORISER(0x35f9…7456).Every production receipt vault shares this one authoriser and its role checks are not vault-scoped, so the two grants enable the issuer to mint/burn across every ST0x SFT at once. The pre-flight proves that uniformity against live chain before any bundle is emitted.
Files
script/20260630-grant-issuer-mint-burn.s.sol—GrantIssuerMintBurn, four entrypoints (grantDeposit()/grantWithdraw()author,verifyDeposit(string)/verifyWithdraw(string)re-derive).test/script/20260630-grant-issuer-mint-burn.t.sol— 11 fork tests..github/workflows/grant-issuer-mint-burn-artifact.yaml— CI dry-run + bundle upload.Approach
Follows the operational-scripts runbook /
MigrateMultisigThresholdtemplate: orchestrator pre-flight (LibInvariants.assertAll→ Safe config, uniform vault ownership + authoriser, pinned authoriser grants) → idempotency guard → single-tx bundle → canonical SafeTxHash → simulate + post-state assert → artifact emit → n+1 reversibility (revoke).Three deviations from the runbook (called out for review)
LibSafeOpshashes a singleSafeTx; the Tx Builder UI MultiSends a multi-tx bundle and signs that, so a 2-tx bundle's per-tx hash would not match what signers verify. The grants are independent (a half-applied state is benign and revocable), so two bundles is the faithful shape. Each grant must be authored in its ownforgeprocess — the n+1 check advances the Safe nonce.run-script.yaml. The generalized dispatcher described in the runbook isn't onmain(it lives on an unmerged branch). This mirrorsmain's actualmultisig-artifact.yamlpattern.MigrateMultisigThreshold,MigrateBeaconOwners) have none, and the runbook's add-a-script checklist doesn't include it. Happy to add one if preferred.Testing
All 11 fork tests pass against live Base (
grantDeposit/grantWithdrawhappy path,verifyround-trips, inverted pre-flight invariants — already-granted, authoriser grant drift, vault ownership drift, vault authoriser drift — and invertedverifyrejections — wrong chainId, wrong role data, wrong target). The live pre-flight passing confirms all 20 vaults share the authoriser, the Safe holdsDEPOSIT_ADMIN/WITHDRAW_ADMIN, and grant+revoke both execute.Operating
Run each
--sigseparately (CI or locally withRPC_URL_BASE_FORK), grab theSafeTxHashfrom the==== TX BUILDER JSON ====log block, upload eachout/grant-issuer-*.jsonto Safe Tx Builder, cross-check the hash byte-for-byte, then sign. The two grants are independent and can be signed in either order.🤖 Generated with Claude Code