It’s a simple question, but I couldn’t find an answer. In an ERC20 contract lies this code
//The nonce for avoid transfer replay attacks
mapping(address => uint256) nonces;
.
uint256 nonce = nonces[_address_from];
bytes32 h = keccak256(_address_from ,_address_to ,_token_amount, _amount_fee ,nonce);
if(_address_from != ecrecover(h,_v,_r,_s)) revert();
_r _s _v are functions parameters which must be set manually when calling it on contract execution.
How do I compute _r _s _v from my address and amounts in order to not get the transaction rejected ?
keccak256and the nonce. – user2284570 May 23 '18 at 17:09r,s, andvfrom the function in web3 that is used to sign the transaction. The nonce is provided by the mapping variablenoncefor each particular address. So you can now check the signature. You seem to be ok now. – Jaime May 23 '18 at 17:29