Add deployment scripts for TestToken and Storage

This commit is contained in:
Mark Spanbroek 2021-11-16 13:54:38 +01:00 committed by markspanbroek
parent 3431f77c82
commit ce4760608b
4 changed files with 22 additions and 0 deletions

12
deploy/storage.js Normal file
View File

@ -0,0 +1,12 @@
module.exports = async ({deployments, getNamedAccounts}) => {
const token = await deployments.get('TestToken')
const stakeAmount = 100
const slashMisses = 3
const slashPercentage = 10
const args = [token.address, stakeAmount, slashMisses, slashPercentage]
const { deployer } = await getNamedAccounts()
await deployments.deploy('Storage', { args, from: deployer })
}
module.exports.tags = ['Storage']
module.exports.dependencies = ['TestToken']

6
deploy/token.js Normal file
View File

@ -0,0 +1,6 @@
module.exports = async ({deployments, getNamedAccounts}) => {
const { deployer } = await getNamedAccounts()
await deployments.deploy('TestToken', { args: [[deployer]], from: deployer })
}
module.exports.tags = ['TestToken']

1
deployments/.gitignore vendored Normal file
View File

@ -0,0 +1 @@
localhost

View File

@ -3,4 +3,7 @@ require("hardhat-deploy")
module.exports = { module.exports = {
solidity: "0.8.4", solidity: "0.8.4",
namedAccounts: {
deployer: { default: 0 }
}
} }