Skip to content

Commit bb8e64d

Browse files
committed
deployment: second safe deployment
1 parent af56cf2 commit bb8e64d

9 files changed

+2387
-4
lines changed

deploy/6_deploy_safe_staking_contract.ts

Lines changed: 12 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -9,9 +9,11 @@ const getMaxFeeBps = (network: string): number => {
99
return 1000;
1010
case "mainnet_safe":
1111
return 2000; //20% max user fee
12+
case "mainnet_2_safe":
13+
return 2500; //25% max user fee
1214

1315
default:
14-
return 1000;
16+
return 2500;
1517
}
1618
};
1719

@@ -21,9 +23,11 @@ const getMaxOperatorFeeBps = (network: string): number => {
2123
return 10000;
2224
case "mainnet_safe":
2325
return 10000; // Leave the possibility of doing the split onchain in the future
26+
case "mainnet_2_safe":
27+
return 10000; // Leave the possibility of doing the split onchain in the future
2428

2529
default:
26-
return 0;
30+
return 10000;
2731
}
2832
};
2933

@@ -33,9 +37,11 @@ const getFeeBps = (network: string): number => {
3337
return 600;
3438
case "mainnet_safe":
3539
return 600; //6% end-user fee
40+
case "mainnet_2_safe":
41+
return 2000; //20% end-user fee
3642

3743
default:
38-
return 600;
44+
return 2000;
3945
}
4046
};
4147

