ECRecovery
library ECRecovery
Based on https://gist.github.com/axic/5b33912c6f61ae6fd96d6c4a47afde6d TODO Remove this library once solidity supports passing a signature to ecrecover. See https://github.com/ethereum/solidity/issues/864.
Source: ECRecovery.sol
Reference
Functions
recover
function recover(bytes32 hash, bytes sig) internal pure returns (address)
Recover signer address from a message by using their signature.
- Parameters:
hash
- bytes32 message, the hash is the signed message. What is recovered is the signer address.sig
- bytes signature, the signature is generated using web3.eth.sign()- Returns:
- address
toEthSignedMessageHash
function toEthSignedMessageHash(bytes32 hash) internal pure returns (bytes32)
ToEthSignedMessageHash, prefix a bytes32 value with "\x19Ethereum Signed Message:" and hash the result.
- Parameters:
hash
- bytes32- Returns:
- bytes32