init
This commit is contained in:
24
todofeed/backend-todofeed/migrations/2_deploy_todofeed.js
Normal file
24
todofeed/backend-todofeed/migrations/2_deploy_todofeed.js
Normal file
@@ -0,0 +1,24 @@
|
||||
|
||||
const TodoFeed = artifacts.require('./TodoFeed.sol')
|
||||
const fs = require('fs')
|
||||
module.exports = function (deployer) {
|
||||
deployer.deploy(TodoFeed)
|
||||
.then(() => {
|
||||
if (TodoFeed._json) {
|
||||
fs.writeFile(
|
||||
'deployedABI',
|
||||
JSON.stringify(TodoFeed._json.abi, 2),
|
||||
(err) => {
|
||||
if (err) throw err
|
||||
console.log(`The abi of ${TodoFeed._json.contractName} is recorded on deployedABI file`)
|
||||
})
|
||||
}
|
||||
fs.writeFile(
|
||||
'deployedAddress',
|
||||
TodoFeed.address,
|
||||
(err) => {
|
||||
if (err) throw err
|
||||
console.log(`The deployed contract address * ${TodoFeed.address} * is recorded on deployedAddress file`)
|
||||
})
|
||||
})
|
||||
}
|
||||
Reference in New Issue
Block a user