Skip to content

Commit

Permalink
Replace contract check verification
Browse files Browse the repository at this point in the history
  • Loading branch information
Kolezhniuk committed Dec 23, 2024
1 parent 7345f44 commit 11daab8
Showing 1 changed file with 1 addition and 14 deletions.
15 changes: 1 addition & 14 deletions contracts/payment/SponsorPayment.sol
Original file line number Diff line number Diff line change
Expand Up @@ -132,7 +132,7 @@ contract SponsorPayment is ReentrancyGuardUpgradeable, EIP712Upgradeable, Ownabl

modifier validToken(address token) {
if (token != address(0)) {
if (!_isContract(token)) revert InvalidToken("Not a contract address");
if (token.code.length == 0) revert InvalidToken("Not a contract address");
}
_;
}
Expand Down Expand Up @@ -168,19 +168,6 @@ contract SponsorPayment is ReentrancyGuardUpgradeable, EIP712Upgradeable, Ownabl
}
}

/**
* @notice Checks if an address contains contract code
* @param addr Address to check
*/
function _isContract(address addr) private view returns (bool) {
uint256 size;
// solhint-disable-next-line no-inline-assembly
assembly {
size := extcodesize(addr)
}
return size > 0;
}

/**
* @dev Get the owner percentage value
* @return ownerPercentFee
Expand Down

0 comments on commit 11daab8

Please sign in to comment.