Skip to content

Commit

Permalink
SafeERC20: use explicit returns
Browse files Browse the repository at this point in the history
  • Loading branch information
sohkai committed Feb 11, 2019
1 parent e4c075b commit b26941b
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions contracts/common/SafeERC20.sol
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,9 @@ library SafeERC20 {

function invokeAndCheckSuccess(address _addr, bytes memory _calldata)
private
returns (bool ret)
returns (bool)
{
bool ret;
assembly {
let ptr := mload(0x40) // free memory pointer

Expand Down Expand Up @@ -51,13 +52,16 @@ library SafeERC20 {
default { }
}
}
return ret;
}

function staticInvoke(address _addr, bytes memory _calldata)
private
view
returns (bool success, uint256 ret)
returns (bool, uint256)
{
bool success;
uint256 ret;
assembly {
let ptr := mload(0x40) // free memory pointer

Expand All @@ -74,6 +78,7 @@ library SafeERC20 {
ret := mload(ptr)
}
}
return (success, ret);
}

/**
Expand Down

0 comments on commit b26941b

Please sign in to comment.