Skip to content

Instantly share code, notes, and snippets.

@marekkirejczyk
Created November 20, 2018 14:49
Show Gist options
  • Save marekkirejczyk/b6210bfd9a1bc968ff1db8fe97ffec57 to your computer and use it in GitHub Desktop.
Save marekkirejczyk/b6210bfd9a1bc968ff1db8fe97ffec57 to your computer and use it in GitHub Desktop.
execute
function execute(...) public returns (bytes32) {
uint256 startingGas = gasleft();
...
to.call.value(...)(...);
...
uint256 gasUsed = startingGas.sub(gasleft());
refund(gasUsed, gasPrice, gasToken);
return ...;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment