aboutsummaryrefslogtreecommitdiffstats
path: root/packages/contracts/src/2.0.0/tokens/ERC20Token/ERC20Token.sol
diff options
context:
space:
mode:
Diffstat (limited to 'packages/contracts/src/2.0.0/tokens/ERC20Token/ERC20Token.sol')
-rw-r--r--packages/contracts/src/2.0.0/tokens/ERC20Token/ERC20Token.sol18
1 files changed, 16 insertions, 2 deletions
diff --git a/packages/contracts/src/2.0.0/tokens/ERC20Token/ERC20Token.sol b/packages/contracts/src/2.0.0/tokens/ERC20Token/ERC20Token.sol
index 563c84b5b..db2d09b9d 100644
--- a/packages/contracts/src/2.0.0/tokens/ERC20Token/ERC20Token.sol
+++ b/packages/contracts/src/2.0.0/tokens/ERC20Token/ERC20Token.sol
@@ -46,9 +46,16 @@ contract ERC20Token is
balances[_to] + _value >= balances[_to],
"UINT256_OVERFLOW"
);
+
balances[msg.sender] -= _value;
balances[_to] += _value;
- emit Transfer(msg.sender, _to, _value);
+
+ emit Transfer(
+ msg.sender,
+ _to,
+ _value
+ );
+
return true;
}
@@ -77,10 +84,17 @@ contract ERC20Token is
balances[_to] + _value >= balances[_to],
"UINT256_OVERFLOW"
);
+
balances[_to] += _value;
balances[_from] -= _value;
allowed[_from][msg.sender] -= _value;
- emit Transfer(_from, _to, _value);
+
+ emit Transfer(
+ _from,
+ _to,
+ _value
+ );
+
return true;
}