@keep-network/tbtc-v2 1.3.0-dev.3 → 1.3.0-dev.5

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 (143) 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/DonationVault.json +3 -3
  14. package/artifacts/EcdsaDkgValidator.json +1 -1
  15. package/artifacts/EcdsaInactivity.json +1 -1
  16. package/artifacts/EcdsaSortitionPool.json +3 -3
  17. package/artifacts/Fraud.json +2 -2
  18. package/artifacts/KeepRegistry.json +1 -1
  19. package/artifacts/KeepStake.json +2 -2
  20. package/artifacts/KeepToken.json +2 -2
  21. package/artifacts/KeepTokenStaking.json +1 -1
  22. package/artifacts/LightRelay.json +18 -18
  23. package/artifacts/LightRelayMaintainerProxy.json +479 -0
  24. package/artifacts/MaintainerProxy.json +19 -19
  25. package/artifacts/MovingFunds.json +2 -2
  26. package/artifacts/NuCypherStakingEscrow.json +1 -1
  27. package/artifacts/NuCypherToken.json +2 -2
  28. package/artifacts/RandomBeacon.json +2 -2
  29. package/artifacts/RandomBeaconChaosnet.json +2 -2
  30. package/artifacts/RandomBeaconGovernance.json +2 -2
  31. package/artifacts/Redemption.json +2 -2
  32. package/artifacts/ReimbursementPool.json +2 -2
  33. package/artifacts/T.json +2 -2
  34. package/artifacts/TBTC.json +3 -3
  35. package/artifacts/TBTCToken.json +3 -3
  36. package/artifacts/TBTCVault.json +23 -23
  37. package/artifacts/TokenStaking.json +1 -1
  38. package/artifacts/TokenholderGovernor.json +9 -9
  39. package/artifacts/TokenholderTimelock.json +8 -8
  40. package/artifacts/VendingMachine.json +3 -3
  41. package/artifacts/VendingMachineKeep.json +1 -1
  42. package/artifacts/VendingMachineNuCypher.json +1 -1
  43. package/artifacts/VendingMachineV2.json +3 -3
  44. package/artifacts/VendingMachineV3.json +3 -3
  45. package/artifacts/WalletCoordinator.json +12 -6
  46. package/artifacts/WalletRegistry.json +5 -5
  47. package/artifacts/WalletRegistryGovernance.json +2 -2
  48. package/artifacts/Wallets.json +2 -2
  49. package/artifacts/solcInputs/{67afa5431c94b7a159788360752a9010.json → 08bd3c90d7f376263925b4f52b0adff9.json} +4 -1
  50. package/build/contracts/GovernanceUtils.sol/GovernanceUtils.dbg.json +1 -1
  51. package/build/contracts/bank/Bank.sol/Bank.dbg.json +1 -1
  52. package/build/contracts/bank/IReceiveBalanceApproval.sol/IReceiveBalanceApproval.dbg.json +1 -1
  53. package/build/contracts/bridge/BitcoinTx.sol/BitcoinTx.dbg.json +1 -1
  54. package/build/contracts/bridge/Bridge.sol/Bridge.dbg.json +1 -1
  55. package/build/contracts/bridge/BridgeGovernanceParameters.sol/BridgeGovernanceParameters.dbg.json +1 -1
  56. package/build/contracts/bridge/BridgeState.sol/BridgeState.dbg.json +1 -1
  57. package/build/contracts/bridge/Deposit.sol/Deposit.dbg.json +1 -1
  58. package/build/contracts/bridge/DepositSweep.sol/DepositSweep.dbg.json +1 -1
  59. package/build/contracts/bridge/EcdsaLib.sol/EcdsaLib.dbg.json +1 -1
  60. package/build/contracts/bridge/Fraud.sol/Fraud.dbg.json +1 -1
  61. package/build/contracts/bridge/Heartbeat.sol/Heartbeat.dbg.json +1 -1
  62. package/build/contracts/bridge/IRelay.sol/IRelay.dbg.json +1 -1
  63. package/build/contracts/bridge/MovingFunds.sol/MovingFunds.dbg.json +1 -1
  64. package/build/contracts/bridge/Redemption.sol/OutboundTx.dbg.json +1 -1
  65. package/build/contracts/bridge/Redemption.sol/Redemption.dbg.json +1 -1
  66. package/build/contracts/bridge/VendingMachine.sol/VendingMachine.dbg.json +1 -1
  67. package/build/contracts/bridge/VendingMachineV2.sol/VendingMachineV2.dbg.json +1 -1
  68. package/build/contracts/bridge/VendingMachineV3.sol/VendingMachineV3.dbg.json +1 -1
  69. package/build/contracts/bridge/WalletCoordinator.sol/WalletCoordinator.dbg.json +1 -1
  70. package/build/contracts/bridge/WalletCoordinator.sol/WalletCoordinator.json +9 -3
  71. package/build/contracts/bridge/Wallets.sol/Wallets.dbg.json +1 -1
  72. package/build/contracts/l2/L2TBTC.sol/L2TBTC.dbg.json +1 -1
  73. package/build/contracts/l2/L2WormholeGateway.sol/IWormholeTokenBridge.dbg.json +1 -1
  74. package/build/contracts/l2/L2WormholeGateway.sol/L2WormholeGateway.dbg.json +1 -1
  75. package/build/contracts/maintainer/MaintainerProxy.sol/MaintainerProxy.dbg.json +1 -1
  76. package/build/contracts/relay/LightRelay.sol/ILightRelay.dbg.json +1 -1
  77. package/build/contracts/relay/LightRelay.sol/LightRelay.dbg.json +1 -1
  78. package/build/contracts/relay/LightRelay.sol/RelayUtils.dbg.json +1 -1
  79. package/build/contracts/relay/LightRelayMaintainerProxy.sol/LightRelayMaintainerProxy.dbg.json +4 -0
  80. package/build/contracts/relay/LightRelayMaintainerProxy.sol/LightRelayMaintainerProxy.json +280 -0
  81. package/build/contracts/token/TBTC.sol/TBTC.dbg.json +1 -1
  82. package/build/contracts/vault/DonationVault.sol/DonationVault.dbg.json +1 -1
  83. package/build/contracts/vault/IVault.sol/IVault.dbg.json +1 -1
  84. package/build/contracts/vault/TBTCOptimisticMinting.sol/TBTCOptimisticMinting.dbg.json +1 -1
  85. package/build/contracts/vault/TBTCVault.sol/TBTCVault.dbg.json +1 -1
  86. package/contracts/bridge/WalletCoordinator.sol +4 -1
  87. package/contracts/relay/LightRelayMaintainerProxy.sol +147 -0
  88. package/deploy/36_deploy_light_relay_maintainer_proxy.ts +35 -0
  89. package/deploy/37_transfer_light_relay_maintainer_proxy_ownership.ts +19 -0
  90. package/deploy/38_authorize_light_relay_maintainer_proxy_in_reimbursement_pool.ts +31 -0
  91. package/deploy/39_authorize_light_relay_maintainer_proxy_in_light_relay.ts +24 -0
  92. package/deploy/94_transfer_relay_ownership.ts +19 -0
  93. package/export/artifacts/@keep-network/bitcoin-spv-sol/contracts/BTCUtils.sol/BTCUtils.json +20 -20
  94. package/export/artifacts/@keep-network/ecdsa/contracts/EcdsaDkgValidator.sol/EcdsaDkgValidator.json +1986 -1986
  95. package/export/artifacts/@keep-network/ecdsa/contracts/libraries/EcdsaDkg.sol/EcdsaDkg.json +20 -20
  96. package/export/artifacts/@keep-network/ecdsa/contracts/libraries/EcdsaInactivity.sol/EcdsaInactivity.json +1836 -1836
  97. package/export/artifacts/@keep-network/random-beacon/contracts/ReimbursementPool.sol/ReimbursementPool.json +545 -545
  98. package/export/artifacts/@keep-network/sortition-pools/contracts/Chaosnet.sol/Chaosnet.json +506 -506
  99. package/export/artifacts/@keep-network/sortition-pools/contracts/Rewards.sol/Rewards.json +23 -23
  100. package/export/artifacts/@keep-network/sortition-pools/contracts/SortitionPool.sol/SortitionPool.json +2456 -2456
  101. package/export/artifacts/@keep-network/sortition-pools/contracts/SortitionTree.sol/SortitionTree.json +465 -465
  102. package/export/artifacts/@openzeppelin/contracts/proxy/ERC1967/ERC1967Proxy.sol/ERC1967Proxy.json +568 -568
  103. package/export/artifacts/@openzeppelin/contracts/proxy/transparent/ProxyAdmin.sol/ProxyAdmin.json +603 -603
  104. package/export/artifacts/@openzeppelin/contracts/proxy/transparent/TransparentUpgradeableProxy.sol/TransparentUpgradeableProxy.json +1001 -1001
  105. package/export/artifacts/@openzeppelin/contracts/token/ERC721/ERC721.sol/ERC721.json +1877 -1877
  106. package/export/artifacts/@openzeppelin/contracts-upgradeable/token/ERC20/ERC20Upgradeable.sol/ERC20Upgradeable.json +654 -654
  107. package/export/artifacts/@thesis/solidity-contracts/contracts/token/ERC20WithPermit.sol/ERC20WithPermit.json +2534 -2534
  108. package/export/artifacts/@thesis/solidity-contracts/contracts/token/MisfundRecovery.sol/MisfundRecovery.json +736 -736
  109. package/export/artifacts/contracts/bank/Bank.sol/Bank.json +1872 -1872
  110. package/export/artifacts/contracts/bridge/Bridge.sol/Bridge.json +7083 -7083
  111. package/export/artifacts/contracts/bridge/VendingMachine.sol/VendingMachine.json +1257 -1257
  112. package/export/artifacts/contracts/bridge/VendingMachineV2.sol/VendingMachineV2.json +972 -972
  113. package/export/artifacts/contracts/bridge/VendingMachineV3.sol/VendingMachineV3.json +1122 -1122
  114. package/export/artifacts/contracts/bridge/WalletCoordinator.sol/WalletCoordinator.json +4277 -4268
  115. package/export/artifacts/contracts/l2/L2TBTC.sol/L2TBTC.json +3001 -3001
  116. package/export/artifacts/contracts/l2/L2WormholeGateway.sol/L2WormholeGateway.json +2471 -2471
  117. package/export/artifacts/contracts/maintainer/MaintainerProxy.sol/MaintainerProxy.json +2393 -2393
  118. package/export/artifacts/contracts/relay/LightRelay.sol/LightRelay.json +1921 -1921
  119. package/export/artifacts/contracts/relay/LightRelayMaintainerProxy.sol/LightRelayMaintainerProxy.json +6348 -0
  120. package/export/artifacts/contracts/test/BankStub.sol/BankStub.json +1874 -1874
  121. package/export/artifacts/contracts/test/BridgeStub.sol/BridgeStub.json +8122 -8122
  122. package/export/artifacts/contracts/test/GoerliLightRelay.sol/GoerliLightRelay.json +1922 -1922
  123. package/export/artifacts/contracts/test/HeartbeatStub.sol/HeartbeatStub.json +130 -130
  124. package/export/artifacts/contracts/test/LightRelayStub.sol/LightRelayStub.json +2047 -2047
  125. package/export/artifacts/contracts/test/ReceiveApprovalStub.sol/ReceiveApprovalStub.json +354 -354
  126. package/export/artifacts/contracts/test/SystemTestRelay.sol/SystemTestRelay.json +568 -568
  127. package/export/artifacts/contracts/test/TestERC20.sol/TestERC20.json +2291 -2291
  128. package/export/artifacts/contracts/test/TestERC721.sol/TestERC721.json +1698 -1698
  129. package/export/artifacts/contracts/test/TestEcdsaLib.sol/TestEcdsaLib.json +189 -189
  130. package/export/artifacts/contracts/test/WormholeBridgeStub.sol/WormholeBridgeStub.json +1447 -1447
  131. package/export/artifacts/contracts/token/TBTC.sol/TBTC.json +2847 -2847
  132. package/export/artifacts/contracts/vault/DonationVault.sol/DonationVault.json +858 -858
  133. package/export/artifacts/contracts/vault/TBTCVault.sol/TBTCVault.json +3476 -3476
  134. package/export/deploy/36_deploy_light_relay_maintainer_proxy.js +86 -0
  135. package/export/deploy/37_transfer_light_relay_maintainer_proxy_ownership.js +60 -0
  136. package/export/deploy/38_authorize_light_relay_maintainer_proxy_in_reimbursement_pool.js +70 -0
  137. package/export/deploy/39_authorize_light_relay_maintainer_proxy_in_light_relay.js +63 -0
  138. package/export/deploy/94_transfer_relay_ownership.js +64 -0
  139. package/export/typechain/LightRelayMaintainerProxy.js +2 -0
  140. package/export/typechain/factories/LightRelayMaintainerProxy__factory.js +359 -0
  141. package/export/typechain/factories/WalletCoordinator__factory.js +8 -2
  142. package/export/typechain/index.js +3 -1
  143. package/package.json +1 -1
