Skip to content

Commit 127f84a

Browse files
nicholaspaipxrl
andauthored
feat: Deploy new SpokePool implementations (#461)
* feat: Remove non-USS functionality from SpokePool This PR showcases how we will remove all non-USS functionality in the spoke pools once all non-USS deposits are fills, fills are refunded, and roots are executed. This PR reduces the bytecode significantly and means we can use the full optimizer runs setting for compiling these new contracts * Remove Deposit and SlowRelay tests Signed-off-by: nicholaspai <npai.nyc@gmail.com> * WIP * WIP * Update utils.ts * Add back Deposit functions * add back legacy deposit unit tests * Update hardhat.config.ts * fix tests * Update package.json * fix Signed-off-by: nicholaspai <npai.nyc@gmail.com> * Add depositUSSNow, replace error strings with custom error types, fix tests * Fix * Fix tests * Update SpokePool.Deposit.ts * feat: Remove all "USS" references in contracts This PR implements a simple find-and-replace of "USS" with "V3" to make it more clear that this is a new version of the Across protocol that supports new features such as cross-chain token-swaps. USS is an internal code name for "Universal Settlement Service" but this is not neccessariy the language that will be used to market this product. So, renaming to V3 makes these contract changes more of a blank slate. * Replace USS with V3 * Remove UBA references * fix tests * merge master * fix tests * change depositV3Now to take in exclusivity deadline * Fix * Update Ovm_SpokePool.sol * Update Ovm_SpokePool.sol * add back depositfor, remove special polygon spoke pool compiler rules * update hardhat-zksolc * Update test/SpokePool.Deposit.ts Co-authored-by: Paul <108695806+pxrl@users.noreply.github.com> * Update hardhat.config.ts * feat: Deploy new SpokePool implementations - ZkSync: https://explorer.zksync.io/address/0x0DA0a157D40B3348285F1a88a329c9387e51bCF9#contract - Polygon: https://polygonscan.com/address/0x9f444346FD853084158ce9cfa7e062BaBd51a577#code - Optimism: https://optimistic.etherscan.io/address/0x5226a5D010F24F0df089963E94ce88E4c87EB53b#code - Base: https://basescan.org/address/0x053Dc4a08302F11d13d8D2B87D8F3c9c28cEDEb4#code - Arbitrum: https://arbiscan.io/address/0x53dcC21887d54f41B049724b73a2195CE7343873#code - Ethereum: https://etherscan.io/address/0xa4D3535f33549749Fb97fA42903AC80F6fb54af6#code * Update storage layout files * Update storageLayout.sh --------- Signed-off-by: nicholaspai <npai.nyc@gmail.com> Co-authored-by: Paul <108695806+pxrl@users.noreply.github.com>
1 parent 480d0fd commit 127f84a

15 files changed

+5367
-3797
lines changed

deployments/arbitrum/Arbitrum_SpokePool.json

Lines changed: 729 additions & 594 deletions
Large diffs are not rendered by default.

deployments/arbitrum/solcInputs/753e9b1a46936a33e4136a61d84a1140.json

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

deployments/base/Base_SpokePool.json

Lines changed: 768 additions & 594 deletions
Large diffs are not rendered by default.

deployments/mainnet/Ethereum_SpokePool.json

Lines changed: 721 additions & 594 deletions
Large diffs are not rendered by default.

deployments/optimism/Optimism_SpokePool.json

Lines changed: 768 additions & 594 deletions
Large diffs are not rendered by default.

deployments/polygon/Polygon_SpokePool.json

Lines changed: 769 additions & 594 deletions
Large diffs are not rendered by default.

deployments/zksync/ZkSync_SpokePool.json

Lines changed: 728 additions & 595 deletions
Large diffs are not rendered by default.

deployments/zksync/solcInputs/71a38f1077a1fcb5bb3a2911c1bd2070.json

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

scripts/storageLayout.sh

Lines changed: 13 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -10,15 +10,24 @@ fi
1010
echo "Creating a storage layout snapshot of the $CONTRACT contract at ./storage-layouts/proposed.$CONTRACT.json"
1111
echo "⏳ This can take a few minutes to complete if you haven't run a forge command recently"
1212
touch ./storage-layouts/proposed.$CONTRACT.json
13-
forge inspect $CONTRACT storagelayout > ./storage-layouts/proposed.$CONTRACT.json
14-
echo "✅ Done!"
1513

16-
read -r -p "Do you want to run a diff on the proposed storage layout with the deployed one? [y/N] " response
14+
read -r -p "Do you want to overwrite $CONTRACT.json? [y/N] " response
1715
case "$response" in
1816
[yY][eE][sS]|[yY])
19-
vim -d ./storage-layouts/proposed.$CONTRACT.json ./storage-layouts/$CONTRACT.json
17+
forge inspect $CONTRACT storagelayout > ./storage-layouts/$CONTRACT.json
18+
echo "✅ Done!"
2019
;;
2120
*)
21+
forge inspect $CONTRACT storagelayout > ./storage-layouts/proposed.$CONTRACT.json
22+
echo "✅ Done!"
23+
read -r -p "Do you want to run a diff on the proposed storage layout with the deployed one? [y/N] " response
24+
case "$response" in
25+
[yY][eE][sS]|[yY])
26+
vim -d ./storage-layouts/proposed.$CONTRACT.json ./storage-layouts/$CONTRACT.json
27+
;;
28+
*)
29+
;;
30+
esac
2231
;;
2332
esac
2433

