Replies: 4 comments
-
Can you update to the latest version of ethers to see if that helps? You are using a 5.3 package, and I don’t think anything has changed regarding BigNumber accepting a BigNumber, it helps rule it out. |
Beta Was this translation helpful? Give feedback.
-
It also looks like you are passing in an |
Beta Was this translation helpful? Give feedback.
-
I updated it to ethers 5.4.6 but everything comes up as 5.4.0, I assume that is correct? Sorry, I am just figuring this all out and am still learning. |
Beta Was this translation helpful? Give feedback.
-
Based on your error it looks like the API changed between v1 and v2 and they now expect an additional parameter somewhere. If you look at the line that is crashing it likely has a contract method; compare the ABI for that method. :) |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
-
This is the error I am getting
Error: invalid BigNumber value (argument="value", value={"value":{"type":"BigNumber","hex":"0x470de4df820000"}}, code=INVALID_ARGUMENT, version=bignumber/5.3.0)
at Logger.makeError (C:\Users\Test\Projects_2\pancakeswap-prediction-winner-master\node_modules@ethersproject\logger\lib\index.js:187:21)
at Logger.throwError (C:\Users\Test\Projects_2\pancakeswap-prediction-winner-master\node_modules@ethersproject\logger\lib\index.js:196:20)
at Logger.throwArgumentError (C:\Users\Test\Projects_2\pancakeswap-prediction-winner-master\node_modules@ethersproject\logger\lib\index.js:199:21)
at Function.BigNumber.from (C:\Users\Test\Projects_2\pancakeswap-prediction-winner-master\node_modules@ethersproject\bignumber\lib\bignumber.js:241:23)
at NumberCoder.encode (C:\Users\Test\Projects_2\pancakeswap-prediction-winner-master\node_modules@ethersproject\abi\lib\coders\number.js:36:39)
at C:\Users\Test\Projects_2\pancakeswap-prediction-winner-master\node_modules@ethersproject\abi\lib\coders\array.js:74:19
at Array.forEach ()
at Object.pack (C:\Users\Test\Projects_2\pancakeswap-prediction-winner-master\node_modules@ethersproject\abi\lib\coders\array.js:60:12)
at TupleCoder.encode (C:\Users\Test\Projects_2\pancakeswap-prediction-winner-master\node_modules@ethersproject\abi\lib\coders\tuple.js:71:24)
at AbiCoder.encode (C:\Users\Test\Projects_2\pancakeswap-prediction-winner-master\node_modules@ethersproject\abi\lib\abi-coder.js:93:15) {
reason: 'invalid BigNumber value',
code: 'INVALID_ARGUMENT',
argument: 'value',
value: { value: BigNumber { _hex: '0x470de4df820000', _isBigNumber: true } }
This script used to run fine but the Pancakeswap Prediction contract went from V1 to V2 so I had to re-do some of it. I redid the ABI and changed the contract # to the new contract and now I receive this error. I have seen that there is a bug of some sort (Sorry, Newb) with Big Number so I am not sure if my errors are coming up because of a central bug or coding on my side. Can you please help?
Thanks!
Note: Not all sections may be relevant, but please be as thorough while remaining concise as possible. Remove this Notice and any sections that don't feel pertinent.
If you are unsure if something is a bug, start a thread in the "discussions" tab above..
Describe the bug
A clear and concise description of what the bug is.
Reproduction steps
Please include code snippets, with console.log output, any contract ABI, contract address, network and the full error.
Environment:
Please include anything that may be useful in diagnosing the issue. Node vs Browser? Geth vs Parity vs Ganache? Third Party tools, like Hardhat? Mobile vs. Desktop?
Search Terms
Often similar issues have come up before. Include any search terms you have tried in this repository's Issues (including closed issues) and "Discussions", so if there are matching issues, we can be sure to add those keywords and link this issue to it, making it easier for people to find in the future.
Beta Was this translation helpful? Give feedback.
All reactions