@@ -1,4 +1,4 @@
1
1
  {
2
2
  "_format": "hh-sol-dbg-1",
3
- "buildInfo": "../../../build-info/39f844cc94c4d636461ba2357058eecf.json"
3
+ "buildInfo": "../../../build-info/4dae352543b4d68232673fef698e9426.json"
4
4
  }
@@ -1,4 +1,4 @@
1
1
  {
2
2
  "_format": "hh-sol-dbg-1",
3
- "buildInfo": "../../../build-info/39f844cc94c4d636461ba2357058eecf.json"
3
+ "buildInfo": "../../../build-info/4dae352543b4d68232673fef698e9426.json"
4
4
  }
@@ -1,4 +1,4 @@
1
1
  {
2
2
  "_format": "hh-sol-dbg-1",
3
- "buildInfo": "../../../build-info/39f844cc94c4d636461ba2357058eecf.json"
3
+ "buildInfo": "../../../build-info/4dae352543b4d68232673fef698e9426.json"
4
4
  }
@@ -1,4 +1,4 @@
1
1
  {
2
2
  "_format": "hh-sol-dbg-1",
3
- "buildInfo": "../../../build-info/39f844cc94c4d636461ba2357058eecf.json"
3
+ "buildInfo": "../../../build-info/4dae352543b4d68232673fef698e9426.json"
4
4
  }
