diff --git a/contracts/extensions/FeeTaker.sol b/contracts/extensions/FeeTaker.sol index 20571a6d..39ed8f5d 100644 --- a/contracts/extensions/FeeTaker.sol +++ b/contracts/extensions/FeeTaker.sol @@ -161,14 +161,6 @@ contract FeeTaker is IPostInteraction, AmountGetterWithFee, Ownable { } } - /** - * @dev Parses fee data from `extraData`. - * Override this function if whitelist structure in postInteraction is different from getters. - */ - function _isWhitelistedPostInteractionImpl(bytes calldata whitelistData, address taker) internal view virtual returns (bool isWhitelisted, bytes calldata tail) { - return _isWhitelistedGetterImpl(whitelistData, taker); - } - /** * @dev Calculates fee amounts depending on whether the taker is in the whitelist and whether they have an _ACCESS_TOKEN. * `extraData` consists of: @@ -189,6 +181,14 @@ contract FeeTaker is IPostInteraction, AmountGetterWithFee, Ownable { protocolFeeAmount = takingAmount.mulDiv(resolverFee, denominator) + integratorFeeTotal - integratorFeeAmount; } + /** + * @dev Parses fee data from `extraData`. + * Override this function if whitelist structure in postInteraction is different from getters. + */ + function _isWhitelistedPostInteractionImpl(bytes calldata whitelistData, address taker) internal view virtual returns (bool isWhitelisted, bytes calldata tail) { + return _isWhitelistedGetterImpl(whitelistData, taker); + } + function _sendEth(address target, uint256 amount) private { (bool success, ) = target.call{value: amount}(""); if (!success) { diff --git a/contracts/interfaces/IOrderMixin.sol b/contracts/interfaces/IOrderMixin.sol index 9c9a0713..6d54fd2a 100644 --- a/contracts/interfaces/IOrderMixin.sol +++ b/contracts/interfaces/IOrderMixin.sol @@ -73,28 +73,12 @@ interface IOrderMixin { ); /** - * @notice Returns bitmask for double-spend invalidators based on lowest byte of order.info and filled quotes - * @param maker Maker address - * @param slot Slot number to return bitmask for - * @return result Each bit represents whether corresponding was already invalidated - */ - function bitInvalidatorForOrder(address maker, uint256 slot) external view returns(uint256 result); - - /** - * @notice Returns bitmask for double-spend invalidators based on lowest byte of order.info and filled quotes - * @param maker Address of the order maker - * @param orderHash Hash of the order - * @return remaining Remaining amount of the order - */ - function remainingInvalidatorForOrder(address maker, bytes32 orderHash) external view returns(uint256 remaining); - - /** - * @notice Returns bitmask for double-spend invalidators based on lowest byte of order.info and filled quotes - * @param maker Address of the order maker - * @param orderHash Hash of the order - * @return remainingRaw Inverse of the remaining amount of the order if order was filled at least once, otherwise 0 + * @notice Delegates execution to custom implementation. Could be used to validate if `transferFrom` works properly + * @dev The function always reverts and returns the simulation results in revert data. + * @param target Addresses that will be delegated + * @param data Data that will be passed to delegatee */ - function rawRemainingInvalidatorForOrder(address maker, bytes32 orderHash) external view returns(uint256 remainingRaw); + function simulate(address target, bytes calldata data) external; /** * @notice Cancels order's quote @@ -117,21 +101,6 @@ interface IOrderMixin { */ function bitsInvalidateForOrder(MakerTraits makerTraits, uint256 additionalMask) external; - /** - * @notice Returns order hash, hashed with limit order protocol contract EIP712 - * @param order Order - * @return orderHash Hash of the order - */ - function hashOrder(IOrderMixin.Order calldata order) external view returns(bytes32 orderHash); - - /** - * @notice Delegates execution to custom implementation. Could be used to validate if `transferFrom` works properly - * @dev The function always reverts and returns the simulation results in revert data. - * @param target Addresses that will be delegated - * @param data Data that will be passed to delegatee - */ - function simulate(address target, bytes calldata data) external; - /** * @notice Fills order's quote, fully or partially (whichever is possible). * @param order Order quote to fill @@ -213,4 +182,33 @@ interface IOrderMixin { TakerTraits takerTraits, bytes calldata args ) external returns(uint256 makingAmount, uint256 takingAmount, bytes32 orderHash); + + /** + * @notice Returns bitmask for double-spend invalidators based on lowest byte of order.info and filled quotes + * @param maker Maker address + * @param slot Slot number to return bitmask for + * @return result Each bit represents whether corresponding was already invalidated + */ + function bitInvalidatorForOrder(address maker, uint256 slot) external view returns(uint256 result); + + /** + * @notice Returns bitmask for double-spend invalidators based on lowest byte of order.info and filled quotes + * @param orderHash Hash of the order + * @return remaining Remaining amount of the order + */ + function remainingInvalidatorForOrder(address maker, bytes32 orderHash) external view returns(uint256 remaining); + + /** + * @notice Returns bitmask for double-spend invalidators based on lowest byte of order.info and filled quotes + * @param orderHash Hash of the order + * @return remainingRaw Inverse of the remaining amount of the order if order was filled at least once, otherwise 0 + */ + function rawRemainingInvalidatorForOrder(address maker, bytes32 orderHash) external view returns(uint256 remainingRaw); + + /** + * @notice Returns order hash, hashed with limit order protocol contract EIP712 + * @param order Order + * @return orderHash Hash of the order + */ + function hashOrder(IOrderMixin.Order calldata order) external view returns(bytes32 orderHash); }