Skip to content

Commit

Permalink
fix(imports): update ethers imports
Browse files Browse the repository at this point in the history
  • Loading branch information
Rubilmax committed Feb 19, 2023
1 parent 4963c89 commit fe2e9b0
Showing 1 changed file with 4 additions and 5 deletions.
9 changes: 4 additions & 5 deletions src/utils.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
import { BigNumber, BigNumberish } from "@ethersproject/bignumber";
import { parseUnits } from "@ethersproject/units";
import { BigNumber, BigNumberish, utils } from "ethers";

export const pow10 = (power: BigNumberish) => BigNumber.from(10).pow(power);

Expand Down Expand Up @@ -65,9 +64,9 @@ export const avgHalfUp = (
return max(0, scale.sub(pct)).mul(x).add(min(scale, pct).mul(y)).add(scale.div(2)).div(scale);
};

export const parsePercent = (value: string) => parseUnits(value, 2);
export const parseWad = (value: string) => parseUnits(value, 18);
export const parseRay = (value: string) => parseUnits(value, 27);
export const parsePercent = (value: string) => utils.parseUnits(value, 2);
export const parseWad = (value: string) => utils.parseUnits(value, 18);
export const parseRay = (value: string) => utils.parseUnits(value, 27);

export const powHalfUp = (x: BigNumberish, exponent: BigNumberish, scale: BigNumber): BigNumber => {
exponent = BigNumber.from(exponent);
Expand Down

0 comments on commit fe2e9b0

Please sign in to comment.