@keep-network/tbtc-v2 1.6.0-dev.17 → 1.6.0-dev.18
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/artifacts/BLS.json +1 -1
- package/artifacts/Bank.json +2 -2
- package/artifacts/BeaconAuthorization.json +1 -1
- package/artifacts/BeaconDkg.json +1 -1
- package/artifacts/BeaconDkgValidator.json +1 -1
- package/artifacts/BeaconInactivity.json +1 -1
- package/artifacts/BeaconSortitionPool.json +3 -3
- package/artifacts/Bridge.json +5 -5
- package/artifacts/BridgeGovernance.json +2 -2
- package/artifacts/BridgeGovernanceParameters.json +1 -1
- package/artifacts/Deposit.json +1 -1
- package/artifacts/DepositSweep.json +1 -1
- package/artifacts/DonationVault.json +1 -1
- package/artifacts/EcdsaDkgValidator.json +1 -1
- package/artifacts/EcdsaInactivity.json +1 -1
- package/artifacts/EcdsaSortitionPool.json +3 -3
- package/artifacts/Fraud.json +1 -1
- package/artifacts/LightRelay.json +2 -2
- package/artifacts/LightRelayMaintainerProxy.json +2 -2
- package/artifacts/MaintainerProxy.json +2 -2
- package/artifacts/MovingFunds.json +1 -1
- package/artifacts/NuCypherToken.json +2 -2
- package/artifacts/RandomBeacon.json +2 -2
- package/artifacts/RandomBeaconChaosnet.json +2 -2
- package/artifacts/RandomBeaconGovernance.json +2 -2
- package/artifacts/Redemption.json +1 -1
- package/artifacts/ReimbursementPool.json +2 -2
- package/artifacts/T.json +2 -2
- package/artifacts/TBTC.json +2 -2
- package/artifacts/TBTCToken.json +2 -2
- package/artifacts/TBTCVault.json +2 -2
- package/artifacts/TokenStaking.json +1 -1
- package/artifacts/TokenholderGovernor.json +9 -9
- package/artifacts/TokenholderTimelock.json +8 -8
- package/artifacts/VendingMachine.json +2 -2
- package/artifacts/VendingMachineNuCypher.json +1 -1
- package/artifacts/VendingMachineV2.json +2 -2
- package/artifacts/VendingMachineV3.json +2 -2
- package/artifacts/WalletProposalValidator.json +1 -1
- package/artifacts/WalletRegistry.json +5 -5
- package/artifacts/WalletRegistryGovernance.json +2 -2
- package/artifacts/Wallets.json +1 -1
- package/build/contracts/test/BankStub.sol/BankStub.dbg.json +4 -0
- package/build/contracts/test/BankStub.sol/BankStub.json +555 -0
- package/build/contracts/test/BridgeStub.sol/BridgeStub.dbg.json +4 -0
- package/build/contracts/test/BridgeStub.sol/BridgeStub.json +3318 -0
- package/build/contracts/test/HeartbeatStub.sol/HeartbeatStub.dbg.json +4 -0
- package/build/contracts/test/HeartbeatStub.sol/HeartbeatStub.json +30 -0
- package/build/contracts/test/LightRelayStub.sol/LightRelayStub.dbg.json +4 -0
- package/build/contracts/test/LightRelayStub.sol/LightRelayStub.json +467 -0
- package/build/contracts/test/ReceiveApprovalStub.sol/ReceiveApprovalStub.dbg.json +4 -0
- package/build/contracts/test/ReceiveApprovalStub.sol/ReceiveApprovalStub.json +96 -0
- package/build/contracts/test/SepoliaLightRelay.sol/SepoliaLightRelay.dbg.json +4 -0
- package/build/contracts/test/SepoliaLightRelay.sol/SepoliaLightRelay.json +456 -0
- package/build/contracts/test/SystemTestRelay.sol/SystemTestRelay.dbg.json +4 -0
- package/build/contracts/test/SystemTestRelay.sol/SystemTestRelay.json +89 -0
- package/build/contracts/test/TestBitcoinTx.sol/TestBitcoinTx.dbg.json +4 -0
- package/build/contracts/test/TestBitcoinTx.sol/TestBitcoinTx.json +102 -0
- package/build/contracts/test/TestERC20.sol/TestERC20.dbg.json +4 -0
- package/build/contracts/test/TestERC20.sol/TestERC20.json +508 -0
- package/build/contracts/test/TestERC721.sol/TestERC721.dbg.json +4 -0
- package/build/contracts/test/TestERC721.sol/TestERC721.json +390 -0
- package/build/contracts/test/TestEcdsaLib.sol/TestEcdsaLib.dbg.json +4 -0
- package/build/contracts/test/TestEcdsaLib.sol/TestEcdsaLib.json +35 -0
- package/build/contracts/test/TestTBTCDepositor.sol/MockBridge.dbg.json +4 -0
- package/build/contracts/test/TestTBTCDepositor.sol/MockBridge.json +224 -0
- package/build/contracts/test/TestTBTCDepositor.sol/MockTBTCVault.dbg.json +4 -0
- package/build/contracts/test/TestTBTCDepositor.sol/MockTBTCVault.json +87 -0
- package/build/contracts/test/TestTBTCDepositor.sol/TestTBTCDepositor.dbg.json +4 -0
- package/build/contracts/test/TestTBTCDepositor.sol/TestTBTCDepositor.json +283 -0
- package/build/contracts/test/WormholeBridgeStub.sol/WormholeBridgeStub.dbg.json +4 -0
- package/build/contracts/test/WormholeBridgeStub.sol/WormholeBridgeStub.json +372 -0
- package/contracts/test/BankStub.sol +11 -0
- package/contracts/test/BridgeStub.sol +174 -0
- package/contracts/test/HeartbeatStub.sol +16 -0
- package/contracts/test/LightRelayStub.sol +15 -0
- package/contracts/test/ReceiveApprovalStub.sol +33 -0
- package/contracts/test/SepoliaLightRelay.sol +48 -0
- package/contracts/test/SystemTestRelay.sol +57 -0
- package/contracts/test/TestBitcoinTx.sol +24 -0
- package/contracts/test/TestERC20.sol +12 -0
- package/contracts/test/TestERC721.sol +16 -0
- package/contracts/test/TestEcdsaLib.sol +17 -0
- package/contracts/test/TestTBTCDepositor.sol +196 -0
- package/contracts/test/WormholeBridgeStub.sol +125 -0
- package/package.json +1 -2
|
@@ -0,0 +1,372 @@
|
|
|
1
|
+
{
|
|
2
|
+
"_format": "hh-sol-artifact-1",
|
|
3
|
+
"contractName": "WormholeBridgeStub",
|
|
4
|
+
"sourceName": "contracts/test/WormholeBridgeStub.sol",
|
|
5
|
+
"abi": [
|
|
6
|
+
{
|
|
7
|
+
"inputs": [
|
|
8
|
+
{
|
|
9
|
+
"internalType": "contract TestERC20",
|
|
10
|
+
"name": "_wormholeToken",
|
|
11
|
+
"type": "address"
|
|
12
|
+
}
|
|
13
|
+
],
|
|
14
|
+
"stateMutability": "nonpayable",
|
|
15
|
+
"type": "constructor"
|
|
16
|
+
},
|
|
17
|
+
{
|
|
18
|
+
"anonymous": false,
|
|
19
|
+
"inputs": [
|
|
20
|
+
{
|
|
21
|
+
"indexed": false,
|
|
22
|
+
"internalType": "bytes",
|
|
23
|
+
"name": "encodedVm",
|
|
24
|
+
"type": "bytes"
|
|
25
|
+
}
|
|
26
|
+
],
|
|
27
|
+
"name": "WormholeBridgeStub_completeTransferWithPayload",
|
|
28
|
+
"type": "event"
|
|
29
|
+
},
|
|
30
|
+
{
|
|
31
|
+
"anonymous": false,
|
|
32
|
+
"inputs": [
|
|
33
|
+
{
|
|
34
|
+
"indexed": false,
|
|
35
|
+
"internalType": "address",
|
|
36
|
+
"name": "token",
|
|
37
|
+
"type": "address"
|
|
38
|
+
},
|
|
39
|
+
{
|
|
40
|
+
"indexed": false,
|
|
41
|
+
"internalType": "uint256",
|
|
42
|
+
"name": "amount",
|
|
43
|
+
"type": "uint256"
|
|
44
|
+
},
|
|
45
|
+
{
|
|
46
|
+
"indexed": false,
|
|
47
|
+
"internalType": "uint16",
|
|
48
|
+
"name": "recipientChain",
|
|
49
|
+
"type": "uint16"
|
|
50
|
+
},
|
|
51
|
+
{
|
|
52
|
+
"indexed": false,
|
|
53
|
+
"internalType": "bytes32",
|
|
54
|
+
"name": "recipient",
|
|
55
|
+
"type": "bytes32"
|
|
56
|
+
},
|
|
57
|
+
{
|
|
58
|
+
"indexed": false,
|
|
59
|
+
"internalType": "uint256",
|
|
60
|
+
"name": "arbiterFee",
|
|
61
|
+
"type": "uint256"
|
|
62
|
+
},
|
|
63
|
+
{
|
|
64
|
+
"indexed": false,
|
|
65
|
+
"internalType": "uint32",
|
|
66
|
+
"name": "nonce",
|
|
67
|
+
"type": "uint32"
|
|
68
|
+
}
|
|
69
|
+
],
|
|
70
|
+
"name": "WormholeBridgeStub_transferTokens",
|
|
71
|
+
"type": "event"
|
|
72
|
+
},
|
|
73
|
+
{
|
|
74
|
+
"anonymous": false,
|
|
75
|
+
"inputs": [
|
|
76
|
+
{
|
|
77
|
+
"indexed": false,
|
|
78
|
+
"internalType": "address",
|
|
79
|
+
"name": "token",
|
|
80
|
+
"type": "address"
|
|
81
|
+
},
|
|
82
|
+
{
|
|
83
|
+
"indexed": false,
|
|
84
|
+
"internalType": "uint256",
|
|
85
|
+
"name": "amount",
|
|
86
|
+
"type": "uint256"
|
|
87
|
+
},
|
|
88
|
+
{
|
|
89
|
+
"indexed": false,
|
|
90
|
+
"internalType": "uint16",
|
|
91
|
+
"name": "recipientChain",
|
|
92
|
+
"type": "uint16"
|
|
93
|
+
},
|
|
94
|
+
{
|
|
95
|
+
"indexed": false,
|
|
96
|
+
"internalType": "bytes32",
|
|
97
|
+
"name": "recipient",
|
|
98
|
+
"type": "bytes32"
|
|
99
|
+
},
|
|
100
|
+
{
|
|
101
|
+
"indexed": false,
|
|
102
|
+
"internalType": "uint32",
|
|
103
|
+
"name": "nonce",
|
|
104
|
+
"type": "uint32"
|
|
105
|
+
},
|
|
106
|
+
{
|
|
107
|
+
"indexed": false,
|
|
108
|
+
"internalType": "bytes",
|
|
109
|
+
"name": "payload",
|
|
110
|
+
"type": "bytes"
|
|
111
|
+
}
|
|
112
|
+
],
|
|
113
|
+
"name": "WormholeBridgeStub_transferTokensWithPayload",
|
|
114
|
+
"type": "event"
|
|
115
|
+
},
|
|
116
|
+
{
|
|
117
|
+
"inputs": [
|
|
118
|
+
{
|
|
119
|
+
"internalType": "bytes",
|
|
120
|
+
"name": "encodedVm",
|
|
121
|
+
"type": "bytes"
|
|
122
|
+
}
|
|
123
|
+
],
|
|
124
|
+
"name": "completeTransferWithPayload",
|
|
125
|
+
"outputs": [
|
|
126
|
+
{
|
|
127
|
+
"internalType": "bytes",
|
|
128
|
+
"name": "",
|
|
129
|
+
"type": "bytes"
|
|
130
|
+
}
|
|
131
|
+
],
|
|
132
|
+
"stateMutability": "nonpayable",
|
|
133
|
+
"type": "function"
|
|
134
|
+
},
|
|
135
|
+
{
|
|
136
|
+
"inputs": [
|
|
137
|
+
{
|
|
138
|
+
"internalType": "address",
|
|
139
|
+
"name": "to",
|
|
140
|
+
"type": "address"
|
|
141
|
+
},
|
|
142
|
+
{
|
|
143
|
+
"internalType": "uint256",
|
|
144
|
+
"name": "amount",
|
|
145
|
+
"type": "uint256"
|
|
146
|
+
}
|
|
147
|
+
],
|
|
148
|
+
"name": "mintWormholeToken",
|
|
149
|
+
"outputs": [],
|
|
150
|
+
"stateMutability": "nonpayable",
|
|
151
|
+
"type": "function"
|
|
152
|
+
},
|
|
153
|
+
{
|
|
154
|
+
"inputs": [
|
|
155
|
+
{
|
|
156
|
+
"internalType": "bytes",
|
|
157
|
+
"name": "encoded",
|
|
158
|
+
"type": "bytes"
|
|
159
|
+
}
|
|
160
|
+
],
|
|
161
|
+
"name": "parseTransferWithPayload",
|
|
162
|
+
"outputs": [
|
|
163
|
+
{
|
|
164
|
+
"components": [
|
|
165
|
+
{
|
|
166
|
+
"internalType": "uint8",
|
|
167
|
+
"name": "payloadID",
|
|
168
|
+
"type": "uint8"
|
|
169
|
+
},
|
|
170
|
+
{
|
|
171
|
+
"internalType": "uint256",
|
|
172
|
+
"name": "amount",
|
|
173
|
+
"type": "uint256"
|
|
174
|
+
},
|
|
175
|
+
{
|
|
176
|
+
"internalType": "bytes32",
|
|
177
|
+
"name": "tokenAddress",
|
|
178
|
+
"type": "bytes32"
|
|
179
|
+
},
|
|
180
|
+
{
|
|
181
|
+
"internalType": "uint16",
|
|
182
|
+
"name": "tokenChain",
|
|
183
|
+
"type": "uint16"
|
|
184
|
+
},
|
|
185
|
+
{
|
|
186
|
+
"internalType": "bytes32",
|
|
187
|
+
"name": "to",
|
|
188
|
+
"type": "bytes32"
|
|
189
|
+
},
|
|
190
|
+
{
|
|
191
|
+
"internalType": "uint16",
|
|
192
|
+
"name": "toChain",
|
|
193
|
+
"type": "uint16"
|
|
194
|
+
},
|
|
195
|
+
{
|
|
196
|
+
"internalType": "bytes32",
|
|
197
|
+
"name": "fromAddress",
|
|
198
|
+
"type": "bytes32"
|
|
199
|
+
},
|
|
200
|
+
{
|
|
201
|
+
"internalType": "bytes",
|
|
202
|
+
"name": "payload",
|
|
203
|
+
"type": "bytes"
|
|
204
|
+
}
|
|
205
|
+
],
|
|
206
|
+
"internalType": "struct IWormholeTokenBridge.TransferWithPayload",
|
|
207
|
+
"name": "transfer",
|
|
208
|
+
"type": "tuple"
|
|
209
|
+
}
|
|
210
|
+
],
|
|
211
|
+
"stateMutability": "pure",
|
|
212
|
+
"type": "function"
|
|
213
|
+
},
|
|
214
|
+
{
|
|
215
|
+
"inputs": [],
|
|
216
|
+
"name": "receiverAddress",
|
|
217
|
+
"outputs": [
|
|
218
|
+
{
|
|
219
|
+
"internalType": "bytes32",
|
|
220
|
+
"name": "",
|
|
221
|
+
"type": "bytes32"
|
|
222
|
+
}
|
|
223
|
+
],
|
|
224
|
+
"stateMutability": "view",
|
|
225
|
+
"type": "function"
|
|
226
|
+
},
|
|
227
|
+
{
|
|
228
|
+
"inputs": [
|
|
229
|
+
{
|
|
230
|
+
"internalType": "bytes32",
|
|
231
|
+
"name": "_receiverAddress",
|
|
232
|
+
"type": "bytes32"
|
|
233
|
+
}
|
|
234
|
+
],
|
|
235
|
+
"name": "setReceiverAddress",
|
|
236
|
+
"outputs": [],
|
|
237
|
+
"stateMutability": "nonpayable",
|
|
238
|
+
"type": "function"
|
|
239
|
+
},
|
|
240
|
+
{
|
|
241
|
+
"inputs": [
|
|
242
|
+
{
|
|
243
|
+
"internalType": "uint256",
|
|
244
|
+
"name": "_transferAmount",
|
|
245
|
+
"type": "uint256"
|
|
246
|
+
}
|
|
247
|
+
],
|
|
248
|
+
"name": "setTransferAmount",
|
|
249
|
+
"outputs": [],
|
|
250
|
+
"stateMutability": "nonpayable",
|
|
251
|
+
"type": "function"
|
|
252
|
+
},
|
|
253
|
+
{
|
|
254
|
+
"inputs": [],
|
|
255
|
+
"name": "transferAmount",
|
|
256
|
+
"outputs": [
|
|
257
|
+
{
|
|
258
|
+
"internalType": "uint256",
|
|
259
|
+
"name": "",
|
|
260
|
+
"type": "uint256"
|
|
261
|
+
}
|
|
262
|
+
],
|
|
263
|
+
"stateMutability": "view",
|
|
264
|
+
"type": "function"
|
|
265
|
+
},
|
|
266
|
+
{
|
|
267
|
+
"inputs": [
|
|
268
|
+
{
|
|
269
|
+
"internalType": "address",
|
|
270
|
+
"name": "token",
|
|
271
|
+
"type": "address"
|
|
272
|
+
},
|
|
273
|
+
{
|
|
274
|
+
"internalType": "uint256",
|
|
275
|
+
"name": "amount",
|
|
276
|
+
"type": "uint256"
|
|
277
|
+
},
|
|
278
|
+
{
|
|
279
|
+
"internalType": "uint16",
|
|
280
|
+
"name": "recipientChain",
|
|
281
|
+
"type": "uint16"
|
|
282
|
+
},
|
|
283
|
+
{
|
|
284
|
+
"internalType": "bytes32",
|
|
285
|
+
"name": "recipient",
|
|
286
|
+
"type": "bytes32"
|
|
287
|
+
},
|
|
288
|
+
{
|
|
289
|
+
"internalType": "uint256",
|
|
290
|
+
"name": "arbiterFee",
|
|
291
|
+
"type": "uint256"
|
|
292
|
+
},
|
|
293
|
+
{
|
|
294
|
+
"internalType": "uint32",
|
|
295
|
+
"name": "nonce",
|
|
296
|
+
"type": "uint32"
|
|
297
|
+
}
|
|
298
|
+
],
|
|
299
|
+
"name": "transferTokens",
|
|
300
|
+
"outputs": [
|
|
301
|
+
{
|
|
302
|
+
"internalType": "uint64",
|
|
303
|
+
"name": "sequence",
|
|
304
|
+
"type": "uint64"
|
|
305
|
+
}
|
|
306
|
+
],
|
|
307
|
+
"stateMutability": "payable",
|
|
308
|
+
"type": "function"
|
|
309
|
+
},
|
|
310
|
+
{
|
|
311
|
+
"inputs": [
|
|
312
|
+
{
|
|
313
|
+
"internalType": "address",
|
|
314
|
+
"name": "token",
|
|
315
|
+
"type": "address"
|
|
316
|
+
},
|
|
317
|
+
{
|
|
318
|
+
"internalType": "uint256",
|
|
319
|
+
"name": "amount",
|
|
320
|
+
"type": "uint256"
|
|
321
|
+
},
|
|
322
|
+
{
|
|
323
|
+
"internalType": "uint16",
|
|
324
|
+
"name": "recipientChain",
|
|
325
|
+
"type": "uint16"
|
|
326
|
+
},
|
|
327
|
+
{
|
|
328
|
+
"internalType": "bytes32",
|
|
329
|
+
"name": "recipient",
|
|
330
|
+
"type": "bytes32"
|
|
331
|
+
},
|
|
332
|
+
{
|
|
333
|
+
"internalType": "uint32",
|
|
334
|
+
"name": "nonce",
|
|
335
|
+
"type": "uint32"
|
|
336
|
+
},
|
|
337
|
+
{
|
|
338
|
+
"internalType": "bytes",
|
|
339
|
+
"name": "payload",
|
|
340
|
+
"type": "bytes"
|
|
341
|
+
}
|
|
342
|
+
],
|
|
343
|
+
"name": "transferTokensWithPayload",
|
|
344
|
+
"outputs": [
|
|
345
|
+
{
|
|
346
|
+
"internalType": "uint64",
|
|
347
|
+
"name": "sequence",
|
|
348
|
+
"type": "uint64"
|
|
349
|
+
}
|
|
350
|
+
],
|
|
351
|
+
"stateMutability": "payable",
|
|
352
|
+
"type": "function"
|
|
353
|
+
},
|
|
354
|
+
{
|
|
355
|
+
"inputs": [],
|
|
356
|
+
"name": "wormholeToken",
|
|
357
|
+
"outputs": [
|
|
358
|
+
{
|
|
359
|
+
"internalType": "contract TestERC20",
|
|
360
|
+
"name": "",
|
|
361
|
+
"type": "address"
|
|
362
|
+
}
|
|
363
|
+
],
|
|
364
|
+
"stateMutability": "view",
|
|
365
|
+
"type": "function"
|
|
366
|
+
}
|
|
367
|
+
],
|
|
368
|
+
"bytecode": "0x608060405234801561001057600080fd5b50604051610b08380380610b0883398101604081905261002f91610054565b600080546001600160a01b0319166001600160a01b0392909216919091179055610084565b60006020828403121561006657600080fd5b81516001600160a01b038116811461007d57600080fd5b9392505050565b610a75806100936000396000f3fe6080604052600436106100b15760003560e01c8063c3f511c111610069578063e566df311161004e578063e566df31146101bb578063ea63738d146101db578063efcb70c01461020857600080fd5b8063c3f511c11461017b578063c5a5ebda146101a857600080fd5b8063504d27fd1161009a578063504d27fd1461010b57806381c82233146101215780639542c9f11461014357600080fd5b80630f5287b0146100b657806316fed3e2146100e7575b600080fd5b6100c96100c4366004610577565b610228565b60405167ffffffffffffffff90911681526020015b60405180910390f35b3480156100f357600080fd5b506100fd60025481565b6040519081526020016100de565b34801561011757600080fd5b506100fd60015481565b34801561012d57600080fd5b5061014161013c3660046105d8565b600155565b005b34801561014f57600080fd5b50600054610163906001600160a01b031681565b6040516001600160a01b0390911681526020016100de565b34801561018757600080fd5b5061019b6101963660046106f9565b6102a0565b6040516100de9190610786565b6100c96101b63660046107a0565b61041e565b3480156101c757600080fd5b506101416101d63660046105d8565b600255565b3480156101e757600080fd5b506101fb6101f63660046106f9565b61046f565b6040516100de9190610823565b34801561021457600080fd5b5061014161022336600461089b565b6104ca565b604080516001600160a01b03881681526020810187905261ffff861681830152606081018590526080810184905263ffffffff831660a082015290516000917f4d24ef3f381c3d7e8696045268f69c41ec3dee2c5bd1aaa48daf8ec2ec7fe436919081900360c00190a1506103099695505050505050565b60607f6efaccd86b6ce8325db6ad038d68e09f9b1af9a0fc1ed121ebe9d870aafc2086826040516102d19190610786565b60405180910390a16000546001546040516340c10f1960e01b815233600482015260248101919091526001600160a01b03909116906340c10f1990604401600060405180830381600087803b15801561032957600080fd5b505af115801561033d573d6000803e3d6000fd5b5050604080516101008101825260018152600260208083018290527f300000000000000000000000000000000000000000000000000000000000000083850152600460608401527f50000000000000000000000000000000000000000000000000000000000000006080840152600660a08401527f700000000000000000000000000000000000000000000000000000000000000060c08401529054835180830191909152835180820383018152908401845260e083015291519093506104079250839101610823565b604051602081830303815290604052915050919050565b60007f8f36aa28e4f86a5b6d397422d004b60e74eda866a331d074749b789d70ca3144878787878787604051610459969594939291906108c5565b60405180910390a1506103789695505050505050565b60408051610100810182526000808252602080830182905292820181905260608083018290526080830182905260a0830182905260c083019190915260e0820152825190916104c49184018101908401610976565b92915050565b6000546040516340c10f1960e01b81526001600160a01b03848116600483015260248201849052909116906340c10f1990604401600060405180830381600087803b15801561051857600080fd5b505af115801561052c573d6000803e3d6000fd5b505050505050565b80356001600160a01b038116811461054b57600080fd5b919050565b61ffff8116811461056057600080fd5b50565b803563ffffffff8116811461054b57600080fd5b60008060008060008060c0878903121561059057600080fd5b61059987610534565b95506020870135945060408701356105b081610550565b935060608701359250608087013591506105cc60a08801610563565b90509295509295509295565b6000602082840312156105ea57600080fd5b5035919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b604051610100810167ffffffffffffffff81118282101715610644576106446105f1565b60405290565b604051601f8201601f1916810167ffffffffffffffff81118282101715610673576106736105f1565b604052919050565b600067ffffffffffffffff821115610695576106956105f1565b50601f01601f191660200190565b600082601f8301126106b457600080fd5b81356106c76106c28261067b565b61064a565b8181528460208386010111156106dc57600080fd5b816020850160208301376000918101602001919091529392505050565b60006020828403121561070b57600080fd5b813567ffffffffffffffff81111561072257600080fd5b61072e848285016106a3565b949350505050565b60005b83811015610751578181015183820152602001610739565b50506000910152565b60008151808452610772816020860160208601610736565b601f01601f19169290920160200192915050565b602081526000610799602083018461075a565b9392505050565b60008060008060008060c087890312156107b957600080fd5b6107c287610534565b95506020870135945060408701356107d981610550565b9350606087013592506107ee60808801610563565b915060a087013567ffffffffffffffff81111561080a57600080fd5b61081689828a016106a3565b9150509295509295509295565b6020815260ff8251166020820152602082015160408201526040820151606082015261ffff6060830151166080820152608082015160a0820152600060a083015161087460c084018261ffff169052565b5060c083015160e083015260e083015161010080818501525061072e61012084018261075a565b600080604083850312156108ae57600080fd5b6108b783610534565b946020939093013593505050565b6001600160a01b038716815285602082015261ffff8516604082015283606082015263ffffffff8316608082015260c060a0820152600061090960c083018461075a565b98975050505050505050565b805160ff8116811461054b57600080fd5b805161054b81610550565b600082601f83011261094257600080fd5b81516109506106c28261067b565b81815284602083860101111561096557600080fd5b61072e826020830160208701610736565b60006020828403121561098857600080fd5b815167ffffffffffffffff808211156109a057600080fd5b9083019061010082860312156109b557600080fd5b6109bd610620565b6109c683610915565b815260208301516020820152604083015160408201526109e860608401610926565b606082015260808301516080820152610a0360a08401610926565b60a082015260c083015160c082015260e083015182811115610a2457600080fd5b610a3087828601610931565b60e0830152509594505050505056fea2646970667358221220913de8d1db6fa583b976d45f865e25f5fd92a6626c1bddca76ad1d23088eee1764736f6c63430008110033",
|
|
369
|
+
"deployedBytecode": "0x6080604052600436106100b15760003560e01c8063c3f511c111610069578063e566df311161004e578063e566df31146101bb578063ea63738d146101db578063efcb70c01461020857600080fd5b8063c3f511c11461017b578063c5a5ebda146101a857600080fd5b8063504d27fd1161009a578063504d27fd1461010b57806381c82233146101215780639542c9f11461014357600080fd5b80630f5287b0146100b657806316fed3e2146100e7575b600080fd5b6100c96100c4366004610577565b610228565b60405167ffffffffffffffff90911681526020015b60405180910390f35b3480156100f357600080fd5b506100fd60025481565b6040519081526020016100de565b34801561011757600080fd5b506100fd60015481565b34801561012d57600080fd5b5061014161013c3660046105d8565b600155565b005b34801561014f57600080fd5b50600054610163906001600160a01b031681565b6040516001600160a01b0390911681526020016100de565b34801561018757600080fd5b5061019b6101963660046106f9565b6102a0565b6040516100de9190610786565b6100c96101b63660046107a0565b61041e565b3480156101c757600080fd5b506101416101d63660046105d8565b600255565b3480156101e757600080fd5b506101fb6101f63660046106f9565b61046f565b6040516100de9190610823565b34801561021457600080fd5b5061014161022336600461089b565b6104ca565b604080516001600160a01b03881681526020810187905261ffff861681830152606081018590526080810184905263ffffffff831660a082015290516000917f4d24ef3f381c3d7e8696045268f69c41ec3dee2c5bd1aaa48daf8ec2ec7fe436919081900360c00190a1506103099695505050505050565b60607f6efaccd86b6ce8325db6ad038d68e09f9b1af9a0fc1ed121ebe9d870aafc2086826040516102d19190610786565b60405180910390a16000546001546040516340c10f1960e01b815233600482015260248101919091526001600160a01b03909116906340c10f1990604401600060405180830381600087803b15801561032957600080fd5b505af115801561033d573d6000803e3d6000fd5b5050604080516101008101825260018152600260208083018290527f300000000000000000000000000000000000000000000000000000000000000083850152600460608401527f50000000000000000000000000000000000000000000000000000000000000006080840152600660a08401527f700000000000000000000000000000000000000000000000000000000000000060c08401529054835180830191909152835180820383018152908401845260e083015291519093506104079250839101610823565b604051602081830303815290604052915050919050565b60007f8f36aa28e4f86a5b6d397422d004b60e74eda866a331d074749b789d70ca3144878787878787604051610459969594939291906108c5565b60405180910390a1506103789695505050505050565b60408051610100810182526000808252602080830182905292820181905260608083018290526080830182905260a0830182905260c083019190915260e0820152825190916104c49184018101908401610976565b92915050565b6000546040516340c10f1960e01b81526001600160a01b03848116600483015260248201849052909116906340c10f1990604401600060405180830381600087803b15801561051857600080fd5b505af115801561052c573d6000803e3d6000fd5b505050505050565b80356001600160a01b038116811461054b57600080fd5b919050565b61ffff8116811461056057600080fd5b50565b803563ffffffff8116811461054b57600080fd5b60008060008060008060c0878903121561059057600080fd5b61059987610534565b95506020870135945060408701356105b081610550565b935060608701359250608087013591506105cc60a08801610563565b90509295509295509295565b6000602082840312156105ea57600080fd5b5035919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b604051610100810167ffffffffffffffff81118282101715610644576106446105f1565b60405290565b604051601f8201601f1916810167ffffffffffffffff81118282101715610673576106736105f1565b604052919050565b600067ffffffffffffffff821115610695576106956105f1565b50601f01601f191660200190565b600082601f8301126106b457600080fd5b81356106c76106c28261067b565b61064a565b8181528460208386010111156106dc57600080fd5b816020850160208301376000918101602001919091529392505050565b60006020828403121561070b57600080fd5b813567ffffffffffffffff81111561072257600080fd5b61072e848285016106a3565b949350505050565b60005b83811015610751578181015183820152602001610739565b50506000910152565b60008151808452610772816020860160208601610736565b601f01601f19169290920160200192915050565b602081526000610799602083018461075a565b9392505050565b60008060008060008060c087890312156107b957600080fd5b6107c287610534565b95506020870135945060408701356107d981610550565b9350606087013592506107ee60808801610563565b915060a087013567ffffffffffffffff81111561080a57600080fd5b61081689828a016106a3565b9150509295509295509295565b6020815260ff8251166020820152602082015160408201526040820151606082015261ffff6060830151166080820152608082015160a0820152600060a083015161087460c084018261ffff169052565b5060c083015160e083015260e083015161010080818501525061072e61012084018261075a565b600080604083850312156108ae57600080fd5b6108b783610534565b946020939093013593505050565b6001600160a01b038716815285602082015261ffff8516604082015283606082015263ffffffff8316608082015260c060a0820152600061090960c083018461075a565b98975050505050505050565b805160ff8116811461054b57600080fd5b805161054b81610550565b600082601f83011261094257600080fd5b81516109506106c28261067b565b81815284602083860101111561096557600080fd5b61072e826020830160208701610736565b60006020828403121561098857600080fd5b815167ffffffffffffffff808211156109a057600080fd5b9083019061010082860312156109b557600080fd5b6109bd610620565b6109c683610915565b815260208301516020820152604083015160408201526109e860608401610926565b606082015260808301516080820152610a0360a08401610926565b60a082015260c083015160c082015260e083015182811115610a2457600080fd5b610a3087828601610931565b60e0830152509594505050505056fea2646970667358221220913de8d1db6fa583b976d45f865e25f5fd92a6626c1bddca76ad1d23088eee1764736f6c63430008110033",
|
|
370
|
+
"linkReferences": {},
|
|
371
|
+
"deployedLinkReferences": {}
|
|
372
|
+
}
|
|
@@ -0,0 +1,174 @@
|
|
|
1
|
+
// SPDX-License-Identifier: GPL-3.0-only
|
|
2
|
+
|
|
3
|
+
pragma solidity 0.8.17;
|
|
4
|
+
|
|
5
|
+
import "../bridge/BitcoinTx.sol";
|
|
6
|
+
import "../bridge/Bridge.sol";
|
|
7
|
+
import "../bridge/MovingFunds.sol";
|
|
8
|
+
import "../bridge/Wallets.sol";
|
|
9
|
+
|
|
10
|
+
contract BridgeStub is Bridge {
|
|
11
|
+
function setSweptDeposits(BitcoinTx.UTXO[] calldata utxos) external {
|
|
12
|
+
for (uint256 i = 0; i < utxos.length; i++) {
|
|
13
|
+
uint256 utxoKey = uint256(
|
|
14
|
+
keccak256(
|
|
15
|
+
abi.encodePacked(utxos[i].txHash, utxos[i].txOutputIndex)
|
|
16
|
+
)
|
|
17
|
+
);
|
|
18
|
+
self.deposits[utxoKey].sweptAt = 1641650400;
|
|
19
|
+
}
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
function setSpentMainUtxos(BitcoinTx.UTXO[] calldata utxos) external {
|
|
23
|
+
for (uint256 i = 0; i < utxos.length; i++) {
|
|
24
|
+
uint256 utxoKey = uint256(
|
|
25
|
+
keccak256(
|
|
26
|
+
abi.encodePacked(utxos[i].txHash, utxos[i].txOutputIndex)
|
|
27
|
+
)
|
|
28
|
+
);
|
|
29
|
+
self.spentMainUTXOs[utxoKey] = true;
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
|
|
33
|
+
function setProcessedMovedFundsSweepRequests(
|
|
34
|
+
BitcoinTx.UTXO[] calldata utxos
|
|
35
|
+
) external {
|
|
36
|
+
for (uint256 i = 0; i < utxos.length; i++) {
|
|
37
|
+
uint256 utxoKey = uint256(
|
|
38
|
+
keccak256(
|
|
39
|
+
abi.encodePacked(utxos[i].txHash, utxos[i].txOutputIndex)
|
|
40
|
+
)
|
|
41
|
+
);
|
|
42
|
+
self.movedFundsSweepRequests[utxoKey].state = MovingFunds
|
|
43
|
+
.MovedFundsSweepRequestState
|
|
44
|
+
.Processed;
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
|
|
48
|
+
function setActiveWallet(bytes20 activeWalletPubKeyHash) external {
|
|
49
|
+
self.activeWalletPubKeyHash = activeWalletPubKeyHash;
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
function setWalletMainUtxo(
|
|
53
|
+
bytes20 walletPubKeyHash,
|
|
54
|
+
BitcoinTx.UTXO calldata utxo
|
|
55
|
+
) external {
|
|
56
|
+
self.registeredWallets[walletPubKeyHash].mainUtxoHash = keccak256(
|
|
57
|
+
abi.encodePacked(
|
|
58
|
+
utxo.txHash,
|
|
59
|
+
utxo.txOutputIndex,
|
|
60
|
+
utxo.txOutputValue
|
|
61
|
+
)
|
|
62
|
+
);
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
function setWallet(bytes20 walletPubKeyHash, Wallets.Wallet calldata wallet)
|
|
66
|
+
external
|
|
67
|
+
{
|
|
68
|
+
self.registeredWallets[walletPubKeyHash] = wallet;
|
|
69
|
+
|
|
70
|
+
if (wallet.state == Wallets.WalletState.Live) {
|
|
71
|
+
self.liveWalletsCount++;
|
|
72
|
+
}
|
|
73
|
+
}
|
|
74
|
+
|
|
75
|
+
function setDepositDustThreshold(uint64 _depositDustThreshold) external {
|
|
76
|
+
self.depositDustThreshold = _depositDustThreshold;
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
function setDepositTxMaxFee(uint64 _depositTxMaxFee) external {
|
|
80
|
+
self.depositTxMaxFee = _depositTxMaxFee;
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
function setRedemptionDustThreshold(uint64 _redemptionDustThreshold)
|
|
84
|
+
external
|
|
85
|
+
{
|
|
86
|
+
self.redemptionDustThreshold = _redemptionDustThreshold;
|
|
87
|
+
}
|
|
88
|
+
|
|
89
|
+
function setRedemptionTreasuryFeeDivisor(
|
|
90
|
+
uint64 _redemptionTreasuryFeeDivisor
|
|
91
|
+
) external {
|
|
92
|
+
self.redemptionTreasuryFeeDivisor = _redemptionTreasuryFeeDivisor;
|
|
93
|
+
}
|
|
94
|
+
|
|
95
|
+
function setPendingMovedFundsSweepRequest(
|
|
96
|
+
bytes20 walletPubKeyHash,
|
|
97
|
+
BitcoinTx.UTXO calldata utxo
|
|
98
|
+
) external {
|
|
99
|
+
uint256 requestKey = uint256(
|
|
100
|
+
keccak256(abi.encodePacked(utxo.txHash, utxo.txOutputIndex))
|
|
101
|
+
);
|
|
102
|
+
|
|
103
|
+
self.movedFundsSweepRequests[requestKey] = MovingFunds
|
|
104
|
+
.MovedFundsSweepRequest(
|
|
105
|
+
walletPubKeyHash,
|
|
106
|
+
utxo.txOutputValue,
|
|
107
|
+
/* solhint-disable-next-line not-rely-on-time */
|
|
108
|
+
uint32(block.timestamp),
|
|
109
|
+
MovingFunds.MovedFundsSweepRequestState.Pending
|
|
110
|
+
);
|
|
111
|
+
|
|
112
|
+
self
|
|
113
|
+
.registeredWallets[walletPubKeyHash]
|
|
114
|
+
.pendingMovedFundsSweepRequestsCount++;
|
|
115
|
+
}
|
|
116
|
+
|
|
117
|
+
function processPendingMovedFundsSweepRequest(
|
|
118
|
+
bytes20 walletPubKeyHash,
|
|
119
|
+
BitcoinTx.UTXO calldata utxo
|
|
120
|
+
) external {
|
|
121
|
+
uint256 requestKey = uint256(
|
|
122
|
+
keccak256(abi.encodePacked(utxo.txHash, utxo.txOutputIndex))
|
|
123
|
+
);
|
|
124
|
+
|
|
125
|
+
MovingFunds.MovedFundsSweepRequest storage request = self
|
|
126
|
+
.movedFundsSweepRequests[requestKey];
|
|
127
|
+
|
|
128
|
+
require(
|
|
129
|
+
request.state == MovingFunds.MovedFundsSweepRequestState.Pending,
|
|
130
|
+
"Stub sweep request must be in Pending state"
|
|
131
|
+
);
|
|
132
|
+
|
|
133
|
+
request.state = MovingFunds.MovedFundsSweepRequestState.Processed;
|
|
134
|
+
|
|
135
|
+
self
|
|
136
|
+
.registeredWallets[walletPubKeyHash]
|
|
137
|
+
.pendingMovedFundsSweepRequestsCount--;
|
|
138
|
+
}
|
|
139
|
+
|
|
140
|
+
function timeoutPendingMovedFundsSweepRequest(
|
|
141
|
+
bytes20 walletPubKeyHash,
|
|
142
|
+
BitcoinTx.UTXO calldata utxo
|
|
143
|
+
) external {
|
|
144
|
+
uint256 requestKey = uint256(
|
|
145
|
+
keccak256(abi.encodePacked(utxo.txHash, utxo.txOutputIndex))
|
|
146
|
+
);
|
|
147
|
+
|
|
148
|
+
MovingFunds.MovedFundsSweepRequest storage request = self
|
|
149
|
+
.movedFundsSweepRequests[requestKey];
|
|
150
|
+
|
|
151
|
+
require(
|
|
152
|
+
request.state == MovingFunds.MovedFundsSweepRequestState.Pending,
|
|
153
|
+
"Stub sweep request must be in Pending state"
|
|
154
|
+
);
|
|
155
|
+
|
|
156
|
+
request.state = MovingFunds.MovedFundsSweepRequestState.TimedOut;
|
|
157
|
+
|
|
158
|
+
self
|
|
159
|
+
.registeredWallets[walletPubKeyHash]
|
|
160
|
+
.pendingMovedFundsSweepRequestsCount--;
|
|
161
|
+
}
|
|
162
|
+
|
|
163
|
+
function setMovedFundsSweepTxMaxTotalFee(
|
|
164
|
+
uint64 _movedFundsSweepTxMaxTotalFee
|
|
165
|
+
) external {
|
|
166
|
+
self.movedFundsSweepTxMaxTotalFee = _movedFundsSweepTxMaxTotalFee;
|
|
167
|
+
}
|
|
168
|
+
|
|
169
|
+
function setDepositRevealAheadPeriod(uint32 _depositRevealAheadPeriod)
|
|
170
|
+
external
|
|
171
|
+
{
|
|
172
|
+
self.depositRevealAheadPeriod = _depositRevealAheadPeriod;
|
|
173
|
+
}
|
|
174
|
+
}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
// SPDX-License-Identifier: GPL-3.0-only
|
|
2
|
+
|
|
3
|
+
pragma solidity 0.8.17;
|
|
4
|
+
|
|
5
|
+
import "../bridge/Heartbeat.sol";
|
|
6
|
+
|
|
7
|
+
/// @dev This is a contract implemented to test Heartbeat library directly.
|
|
8
|
+
contract HeartbeatStub {
|
|
9
|
+
function isValidHeartbeatMessage(bytes calldata message)
|
|
10
|
+
public
|
|
11
|
+
pure
|
|
12
|
+
returns (bool)
|
|
13
|
+
{
|
|
14
|
+
return Heartbeat.isValidHeartbeatMessage(message);
|
|
15
|
+
}
|
|
16
|
+
}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
// SPDX-License-Identifier: GPL-3.0-only
|
|
2
|
+
|
|
3
|
+
pragma solidity 0.8.17;
|
|
4
|
+
|
|
5
|
+
import "../relay/LightRelay.sol";
|
|
6
|
+
|
|
7
|
+
contract LightRelayStub is LightRelay {
|
|
8
|
+
// Gas-reporting version of validateChain
|
|
9
|
+
function validateChainGasReport(bytes memory headers)
|
|
10
|
+
external
|
|
11
|
+
returns (uint256, uint256)
|
|
12
|
+
{
|
|
13
|
+
return this.validateChain(headers);
|
|
14
|
+
}
|
|
15
|
+
}
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
// SPDX-License-Identifier: GPL-3.0-only
|
|
2
|
+
|
|
3
|
+
pragma solidity 0.8.17;
|
|
4
|
+
|
|
5
|
+
import "../token/TBTC.sol";
|
|
6
|
+
|
|
7
|
+
contract ReceiveApprovalStub is IReceiveApproval {
|
|
8
|
+
bool public shouldRevert;
|
|
9
|
+
|
|
10
|
+
event ApprovalReceived(
|
|
11
|
+
address from,
|
|
12
|
+
uint256 value,
|
|
13
|
+
address token,
|
|
14
|
+
bytes extraData
|
|
15
|
+
);
|
|
16
|
+
|
|
17
|
+
function receiveApproval(
|
|
18
|
+
address from,
|
|
19
|
+
uint256 value,
|
|
20
|
+
address token,
|
|
21
|
+
bytes calldata extraData
|
|
22
|
+
) external override {
|
|
23
|
+
if (shouldRevert) {
|
|
24
|
+
revert("i am your father luke");
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
emit ApprovalReceived(from, value, token, extraData);
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
function setShouldRevert(bool _shouldRevert) external {
|
|
31
|
+
shouldRevert = _shouldRevert;
|
|
32
|
+
}
|
|
33
|
+
}
|