Skip to content

Commit db1fdf3

Browse files
committed
x
1 parent bd24d5c commit db1fdf3

File tree

4 files changed

+34
-30
lines changed

4 files changed

+34
-30
lines changed

contracts/deployments/1.json

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,12 @@
11
{
22
"GENESIS_STATE_ROOT": "0x7f1150ec996e291947d4a9a30a49155b5f042042f841f25db4d41da04cef63f4",
3+
"GOVERNOR": "0x04AEf68a07151b4940bbde042B70ab298D77e85d",
4+
"I_PROVE": "0x51Ae4c6bc32579c782Ce77D575280058BF9409Fa",
35
"PROVE": "0x6BEF15D938d4E72056AC92Ea4bDD0D76B1C4ad29",
6+
"STAKING": "0x9c539310fdAad2EB080587bF52a366cC5615108F",
7+
"STAKING_IMPL": "0xAd729CA02dE58A7a179C6b2BB16657bA759DBD2c",
8+
"VAPP": "0x22B61CC74102A2702E26B25deBAD6cb2dDeB0c07",
9+
"VAPP_IMPL": "0x2272FEd07bbcda3b9A106A6EEdd9939c053BB73b",
410
"VERIFIER": "0x397A5f7f3dBd538f23DE225B51f532c34448dA9B",
511
"VKEY": "0x00379594d327723819f32e812d869de681100f77f766869b8d672072ab73e27c"
612
}

contracts/deployments/11155111.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,8 @@
44
"I_PROVE": "0xda5b610ea2109636a8ce728dB5141c12499feA1B",
55
"PROVE": "0x376099fd6B50B60FE8b24B909827C1795D6e5096",
66
"PROVER": "0x7B7797E652C930A708eF761C93cbf427BA6aEa42",
7-
"STAKING": "0x837D40650aB3b0AA02E7e28238D9FEA73031856C",
7+
"STAKING": "0x33D3D91FD84FA388d1E4C99A2D0Cee6ec73a97c3",
8+
"STAKING_IMPL": "0xAd729CA02dE58A7a179C6b2BB16657bA759DBD2c",
89
"VAPP": "0x26CCcCBfd8474606EF575bbFa67F9654Da604379",
910
"VERIFIER": "0x29A39a8Ecd2473FBcD7bfAA2526Fcb1B1F692Eb1",
1011
"VKEY": "0x004988f252500633b4d3d369b3726d5bdacfbe35236b36eb2d487af3742c905e"

contracts/foundry.toml

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -16,14 +16,10 @@ exclude_lints = ["mixed-case-variable", "mixed-case-function", "screaming-snake-
1616
[profile.deploy]
1717
optimizer = true
1818
optimizer_runs = 100
19-
bytecode_hash = "none"
20-
cbor_metadata = false
2119

2220
[profile.fuzz]
2321
optimizer = true
2422
optimizer_runs = 100
25-
bytecode_hash = "none"
26-
cbor_metadata = false
2723
runs = 10000
2824
seed = "0x1234"
2925

contracts/script/deploy/SuccinctStaking.s.sol

Lines changed: 26 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,21 @@ contract SuccinctStakingScript is BaseScript {
1212
function run() external broadcaster {
1313
// Read config
1414
bytes32 salt = readBytes32("CREATE2_SALT");
15+
16+
// Deploy contract
17+
address STAKING_IMPL = address(new SuccinctStaking{salt: salt}());
18+
address STAKING = address(
19+
SuccinctStaking(payable(address(new ERC1967Proxy{salt: salt}(STAKING_IMPL, ""))))
20+
);
21+
22+
// Write address
23+
writeAddress(KEY, STAKING);
24+
writeAddress(string.concat(KEY, "_IMPL"), STAKING_IMPL);
25+
}
26+
27+
/// @dev Only run this once all of the other contracts are deployed. Script must be ran with OWNER's private key.
28+
function initialize() external broadcaster {
29+
address STAKING = readAddress(KEY);
1530
address OWNER = readAddress("OWNER");
1631
address GOVERNOR = readAddress("GOVERNOR");
1732
address VAPP = readAddress("VAPP");
@@ -23,31 +38,17 @@ contract SuccinctStakingScript is BaseScript {
2338
uint256 UNSTAKE_PERIOD = readUint256("UNSTAKE_PERIOD");
2439
uint256 SLASH_CANCELLATION_PERIOD = readUint256("SLASH_CANCELLATION_PERIOD");
2540

26-
// Encode the initialize function call data
27-
bytes memory initData = abi.encodeCall(
28-
SuccinctStaking.initialize,
29-
(
30-
OWNER,
31-
GOVERNOR,
32-
VAPP,
33-
PROVE,
34-
I_PROVE,
35-
DISPENSER,
36-
MIN_STAKE_AMOUNT,
37-
MAX_UNSTAKE_REQUESTS,
38-
UNSTAKE_PERIOD,
39-
SLASH_CANCELLATION_PERIOD
40-
)
41-
);
42-
43-
// Deploy contract
44-
address STAKING_IMPL = address(new SuccinctStaking{salt: salt}());
45-
address STAKING = address(
46-
SuccinctStaking(payable(address(new ERC1967Proxy{salt: salt}(STAKING_IMPL, initData))))
41+
SuccinctStaking(STAKING).initialize(
42+
OWNER,
43+
GOVERNOR,
44+
VAPP,
45+
PROVE,
46+
I_PROVE,
47+
DISPENSER,
48+
MIN_STAKE_AMOUNT,
49+
MAX_UNSTAKE_REQUESTS,
50+
UNSTAKE_PERIOD,
51+
SLASH_CANCELLATION_PERIOD
4752
);
48-
49-
// Write address
50-
writeAddress(KEY, STAKING);
51-
writeAddress(string.concat(KEY, "_IMPL"), STAKING_IMPL);
5253
}
5354
}

0 commit comments

Comments
 (0)