Skip to content

Commit

Permalink
Script to deploy new Otoken implementation (#372)
Browse files Browse the repository at this point in the history
* truffle script to deploy new Otoken implementation
* Fix typo

Co-authored-by: Anton Cheng <[email protected]>
  • Loading branch information
haythem96 and antoncoding authored Apr 22, 2021
1 parent 79cd1c4 commit 6a4aec5
Showing 1 changed file with 24 additions and 0 deletions.
24 changes: 24 additions & 0 deletions scripts/deployOtokenImpl.js
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)
}
}

0 comments on commit 6a4aec5

Please sign in to comment.