Skip to content

Commit d4f328e

Browse files
authored
Merge pull request #77 from Uniswap/deployer-update
Final Deployer Preparations
2 parents e458c11 + 00e9cc4 commit d4f328e

21 files changed

+1173
-181
lines changed

.github/workflows/ci.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,3 +52,4 @@ jobs:
5252
FOUNDRY_PROFILE: pr
5353
FORGE_SNAPSHOT_CHECK: true
5454
MAINNET_RPC_URL: ${{ secrets.MAINNET_RPC_URL }}
55+
UNICHAIN_RPC_URL: ${{ secrets.UNICHAIN_RPC_URL }}

.gitmodules

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,3 +25,6 @@
2525
[submodule "lib/BokkyPooBahsDateTimeLibrary"]
2626
path = lib/BokkyPooBahsDateTimeLibrary
2727
url = https://github.com/bokkypoobah/BokkyPooBahsDateTimeLibrary
28+
[submodule "lib/dao-signer"]
29+
path = lib/dao-signer
30+
url = https://github.com/ScopeLift/dao-signer

foundry.lock

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,9 @@
55
"lib/briefcase": {
66
"rev": "62c718ec25b64ecc95b4e09c2751134d78b89a4f"
77
},
8+
"lib/dao-signer": {
9+
"rev": "ee1e73fbda9b3328aca30d9e42ca78819f4383a3"
10+
},
811
"lib/forge-std": {
912
"rev": "77041d2ce690e692d6e03cc812b57d1ddaa4d505"
1013
},

foundry.toml

Lines changed: 28 additions & 26 deletions
Original file line numberDiff line numberDiff line change
@@ -1,39 +1,41 @@
11
[profile.default]
2-
evm_version = "cancun"
3-
optimizer = true
4-
optimizer_runs = 10_000_000
5-
solc_version = "0.8.29"
6-
verbosity = 3
7-
gas_limit = "9223372036854775807"
8-
no_match_test = "test_fuzz_gas_release_malicious"
2+
evm_version = "cancun"
3+
optimizer = true
4+
optimizer_runs = 10_000_000
5+
solc_version = "0.8.29"
6+
verbosity = 3
7+
gas_limit = "9223372036854775807"
8+
no_match_test = "test_fuzz_gas_release_malicious"
99

1010
[rpc_endpoints]
11-
mainnet = "${MAINNET_RPC_URL}"
11+
mainnet = "${MAINNET_RPC_URL}"
12+
unichain = "${UNICHAIN_RPC_URL}"
1213

1314
[profile.ci]
14-
fuzz = { runs = 5000 }
15-
invariant = { runs = 1000 }
15+
fuzz = { runs = 5000 }
16+
invariant = { runs = 1000 }
1617

1718
[profile.coverage]
18-
fuzz = { runs = 100 }
19-
invariant = { runs = 0 }
19+
fuzz = { runs = 100 }
20+
invariant = { runs = 0 }
2021

2122
[profile.lite]
22-
fuzz = { runs = 50 }
23-
invariant = { runs = 10 }
24-
# Speed up compilation and tests during development.
25-
optimizer = false
23+
fuzz = { runs = 50 }
24+
invariant = { runs = 10 }
25+
# Speed up compilation and tests during development.
26+
optimizer = false
2627

2728
[fmt]
28-
bracket_spacing = false
29-
int_types = "long"
30-
line_length = 100
31-
multiline_func_header = "attributes_first"
32-
number_underscore = "thousands"
33-
quote_style = "double"
34-
single_line_statement_blocks = "single"
35-
tab_width = 2
36-
wrap_comments = true
29+
bracket_spacing = false
30+
int_types = "long"
31+
line_length = 100
32+
multiline_func_header = "attributes_first"
33+
number_underscore = "thousands"
34+
quote_style = "double"
35+
single_line_statement_blocks = "single"
36+
tab_width = 2
37+
wrap_comments = true
3738

3839
[lint]
39-
exclude_lints = ["mixed-case-variable", "mixed-case-function"]
40+
exclude_lints = ["mixed-case-variable", "mixed-case-function"]
41+

lib/dao-signer

Submodule dao-signer added at ee1e73f

remappings.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,3 @@
11
solmate/=lib/solmate/
22
@eth-optimism-bedrock/=lib/optimism/packages/contracts-bedrock
3+
eas-contracts/=lib/dao-signer/lib/eas-contracts/contracts/

