2023-01-09 15:01:43 +00:00
|
|
|
async function deployMarketplace({ deployments, getNamedAccounts }) {
|
2022-02-09 13:17:23 +00:00
|
|
|
const token = await deployments.get("TestToken")
|
2023-01-17 14:09:19 +00:00
|
|
|
const configuration = {
|
|
|
|
collateral: {
|
|
|
|
initialAmount: 100,
|
|
|
|
minimumAmount: 40,
|
|
|
|
slashCriterion: 3,
|
|
|
|
slashPercentage: 10,
|
|
|
|
},
|
|
|
|
proofs: {
|
|
|
|
period: 10,
|
|
|
|
timeout: 5,
|
|
|
|
downtime: 64,
|
|
|
|
},
|
|
|
|
}
|
|
|
|
const args = [token.address, configuration]
|
2021-11-16 12:54:38 +00:00
|
|
|
const { deployer } = await getNamedAccounts()
|
2023-01-09 15:01:43 +00:00
|
|
|
await deployments.deploy("Marketplace", { 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)
|
2023-01-09 15:01:43 +00:00
|
|
|
await deployMarketplace(environment)
|
2022-03-15 15:45:35 +00:00
|
|
|
}
|
|
|
|
|
2023-01-09 15:01:43 +00:00
|
|
|
module.exports.tags = ["Marketplace"]
|
2022-02-09 13:17:23 +00:00
|
|
|
module.exports.dependencies = ["TestToken"]
|