Skip to content

Commit

Permalink
feat: use code.length instead of extcodesize (#12)
Browse files Browse the repository at this point in the history
Co-authored-by: JG Carvalho <[email protected]>
  • Loading branch information
Lucas Manuel and JGcarv authored Dec 15, 2021
1 parent b43dd08 commit 1361ddf
Showing 1 changed file with 1 addition and 7 deletions.
8 changes: 1 addition & 7 deletions src/ERC20Helper.sol
Original file line number Diff line number Diff line change
Expand Up @@ -34,13 +34,7 @@ library ERC20Helper {
}

function _call(address token_, bytes memory data_) private returns (bool success_) {
uint256 size;

assembly {
size := extcodesize(token_)
}

if (size == uint256(0)) return false;
if (token_.code.length == 0) return false;

bytes memory returnData;
( success_, returnData ) = token_.call(data_);
Expand Down

0 comments on commit 1361ddf

Please sign in to comment.