-
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.
- Loading branch information
1 parent
9cf7178
commit 9bf6097
Showing
1 changed file
with
34 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,34 @@ | ||
const yargs = require('yargs') | ||
|
||
const MaticXPricer = artifacts.require('MaticX.sol') | ||
|
||
module.exports = async function(callback) { | ||
try { | ||
const options = yargs | ||
.usage( | ||
'Usage: --network <network> --bot <bot> --asset <asset> --aggregator <aggregator> --oracle <oracle> --gasPrice <gasPrice> --gasLimit <gasLimit>', | ||
) | ||
.option('network', {describe: 'Network name', type: 'string', demandOption: true}) | ||
.option('bot', {describe: 'Bot address', type: 'string', demandOption: true}) | ||
.option('asset', {describe: 'Asset address', type: 'string', demandOption: true}) | ||
.option('aggregator', {describe: 'maticX aggregator address', type: 'string', demandOption: true}) | ||
.option('oracle', {describe: 'Oracle module address', type: 'string', demandOption: true}) | ||
.option('gasPrice', {describe: 'Gas price in WEI', type: 'string', demandOption: false}) | ||
.option('gasLimit', {describe: 'Gas Limit in WEI', type: 'string', demandOption: false}).argv | ||
|
||
console.log(`Deploying maticX pricer contract on ${options.network} 🍕`) | ||
|
||
const tx = await MaticXPricer.new(options.bot, options.asset, options.aggregator, options.oracle, { | ||
gasPrice: options.gasPrice, | ||
gas: options.gasLimit, | ||
}) | ||
|
||
console.log('maticX pricer deployed! 🎉') | ||
console.log(`Transaction hash: ${tx.transactionHash}`) | ||
console.log(`Deployed contract address: ${tx.address}`) | ||
|
||
callback() | ||
} catch (err) { | ||
callback(err) | ||
} | ||
} |