@keep-network/tbtc-v2 1.6.0-dev.20 → 1.6.0-dev.22
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 +3 -3
- 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 +2 -2
- package/artifacts/Deposit.json +2 -2
- package/artifacts/DepositSweep.json +2 -2
- package/artifacts/DonationVault.json +3 -3
- package/artifacts/EcdsaDkgValidator.json +1 -1
- package/artifacts/EcdsaInactivity.json +1 -1
- package/artifacts/EcdsaSortitionPool.json +3 -3
- package/artifacts/Fraud.json +2 -2
- package/artifacts/LightRelay.json +18 -18
- package/artifacts/LightRelayMaintainerProxy.json +8 -8
- package/artifacts/MaintainerProxy.json +19 -19
- package/artifacts/MovingFunds.json +2 -2
- 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 +2 -2
- package/artifacts/ReimbursementPool.json +2 -2
- package/artifacts/T.json +2 -2
- package/artifacts/TBTC.json +3 -3
- package/artifacts/TBTCToken.json +3 -3
- package/artifacts/TBTCVault.json +23 -23
- package/artifacts/TokenStaking.json +1 -1
- package/artifacts/TokenholderGovernor.json +9 -9
- package/artifacts/TokenholderTimelock.json +8 -8
- package/artifacts/VendingMachine.json +3 -3
- package/artifacts/VendingMachineNuCypher.json +1 -1
- package/artifacts/VendingMachineV2.json +3 -3
- package/artifacts/VendingMachineV3.json +3 -3
- package/artifacts/WalletProposalValidator.json +2 -2
- package/artifacts/WalletRegistry.json +5 -5
- package/artifacts/WalletRegistryGovernance.json +8 -8
- package/artifacts/Wallets.json +2 -2
- package/artifacts/solcInputs/{3820d7396bf453fe963a951f7b59372d.json → dd1c38c53a7547fe3e334d72c1e4d8e1.json} +3 -3
- 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/WalletProposalValidator.sol/WalletProposalValidator.dbg.json +1 -1
- package/build/contracts/bridge/Wallets.sol/Wallets.dbg.json +1 -1
- package/build/contracts/integrator/AbstractTBTCDepositor.sol/AbstractTBTCDepositor.dbg.json +1 -1
- package/build/contracts/integrator/AbstractTBTCDepositor.sol/AbstractTBTCDepositor.json +0 -44
- package/build/contracts/integrator/IBridge.sol/IBridge.dbg.json +1 -1
- package/build/contracts/integrator/IBridge.sol/IBridgeTypes.dbg.json +1 -1
- package/build/contracts/integrator/ITBTCVault.sol/ITBTCVault.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/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/test/BankStub.sol/BankStub.dbg.json +1 -1
- package/build/contracts/test/BridgeStub.sol/BridgeStub.dbg.json +1 -1
- package/build/contracts/test/HeartbeatStub.sol/HeartbeatStub.dbg.json +1 -1
- package/build/contracts/test/LightRelayStub.sol/LightRelayStub.dbg.json +1 -1
- package/build/contracts/test/ReceiveApprovalStub.sol/ReceiveApprovalStub.dbg.json +1 -1
- package/build/contracts/test/SepoliaLightRelay.sol/SepoliaLightRelay.dbg.json +1 -1
- package/build/contracts/test/SystemTestRelay.sol/SystemTestRelay.dbg.json +1 -1
- package/build/contracts/test/TestBitcoinTx.sol/TestBitcoinTx.dbg.json +1 -1
- package/build/contracts/test/TestERC20.sol/TestERC20.dbg.json +1 -1
- package/build/contracts/test/TestERC721.sol/TestERC721.dbg.json +1 -1
- package/build/contracts/test/TestEcdsaLib.sol/TestEcdsaLib.dbg.json +1 -1
- package/build/contracts/test/TestTBTCDepositor.sol/MockBridge.dbg.json +1 -1
- package/build/contracts/test/TestTBTCDepositor.sol/MockBridge.json +2 -2
- package/build/contracts/test/TestTBTCDepositor.sol/MockTBTCVault.dbg.json +1 -1
- package/build/contracts/test/TestTBTCDepositor.sol/MockTBTCVault.json +2 -2
- package/build/contracts/test/TestTBTCDepositor.sol/TestTBTCDepositor.dbg.json +1 -1
- package/build/contracts/test/TestTBTCDepositor.sol/TestTBTCDepositor.json +2 -46
- package/build/contracts/test/WormholeBridgeStub.sol/WormholeBridgeStub.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/integrator/AbstractTBTCDepositor.sol +1 -23
- package/contracts/test/TestTBTCDepositor.sol +13 -2
- package/export/artifacts/@keep-network/ecdsa/contracts/WalletRegistry.sol/WalletRegistry.json +7 -7
- 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/L2TBTC.sol/L2TBTC.json +40 -40
- package/export/artifacts/contracts/l2/L2WormholeGateway.sol/L2WormholeGateway.json +47 -47
- 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 +2 -2
- package/export/artifacts/contracts/test/BridgeStub.sol/BridgeStub.json +30 -30
- package/export/artifacts/contracts/test/HeartbeatStub.sol/HeartbeatStub.json +2 -2
- package/export/artifacts/contracts/test/LightRelayStub.sol/LightRelayStub.json +59 -59
- package/export/artifacts/contracts/test/ReceiveApprovalStub.sol/ReceiveApprovalStub.json +7 -7
- package/export/artifacts/contracts/test/SepoliaLightRelay.sol/SepoliaLightRelay.json +59 -59
- package/export/artifacts/contracts/test/SystemTestRelay.sol/SystemTestRelay.json +14 -14
- package/export/artifacts/contracts/test/TestBitcoinTx.sol/TestBitcoinTx.json +5 -5
- package/export/artifacts/contracts/test/TestERC20.sol/TestERC20.json +6 -6
- package/export/artifacts/contracts/test/TestERC721.sol/TestERC721.json +8 -8
- package/export/artifacts/contracts/test/TestEcdsaLib.sol/TestEcdsaLib.json +2 -2
- package/export/artifacts/contracts/test/TestTBTCDepositor.sol/MockBridge.json +38 -38
- package/export/artifacts/contracts/test/TestTBTCDepositor.sol/MockTBTCVault.json +31 -25
- package/export/artifacts/contracts/test/TestTBTCDepositor.sol/TestTBTCDepositor.json +936 -1261
- package/export/artifacts/contracts/test/WormholeBridgeStub.sol/WormholeBridgeStub.json +37 -37
- 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/typechain/factories/AbstractTBTCDepositor__factory.js +0 -44
- package/export/typechain/factories/MockBridge__factory.js +1 -1
- package/export/typechain/factories/MockTBTCVault__factory.js +1 -1
- package/export/typechain/factories/TestTBTCDepositor__factory.js +1 -45
- package/export/typechain/factories/WalletRegistry__factory.js +1 -1
- package/package.json +2 -2
|
@@ -96,14 +96,6 @@ abstract contract AbstractTBTCDepositor {
|
|
|
96
96
|
// slither-disable-next-line unused-state
|
|
97
97
|
uint256[47] private __gap;
|
|
98
98
|
|
|
99
|
-
event DepositInitialized(uint256 indexed depositKey, uint32 initializedAt);
|
|
100
|
-
|
|
101
|
-
event DepositFinalized(
|
|
102
|
-
uint256 indexed depositKey,
|
|
103
|
-
uint256 tbtcAmount,
|
|
104
|
-
uint32 finalizedAt
|
|
105
|
-
);
|
|
106
|
-
|
|
107
99
|
/// @notice Initializes the contract. MUST BE CALLED from the child
|
|
108
100
|
/// contract initializer.
|
|
109
101
|
// slither-disable-next-line dead-code
|
|
@@ -150,12 +142,6 @@ abstract contract AbstractTBTCDepositor {
|
|
|
150
142
|
reveal.fundingOutputIndex
|
|
151
143
|
);
|
|
152
144
|
|
|
153
|
-
emit DepositInitialized(
|
|
154
|
-
depositKey,
|
|
155
|
-
/* solhint-disable-next-line not-rely-on-time */
|
|
156
|
-
uint32(block.timestamp)
|
|
157
|
-
);
|
|
158
|
-
|
|
159
145
|
// The Bridge does not allow to reveal the same deposit twice and
|
|
160
146
|
// revealed deposits stay there forever. The transaction will revert
|
|
161
147
|
// if the deposit has already been revealed so, there is no need to do
|
|
@@ -166,7 +152,7 @@ abstract contract AbstractTBTCDepositor {
|
|
|
166
152
|
}
|
|
167
153
|
|
|
168
154
|
/// @notice Finalizes a deposit by calculating the amount of TBTC minted
|
|
169
|
-
/// for the deposit
|
|
155
|
+
/// for the deposit.
|
|
170
156
|
/// @param depositKey Deposit key identifying the deposit.
|
|
171
157
|
/// @return initialDepositAmount Amount of funding transaction deposit. In
|
|
172
158
|
/// TBTC token decimals precision.
|
|
@@ -211,14 +197,6 @@ abstract contract AbstractTBTCDepositor {
|
|
|
211
197
|
|
|
212
198
|
tbtcAmount = _calculateTbtcAmount(deposit.amount, deposit.treasuryFee);
|
|
213
199
|
|
|
214
|
-
// slither-disable-next-line reentrancy-events
|
|
215
|
-
emit DepositFinalized(
|
|
216
|
-
depositKey,
|
|
217
|
-
tbtcAmount,
|
|
218
|
-
/* solhint-disable-next-line not-rely-on-time */
|
|
219
|
-
uint32(block.timestamp)
|
|
220
|
-
);
|
|
221
|
-
|
|
222
200
|
extraData = deposit.extraData;
|
|
223
201
|
}
|
|
224
202
|
|
|
@@ -8,6 +8,8 @@ import "../integrator/AbstractTBTCDepositor.sol";
|
|
|
8
8
|
import "../integrator/IBridge.sol";
|
|
9
9
|
import "../integrator/ITBTCVault.sol";
|
|
10
10
|
|
|
11
|
+
import "@openzeppelin/contracts/token/ERC20/IERC20.sol";
|
|
12
|
+
|
|
11
13
|
contract TestTBTCDepositor is AbstractTBTCDepositor {
|
|
12
14
|
event InitializeDepositReturned(uint256 depositKey);
|
|
13
15
|
|
|
@@ -168,7 +170,10 @@ contract MockTBTCVault is ITBTCVault {
|
|
|
168
170
|
return (request.requestedAt, request.finalizedAt);
|
|
169
171
|
}
|
|
170
172
|
|
|
171
|
-
function
|
|
173
|
+
/// @dev The function is virtual to allow other projects using this mock
|
|
174
|
+
/// for AbtractTBTCDepositor-based contract tests to add any custom
|
|
175
|
+
/// logic needed.
|
|
176
|
+
function createOptimisticMintingRequest(uint256 depositKey) public virtual {
|
|
172
177
|
require(
|
|
173
178
|
_requests[depositKey].requestedAt == 0,
|
|
174
179
|
"Request already exists"
|
|
@@ -177,7 +182,13 @@ contract MockTBTCVault is ITBTCVault {
|
|
|
177
182
|
_requests[depositKey].requestedAt = uint64(block.timestamp);
|
|
178
183
|
}
|
|
179
184
|
|
|
180
|
-
function
|
|
185
|
+
/// @dev The function is virtual to allow other projects using this mock
|
|
186
|
+
/// for AbtractTBTCDepositor-based contract tests to add any custom
|
|
187
|
+
/// logic needed.
|
|
188
|
+
function finalizeOptimisticMintingRequest(uint256 depositKey)
|
|
189
|
+
public
|
|
190
|
+
virtual
|
|
191
|
+
{
|
|
181
192
|
require(
|
|
182
193
|
_requests[depositKey].requestedAt != 0,
|
|
183
194
|
"Request does not exist"
|