aergo icon indicating copy to clipboard operation
aergo copied to clipboard

add contract.gasLeft()

Open kroggen opened this issue 10 months ago • 6 comments

This PR adds the contract.gasLeft() function to retrieve the remaining gas in the contract execution

Closes #239

There is a problem though:

The lua_pushinteger() function accepts a value of type lua_Integer, that is signed int64, and the lua_gasget() function returns an unsigned int64

So if the value of gas is too big, it may appear for the Lua code as a negative value (to be tested)

kroggen avatar Sep 23 '23 05:09 kroggen