Set Gas Limit when calling Smart Contract

Hi all,

Is there a way to set gas limit when calling a smart contract (MATIC if it matters)? I am using useWeb3Contract method but can’t find any option to do it. Transactions sometimes fail due to out of gas.

Thanks for any solutions.

I’m not sure if you mean to call a read only function or to send a transaction.

When calling a read only function no gas would be used as it will not send a transaction on chain to be mined.

Yes, send a transaction to a contract, that’s what I meant. Is there any options to change gas limit?

I think that you can not change gas limit with that function, you could do that if you use ether.js or web3 directly, most of the time you don’t need to change that gas limit

got it, thanks. Trying with web3.