Created
October 11, 2018 06:57
-
-
Save RomanFro/6252c9edf01bd31cd31fab432cc17b0c to your computer and use it in GitHub Desktop.
Execute function using solidity assembly.
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
// 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