From 1db78a1660313ab0aa5228094e690de881e1128f Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jo=C3=A3o=20V=C3=ADtor?= Date: Sun, 3 Jun 2018 18:20:53 -0300 Subject: fix recoverSigner function --- docs/solidity-by-example.rst | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'docs') diff --git a/docs/solidity-by-example.rst b/docs/solidity-by-example.rst index b1bc11d9..52beb862 100644 --- a/docs/solidity-by-example.rst +++ b/docs/solidity-by-example.rst @@ -792,7 +792,7 @@ The full contract mapping(uint256 => bool) usedNonces; - function ReceiverPays() public payable {} + constructor() public payable {} function claimPayment(uint256 amount, uint256 nonce, bytes signature) public { require(!usedNonces[nonce]); @@ -801,7 +801,7 @@ The full contract // this recreates the message that was signed on the client bytes32 message = prefixed(keccak256(msg.sender, amount, nonce, this)); - require(recoverSigner(message,sig) == owner); + require(recoverSigner(message, signature) == owner); msg.sender.transfer(amount); } @@ -841,7 +841,7 @@ The full contract pure returns (address) { - uint8; + uint8 v; bytes32 r; bytes32 s; -- cgit v1.2.3