Determine gas amount for smart contract call

How do determine what amount of SUI is needed as gas to call an entry smart contact function?

2 Likes

If you are using TS-SDK PTB it will calulate it for you.

2 Likes

What will be the syntax, cause when I use TS SDK to call a smart contract function, I have to set the gas otherwise it would give an error.

1 Like

It shouldn’t error: Building Programmable Transaction Blocks | Sui Documentation

1 Like

Sometimes it may error indeed. You can set it to something around 1.000.000.000 (1 Sui), it won’t consume it after all!

OR you can estimate the actual gas cost by running dryRunTransactionBlock

2 Likes