On my mint contract abi it says that the internal type is uint256 and the token mint price is 0.01 ETH so i'm not sure how to convert this to uint256 in the frontend?
{
"inputs": [
{ "internalType": "uint256", "name": "_mintAmount", "type": "uint256" }
],
"name": "mint",
"outputs": [],
"stateMutability": "payable",
"type": "function"
},
I'm using ethers.js to interact with the contract, what is the best way to pass the value as unit256?
Here is the error that i get:
MetaMask - RPC Error: execution reverted: Invalid mint amount!
Here is how i'm calling to the frontent
const mintContract = async () => {
if (contract) {
try {
const tx = contract.mint(utils.parseUnits("0.01"));
tx.wait();
} catch (error) {
await setError(true);
}
}
};