@keep-network/tbtc-v2 1.0.0-dev.0 → 1.0.0-dev.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.
Files changed (115) hide show
  1. package/artifacts/BLS.json +1 -1
  2. package/artifacts/Bank.json +3 -3
  3. package/artifacts/BeaconAuthorization.json +1 -1
  4. package/artifacts/BeaconDkg.json +1 -1
  5. package/artifacts/BeaconDkgValidator.json +1 -1
  6. package/artifacts/BeaconInactivity.json +1 -1
  7. package/artifacts/BeaconSortitionPool.json +3 -3
  8. package/artifacts/Bridge.json +5 -5
  9. package/artifacts/BridgeGovernance.json +2 -2
  10. package/artifacts/BridgeGovernanceParameters.json +2 -2
  11. package/artifacts/Deposit.json +2 -2
  12. package/artifacts/DepositSweep.json +2 -2
  13. package/artifacts/EcdsaDkgValidator.json +1 -1
  14. package/artifacts/EcdsaInactivity.json +1 -1
  15. package/artifacts/EcdsaSortitionPool.json +3 -3
  16. package/artifacts/Fraud.json +2 -2
  17. package/artifacts/KeepRegistry.json +1 -1
  18. package/artifacts/KeepStake.json +2 -2
  19. package/artifacts/KeepToken.json +2 -2
  20. package/artifacts/KeepTokenStaking.json +1 -1
  21. package/artifacts/LightRelay.json +4 -4
  22. package/artifacts/MaintainerProxy.json +3 -3
  23. package/artifacts/MovingFunds.json +2 -2
  24. package/artifacts/NuCypherStakingEscrow.json +1 -1
  25. package/artifacts/NuCypherToken.json +2 -2
  26. package/artifacts/RandomBeacon.json +2 -2
  27. package/artifacts/RandomBeaconChaosnet.json +2 -2
  28. package/artifacts/RandomBeaconGovernance.json +2 -2
  29. package/artifacts/Redemption.json +2 -2
  30. package/artifacts/ReimbursementPool.json +2 -2
  31. package/artifacts/T.json +2 -2
  32. package/artifacts/TBTC.json +3 -3
  33. package/artifacts/TBTCToken.json +3 -3
  34. package/artifacts/TBTCVault.json +23 -23
  35. package/artifacts/TokenStaking.json +1 -1
  36. package/artifacts/TokenholderGovernor.json +9 -9
  37. package/artifacts/TokenholderTimelock.json +8 -8
  38. package/artifacts/VendingMachine.json +3 -3
  39. package/artifacts/VendingMachineKeep.json +1 -1
  40. package/artifacts/VendingMachineNuCypher.json +1 -1
  41. package/artifacts/WalletRegistry.json +5 -5
  42. package/artifacts/WalletRegistryGovernance.json +2 -2
  43. package/artifacts/Wallets.json +2 -2
  44. package/artifacts/solcInputs/{155bbd01797c525b694dc9f75cefed21.json → 601573cb2697bb9512dba002bb727262.json} +4 -1
  45. package/build/contracts/GovernanceUtils.sol/GovernanceUtils.dbg.json +1 -1
  46. package/build/contracts/bank/Bank.sol/Bank.dbg.json +1 -1
  47. package/build/contracts/bank/IReceiveBalanceApproval.sol/IReceiveBalanceApproval.dbg.json +1 -1
  48. package/build/contracts/bridge/BitcoinTx.sol/BitcoinTx.dbg.json +1 -1
  49. package/build/contracts/bridge/Bridge.sol/Bridge.dbg.json +1 -1
  50. package/build/contracts/bridge/BridgeGovernanceParameters.sol/BridgeGovernanceParameters.dbg.json +1 -1
  51. package/build/contracts/bridge/BridgeState.sol/BridgeState.dbg.json +1 -1
  52. package/build/contracts/bridge/Deposit.sol/Deposit.dbg.json +1 -1
  53. package/build/contracts/bridge/DepositSweep.sol/DepositSweep.dbg.json +1 -1
  54. package/build/contracts/bridge/EcdsaLib.sol/EcdsaLib.dbg.json +1 -1
  55. package/build/contracts/bridge/Fraud.sol/Fraud.dbg.json +1 -1
  56. package/build/contracts/bridge/Heartbeat.sol/Heartbeat.dbg.json +1 -1
  57. package/build/contracts/bridge/IRelay.sol/IRelay.dbg.json +1 -1
  58. package/build/contracts/bridge/MovingFunds.sol/MovingFunds.dbg.json +1 -1
  59. package/build/contracts/bridge/Redemption.sol/OutboundTx.dbg.json +1 -1
  60. package/build/contracts/bridge/Redemption.sol/Redemption.dbg.json +1 -1
  61. package/build/contracts/bridge/VendingMachine.sol/VendingMachine.dbg.json +1 -1
  62. package/build/contracts/bridge/Wallets.sol/Wallets.dbg.json +1 -1
  63. package/build/contracts/maintainer/MaintainerProxy.sol/MaintainerProxy.dbg.json +1 -1
  64. package/build/contracts/relay/LightRelay.sol/ILightRelay.dbg.json +1 -1
  65. package/build/contracts/relay/LightRelay.sol/LightRelay.dbg.json +1 -1
  66. package/build/contracts/relay/LightRelay.sol/LightRelay.json +2 -2
  67. package/build/contracts/relay/LightRelay.sol/RelayUtils.dbg.json +1 -1
  68. package/build/contracts/relay/LightRelay.sol/RelayUtils.json +2 -2
  69. package/build/contracts/token/TBTC.sol/TBTC.dbg.json +1 -1
  70. package/build/contracts/vault/DonationVault.sol/DonationVault.dbg.json +1 -1
  71. package/build/contracts/vault/IVault.sol/IVault.dbg.json +1 -1
  72. package/build/contracts/vault/TBTCOptimisticMinting.sol/TBTCOptimisticMinting.dbg.json +1 -1
  73. package/build/contracts/vault/TBTCVault.sol/TBTCVault.dbg.json +1 -1
  74. package/contracts/relay/LightRelay.sol +7 -2
  75. package/deploy/01_deploy_light_relay.ts +16 -4
  76. package/export/artifacts/@keep-network/bitcoin-spv-sol/contracts/BTCUtils.sol/BTCUtils.json +20 -20
  77. package/export/artifacts/@keep-network/ecdsa/contracts/EcdsaDkgValidator.sol/EcdsaDkgValidator.json +2025 -2025
  78. package/export/artifacts/@keep-network/ecdsa/contracts/libraries/EcdsaDkg.sol/EcdsaDkg.json +20 -20
  79. package/export/artifacts/@keep-network/ecdsa/contracts/libraries/EcdsaInactivity.sol/EcdsaInactivity.json +1875 -1875
  80. package/export/artifacts/@keep-network/random-beacon/contracts/ReimbursementPool.sol/ReimbursementPool.json +545 -545
  81. package/export/artifacts/@keep-network/sortition-pools/contracts/Chaosnet.sol/Chaosnet.json +506 -506
  82. package/export/artifacts/@keep-network/sortition-pools/contracts/Rewards.sol/Rewards.json +23 -23
  83. package/export/artifacts/@keep-network/sortition-pools/contracts/SortitionPool.sol/SortitionPool.json +2456 -2456
  84. package/export/artifacts/@keep-network/sortition-pools/contracts/SortitionTree.sol/SortitionTree.json +465 -465
  85. package/export/artifacts/@openzeppelin/contracts/proxy/ERC1967/ERC1967Proxy.sol/ERC1967Proxy.json +639 -639
  86. package/export/artifacts/@openzeppelin/contracts/proxy/transparent/ProxyAdmin.sol/ProxyAdmin.json +603 -603
  87. package/export/artifacts/@openzeppelin/contracts/proxy/transparent/TransparentUpgradeableProxy.sol/TransparentUpgradeableProxy.json +1072 -1072
  88. package/export/artifacts/@openzeppelin/contracts/token/ERC721/ERC721.sol/ERC721.json +2078 -2078
  89. package/export/artifacts/@thesis/solidity-contracts/contracts/token/ERC20WithPermit.sol/ERC20WithPermit.json +2534 -2534
  90. package/export/artifacts/@thesis/solidity-contracts/contracts/token/MisfundRecovery.sol/MisfundRecovery.json +736 -736
  91. package/export/artifacts/contracts/bank/Bank.sol/Bank.json +1872 -1872
  92. package/export/artifacts/contracts/bridge/Bridge.sol/Bridge.json +7050 -7050
  93. package/export/artifacts/contracts/bridge/VendingMachine.sol/VendingMachine.json +1257 -1257
  94. package/export/artifacts/contracts/maintainer/MaintainerProxy.sol/MaintainerProxy.json +2305 -2305
  95. package/export/artifacts/contracts/relay/LightRelay.sol/LightRelay.json +1870 -1870
  96. package/export/artifacts/contracts/test/BankStub.sol/BankStub.json +1872 -1872
  97. package/export/artifacts/contracts/test/BridgeStub.sol/BridgeStub.json +8053 -8053
  98. package/export/artifacts/contracts/test/GoerliLightRelay.sol/GoerliLightRelay.json +11982 -0
  99. package/export/artifacts/contracts/test/HeartbeatStub.sol/HeartbeatStub.json +130 -130
  100. package/export/artifacts/contracts/test/LightRelayStub.sol/LightRelayStub.json +1995 -1995
  101. package/export/artifacts/contracts/test/ReceiveApprovalStub.sol/ReceiveApprovalStub.json +354 -354
  102. package/export/artifacts/contracts/test/TestERC20.sol/TestERC20.json +2291 -2291
  103. package/export/artifacts/contracts/test/TestERC721.sol/TestERC721.json +1899 -1899
  104. package/export/artifacts/contracts/test/TestEcdsaLib.sol/TestEcdsaLib.json +189 -189
  105. package/export/artifacts/contracts/test/TestRelay.sol/TestRelay.json +568 -568
  106. package/export/artifacts/contracts/token/TBTC.sol/TBTC.json +2847 -2847
  107. package/export/artifacts/contracts/vault/DonationVault.sol/DonationVault.json +858 -858
  108. package/export/artifacts/contracts/vault/TBTCVault.sol/TBTCVault.json +3387 -3387
  109. package/export/deploy/01_deploy_light_relay.js +20 -4
  110. package/export/typechain/GoerliLightRelay.js +2 -0
  111. package/export/typechain/factories/GoerliLightRelay__factory.js +522 -0
  112. package/export/typechain/factories/LightRelayStub__factory.js +1 -1
  113. package/export/typechain/factories/LightRelay__factory.js +1 -1
  114. package/export/typechain/index.js +3 -1
  115. package/package.json +1 -1
