The following function must be implemented for a token to be ERC-20 compliant:
// Transfer the balance from owner's account to another account
15 function transfer(address _to, uint256 _amount) returns (bool success) {
16 if (balances[msg.sender] >= _amount
17 && _amount > 0
18 && balances[_to] + _amount > balances[_to]) {
19 balances[msg.sender] -= _amount;
20 balances[_to] += _amount;
21 return true;
22 } else {
23 return false;
24 }
25 }
Notice that one of the parameters is the _amount
. That's the amount that the user specifies. However, isn't one of the internal properties of a transaction the msg.value
parameter? That means that the _amount
variable is redundant, and a code smell.