You can call this simple counter contract with 1Tgas attached and it works.
And you'll see that both NEAR Explorer and nearblocks.io agree that you attached only 1 Tgas but somehow used 5 Tgas.
How is this possible?
You can call this simple counter contract with 1Tgas attached and it works.
And you'll see that both NEAR Explorer and nearblocks.io agree that you attached only 1 Tgas but somehow used 5 Tgas.
How is this possible?
Reading through these two chapters may be useful to understand the concepts:
I'm by no means an expert, so this answer is a guess more than anything.
When a user calls a method on your contract, they are automatically deducted a fixed amount (gas) set by the contract configurations. For example
action_function_call_send_sir: 2_319_861_500_000action_function_call_execution: 2_319_861_500_000action_receipt_creation_send_sir: 108_059_500_000With these assumptions, the attached gas doesn't need to be higher than the gas used. If the total sum of "automatically deducted gas" + "attached gas" is more than what's actually burned, you'll get a refund.
From your transaction, you are refunded 0.00005Ⓝ. If you try to attach even less gas, e.g. 579279990000, you'll still be able to call the method, and you'll be refunded a little less 0.00001Ⓝ (See this transaction)