Skip to content

Instantly share code, notes, and snippets.

@RomanFro
Created October 11, 2018 06:57
Show Gist options
  • Save RomanFro/6252c9edf01bd31cd31fab432cc17b0c to your computer and use it in GitHub Desktop.
Save RomanFro/6252c9edf01bd31cd31fab432cc17b0c to your computer and use it in GitHub Desktop.
Execute function using solidity assembly.
// Execute the encoded function in the specified contract
function executeCall(address to, uint256 value, bytes data)
internal
returns (bool success)
{
assembly {
success := call(gas, to, value, add(data, 0x20), mload(data), 0, 0)
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment