104
rated 0 times
[
106]
[
2]
/ answers: 1 / hits: 7499
/ 3 Years ago, thu, november 4, 2021, 12:00:00
I tried to send a request to my contract using ethersjs like this:
const web3Modal = new Web3Modal()
const connection = await web3Modal.connect()
const provider = new ethers.providers.Web3Provider(connection)
const signer = provider.getSigner()
const contract = new ethers.Contract(Contract, Market.abi, signer)
const price = ethers.utils.parseUnits(price.toString(), 18)
//const price = web3.utils.toWei(nft.price);
//const price = ethers.BigNumber.from(nft.price.toString()).toHexString();
const transaction = await contract.createSale(address, price)
await transaction.wait()
This code shows an error, I have tried all the solutions in this world, but nothing worked. => versions: nodejs 14.15, npm 8, web3 1.6, ethers 5.5
Any help?
Unhandled Rejection (Error): invalid BigNumber value (argument="value", value=undefined, code=INVALID_ARGUMENT, version=bignumber/5.5.0)
More From » web3js