Last active
May 7, 2018 00:01
-
-
Save kosecki123/502346520d45bda50833c9f5f0ceb147 to your computer and use it in GitHub Desktop.
callData.sol
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
function callWithData(address dest, bytes data) | |
private returns (bytes32 c) | |
{ | |
assembly { | |
let freemem := mload(0x40) | |
pop( | |
call( | |
5000, | |
dest, | |
0, | |
add(data, 0x20), | |
mload(data), | |
freemem, | |
0x20 | |
) | |
) | |
c := mload(freemem) | |
mstore(0x40, add(freemem, 0x20)) | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment