Tx Reverted sendTransaction with purchase method

I have a transaction with a method.purchase(). But the tx has been reverted.

This is my tx in sepolia.etherscan tx/0x13575e79b12f3110d7df1d9597595c606a2c3c180d17bf98545db45fb61a6e0f.

And this is my code:
/* After estimate the gas I do this */

const weiValue = web3.utils.toWei(res.amount.toString(), "ether");
 const bnNumber = web3.utils.toBN(weiValue);

  web3.eth
        .sendTransaction({
          from: res["user-address"],
          to: res["contract-address-trader"],
          value: bnNumber,
          gas: gasUsed,
          data: traderContract.methods
            .purchase(res["contract-address"], res["token-id"])
            .encodeABI()
        })

I don’t know why the tx is reverted. Any help here please? I haven’t got almost experience with MetaMask.

Hi I’ve looked at your account looks like you have several reverted transactions, what is this contract contract-address-trader where is it coming from? There are a few things to keep in mind when it reverts: Ethereum Whitepaper | ethereum.org it looks like you have enough gas. Could you show me how are you setting the gas price or are you using default

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.