Hello, I am trying to deply contract. Do you know what does it means this: creation of BABYTOKEN errored: Error encoding arguments: Error: invalid BigNumber string (argument="value", value="", code=INVALID_ARGUMENT, version=bignumber/5.5.0)
Thank you

May 1, 2022, 12:49 PM
It means you need to hex encode the number and use 'Bignumber' object. I.e if you use ethers.js for instance. if you want to obtain a bignumeber ethers have a number of utils: ethers.utils.parseEther("0.4")
May 1, 2022, 1:05 PM
So what I need to rewrite in code?
May 1, 2022, 1:58 PM
Convert the argument from a number to BigNumber. If you paste the line that deploys the contract i can show you how to correct it
May 1, 2022, 2:00 PM
The problem is that my code contains 10 000 words (comments included) and remix does not show line of error so I don't know specific part
Do you know which function could be it?
May 1, 2022, 2:03 PM
if you use remix, it should indicate the line of code that fails
But if you got it to compile, then its in a conversion from a string or numeric to a bignumber
i ussse if you then hit the deploy, then you use hardhat for deployment to a test chain. I suggest use the remix deployer for the contract and see what happens.
I'm pretty sure it happens at the line where the babytoken contaract instantation is attempted
May 1, 2022, 2:07 PM
I see only this
May 1, 2022, 2:09 PM
if you have this: let factory = new ethers.ContractFactory(metadata.abi, metadata.data.bytecode.object, signer);

let contract = await factory.deploy(...constructorArgs);
then the array of the arguments which expects a bignumber is incorrectly encoded
May 1, 2022, 2:09 PM
Welcome to Remix 0.23.2

Your files are stored in indexedDB, 1.41 KB / 279.15 GB used

You can use this terminal to:
Check transactions details and start debugging.
Execute JavaScript scripts:
- Input a script directly in the command line interface
- Select a Javascript file in the file explorer and then run \remix.execute()\ or \remix.exeCurrent()\ in the command line interface
- Right click on a JavaScript file in the file explorer and then click \Run\
The following libraries are accessible:
web3 version 1.5.2
ethers.js
remix
Type the library name to see available commands.
creation of BABYTOKEN errored: Error encoding arguments: Error: invalid BigNumber string (argument="value", value="", code=INVALID_ARGUMENT, version=bignumber/5.5.0)
I have not this in code
May 1, 2022, 2:10 PM
so look at the consturor args and then use ethers to convert the argument in your solidity contract is a unit256 to be a bignumber using the ethers.js utilittyfunctions. I believe you intend to pass in a javascript number which will throw an error
you should have something similar: the constructor args is where the error is at.
May 1, 2022, 2:11 PM
May 1, 2022, 2:13 PM
ok, it is l one of the uint256 arguments when you pass them in from the deployment code that isnt converted to bignumber
i.e. the second contract, which i assume is called 'babytoken'.
May 1, 2022, 2:14 PM
I would upload the code but all services which I know does not allow to upload so big code
May 1, 2022, 2:14 PM
Anon: i think he deployed via a javascript depoyment contract.
May 1, 2022, 2:15 PM
May 1, 2022, 2:15 PM
er, deployment script.
May 1, 2022, 2:15 PM
May 1, 2022, 2:16 PM
Anon mean the next tab, the one with the ETH and arrow symbol
May 1, 2022, 2:16 PM
So choose js instead of injected web3 ?
May 1, 2022, 2:16 PM
no, injected is fine, but we just want to see whta tyou put in as deploy arguments to the contract
May 1, 2022, 2:17 PM
Is it also in lefz side?
May 1, 2022, 2:17 PM
May 1, 2022, 2:18 PM
Ok
May 1, 2022, 2:19 PM
you should get a number of arguments there on the left side. Show what you type in those.
May 1, 2022, 2:19 PM
I havent values there
I think I will be seeting it in bscscan
May 1, 2022, 2:19 PM
ok, you should add values in those, then clicking deploy should work
May 1, 2022, 2:19 PM
Ok, thank you 👍
May 1, 2022, 2:20 PM
no, binance chanisn only does suggest the transaction fees
May 1, 2022, 2:20 PM
If is there for example adress[3] it means that I may to write 3 adresses excluded by , Right? 😅
May 1, 2022, 2:23 PM
Those addresses must be correct and to the indicated contracts
Othee than that - yes
May 1, 2022, 2:26 PM

© 2024 Draquery.com All rights reserved.