Created
May 2, 2023 17:16
-
-
Save riemannulus/81bd71d85ca7ec356f6d5454e6885fcd to your computer and use it in GitHub Desktop.
Example IAction Execute for gas
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
IAccountStateDelta Execute(IActionContext context) | |
{ | |
UInt256 gasCap = context.AvaliableGas(); | |
UInt256 HASGas = 10; | |
if(gasCap < HASGas) | |
{ | |
return context.PreivousState.UseGas(gasCap); | |
} | |
return Battle(context).UseGas(HASGas); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment