Skip to content

Commit

Permalink
feat: mode deployment (#185)
Browse files Browse the repository at this point in the history
  • Loading branch information
simplyoptimistic authored Nov 8, 2024
1 parent 8c57f27 commit a739cdd
Show file tree
Hide file tree
Showing 7 changed files with 57 additions and 23 deletions.
19 changes: 13 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -27,18 +27,25 @@ Run the following commands to check that the CreateX factory has the correct cod
[[ $(cast keccak $(cast code 0xba5Ed099633D3B313e4D5F7bdc1305d3c28ba5Ed --rpc-url {RPC_URL})) == "0xbd8a7ea8cfca7b4e5f5041d7d4b17bc317c5ce42cfbc42066a00cf26b43eb53f" ]] && echo "Hash Matches" || echo "Hash Does Not Match"
```

Sample scripting commands, using optimism as an example. We assume blockscout is the default verifier:
Deploy Root contracts first:

```
forge script script/deployParameters/optimism/DeployBase.s.sol:DeployBase --slow --rpc-url optimism -vvvv
forge script script/deployParameters/optimism/DeployStaking.s.sol:DeployStaking --slow --rpc-url optimism -vvvv
forge script script/deployParameters/optimism/DeployRootBase.s.sol:DeployRootBase --slow --rpc-url optimism -vvvv
forge script script/deployParameters/optimism/DeployRootBase.s.sol:DeployRootBase --slow --rpc-url optimism --broadcast --verify -vvvv
```

With broadcast:
Deploy Leaf contracts next:

```
forge script script/deployParameters/optimism/DeployBase.s.sol:DeployBase --slow --rpc-url optimism --broadcast --verify --verifier blockscout --verifier-url https://optimism.blockscout.com/api\? -vvvv
forge script script/deployParameters/optimism/DeployStaking.s.sol:DeployStaking --slow --rpc-url optimism --broadcast --verify --verifier blockscout --verifier-url https://optimism.blockscout.com/api\? -vvvv
forge script script/deployPartial/deployParameters/mode/DeployPartialBase.s.sol:DeployPartialBase --slow --rpc-url mode -vvvv
forge script script/deployPartial/deployParameters/mode/DeployPartialBase.s.sol:DeployPartialBase --slow --rpc-url mode --broadcast --verify --verifier blockscout --verifier-url https://explorer.mode.network/api\? -vvvv
```

Run the bash scripts (after updating them) to verify contracts.

```
bash script/verifyRoot.sh
bash script/verifyLeaf.sh
```

If there is a verification failure, simply remove `--broadcast` and add `--resume`.
Expand Down
15 changes: 14 additions & 1 deletion deployment-addresses/deployPartial/mode.json
Original file line number Diff line number Diff line change
@@ -1 +1,14 @@
{}
{
"ism: ": "0x0000000000000000000000000000000000000000",
"leafGaugeFactory: ": "0x42e403b73898320f23109708b0ba1Ae85838C445",
"leafMessageBridge: ": "0xF278761576f45472bdD721EACA19317cE159c011",
"leafMessageModule: ": "0xF385603a12Be8b7B885222329c581FDD1C30071D",
"leafPoolFactory": "0x31832f2a97Fd20664D76Cc421207669b55CE4BC0",
"leafPoolImplementation": "0x10499d88Bd32AF443Fc936F67DE32bE1c8Bb374C",
"leafRouter: ": "0x3a63171DD9BebF4D07BC782FECC7eb0b890C2A45",
"leafTokenBridge: ": "0xA7287a56C01ac8Baaf8e7B662bDB41b10889C7A6",
"leafVoter: ": "0x97cDBCe21B6fd0585d29E539B1B99dAd328a1123",
"leafVotingRewardsFactory: ": "0x7dc9fd82f91B36F416A89f5478375e4a79f4Fb2F",
"leafXFactory: ": "0x73CaE4450f11f4A33a49C880CE3E8E56a9294B31",
"leafXVelo: ": "0x7f9AdFbd38b669F03d1d11000Bc76b9AaEA28A81"
}
14 changes: 14 additions & 0 deletions deployment-addresses/optimism.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
{
"emergencyCouncil: ": "0xf7a15F27533c2Db26341220C1e0B939B56dEfeda",
"ism: ": "0x0000000000000000000000000000000000000000",
"rootGaugeFactory: ": "0x42e403b73898320f23109708b0ba1Ae85838C445",
"rootLockbox: ": "0x12B64dF29590b4F0934070faC96e82e580D60232",
"rootMessageBridge: ": "0xF278761576f45472bdD721EACA19317cE159c011",
"rootMessageModule: ": "0xF385603a12Be8b7B885222329c581FDD1C30071D",
"rootPoolFactory: ": "0x31832f2a97Fd20664D76Cc421207669b55CE4BC0",
"rootPoolImplementation: ": "0x10499d88Bd32AF443Fc936F67DE32bE1c8Bb374C",
"rootTokenBridge: ": "0xA7287a56C01ac8Baaf8e7B662bDB41b10889C7A6",
"rootVotingRewardsFactory: ": "0x7dc9fd82f91B36F416A89f5478375e4a79f4Fb2F",
"rootXFactory: ": "0x73CaE4450f11f4A33a49C880CE3E8E56a9294B31",
"rootXVelo: ": "0x7f9AdFbd38b669F03d1d11000Bc76b9AaEA28A81"
}
12 changes: 6 additions & 6 deletions script/deployParameters/mode/DeployBase.s.sol
Original file line number Diff line number Diff line change
Expand Up @@ -23,12 +23,12 @@ contract DeployBase is DeployBaseFixture {
function setUp() public override {
_params = DeployBaseFixture.DeploymentParameters({
weth: 0x4200000000000000000000000000000000000006,
poolAdmin: 0xA6074AcC04DeAb343881882c896555A1Ba2E9d46,
pauser: 0xA6074AcC04DeAb343881882c896555A1Ba2E9d46,
feeManager: 0xA6074AcC04DeAb343881882c896555A1Ba2E9d46,
tokenAdmin: 0x0000000000000000000000000000000000000001,
bridgeOwner: 0x0000000000000000000000000000000000000001,
moduleOwner: 0x0000000000000000000000000000000000000001,
poolAdmin: 0xe915AEf46E1bd9b9eD2D9FE571AE9b5afbDE571b,
pauser: 0xe915AEf46E1bd9b9eD2D9FE571AE9b5afbDE571b,
feeManager: 0xe915AEf46E1bd9b9eD2D9FE571AE9b5afbDE571b,
tokenAdmin: 0xe915AEf46E1bd9b9eD2D9FE571AE9b5afbDE571b,
bridgeOwner: 0xe915AEf46E1bd9b9eD2D9FE571AE9b5afbDE571b,
moduleOwner: 0xe915AEf46E1bd9b9eD2D9FE571AE9b5afbDE571b,
mailbox: 0x2f2aFaE1139Ce54feFC03593FeE8AB2aDF4a85A7,
outputFilename: "mode.json"
});
Expand Down
12 changes: 6 additions & 6 deletions script/deployParameters/optimism/DeployRootBase.s.sol
Original file line number Diff line number Diff line change
Expand Up @@ -9,12 +9,12 @@ contract DeployRootBase is DeployRootBaseFixture {
weth: 0x4200000000000000000000000000000000000006,
voter: 0x41C914ee0c7E1A5edCD0295623e6dC557B5aBf3C,
velo: 0x9560e827aF36c94D2Ac33a39bCE1Fe78631088Db,
tokenAdmin: 0x0000000000000000000000000000000000000001,
bridgeOwner: 0x0000000000000000000000000000000000000001,
emergencyCouncilOwner: 0x0000000000000000000000000000000000000001,
notifyAdmin: 0x0000000000000000000000000000000000000001,
emissionAdmin: 0x0000000000000000000000000000000000000001,
defaultCap: 100,
tokenAdmin: 0xBA4BB89f4d1E66AA86B60696534892aE0cCf91F5,
bridgeOwner: 0xBA4BB89f4d1E66AA86B60696534892aE0cCf91F5,
emergencyCouncilOwner: 0x838352F4E3992187a33a04826273dB3992Ee2b3f,
notifyAdmin: 0xBA4BB89f4d1E66AA86B60696534892aE0cCf91F5,
emissionAdmin: 0xBA4BB89f4d1E66AA86B60696534892aE0cCf91F5,
defaultCap: 150,
mailbox: 0xd4C1905BB1D26BC93DAC913e13CaCC278CdCC80D,
outputFilename: "optimism.json"
});
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -22,9 +22,9 @@ contract DeployPartialBase is DeployPartialBaseFixture {

function setUp() public override {
_params = DeployPartialBaseFixture.DeploymentParameters({
tokenAdmin: 0x0000000000000000000000000000000000000001,
bridgeOwner: 0x0000000000000000000000000000000000000001,
moduleOwner: 0x0000000000000000000000000000000000000001,
tokenAdmin: 0xe915AEf46E1bd9b9eD2D9FE571AE9b5afbDE571b,
bridgeOwner: 0xe915AEf46E1bd9b9eD2D9FE571AE9b5afbDE571b,
moduleOwner: 0xe915AEf46E1bd9b9eD2D9FE571AE9b5afbDE571b,
mailbox: 0x2f2aFaE1139Ce54feFC03593FeE8AB2aDF4a85A7,
inputFilename: "mode.json",
outputFilename: "mode.json"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
pragma solidity >=0.8.19 <0.9.0;

import "test/BaseFixture.sol";
import {DeployPartialBase} from "script/deployPartial/deployParameters/mode/DeployPartialBase.sol";
import {DeployPartialBase} from "script/deployPartial/deployParameters/mode/DeployPartialBase.s.sol";

import {ModeFeeSharing} from "src/extensions/ModeFeeSharing.sol";

Expand Down

0 comments on commit a739cdd

Please sign in to comment.