Web3.js: TypeError: BigNumber is not a constructor

Created on 11 Dec 2018  路  2Comments  路  Source: ChainSafe/web3.js

Usage

const BigNumber = web3.BigNumber;

module.exports = {
  ZERO_ADDRESS: '0x0000000000000000000000000000000000000000',
  MAX_UINT256: new BigNumber(2).pow(256).minus(1),
};

Details

  • Truffle v5.0.0-next.20 (core: 5.0.0-beta.2)
  • Solidity v0.5.0 (solc-js)
  • Node v8.9.3
  • [email protected]
support

Most helpful comment

All 2 comments

Hey thanks for the issue as @mswezey23 has stated you need to use web3.utils.BN -https://web3js.readthedocs.io/en/1.0/web3-utils.html#bn

Will close it now
Thanks

Was this page helpful?
0 / 5 - 0 ratings

Related issues

xpepermint picture xpepermint  路  3Comments

dzarezenko picture dzarezenko  路  3Comments

TinyWJL picture TinyWJL  路  3Comments

zamoore picture zamoore  路  3Comments

joeriexelmans picture joeriexelmans  路  3Comments