You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on May 13, 2021. It is now read-only.
var accountToSignWith = '0xbedcf417ff2752d996d2ade98b97a6f0bef4beb9';
var message = 'Lorem ipsum dolor sit amet, consectetur adipiscing elit. Tubulum fuisse, qua illum, cuius is condemnatus est rogatione, P. Eaedem res maneant alio modo.'
var contractABI = [{"constant":true,"inputs":[{"name":"msgHash","type":"bytes32"},{"name":"v","type":"uint8"},{"name":"r","type":"bytes32"},{"name":"s","type":"bytes32"}],"name":"RecoverAddress","outputs":[{"name":"","type":"address"}],"payable":false,"type":"function"}];
var contractAddress = '0x5481c0fe170641bd2e0ff7f04161871829c1902d'; // on Ropsten and Rinkeby
var signAndVerifyContract = web3.eth.contract(contractABI).at(contractAddress);
// eth_sign calculated the signature over keccak256("\x19Ethereum Signed Message:\n" + len(givenMessage) + givenMessage)))
// this gives context to a signature and prevents signing of transactions.
function messageHash(msg) {
return web3.sha3('\x19Ethereum Signed Message:\n' + msg.length + msg);
}
function verifyHandler(err, address) {
if (!err) {
console.log('Recovered address:', address);
console.log(' Address matched:', accountToSignWith === address);
} else {
console.err('Could not recover address:', err);
}
}
Sign up for freeto subscribe to this conversation on GitHub.
Already have an account?
Sign in.
I deliberately didn't include this one into the maintained-by-parity repos: https://github.com/paritytech/js-libs.
If we decide to take care of it, it would be nice to include it too.
The text was updated successfully, but these errors were encountered: