forked from humanprotocol/hmt-escrow
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
6 changed files
with
37 additions
and
20 deletions.
There are no files selected for viewing
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
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
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
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
const fs = require('fs'); | ||
|
||
const path = require('path'); | ||
|
||
const HMToken = artifacts.require('./HMToken.sol'); | ||
|
||
const ADDRESS_OUTPUT_FILENAME = '/deployed-hmtoken/hmt.address.json'; | ||
|
||
module.exports = (deployer) => { | ||
deployer | ||
.deploy(HMToken, 1000000000, 'Human Token', 18, 'HMT') | ||
.then(() => { | ||
const fileContent = { | ||
address: HMToken.address, | ||
}; | ||
|
||
try { | ||
fs.mkdirSync(path.dirname(ADDRESS_OUTPUT_FILENAME)); | ||
} catch (err) { | ||
if (err.code !== 'EEXIST') throw err; | ||
} | ||
|
||
fs.writeFile(ADDRESS_OUTPUT_FILENAME, JSON.stringify(fileContent, null, 2), (err) => { | ||
if (err) { | ||
console.error(`unable to write address to output file: ${ADDRESS_OUTPUT_FILENAME}`); | ||
} else { | ||
console.log(`deployed hmt token address stored in ${ADDRESS_OUTPUT_FILENAME}`); | ||
} | ||
}); | ||
}); | ||
}; |
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
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