Created
February 12, 2020 14:48
-
-
Save dumebi/cfee8e5e1c37134a6ab21ea568339438 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
const { scripts, ConfigManager } = require('@openzeppelin/cli'); | |
const { add, push, create } = scripts; | |
require('dotenv').config(); | |
async function deploy(options, accounts) { | |
console.log('accounts ', accounts) | |
add({ contractsData: [{ name: 'ANO', alias: 'ANO' }] }); | |
await push(options); | |
await create(Object.assign({ contractAlias: 'ANO', methodName: 'initialize', methodArgs: [ | |
"ANO Token", "ANO", 18, `${process.env.METAMASK_ADDRESS}`, `${process.env.METAMASK_ADDRESS}`, 10 | |
]}, options)); | |
} | |
module.exports = (deployer, networkName, accounts) => { | |
deployer.then(async () => { | |
const { network, txParams } = await ConfigManager.initNetworkConfiguration({ network: networkName, from: accounts[1] }) | |
console.log(network, txParams) | |
await deploy({ network, txParams, from: `${process.env.METAMASK_ADDRESS}` }) | |
}) | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment