I am trying to learn web3, and im stuck on a simple transaction method. Im at a loss, and am willing to pay you for your very brief time. Please tell me how much to answer this question.
How can i get the mint method to work on this contract?
https://rinkeby.etherscan.io/address/0xf3e33773c13c9082953f9ca89930899ca57f4e6f#writeContract
this is what im trying to do so far, not working.
async function TESTMint() {
const CONTRACT_ADDRESS = "0xF3E33773C13c9082953F9cA89930899CA57F4E6f";
const contract = new window.web3.eth.Contract(
window.ABI,
CONTRACT_ADDRESS
);
try {
await contract.methods.mint(window.wei,window.qty).send({ from: window.userAddress });
} catch (e) {
console.log(e);
}
}
Mar 16, 2022, 11:23 PM
Probably instead of (window.wei, window.qty) you want just (window.qty), and pass the ether in the curly braces like {from: ..., value: window.wei}
Mar 16, 2022, 11:26 PM