Skip to content
This repository has been archived by the owner on Oct 12, 2021. It is now read-only.

Commit

Permalink
Added MinInt256 and MaxInt256 constants (ethers-io#1576).
Browse files Browse the repository at this point in the history
  • Loading branch information
ricmoo authored and pull[bot] committed Jun 4, 2021
1 parent dc45f63 commit f8cce0d
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 2 deletions.
7 changes: 6 additions & 1 deletion packages/constants/src.ts/bignumbers.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,16 @@ const Two: BigNumber = (/*#__PURE__*/BigNumber.from(2));
const WeiPerEther: BigNumber = (/*#__PURE__*/BigNumber.from("1000000000000000000"));
const MaxUint256: BigNumber = (/*#__PURE__*/BigNumber.from("0xffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff"));

const MinInt256: BigNumber = (/*#__PURE__*/BigNumber.from("-0x8000000000000000000000000000000000000000000000000000000000000000"));
const MaxInt256: BigNumber = (/*#__PURE__*/BigNumber.from("0x7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff"));

export {
NegativeOne,
Zero,
One,
Two,
WeiPerEther,
MaxUint256
MaxUint256,
MinInt256,
MaxInt256,
};
4 changes: 3 additions & 1 deletion packages/constants/src.ts/index.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,9 @@ export {
One,
Two,
WeiPerEther,
MaxUint256
MaxUint256,
MinInt256,
MaxInt256
} from "./bignumbers";
export { HashZero } from "./hashes";
export { EtherSymbol } from "./strings";
Expand Down

0 comments on commit f8cce0d

Please sign in to comment.