Skip to content

Commit 77c1ba9

Browse files
committed
updated rebase script
1 parent b6d5e49 commit 77c1ba9

File tree

2 files changed

+5
-6
lines changed

2 files changed

+5
-6
lines changed

sdk/ampleforth.js

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -34,11 +34,10 @@ const execRebase = async (
3434
txParams = {},
3535
) => {
3636
// Casting percChange to Bignumber.js instance to handle floating points
37-
const rateDiff = BigNumber(AMPL_BASE_RATE.toString())
38-
.times(percChange)
39-
.div(100)
40-
.toString(10);
41-
const newRate = AMPL_BASE_RATE.add(rateDiff);
37+
const newRate = new BigNumber(AMPL_BASE_RATE.toString())
38+
.times(100 + parseFloat(percChange))
39+
.div(100)
40+
.toString(10);
4241

4342
const rateTx = await rateOracle.connect(signer).pushReport(newRate, txParams);
4443
await rateTx.wait();

tasks/ops/rebase.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ const {
1414
const { printRebaseInfo, execRebase } = require('../../sdk/ampleforth');
1515

1616
txTask('testnet:rebase:base_chain', 'Executes rebase on the base chain')
17-
.addParam('rebasePerc', 'The rebase percentage to be applied', 0, types.float)
17+
.addParam('rebasePerc', 'The rebase percentage to be applied', '0')
1818
.setAction(async (args, hre) => {
1919
const txParams = { gasPrice: args.gasPrice, gasLimit: args.gasLimit };
2020
if (txParams.gasPrice == 0) {

0 commit comments

Comments
 (0)