Skip to content

Instantly share code, notes, and snippets.

@0xAnon101
Last active May 17, 2021 07:05
Show Gist options
  • Select an option

  • Save 0xAnon101/a7fed5a7fad0f42fe4fa86265a7f1d73 to your computer and use it in GitHub Desktop.

Select an option

Save 0xAnon101/a7fed5a7fad0f42fe4fa86265a7f1d73 to your computer and use it in GitHub Desktop.
Deployer modifications
const Registration = artifacts.require("Registration");
const fs = require('fs');
const path = '/../src/metaData.js'; // need to create src folder first
module.exports = async function (deployer) {
await deployer.deploy(Registration);
const instance = await Registration.deployed();
fs.writeFile(
__dirname + path,
`const ADDRESS = ${Registration.address};\nconst ABI = ${JSON.stringify(Registration.abi)};\nmodule.exports = {\nADDRESS,\n ABI\n};`,
(err) => {
if(err) throw err;
console.log('Contract initialie data has been saved!');
}
)
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment