Last active
May 17, 2021 07:05
-
-
Save 0xAnon101/a7fed5a7fad0f42fe4fa86265a7f1d73 to your computer and use it in GitHub Desktop.
Deployer modifications
This file contains hidden or 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 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