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

Remove redundant require statements #1409

Merged
merged 3 commits into from
Nov 2, 2018
Merged
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
5 changes: 1 addition & 4 deletions contracts/token/ERC20/ERC20.sol
Original file line number Diff line number Diff line change
Expand Up @@ -93,8 +93,6 @@ contract ERC20 is IERC20 {
public
returns (bool)
{
require(value <= _allowed[from][msg.sender]);

_allowed[from][msg.sender] = _allowed[from][msg.sender].sub(value);
_transfer(from, to, value);
return true;
Expand Down Expand Up @@ -155,7 +153,6 @@ contract ERC20 is IERC20 {
* @param value The amount to be transferred.
*/
function _transfer(address from, address to, uint256 value) internal {
require(value <= _balances[from]);
require(to != address(0));

_balances[from] = _balances[from].sub(value);
Expand All @@ -172,6 +169,7 @@ contract ERC20 is IERC20 {
*/
function _mint(address account, uint256 value) internal {
require(account != address(0));

_totalSupply = _totalSupply.add(value);
_balances[account] = _balances[account].add(value);
emit Transfer(address(0), account, value);
Expand All @@ -185,7 +183,6 @@ contract ERC20 is IERC20 {
*/
function _burn(address account, uint256 value) internal {
require(account != address(0));
require(value <= _balances[account]);

_totalSupply = _totalSupply.sub(value);
_balances[account] = _balances[account].sub(value);
Expand Down