Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adds indexing event for saving transferFrom and burnFrom transactions. #1264

Closed
wants to merge 2 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion contracts/token/ERC20/ERC20.sol
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ contract ERC20 is IERC20 {
balances_[_from] = balances_[_from].sub(_value);
balances_[_to] = balances_[_to].add(_value);
allowed_[_from][msg.sender] = allowed_[_from][msg.sender].sub(_value);
emit Transfer(_from, _to, _value);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We can't remove the Transfer event from here because it's required by ERC20. If anything we have to add a new event.

emit TransferFrom(msg.sender, _from, _to, _value);
return true;
}

Expand Down Expand Up @@ -200,5 +200,6 @@ contract ERC20 is IERC20 {
allowed_[_account][msg.sender] = allowed_[_account][msg.sender].sub(
_amount);
_burn(_account, _amount);
emit TransferFrom(msg.sender, _account, address(0), _amount);
}
}
5 changes: 5 additions & 0 deletions contracts/token/ERC20/IERC20.sol
Original file line number Diff line number Diff line change
Expand Up @@ -32,4 +32,9 @@ interface IERC20 {
address indexed spender,
uint256 value
);
event TransferFrom(
address indexed executor,
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The usual term for this account is "spender".

address indexed from,
address indexed to,
uint256 value);
}