Last active
December 26, 2023 22:53
-
-
Save sogoiii/796c1088796ff25b279bffb893f88a2c to your computer and use it in GitHub Desktop.
A Solidity contract that verifies signatures
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
pragma solidity ^0.4.8; | |
contract Verifier { | |
function recoverAddr(bytes32 msgHash, uint8 v, bytes32 r, bytes32 s) returns (address) { | |
return ecrecover(msgHash, v, r, s); | |
} | |
function isSigned(address _addr, bytes32 msgHash, uint8 v, bytes32 r, bytes32 s) returns (bool) { | |
return ecrecover(msgHash, v, r, s) == _addr; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment