Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error: invalid BigNumber string #445

Closed
MDimow opened this issue Feb 16, 2023 · 3 comments
Closed

Error: invalid BigNumber string #445

MDimow opened this issue Feb 16, 2023 · 3 comments
Labels
invalid This doesn't seem right

Comments

@MDimow
Copy link

MDimow commented Feb 16, 2023

Hello, everybody.

I am getting this problem when I try to set the _Cost before deploying when I use decimals.

creation of YourNftToken errored: Error encoding arguments: Error: invalid BigNumber string (argument="value", value="0.1", code=INVALID_ARGUMENT, version=bignumber/5.5.0)

On the other hand, if I use a whole number like 1 for the _Cost it accepts it and the contract is being deployed, BUT! After I try to mint it returns the same error:

transact to YourNftToken.mint errored: Error encoding arguments: Error: invalid BigNumber string (argument="value", value="", code=INVALID_ARGUMENT, version=bignumber/5.5.0)

P.S. I didn't change anything in the contract. I am using Remix with compiler 0.8.9

@liarco
Copy link
Member

liarco commented Feb 16, 2023

Hi @MDimow,
please avoid duplicating requests on both Discussions and Issues. Also, this report is invalid since you removed all the required information from our template.

That data is required for us to understand what's going on and help us recreating the issue on our end. Please add all of the missing info and also provide all the steps to reproduce this error.
I tried creating a brand new project and I can customize the configuration with both integer and decimal values with no issues.

Thank you for your understanding.

@liarco liarco added feedback requested To be closed if no feedback is received invalid This doesn't seem right labels Feb 16, 2023
@MDimow
Copy link
Author

MDimow commented Feb 16, 2023

General information

Description Value
Solidity Compiler 0.8.9+
Operating system and version Windows 11
Deployer Platform Remix
Network Goerli Testnet
Environment Injected Provider - Metamask

Describe the bug

I am getting this problem when I try to set the _Cost before deploying when I use decimals.

creation of YourNftToken errored: Error encoding arguments: Error: invalid BigNumber string (argument="value", value="0.1", code=INVALID_ARGUMENT, version=bignumber/5.5.0)

On the other hand, if I use a whole number like 1 for the _Cost it accepts it and the contract is being deployed, BUT! After I try to mint it returns the same error:

transact to YourNftToken.mint errored: Error encoding arguments: Error: invalid BigNumber string (argument="value", value="", code=INVALID_ARGUMENT, version=bignumber/5.5.0)

How to Reproduce

Steps to reproduce the behavior (please provide a reproducer project for complex bugs):

  1. Set bool public paused = false;
  2. Set bool public whitelistMintEnabled = false;
  3. Set bool public revealed = true;
  4. Set string public uriPrefix = 'ipfs://QmaGitJ2nUHCPCcEm5xrqzNCUzqzHkk5AufM1UQB5AhCM4/';
  5. Compile the contract with Solidity Compiler version 0.8.9+
  6. Set the deployment options and type decimal number for _Cost.
    image
  7. Deploy the contract and it will return this error.
    image

Expected behavior

The field where you setup cost per mint should accept decimals.

Screenshots

image

Additional context

The only thing that I have changed in the contract is adding the following library due to an error regarding using Strings for uint256;

import '@openzeppelin/contracts/utils/Strings.sol';

The error before importing the library:
image

@liarco
Copy link
Member

liarco commented Feb 18, 2023

I'm sorry @MDimow but this project is not meant to be used with Remix. You can find my YouTube tutorials about how to use it in our README file. The reason why you are getting the error regarding BigNumbers is because Remix expects Ethereum values (e.g. the price) to be set in WEI, not ETH.

I highly recommend sticking with the recommended tools or you might bump into many more issues down the road. If you really wanna continue using Remix, then it's fine, but we can't provide you with official support for that... you may try opening a dedicated discussion or ask on the HashLips Discord server and see if there's anyone who can help you.

@liarco liarco closed this as completed Feb 18, 2023
@liarco liarco removed the feedback requested To be closed if no feedback is received label Feb 18, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
invalid This doesn't seem right
Projects
None yet
Development

No branches or pull requests

2 participants