Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 8 additions & 8 deletions contracts/extensions/FeeTaker.sol
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand All @@ -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) {
Expand Down
70 changes: 34 additions & 36 deletions contracts/interfaces/IOrderMixin.sol
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand Down Expand Up @@ -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);
}
Loading