Commit 1bd9a804 authored by Mark Tyneway's avatar Mark Tyneway

contracts-bedrock: upgrade script for post sherlock

Includes a complete upgrade script that can be ran
for upgrading any op-stack based chain that was deployed
before the sherlock audit fixes were all included.

The script is ran with the following command:

```bash
forge script \
    scripts/upgrades/PostSherlock.s.sol \
    --rpc-url $ETH_RPC_URL \
    --private-key $PRIVATE_KEY \
    --sig 'run(address,address)' \
    $SAFE_ADDRESS \
    $PROXY_ADMIN_ADDRESS
```

Signers should run the script and be sure to add any required
flags so that hardware wallets can be used. The script will
submit a single transaction that approves the upgrade and
then checks to see if there have been enough approvals and
then triggers the upgrade if there have been enough approvals.

This comes with test coverage but requires a goerli RPC url.
To run the tests, use the following command:

```bash
forge test --contracts scripts/upgrades --rpc-url $ETH_RPC_URL
```
parent f738fcfb
......@@ -30,7 +30,9 @@
"@eth-optimism/contracts-periphery/ds-test",
"@eth-optimism/contracts-periphery/forge-std",
"@eth-optimism/contracts-periphery/@rari-capital/solmate",
"forta-agent"
"forta-agent",
"@eth-optimism/contracts-bedrock/@safe-global/safe-contracts",
"@eth-optimism/contracts-bedrock/solady"
]
},
"private": true,
......
......@@ -9,7 +9,9 @@ remappings = [
'@openzeppelin/contracts/=node_modules/@openzeppelin/contracts/',
'@rari-capital/solmate/=node_modules/@rari-capital/solmate',
'forge-std/=node_modules/forge-std/src',
'ds-test/=node_modules/ds-test/src'
'ds-test/=node_modules/ds-test/src',
'@safe-global/safe-contracts=node_modules/@safe-global/safe-contracts/',
'solady/=node_modules/solady/src'
]
extra_output = ['devdoc', 'userdoc', 'metadata', 'storageLayout']
bytecode_hash = 'none'
......
......@@ -80,6 +80,8 @@
"forge-std": "https://github.com/foundry-rs/forge-std.git#46264e9788017fc74f9f58b7efa0bc6e1df6d410",
"glob": "^7.1.6",
"hardhat-deploy": "^0.11.4",
"@safe-global/safe-contracts": "https://github.com/safe-global/safe-contracts.git#v1.3.0-libs.0",
"solady": "https://github.com/Vectorized/solady.git#v0.0.85",
"solhint": "^3.3.7",
"solhint-plugin-prettier": "^0.0.5",
"ts-node": "^10.9.1",
......
This diff is collapsed.
......@@ -3760,6 +3760,10 @@
"@safe-global/safe-gateway-typescript-sdk" "^3.5.3"
ethers "^5.7.2"
"@safe-global/safe-contracts@https://github.com/safe-global/safe-contracts.git#v1.3.0-libs.0":
version "1.3.0"
resolved "https://github.com/safe-global/safe-contracts.git#767ef36bba88bdbc0c9fe3708a4290cabef4c376"
"@safe-global/safe-gateway-typescript-sdk@^3.5.3":
version "3.7.0"
resolved "https://registry.yarnpkg.com/@safe-global/safe-gateway-typescript-sdk/-/safe-gateway-typescript-sdk-3.7.0.tgz#2af52f1bc73759b1b6a549fed598781c8c5fce72"
......@@ -19354,6 +19358,10 @@ socks@^2.3.3, socks@^2.6.1:
ip "^1.1.5"
smart-buffer "^4.1.0"
"solady@https://github.com/Vectorized/solady.git#v0.0.85":
version "0.0.85"
resolved "https://github.com/Vectorized/solady.git#507e0d84872f435d497e6d2ce10e7f484392db4f"
solc@0.7.3:
version "0.7.3"
resolved "https://registry.yarnpkg.com/solc/-/solc-0.7.3.tgz#04646961bd867a744f63d2b4e3c0701ffdc7d78a"
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment