I am trying to call a mint function on an ethereum smart contract. When the user clicks the mint button, metamask should open up pointing to the mint method with the correct price and number of mints, and then return a transaction.
However, I am confused as to how this transaction is properly translated towards the smart contract. Also, the price of this is coming out as 0E (should be 0.5E), and frankly I have no idea how to interpret the transaction hash I get out the other side.
The contract for this is here: https://rinkeby.etherscan.io/address/0xeaf59acf00435857d4d0e26e2b48948b86a8a8ca#code
The code for this is below:
const onPurchase = async () => {
const transactionParameters = {
gasPrice: '0x09184e72a000',
gas: '0x2710',
to: '0xd46e8dd67c5d32be8058bb8eb970870f07244567',
from: '0x010bc28dE2E080E233cA98Bc2D03B22D5CA8eD41',
value: '0x9184e72a',
data: '0xa0712d680000000000000000000000000000000000000000000000000000000000000001',
};
const txHash = await window.ethereum.request({
method: 'eth_sendTransaction',
params: [transactionParameters],
});
}
and the ABI for the mint function looks like so:
{
"inputs": [
{
"internalType": "uint256",
"name": "numberOfTokensMax5",
"type": "uint256"
}
],
"name": "mint",
"outputs": [],
"stateMutability": "payable",
"type": "function"
},