Skip to content

Commit

Permalink
task/deploySAvaxPricer Adding sAvax pricer deploy script
Browse files Browse the repository at this point in the history
  • Loading branch information
fqlx committed Feb 17, 2022
1 parent 74bdee6 commit 25f639e
Show file tree
Hide file tree
Showing 2 changed files with 34 additions and 1 deletion.
2 changes: 1 addition & 1 deletion contracts/pricers/SAvaxPricer.sol
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ import {SafeMath} from "../packages/oz/SafeMath.sol";

/**
* @title SAvaxPricer
* @author Opyn Team
* @author Ben Burns ([email protected])
* @notice A Pricer contract for a sAVAX token
*/
contract SAvaxPricer is OpynPricerInterface {
Expand Down
33 changes: 33 additions & 0 deletions scripts/deploySAvaxPricer.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
const yargs = require('yargs')

const SAvaxPricer = artifacts.require('SAvaxPricer.sol')

module.exports = async function (callback) {
try {
const options = yargs
.usage(
'Usage: --network <network> --sAvax <sAvax> --underlying <underlying> --oracle <oracle> --gasPrice <gasPrice> --gasLimit <gasLimit>',
)
.option('network', { describe: 'Network name', type: 'string', demandOption: true })
.option('sAvax', { describe: 'sAvax address', type: 'string', demandOption: true })
.option('underlying', { describe: 'Underlying 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 sAvax pricer contract to ${options.network} 🍕`)

const tx = await SAvaxPricer.new(options.sAvax, options.underlying, options.oracle, {
gasPrice: options.gasPrice,
gas: options.gasLimit,
})

console.log('sAvax pricer deployed! 🎉')
console.log(`Transaction hash: ${tx.transactionHash}`)
console.log(`Deployed contract address: ${tx.address}`)

callback()
} catch (err) {
callback(err)
}
}

0 comments on commit 25f639e

Please sign in to comment.