Transaction ran out of gas in testnet - ganache not

Hey! I am trying to call a function of my smart contract on the polygon (mumbai) testnet - however, this function is running out of gas every single time. The same function runs without any problems or enormous gas fee's on my local hardhat node. Even increasing the gas price to the maximum results in the same error.

I am really stuck at this point because I have no idea how to debug this further - the only response I get is:

reason: 'transaction failed',

So there is no infinite loop or reverted error thrown (in my opinion). Are there any best practices to debug this kind of error? I can see properties called "logsBloom" and "logs" in my transaction receipt - but I am not sure if that could help me?


Hi, maybe you can try to use Hardhat, it can print some logs in the contract, for more details, you can have a look at their documentation: Using the Hardhat console | Hardhat