Remove redundant require statements (#1409)
* Remove redundant require statements Now that SafeMath uses require, the require statements are redundant. They were also previously inconsistent because they were only included in some functions, but not others * Update ERC20.sol
This commit is contained in:
committed by
Nicolás Venturo
parent
f72c79d54a
commit
6363a776f7
@ -93,8 +93,6 @@ contract ERC20 is IERC20 {
|
|||||||
public
|
public
|
||||||
returns (bool)
|
returns (bool)
|
||||||
{
|
{
|
||||||
require(value <= _allowed[from][msg.sender]);
|
|
||||||
|
|
||||||
_allowed[from][msg.sender] = _allowed[from][msg.sender].sub(value);
|
_allowed[from][msg.sender] = _allowed[from][msg.sender].sub(value);
|
||||||
_transfer(from, to, value);
|
_transfer(from, to, value);
|
||||||
return true;
|
return true;
|
||||||
@ -155,7 +153,6 @@ contract ERC20 is IERC20 {
|
|||||||
* @param value The amount to be transferred.
|
* @param value The amount to be transferred.
|
||||||
*/
|
*/
|
||||||
function _transfer(address from, address to, uint256 value) internal {
|
function _transfer(address from, address to, uint256 value) internal {
|
||||||
require(value <= _balances[from]);
|
|
||||||
require(to != address(0));
|
require(to != address(0));
|
||||||
|
|
||||||
_balances[from] = _balances[from].sub(value);
|
_balances[from] = _balances[from].sub(value);
|
||||||
@ -172,6 +169,7 @@ contract ERC20 is IERC20 {
|
|||||||
*/
|
*/
|
||||||
function _mint(address account, uint256 value) internal {
|
function _mint(address account, uint256 value) internal {
|
||||||
require(account != address(0));
|
require(account != address(0));
|
||||||
|
|
||||||
_totalSupply = _totalSupply.add(value);
|
_totalSupply = _totalSupply.add(value);
|
||||||
_balances[account] = _balances[account].add(value);
|
_balances[account] = _balances[account].add(value);
|
||||||
emit Transfer(address(0), account, value);
|
emit Transfer(address(0), account, value);
|
||||||
@ -185,7 +183,6 @@ contract ERC20 is IERC20 {
|
|||||||
*/
|
*/
|
||||||
function _burn(address account, uint256 value) internal {
|
function _burn(address account, uint256 value) internal {
|
||||||
require(account != address(0));
|
require(account != address(0));
|
||||||
require(value <= _balances[account]);
|
|
||||||
|
|
||||||
_totalSupply = _totalSupply.sub(value);
|
_totalSupply = _totalSupply.sub(value);
|
||||||
_balances[account] = _balances[account].sub(value);
|
_balances[account] = _balances[account].sub(value);
|
||||||
|
|||||||
Reference in New Issue
Block a user