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
address public grantSigner; | |
function stake(address _userUportAddress, uint _expiryDate, bytes _signature) public payable whenNotPaused { | |
bytes32 hashMessage = keccak256(abi.encodePacked(_userUportAddress, msg.value, _expiryDate)); | |
address signer = hashMessage.toEthSignedMessageHash().recover(_signature); | |
require(signer == grantSigner, "Signature is not valid"); | |
require(block.timestamp < _expiryDate, "Grant is expired"); | |
require(userStakedAddress[_userUportAddress] == 0, "User has already staked!"); |
NewerOlder