dagger-contracts/deploy/storage.js

37 lines
957 B
JavaScript
Raw Normal View History

async function deployStorage({ deployments, getNamedAccounts }) {
2022-02-09 13:17:23 +00:00
const token = await deployments.get("TestToken")
const proofPeriod = 10
const proofTimeout = 5
2022-03-10 09:19:21 +00:00
const proofDowntime = 64
const collateralAmount = 100
const slashMisses = 3
const slashPercentage = 10
const minCollateralThreshold = 40
const args = [
token.address,
proofPeriod,
proofTimeout,
2022-03-10 09:19:21 +00:00
proofDowntime,
collateralAmount,
slashMisses,
slashPercentage,
minCollateralThreshold,
]
const { deployer } = await getNamedAccounts()
await deployments.deploy("TestStorage", { args, from: deployer })
}
async function mine256blocks({ network, ethers }) {
if (network.tags.local) {
await ethers.provider.send("hardhat_mine", ["0x100"])
}
}
module.exports = async (environment) => {
await mine256blocks(environment)
await deployStorage(environment)
}
module.exports.tags = ["TestStorage"]
2022-02-09 13:17:23 +00:00
module.exports.dependencies = ["TestToken"]