@@ -1,4 +1,4 @@
1
1
  {
2
2
  "_format": "hh-sol-dbg-1",
3
- "buildInfo": "../../../build-info/202540fc7c01cdff78b47ecfb5553746.json"
3
+ "buildInfo": "../../../build-info/d7ea23aa4a06819cfa91c20dd312aa6c.json"
4
4
  }
@@ -1,4 +1,4 @@
1
1
  {
2
2
  "_format": "hh-sol-dbg-1",
3
- "buildInfo": "../../../build-info/202540fc7c01cdff78b47ecfb5553746.json"
3
+ "buildInfo": "../../../build-info/d7ea23aa4a06819cfa91c20dd312aa6c.json"
4
4
  }
@@ -1,4 +1,4 @@
1
1
  {
2
2
  "_format": "hh-sol-dbg-1",
3
- "buildInfo": "../../../build-info/202540fc7c01cdff78b47ecfb5553746.json"
3
+ "buildInfo": "../../../build-info/d7ea23aa4a06819cfa91c20dd312aa6c.json"
4
4
  }
@@ -1,4 +1,4 @@
1
1
  {
2
2
  "_format": "hh-sol-dbg-1",
3
- "buildInfo": "../../../build-info/202540fc7c01cdff78b47ecfb5553746.json"
3
+ "buildInfo": "../../../build-info/d7ea23aa4a06819cfa91c20dd312aa6c.json"
4
4
  }
