Is there a way to calculate gas-budget needed

,

Is there a way to calculate gas-budget needed for a function to execute? I tried to execute a function for a package that I made throught the explorer, but it has a hardcoded 2000 gas-budget. So my transaction fails with insufficient gas.

When I change the gas-budget in the explorer (I run it locally) to 5000 for example it does work and uses about 3349 MIST. How do I know how much the gas-budget should be? Because you always need to attach a gas-budget to a moveCall.

You have options:

  • You could try using sui_dryRunTransaction
  • You could try using sui_devInspectTransactions

They both will show approx gas cost.

2 Likes

Thanks, didn’t know these exist

1 Like