Skip to content

Instantly share code, notes, and snippets.

@PhABC
Last active November 20, 2021 10:03
Show Gist options
  • Save PhABC/b123cc9de7ef67b0d197c5dbf30e2736 to your computer and use it in GitHub Desktop.
Save PhABC/b123cc9de7ef67b0d197c5dbf30e2736 to your computer and use it in GitHub Desktop.
// Message to sign : contract address + address to give access
var message = web3.sha3(contractAddress.substr(2) + userAddress.substr(2), {encoding: 'hex'})
// Signing message (with "\x19Ethereum Signed Message:\n32" as prefix by default)
web3.personal.sign(message, web3.eth.defaultAccount, (err, res) => sign = res)
@goddev1026
Copy link

Hello.
I have read your post carefully.
What does web3.personal mean here?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment