Skip to content

Instantly share code, notes, and snippets.

@riemannulus
Created May 2, 2023 17:16
Show Gist options
  • Save riemannulus/81bd71d85ca7ec356f6d5454e6885fcd to your computer and use it in GitHub Desktop.
Save riemannulus/81bd71d85ca7ec356f6d5454e6885fcd to your computer and use it in GitHub Desktop.
Example IAction Execute for gas
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