Hey! I know this doesnt directly have anything to do about uniswap but its the closest sub I could find
I tried providing my own gas values converted to BigInts, Numbers, Strings, and JSBI's, changing the number values, ect
I looked at some other stuff but nothing could resolved the error(s)
Expected Result: Transaction goes thru and approves money for spending by routerAddress
Error:
TypeError: invalid BigNumberish value (argument="value", value={ "hex": "0xb3e3", "type": "BigNumber" }, code=INVALID_ARGUMENT, version=6.4.2)
at makeError (file:///home/celestial/Documents/projects/auto-trading/web/node_modules/ethers/lib.esm/utils/errors.js:113:21)
at assert (file:///home/celestial/Documents/projects/auto-trading/web/node_modules/ethers/lib.esm/utils/errors.js:136:15)
at assertArgument (file:///home/celestial/Documents/projects/auto-trading/web/node_modules/ethers/lib.esm/utils/errors.js:147:5)
at getBigInt (file:///home/celestial/Documents/projects/auto-trading/web/node_modules/ethers/lib.esm/utils/maths.js:90:5)
at set gasLimit [as gasLimit] (file:///home/celestial/Documents/projects/auto-trading/web/node_modules/ethers/lib.esm/transaction/transaction.js:327:44)
at Transaction.from (file:///home/celestial/Documents/projects/auto-trading/web/node_modules/ethers/lib.esm/transaction/transaction.js:667:29)
at Wallet.sendTransaction (file:///home/celestial/Documents/projects/auto-trading/web/node_modules/ethers/lib.esm/providers/abstract-signer.js:181:35)
at process.processTicksAndRejections (node:internal/process/task_queues:95:5)
at async send (file:///home/celestial/Documents/projects/auto-trading/web/node_modules/ethers/lib.esm/contract/contract.js:199:20)
at async Proxy.approve (file:///home/celestial/Documents/projects/auto-trading/web/node_modules/ethers/lib.esm/contract/contract.js:232:16) {
code: 'INVALID_ARGUMENT',
argument: 'value',
value: [BigNumber]
Image of Error
https://preview.redd.it/y5065okm8jrb1.png?width=953&format=png&auto=webp&s=9af9cddc28d0d166e6eaefc442e3557511a65af9
Code for running approval function (erroring section)
// goerli chain
const wethAddress = '0xB4FBF271143F4FBf7B91A5ded31805e42b2208d6';
const routerAddress = '0x68b3465833fb72A70ecDF485E0e4C7bD8665Fc45';
const provider = new JsonRpcProvider(PROVIDER_URL);
const approvalContract = new Contract(wethAddress, erc20Abi, provider);
console.log('approving');
await approvalContract.connect(wallet).approve(
routerAddress,
6500000000000000
);
console.log('approved');
Any help would be appreciated, thanks!