From 5f3c987f964374511984519a319f8388ecf412e7 Mon Sep 17 00:00:00 2001 From: Benjamin Bollen Date: Sat, 4 Nov 2017 19:16:55 +0530 Subject: [PATCH] contracts: add comment on approve of EIP20 that allowance must be zero before setting. --- contracts/ERC20Token.sol | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/contracts/ERC20Token.sol b/contracts/ERC20Token.sol index 668a816..1b885da 100644 --- a/contracts/ERC20Token.sol +++ b/contracts/ERC20Token.sol @@ -99,6 +99,10 @@ contract ERC20Token is ERC20Interface, Owned { } + /* + * Note that when changing the approved allowance for a spender the sender should + * first check that the allowance for the spender is zero. + */ function approve(address _spender, uint256 _value) public returns (bool success) { allowed[msg.sender][_spender] = _value;