[Sonic] Deploy 031 - Disable minting on Sonic Vault#2947
Conversation
Rebuild OpenZeppelin validation data from Hardhat build-info when the validation cache is missing or stale. This restores storage-layout checks after removing the hardhat-upgrades plugin.
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #2947 +/- ##
==========================================
- Coverage 47.33% 46.01% -1.32%
==========================================
Files 110 110
Lines 4920 4924 +4
Branches 1362 1364 +2
==========================================
- Hits 2329 2266 -63
- Misses 2587 2654 +67
Partials 4 4 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
| await oSonicVault.connect(governor).setStrategistAddr(user.address); | ||
| await wS.connect(user).approve(oSonicVault.address, amount); | ||
| const tx = await oSonicVault.connect(user).mint(amount); | ||
| await oSonicVault.connect(governor).setStrategistAddr(strategist.address); | ||
| return tx; |
There was a problem hiding this comment.
nit: alternative, strategist can mint and transfer to the user. But this works as well if we are tracking events
Deployment verification —
|
| Field | Committed artifact | This PR's actual deploy |
|---|---|---|
| address | 0xF66886e242e20cAb2496AF1d411eBcFb73440270 |
0x41DF78939406BF3f189c304C72f01fAd7acAfce7 |
| tx | 0x085fd708…f45d83a2 |
0xcd82182c…e8983653 |
git log shows the artifact was last touched by 69923754b (#2894), and 0xF66886…0270 is the current, pre-upgrade implementation — op 029_vault_permissioned_rebase upgraded to it, and the proxy's EIP-1967 slot still reads it today. The new impl 0x41DF…Fce7 appears nowhere under deployments/.
Impact: anything resolving by name — ethers.getContract("OSVault"), later deploy scripts, Talos actions — gets the old implementation. The PR body already notes "post-deployment metadata generation failed"; the artifact was never regenerated and committed.
🔴 B2 — Governance operation files are missing
The description references deployments/sonic/operations/031_disable_mints.schedule.json and .execute.json. Neither exists in the repo — this PR changes only three files:
contracts/contracts/vault/OSVault.sol
contracts/deploy/sonic/031_disable_mints.js
contracts/test/vault/os-vault.sonic.js
With no committed payload, the script's single action — OSonicVaultProxy(0xa3c0…0186).upgradeTo(0x41DF…Fce7) — cannot be diffed against any governance artifact.
🟡 B3 — The description documents changes that aren't in the diff
The entire Storage-layout validation section (stale-cache detection, reconstructing OZ validation runs from build-info, rewriting the cache) corresponds to no file in this PR. Please confirm where that landed before relying on the quoted [storage-slots] Contract OSVault is safe for upgrade result — the validating tooling was itself reportedly patched.
✅ What checks out
Code match — sol2uml diff against the real deployed impl (clean)
sol2uml diff 0x41DF78939406BF3f189c304C72f01fAd7acAfce7 .,node_modules --network sonic
All files reported match, including contracts/vault/OSVault.sol, VaultCore.sol, VaultAdmin.sol, VaultStorage.sol, VaultInitializer.sol, token/OUSD.sol, governance/Governable.sol and the OpenZeppelin dependencies. No differences.
Constructor argument
Trailing 32-byte word of the creation input:
000000000000000000000000039e2fb66102314ce7b64ce5ce3e5183bc94ad38
-> 0x039e2fB66102314Ce7b64Ce5Ce3E5183bc94aD38 == addresses.sonic.wS ✅
Intent — the mint restriction is actually effective
Inheritance resolves as OSVault → VaultAdmin → VaultCore, so the override binds. _mint(uint256) (VaultCore.sol:74, internal virtual) is the single chokepoint both public entry points route through:
VaultCore.sol:53mint(...)→:58 _mint(_amount)VaultCore.sol:65mint(uint256)→:66 _mint(_amount)
Both are therefore gated behind msg.sender == strategistAddr || isGovernor(). ✅
ℹ️ Not a defect (expected pre-execution)
The upgrade has not executed — the proxy implementation slot still reads 0xF66886…0270. I also scanned the Sonic Timelock (0x31a91336414d3B955E494E7d485a6B06b55FC8fB) from the deploy block 76,311,221 → 76,321,409 and found no event referencing the new impl, i.e. no scheduled upgrade yet. Caveat: that window is only ~10k Sonic blocks, so it rules out a schedule shortly after deploy, not one made later.
Before merge
- Regenerate and commit
deployments/sonic/OSVault.jsonpointing at0x41DF…Fce7, plus the two031_disable_mintsops JSON files. - Once scheduled, confirm the Timelock payload is target
0xa3c0eCA00D2B76b4d1F170b0AB3FdeA16C180186, calldata0x3659cfe6+ padded41df78939406bf3f189c304c72f01fad7acafce7. - Resolve B3 and independently confirm storage-layout upgrade safety.
- Off-chain multisig follow-up to schedule + execute the upgrade.
Read-only audit: block explorer + read-only RPC. No transactions sent, no files modified.
|
@sparrowDom sorry, I missed pushing the deployment artifacts. Can you check again. |
Deployment verification —
|
shahthepro
left a comment
There was a problem hiding this comment.
- All deployed contracts are listed in the deploy PR's description
- Deployed contract's verified code (and all dependencies) match the code in master
- Contract constructors have correct arguments
- The transactions that interacted with the newly deployed contract match the deploy script.
- Governance proposal matches the deploy script
- Smoke tests pass after fork test execution of the governance proposal
Summary
Disables public minting on the Sonic Vault as part of the OS sunset.
The new
OSVaultimplementation restricts asset-backed mints to the Strategist or Governor, following the approach previously used for the Plume Vault.Deployment
Deployment
031_disable_mintsupgradesOSonicVaultProxyto the new implementation through the Sonic Timelock.Contract
Deployment transaction: 0xcd82182cfedcbfd35b92b15c3da6fc789d3e6c4f552be8a2a7c1cb20e8983653
Constructor argument:
0x039e2fB66102314Ce7b64Ce5Ce3E5183bc94aD38Governance actions
contracts/deployments/sonic/operations/031_disable_mints.schedule.jsoncontracts/deployments/sonic/operations/031_disable_mints.execute.jsonStorage-layout validation
The initial deployment transaction succeeded, but post-deployment metadata generation failed because the OpenZeppelin validations cache was no longer generated after
@openzeppelin/hardhat-upgradeswas removed.The storage-layout helper now:
@openzeppelin/upgrades-core.The repaired validation path confirms:
Code Change Checklist
To be completed before internal review begins:
Internal review:
Deploy checklist
Two reviewers complete the following checklist: