-
Notifications
You must be signed in to change notification settings - Fork 97
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Script to deploy new Otoken implementation (#372)
* truffle script to deploy new Otoken implementation * Fix typo Co-authored-by: Anton Cheng <[email protected]>
- Loading branch information
1 parent
79cd1c4
commit 6a4aec5
Showing
1 changed file
with
24 additions
and
0 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
const yargs = require('yargs') | ||
|
||
const Otoken = artifacts.require('Otoken.sol') | ||
|
||
module.exports = async function(callback) { | ||
try { | ||
const options = yargs | ||
.usage('Usage: --network <network> --gas <gasPrice>') | ||
.option('network', {describe: 'Network name', type: 'string', demandOption: true}) | ||
.option('gas', {describe: 'Gas price in WEI', type: 'string', demandOption: false}).argv | ||
|
||
console.log(`Deploying Otoken contract on ${options.network} 🍕`) | ||
|
||
const tx = await Otoken.new({gasPrice: options.gas}) | ||
|
||
console.log('Otoken implementation deployed! 🎉') | ||
console.log(`Transaction hash: ${tx.transactionHash}`) | ||
console.log(`Deployed contract address: ${tx.address}`) | ||
|
||
callback() | ||
} catch (err) { | ||
callback(err) | ||
} | ||
} |