@@ -433,6 +433,7 @@ contract WalletCoordinator is OwnableUpgradeable, Reimbursable {
433
433
  /// supposed to do that check on their own.
434
434
  /// @param proposal The sweeping proposal to validate.
435
435
  /// @param depositsExtraInfo Deposits extra data required to perform the validation.
436
+ /// @return True if the proposal is valid. Reverts otherwise.
436
437
  /// @dev Requirements:
437
438
  /// - The target wallet must be in the Live state,
438
439
  /// - The number of deposits included in the sweep must be in
@@ -458,7 +459,7 @@ contract WalletCoordinator is OwnableUpgradeable, Reimbursable {
458
459
  function validateDepositSweepProposal(
459
460
  DepositSweepProposal calldata proposal,
460
461
  DepositExtraInfo[] calldata depositsExtraInfo
461
- ) external view {
462
+ ) external view returns (bool) {
462
463
  require(
463
464
  bridge.wallets(proposal.walletPubKeyHash).state ==
464
465
  Wallets.WalletState.Live,
@@ -538,6 +539,8 @@ contract WalletCoordinator is OwnableUpgradeable, Reimbursable {
538
539
  "Deposit targets different vault"
539
540
  );
540
541
  }
542
+
543
+ return true;
541
544
  }
542
545
 
543
546
  /// @notice Validates the sweep tx fee by checking if the part of the fee
@@ -0,0 +1,147 @@
1
+ // SPDX-License-Identifier: GPL-3.0-only
2
+
3
+ // ██████████████ ▐████▌ ██████████████
4
+ // ██████████████ ▐████▌ ██████████████
5
+ // ▐████▌ ▐████▌
6
+ // ▐████▌ ▐████▌
7
+ // ██████████████ ▐████▌ ██████████████
8
+ // ██████████████ ▐████▌ ██████████████
9
+ // ▐████▌ ▐████▌
10
+ // ▐████▌ ▐████▌
11
+ // ▐████▌ ▐████▌
12
+ // ▐████▌ ▐████▌
13
+ // ▐████▌ ▐████▌
14
+ // ▐████▌ ▐████▌
15
+
16
+ pragma solidity 0.8.17;
17
+
18
+ import "@openzeppelin/contracts/access/Ownable.sol";
19
+ import "@keep-network/random-beacon/contracts/Reimbursable.sol";
20
+ import "@keep-network/random-beacon/contracts/ReimbursementPool.sol";
21
+
22
+ import "./LightRelay.sol";
23
+
24
+ /// @title LightRelayMaintainerProxy
25
+ /// @notice The proxy contract that allows the relay maintainers to be refunded
26
+ /// for the spent gas from the `ReimbursementPool`. When proving the
27
+ /// next Bitcoin difficulty epoch, the maintainer calls the
28
+ /// `LightRelayMaintainerProxy` which in turn calls the actual `LightRelay`
29
+ /// contract.
30
+ contract LightRelayMaintainerProxy is Ownable, Reimbursable {
31
+ ILightRelay public lightRelay;
32
+
33
+ /// @notice Stores the addresses that can maintain the relay. Those
34
+ /// addresses are attested by the DAO.
35
+ /// @dev The goal is to prevent a griefing attack by frontrunning relay
36
+ /// maintainer which is responsible for retargetting the relay in the
37
+ /// given round. The maintainer's transaction would revert with no gas
38
+ /// refund. Having the ability to restrict maintainer addresses is also
39
+ /// important in case the underlying relay contract has authorization
40
+ /// requirements for callers.
41
+ mapping(address => bool) public isAuthorized;
42
+
43
+ /// @notice Gas that is meant to balance the retarget overall cost. Can be
44
+ // updated by the governance based on the current market conditions.
45
+ uint256 public retargetGasOffset;
46
+
47
+ event LightRelayUpdated(address newRelay);
48
+
49
+ event MaintainerAuthorized(address indexed maintainer);
50
+
51
+ event MaintainerDeauthorized(address indexed maintainer);
52
+
53
+ event RetargetGasOffsetUpdated(uint256 retargetGasOffset);
54
+
55
+ modifier onlyRelayMaintainer() {
56
+ require(isAuthorized[msg.sender], "Caller is not authorized");
57
+ _;
58
+ }
59
+
60
+ modifier onlyReimbursableAdmin() override {
61
+ require(owner() == msg.sender, "Caller is not the owner");
62
+ _;
63
+ }
64
+
65
+ constructor(ILightRelay _lightRelay, ReimbursementPool _reimbursementPool) {
66
+ require(
67
+ address(_lightRelay) != address(0),
68
+ "Light relay must not be zero address"
69
+ );
70
+ require(
71
+ address(_reimbursementPool) != address(0),
72
+ "Reimbursement pool must not be zero address"
73
+ );
74
+
75
+ lightRelay = _lightRelay;
76
+ reimbursementPool = _reimbursementPool;
77
+
78
+ retargetGasOffset = 54000;
79
+ }
80
+
81
+ /// @notice Allows the governance to upgrade the `LightRelay` address.
82
+ /// @dev The function does not implement any governance delay and does not
83
+ /// check the status of the `LightRelay`. The Governance implementation
84
+ /// needs to ensure all requirements for the upgrade are satisfied
85
+ /// before executing this function.
86
+ function updateLightRelay(ILightRelay _lightRelay) external onlyOwner {
87
+ require(
88
+ address(_lightRelay) != address(0),
89
+ "New light relay must not be zero address"
90
+ );
91
+
92
+ lightRelay = _lightRelay;
93
+ emit LightRelayUpdated(address(_lightRelay));
94
+ }
95
+
96
+ /// @notice Authorizes the given address as a maintainer. Can only be called
97
+ /// by the owner and the address of the maintainer must not be
98
+ /// already authorized.
99
+ /// @dev The function does not implement any governance delay.
100
+ /// @param maintainer The address of the maintainer to be authorized.
101
+ function authorize(address maintainer) external onlyOwner {
102
+ require(!isAuthorized[maintainer], "Maintainer is already authorized");
103
+
104
+ isAuthorized[maintainer] = true;
105
+ emit MaintainerAuthorized(maintainer);
106
+ }
107
+
108
+ /// @notice Deauthorizes the given address as a maintainer. Can only be
109
+ /// called by the owner and the address of the maintainer must be
110
+ /// authorized.
111
+ /// @dev The function does not implement any governance delay.
112
+ /// @param maintainer The address of the maintainer to be deauthorized.
113
+ function deauthorize(address maintainer) external onlyOwner {
114
+ require(isAuthorized[maintainer], "Maintainer is not authorized");
115
+
116
+ isAuthorized[maintainer] = false;
117
+ emit MaintainerDeauthorized(maintainer);
118
+ }
119
+
120
+ /// @notice Updates the values of retarget gas offset.
121
+ /// @dev Can be called only by the contract owner. The caller is responsible
122
+ /// for validating the parameter. The function does not implement any
123
+ /// governance delay.
124
+ /// @param newRetargetGasOffset New retarget gas offset.
125
+ function updateRetargetGasOffset(uint256 newRetargetGasOffset)
126
+ external
127
+ onlyOwner
128
+ {
129
+ retargetGasOffset = newRetargetGasOffset;
130
+ emit RetargetGasOffsetUpdated(retargetGasOffset);
131
+ }
132
+
133
+ /// @notice Wraps `LightRelay.retarget` call and reimburses the caller's
134
+ /// transaction cost. Can only be called by an authorized relay
135
+ /// maintainer.
136
+ /// @dev See `LightRelay.retarget` function documentation.
137
+ function retarget(bytes memory headers) external onlyRelayMaintainer {
138
+ uint256 gasStart = gasleft();
139
+
140
+ lightRelay.retarget(headers);
141
+
142
+ reimbursementPool.refund(
143
+ (gasStart - gasleft()) + retargetGasOffset,
144
+ msg.sender
145
+ );
146
+ }
147
+ }
@@ -0,0 +1,35 @@
1
+ import { HardhatRuntimeEnvironment } from "hardhat/types"
2
+ import { DeployFunction } from "hardhat-deploy/types"
3
+
4
+ const func: DeployFunction = async function (hre: HardhatRuntimeEnvironment) {
5
+ const { deployments, getNamedAccounts, helpers } = hre
6
+ const { deploy } = deployments
7
+ const { deployer } = await getNamedAccounts()
8
+
9
+ const ReimbursementPool = await deployments.get("ReimbursementPool")
10
+ const LightRelay = await deployments.get("LightRelay")
11
+
12
+ const lightRelayMaintainerProxy = await deploy("LightRelayMaintainerProxy", {
13
+ contract: "LightRelayMaintainerProxy",
14
+ from: deployer,
15
+ args: [LightRelay.address, ReimbursementPool.address],
16
+ log: true,
17
+ waitConfirmations: 1,
18
+ })
19
+
20
+ if (hre.network.tags.etherscan) {
21
+ await helpers.etherscan.verify(lightRelayMaintainerProxy)
22
+ }
23
+
24
+ if (hre.network.tags.tenderly) {
25
+ await hre.tenderly.verify({
26
+ name: "LightRelayMaintainerProxy",
27
+ address: lightRelayMaintainerProxy.address,
28
+ })
29
+ }
30
+ }
31
+
32
+ export default func
33
+
34
+ func.tags = ["LightRelayMaintainerProxy"]
35
+ func.dependencies = ["LightRelay", "ReimbursementPool"]
@@ -0,0 +1,19 @@
1
+ import { HardhatRuntimeEnvironment } from "hardhat/types"
2
+ import { DeployFunction } from "hardhat-deploy/types"
3
+
4
+ const func: DeployFunction = async function (hre: HardhatRuntimeEnvironment) {
5
+ const { getNamedAccounts, helpers } = hre
6
+ const { deployer, governance } = await getNamedAccounts()
7
+
8
+ await helpers.ownable.transferOwnership(
9
+ "LightRelayMaintainerProxy",
10
+ governance,
11
+ deployer
12
+ )
13
+ }
14
+
15
+ export default func
16
+
17
+ func.tags = ["TransferLightRelayMaintainerProxyOwnership"]
18
+ func.dependencies = ["LightRelayMaintainerProxy"]
19
+ func.runAtTheEnd = true
@@ -0,0 +1,31 @@
1
+ import { HardhatRuntimeEnvironment } from "hardhat/types"
2
+ import { DeployFunction } from "hardhat-deploy/types"
3
+
4
+ const func: DeployFunction = async function (hre: HardhatRuntimeEnvironment) {
5
+ const { getNamedAccounts, deployments } = hre
6
+ const { execute } = deployments
7
+ const { governance } = await getNamedAccounts()
8
+
9
+ const LightRelayMaintainerProxy = await deployments.get(
10
+ "LightRelayMaintainerProxy"
11
+ )
12
+
13
+ await execute(
14
+ "ReimbursementPool",
15
+ { from: governance, log: true, waitConfirmations: 1 },
16
+ "authorize",
17
+ LightRelayMaintainerProxy.address
18
+ )
19
+ }
20
+
21
+ export default func
22
+
23
+ func.tags = ["AuthorizeLightRelayMaintainerProxyInReimbursementPool"]
24
+ func.dependencies = ["ReimbursementPool", "LightRelayMaintainerProxy"]
25
+
26
+ // On mainnet, the ReimbursementPool ownership is passed to the Threshold
27
+ // Council / DAO and that address is not controlled by the dev team.
28
+ // Hence, this step can be executed only for non-mainnet networks such as
29
+ // Hardhat (unit tests) and Goerli (testnet).
30
+ func.skip = async (hre: HardhatRuntimeEnvironment): Promise<boolean> =>
31
+ hre.network.name === "mainnet"
@@ -0,0 +1,24 @@
1
+ import { HardhatRuntimeEnvironment } from "hardhat/types"
2
+ import { DeployFunction } from "hardhat-deploy/types"
3
+
4
+ const func: DeployFunction = async function (hre: HardhatRuntimeEnvironment) {
5
+ const { getNamedAccounts, deployments } = hre
6
+ const { execute } = deployments
7
+ const { deployer } = await getNamedAccounts()
8
+
9
+ const LightRelayMaintainerProxy = await deployments.get(
10
+ "LightRelayMaintainerProxy"
11
+ )
12
+
13
+ await execute(
14
+ "LightRelay",
15
+ { from: deployer, log: true, waitConfirmations: 1 },
16
+ "authorize",
17
+ LightRelayMaintainerProxy.address
18
+ )
19
+ }
20
+
21
+ export default func
22
+
23
+ func.tags = ["AuthorizeLightRelayMaintainerProxyInLightRelay"]
24
+ func.dependencies = ["LightRelay", "LightRelayMaintainerProxy"]
@@ -0,0 +1,19 @@
1
+ import { HardhatRuntimeEnvironment } from "hardhat/types"
2
+ import { DeployFunction } from "hardhat-deploy/types"
3
+
4
+ const func: DeployFunction = async function (hre: HardhatRuntimeEnvironment) {
5
+ const { getNamedAccounts, helpers } = hre
6
+ const { deployer, governance } = await getNamedAccounts()
7
+
8
+ await helpers.ownable.transferOwnership("LightRelay", governance, deployer)
9
+ }
10
+
11
+ export default func
12
+
13
+ func.tags = ["TransferLightRelayOwnership"]
14
+ func.dependencies = ["LightRelay"]
15
+ func.runAtTheEnd = true
16
+
17
+ // Only execute for mainnet.
18
+ func.skip = async (hre: HardhatRuntimeEnvironment): Promise<boolean> =>
19
+ hre.network.name !== "mainnet"
@@ -109,32 +109,32 @@
109
109
  {
110
110
  "ast": {
111
111
  "nodeType": "YulBlock",
112
- "src": "0:201:124",
112
+ "src": "0:201:125",
113
113
  "statements": [
114
114
  {
115
115
  "nodeType": "YulBlock",
116
- "src": "6:3:124",
116
+ "src": "6:3:125",
117
117
  "statements": []
118
118
  },
119
119
  {
120
120
  "body": {
121
121
  "nodeType": "YulBlock",
122
- "src": "123:76:124",
122
+ "src": "123:76:125",
123
123
  "statements": [
124
124
  {
125
125
  "nodeType": "YulAssignment",
126
- "src": "133:26:124",
126
+ "src": "133:26:125",
127
127
  "value": {
128
128
  "arguments": [
129
129
  {
130
130
  "name": "headStart",
131
131
  "nodeType": "YulIdentifier",
132
- "src": "145:9:124"
132
+ "src": "145:9:125"
133
133
  },
134
134
  {
135
135
  "kind": "number",
136
136
  "nodeType": "YulLiteral",
137
- "src": "156:2:124",
137
+ "src": "156:2:125",
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:124"
145
+ "src": "141:3:125"
146
146
  },
147
147
  "nodeType": "YulFunctionCall",
148
- "src": "141:18:124"
148
+ "src": "141:18:125"
149
149
  },
150
150
  "variableNames": [
151
151
  {
152
152
  "name": "tail",
153
153
  "nodeType": "YulIdentifier",
154
- "src": "133:4:124"
154
+ "src": "133:4:125"
155
155
  }
156
156
  ]
157
157
  },
@@ -161,24 +161,24 @@
161
161
  {
162
162
  "name": "headStart",
163
163
  "nodeType": "YulIdentifier",
164
- "src": "175:9:124"
164
+ "src": "175:9:125"
165
165
  },
166
166
  {
167
167
  "name": "value0",
168
168
  "nodeType": "YulIdentifier",
169
- "src": "186:6:124"
169
+ "src": "186:6:125"
170
170
  }
171
171
  ],
172
172
  "functionName": {
173
173
  "name": "mstore",
174
174
  "nodeType": "YulIdentifier",
175
- "src": "168:6:124"
175
+ "src": "168:6:125"
176
176
  },
177
177
  "nodeType": "YulFunctionCall",
178
- "src": "168:25:124"
178
+ "src": "168:25:125"
179
179
  },
180
180
  "nodeType": "YulExpressionStatement",
181
- "src": "168:25:124"
181
+ "src": "168:25:125"
182
182
  }
183
183
  ]
184
184
  },
@@ -188,13 +188,13 @@
188
188
  {
189
189
  "name": "headStart",
190
190
  "nodeType": "YulTypedName",
191
- "src": "92:9:124",
191
+ "src": "92:9:125",
192
192
  "type": ""
193
193
  },
194
194
  {
195
195
  "name": "value0",
196
196
  "nodeType": "YulTypedName",
197
- "src": "103:6:124",
197
+ "src": "103:6:125",
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:124",
205
+ "src": "114:4:125",
206
206
  "type": ""
207
207
  }
208
208
  ],
209
- "src": "14:185:124"
209
+ "src": "14:185:125"
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": 124,
214
+ "id": 125,
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:124;;;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:125;;;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": {