From 143d92806b8da5e782c0ea8f6e1cf86e62f25dc7 Mon Sep 17 00:00:00 2001 From: p0n1 <36690236+p0n1@users.noreply.github.com> Date: Sat, 9 Jun 2018 15:05:51 +0800 Subject: [PATCH] token-advanced: add event Approval to follow eip20 Same as https://github.com/ethereum/ethereum-org/pull/865. --- solidity/token-advanced.sol | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/solidity/token-advanced.sol b/solidity/token-advanced.sol index 080f3227..f850653a 100644 --- a/solidity/token-advanced.sol +++ b/solidity/token-advanced.sol @@ -33,6 +33,9 @@ contract TokenERC20 { // This generates a public event on the blockchain that will notify clients event Transfer(address indexed from, address indexed to, uint256 value); + + // This generates a public event on the blockchain that will notify clients + event Approval(address indexed _owner, address indexed _spender, uint256 _value); // This notifies clients about the amount burnt event Burn(address indexed from, uint256 value); @@ -113,6 +116,7 @@ contract TokenERC20 { function approve(address _spender, uint256 _value) public returns (bool success) { allowance[msg.sender][_spender] = _value; + emit Approval(msg.sender, _spender, _value); return true; }