[SOLVED] [execution reverted] value transfer did not complete from a contract reverted

Hello friends, I hope you are well, I am trying to execute a contract function, but in each attempt I get [CANCELLED] , specifically the reason seems to be “value transfer did not complete from a contract reverted”, at first everything seems to be going well, the call to the function, then confirm, pending, but in the end it doesn’t go any further and I get this
failed transaction, [CANCELLED]

    const getItem = async () => {
        const ethers = Moralis.web3Library; 
        const web3Provider = await Moralis.enableWeb3();
    
        const signer = web3Provider.getSigner(); 
        const address = "0x7o345...";
        const contract = new ethers.Contract(address, ABI, signer); 
                
            async function transation() {
                try {
                const tx = await contract.functions.buyItem(props.item, {value: props.askingPrice, gasLimit: 30000000})
                const result = await tx.wait();
                } catch (error) {
                    throw new Error(error);
                }
            }
            const receipt = await transation();
            console.log(receipt);
    };

img1

error:

I would appreciate any suggestions on what I might be doing wrong.

What is the contract address, chain, and that failed transaction (hash)?

If this is your contract, check the buyItem function to see if there’s something obvious making it revert based on the params you pass to it. You can post the contract code as well.

@alex Thank you very much, your suggestions are always very successful, indeed it was a problem with the parameters that I was passing in the wrong way, problem fixed :beers:

Hey @Addict2Bass, I’m facing the same error. Could you please tell me how you fixed it?

Hi @pushpit07 Of course, apparently it was a problem related to the execution of the smart contract function, check the parameters that are passing when the function is called, I would focus on the smart contract, there you will find the solution more quickly, let me know if you need anything else regards :smiley: :smiley:

Thanks. Turns out it was a problem related to the gasLimit