storage-layouts/Arbitrum_SpokePool.json

Lines changed: 34 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -1,199 +1,199 @@
11
{
22
"storage": [
33
{
4-
"astId": 42749,
4+
"astId": 42110,
55
"contract": "contracts/Arbitrum_SpokePool.sol:Arbitrum_SpokePool",
66
"label": "_initialized",
77
"offset": 0,
88
"slot": "0",
99
"type": "t_uint8"
1010
},
1111
{
12-
"astId": 42752,
12+
"astId": 42113,
1313
"contract": "contracts/Arbitrum_SpokePool.sol:Arbitrum_SpokePool",
1414
"label": "_initializing",
1515
"offset": 1,
1616
"slot": "0",
1717
"type": "t_bool"
1818
},
1919
{
20-
"astId": 42731,
20+
"astId": 42092,
2121
"contract": "contracts/Arbitrum_SpokePool.sol:Arbitrum_SpokePool",
2222
"label": "__gap",
2323
"offset": 0,
2424
"slot": "1",
2525
"type": "t_array(t_uint256)50_storage"
2626
},
2727
{
28-
"astId": 43046,
28+
"astId": 42407,
2929
"contract": "contracts/Arbitrum_SpokePool.sol:Arbitrum_SpokePool",
3030
"label": "__gap",
3131
"offset": 0,
3232
"slot": "51",
3333
"type": "t_array(t_uint256)50_storage"
3434
},
3535
{
36-
"astId": 43061,
36+
"astId": 42422,
3737
"contract": "contracts/Arbitrum_SpokePool.sol:Arbitrum_SpokePool",
3838
"label": "_status",
3939
"offset": 0,
4040
"slot": "101",
4141
"type": "t_uint256"
4242
},
4343
{
44-
"astId": 43130,
44+
"astId": 42491,
4545
"contract": "contracts/Arbitrum_SpokePool.sol:Arbitrum_SpokePool",
4646
"label": "__gap",
4747
"offset": 0,
4848
"slot": "102",
4949
"type": "t_array(t_uint256)49_storage"
5050
},
5151
{
52-
"astId": 15466,
52+
"astId": 14827,
5353
"contract": "contracts/Arbitrum_SpokePool.sol:Arbitrum_SpokePool",
5454
"label": "__gap",
5555
"offset": 0,
5656
"slot": "151",
5757
"type": "t_array(t_uint256)1000_storage"
5858
},
5959
{
60-
"astId": 15271,
60+
"astId": 14632,
6161
"contract": "contracts/Arbitrum_SpokePool.sol:Arbitrum_SpokePool",
6262
"label": "_HASHED_NAME",
6363
"offset": 0,
6464
"slot": "1151",
6565
"type": "t_bytes32"
6666
},
6767
{
68-
"astId": 15273,
68+
"astId": 14634,
6969
"contract": "contracts/Arbitrum_SpokePool.sol:Arbitrum_SpokePool",
7070
"label": "_HASHED_VERSION",
7171
"offset": 0,
7272
"slot": "1152",
7373
"type": "t_bytes32"
7474
},
7575
{
76-
"astId": 15372,
76+
"astId": 14733,
7777
"contract": "contracts/Arbitrum_SpokePool.sol:Arbitrum_SpokePool",
7878
"label": "__gap",
7979
"offset": 0,
8080
"slot": "1153",
8181
"type": "t_array(t_uint256)1000_storage"
8282
},
8383
{
84-
"astId": 5508,
84+
"astId": 5482,
8585
"contract": "contracts/Arbitrum_SpokePool.sol:Arbitrum_SpokePool",
8686
"label": "crossDomainAdmin",
8787
"offset": 0,
8888
"slot": "2153",
8989
"type": "t_address"
9090
},
9191
{
92-
"astId": 5510,
92+
"astId": 5484,
9393
"contract": "contracts/Arbitrum_SpokePool.sol:Arbitrum_SpokePool",
9494
"label": "hubPool",
9595
"offset": 0,
9696
"slot": "2154",
9797
"type": "t_address"
9898
},
9999
{
100-
"astId": 5513,
100+
"astId": 5487,
101101
"contract": "contracts/Arbitrum_SpokePool.sol:Arbitrum_SpokePool",
102102
"label": "DEPRECATED_wrappedNativeToken",
103103
"offset": 0,
104104
"slot": "2155",
105-
"type": "t_contract(WETH9Interface)12711"
105+
"type": "t_contract(WETH9Interface)11748"
106106
},
107107
{
108-
"astId": 5515,
108+
"astId": 5489,
109109
"contract": "contracts/Arbitrum_SpokePool.sol:Arbitrum_SpokePool",
110110
"label": "DEPRECATED_depositQuoteTimeBuffer",
111111
"offset": 20,
112112
"slot": "2155",
113113
"type": "t_uint32"
114114
},
115115
{
116-
"astId": 5517,
116+
"astId": 5491,
117117
"contract": "contracts/Arbitrum_SpokePool.sol:Arbitrum_SpokePool",
118118
"label": "numberOfDeposits",
119119
"offset": 24,
120120
"slot": "2155",
121121
"type": "t_uint32"
122122
},
123123
{
124-
"astId": 5519,
124+
"astId": 5493,
125125
"contract": "contracts/Arbitrum_SpokePool.sol:Arbitrum_SpokePool",
126126
"label": "pausedFills",
127127
"offset": 28,
128128
"slot": "2155",
129129
"type": "t_bool"
130130
},
131131
{
132-
"astId": 5521,
132+
"astId": 5495,
133133
"contract": "contracts/Arbitrum_SpokePool.sol:Arbitrum_SpokePool",
134134
"label": "pausedDeposits",
135135
"offset": 29,
136136
"slot": "2155",
137137
"type": "t_bool"
138138
},
139139
{
140-
"astId": 5525,
140+
"astId": 5499,
141141
"contract": "contracts/Arbitrum_SpokePool.sol:Arbitrum_SpokePool",
142142
"label": "rootBundles",
143143
"offset": 0,
144144
"slot": "2156",
145-
"type": "t_array(t_struct(RootBundle)13015_storage)dyn_storage"
145+
"type": "t_array(t_struct(RootBundle)12025_storage)dyn_storage"
146146
},
147147
{
148-
"astId": 5531,
148+
"astId": 5505,
149149
"contract": "contracts/Arbitrum_SpokePool.sol:Arbitrum_SpokePool",
150150
"label": "enabledDepositRoutes",
151151
"offset": 0,
152152
"slot": "2157",
153153
"type": "t_mapping(t_address,t_mapping(t_uint256,t_bool))"
154154
},
155155
{
156-
"astId": 5535,
156+
"astId": 5509,
157157
"contract": "contracts/Arbitrum_SpokePool.sol:Arbitrum_SpokePool",
158158
"label": "DEPRECATED_relayFills",
159159
"offset": 0,
160160
"slot": "2158",
161161
"type": "t_mapping(t_bytes32,t_uint256)"
162162
},
163163
{
164-
"astId": 5539,
164+
"astId": 5513,
165165
"contract": "contracts/Arbitrum_SpokePool.sol:Arbitrum_SpokePool",
166166
"label": "DEPRECATED_fillCounter",
167167
"offset": 0,
168168
"slot": "2159",
169169
"type": "t_mapping(t_address,t_uint256)"
170170
},
171171
{
172-
"astId": 5543,
172+
"astId": 5517,
173173
"contract": "contracts/Arbitrum_SpokePool.sol:Arbitrum_SpokePool",
174174
"label": "DEPRECATED_depositCounter",
175175
"offset": 0,
176176
"slot": "2160",
177177
"type": "t_mapping(t_address,t_uint256)"
178178
},
179179
{
180-
"astId": 5547,
180+
"astId": 5521,
181181
"contract": "contracts/Arbitrum_SpokePool.sol:Arbitrum_SpokePool",
182182
"label": "DEPRECATED_refundsRequested",
183183
"offset": 0,
184184
"slot": "2161",
185185
"type": "t_mapping(t_bytes32,t_uint256)"
186186
},
187187
{
188-
"astId": 5551,
188+
"astId": 5525,
189189
"contract": "contracts/Arbitrum_SpokePool.sol:Arbitrum_SpokePool",
190190
"label": "fillStatuses",
191191
"offset": 0,
192192
"slot": "2162",
193193
"type": "t_mapping(t_bytes32,t_uint256)"
194194
},
195195
{
196-
"astId": 8363,
196+
"astId": 7342,
197197
"contract": "contracts/Arbitrum_SpokePool.sol:Arbitrum_SpokePool",
198198
"label": "__gap",
199199
"offset": 0,
@@ -223,11 +223,11 @@
223223
"label": "address",
224224
"numberOfBytes": "20"
225225
},
226-
"t_array(t_struct(RootBundle)13015_storage)dyn_storage": {
226+
"t_array(t_struct(RootBundle)12025_storage)dyn_storage": {
227227
"encoding": "dynamic_array",
228228
"label": "struct SpokePoolInterface.RootBundle[]",
229229
"numberOfBytes": "32",
230-
"base": "t_struct(RootBundle)13015_storage"
230+
"base": "t_struct(RootBundle)12025_storage"
231231
},
232232
"t_array(t_uint256)1000_storage": {
233233
"encoding": "inplace",
@@ -263,7 +263,7 @@
263263
"label": "bytes32",
264264
"numberOfBytes": "32"
265265
},
266-
"t_contract(WETH9Interface)12711": {
266+
"t_contract(WETH9Interface)11748": {
267267
"encoding": "inplace",
268268
"label": "contract WETH9Interface",
269269
"numberOfBytes": "20"
@@ -310,29 +310,29 @@
310310
"numberOfBytes": "32",
311311
"value": "t_uint256"
312312
},
313-
"t_struct(RootBundle)13015_storage": {
313+
"t_struct(RootBundle)12025_storage": {
314314
"encoding": "inplace",
315315
"label": "struct SpokePoolInterface.RootBundle",
316316
"numberOfBytes": "96",
317317
"members": [
318318
{
319-
"astId": 13008,
319+
"astId": 12018,
320320
"contract": "contracts/Arbitrum_SpokePool.sol:Arbitrum_SpokePool",
321321
"label": "slowRelayRoot",
322322
"offset": 0,
323323
"slot": "0",
324324
"type": "t_bytes32"
325325
},
326326
{
327-
"astId": 13010,
327+
"astId": 12020,
328328
"contract": "contracts/Arbitrum_SpokePool.sol:Arbitrum_SpokePool",
329329
"label": "relayerRefundRoot",
330330
"offset": 0,
331331
"slot": "1",
332332
"type": "t_bytes32"
333333
},
334334
{
335-
"astId": 13014,
335+
"astId": 12024,
336336
"contract": "contracts/Arbitrum_SpokePool.sol:Arbitrum_SpokePool",
337337
"label": "claimedBitmap",
338338
"offset": 0,

0 commit comments

Comments
 (0)