@keep-network/tbtc-v2 1.5.0 → 1.5.1
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/build/contracts/GovernanceUtils.sol/GovernanceUtils.dbg.json +1 -1
- package/build/contracts/bank/Bank.sol/Bank.dbg.json +1 -1
- package/build/contracts/bank/IReceiveBalanceApproval.sol/IReceiveBalanceApproval.dbg.json +1 -1
- package/build/contracts/bridge/BitcoinTx.sol/BitcoinTx.dbg.json +1 -1
- package/build/contracts/bridge/Bridge.sol/Bridge.dbg.json +1 -1
- package/build/contracts/bridge/BridgeGovernanceParameters.sol/BridgeGovernanceParameters.dbg.json +1 -1
- package/build/contracts/bridge/BridgeState.sol/BridgeState.dbg.json +1 -1
- package/build/contracts/bridge/Deposit.sol/Deposit.dbg.json +1 -1
- package/build/contracts/bridge/DepositSweep.sol/DepositSweep.dbg.json +1 -1
- package/build/contracts/bridge/EcdsaLib.sol/EcdsaLib.dbg.json +1 -1
- package/build/contracts/bridge/Fraud.sol/Fraud.dbg.json +1 -1
- package/build/contracts/bridge/Heartbeat.sol/Heartbeat.dbg.json +1 -1
- package/build/contracts/bridge/IRelay.sol/IRelay.dbg.json +1 -1
- package/build/contracts/bridge/MovingFunds.sol/MovingFunds.dbg.json +1 -1
- package/build/contracts/bridge/Redemption.sol/OutboundTx.dbg.json +1 -1
- package/build/contracts/bridge/Redemption.sol/Redemption.dbg.json +1 -1
- package/build/contracts/bridge/VendingMachine.sol/VendingMachine.dbg.json +1 -1
- package/build/contracts/bridge/VendingMachineV2.sol/VendingMachineV2.dbg.json +1 -1
- package/build/contracts/bridge/VendingMachineV3.sol/VendingMachineV3.dbg.json +1 -1
- package/build/contracts/bridge/WalletCoordinator.sol/WalletCoordinator.dbg.json +1 -1
- package/build/contracts/bridge/Wallets.sol/Wallets.dbg.json +1 -1
- package/build/contracts/l2/L2TBTC.sol/L2TBTC.dbg.json +1 -1
- package/build/contracts/l2/L2WormholeGateway.sol/IWormholeTokenBridge.dbg.json +1 -1
- package/build/contracts/l2/L2WormholeGateway.sol/L2WormholeGateway.dbg.json +1 -1
- package/build/contracts/l2/L2WormholeGateway.sol/L2WormholeGateway.json +2 -15
- package/build/contracts/maintainer/MaintainerProxy.sol/MaintainerProxy.dbg.json +1 -1
- package/build/contracts/relay/LightRelay.sol/ILightRelay.dbg.json +1 -1
- package/build/contracts/relay/LightRelay.sol/LightRelay.dbg.json +1 -1
- package/build/contracts/relay/LightRelay.sol/RelayUtils.dbg.json +1 -1
- package/build/contracts/relay/LightRelayMaintainerProxy.sol/LightRelayMaintainerProxy.dbg.json +1 -1
- package/build/contracts/token/TBTC.sol/TBTC.dbg.json +1 -1
- package/build/contracts/vault/DonationVault.sol/DonationVault.dbg.json +1 -1
- package/build/contracts/vault/IVault.sol/IVault.dbg.json +1 -1
- package/build/contracts/vault/TBTCOptimisticMinting.sol/TBTCOptimisticMinting.dbg.json +1 -1
- package/build/contracts/vault/TBTCVault.sol/TBTCVault.dbg.json +1 -1
- package/contracts/l2/L2WormholeGateway.sol +7 -27
- package/export/artifacts/contracts/bridge/VendingMachine.sol/VendingMachine.json +6 -6
- package/export/artifacts/contracts/bridge/VendingMachineV2.sol/VendingMachineV2.json +6 -6
- package/export/artifacts/contracts/bridge/VendingMachineV3.sol/VendingMachineV3.json +6 -6
- package/export/artifacts/contracts/l2/L2WormholeGateway.sol/L2WormholeGateway.json +3030 -3498
- package/export/artifacts/contracts/maintainer/MaintainerProxy.sol/MaintainerProxy.json +88 -88
- package/export/artifacts/contracts/relay/LightRelay.sol/LightRelay.json +57 -57
- package/export/artifacts/contracts/relay/LightRelayMaintainerProxy.sol/LightRelayMaintainerProxy.json +31 -31
- package/export/artifacts/contracts/test/BankStub.sol/BankStub.json +11975 -0
- package/export/artifacts/contracts/test/BridgeStub.sol/BridgeStub.json +51806 -0
- package/export/artifacts/contracts/test/GoerliLightRelay.sol/GoerliLightRelay.json +12024 -0
- package/export/artifacts/contracts/test/HeartbeatStub.sol/HeartbeatStub.json +822 -0
- package/export/artifacts/contracts/test/LightRelayStub.sol/LightRelayStub.json +12729 -0
- package/export/artifacts/contracts/test/ReceiveApprovalStub.sol/ReceiveApprovalStub.json +2160 -0
- package/export/artifacts/contracts/test/SystemTestRelay.sol/SystemTestRelay.json +3407 -0
- package/export/artifacts/contracts/test/TestERC20.sol/TestERC20.json +14263 -0
- package/export/artifacts/contracts/test/TestERC721.sol/TestERC721.json +10644 -0
- package/export/artifacts/contracts/test/TestEcdsaLib.sol/TestEcdsaLib.json +1160 -0
- package/export/artifacts/contracts/test/WormholeBridgeStub.sol/WormholeBridgeStub.json +8665 -0
- package/export/artifacts/contracts/token/TBTC.sol/TBTC.json +2 -2
- package/export/artifacts/contracts/vault/DonationVault.sol/DonationVault.json +11 -11
- package/export/artifacts/contracts/vault/TBTCVault.sol/TBTCVault.json +135 -135
- package/export/test/integration/data/bls.js +12 -0
- package/export/test/integration/data/integration.js +133 -0
- package/export/test/integration/utils/ecdsa-wallet-registry.js +370 -0
- package/export/test/integration/utils/random-beacon.js +193 -0
- package/export/{deploy/08_deploy_maintainer_proxy.js → test/integration/utils/staking.js} +35 -32
- package/export/typechain/factories/L2WormholeGateway__factory.js +1 -14
- package/export/typechain/factories/WormholeBridgeStub__factory.js +1 -1
- package/package.json +1 -1
- package/export/deploy/00_resolve_relay.js +0 -83
- package/export/deploy/01_deploy_tbtc_v2_token.js +0 -70
- package/export/deploy/02_deploy_vending_machine.js +0 -84
- package/export/deploy/03_transfer_vending_machine_roles.js +0 -69
- package/export/deploy/04_deploy_bank.js +0 -73
- package/export/deploy/05_deploy_bridge.js +0 -178
- package/export/deploy/06_deploy_tbtc_vault.js +0 -80
- package/export/deploy/07_deploy_bridge_governance.js +0 -87
- package/export/deploy/09_bank_update_bridge.js +0 -63
- package/export/deploy/10_authorize_spv_maintainer_in_bridge.js +0 -61
- package/export/deploy/11_transfer_bank_ownership.js +0 -60
- package/export/deploy/12_transfer_bridge_governance.js +0 -63
- package/export/deploy/13_transfer_bridge_governance_ownership.js +0 -60
- package/export/deploy/14_transfer_tbtc_vault_ownership.js +0 -60
- package/export/deploy/15_transfer_maintainer_proxy_ownership.js +0 -60
- package/export/deploy/16_initialize_wallet_owner.js +0 -63
- package/export/deploy/16_transfer_proxy_admin_ownership.js +0 -73
- package/export/deploy/17_authorize_maintainer_proxy_in_bridge.js +0 -63
- package/export/deploy/17_transfer_proxy_admin_ownership.js +0 -73
- package/export/deploy/18_authorize_maintainer_proxy_in_bridge.js +0 -63
- package/export/deploy/18_authorize_maintainer_proxy_in_reimbursement_pool.js +0 -63
- package/export/deploy/19_authorize_bridge_in_reimbursement_pool.js +0 -63
- package/export/deploy/19_authorize_maintainer_proxy_in_reimbursement_pool.js +0 -63
- package/export/deploy/20_authorize_bridge_in_reimbursement_pool.js +0 -63
- package/export/deploy/20_deploy_proxy_admin_with_deputy.js +0 -80
- package/export/deploy/21_transfer_reimbursement_pool_ownership.js +0 -60
- package/export/deploy/22_deploy_proxy_admin_with_deputy.js +0 -80
- package/export/deploy/24_transfer_maintainer_proxy_ownership.js +0 -60
- package/export/deploy/25_transfer_proxy_admin_ownership.js +0 -73
- package/export/deploy/26_authorize_maintainer_proxy_in_reimbursement_pool.js +0 -70
- package/export/deploy/27_authorize_bridge_in_reimbursement_pool.js +0 -70
- package/export/deploy/28_deploy_proxy_admin_with_deputy.js +0 -80
- package/export/deploy/35_transfer_wallet_coordinator_ownership.js +0 -60
- package/export/deploy/36_deploy_light_relay_maintainer_proxy.js +0 -86
- package/export/deploy/37_authorize_maintainer_in_light_relay_maintainer_proxy.js +0 -65
- package/export/deploy/38_transfer_light_relay_maintainer_proxy_ownership.js +0 -60
- package/export/deploy/39_authorize_light_relay_maintainer_proxy_in_reimbursement_pool.js +0 -70
- package/export/deploy/40_authorize_light_relay_maintainer_proxy_in_light_relay.js +0 -66
- package/export/typechain/RelayStub.js +0 -2
- package/export/typechain/TestRelay.js +0 -2
- package/export/typechain/factories/RelayStub__factory.js +0 -546
- package/export/typechain/factories/TestRelay__factory.js +0 -168
|
@@ -0,0 +1,822 @@
|
|
|
1
|
+
{
|
|
2
|
+
"contractName": "HeartbeatStub",
|
|
3
|
+
"sourceName": "contracts/test/HeartbeatStub.sol",
|
|
4
|
+
"abi": [
|
|
5
|
+
{
|
|
6
|
+
"inputs": [
|
|
7
|
+
{
|
|
8
|
+
"internalType": "bytes",
|
|
9
|
+
"name": "message",
|
|
10
|
+
"type": "bytes"
|
|
11
|
+
}
|
|
12
|
+
],
|
|
13
|
+
"name": "isValidHeartbeatMessage",
|
|
14
|
+
"outputs": [
|
|
15
|
+
{
|
|
16
|
+
"internalType": "bool",
|
|
17
|
+
"name": "",
|
|
18
|
+
"type": "bool"
|
|
19
|
+
}
|
|
20
|
+
],
|
|
21
|
+
"stateMutability": "pure",
|
|
22
|
+
"type": "function"
|
|
23
|
+
}
|
|
24
|
+
],
|
|
25
|
+
"bytecode": "0x608060405234801561001057600080fd5b506101b3806100206000396000f3fe608060405234801561001057600080fd5b506004361061002b5760003560e01c8063ea5bf84914610030575b600080fd5b61004361003e36600461010b565b610057565b604051901515815260200160405180910390f35b6000610063838361006c565b90505b92915050565b60006010821461007e57506000610066565b6100c2600084848080601f01602080910402602001604051908101604052809392919081815260200183838082843760009201919091525092939250506100fc9050565b7fffffffffffffffff000000000000000000000000000000000000000000000000908116146100f357506000610066565b50600192915050565b60006100638383016020015190565b6000806020838503121561011e57600080fd5b823567ffffffffffffffff8082111561013657600080fd5b818501915085601f83011261014a57600080fd5b81358181111561015957600080fd5b86602082850101111561016b57600080fd5b6020929092019691955090935050505056fea264697066735822122070b2f1b2d2ab237110e2d7405365b63e123144198c2419d43fdc397b756c316c64736f6c63430008110033",
|
|
26
|
+
"deployedBytecode": "0x608060405234801561001057600080fd5b506004361061002b5760003560e01c8063ea5bf84914610030575b600080fd5b61004361003e36600461010b565b610057565b604051901515815260200160405180910390f35b6000610063838361006c565b90505b92915050565b60006010821461007e57506000610066565b6100c2600084848080601f01602080910402602001604051908101604052809392919081815260200183838082843760009201919091525092939250506100fc9050565b7fffffffffffffffff000000000000000000000000000000000000000000000000908116146100f357506000610066565b50600192915050565b60006100638383016020015190565b6000806020838503121561011e57600080fd5b823567ffffffffffffffff8082111561013657600080fd5b818501915085601f83011261014a57600080fd5b81358181111561015957600080fd5b86602082850101111561016b57600080fd5b6020929092019691955090935050505056fea264697066735822122070b2f1b2d2ab237110e2d7405365b63e123144198c2419d43fdc397b756c316c64736f6c63430008110033",
|
|
27
|
+
"linkReferences": {},
|
|
28
|
+
"deployedLinkReferences": {},
|
|
29
|
+
"devdoc": {
|
|
30
|
+
"details": "This is a contract implemented to test Heartbeat library directly.",
|
|
31
|
+
"kind": "dev",
|
|
32
|
+
"methods": {},
|
|
33
|
+
"version": 1
|
|
34
|
+
},
|
|
35
|
+
"evm": {
|
|
36
|
+
"bytecode": {
|
|
37
|
+
"functionDebugData": {},
|
|
38
|
+
"generatedSources": [],
|
|
39
|
+
"linkReferences": {},
|
|
40
|
+
"opcodes": "PUSH1 0x80 PUSH1 0x40 MSTORE CALLVALUE DUP1 ISZERO PUSH2 0x10 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP PUSH2 0x1B3 DUP1 PUSH2 0x20 PUSH1 0x0 CODECOPY PUSH1 0x0 RETURN INVALID PUSH1 0x80 PUSH1 0x40 MSTORE CALLVALUE DUP1 ISZERO PUSH2 0x10 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP PUSH1 0x4 CALLDATASIZE LT PUSH2 0x2B JUMPI PUSH1 0x0 CALLDATALOAD PUSH1 0xE0 SHR DUP1 PUSH4 0xEA5BF849 EQ PUSH2 0x30 JUMPI JUMPDEST PUSH1 0x0 DUP1 REVERT JUMPDEST PUSH2 0x43 PUSH2 0x3E CALLDATASIZE PUSH1 0x4 PUSH2 0x10B JUMP JUMPDEST PUSH2 0x57 JUMP JUMPDEST PUSH1 0x40 MLOAD SWAP1 ISZERO ISZERO DUP2 MSTORE PUSH1 0x20 ADD PUSH1 0x40 MLOAD DUP1 SWAP2 SUB SWAP1 RETURN JUMPDEST PUSH1 0x0 PUSH2 0x63 DUP4 DUP4 PUSH2 0x6C JUMP JUMPDEST SWAP1 POP JUMPDEST SWAP3 SWAP2 POP POP JUMP JUMPDEST PUSH1 0x0 PUSH1 0x10 DUP3 EQ PUSH2 0x7E JUMPI POP PUSH1 0x0 PUSH2 0x66 JUMP JUMPDEST PUSH2 0xC2 PUSH1 0x0 DUP5 DUP5 DUP1 DUP1 PUSH1 0x1F ADD PUSH1 0x20 DUP1 SWAP2 DIV MUL PUSH1 0x20 ADD PUSH1 0x40 MLOAD SWAP1 DUP2 ADD PUSH1 0x40 MSTORE DUP1 SWAP4 SWAP3 SWAP2 SWAP1 DUP2 DUP2 MSTORE PUSH1 0x20 ADD DUP4 DUP4 DUP1 DUP3 DUP5 CALLDATACOPY PUSH1 0x0 SWAP3 ADD SWAP2 SWAP1 SWAP2 MSTORE POP SWAP3 SWAP4 SWAP3 POP POP PUSH2 0xFC SWAP1 POP JUMP JUMPDEST PUSH32 0xFFFFFFFFFFFFFFFF000000000000000000000000000000000000000000000000 SWAP1 DUP2 AND EQ PUSH2 0xF3 JUMPI POP PUSH1 0x0 PUSH2 0x66 JUMP JUMPDEST POP PUSH1 0x1 SWAP3 SWAP2 POP POP JUMP JUMPDEST PUSH1 0x0 PUSH2 0x63 DUP4 DUP4 ADD PUSH1 0x20 ADD MLOAD SWAP1 JUMP JUMPDEST PUSH1 0x0 DUP1 PUSH1 0x20 DUP4 DUP6 SUB SLT ISZERO PUSH2 0x11E JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST DUP3 CALLDATALOAD PUSH8 0xFFFFFFFFFFFFFFFF DUP1 DUP3 GT ISZERO PUSH2 0x136 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST DUP2 DUP6 ADD SWAP2 POP DUP6 PUSH1 0x1F DUP4 ADD SLT PUSH2 0x14A JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST DUP2 CALLDATALOAD DUP2 DUP2 GT ISZERO PUSH2 0x159 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST DUP7 PUSH1 0x20 DUP3 DUP6 ADD ADD GT ISZERO PUSH2 0x16B JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST PUSH1 0x20 SWAP3 SWAP1 SWAP3 ADD SWAP7 SWAP2 SWAP6 POP SWAP1 SWAP4 POP POP POP POP JUMP INVALID LOG2 PUSH5 0x6970667358 0x22 SLT KECCAK256 PUSH17 0xB2F1B2D2AB237110E2D7405365B63E1231 DIFFICULTY NOT DUP13 0x24 NOT 0xD4 EXTCODEHASH 0xDC CODECOPY PUSH28 0x756C316C64736F6C6343000811003300000000000000000000000000 ",
|
|
41
|
+
"sourceMap": "178:209:112:-:0;;;;;;;;;;;;;;;;;;;"
|
|
42
|
+
},
|
|
43
|
+
"deployedBytecode": {
|
|
44
|
+
"functionDebugData": {
|
|
45
|
+
"@isValidHeartbeatMessage_31101": {
|
|
46
|
+
"entryPoint": 108,
|
|
47
|
+
"id": 31101,
|
|
48
|
+
"parameterSlots": 2,
|
|
49
|
+
"returnSlots": 1
|
|
50
|
+
},
|
|
51
|
+
"@isValidHeartbeatMessage_40832": {
|
|
52
|
+
"entryPoint": 87,
|
|
53
|
+
"id": 40832,
|
|
54
|
+
"parameterSlots": 2,
|
|
55
|
+
"returnSlots": 1
|
|
56
|
+
},
|
|
57
|
+
"@slice32_2315": {
|
|
58
|
+
"entryPoint": null,
|
|
59
|
+
"id": 2315,
|
|
60
|
+
"parameterSlots": 2,
|
|
61
|
+
"returnSlots": 1
|
|
62
|
+
},
|
|
63
|
+
"@slice8_2353": {
|
|
64
|
+
"entryPoint": 252,
|
|
65
|
+
"id": 2353,
|
|
66
|
+
"parameterSlots": 2,
|
|
67
|
+
"returnSlots": 1
|
|
68
|
+
},
|
|
69
|
+
"abi_decode_tuple_t_bytes_calldata_ptr": {
|
|
70
|
+
"entryPoint": 267,
|
|
71
|
+
"id": null,
|
|
72
|
+
"parameterSlots": 2,
|
|
73
|
+
"returnSlots": 2
|
|
74
|
+
},
|
|
75
|
+
"abi_encode_tuple_t_bool__to_t_bool__fromStack_reversed": {
|
|
76
|
+
"entryPoint": null,
|
|
77
|
+
"id": null,
|
|
78
|
+
"parameterSlots": 2,
|
|
79
|
+
"returnSlots": 1
|
|
80
|
+
}
|
|
81
|
+
},
|
|
82
|
+
"generatedSources": [
|
|
83
|
+
{
|
|
84
|
+
"ast": {
|
|
85
|
+
"nodeType": "YulBlock",
|
|
86
|
+
"src": "0:799:125",
|
|
87
|
+
"statements": [
|
|
88
|
+
{
|
|
89
|
+
"nodeType": "YulBlock",
|
|
90
|
+
"src": "6:3:125",
|
|
91
|
+
"statements": []
|
|
92
|
+
},
|
|
93
|
+
{
|
|
94
|
+
"body": {
|
|
95
|
+
"nodeType": "YulBlock",
|
|
96
|
+
"src": "103:502:125",
|
|
97
|
+
"statements": [
|
|
98
|
+
{
|
|
99
|
+
"body": {
|
|
100
|
+
"nodeType": "YulBlock",
|
|
101
|
+
"src": "149:16:125",
|
|
102
|
+
"statements": [
|
|
103
|
+
{
|
|
104
|
+
"expression": {
|
|
105
|
+
"arguments": [
|
|
106
|
+
{
|
|
107
|
+
"kind": "number",
|
|
108
|
+
"nodeType": "YulLiteral",
|
|
109
|
+
"src": "158:1:125",
|
|
110
|
+
"type": "",
|
|
111
|
+
"value": "0"
|
|
112
|
+
},
|
|
113
|
+
{
|
|
114
|
+
"kind": "number",
|
|
115
|
+
"nodeType": "YulLiteral",
|
|
116
|
+
"src": "161:1:125",
|
|
117
|
+
"type": "",
|
|
118
|
+
"value": "0"
|
|
119
|
+
}
|
|
120
|
+
],
|
|
121
|
+
"functionName": {
|
|
122
|
+
"name": "revert",
|
|
123
|
+
"nodeType": "YulIdentifier",
|
|
124
|
+
"src": "151:6:125"
|
|
125
|
+
},
|
|
126
|
+
"nodeType": "YulFunctionCall",
|
|
127
|
+
"src": "151:12:125"
|
|
128
|
+
},
|
|
129
|
+
"nodeType": "YulExpressionStatement",
|
|
130
|
+
"src": "151:12:125"
|
|
131
|
+
}
|
|
132
|
+
]
|
|
133
|
+
},
|
|
134
|
+
"condition": {
|
|
135
|
+
"arguments": [
|
|
136
|
+
{
|
|
137
|
+
"arguments": [
|
|
138
|
+
{
|
|
139
|
+
"name": "dataEnd",
|
|
140
|
+
"nodeType": "YulIdentifier",
|
|
141
|
+
"src": "124:7:125"
|
|
142
|
+
},
|
|
143
|
+
{
|
|
144
|
+
"name": "headStart",
|
|
145
|
+
"nodeType": "YulIdentifier",
|
|
146
|
+
"src": "133:9:125"
|
|
147
|
+
}
|
|
148
|
+
],
|
|
149
|
+
"functionName": {
|
|
150
|
+
"name": "sub",
|
|
151
|
+
"nodeType": "YulIdentifier",
|
|
152
|
+
"src": "120:3:125"
|
|
153
|
+
},
|
|
154
|
+
"nodeType": "YulFunctionCall",
|
|
155
|
+
"src": "120:23:125"
|
|
156
|
+
},
|
|
157
|
+
{
|
|
158
|
+
"kind": "number",
|
|
159
|
+
"nodeType": "YulLiteral",
|
|
160
|
+
"src": "145:2:125",
|
|
161
|
+
"type": "",
|
|
162
|
+
"value": "32"
|
|
163
|
+
}
|
|
164
|
+
],
|
|
165
|
+
"functionName": {
|
|
166
|
+
"name": "slt",
|
|
167
|
+
"nodeType": "YulIdentifier",
|
|
168
|
+
"src": "116:3:125"
|
|
169
|
+
},
|
|
170
|
+
"nodeType": "YulFunctionCall",
|
|
171
|
+
"src": "116:32:125"
|
|
172
|
+
},
|
|
173
|
+
"nodeType": "YulIf",
|
|
174
|
+
"src": "113:52:125"
|
|
175
|
+
},
|
|
176
|
+
{
|
|
177
|
+
"nodeType": "YulVariableDeclaration",
|
|
178
|
+
"src": "174:37:125",
|
|
179
|
+
"value": {
|
|
180
|
+
"arguments": [
|
|
181
|
+
{
|
|
182
|
+
"name": "headStart",
|
|
183
|
+
"nodeType": "YulIdentifier",
|
|
184
|
+
"src": "201:9:125"
|
|
185
|
+
}
|
|
186
|
+
],
|
|
187
|
+
"functionName": {
|
|
188
|
+
"name": "calldataload",
|
|
189
|
+
"nodeType": "YulIdentifier",
|
|
190
|
+
"src": "188:12:125"
|
|
191
|
+
},
|
|
192
|
+
"nodeType": "YulFunctionCall",
|
|
193
|
+
"src": "188:23:125"
|
|
194
|
+
},
|
|
195
|
+
"variables": [
|
|
196
|
+
{
|
|
197
|
+
"name": "offset",
|
|
198
|
+
"nodeType": "YulTypedName",
|
|
199
|
+
"src": "178:6:125",
|
|
200
|
+
"type": ""
|
|
201
|
+
}
|
|
202
|
+
]
|
|
203
|
+
},
|
|
204
|
+
{
|
|
205
|
+
"nodeType": "YulVariableDeclaration",
|
|
206
|
+
"src": "220:28:125",
|
|
207
|
+
"value": {
|
|
208
|
+
"kind": "number",
|
|
209
|
+
"nodeType": "YulLiteral",
|
|
210
|
+
"src": "230:18:125",
|
|
211
|
+
"type": "",
|
|
212
|
+
"value": "0xffffffffffffffff"
|
|
213
|
+
},
|
|
214
|
+
"variables": [
|
|
215
|
+
{
|
|
216
|
+
"name": "_1",
|
|
217
|
+
"nodeType": "YulTypedName",
|
|
218
|
+
"src": "224:2:125",
|
|
219
|
+
"type": ""
|
|
220
|
+
}
|
|
221
|
+
]
|
|
222
|
+
},
|
|
223
|
+
{
|
|
224
|
+
"body": {
|
|
225
|
+
"nodeType": "YulBlock",
|
|
226
|
+
"src": "275:16:125",
|
|
227
|
+
"statements": [
|
|
228
|
+
{
|
|
229
|
+
"expression": {
|
|
230
|
+
"arguments": [
|
|
231
|
+
{
|
|
232
|
+
"kind": "number",
|
|
233
|
+
"nodeType": "YulLiteral",
|
|
234
|
+
"src": "284:1:125",
|
|
235
|
+
"type": "",
|
|
236
|
+
"value": "0"
|
|
237
|
+
},
|
|
238
|
+
{
|
|
239
|
+
"kind": "number",
|
|
240
|
+
"nodeType": "YulLiteral",
|
|
241
|
+
"src": "287:1:125",
|
|
242
|
+
"type": "",
|
|
243
|
+
"value": "0"
|
|
244
|
+
}
|
|
245
|
+
],
|
|
246
|
+
"functionName": {
|
|
247
|
+
"name": "revert",
|
|
248
|
+
"nodeType": "YulIdentifier",
|
|
249
|
+
"src": "277:6:125"
|
|
250
|
+
},
|
|
251
|
+
"nodeType": "YulFunctionCall",
|
|
252
|
+
"src": "277:12:125"
|
|
253
|
+
},
|
|
254
|
+
"nodeType": "YulExpressionStatement",
|
|
255
|
+
"src": "277:12:125"
|
|
256
|
+
}
|
|
257
|
+
]
|
|
258
|
+
},
|
|
259
|
+
"condition": {
|
|
260
|
+
"arguments": [
|
|
261
|
+
{
|
|
262
|
+
"name": "offset",
|
|
263
|
+
"nodeType": "YulIdentifier",
|
|
264
|
+
"src": "263:6:125"
|
|
265
|
+
},
|
|
266
|
+
{
|
|
267
|
+
"name": "_1",
|
|
268
|
+
"nodeType": "YulIdentifier",
|
|
269
|
+
"src": "271:2:125"
|
|
270
|
+
}
|
|
271
|
+
],
|
|
272
|
+
"functionName": {
|
|
273
|
+
"name": "gt",
|
|
274
|
+
"nodeType": "YulIdentifier",
|
|
275
|
+
"src": "260:2:125"
|
|
276
|
+
},
|
|
277
|
+
"nodeType": "YulFunctionCall",
|
|
278
|
+
"src": "260:14:125"
|
|
279
|
+
},
|
|
280
|
+
"nodeType": "YulIf",
|
|
281
|
+
"src": "257:34:125"
|
|
282
|
+
},
|
|
283
|
+
{
|
|
284
|
+
"nodeType": "YulVariableDeclaration",
|
|
285
|
+
"src": "300:32:125",
|
|
286
|
+
"value": {
|
|
287
|
+
"arguments": [
|
|
288
|
+
{
|
|
289
|
+
"name": "headStart",
|
|
290
|
+
"nodeType": "YulIdentifier",
|
|
291
|
+
"src": "314:9:125"
|
|
292
|
+
},
|
|
293
|
+
{
|
|
294
|
+
"name": "offset",
|
|
295
|
+
"nodeType": "YulIdentifier",
|
|
296
|
+
"src": "325:6:125"
|
|
297
|
+
}
|
|
298
|
+
],
|
|
299
|
+
"functionName": {
|
|
300
|
+
"name": "add",
|
|
301
|
+
"nodeType": "YulIdentifier",
|
|
302
|
+
"src": "310:3:125"
|
|
303
|
+
},
|
|
304
|
+
"nodeType": "YulFunctionCall",
|
|
305
|
+
"src": "310:22:125"
|
|
306
|
+
},
|
|
307
|
+
"variables": [
|
|
308
|
+
{
|
|
309
|
+
"name": "_2",
|
|
310
|
+
"nodeType": "YulTypedName",
|
|
311
|
+
"src": "304:2:125",
|
|
312
|
+
"type": ""
|
|
313
|
+
}
|
|
314
|
+
]
|
|
315
|
+
},
|
|
316
|
+
{
|
|
317
|
+
"body": {
|
|
318
|
+
"nodeType": "YulBlock",
|
|
319
|
+
"src": "380:16:125",
|
|
320
|
+
"statements": [
|
|
321
|
+
{
|
|
322
|
+
"expression": {
|
|
323
|
+
"arguments": [
|
|
324
|
+
{
|
|
325
|
+
"kind": "number",
|
|
326
|
+
"nodeType": "YulLiteral",
|
|
327
|
+
"src": "389:1:125",
|
|
328
|
+
"type": "",
|
|
329
|
+
"value": "0"
|
|
330
|
+
},
|
|
331
|
+
{
|
|
332
|
+
"kind": "number",
|
|
333
|
+
"nodeType": "YulLiteral",
|
|
334
|
+
"src": "392:1:125",
|
|
335
|
+
"type": "",
|
|
336
|
+
"value": "0"
|
|
337
|
+
}
|
|
338
|
+
],
|
|
339
|
+
"functionName": {
|
|
340
|
+
"name": "revert",
|
|
341
|
+
"nodeType": "YulIdentifier",
|
|
342
|
+
"src": "382:6:125"
|
|
343
|
+
},
|
|
344
|
+
"nodeType": "YulFunctionCall",
|
|
345
|
+
"src": "382:12:125"
|
|
346
|
+
},
|
|
347
|
+
"nodeType": "YulExpressionStatement",
|
|
348
|
+
"src": "382:12:125"
|
|
349
|
+
}
|
|
350
|
+
]
|
|
351
|
+
},
|
|
352
|
+
"condition": {
|
|
353
|
+
"arguments": [
|
|
354
|
+
{
|
|
355
|
+
"arguments": [
|
|
356
|
+
{
|
|
357
|
+
"arguments": [
|
|
358
|
+
{
|
|
359
|
+
"name": "_2",
|
|
360
|
+
"nodeType": "YulIdentifier",
|
|
361
|
+
"src": "359:2:125"
|
|
362
|
+
},
|
|
363
|
+
{
|
|
364
|
+
"kind": "number",
|
|
365
|
+
"nodeType": "YulLiteral",
|
|
366
|
+
"src": "363:4:125",
|
|
367
|
+
"type": "",
|
|
368
|
+
"value": "0x1f"
|
|
369
|
+
}
|
|
370
|
+
],
|
|
371
|
+
"functionName": {
|
|
372
|
+
"name": "add",
|
|
373
|
+
"nodeType": "YulIdentifier",
|
|
374
|
+
"src": "355:3:125"
|
|
375
|
+
},
|
|
376
|
+
"nodeType": "YulFunctionCall",
|
|
377
|
+
"src": "355:13:125"
|
|
378
|
+
},
|
|
379
|
+
{
|
|
380
|
+
"name": "dataEnd",
|
|
381
|
+
"nodeType": "YulIdentifier",
|
|
382
|
+
"src": "370:7:125"
|
|
383
|
+
}
|
|
384
|
+
],
|
|
385
|
+
"functionName": {
|
|
386
|
+
"name": "slt",
|
|
387
|
+
"nodeType": "YulIdentifier",
|
|
388
|
+
"src": "351:3:125"
|
|
389
|
+
},
|
|
390
|
+
"nodeType": "YulFunctionCall",
|
|
391
|
+
"src": "351:27:125"
|
|
392
|
+
}
|
|
393
|
+
],
|
|
394
|
+
"functionName": {
|
|
395
|
+
"name": "iszero",
|
|
396
|
+
"nodeType": "YulIdentifier",
|
|
397
|
+
"src": "344:6:125"
|
|
398
|
+
},
|
|
399
|
+
"nodeType": "YulFunctionCall",
|
|
400
|
+
"src": "344:35:125"
|
|
401
|
+
},
|
|
402
|
+
"nodeType": "YulIf",
|
|
403
|
+
"src": "341:55:125"
|
|
404
|
+
},
|
|
405
|
+
{
|
|
406
|
+
"nodeType": "YulVariableDeclaration",
|
|
407
|
+
"src": "405:30:125",
|
|
408
|
+
"value": {
|
|
409
|
+
"arguments": [
|
|
410
|
+
{
|
|
411
|
+
"name": "_2",
|
|
412
|
+
"nodeType": "YulIdentifier",
|
|
413
|
+
"src": "432:2:125"
|
|
414
|
+
}
|
|
415
|
+
],
|
|
416
|
+
"functionName": {
|
|
417
|
+
"name": "calldataload",
|
|
418
|
+
"nodeType": "YulIdentifier",
|
|
419
|
+
"src": "419:12:125"
|
|
420
|
+
},
|
|
421
|
+
"nodeType": "YulFunctionCall",
|
|
422
|
+
"src": "419:16:125"
|
|
423
|
+
},
|
|
424
|
+
"variables": [
|
|
425
|
+
{
|
|
426
|
+
"name": "length",
|
|
427
|
+
"nodeType": "YulTypedName",
|
|
428
|
+
"src": "409:6:125",
|
|
429
|
+
"type": ""
|
|
430
|
+
}
|
|
431
|
+
]
|
|
432
|
+
},
|
|
433
|
+
{
|
|
434
|
+
"body": {
|
|
435
|
+
"nodeType": "YulBlock",
|
|
436
|
+
"src": "462:16:125",
|
|
437
|
+
"statements": [
|
|
438
|
+
{
|
|
439
|
+
"expression": {
|
|
440
|
+
"arguments": [
|
|
441
|
+
{
|
|
442
|
+
"kind": "number",
|
|
443
|
+
"nodeType": "YulLiteral",
|
|
444
|
+
"src": "471:1:125",
|
|
445
|
+
"type": "",
|
|
446
|
+
"value": "0"
|
|
447
|
+
},
|
|
448
|
+
{
|
|
449
|
+
"kind": "number",
|
|
450
|
+
"nodeType": "YulLiteral",
|
|
451
|
+
"src": "474:1:125",
|
|
452
|
+
"type": "",
|
|
453
|
+
"value": "0"
|
|
454
|
+
}
|
|
455
|
+
],
|
|
456
|
+
"functionName": {
|
|
457
|
+
"name": "revert",
|
|
458
|
+
"nodeType": "YulIdentifier",
|
|
459
|
+
"src": "464:6:125"
|
|
460
|
+
},
|
|
461
|
+
"nodeType": "YulFunctionCall",
|
|
462
|
+
"src": "464:12:125"
|
|
463
|
+
},
|
|
464
|
+
"nodeType": "YulExpressionStatement",
|
|
465
|
+
"src": "464:12:125"
|
|
466
|
+
}
|
|
467
|
+
]
|
|
468
|
+
},
|
|
469
|
+
"condition": {
|
|
470
|
+
"arguments": [
|
|
471
|
+
{
|
|
472
|
+
"name": "length",
|
|
473
|
+
"nodeType": "YulIdentifier",
|
|
474
|
+
"src": "450:6:125"
|
|
475
|
+
},
|
|
476
|
+
{
|
|
477
|
+
"name": "_1",
|
|
478
|
+
"nodeType": "YulIdentifier",
|
|
479
|
+
"src": "458:2:125"
|
|
480
|
+
}
|
|
481
|
+
],
|
|
482
|
+
"functionName": {
|
|
483
|
+
"name": "gt",
|
|
484
|
+
"nodeType": "YulIdentifier",
|
|
485
|
+
"src": "447:2:125"
|
|
486
|
+
},
|
|
487
|
+
"nodeType": "YulFunctionCall",
|
|
488
|
+
"src": "447:14:125"
|
|
489
|
+
},
|
|
490
|
+
"nodeType": "YulIf",
|
|
491
|
+
"src": "444:34:125"
|
|
492
|
+
},
|
|
493
|
+
{
|
|
494
|
+
"body": {
|
|
495
|
+
"nodeType": "YulBlock",
|
|
496
|
+
"src": "528:16:125",
|
|
497
|
+
"statements": [
|
|
498
|
+
{
|
|
499
|
+
"expression": {
|
|
500
|
+
"arguments": [
|
|
501
|
+
{
|
|
502
|
+
"kind": "number",
|
|
503
|
+
"nodeType": "YulLiteral",
|
|
504
|
+
"src": "537:1:125",
|
|
505
|
+
"type": "",
|
|
506
|
+
"value": "0"
|
|
507
|
+
},
|
|
508
|
+
{
|
|
509
|
+
"kind": "number",
|
|
510
|
+
"nodeType": "YulLiteral",
|
|
511
|
+
"src": "540:1:125",
|
|
512
|
+
"type": "",
|
|
513
|
+
"value": "0"
|
|
514
|
+
}
|
|
515
|
+
],
|
|
516
|
+
"functionName": {
|
|
517
|
+
"name": "revert",
|
|
518
|
+
"nodeType": "YulIdentifier",
|
|
519
|
+
"src": "530:6:125"
|
|
520
|
+
},
|
|
521
|
+
"nodeType": "YulFunctionCall",
|
|
522
|
+
"src": "530:12:125"
|
|
523
|
+
},
|
|
524
|
+
"nodeType": "YulExpressionStatement",
|
|
525
|
+
"src": "530:12:125"
|
|
526
|
+
}
|
|
527
|
+
]
|
|
528
|
+
},
|
|
529
|
+
"condition": {
|
|
530
|
+
"arguments": [
|
|
531
|
+
{
|
|
532
|
+
"arguments": [
|
|
533
|
+
{
|
|
534
|
+
"arguments": [
|
|
535
|
+
{
|
|
536
|
+
"name": "_2",
|
|
537
|
+
"nodeType": "YulIdentifier",
|
|
538
|
+
"src": "501:2:125"
|
|
539
|
+
},
|
|
540
|
+
{
|
|
541
|
+
"name": "length",
|
|
542
|
+
"nodeType": "YulIdentifier",
|
|
543
|
+
"src": "505:6:125"
|
|
544
|
+
}
|
|
545
|
+
],
|
|
546
|
+
"functionName": {
|
|
547
|
+
"name": "add",
|
|
548
|
+
"nodeType": "YulIdentifier",
|
|
549
|
+
"src": "497:3:125"
|
|
550
|
+
},
|
|
551
|
+
"nodeType": "YulFunctionCall",
|
|
552
|
+
"src": "497:15:125"
|
|
553
|
+
},
|
|
554
|
+
{
|
|
555
|
+
"kind": "number",
|
|
556
|
+
"nodeType": "YulLiteral",
|
|
557
|
+
"src": "514:2:125",
|
|
558
|
+
"type": "",
|
|
559
|
+
"value": "32"
|
|
560
|
+
}
|
|
561
|
+
],
|
|
562
|
+
"functionName": {
|
|
563
|
+
"name": "add",
|
|
564
|
+
"nodeType": "YulIdentifier",
|
|
565
|
+
"src": "493:3:125"
|
|
566
|
+
},
|
|
567
|
+
"nodeType": "YulFunctionCall",
|
|
568
|
+
"src": "493:24:125"
|
|
569
|
+
},
|
|
570
|
+
{
|
|
571
|
+
"name": "dataEnd",
|
|
572
|
+
"nodeType": "YulIdentifier",
|
|
573
|
+
"src": "519:7:125"
|
|
574
|
+
}
|
|
575
|
+
],
|
|
576
|
+
"functionName": {
|
|
577
|
+
"name": "gt",
|
|
578
|
+
"nodeType": "YulIdentifier",
|
|
579
|
+
"src": "490:2:125"
|
|
580
|
+
},
|
|
581
|
+
"nodeType": "YulFunctionCall",
|
|
582
|
+
"src": "490:37:125"
|
|
583
|
+
},
|
|
584
|
+
"nodeType": "YulIf",
|
|
585
|
+
"src": "487:57:125"
|
|
586
|
+
},
|
|
587
|
+
{
|
|
588
|
+
"nodeType": "YulAssignment",
|
|
589
|
+
"src": "553:21:125",
|
|
590
|
+
"value": {
|
|
591
|
+
"arguments": [
|
|
592
|
+
{
|
|
593
|
+
"name": "_2",
|
|
594
|
+
"nodeType": "YulIdentifier",
|
|
595
|
+
"src": "567:2:125"
|
|
596
|
+
},
|
|
597
|
+
{
|
|
598
|
+
"kind": "number",
|
|
599
|
+
"nodeType": "YulLiteral",
|
|
600
|
+
"src": "571:2:125",
|
|
601
|
+
"type": "",
|
|
602
|
+
"value": "32"
|
|
603
|
+
}
|
|
604
|
+
],
|
|
605
|
+
"functionName": {
|
|
606
|
+
"name": "add",
|
|
607
|
+
"nodeType": "YulIdentifier",
|
|
608
|
+
"src": "563:3:125"
|
|
609
|
+
},
|
|
610
|
+
"nodeType": "YulFunctionCall",
|
|
611
|
+
"src": "563:11:125"
|
|
612
|
+
},
|
|
613
|
+
"variableNames": [
|
|
614
|
+
{
|
|
615
|
+
"name": "value0",
|
|
616
|
+
"nodeType": "YulIdentifier",
|
|
617
|
+
"src": "553:6:125"
|
|
618
|
+
}
|
|
619
|
+
]
|
|
620
|
+
},
|
|
621
|
+
{
|
|
622
|
+
"nodeType": "YulAssignment",
|
|
623
|
+
"src": "583:16:125",
|
|
624
|
+
"value": {
|
|
625
|
+
"name": "length",
|
|
626
|
+
"nodeType": "YulIdentifier",
|
|
627
|
+
"src": "593:6:125"
|
|
628
|
+
},
|
|
629
|
+
"variableNames": [
|
|
630
|
+
{
|
|
631
|
+
"name": "value1",
|
|
632
|
+
"nodeType": "YulIdentifier",
|
|
633
|
+
"src": "583:6:125"
|
|
634
|
+
}
|
|
635
|
+
]
|
|
636
|
+
}
|
|
637
|
+
]
|
|
638
|
+
},
|
|
639
|
+
"name": "abi_decode_tuple_t_bytes_calldata_ptr",
|
|
640
|
+
"nodeType": "YulFunctionDefinition",
|
|
641
|
+
"parameters": [
|
|
642
|
+
{
|
|
643
|
+
"name": "headStart",
|
|
644
|
+
"nodeType": "YulTypedName",
|
|
645
|
+
"src": "61:9:125",
|
|
646
|
+
"type": ""
|
|
647
|
+
},
|
|
648
|
+
{
|
|
649
|
+
"name": "dataEnd",
|
|
650
|
+
"nodeType": "YulTypedName",
|
|
651
|
+
"src": "72:7:125",
|
|
652
|
+
"type": ""
|
|
653
|
+
}
|
|
654
|
+
],
|
|
655
|
+
"returnVariables": [
|
|
656
|
+
{
|
|
657
|
+
"name": "value0",
|
|
658
|
+
"nodeType": "YulTypedName",
|
|
659
|
+
"src": "84:6:125",
|
|
660
|
+
"type": ""
|
|
661
|
+
},
|
|
662
|
+
{
|
|
663
|
+
"name": "value1",
|
|
664
|
+
"nodeType": "YulTypedName",
|
|
665
|
+
"src": "92:6:125",
|
|
666
|
+
"type": ""
|
|
667
|
+
}
|
|
668
|
+
],
|
|
669
|
+
"src": "14:591:125"
|
|
670
|
+
},
|
|
671
|
+
{
|
|
672
|
+
"body": {
|
|
673
|
+
"nodeType": "YulBlock",
|
|
674
|
+
"src": "705:92:125",
|
|
675
|
+
"statements": [
|
|
676
|
+
{
|
|
677
|
+
"nodeType": "YulAssignment",
|
|
678
|
+
"src": "715:26:125",
|
|
679
|
+
"value": {
|
|
680
|
+
"arguments": [
|
|
681
|
+
{
|
|
682
|
+
"name": "headStart",
|
|
683
|
+
"nodeType": "YulIdentifier",
|
|
684
|
+
"src": "727:9:125"
|
|
685
|
+
},
|
|
686
|
+
{
|
|
687
|
+
"kind": "number",
|
|
688
|
+
"nodeType": "YulLiteral",
|
|
689
|
+
"src": "738:2:125",
|
|
690
|
+
"type": "",
|
|
691
|
+
"value": "32"
|
|
692
|
+
}
|
|
693
|
+
],
|
|
694
|
+
"functionName": {
|
|
695
|
+
"name": "add",
|
|
696
|
+
"nodeType": "YulIdentifier",
|
|
697
|
+
"src": "723:3:125"
|
|
698
|
+
},
|
|
699
|
+
"nodeType": "YulFunctionCall",
|
|
700
|
+
"src": "723:18:125"
|
|
701
|
+
},
|
|
702
|
+
"variableNames": [
|
|
703
|
+
{
|
|
704
|
+
"name": "tail",
|
|
705
|
+
"nodeType": "YulIdentifier",
|
|
706
|
+
"src": "715:4:125"
|
|
707
|
+
}
|
|
708
|
+
]
|
|
709
|
+
},
|
|
710
|
+
{
|
|
711
|
+
"expression": {
|
|
712
|
+
"arguments": [
|
|
713
|
+
{
|
|
714
|
+
"name": "headStart",
|
|
715
|
+
"nodeType": "YulIdentifier",
|
|
716
|
+
"src": "757:9:125"
|
|
717
|
+
},
|
|
718
|
+
{
|
|
719
|
+
"arguments": [
|
|
720
|
+
{
|
|
721
|
+
"arguments": [
|
|
722
|
+
{
|
|
723
|
+
"name": "value0",
|
|
724
|
+
"nodeType": "YulIdentifier",
|
|
725
|
+
"src": "782:6:125"
|
|
726
|
+
}
|
|
727
|
+
],
|
|
728
|
+
"functionName": {
|
|
729
|
+
"name": "iszero",
|
|
730
|
+
"nodeType": "YulIdentifier",
|
|
731
|
+
"src": "775:6:125"
|
|
732
|
+
},
|
|
733
|
+
"nodeType": "YulFunctionCall",
|
|
734
|
+
"src": "775:14:125"
|
|
735
|
+
}
|
|
736
|
+
],
|
|
737
|
+
"functionName": {
|
|
738
|
+
"name": "iszero",
|
|
739
|
+
"nodeType": "YulIdentifier",
|
|
740
|
+
"src": "768:6:125"
|
|
741
|
+
},
|
|
742
|
+
"nodeType": "YulFunctionCall",
|
|
743
|
+
"src": "768:22:125"
|
|
744
|
+
}
|
|
745
|
+
],
|
|
746
|
+
"functionName": {
|
|
747
|
+
"name": "mstore",
|
|
748
|
+
"nodeType": "YulIdentifier",
|
|
749
|
+
"src": "750:6:125"
|
|
750
|
+
},
|
|
751
|
+
"nodeType": "YulFunctionCall",
|
|
752
|
+
"src": "750:41:125"
|
|
753
|
+
},
|
|
754
|
+
"nodeType": "YulExpressionStatement",
|
|
755
|
+
"src": "750:41:125"
|
|
756
|
+
}
|
|
757
|
+
]
|
|
758
|
+
},
|
|
759
|
+
"name": "abi_encode_tuple_t_bool__to_t_bool__fromStack_reversed",
|
|
760
|
+
"nodeType": "YulFunctionDefinition",
|
|
761
|
+
"parameters": [
|
|
762
|
+
{
|
|
763
|
+
"name": "headStart",
|
|
764
|
+
"nodeType": "YulTypedName",
|
|
765
|
+
"src": "674:9:125",
|
|
766
|
+
"type": ""
|
|
767
|
+
},
|
|
768
|
+
{
|
|
769
|
+
"name": "value0",
|
|
770
|
+
"nodeType": "YulTypedName",
|
|
771
|
+
"src": "685:6:125",
|
|
772
|
+
"type": ""
|
|
773
|
+
}
|
|
774
|
+
],
|
|
775
|
+
"returnVariables": [
|
|
776
|
+
{
|
|
777
|
+
"name": "tail",
|
|
778
|
+
"nodeType": "YulTypedName",
|
|
779
|
+
"src": "696:4:125",
|
|
780
|
+
"type": ""
|
|
781
|
+
}
|
|
782
|
+
],
|
|
783
|
+
"src": "610:187:125"
|
|
784
|
+
}
|
|
785
|
+
]
|
|
786
|
+
},
|
|
787
|
+
"contents": "{\n { }\n function abi_decode_tuple_t_bytes_calldata_ptr(headStart, dataEnd) -> value0, value1\n {\n if slt(sub(dataEnd, headStart), 32) { revert(0, 0) }\n let offset := calldataload(headStart)\n let _1 := 0xffffffffffffffff\n if gt(offset, _1) { revert(0, 0) }\n let _2 := add(headStart, offset)\n if iszero(slt(add(_2, 0x1f), dataEnd)) { revert(0, 0) }\n let length := calldataload(_2)\n if gt(length, _1) { revert(0, 0) }\n if gt(add(add(_2, length), 32), dataEnd) { revert(0, 0) }\n value0 := add(_2, 32)\n value1 := length\n }\n function abi_encode_tuple_t_bool__to_t_bool__fromStack_reversed(headStart, value0) -> tail\n {\n tail := add(headStart, 32)\n mstore(headStart, iszero(iszero(value0)))\n }\n}",
|
|
788
|
+
"id": 125,
|
|
789
|
+
"language": "Yul",
|
|
790
|
+
"name": "#utility.yul"
|
|
791
|
+
}
|
|
792
|
+
],
|
|
793
|
+
"immutableReferences": {},
|
|
794
|
+
"linkReferences": {},
|
|
795
|
+
"opcodes": "PUSH1 0x80 PUSH1 0x40 MSTORE CALLVALUE DUP1 ISZERO PUSH2 0x10 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST POP PUSH1 0x4 CALLDATASIZE LT PUSH2 0x2B JUMPI PUSH1 0x0 CALLDATALOAD PUSH1 0xE0 SHR DUP1 PUSH4 0xEA5BF849 EQ PUSH2 0x30 JUMPI JUMPDEST PUSH1 0x0 DUP1 REVERT JUMPDEST PUSH2 0x43 PUSH2 0x3E CALLDATASIZE PUSH1 0x4 PUSH2 0x10B JUMP JUMPDEST PUSH2 0x57 JUMP JUMPDEST PUSH1 0x40 MLOAD SWAP1 ISZERO ISZERO DUP2 MSTORE PUSH1 0x20 ADD PUSH1 0x40 MLOAD DUP1 SWAP2 SUB SWAP1 RETURN JUMPDEST PUSH1 0x0 PUSH2 0x63 DUP4 DUP4 PUSH2 0x6C JUMP JUMPDEST SWAP1 POP JUMPDEST SWAP3 SWAP2 POP POP JUMP JUMPDEST PUSH1 0x0 PUSH1 0x10 DUP3 EQ PUSH2 0x7E JUMPI POP PUSH1 0x0 PUSH2 0x66 JUMP JUMPDEST PUSH2 0xC2 PUSH1 0x0 DUP5 DUP5 DUP1 DUP1 PUSH1 0x1F ADD PUSH1 0x20 DUP1 SWAP2 DIV MUL PUSH1 0x20 ADD PUSH1 0x40 MLOAD SWAP1 DUP2 ADD PUSH1 0x40 MSTORE DUP1 SWAP4 SWAP3 SWAP2 SWAP1 DUP2 DUP2 MSTORE PUSH1 0x20 ADD DUP4 DUP4 DUP1 DUP3 DUP5 CALLDATACOPY PUSH1 0x0 SWAP3 ADD SWAP2 SWAP1 SWAP2 MSTORE POP SWAP3 SWAP4 SWAP3 POP POP PUSH2 0xFC SWAP1 POP JUMP JUMPDEST PUSH32 0xFFFFFFFFFFFFFFFF000000000000000000000000000000000000000000000000 SWAP1 DUP2 AND EQ PUSH2 0xF3 JUMPI POP PUSH1 0x0 PUSH2 0x66 JUMP JUMPDEST POP PUSH1 0x1 SWAP3 SWAP2 POP POP JUMP JUMPDEST PUSH1 0x0 PUSH2 0x63 DUP4 DUP4 ADD PUSH1 0x20 ADD MLOAD SWAP1 JUMP JUMPDEST PUSH1 0x0 DUP1 PUSH1 0x20 DUP4 DUP6 SUB SLT ISZERO PUSH2 0x11E JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST DUP3 CALLDATALOAD PUSH8 0xFFFFFFFFFFFFFFFF DUP1 DUP3 GT ISZERO PUSH2 0x136 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST DUP2 DUP6 ADD SWAP2 POP DUP6 PUSH1 0x1F DUP4 ADD SLT PUSH2 0x14A JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST DUP2 CALLDATALOAD DUP2 DUP2 GT ISZERO PUSH2 0x159 JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST DUP7 PUSH1 0x20 DUP3 DUP6 ADD ADD GT ISZERO PUSH2 0x16B JUMPI PUSH1 0x0 DUP1 REVERT JUMPDEST PUSH1 0x20 SWAP3 SWAP1 SWAP3 ADD SWAP7 SWAP2 SWAP6 POP SWAP1 SWAP4 POP POP POP POP JUMP INVALID LOG2 PUSH5 0x6970667358 0x22 SLT KECCAK256 PUSH17 0xB2F1B2D2AB237110E2D7405365B63E1231 DIFFICULTY NOT DUP13 0x24 NOT 0xD4 EXTCODEHASH 0xDC CODECOPY PUSH28 0x756C316C64736F6C6343000811003300000000000000000000000000 ",
|
|
796
|
+
"sourceMap": "178:209:112:-:0;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;207:178;;;;;;:::i;:::-;;:::i;:::-;;;775:14:125;;768:22;750:41;;738:2;723:18;207:178:112;;;;;;;;309:4;336:42;370:7;;336:33;:42::i;:::-;329:49;;207:178;;;;;:::o;4689:307:92:-;4793:4;4835:2;4817:20;;4813:63;;-1:-1:-1;4860:5:92;4853:12;;4813:63;4890:17;4905:1;4890:7;;:14;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;-1:-1:-1;4890:14:92;;:17;-1:-1:-1;;4890:14:92;:17;-1:-1:-1;4890:17:92:i;:::-;:39;;;;;4886:82;;-1:-1:-1;4952:5:92;4945:12;;4886:82;-1:-1:-1;4985:4:92;4689:307;;;;:::o;12875:136:1:-;12948:6;12980:23;12988:6;12996;12550:28;12566:2;12550:28;12544:35;;12417:178;14:591:125;84:6;92;145:2;133:9;124:7;120:23;116:32;113:52;;;161:1;158;151:12;113:52;201:9;188:23;230:18;271:2;263:6;260:14;257:34;;;287:1;284;277:12;257:34;325:6;314:9;310:22;300:32;;370:7;363:4;359:2;355:13;351:27;341:55;;392:1;389;382:12;341:55;432:2;419:16;458:2;450:6;447:14;444:34;;;474:1;471;464:12;444:34;519:7;514:2;505:6;501:2;497:15;493:24;490:37;487:57;;;540:1;537;530:12;487:57;571:2;563:11;;;;;593:6;;-1:-1:-1;14:591:125;;-1:-1:-1;;;;14:591:125:o"
|
|
797
|
+
},
|
|
798
|
+
"gasEstimates": {
|
|
799
|
+
"creation": {
|
|
800
|
+
"codeDepositCost": "87000",
|
|
801
|
+
"executionCost": "135",
|
|
802
|
+
"totalCost": "87135"
|
|
803
|
+
},
|
|
804
|
+
"external": {
|
|
805
|
+
"isValidHeartbeatMessage(bytes)": "infinite"
|
|
806
|
+
}
|
|
807
|
+
},
|
|
808
|
+
"methodIdentifiers": {
|
|
809
|
+
"isValidHeartbeatMessage(bytes)": "ea5bf849"
|
|
810
|
+
}
|
|
811
|
+
},
|
|
812
|
+
"metadata": "{\"compiler\":{\"version\":\"0.8.17+commit.8df45f5f\"},\"language\":\"Solidity\",\"output\":{\"abi\":[{\"inputs\":[{\"internalType\":\"bytes\",\"name\":\"message\",\"type\":\"bytes\"}],\"name\":\"isValidHeartbeatMessage\",\"outputs\":[{\"internalType\":\"bool\",\"name\":\"\",\"type\":\"bool\"}],\"stateMutability\":\"pure\",\"type\":\"function\"}],\"devdoc\":{\"details\":\"This is a contract implemented to test Heartbeat library directly.\",\"kind\":\"dev\",\"methods\":{},\"version\":1},\"userdoc\":{\"kind\":\"user\",\"methods\":{},\"version\":1}},\"settings\":{\"compilationTarget\":{\"contracts/test/HeartbeatStub.sol\":\"HeartbeatStub\"},\"evmVersion\":\"london\",\"libraries\":{},\"metadata\":{\"bytecodeHash\":\"ipfs\",\"useLiteralContent\":true},\"optimizer\":{\"enabled\":true,\"runs\":1000},\"remappings\":[]},\"sources\":{\"@keep-network/bitcoin-spv-sol/contracts/BytesLib.sol\":{\"content\":\"pragma solidity ^0.8.4;\\n\\n/*\\n\\nhttps://github.com/GNSPS/solidity-bytes-utils/\\n\\nThis is free and unencumbered software released into the public domain.\\n\\nAnyone is free to copy, modify, publish, use, compile, sell, or\\ndistribute this software, either in source code form or as a compiled\\nbinary, for any purpose, commercial or non-commercial, and by any\\nmeans.\\n\\nIn jurisdictions that recognize copyright laws, the author or authors\\nof this software dedicate any and all copyright interest in the\\nsoftware to the public domain. We make this dedication for the benefit\\nof the public at large and to the detriment of our heirs and\\nsuccessors. We intend this dedication to be an overt act of\\nrelinquishment in perpetuity of all present and future rights to this\\nsoftware under copyright law.\\n\\nTHE SOFTWARE IS PROVIDED \\\"AS IS\\\", WITHOUT WARRANTY OF ANY KIND,\\nEXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF\\nMERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.\\nIN NO EVENT SHALL THE AUTHORS BE LIABLE FOR ANY CLAIM, DAMAGES OR\\nOTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE,\\nARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR\\nOTHER DEALINGS IN THE SOFTWARE.\\n\\nFor more information, please refer to <https://unlicense.org>\\n*/\\n\\n\\n/** @title BytesLib **/\\n/** @author https://github.com/GNSPS **/\\n\\nlibrary BytesLib {\\n function concat(bytes memory _preBytes, bytes memory _postBytes) internal pure returns (bytes memory) {\\n bytes memory tempBytes;\\n\\n assembly {\\n // Get a location of some free memory and store it in tempBytes as\\n // Solidity does for memory variables.\\n tempBytes := mload(0x40)\\n\\n // Store the length of the first bytes array at the beginning of\\n // the memory for tempBytes.\\n let length := mload(_preBytes)\\n mstore(tempBytes, length)\\n\\n // Maintain a memory counter for the current write location in the\\n // temp bytes array by adding the 32 bytes for the array length to\\n // the starting location.\\n let mc := add(tempBytes, 0x20)\\n // Stop copying when the memory counter reaches the length of the\\n // first bytes array.\\n let end := add(mc, length)\\n\\n for {\\n // Initialize a copy counter to the start of the _preBytes data,\\n // 32 bytes into its memory.\\n let cc := add(_preBytes, 0x20)\\n } lt(mc, end) {\\n // Increase both counters by 32 bytes each iteration.\\n mc := add(mc, 0x20)\\n cc := add(cc, 0x20)\\n } {\\n // Write the _preBytes data into the tempBytes memory 32 bytes\\n // at a time.\\n mstore(mc, mload(cc))\\n }\\n\\n // Add the length of _postBytes to the current length of tempBytes\\n // and store it as the new length in the first 32 bytes of the\\n // tempBytes memory.\\n length := mload(_postBytes)\\n mstore(tempBytes, add(length, mload(tempBytes)))\\n\\n // Move the memory counter back from a multiple of 0x20 to the\\n // actual end of the _preBytes data.\\n mc := end\\n // Stop copying when the memory counter reaches the new combined\\n // length of the arrays.\\n end := add(mc, length)\\n\\n for {\\n let cc := add(_postBytes, 0x20)\\n } lt(mc, end) {\\n mc := add(mc, 0x20)\\n cc := add(cc, 0x20)\\n } {\\n mstore(mc, mload(cc))\\n }\\n\\n // Update the free-memory pointer by padding our last write location\\n // to 32 bytes: add 31 bytes to the end of tempBytes to move to the\\n // next 32 byte block, then round down to the nearest multiple of\\n // 32. If the sum of the length of the two arrays is zero then add\\n // one before rounding down to leave a blank 32 bytes (the length block with 0).\\n mstore(0x40, and(\\n add(add(end, iszero(add(length, mload(_preBytes)))), 31),\\n not(31) // Round down to the nearest 32 bytes.\\n ))\\n }\\n\\n return tempBytes;\\n }\\n\\n function concatStorage(bytes storage _preBytes, bytes memory _postBytes) internal {\\n assembly {\\n // Read the first 32 bytes of _preBytes storage, which is the length\\n // of the array. (We don't need to use the offset into the slot\\n // because arrays use the entire slot.)\\n let fslot := sload(_preBytes.slot)\\n // Arrays of 31 bytes or less have an even value in their slot,\\n // while longer arrays have an odd value. The actual length is\\n // the slot divided by two for odd values, and the lowest order\\n // byte divided by two for even values.\\n // If the slot is even, bitwise and the slot with 255 and divide by\\n // two to get the length. If the slot is odd, bitwise and the slot\\n // with -1 and divide by two.\\n let slength := div(and(fslot, sub(mul(0x100, iszero(and(fslot, 1))), 1)), 2)\\n let mlength := mload(_postBytes)\\n let newlength := add(slength, mlength)\\n // slength can contain both the length and contents of the array\\n // if length < 32 bytes so let's prepare for that\\n // v. http://solidity.readthedocs.io/en/latest/miscellaneous.html#layout-of-state-variables-in-storage\\n switch add(lt(slength, 32), lt(newlength, 32))\\n case 2 {\\n // Since the new array still fits in the slot, we just need to\\n // update the contents of the slot.\\n // uint256(bytes_storage) = uint256(bytes_storage) + uint256(bytes_memory) + new_length\\n sstore(\\n _preBytes.slot,\\n // all the modifications to the slot are inside this\\n // next block\\n add(\\n // we can just add to the slot contents because the\\n // bytes we want to change are the LSBs\\n fslot,\\n add(\\n mul(\\n div(\\n // load the bytes from memory\\n mload(add(_postBytes, 0x20)),\\n // zero all bytes to the right\\n exp(0x100, sub(32, mlength))\\n ),\\n // and now shift left the number of bytes to\\n // leave space for the length in the slot\\n exp(0x100, sub(32, newlength))\\n ),\\n // increase length by the double of the memory\\n // bytes length\\n mul(mlength, 2)\\n )\\n )\\n )\\n }\\n case 1 {\\n // The stored value fits in the slot, but the combined value\\n // will exceed it.\\n // get the keccak hash to get the contents of the array\\n mstore(0x0, _preBytes.slot)\\n let sc := add(keccak256(0x0, 0x20), div(slength, 32))\\n\\n // save new length\\n sstore(_preBytes.slot, add(mul(newlength, 2), 1))\\n\\n // The contents of the _postBytes array start 32 bytes into\\n // the structure. Our first read should obtain the `submod`\\n // bytes that can fit into the unused space in the last word\\n // of the stored array. To get this, we read 32 bytes starting\\n // from `submod`, so the data we read overlaps with the array\\n // contents by `submod` bytes. Masking the lowest-order\\n // `submod` bytes allows us to add that value directly to the\\n // stored value.\\n\\n let submod := sub(32, slength)\\n let mc := add(_postBytes, submod)\\n let end := add(_postBytes, mlength)\\n let mask := sub(exp(0x100, submod), 1)\\n\\n sstore(\\n sc,\\n add(\\n and(\\n fslot,\\n 0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00\\n ),\\n and(mload(mc), mask)\\n )\\n )\\n\\n for {\\n mc := add(mc, 0x20)\\n sc := add(sc, 1)\\n } lt(mc, end) {\\n sc := add(sc, 1)\\n mc := add(mc, 0x20)\\n } {\\n sstore(sc, mload(mc))\\n }\\n\\n mask := exp(0x100, sub(mc, end))\\n\\n sstore(sc, mul(div(mload(mc), mask), mask))\\n }\\n default {\\n // get the keccak hash to get the contents of the array\\n mstore(0x0, _preBytes.slot)\\n // Start copying to the last used word of the stored array.\\n let sc := add(keccak256(0x0, 0x20), div(slength, 32))\\n\\n // save new length\\n sstore(_preBytes.slot, add(mul(newlength, 2), 1))\\n\\n // Copy over the first `submod` bytes of the new data as in\\n // case 1 above.\\n let slengthmod := mod(slength, 32)\\n let mlengthmod := mod(mlength, 32)\\n let submod := sub(32, slengthmod)\\n let mc := add(_postBytes, submod)\\n let end := add(_postBytes, mlength)\\n let mask := sub(exp(0x100, submod), 1)\\n\\n sstore(sc, add(sload(sc), and(mload(mc), mask)))\\n\\n for {\\n sc := add(sc, 1)\\n mc := add(mc, 0x20)\\n } lt(mc, end) {\\n sc := add(sc, 1)\\n mc := add(mc, 0x20)\\n } {\\n sstore(sc, mload(mc))\\n }\\n\\n mask := exp(0x100, sub(mc, end))\\n\\n sstore(sc, mul(div(mload(mc), mask), mask))\\n }\\n }\\n }\\n\\n function slice(bytes memory _bytes, uint _start, uint _length) internal pure returns (bytes memory res) {\\n if (_length == 0) {\\n return hex\\\"\\\";\\n }\\n uint _end = _start + _length;\\n require(_end > _start && _bytes.length >= _end, \\\"Slice out of bounds\\\");\\n\\n assembly {\\n // Alloc bytes array with additional 32 bytes afterspace and assign it's size\\n res := mload(0x40)\\n mstore(0x40, add(add(res, 64), _length))\\n mstore(res, _length)\\n\\n // Compute distance between source and destination pointers\\n let diff := sub(res, add(_bytes, _start))\\n\\n for {\\n let src := add(add(_bytes, 32), _start)\\n let end := add(src, _length)\\n } lt(src, end) {\\n src := add(src, 32)\\n } {\\n mstore(add(src, diff), mload(src))\\n }\\n }\\n }\\n\\n /// @notice Take a slice of the byte array, overwriting the destination.\\n /// The length of the slice will equal the length of the destination array.\\n /// @dev Make sure the destination array has afterspace if required.\\n /// @param _bytes The source array\\n /// @param _dest The destination array.\\n /// @param _start The location to start in the source array.\\n function sliceInPlace(\\n bytes memory _bytes,\\n bytes memory _dest,\\n uint _start\\n ) internal pure {\\n uint _length = _dest.length;\\n uint _end = _start + _length;\\n require(_end > _start && _bytes.length >= _end, \\\"Slice out of bounds\\\");\\n\\n assembly {\\n for {\\n let src := add(add(_bytes, 32), _start)\\n let res := add(_dest, 32)\\n let end := add(src, _length)\\n } lt(src, end) {\\n src := add(src, 32)\\n res := add(res, 32)\\n } {\\n mstore(res, mload(src))\\n }\\n }\\n }\\n\\n // Static slice functions, no bounds checking\\n /// @notice take a 32-byte slice from the specified position\\n function slice32(bytes memory _bytes, uint _start) internal pure returns (bytes32 res) {\\n assembly {\\n res := mload(add(add(_bytes, 32), _start))\\n }\\n }\\n\\n /// @notice take a 20-byte slice from the specified position\\n function slice20(bytes memory _bytes, uint _start) internal pure returns (bytes20) {\\n return bytes20(slice32(_bytes, _start));\\n }\\n\\n /// @notice take a 8-byte slice from the specified position\\n function slice8(bytes memory _bytes, uint _start) internal pure returns (bytes8) {\\n return bytes8(slice32(_bytes, _start));\\n }\\n\\n /// @notice take a 4-byte slice from the specified position\\n function slice4(bytes memory _bytes, uint _start) internal pure returns (bytes4) {\\n return bytes4(slice32(_bytes, _start));\\n }\\n\\n /// @notice take a 3-byte slice from the specified position\\n function slice3(bytes memory _bytes, uint _start) internal pure returns (bytes3) {\\n return bytes3(slice32(_bytes, _start));\\n }\\n\\n /// @notice take a 2-byte slice from the specified position\\n function slice2(bytes memory _bytes, uint _start) internal pure returns (bytes2) {\\n return bytes2(slice32(_bytes, _start));\\n }\\n\\n function toAddress(bytes memory _bytes, uint _start) internal pure returns (address) {\\n uint _totalLen = _start + 20;\\n require(_totalLen > _start && _bytes.length >= _totalLen, \\\"Address conversion out of bounds.\\\");\\n address tempAddress;\\n\\n assembly {\\n tempAddress := div(mload(add(add(_bytes, 0x20), _start)), 0x1000000000000000000000000)\\n }\\n\\n return tempAddress;\\n }\\n\\n function toUint(bytes memory _bytes, uint _start) internal pure returns (uint256) {\\n uint _totalLen = _start + 32;\\n require(_totalLen > _start && _bytes.length >= _totalLen, \\\"Uint conversion out of bounds.\\\");\\n uint256 tempUint;\\n\\n assembly {\\n tempUint := mload(add(add(_bytes, 0x20), _start))\\n }\\n\\n return tempUint;\\n }\\n\\n function equal(bytes memory _preBytes, bytes memory _postBytes) internal pure returns (bool) {\\n bool success = true;\\n\\n assembly {\\n let length := mload(_preBytes)\\n\\n // if lengths don't match the arrays are not equal\\n switch eq(length, mload(_postBytes))\\n case 1 {\\n // cb is a circuit breaker in the for loop since there's\\n // no said feature for inline assembly loops\\n // cb = 1 - don't breaker\\n // cb = 0 - break\\n let cb := 1\\n\\n let mc := add(_preBytes, 0x20)\\n let end := add(mc, length)\\n\\n for {\\n let cc := add(_postBytes, 0x20)\\n // the next line is the loop condition:\\n // while(uint(mc < end) + cb == 2)\\n } eq(add(lt(mc, end), cb), 2) {\\n mc := add(mc, 0x20)\\n cc := add(cc, 0x20)\\n } {\\n // if any of these checks fails then arrays are not equal\\n if iszero(eq(mload(mc), mload(cc))) {\\n // unsuccess:\\n success := 0\\n cb := 0\\n }\\n }\\n }\\n default {\\n // unsuccess:\\n success := 0\\n }\\n }\\n\\n return success;\\n }\\n\\n function equalStorage(bytes storage _preBytes, bytes memory _postBytes) internal view returns (bool) {\\n bool success = true;\\n\\n assembly {\\n // we know _preBytes_offset is 0\\n let fslot := sload(_preBytes.slot)\\n // Decode the length of the stored array like in concatStorage().\\n let slength := div(and(fslot, sub(mul(0x100, iszero(and(fslot, 1))), 1)), 2)\\n let mlength := mload(_postBytes)\\n\\n // if lengths don't match the arrays are not equal\\n switch eq(slength, mlength)\\n case 1 {\\n // slength can contain both the length and contents of the array\\n // if length < 32 bytes so let's prepare for that\\n // v. http://solidity.readthedocs.io/en/latest/miscellaneous.html#layout-of-state-variables-in-storage\\n if iszero(iszero(slength)) {\\n switch lt(slength, 32)\\n case 1 {\\n // blank the last byte which is the length\\n fslot := mul(div(fslot, 0x100), 0x100)\\n\\n if iszero(eq(fslot, mload(add(_postBytes, 0x20)))) {\\n // unsuccess:\\n success := 0\\n }\\n }\\n default {\\n // cb is a circuit breaker in the for loop since there's\\n // no said feature for inline assembly loops\\n // cb = 1 - don't breaker\\n // cb = 0 - break\\n let cb := 1\\n\\n // get the keccak hash to get the contents of the array\\n mstore(0x0, _preBytes.slot)\\n let sc := keccak256(0x0, 0x20)\\n\\n let mc := add(_postBytes, 0x20)\\n let end := add(mc, mlength)\\n\\n // the next line is the loop condition:\\n // while(uint(mc < end) + cb == 2)\\n for {} eq(add(lt(mc, end), cb), 2) {\\n sc := add(sc, 1)\\n mc := add(mc, 0x20)\\n } {\\n if iszero(eq(sload(sc), mload(mc))) {\\n // unsuccess:\\n success := 0\\n cb := 0\\n }\\n }\\n }\\n }\\n }\\n default {\\n // unsuccess:\\n success := 0\\n }\\n }\\n\\n return success;\\n }\\n\\n function toBytes32(bytes memory _source) pure internal returns (bytes32 result) {\\n if (_source.length == 0) {\\n return 0x0;\\n }\\n\\n assembly {\\n result := mload(add(_source, 32))\\n }\\n }\\n\\n function keccak256Slice(bytes memory _bytes, uint _start, uint _length) pure internal returns (bytes32 result) {\\n uint _end = _start + _length;\\n require(_end > _start && _bytes.length >= _end, \\\"Slice out of bounds\\\");\\n\\n assembly {\\n result := keccak256(add(add(_bytes, 32), _start), _length)\\n }\\n }\\n}\\n\",\"keccak256\":\"0x43e0f3b3b23c861bd031588bf410dfdd02e2af17941a89aa38d70e534e0380d1\"},\"contracts/bridge/Heartbeat.sol\":{\"content\":\"// SPDX-License-Identifier: GPL-3.0-only\\n\\n// \\u2588\\u2588\\u2588\\u2588\\u2588\\u2588\\u2588\\u2588\\u2588\\u2588\\u2588\\u2588\\u2588\\u2588 \\u2590\\u2588\\u2588\\u2588\\u2588\\u258c \\u2588\\u2588\\u2588\\u2588\\u2588\\u2588\\u2588\\u2588\\u2588\\u2588\\u2588\\u2588\\u2588\\u2588\\n// \\u2588\\u2588\\u2588\\u2588\\u2588\\u2588\\u2588\\u2588\\u2588\\u2588\\u2588\\u2588\\u2588\\u2588 \\u2590\\u2588\\u2588\\u2588\\u2588\\u258c \\u2588\\u2588\\u2588\\u2588\\u2588\\u2588\\u2588\\u2588\\u2588\\u2588\\u2588\\u2588\\u2588\\u2588\\n// \\u2590\\u2588\\u2588\\u2588\\u2588\\u258c \\u2590\\u2588\\u2588\\u2588\\u2588\\u258c\\n// \\u2590\\u2588\\u2588\\u2588\\u2588\\u258c \\u2590\\u2588\\u2588\\u2588\\u2588\\u258c\\n// \\u2588\\u2588\\u2588\\u2588\\u2588\\u2588\\u2588\\u2588\\u2588\\u2588\\u2588\\u2588\\u2588\\u2588 \\u2590\\u2588\\u2588\\u2588\\u2588\\u258c \\u2588\\u2588\\u2588\\u2588\\u2588\\u2588\\u2588\\u2588\\u2588\\u2588\\u2588\\u2588\\u2588\\u2588\\n// \\u2588\\u2588\\u2588\\u2588\\u2588\\u2588\\u2588\\u2588\\u2588\\u2588\\u2588\\u2588\\u2588\\u2588 \\u2590\\u2588\\u2588\\u2588\\u2588\\u258c \\u2588\\u2588\\u2588\\u2588\\u2588\\u2588\\u2588\\u2588\\u2588\\u2588\\u2588\\u2588\\u2588\\u2588\\n// \\u2590\\u2588\\u2588\\u2588\\u2588\\u258c \\u2590\\u2588\\u2588\\u2588\\u2588\\u258c\\n// \\u2590\\u2588\\u2588\\u2588\\u2588\\u258c \\u2590\\u2588\\u2588\\u2588\\u2588\\u258c\\n// \\u2590\\u2588\\u2588\\u2588\\u2588\\u258c \\u2590\\u2588\\u2588\\u2588\\u2588\\u258c\\n// \\u2590\\u2588\\u2588\\u2588\\u2588\\u258c \\u2590\\u2588\\u2588\\u2588\\u2588\\u258c\\n// \\u2590\\u2588\\u2588\\u2588\\u2588\\u258c \\u2590\\u2588\\u2588\\u2588\\u2588\\u258c\\n// \\u2590\\u2588\\u2588\\u2588\\u2588\\u258c \\u2590\\u2588\\u2588\\u2588\\u2588\\u258c\\n\\npragma solidity 0.8.17;\\n\\nimport {BytesLib} from \\\"@keep-network/bitcoin-spv-sol/contracts/BytesLib.sol\\\";\\n\\n/// @title Bridge wallet heartbeat\\n/// @notice The library establishes expected format for heartbeat messages\\n/// signed by wallet ECDSA signing group. Heartbeat messages are\\n/// constructed in such a way that they can not be used as a Bitcoin\\n/// transaction preimages.\\n/// @dev The smallest Bitcoin non-coinbase transaction is a one spending an\\n/// OP_TRUE anyonecanspend output and creating 1 OP_TRUE anyonecanspend\\n/// output. Such a transaction has 61 bytes (see `BitcoinTx` documentation):\\n/// 4 bytes for version\\n/// 1 byte for tx_in_count\\n/// 36 bytes for tx_in.previous_output\\n/// 1 byte for tx_in.script_bytes (value: 0)\\n/// 0 bytes for tx_in.signature_script\\n/// 4 bytes for tx_in.sequence\\n/// 1 byte for tx_out_count\\n/// 8 bytes for tx_out.value\\n/// 1 byte for tx_out.pk_script_bytes\\n/// 1 byte for tx_out.pk_script\\n/// 4 bytes for lock_time\\n///\\n///\\n/// The smallest Bitcoin coinbase transaction is a one creating\\n/// 1 OP_TRUE anyonecanspend output and having an empty coinbase script.\\n/// Such a transaction has 65 bytes:\\n/// 4 bytes for version\\n/// 1 byte for tx_in_count\\n/// 32 bytes for tx_in.hash (all 0x00)\\n/// 4 bytes for tx_in.index (all 0xff)\\n/// 1 byte for tx_in.script_bytes (value: 0)\\n/// 4 bytes for tx_in.height\\n/// 0 byte for tx_in.coinbase_script\\n/// 4 bytes for tx_in.sequence\\n/// 1 byte for tx_out_count\\n/// 8 bytes for tx_out.value\\n/// 1 byte for tx_out.pk_script_bytes\\n/// 1 byte for tx_out.pk_script\\n/// 4 bytes for lock_time\\n///\\n///\\n/// A SIGHASH flag is used to indicate which part of the transaction is\\n/// signed by the ECDSA signature. There are currently 3 flags:\\n/// SIGHASH_ALL, SIGHASH_NONE, SIGHASH_SINGLE, and different combinations\\n/// of these flags.\\n///\\n/// No matter the SIGHASH flag and no matter the combination, the following\\n/// fields from the transaction are always included in the constructed\\n/// preimage:\\n/// 4 bytes for version\\n/// 36 bytes for tx_in.previous_output (or tx_in.hash + tx_in.index for coinbase)\\n/// 4 bytes for lock_time\\n///\\n/// Additionally, the last 4 bytes of the preimage determines the SIGHASH\\n/// flag.\\n///\\n/// This is enough to say there is no way the preimage could be shorter\\n/// than 4 + 36 + 4 + 4 = 48 bytes.\\n///\\n/// For this reason, we construct the heartbeat message, as a 16-byte\\n/// message. The first 8 bytes are 0xffffffffffffffff. The last 8 bytes\\n/// are for an arbitrary uint64, being a signed heartbeat nonce (for\\n/// example, the last Ethereum block hash).\\n///\\n/// The message being signed by the wallet when executing the heartbeat\\n/// protocol should be Bitcoin's hash256 (double SHA-256) of the heartbeat\\n/// message:\\n/// heartbeat_sighash = hash256(heartbeat_message)\\nlibrary Heartbeat {\\n using BytesLib for bytes;\\n\\n /// @notice Determines if the signed byte array is a valid, non-fraudulent\\n /// heartbeat message.\\n /// @param message Message signed by the wallet. It is a potential heartbeat\\n /// message, Bitcoin transaction preimage, or an arbitrary signed\\n /// bytes.\\n /// @dev Wallet heartbeat message must be exactly 16 bytes long with the first\\n /// 8 bytes set to 0xffffffffffffffff.\\n /// @return True if valid heartbeat message, false otherwise.\\n function isValidHeartbeatMessage(bytes calldata message)\\n internal\\n pure\\n returns (bool)\\n {\\n if (message.length != 16) {\\n return false;\\n }\\n\\n if (message.slice8(0) != 0xffffffffffffffff) {\\n return false;\\n }\\n\\n return true;\\n }\\n}\\n\",\"keccak256\":\"0x2f3ad70beadc4dfb6414064fd7b3621b1edcd2713f186853b4a5fd36fb4502ba\",\"license\":\"GPL-3.0-only\"},\"contracts/test/HeartbeatStub.sol\":{\"content\":\"// SPDX-License-Identifier: GPL-3.0-only\\n\\npragma solidity 0.8.17;\\n\\nimport \\\"../bridge/Heartbeat.sol\\\";\\n\\n/// @dev This is a contract implemented to test Heartbeat library directly.\\ncontract HeartbeatStub {\\n function isValidHeartbeatMessage(bytes calldata message)\\n public\\n pure\\n returns (bool)\\n {\\n return Heartbeat.isValidHeartbeatMessage(message);\\n }\\n}\\n\",\"keccak256\":\"0xc53f2198c32f5f145c7412c8f5e1765317af7b33dd7d26e767766ad4383d8e4a\",\"license\":\"GPL-3.0-only\"}},\"version\":1}",
|
|
813
|
+
"storageLayout": {
|
|
814
|
+
"storage": [],
|
|
815
|
+
"types": null
|
|
816
|
+
},
|
|
817
|
+
"userdoc": {
|
|
818
|
+
"kind": "user",
|
|
819
|
+
"methods": {},
|
|
820
|
+
"version": 1
|
|
821
|
+
}
|
|
822
|
+
}
|