@@ -45,6 +51,8 @@ const getOperatorFeeBps = (network: string): number => {
4551
return 0;
4652
case "mainnet_safe":
4753
return 0; // at the start all the fees go to the treasury
54+
case "mainnet_2_safe":
55+
return 0; // at the start all the fees go to the treasury
4856

4957
default:
5058
return 0;
@@ -123,7 +131,7 @@ const func: DeployFunction = async function ({
123131
};
124132

125133
func.skip = async function ({ deployments, network }: HardhatRuntimeEnvironment): Promise<boolean> {
126-
const shouldSkip = network.name !== "holesky_dev_safe" && network.name !== "mainnet_safe";
134+
const shouldSkip = ! network.name.endsWith("_safe");
127135
if (shouldSkip) {
128136
console.log("Skipped");
129137
}

deployment.mainnet_2_safe.json

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
{
2+
"name": "mainnet_2_safe",
3+
"chainId": "1",
4+
"contracts": {
5+
"ConsensusLayerFeeDispatcher": "0x56A080FBB34c916054737FFCa1fe9bf1c44ca3bc",
6+
"ExecutionLayerFeeDispatcher": "0x9aDC1a7BA031C36CD8aa648375c5A15D9a56b086",
7+
"FeeRecipient": "0x615E2Bb6B667c5e9D698d582b8916463EC58B5C4",
8+
"StakingContract": "0xbbb56e071f33e020daEB0A1dD2249B8Bbdb69fB8"
9+
},
10+
"namedAccounts": {
11+
"deployer": "0x6C74FDa18Ea90E1C61e800Dd9B4508Ac782e0Dc8",
12+
"admin": "0x60CFAC5cD4aEed165023A81F57A0bc92D7CfEb6E",
13+
"depositContract": "0x00000000219ab540356cBB839Cbe05303d7705Fa",
14+
"treasury": "0xF9beDA1d78916CC89D4B3F6beF092Dc1D302112b"
15+
}
16+
}

deployments/mainnet_2_safe/.chainId

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
1

deployments/mainnet_2_safe/ConsensusLayerFeeDispatcher.json

Lines changed: 241 additions & 0 deletions
Large diffs are not rendered by default.

deployments/mainnet_2_safe/ExecutionLayerFeeDispatcher.json

Lines changed: 241 additions & 0 deletions
Large diffs are not rendered by default.
Lines changed: 169 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,169 @@
1+
{
2+
"address": "0x615E2Bb6B667c5e9D698d582b8916463EC58B5C4",
3+
"abi": [
4+
{
5+
"inputs": [],
6+
"name": "AlreadyInitialized",
7+
"type": "error"
8+
},
9+
{
10+
"stateMutability": "payable",
11+
"type": "fallback"
12+
},
13+
{
14+
"inputs": [],
15+
"name": "getPublicKeyRoot",
16+
"outputs": [
17+
{
18+
"internalType": "bytes32",
19+
"name": "",
20+
"type": "bytes32"
21+
}
22+
],
23+
"stateMutability": "view",
24+
"type": "function"
25+
},
26+
{
27+
"inputs": [],
28+
"name": "getWithdrawer",
29+
"outputs": [
30+
{
31+
"internalType": "address",
32+
"name": "",
33+
"type": "address"
34+
}
35+
],
36+
"stateMutability": "view",
37+
"type": "function"
38+
},
39+
{
40+
"inputs": [
41+
{
42+
"internalType": "address",
43+
"name": "_dispatcher",
44+
"type": "address"
45+
},
46+
{
47+
"internalType": "bytes32",
48+
"name": "_publicKeyRoot",
49+
"type": "bytes32"
50+
}
51+
],
52+
"name": "init",
53+
"outputs": [],
54+
"stateMutability": "nonpayable",
55+
"type": "function"
56+
},
57+
{
58+
"inputs": [],
59+
"name": "withdraw",
60+
"outputs": [],
61+
"stateMutability": "nonpayable",
62+
"type": "function"
63+
},
64+
{
65+
"stateMutability": "payable",
66+
"type": "receive"
67+
}
68+
],
69+
"transactionHash": "0xd0216dd0d9942db03043fcc9a8a4c6ad219c74f3296bb5eaeb895e0a870f5dbd",
70+
"receipt": {
71+
"to": null,
72+
"from": "0x6C74FDa18Ea90E1C61e800Dd9B4508Ac782e0Dc8",
73+
"contractAddress": "0x615E2Bb6B667c5e9D698d582b8916463EC58B5C4",
74+
"transactionIndex": 28,
75+
"gasUsed": "233362",
76+
"logsBloom": "0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000",
77+
"blockHash": "0x2ccf5e39698245e06f12f085e5f332d110d31a17efb866b3417598f0b6244faf",
78+
"transactionHash": "0xd0216dd0d9942db03043fcc9a8a4c6ad219c74f3296bb5eaeb895e0a870f5dbd",
79+
"logs": [],
80+
"blockNumber": 21187165,
81+
"cumulativeGasUsed": "4888153",
82+
"status": 1,
83+
"byzantium": true
84+
},
85+
"args": [],
86+
"numDeployments": 1,
87+
"solcInputHash": "e20c74109a1c61285ef1a2afbbbc70eb",
88+
"metadata": "{\"compiler\":{\"version\":\"0.8.13+commit.abaa5c0e\"},\"language\":\"Solidity\",\"output\":{\"abi\":[{\"inputs\":[],\"name\":\"AlreadyInitialized\",\"type\":\"error\"},{\"stateMutability\":\"payable\",\"type\":\"fallback\"},{\"inputs\":[],\"name\":\"getPublicKeyRoot\",\"outputs\":[{\"internalType\":\"bytes32\",\"name\":\"\",\"type\":\"bytes32\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"getWithdrawer\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"_dispatcher\",\"type\":\"address\"},{\"internalType\":\"bytes32\",\"name\":\"_publicKeyRoot\",\"type\":\"bytes32\"}],\"name\":\"init\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"withdraw\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"stateMutability\":\"payable\",\"type\":\"receive\"}],\"devdoc\":{\"kind\":\"dev\",\"methods\":{\"init(address,bytes32)\":{\"params\":{\"_dispatcher\":\"Address that will handle the fee dispatching\",\"_publicKeyRoot\":\"Public Key root assigned to this receiver\"}},\"withdraw()\":{\"details\":\"Can be called by any wallet as recipients are not parameters\"}},\"version\":1},\"userdoc\":{\"kind\":\"user\",\"methods\":{\"getPublicKeyRoot()\":{\"notice\":\"Retrieve the assigned public key root\"},\"getWithdrawer()\":{\"notice\":\"retrieve the assigned withdrawer\"},\"init(address,bytes32)\":{\"notice\":\"Initializes the receiver\"},\"withdraw()\":{\"notice\":\"Triggers a withdrawal by sending its funds + its public key root to the dispatcher\"}},\"version\":1}},\"settings\":{\"compilationTarget\":{\"src/contracts/FeeRecipient.sol\":\"FeeRecipient\"},\"evmVersion\":\"london\",\"libraries\":{},\"metadata\":{\"bytecodeHash\":\"ipfs\",\"useLiteralContent\":true},\"optimizer\":{\"enabled\":true,\"runs\":10000},\"remappings\":[]},\"sources\":{\"src/contracts/FeeRecipient.sol\":{\"content\":\"//SPDX-License-Identifier: BUSL-1.1\\npragma solidity >=0.8.10;\\n\\nimport \\\"./interfaces/IFeeDispatcher.sol\\\";\\n\\ncontract FeeRecipient {\\n /// @notice Constructor replay prevention\\n bool internal initialized;\\n /// @notice Address where funds are sent to be dispatched\\n IFeeDispatcher internal dispatcher;\\n /// @notice Public Key root assigned to this receiver\\n bytes32 internal publicKeyRoot;\\n\\n error AlreadyInitialized();\\n\\n /// @notice Initializes the receiver\\n /// @param _dispatcher Address that will handle the fee dispatching\\n /// @param _publicKeyRoot Public Key root assigned to this receiver\\n function init(address _dispatcher, bytes32 _publicKeyRoot) external {\\n if (initialized) {\\n revert AlreadyInitialized();\\n }\\n initialized = true;\\n dispatcher = IFeeDispatcher(_dispatcher);\\n publicKeyRoot = _publicKeyRoot;\\n }\\n\\n /// @notice Empty calldata fallback\\n receive() external payable {}\\n\\n /// @notice Non-empty calldata fallback\\n fallback() external payable {}\\n\\n /// @notice Triggers a withdrawal by sending its funds + its public key root to the dispatcher\\n /// @dev Can be called by any wallet as recipients are not parameters\\n function withdraw() external {\\n dispatcher.dispatch{value: address(this).balance}(publicKeyRoot);\\n }\\n\\n /// @notice Retrieve the assigned public key root\\n function getPublicKeyRoot() external view returns (bytes32) {\\n return publicKeyRoot;\\n }\\n\\n /// @notice retrieve the assigned withdrawer\\n function getWithdrawer() external view returns (address) {\\n return dispatcher.getWithdrawer(publicKeyRoot);\\n }\\n}\\n\",\"keccak256\":\"0xf788bf2e0e2112b0322904479f0704ac8fb23601f760326fec7f564ec0101090\",\"license\":\"BUSL-1.1\"},\"src/contracts/interfaces/IFeeDispatcher.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity >=0.8.10;\\n\\ninterface IFeeDispatcher {\\n function dispatch(bytes32 _publicKeyRoot) external payable;\\n\\n function getWithdrawer(bytes32 _publicKeyRoot) external view returns (address);\\n}\\n\",\"keccak256\":\"0x75efa5a697b32235188a62f730b7ab2a2fc5c422a93010aa0b18e93ea1bade45\",\"license\":\"MIT\"}},\"version\":1}",
89+
"bytecode": "0x608060405234801561001057600080fd5b50610348806100206000396000f3fe6080604052600436106100405760003560e01c80632cc0b254146100495780633ccfd60b146100695780637d38d21f1461007e5780637f763702146100bd57005b3661004757005b005b34801561005557600080fd5b506100476100643660046102c2565b6100db565b34801561007557600080fd5b5061004761016c565b34801561008a57600080fd5b506100936101fc565b60405173ffffffffffffffffffffffffffffffffffffffff90911681526020015b60405180910390f35b3480156100c957600080fd5b506001546040519081526020016100b4565b60005460ff1615610118576040517f0dc149f000000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6000805473ffffffffffffffffffffffffffffffffffffffff909316610100027fffffffffffffffffffffff0000000000000000000000000000000000000000009093169290921760019081179092559055565b6000546001546040517fce120650000000000000000000000000000000000000000000000000000000008152600481019190915261010090910473ffffffffffffffffffffffffffffffffffffffff169063ce1206509047906024016000604051808303818588803b1580156101e157600080fd5b505af11580156101f5573d6000803e3d6000fd5b5050505050565b600080546001546040517f27de9016000000000000000000000000000000000000000000000000000000008152600481019190915261010090910473ffffffffffffffffffffffffffffffffffffffff16906327de901690602401602060405180830381865afa158015610274573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061029891906102ee565b905090565b73ffffffffffffffffffffffffffffffffffffffff811681146102bf57600080fd5b50565b600080604083850312156102d557600080fd5b82356102e08161029d565b946020939093013593505050565b60006020828403121561030057600080fd5b815161030b8161029d565b939250505056fea2646970667358221220b126dc994bed0492fb480c2169ce4878eff8e5f378432ddaf44ae3ceeb35a64064736f6c634300080d0033",
90+
"deployedBytecode": "0x6080604052600436106100405760003560e01c80632cc0b254146100495780633ccfd60b146100695780637d38d21f1461007e5780637f763702146100bd57005b3661004757005b005b34801561005557600080fd5b506100476100643660046102c2565b6100db565b34801561007557600080fd5b5061004761016c565b34801561008a57600080fd5b506100936101fc565b60405173ffffffffffffffffffffffffffffffffffffffff90911681526020015b60405180910390f35b3480156100c957600080fd5b506001546040519081526020016100b4565b60005460ff1615610118576040517f0dc149f000000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6000805473ffffffffffffffffffffffffffffffffffffffff909316610100027fffffffffffffffffffffff0000000000000000000000000000000000000000009093169290921760019081179092559055565b6000546001546040517fce120650000000000000000000000000000000000000000000000000000000008152600481019190915261010090910473ffffffffffffffffffffffffffffffffffffffff169063ce1206509047906024016000604051808303818588803b1580156101e157600080fd5b505af11580156101f5573d6000803e3d6000fd5b5050505050565b600080546001546040517f27de9016000000000000000000000000000000000000000000000000000000008152600481019190915261010090910473ffffffffffffffffffffffffffffffffffffffff16906327de901690602401602060405180830381865afa158015610274573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061029891906102ee565b905090565b73ffffffffffffffffffffffffffffffffffffffff811681146102bf57600080fd5b50565b600080604083850312156102d557600080fd5b82356102e08161029d565b946020939093013593505050565b60006020828403121561030057600080fd5b815161030b8161029d565b939250505056fea2646970667358221220b126dc994bed0492fb480c2169ce4878eff8e5f378432ddaf44ae3ceeb35a64064736f6c634300080d0033",
91+
"devdoc": {
92+
"kind": "dev",
93+
"methods": {
94+
"init(address,bytes32)": {
95+
"params": {
96+
"_dispatcher": "Address that will handle the fee dispatching",
97+
"_publicKeyRoot": "Public Key root assigned to this receiver"
98+
}
99+
},
100+
"withdraw()": {
101+
"details": "Can be called by any wallet as recipients are not parameters"
102+
}
103+
},
104+
"version": 1
105+
},
106+
"userdoc": {
107+
"kind": "user",
108+
"methods": {
109+
"getPublicKeyRoot()": {
110+
"notice": "Retrieve the assigned public key root"
111+
},
112+
"getWithdrawer()": {
113+
"notice": "retrieve the assigned withdrawer"
114+
},
115+
"init(address,bytes32)": {
116+
"notice": "Initializes the receiver"
117+
},
118+
"withdraw()": {
119+
"notice": "Triggers a withdrawal by sending its funds + its public key root to the dispatcher"
120+
}
121+
},
122+
"version": 1
123+
},
124+
"storageLayout": {
125+
"storage": [
126+
{
127+
"astId": 1850,
128+
"contract": "src/contracts/FeeRecipient.sol:FeeRecipient",
129+
"label": "initialized",
130+
"offset": 0,
131+
"slot": "0",
132+
"type": "t_bool"
133+
},
134+
{
135+
"astId": 1854,
136+
"contract": "src/contracts/FeeRecipient.sol:FeeRecipient",
137+
"label": "dispatcher",
138+
"offset": 1,
139+
"slot": "0",
140+
"type": "t_contract(IFeeDispatcher)5045"
141+
},
142+
{
143+
"astId": 1857,
144+
"contract": "src/contracts/FeeRecipient.sol:FeeRecipient",
145+
"label": "publicKeyRoot",
146+
"offset": 0,
147+
"slot": "1",
148+
"type": "t_bytes32"
149+
}
150+
],
151+
"types": {
152+
"t_bool": {
153+
"encoding": "inplace",
154+
"label": "bool",
155+
"numberOfBytes": "1"
156+
},
157+
"t_bytes32": {
158+
"encoding": "inplace",
159+
"label": "bytes32",
160+
"numberOfBytes": "32"
161+
},
162+
"t_contract(IFeeDispatcher)5045": {
163+
"encoding": "inplace",
164+
"label": "contract IFeeDispatcher",
165+
"numberOfBytes": "20"
166+
}
167+
}
168+
}
169+
}

0 commit comments

Comments
 (0)