const Token = artifacts.require('Token');
const Chef = artifacts.require('Chef');
module.exports = async function (deployer, network, accounts) {
const DEV = accounts[0];
deployer.then(async () => {
try {
await deployer.deploy(Token, {
from: DEV,
gas: xxxxx
})
console.log(`Successfully deployed token ${network}. `)
console.log("Deploying token to network: " + network);
const TokenInstance = await Token.deployed();
const BLOCKREWARD = '50';
const STARTBLOCK = '0';
const ENDBLOCK = (parseInt(STARTBLOCK, 10) + 180000).toString(); // 5 weeks
// DEPLOY MASTERCHEF
await deployer.deploy(Chef, TokenInstance.address, DEV, BLOCKREWARD, { from: DEV, gas: xxxx });
const ChefInstance = await Chef.deployed();
} catch (e) {
console.log(e);
}
})
Oct 16, 2020, 8:12 AM
see how I'm including the artifacts, that means you need to have the SOL files for whatever contract compiled.
It's not a complete solution but it should help you understand.
Oct 16, 2020, 8:13 AM