Skip to content
This repository has been archived by the owner on Feb 26, 2024. It is now read-only.

ecrecover does not return consistently depending on digest despite correct signer #98

Closed
snario opened this issue Apr 5, 2018 · 1 comment

Comments

@snario
Copy link

snario commented Apr 5, 2018

Using the following code:

contract ECRecover {
	function recover (bytes32 nonce, uint8 v, bytes32 r, bytes32 s) constant returns (address) {
		return ecrecover(nonce, v, r, s);
	}
}

For some inputs, e.g., with the nonce variable here that an account signs, ecrecover does not correctly recover the address.

Expected Behavior

ecrecover should return the address of the account that signed the message.

Current Behavior

ecrecover does not return the address of the account that signed the message for "some" digests. I haven't figured out the pattern yet.

Steps to Reproduce (for bugs)

I've made a repo here: https://github.com/snario/reproducible-ganache-bug

Context

I'm trying to sign messages roughly following the direction of EIP 155. GnosisSafe already implements this.

Your Environment

See the repo, ran inside a fresh ubuntu Docker container.

@snario
Copy link
Author

snario commented Jun 19, 2018

Seems like an ethers.js bug.

ethers-io/ethers.js#208

@snario snario closed this as completed Jun 19, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant