Created
February 16, 2018 02:53
-
-
Save dominiek/50de25f94bd0449e9db29559c74226ed to your computer and use it in GitHub Desktop.
ethereum_smart_contract_ecrecover.sol
This file contains hidden or 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 getOriginAddress(bytes32 signedMessage, uint8 v, bytes32 r, bytes32 s) constant returns(address) { | |
bytes memory prefix = "\x19Ethereum Signed Message:\n32"; | |
bytes32 prefixedHash = keccak256(prefix, signedMessage); | |
return ecrecover(prefixedHash, v, r, s); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment