Skip to content

Commit

Permalink
Merge pull request #347 from 1inch/audit/astrasec-n2
Browse files Browse the repository at this point in the history
[SC-1387] Unnecessary Code Removal
  • Loading branch information
zZoMROT authored Jan 15, 2025
2 parents 6040024 + 30b9a30 commit 505d462
Showing 1 changed file with 0 additions and 4 deletions.
4 changes: 0 additions & 4 deletions contracts/extensions/AmountGetterWithFee.sol
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,7 @@ contract AmountGetterWithFee is AmountGetterBase {
uint256 internal constant _BASE_1E5 = 1e5;
uint256 internal constant _BASE_1E2 = 100;

error InvalidIntegratorFee();
error InvalidIntegratorShare();
error InvalidResolverFee();
error InvalidWhitelistDiscountNumerator();

/**
Expand Down Expand Up @@ -80,11 +78,9 @@ contract AmountGetterWithFee is AmountGetterBase {
) internal view returns (bool isWhitelisted, uint256 integratorFee, uint256 integratorShare, uint256 resolverFee, bytes calldata tail) {
unchecked {
integratorFee = uint256(uint16(bytes2(extraData)));
if (integratorFee > _BASE_1E5) revert InvalidIntegratorFee();
integratorShare = uint256(uint8(bytes1(extraData[2:])));
if (integratorShare > _BASE_1E2) revert InvalidIntegratorShare();
resolverFee = uint256(uint16(bytes2(extraData[3:])));
if (resolverFee > _BASE_1E5) revert InvalidResolverFee();
uint256 whitelistDiscountNumerator = uint256(uint8(bytes1(extraData[5:])));
if (whitelistDiscountNumerator > _BASE_1E2) revert InvalidWhitelistDiscountNumerator();
(isWhitelisted, tail) = _isWhitelisted(extraData[6:], taker);
Expand Down

0 comments on commit 505d462

Please sign in to comment.