2022-03-15 15:45:35 +00:00
|
|
|
async function deployStorage({ deployments, getNamedAccounts }) {
|
2022-02-09 13:17:23 +00:00
|
|
|
const token = await deployments.get("TestToken")
|
2022-03-02 14:44:58 +00:00
|
|
|
const proofPeriod = 10
|
|
|
|
const proofTimeout = 5
|
2022-03-10 09:19:21 +00:00
|
|
|
const proofDowntime = 64
|
2022-02-15 16:54:19 +00:00
|
|
|
const collateralAmount = 100
|
2021-11-16 12:54:38 +00:00
|
|
|
const slashMisses = 3
|
|
|
|
const slashPercentage = 10
|
2022-09-13 07:18:55 +00:00
|
|
|
const minCollateralThreshold = 40
|
2022-03-02 14:44:58 +00:00
|
|
|
const args = [
|
|
|
|
token.address,
|
|
|
|
proofPeriod,
|
|
|
|
proofTimeout,
|
2022-03-10 09:19:21 +00:00
|
|
|
proofDowntime,
|
2022-03-02 14:44:58 +00:00
|
|
|
collateralAmount,
|
|
|
|
slashMisses,
|
|
|
|
slashPercentage,
|
2022-09-13 07:18:55 +00:00
|
|
|
minCollateralThreshold,
|
2022-03-02 14:44:58 +00:00
|
|
|
]
|
2021-11-16 12:54:38 +00:00
|
|
|
const { deployer } = await getNamedAccounts()
|
2022-09-22 02:21:49 +00:00
|
|
|
await deployments.deploy("Storage", { args, from: deployer })
|
2021-11-16 12:54:38 +00:00
|
|
|
}
|
|
|
|
|
2022-03-15 15:45:35 +00:00
|
|
|
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)
|
|
|
|
}
|
|
|
|
|
2022-09-22 02:21:49 +00:00
|
|
|
module.exports.tags = ["Storage"]
|
2022-02-09 13:17:23 +00:00
|
|
|
module.exports.dependencies = ["TestToken"]
|