Skip to content

Commit

Permalink
fix(compound): rename mul/div operations
Browse files Browse the repository at this point in the history
BREAKING CHANGE: compoundMul (resp. compoundDiv) renamed to compMul (resp. compDiv)
  • Loading branch information
Rubilmax committed Oct 14, 2022
1 parent d81f802 commit 4004202
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions src/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -22,8 +22,8 @@ declare module "@ethersproject/bignumber/lib/bignumber" {
max: (other: BigNumberish) => BigNumber;
sum: (others: BigNumberish[]) => BigNumber;

compoundMul: (other: BigNumberish) => BigNumber;
compoundDiv: (other: BigNumberish) => BigNumber;
compMul: (other: BigNumberish) => BigNumber;
compDiv: (other: BigNumberish) => BigNumber;

percentAdd: (pct: BigNumberish) => BigNumber;
percentSub: (pct: BigNumberish) => BigNumber;
Expand Down Expand Up @@ -75,10 +75,10 @@ BigNumber.prototype.sum = function (others: BigNumberish[]) {
return others.reduce<BigNumber>((acc, val) => acc.add(val), this);
};

BigNumber.prototype.compoundMul = function (other: BigNumberish) {
BigNumber.prototype.compMul = function (other: BigNumberish) {
return BigNumber.from(this).mul(other).div(WAD);
};
BigNumber.prototype.compoundDiv = function (other: BigNumberish) {
BigNumber.prototype.compDiv = function (other: BigNumberish) {
return WAD.mul(this).mul(WAD).div(other).div(WAD);
};

Expand Down

0 comments on commit 4004202

Please sign in to comment.