script/01_DeployMainnet.s.sol

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
// SPDX-License-Identifier: MIT
2+
pragma solidity ^0.8.20;
3+
4+
import {console2} from "forge-std/console2.sol";
5+
import "forge-std/Script.sol";
6+
import {MainnetDeployer} from "./deployers/MainnetDeployer.sol";
7+
8+
contract DeployMainnet is Script {
9+
function setUp() public {}
10+
11+
function run() public {
12+
require(block.chainid == 1, "Not mainnet");
13+
14+
vm.startBroadcast();
15+
16+
MainnetDeployer deployer = new MainnetDeployer();
17+
console2.log("Deployed Deployer at:", address(deployer));
18+
console2.log("TOKEN_JAR at:", address(deployer.TOKEN_JAR()));
19+
console2.log("RELEASER at:", address(deployer.RELEASER()));
20+
console2.log("V3_FEE_ADAPTER at:", address(deployer.V3_FEE_ADAPTER()));
21+
console2.log("UNI_VESTING at:", address(deployer.UNI_VESTING()));
22+
23+
vm.stopBroadcast();
24+
}
25+
}

script/02_DeployUnichain.s.sol

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
// SPDX-License-Identifier: MIT
2+
pragma solidity ^0.8.20;
3+
4+
import {console2} from "forge-std/console2.sol";
5+
import {Script} from "forge-std/Script.sol";
6+
import {UnichainDeployer} from "./deployers/UnichainDeployer.sol";
7+
import {OptimismBridgedResourceFirepit} from "../src/releasers/OptimismBridgedResourceFirepit.sol";
8+
9+
contract DeployUnichain is Script {
10+
function setUp() public {}
11+
12+
function run() public {
13+
require(block.chainid == 130, "Not Unichain");
14+
15+
vm.startBroadcast();
16+
17+
UnichainDeployer deployer = new UnichainDeployer();
18+
console2.log("Deployed Deployer at:", address(deployer));
19+
console2.log("TOKEN_JAR at:", address(deployer.TOKEN_JAR()));
20+
console2.log("RELEASER at:", address(deployer.RELEASER()));
21+
22+
vm.stopBroadcast();
23+
}
24+
}
Lines changed: 37 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,37 @@
1+
// SPDX-License-Identifier: AGPL-3.0-only
2+
pragma solidity ^0.8.29;
3+
4+
import {Script, console2} from "forge-std/Script.sol";
5+
import {IAgreementAnchorFactory} from "dao-signer/src/interfaces/IAgreementAnchorFactory.sol";
6+
import {AgreementAnchor} from "dao-signer/src/AgreementAnchor.sol";
7+
8+
contract CreateAgreementAnchors is Script {
9+
IAgreementAnchorFactory public constant AGREEMENT_ANCHOR_FACTORY =
10+
IAgreementAnchorFactory(0x5Ef3cCf9eC7E0af61E1767b2EEbB50e052b5Df47);
11+
12+
// TODO: set content hashes and counterparty addresses for DUNI agreements
13+
bytes32 public constant AGREEMENT_ANCHOR_1_CONTENT_HASH = "";
14+
address public constant AGREEMENT_ANCHOR_1_COUNTER_SIGNER = address(0);
15+
bytes32 public constant AGREEMENT_ANCHOR_2_CONTENT_HASH = "";
16+
address public constant AGREEMENT_ANCHOR_2_COUNTER_SIGNER = address(0);
17+
18+
function run() public returns (address, address) {
19+
require(block.chainid == 1, "Not mainnet");
20+
vm.startBroadcast();
21+
address agreementAnchor1 = address(
22+
AGREEMENT_ANCHOR_FACTORY.createAgreementAnchor(
23+
AGREEMENT_ANCHOR_1_CONTENT_HASH, AGREEMENT_ANCHOR_1_COUNTER_SIGNER
24+
)
25+
);
26+
27+
address agreementAnchor2 = address(
28+
AGREEMENT_ANCHOR_FACTORY.createAgreementAnchor(
29+
AGREEMENT_ANCHOR_2_CONTENT_HASH, AGREEMENT_ANCHOR_2_COUNTER_SIGNER
30+
)
31+
);
32+
console2.log("Agreement Anchor 1:", agreementAnchor1);
33+
console2.log("Agreement Anchor 2:", agreementAnchor2);
34+
vm.stopBroadcast();
35+
return (agreementAnchor1, agreementAnchor2);
36+
}
37+
}

0 commit comments

Comments
 (0)