@@ -537,14 +537,19 @@ contract LightRelay is Ownable, ILightRelay {
537
537
  /// @notice Returns the difficulty of the current epoch.
538
538
  /// @dev returns 0 if the relay is not ready.
539
539
  /// @return The difficulty of the current epoch.
540
- function getCurrentEpochDifficulty() external view returns (uint256) {
540
+ function getCurrentEpochDifficulty()
541
+ external
542
+ view
543
+ virtual
544
+ returns (uint256)
545
+ {
541
546
  return currentEpochDifficulty;
542
547
  }
543
548
 
544
549
  /// @notice Returns the difficulty of the previous epoch.
545
550
  /// @dev Returns 0 if the relay is not ready or has not had a retarget.
546
551
  /// @return The difficulty of the previous epoch.
547
- function getPrevEpochDifficulty() external view returns (uint256) {
552
+ function getPrevEpochDifficulty() external view virtual returns (uint256) {
548
553
  return prevEpochDifficulty;
549
554
  }
550
555
 
@@ -5,11 +5,23 @@ const func: DeployFunction = async function (hre: HardhatRuntimeEnvironment) {
5
5
  const { getNamedAccounts, deployments, helpers } = hre
6
6
  const { deployer } = await getNamedAccounts()
7
7
 
8
- // LightRelay is deployed only for mainnet. For all other networks (Hardhat,
9
- // Goerli) we use TestRelay contract. LightRelay will work properly only with
10
- // Bitcoin Mainnet headers.
8
+ // LightRelay is the real-world relay and is deployed for mainnet.
9
+ // GoerliLightRelay is a stub version with immutable difficulties and is
10
+ // deployed for goerli.
11
+ // TestRelay is a stub version with mutable difficulties and is deployed for
12
+ // hardhat.
13
+ function resolveRelayContract() {
14
+ if (hre.network.name === "mainnet") {
15
+ return "LightRelay"
16
+ }
17
+ if (hre.network.name === "goerli") {
18
+ return "GoerliLightRelay"
19
+ }
20
+ return "TestRelay"
21
+ }
22
+
11
23
  const lightRelay = await deployments.deploy("LightRelay", {
12
- contract: hre.network.name === "mainnet" ? "LightRelay" : "TestRelay",
24
+ contract: resolveRelayContract(),
13
25
  from: deployer,
14
26
  log: true,
15
27
  waitConfirmations: 1,
@@ -109,32 +109,32 @@
109
109
  {
110
110
  "ast": {
111
111
  "nodeType": "YulBlock",
112
- "src": "0:201:100",
112
+ "src": "0:201:101",
113
113
  "statements": [
114
114
  {
115
115
  "nodeType": "YulBlock",
116
- "src": "6:3:100",
116
+ "src": "6:3:101",
117
117
  "statements": []
118
118
  },
119
119
  {
120
120
  "body": {
121
121
  "nodeType": "YulBlock",
122
- "src": "123:76:100",
122
+ "src": "123:76:101",
123
123
  "statements": [
124
124
  {
125
125
  "nodeType": "YulAssignment",
126
- "src": "133:26:100",
126
+ "src": "133:26:101",
127
127
  "value": {
128
128
  "arguments": [
129
129
  {
130
130
  "name": "headStart",
131
131
  "nodeType": "YulIdentifier",
132
- "src": "145:9:100"
132
+ "src": "145:9:101"
133
133
  },
134
134
  {
135
135
  "kind": "number",
136
136
  "nodeType": "YulLiteral",
137
- "src": "156:2:100",
137
+ "src": "156:2:101",
138
138
  "type": "",
139
139
  "value": "32"
140
140
  }
@@ -142,16 +142,16 @@
142
142
  "functionName": {
143
143
  "name": "add",
144
144
  "nodeType": "YulIdentifier",
145
- "src": "141:3:100"
145
+ "src": "141:3:101"
146
146
  },
147
147
  "nodeType": "YulFunctionCall",
148
- "src": "141:18:100"
148
+ "src": "141:18:101"
149
149
  },
150
150
  "variableNames": [
151
151
  {
152
152
  "name": "tail",
153
153
  "nodeType": "YulIdentifier",
154
- "src": "133:4:100"
154
+ "src": "133:4:101"
155
155
  }
156
156
  ]
157
157
  },
@@ -161,24 +161,24 @@
161
161
  {
162
162
  "name": "headStart",
163
163
  "nodeType": "YulIdentifier",
164
- "src": "175:9:100"
164
+ "src": "175:9:101"
165
165
  },
166
166
  {
167
167
  "name": "value0",
168
168
  "nodeType": "YulIdentifier",
169
- "src": "186:6:100"
169
+ "src": "186:6:101"
170
170
  }
171
171
  ],
172
172
  "functionName": {
173
173
  "name": "mstore",
174
174
  "nodeType": "YulIdentifier",
175
- "src": "168:6:100"
175
+ "src": "168:6:101"
176
176
  },
177
177
  "nodeType": "YulFunctionCall",
178
- "src": "168:25:100"
178
+ "src": "168:25:101"
179
179
  },
180
180
  "nodeType": "YulExpressionStatement",
181
- "src": "168:25:100"
181
+ "src": "168:25:101"
182
182
  }
183
183
  ]
184
184
  },
@@ -188,13 +188,13 @@
188
188
  {
189
189
  "name": "headStart",
190
190
  "nodeType": "YulTypedName",
191
- "src": "92:9:100",
191
+ "src": "92:9:101",
192
192
  "type": ""
193
193
  },
194
194
  {
195
195
  "name": "value0",
196
196
  "nodeType": "YulTypedName",
197
- "src": "103:6:100",
197
+ "src": "103:6:101",
198
198
  "type": ""
199
199
  }
200
200
  ],
@@ -202,16 +202,16 @@
202
202
  {
203
203
  "name": "tail",
204
204
  "nodeType": "YulTypedName",
205
- "src": "114:4:100",
205
+ "src": "114:4:101",
206
206
  "type": ""
207
207
  }
208
208
  ],
209
- "src": "14:185:100"
209
+ "src": "14:185:101"
210
210
  }
211
211
  ]
212
212
  },
213
213
  "contents": "{\n { }\n function abi_encode_tuple_t_uint256__to_t_uint256__fromStack_library_reversed(headStart, value0) -> tail\n {\n tail := add(headStart, 32)\n mstore(headStart, value0)\n }\n}",
214
- "id": 100,
214
+ "id": 101,
215
215
  "language": "Yul",
216
216
  "name": "#utility.yul"
217
217
  }
@@ -219,7 +219,7 @@
219
219
  "immutableReferences": {},
220
220
  "linkReferences": {},
221
221
  "opcodes": "PUSH20 0x0 ADDRESS EQ PUSH1 0x80 PUSH1 0x40 MSTORE PUSH1 0x4 CALLDATASIZE LT PUSH1 0x51 JUMPI PUSH1 0x0 CALLDATALOAD PUSH1 0xE0 SHR DUP1 PUSH4 0x56E04EC EQ PUSH1 0x56 JUMPI DUP1 PUSH4 0x8CC71569 EQ PUSH1 0x71 JUMPI DUP1 PUSH4 0x8DB69E60 EQ PUSH1 0x79 JUMPI DUP1 PUSH4 0xD4258CA7 EQ PUSH1 0x81 JUMPI JUMPDEST PUSH1 0x0 DUP1 REVERT JUMPDEST PUSH1 0x5F PUSH3 0x127500 DUP2 JUMP JUMPDEST PUSH1 0x40 MLOAD SWAP1 DUP2 MSTORE PUSH1 0x20 ADD PUSH1 0x40 MLOAD DUP1 SWAP2 SUB SWAP1 RETURN JUMPDEST PUSH1 0x5F PUSH2 0x7E0 DUP2 JUMP JUMPDEST PUSH1 0x5F PUSH1 0x0 NOT DUP2 JUMP JUMPDEST PUSH1 0x5F PUSH28 0xFFFF0000000000000000000000000000000000000000000000000000 DUP2 JUMP INVALID LOG2 PUSH5 0x6970667358 0x22 SLT KECCAK256 0x21 0xD8 0x5F GT 0xF6 0x4E 0xD4 0x4F 0xFB 0xA5 SWAP12 0xFC PUSH12 0x4A327F00D51E8E91CA784A04 DUP14 CALLDATACOPY 0x29 0xDB ADD 0xB3 PUSH32 0x64736F6C63430008110033000000000000000000000000000000000000000000 ",
222
- "sourceMap": "175:38691:0:-:0;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;443:62;;485:20;443:62;;;;;168:25:100;;;156:2;141:18;443:62:0;;;;;;;534:53;;583:4;534:53;;616:104;;-1:-1:-1;;616:104:0;;339:97;;378:58;339:97;"
222
+ "sourceMap": "175:38691:0:-:0;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;443:62;;485:20;443:62;;;;;168:25:101;;;156:2;141:18;443:62:0;;;;;;;534:53;;583:4;534:53;;616:104;;-1:-1:-1;;616:104:0;;339:97;;378:58;339:97;"
223
223
  },
224
224
  "gasEstimates": {
225
225
  "creation": {