Business
Jobs
  • About Us
  • Solutions
    • Job Postings
      Post your job and receive qualified candidates in 48h.
    • Candidate Assessments
      500+ technical and psychological tests, plus anti-fraud.
    • Headhunting
      Tailor-made executive search from start to finish.
    • Payroll + EOR
      Payroll dispersal and EOR across 15+ LATAM countries.
  • Pricing
  • Jobs

0

91
Views
Interacting with a smart contract method via metamask mint transaction in web3js

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"
  },
about 4 years ago · Juan Pablo Isaza
Answer question
Find remote jobs

Discover the new way to find a job!

Top jobs
Top job categories
Business
Post vacancy Pricing Sales
Legal
Terms and conditions Privacy policy
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Show me some job opportunities
There's an error!