Skip to content

Commit

Permalink
Add maticX deployment script
Browse files Browse the repository at this point in the history
  • Loading branch information
mavvverick committed Sep 3, 2022
1 parent 9cf7178 commit 9bf6097
Showing 1 changed file with 34 additions and 0 deletions.
34 changes: 34 additions & 0 deletions scripts/deployMaticX.js
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)
}
}

0 comments on commit 9bf6097

Please sign in to comment.