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 value (argument="value", value=undefined, code=INVALID_ARGUMENT, version=bignumber/5.5.0) #39

Open
jorgehenriquezd opened this issue Feb 17, 2022 · 6 comments

Comments

@jorgehenriquezd
Copy link

When i click buy nft I got this error, what can I do?

@appleyapple
Copy link

also encountered this problem, it works fine in testing but once I try it on the app it gives this error.

it seems to come from these lines
const price = ethers.utils.parseUnits(nft.price.toString(), 'ether')
const transaction = await contract.createMarketSale(nftaddress, nft.itemId, {value: price})

price constant prints as expected:
BigNumber {_hex: '0x29a2241af62c0000', _isBigNumber: true}
_hex: "0x29a2241af62c0000"
_isBigNumber: true

if relevant I am on ethers 5.5.4, ipfs-http-client 50.1.2, web3modal 1.9.5, hardhat 2.8.4

@p0sidonz
Copy link

same here, did you figure that out yet?

@jamesbayy
Copy link

I have the same problem ..

@jamesbayy
Copy link

now,i solved the problem.the nft.tokenid need to match the item tokenid
const transaction = await contract.createMarketSale(nftaddress,nft.tokenid, { value: price })
let item = { price, tokenid:i.tokenid.toNumber(), seller: i.seller, owner: i.owner, image: meta.data.image, name: meta.data.name, description: meta.data.description }

if there is nft.tokenId. tokenId is undefined .

@DannyIscra
Copy link

Having the same issue but with the new code.

I believe it is coming from this section:

Error: invalid decimal value (argument="value", value="", code=INVALID_ARGUMENT, version=bignumber/5.6.2)

Here is the code for that section:

const price = ethers.utils.parseUnits(formInput.price, 'ether')
let contract = new ethers.Contract(marketplaceAddress, NFTMarketplace.abi, signer)
let listingPrice = await contract.getListingPrice()

listingPrice = listingPrice.toString()
let transaction = await contract.createToken(url, price, { value: listingPrice })

await transaction.wait()

No coding experience, can anyone step by step come up with a solution as to why this may be?

@Banksy-said-hi
Copy link

I am having the same issue!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

6 participants