I call

let inst = contract.deployed()

and then on inst I can then call

mybn = units.then(function(inst) {return inst.getBN()}

mybn looks like this

BN { negative: 0, words: [ 1, <1 empty item> ], length: 1, red: null }

and if I run mybn.toNumber() I get the error letting me know mybn.toNumber is not a function


1 Answer 1


Not sure if this is going to work because I don't understand the question fully. But Please try this.

First you can try using:


Then go to the following if it returns true.

var BN = web3.utils.BN;

new BN(1234).toString();


new BN('1234').add(new BN('1')).toString();


new BN('0xea').toString();


reference: https://web3js.readthedocs.io/en/v1.2.0/web3-utils.html#bn

Not the answer you're looking for? Browse other questions tagged or ask your own question.