@keep-network/tbtc-v2 0.1.1-dev.5 → 0.1.1-dev.50
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 +752 -0
- package/artifacts/Bridge.json +3271 -0
- package/artifacts/Deposit.json +117 -0
- package/artifacts/EcdsaDkgValidator.json +532 -0
- package/artifacts/EcdsaInactivity.json +156 -0
- package/artifacts/Fraud.json +153 -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 +160 -0
- package/artifacts/NuCypherStakingEscrow.json +256 -0
- package/artifacts/NuCypherToken.json +711 -0
- package/artifacts/RandomBeaconStub.json +141 -0
- package/artifacts/Redemption.json +161 -0
- package/artifacts/ReimbursementPool.json +509 -0
- package/artifacts/Relay.json +123 -0
- package/artifacts/SortitionPool.json +944 -0
- package/artifacts/Sweep.json +76 -0
- package/artifacts/T.json +1148 -0
- package/artifacts/TBTC.json +27 -26
- package/artifacts/TBTCToken.json +27 -26
- package/artifacts/TokenStaking.json +2288 -0
- package/artifacts/TokenholderGovernor.json +1795 -0
- package/artifacts/TokenholderTimelock.json +1058 -0
- package/artifacts/VendingMachine.json +30 -29
- package/artifacts/VendingMachineKeep.json +400 -0
- package/artifacts/VendingMachineNuCypher.json +400 -0
- package/artifacts/WalletRegistry.json +2709 -0
- package/artifacts/WalletRegistryGovernance.json +2364 -0
- package/artifacts/Wallets.json +186 -0
- package/artifacts/solcInputs/b0c3ed0992bd570aaaee717425c37538.json +218 -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 +20 -2
- package/build/contracts/bridge/BitcoinTx.sol/BitcoinTx.dbg.json +4 -0
- package/build/contracts/bridge/BitcoinTx.sol/BitcoinTx.json +10 -0
- package/build/contracts/bridge/Bridge.sol/Bridge.dbg.json +1 -1
- package/build/contracts/bridge/Bridge.sol/Bridge.json +2093 -77
- package/build/contracts/bridge/BridgeState.sol/BridgeState.dbg.json +4 -0
- package/build/contracts/bridge/BridgeState.sol/BridgeState.json +166 -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/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/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 +81 -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/Sweep.sol/Sweep.dbg.json +4 -0
- package/build/contracts/bridge/Sweep.sol/Sweep.json +30 -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/IVault.sol/IVault.dbg.json +1 -1
- package/build/contracts/vault/IVault.sol/IVault.json +19 -1
- package/build/contracts/vault/TBTCVault.sol/TBTCVault.dbg.json +1 -1
- package/build/contracts/vault/TBTCVault.sol/TBTCVault.json +36 -18
- package/contracts/GovernanceUtils.sol +1 -1
- package/contracts/bank/Bank.sol +34 -18
- package/contracts/bridge/BitcoinTx.sol +234 -0
- package/contracts/bridge/Bridge.sol +1274 -126
- package/contracts/bridge/BridgeState.sol +538 -0
- package/contracts/bridge/Deposit.sol +266 -0
- package/contracts/bridge/EcdsaLib.sol +45 -0
- package/contracts/bridge/Fraud.sol +488 -0
- package/contracts/bridge/IRelay.sol +28 -0
- package/contracts/bridge/MovingFunds.sol +511 -0
- package/contracts/bridge/Redemption.sol +846 -0
- package/contracts/bridge/Sweep.sol +514 -0
- package/contracts/bridge/VendingMachine.sol +1 -1
- package/contracts/bridge/Wallets.sol +551 -0
- package/contracts/token/TBTC.sol +1 -1
- package/contracts/vault/IVault.sol +32 -10
- package/contracts/vault/TBTCVault.sol +20 -2
- package/deploy/00_resolve_relay.ts +28 -0
- package/deploy/04_deploy_bank.ts +27 -0
- package/deploy/05_deploy_bridge.ts +64 -0
- package/deploy/06_bank_update_bridge.ts +19 -0
- package/deploy/07_transfer_ownership.ts +15 -0
- package/deploy/08_transfer_governance.ts +20 -0
- package/export.json +15173 -472
- package/package.json +27 -23
- package/artifacts/solcInputs/d71966212a658480bad5748ad85b1396.json +0 -116
|
@@ -0,0 +1,28 @@
|
|
|
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, helpers } = hre
|
|
6
|
+
const { log } = deployments
|
|
7
|
+
const { deployer } = await getNamedAccounts()
|
|
8
|
+
|
|
9
|
+
const Relay = await deployments.getOrNull("Relay")
|
|
10
|
+
|
|
11
|
+
if (Relay && helpers.address.isValid(Relay.address)) {
|
|
12
|
+
log(`using external Relay at ${Relay.address}`)
|
|
13
|
+
} else if (hre.network.name !== "hardhat") {
|
|
14
|
+
throw new Error("deployed Relay contract not found")
|
|
15
|
+
} else {
|
|
16
|
+
log("deploying Relay stub")
|
|
17
|
+
|
|
18
|
+
await deployments.deploy("Relay", {
|
|
19
|
+
contract: "TestRelay",
|
|
20
|
+
from: deployer,
|
|
21
|
+
log: true,
|
|
22
|
+
})
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
export default func
|
|
27
|
+
|
|
28
|
+
func.tags = ["Relay"]
|
|
@@ -0,0 +1,27 @@
|
|
|
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 } = hre
|
|
6
|
+
const { deploy } = deployments
|
|
7
|
+
const { deployer } = await getNamedAccounts()
|
|
8
|
+
|
|
9
|
+
const Bank = await deploy("Bank", {
|
|
10
|
+
contract:
|
|
11
|
+
deployments.getNetworkName() === "hardhat" ? "BankStub" : undefined,
|
|
12
|
+
from: deployer,
|
|
13
|
+
args: [],
|
|
14
|
+
log: true,
|
|
15
|
+
})
|
|
16
|
+
|
|
17
|
+
if (hre.network.tags.tenderly) {
|
|
18
|
+
await hre.tenderly.verify({
|
|
19
|
+
name: "Bank",
|
|
20
|
+
address: Bank.address,
|
|
21
|
+
})
|
|
22
|
+
}
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
export default func
|
|
26
|
+
|
|
27
|
+
func.tags = ["Bank"]
|
|
@@ -0,0 +1,64 @@
|
|
|
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 } = hre
|
|
6
|
+
const { deploy } = deployments
|
|
7
|
+
const { deployer, treasury } = await getNamedAccounts()
|
|
8
|
+
|
|
9
|
+
const Bank = await deployments.get("Bank")
|
|
10
|
+
const Relay = await deployments.get("Relay")
|
|
11
|
+
|
|
12
|
+
// TODO: Test for mainnet deployment that when `WalletRegistry` is provided
|
|
13
|
+
// in `external/mainnet/` directory it gets resolved correctly, and the deployment
|
|
14
|
+
// script from `@keep-network/ecdsa` is not invoked once again.
|
|
15
|
+
const WalletRegistry = await deployments.get("WalletRegistry")
|
|
16
|
+
|
|
17
|
+
// For local tests use `1`.
|
|
18
|
+
const txProofDifficultyFactor =
|
|
19
|
+
deployments.getNetworkName() === "hardhat" ? 1 : 6
|
|
20
|
+
|
|
21
|
+
const Deposit = await deploy("Deposit", { from: deployer, log: true })
|
|
22
|
+
const Sweep = await deploy("Sweep", { from: deployer, log: true })
|
|
23
|
+
const Redemption = await deploy("Redemption", { from: deployer, log: true })
|
|
24
|
+
const Wallets = await deploy("Wallets", { from: deployer, log: true })
|
|
25
|
+
const Fraud = await deploy("Fraud", { from: deployer, log: true })
|
|
26
|
+
const MovingFunds = await deploy("MovingFunds", {
|
|
27
|
+
from: deployer,
|
|
28
|
+
log: true,
|
|
29
|
+
})
|
|
30
|
+
|
|
31
|
+
const Bridge = await deploy("Bridge", {
|
|
32
|
+
contract:
|
|
33
|
+
deployments.getNetworkName() === "hardhat" ? "BridgeStub" : undefined,
|
|
34
|
+
from: deployer,
|
|
35
|
+
args: [
|
|
36
|
+
Bank.address,
|
|
37
|
+
Relay.address,
|
|
38
|
+
treasury,
|
|
39
|
+
WalletRegistry.address,
|
|
40
|
+
txProofDifficultyFactor,
|
|
41
|
+
],
|
|
42
|
+
libraries: {
|
|
43
|
+
Deposit: Deposit.address,
|
|
44
|
+
Sweep: Sweep.address,
|
|
45
|
+
Redemption: Redemption.address,
|
|
46
|
+
Wallets: Wallets.address,
|
|
47
|
+
Fraud: Fraud.address,
|
|
48
|
+
MovingFunds: MovingFunds.address,
|
|
49
|
+
},
|
|
50
|
+
log: true,
|
|
51
|
+
})
|
|
52
|
+
|
|
53
|
+
if (hre.network.tags.tenderly) {
|
|
54
|
+
await hre.tenderly.verify({
|
|
55
|
+
name: "Bridge",
|
|
56
|
+
address: Bridge.address,
|
|
57
|
+
})
|
|
58
|
+
}
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
export default func
|
|
62
|
+
|
|
63
|
+
func.tags = ["Bridge"]
|
|
64
|
+
func.dependencies = ["Bank", "Relay", "Treasury", "WalletRegistry"]
|
|
@@ -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, deployments } = hre
|
|
6
|
+
const { execute, log } = deployments
|
|
7
|
+
const { deployer } = await getNamedAccounts()
|
|
8
|
+
|
|
9
|
+
const Bridge = await deployments.get("Bridge")
|
|
10
|
+
|
|
11
|
+
log("updating Bridge in Bank")
|
|
12
|
+
|
|
13
|
+
await execute("Bank", { from: deployer }, "updateBridge", Bridge.address)
|
|
14
|
+
}
|
|
15
|
+
|
|
16
|
+
export default func
|
|
17
|
+
|
|
18
|
+
func.tags = ["BankUpdateBridge"]
|
|
19
|
+
func.dependencies = ["Bank", "Bridge"]
|
|
@@ -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 = ["TransferOwnership"]
|
|
14
|
+
func.dependencies = ["Bank"]
|
|
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 = ["TransferGovernance"]
|
|
19
|
+
func.dependencies = ["Bridge"]
|
|
20
|
+
func.runAtTheEnd = true
|