@keep-network/tbtc-v2 1.3.0-dev.4 → 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.
- 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/KeepRegistry.json +1 -1
- package/artifacts/KeepStake.json +2 -2
- package/artifacts/KeepToken.json +2 -2
- package/artifacts/KeepTokenStaking.json +1 -1
- package/artifacts/LightRelay.json +3 -3
- package/artifacts/LightRelayMaintainerProxy.json +479 -0
- package/artifacts/MaintainerProxy.json +3 -3
- package/artifacts/MovingFunds.json +2 -2
- package/artifacts/NuCypherStakingEscrow.json +1 -1
- package/artifacts/NuCypherToken.json +2 -2
- package/artifacts/RandomBeacon.json +2 -2
- package/artifacts/RandomBeaconChaosnet.json +2 -2
- package/artifacts/RandomBeaconGovernance.json +2 -2
- package/artifacts/Redemption.json +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/VendingMachineKeep.json +1 -1
- package/artifacts/VendingMachineNuCypher.json +1 -1
- package/artifacts/VendingMachineV2.json +3 -3
- package/artifacts/VendingMachineV3.json +3 -3
- package/artifacts/WalletCoordinator.json +5 -5
- package/artifacts/WalletRegistry.json +5 -5
- package/artifacts/WalletRegistryGovernance.json +2 -2
- package/artifacts/Wallets.json +2 -2
- package/artifacts/solcInputs/{609b7e5bc658a3c9d056ae5f7bac2b7c.json → 08bd3c90d7f376263925b4f52b0adff9.json} +3 -0
- 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/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 +4 -0
- package/build/contracts/relay/LightRelayMaintainerProxy.sol/LightRelayMaintainerProxy.json +280 -0
- 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/relay/LightRelayMaintainerProxy.sol +147 -0
- package/deploy/36_deploy_light_relay_maintainer_proxy.ts +35 -0
- package/deploy/37_transfer_light_relay_maintainer_proxy_ownership.ts +19 -0
- package/deploy/38_authorize_light_relay_maintainer_proxy_in_reimbursement_pool.ts +31 -0
- package/deploy/39_authorize_light_relay_maintainer_proxy_in_light_relay.ts +24 -0
- package/deploy/94_transfer_relay_ownership.ts +19 -0
- package/export/artifacts/@keep-network/bitcoin-spv-sol/contracts/BTCUtils.sol/BTCUtils.json +20 -20
- package/export/artifacts/@keep-network/ecdsa/contracts/EcdsaDkgValidator.sol/EcdsaDkgValidator.json +1986 -1986
- package/export/artifacts/@keep-network/ecdsa/contracts/libraries/EcdsaDkg.sol/EcdsaDkg.json +20 -20
- package/export/artifacts/@keep-network/ecdsa/contracts/libraries/EcdsaInactivity.sol/EcdsaInactivity.json +1836 -1836
- package/export/artifacts/@keep-network/random-beacon/contracts/ReimbursementPool.sol/ReimbursementPool.json +545 -545
- package/export/artifacts/@keep-network/sortition-pools/contracts/Chaosnet.sol/Chaosnet.json +506 -506
- package/export/artifacts/@keep-network/sortition-pools/contracts/Rewards.sol/Rewards.json +23 -23
- package/export/artifacts/@keep-network/sortition-pools/contracts/SortitionPool.sol/SortitionPool.json +2456 -2456
- package/export/artifacts/@keep-network/sortition-pools/contracts/SortitionTree.sol/SortitionTree.json +465 -465
- package/export/artifacts/@openzeppelin/contracts/proxy/ERC1967/ERC1967Proxy.sol/ERC1967Proxy.json +568 -568
- package/export/artifacts/@openzeppelin/contracts/proxy/transparent/ProxyAdmin.sol/ProxyAdmin.json +603 -603
- package/export/artifacts/@openzeppelin/contracts/proxy/transparent/TransparentUpgradeableProxy.sol/TransparentUpgradeableProxy.json +1001 -1001
- package/export/artifacts/@openzeppelin/contracts/token/ERC721/ERC721.sol/ERC721.json +1877 -1877
- package/export/artifacts/@openzeppelin/contracts-upgradeable/token/ERC20/ERC20Upgradeable.sol/ERC20Upgradeable.json +654 -654
- package/export/artifacts/@thesis/solidity-contracts/contracts/token/ERC20WithPermit.sol/ERC20WithPermit.json +2534 -2534
- package/export/artifacts/@thesis/solidity-contracts/contracts/token/MisfundRecovery.sol/MisfundRecovery.json +736 -736
- package/export/artifacts/contracts/bank/Bank.sol/Bank.json +1872 -1872
- package/export/artifacts/contracts/bridge/Bridge.sol/Bridge.json +7061 -7061
- package/export/artifacts/contracts/bridge/VendingMachine.sol/VendingMachine.json +1257 -1257
- package/export/artifacts/contracts/bridge/VendingMachineV2.sol/VendingMachineV2.json +972 -972
- package/export/artifacts/contracts/bridge/VendingMachineV3.sol/VendingMachineV3.json +1122 -1122
- package/export/artifacts/contracts/bridge/WalletCoordinator.sol/WalletCoordinator.json +4172 -4172
- package/export/artifacts/contracts/l2/L2TBTC.sol/L2TBTC.json +2961 -2961
- package/export/artifacts/contracts/l2/L2WormholeGateway.sol/L2WormholeGateway.json +2424 -2424
- package/export/artifacts/contracts/maintainer/MaintainerProxy.sol/MaintainerProxy.json +2305 -2305
- package/export/artifacts/contracts/relay/LightRelay.sol/LightRelay.json +1864 -1864
- package/export/artifacts/contracts/relay/LightRelayMaintainerProxy.sol/LightRelayMaintainerProxy.json +6348 -0
- package/export/artifacts/contracts/test/BankStub.sol/BankStub.json +1874 -1874
- package/export/artifacts/contracts/test/BridgeStub.sol/BridgeStub.json +8094 -8094
- package/export/artifacts/contracts/test/GoerliLightRelay.sol/GoerliLightRelay.json +1869 -1869
- package/export/artifacts/contracts/test/HeartbeatStub.sol/HeartbeatStub.json +130 -130
- package/export/artifacts/contracts/test/LightRelayStub.sol/LightRelayStub.json +1990 -1990
- package/export/artifacts/contracts/test/ReceiveApprovalStub.sol/ReceiveApprovalStub.json +354 -354
- package/export/artifacts/contracts/test/SystemTestRelay.sol/SystemTestRelay.json +568 -568
- package/export/artifacts/contracts/test/TestERC20.sol/TestERC20.json +2291 -2291
- package/export/artifacts/contracts/test/TestERC721.sol/TestERC721.json +1698 -1698
- package/export/artifacts/contracts/test/TestEcdsaLib.sol/TestEcdsaLib.json +189 -189
- package/export/artifacts/contracts/test/WormholeBridgeStub.sol/WormholeBridgeStub.json +1443 -1443
- package/export/artifacts/contracts/token/TBTC.sol/TBTC.json +2847 -2847
- package/export/artifacts/contracts/vault/DonationVault.sol/DonationVault.json +858 -858
- package/export/artifacts/contracts/vault/TBTCVault.sol/TBTCVault.json +3476 -3476
- package/export/deploy/36_deploy_light_relay_maintainer_proxy.js +86 -0
- package/export/deploy/37_transfer_light_relay_maintainer_proxy_ownership.js +60 -0
- package/export/deploy/38_authorize_light_relay_maintainer_proxy_in_reimbursement_pool.js +70 -0
- package/export/deploy/39_authorize_light_relay_maintainer_proxy_in_light_relay.js +63 -0
- package/export/deploy/94_transfer_relay_ownership.js +64 -0
- package/export/typechain/LightRelayMaintainerProxy.js +2 -0
- package/export/typechain/factories/LightRelayMaintainerProxy__factory.js +359 -0
- package/export/typechain/index.js +3 -1
- package/package.json +1 -1
|
@@ -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:
|
|
112
|
+
"src": "0:201:125",
|
|
113
113
|
"statements": [
|
|
114
114
|
{
|
|
115
115
|
"nodeType": "YulBlock",
|
|
116
|
-
"src": "6:3:
|
|
116
|
+
"src": "6:3:125",
|
|
117
117
|
"statements": []
|
|
118
118
|
},
|
|
119
119
|
{
|
|
120
120
|
"body": {
|
|
121
121
|
"nodeType": "YulBlock",
|
|
122
|
-
"src": "123:76:
|
|
122
|
+
"src": "123:76:125",
|
|
123
123
|
"statements": [
|
|
124
124
|
{
|
|
125
125
|
"nodeType": "YulAssignment",
|
|
126
|
-
"src": "133:26:
|
|
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:
|
|
132
|
+
"src": "145:9:125"
|
|
133
133
|
},
|
|
134
134
|
{
|
|
135
135
|
"kind": "number",
|
|
136
136
|
"nodeType": "YulLiteral",
|
|
137
|
-
"src": "156:2:
|
|
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:
|
|
145
|
+
"src": "141:3:125"
|
|
146
146
|
},
|
|
147
147
|
"nodeType": "YulFunctionCall",
|
|
148
|
-
"src": "141:18:
|
|
148
|
+
"src": "141:18:125"
|
|
149
149
|
},
|
|
150
150
|
"variableNames": [
|
|
151
151
|
{
|
|
152
152
|
"name": "tail",
|
|
153
153
|
"nodeType": "YulIdentifier",
|
|
154
|
-
"src": "133:4:
|
|
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:
|
|
164
|
+
"src": "175:9:125"
|
|
165
165
|
},
|
|
166
166
|
{
|
|
167
167
|
"name": "value0",
|
|
168
168
|
"nodeType": "YulIdentifier",
|
|
169
|
-
"src": "186:6:
|
|
169
|
+
"src": "186:6:125"
|
|
170
170
|
}
|
|
171
171
|
],
|
|
172
172
|
"functionName": {
|
|
173
173
|
"name": "mstore",
|
|
174
174
|
"nodeType": "YulIdentifier",
|
|
175
|
-
"src": "168:6:
|
|
175
|
+
"src": "168:6:125"
|
|
176
176
|
},
|
|
177
177
|
"nodeType": "YulFunctionCall",
|
|
178
|
-
"src": "168:25:
|
|
178
|
+
"src": "168:25:125"
|
|
179
179
|
},
|
|
180
180
|
"nodeType": "YulExpressionStatement",
|
|
181
|
-
"src": "168:25:
|
|
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:
|
|
191
|
+
"src": "92:9:125",
|
|
192
192
|
"type": ""
|
|
193
193
|
},
|
|
194
194
|
{
|
|
195
195
|
"name": "value0",
|
|
196
196
|
"nodeType": "YulTypedName",
|
|
197
|
-
"src": "103:6:
|
|
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:
|
|
205
|
+
"src": "114:4:125",
|
|
206
206
|
"type": ""
|
|
207
207
|
}
|
|
208
208
|
],
|
|
209
|
-
"src": "14:185:
|
|
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":
|
|
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:
|
|
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": {
|