Skip to content

Instantly share code, notes, and snippets.

@novaknole
Created January 11, 2022 15:21
Show Gist options
  • Save novaknole/442cce5b096524a7a6e91f9ea95ae92c to your computer and use it in GitHub Desktop.
Save novaknole/442cce5b096524a7a6e91f9ea95ae92c to your computer and use it in GitHub Desktop.
function hashMessage(address sender) internal pure returns(bytes32) {
bytes32 payloadHash = keccak256(abi.encode(sender, salt));
bytes32 messageHash = keccak256(abi.encodePacked("\x19Ethereum Signed Message:\n32", payloadHash));
return messageHash;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment