@keep-network/tbtc-v2 0.1.1-dev.9 → 0.1.1-dev.92
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/README.adoc +12 -0
- package/artifacts/Bank.json +807 -0
- package/artifacts/Bridge.json +2300 -0
- package/artifacts/Deposit.json +117 -0
- package/artifacts/DepositSweep.json +77 -0
- package/artifacts/EcdsaDkgValidator.json +532 -0
- package/artifacts/EcdsaInactivity.json +156 -0
- package/artifacts/EcdsaSortitionPool.json +1004 -0
- package/artifacts/Fraud.json +164 -0
- package/artifacts/KeepRegistry.json +99 -0
- package/artifacts/KeepStake.json +286 -0
- package/artifacts/KeepToken.json +711 -0
- package/artifacts/KeepTokenStaking.json +483 -0
- package/artifacts/MovingFunds.json +249 -0
- package/artifacts/NuCypherStakingEscrow.json +256 -0
- package/artifacts/NuCypherToken.json +711 -0
- package/artifacts/RandomBeaconStub.json +141 -0
- package/artifacts/Redemption.json +174 -0
- package/artifacts/ReimbursementPool.json +509 -0
- package/artifacts/Relay.json +123 -0
- package/artifacts/T.json +1148 -0
- package/artifacts/TBTC.json +27 -26
- package/artifacts/TBTCToken.json +27 -26
- package/artifacts/TBTCVault.json +691 -0
- package/artifacts/TokenStaking.json +2288 -0
- package/artifacts/TokenholderGovernor.json +1795 -0
- package/artifacts/TokenholderTimelock.json +1058 -0
- package/artifacts/VendingMachine.json +31 -30
- package/artifacts/VendingMachineKeep.json +400 -0
- package/artifacts/VendingMachineNuCypher.json +400 -0
- package/artifacts/WalletRegistry.json +1843 -0
- package/artifacts/WalletRegistryGovernance.json +2754 -0
- package/artifacts/Wallets.json +186 -0
- package/artifacts/solcInputs/2522ad78efeee521d6cb3252a08f9f62.json +314 -0
- package/build/contracts/GovernanceUtils.sol/GovernanceUtils.dbg.json +1 -1
- package/build/contracts/GovernanceUtils.sol/GovernanceUtils.json +2 -2
- package/build/contracts/bank/Bank.sol/Bank.dbg.json +1 -1
- package/build/contracts/bank/Bank.sol/Bank.json +27 -4
- package/build/contracts/bank/IReceiveBalanceApproval.sol/IReceiveBalanceApproval.dbg.json +4 -0
- package/build/contracts/bank/IReceiveBalanceApproval.sol/IReceiveBalanceApproval.json +34 -0
- package/build/contracts/bridge/BitcoinTx.sol/BitcoinTx.dbg.json +1 -1
- package/build/contracts/bridge/BitcoinTx.sol/BitcoinTx.json +2 -2
- package/build/contracts/bridge/Bridge.sol/Bridge.dbg.json +1 -1
- package/build/contracts/bridge/Bridge.sol/Bridge.json +2547 -196
- package/build/contracts/bridge/BridgeState.sol/BridgeState.dbg.json +4 -0
- package/build/contracts/bridge/BridgeState.sol/BridgeState.json +226 -0
- package/build/contracts/bridge/Deposit.sol/Deposit.dbg.json +4 -0
- package/build/contracts/bridge/Deposit.sol/Deposit.json +72 -0
- package/build/contracts/bridge/DepositSweep.sol/DepositSweep.dbg.json +4 -0
- package/build/contracts/bridge/DepositSweep.sol/DepositSweep.json +30 -0
- package/build/contracts/bridge/EcdsaLib.sol/EcdsaLib.dbg.json +4 -0
- package/build/contracts/bridge/EcdsaLib.sol/EcdsaLib.json +10 -0
- package/build/contracts/bridge/Fraud.sol/Fraud.dbg.json +4 -0
- package/build/contracts/bridge/Fraud.sol/Fraud.json +86 -0
- package/build/contracts/bridge/Heartbeat.sol/Heartbeat.dbg.json +4 -0
- package/build/contracts/bridge/Heartbeat.sol/Heartbeat.json +10 -0
- package/build/contracts/bridge/IRelay.sol/IRelay.dbg.json +4 -0
- package/build/contracts/bridge/IRelay.sol/IRelay.json +37 -0
- package/build/contracts/bridge/MovingFunds.sol/MovingFunds.dbg.json +4 -0
- package/build/contracts/bridge/MovingFunds.sol/MovingFunds.json +138 -0
- package/build/contracts/bridge/Redemption.sol/OutboundTx.dbg.json +4 -0
- package/build/contracts/bridge/Redemption.sol/OutboundTx.json +10 -0
- package/build/contracts/bridge/Redemption.sol/Redemption.dbg.json +4 -0
- package/build/contracts/bridge/Redemption.sol/Redemption.json +92 -0
- package/build/contracts/bridge/VendingMachine.sol/VendingMachine.dbg.json +1 -1
- package/build/contracts/bridge/VendingMachine.sol/VendingMachine.json +2 -2
- package/build/contracts/bridge/Wallets.sol/Wallets.dbg.json +4 -0
- package/build/contracts/bridge/Wallets.sol/Wallets.json +112 -0
- package/build/contracts/token/TBTC.sol/TBTC.dbg.json +1 -1
- package/build/contracts/token/TBTC.sol/TBTC.json +2 -2
- package/build/contracts/vault/DonationVault.sol/DonationVault.dbg.json +4 -0
- package/build/contracts/vault/DonationVault.sol/DonationVault.json +108 -0
- package/build/contracts/vault/IVault.sol/IVault.dbg.json +1 -1
- package/build/contracts/vault/IVault.sol/IVault.json +24 -1
- package/build/contracts/vault/TBTCVault.sol/TBTCVault.dbg.json +1 -1
- package/build/contracts/vault/TBTCVault.sol/TBTCVault.json +295 -9
- package/contracts/GovernanceUtils.sol +4 -4
- package/contracts/bank/Bank.sol +119 -57
- package/contracts/bank/IReceiveBalanceApproval.sol +45 -0
- package/contracts/bridge/BitcoinTx.sol +232 -10
- package/contracts/bridge/Bridge.sol +1692 -244
- package/contracts/bridge/BridgeState.sol +739 -0
- package/contracts/bridge/Deposit.sol +269 -0
- package/contracts/bridge/DepositSweep.sol +571 -0
- package/contracts/bridge/EcdsaLib.sol +45 -0
- package/contracts/bridge/Fraud.sol +604 -0
- package/contracts/bridge/Heartbeat.sol +112 -0
- package/contracts/bridge/IRelay.sol +28 -0
- package/contracts/bridge/MovingFunds.sol +1089 -0
- package/contracts/bridge/Redemption.sol +1021 -0
- package/contracts/bridge/VendingMachine.sol +2 -2
- package/contracts/bridge/Wallets.sol +553 -0
- package/contracts/hardhat-dependency-compiler/.hardhat-dependency-compiler +1 -0
- package/contracts/hardhat-dependency-compiler/@keep-network/ecdsa/contracts/WalletRegistry.sol +3 -0
- package/contracts/hardhat-dependency-compiler/@openzeppelin/contracts/proxy/transparent/ProxyAdmin.sol +3 -0
- package/contracts/hardhat-dependency-compiler/@openzeppelin/contracts/proxy/transparent/TransparentUpgradeableProxy.sol +3 -0
- package/contracts/token/TBTC.sol +1 -1
- package/contracts/vault/DonationVault.sol +125 -0
- package/contracts/vault/IVault.sol +19 -13
- package/contracts/vault/TBTCVault.sol +200 -23
- package/deploy/00_resolve_relay.ts +28 -0
- package/deploy/{03_transfer_roles.ts → 03_transfer_vending_machine_roles.ts} +1 -1
- package/deploy/04_deploy_bank.ts +27 -0
- package/deploy/05_deploy_bridge.ts +80 -0
- package/deploy/06_deploy_tbtc_vault.ts +30 -0
- package/deploy/07_bank_update_bridge.ts +19 -0
- package/deploy/08_transfer_bank_ownership.ts +15 -0
- package/deploy/09_transfer_tbtc_vault_ownership.ts +15 -0
- package/deploy/10_transfer_bridge_governance.ts +20 -0
- package/deploy/11_initialize_wallet_owner.ts +18 -0
- package/deploy/11_transfer_proxy_admin_ownership.ts +30 -0
- package/deploy/12_deploy_proxy_admin_with_deputy.ts +33 -0
- package/export.json +15771 -443
- package/package.json +34 -26
- package/artifacts/solcInputs/58d5b3ee7688835879381470de985d6b.json +0 -128
|
@@ -0,0 +1,15 @@
|
|
|
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("Bank", governance, deployer)
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
export default func
|
|
12
|
+
|
|
13
|
+
func.tags = ["TransferBankOwnership"]
|
|
14
|
+
func.dependencies = ["Bank"]
|
|
15
|
+
func.runAtTheEnd = true
|
|
@@ -0,0 +1,15 @@
|
|
|
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("TBTCVault", governance, deployer)
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
export default func
|
|
12
|
+
|
|
13
|
+
func.tags = ["TransferTBTCVaultOwnership"]
|
|
14
|
+
func.dependencies = ["TBTCVault"]
|
|
15
|
+
func.runAtTheEnd = true
|
|
@@ -0,0 +1,20 @@
|
|
|
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 { deployer, governance } = await getNamedAccounts()
|
|
7
|
+
|
|
8
|
+
await deployments.execute(
|
|
9
|
+
"Bridge",
|
|
10
|
+
{ from: deployer },
|
|
11
|
+
"transferGovernance",
|
|
12
|
+
governance
|
|
13
|
+
)
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
export default func
|
|
17
|
+
|
|
18
|
+
func.tags = ["TransferBridgeGovernance"]
|
|
19
|
+
func.dependencies = ["Bridge"]
|
|
20
|
+
func.runAtTheEnd = true
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import type { HardhatRuntimeEnvironment } from "hardhat/types"
|
|
2
|
+
import type { DeployFunction } from "hardhat-deploy/types"
|
|
3
|
+
|
|
4
|
+
import initializeWalletOwner from "@keep-network/ecdsa/export/tasks/initialize-wallet-owner"
|
|
5
|
+
|
|
6
|
+
const func: DeployFunction = async (hre: HardhatRuntimeEnvironment) => {
|
|
7
|
+
const Bridge = await hre.deployments.get("Bridge")
|
|
8
|
+
|
|
9
|
+
await initializeWalletOwner(hre, Bridge.address)
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
export default func
|
|
13
|
+
|
|
14
|
+
func.tags = ["InitializeWalletOwner"]
|
|
15
|
+
func.dependencies = ["Bridge"]
|
|
16
|
+
|
|
17
|
+
func.skip = async (hre: HardhatRuntimeEnvironment): Promise<boolean> =>
|
|
18
|
+
hre.network.name === "mainnet"
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import type { HardhatRuntimeEnvironment } from "hardhat/types"
|
|
2
|
+
import type { DeployFunction } from "hardhat-deploy/types"
|
|
3
|
+
|
|
4
|
+
const func: DeployFunction = async (hre: HardhatRuntimeEnvironment) => {
|
|
5
|
+
const { helpers, upgrades, deployments } = hre
|
|
6
|
+
const { esdm, deployer } = await helpers.signers.getNamedSigners()
|
|
7
|
+
const { log } = deployments
|
|
8
|
+
|
|
9
|
+
// TODO: Once a DAO is established we want to switch to ProxyAdminWithDeputy and
|
|
10
|
+
// use the DAO as the proxy admin owner and ESDM as the deputy. Until then we
|
|
11
|
+
// use ESDM as the owner of ProxyAdmin contract.
|
|
12
|
+
const newProxyAdminOwner = esdm.address
|
|
13
|
+
|
|
14
|
+
const proxyAdmin = await upgrades.admin.getInstance()
|
|
15
|
+
|
|
16
|
+
const currentOwner = await proxyAdmin.owner()
|
|
17
|
+
|
|
18
|
+
// The `@openzeppelin/hardhat-upgrades` plugin deploys a single ProxyAdmin
|
|
19
|
+
// per network. We don't want to transfer the ownership if the owner is already
|
|
20
|
+
// set to the desired address.
|
|
21
|
+
if (!helpers.address.equal(currentOwner, newProxyAdminOwner)) {
|
|
22
|
+
log(`transferring ownership of ProxyAdmin to ${newProxyAdminOwner}`)
|
|
23
|
+
await proxyAdmin.connect(deployer).transferOwnership(newProxyAdminOwner)
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
export default func
|
|
28
|
+
|
|
29
|
+
func.tags = ["TransferProxyAdminOwnership"]
|
|
30
|
+
func.dependencies = ["Bridge"]
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import type { HardhatRuntimeEnvironment } from "hardhat/types"
|
|
2
|
+
import type { DeployFunction } from "hardhat-deploy/types"
|
|
3
|
+
|
|
4
|
+
const func: DeployFunction = async (hre: HardhatRuntimeEnvironment) => {
|
|
5
|
+
const { ethers, getNamedAccounts, upgrades, deployments } = hre
|
|
6
|
+
const { deployer, dao, esdm } = await getNamedAccounts()
|
|
7
|
+
|
|
8
|
+
const BridgeProxyAdminWithDeputy = await deployments.deploy(
|
|
9
|
+
"BridgeProxyAdminWithDeputy",
|
|
10
|
+
{
|
|
11
|
+
contract: "ProxyAdminWithDeputy",
|
|
12
|
+
from: deployer,
|
|
13
|
+
args: [dao, esdm],
|
|
14
|
+
log: true,
|
|
15
|
+
}
|
|
16
|
+
)
|
|
17
|
+
|
|
18
|
+
const Bridge = await deployments.get("Bridge")
|
|
19
|
+
|
|
20
|
+
const proxyAdmin = await upgrades.admin.getInstance()
|
|
21
|
+
|
|
22
|
+
await proxyAdmin
|
|
23
|
+
.connect(await ethers.getSigner(esdm))
|
|
24
|
+
.changeProxyAdmin(Bridge.address, BridgeProxyAdminWithDeputy.address)
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
export default func
|
|
28
|
+
|
|
29
|
+
func.tags = ["BridgeProxyAdminWithDeputy"]
|
|
30
|
+
func.dependencies = ["Bridge"]
|
|
31
|
+
|
|
32
|
+
// TODO: For now we skip this script as DAO is not yet established.
|
|
33
|
+
func.skip = async () => true
|