I meet the same problem as this question: Passing an array as a parameter from javascrpt (web3) to a Solidity function

If I call my function in the browser-solidity with the parameter [122,44], it works well. But if I use it in my own web UI, it throw out "Error: new BigNumber() not a number". The way I call it is like:




I don't know why. It should be the same result as in the browser-solidiy.


What types your solidity function expects? If it's uint or int then you must convert your params to BigNumber before you passing it. E.g.:

import BigNumber from 'bignumber.js';
let myParams = [122,44];
let convertedParams = myParams.map( item => { return new BigNumber(item)});

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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