How to execute a transaction with only one Coin<SUI> left?

Got it, yes – this is a difference in Sui’s object model vs Aptos’, you can read more about the reasons for it here. Regarding the “one-gas-resource-left” issue, we have some plans in the pipeline to simplify (and in some cases, automate) this process so that we get the safety and parallelism benefits of explicitly specifying objects in entry functions without the cognitive overhead of coin management.

One of these features is Programmable Transactions, which will allow you to write a single transaction that uses one coin to pay for gas and to pay within the transaction as well. The other is something we call “gas smashing” which will allow you to pay for a transaction with multiple gas coins, which will get combined in the process.

3 Likes