Skip to content

Commit 3343e6a

Browse files
committed
Сonsistent Order Within a Contract
1 parent 60d57d8 commit 3343e6a

File tree

2 files changed

+23
-23
lines changed

2 files changed

+23
-23
lines changed

contracts/extensions/FeeTaker.sol

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -161,14 +161,6 @@ contract FeeTaker is IPostInteraction, AmountGetterWithFee, Ownable {
161161
}
162162
}
163163

164-
/**
165-
* @dev Parses fee data from `extraData`.
166-
* Override this function if whitelist structure in postInteraction is different from getters.
167-
*/
168-
function _isWhitelistedPostInteractionImpl(bytes calldata whitelistData, address taker) internal view virtual returns (bool isWhitelisted, bytes calldata tail) {
169-
return _isWhitelistedGetterImpl(whitelistData, taker);
170-
}
171-
172164
/**
173165
* @dev Calculates fee amounts depending on whether the taker is in the whitelist and whether they have an _ACCESS_TOKEN.
174166
* `extraData` consists of:
@@ -189,6 +181,14 @@ contract FeeTaker is IPostInteraction, AmountGetterWithFee, Ownable {
189181
protocolFeeAmount = takingAmount.mulDiv(resolverFee, denominator) + integratorFeeTotal - integratorFeeAmount;
190182
}
191183

184+
/**
185+
* @dev Parses fee data from `extraData`.
186+
* Override this function if whitelist structure in postInteraction is different from getters.
187+
*/
188+
function _isWhitelistedPostInteractionImpl(bytes calldata whitelistData, address taker) internal view virtual returns (bool isWhitelisted, bytes calldata tail) {
189+
return _isWhitelistedGetterImpl(whitelistData, taker);
190+
}
191+
192192
function _sendEth(address target, uint256 amount) private {
193193
(bool success, ) = target.call{value: amount}("");
194194
if (!success) {

contracts/interfaces/IOrderMixin.sol

Lines changed: 15 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -96,6 +96,21 @@ interface IOrderMixin {
9696
*/
9797
function rawRemainingInvalidatorForOrder(address maker, bytes32 orderHash) external view returns(uint256 remainingRaw);
9898

99+
/**
100+
* @notice Returns order hash, hashed with limit order protocol contract EIP712
101+
* @param order Order
102+
* @return orderHash Hash of the order
103+
*/
104+
function hashOrder(IOrderMixin.Order calldata order) external view returns(bytes32 orderHash);
105+
106+
/**
107+
* @notice Delegates execution to custom implementation. Could be used to validate if `transferFrom` works properly
108+
* @dev The function always reverts and returns the simulation results in revert data.
109+
* @param target Addresses that will be delegated
110+
* @param data Data that will be passed to delegatee
111+
*/
112+
function simulate(address target, bytes calldata data) external;
113+
99114
/**
100115
* @notice Cancels order's quote
101116
* @param makerTraits Order makerTraits
@@ -117,21 +132,6 @@ interface IOrderMixin {
117132
*/
118133
function bitsInvalidateForOrder(MakerTraits makerTraits, uint256 additionalMask) external;
119134

120-
/**
121-
* @notice Returns order hash, hashed with limit order protocol contract EIP712
122-
* @param order Order
123-
* @return orderHash Hash of the order
124-
*/
125-
function hashOrder(IOrderMixin.Order calldata order) external view returns(bytes32 orderHash);
126-
127-
/**
128-
* @notice Delegates execution to custom implementation. Could be used to validate if `transferFrom` works properly
129-
* @dev The function always reverts and returns the simulation results in revert data.
130-
* @param target Addresses that will be delegated
131-
* @param data Data that will be passed to delegatee
132-
*/
133-
function simulate(address target, bytes calldata data) external;
134-
135135
/**
136136
* @notice Fills order's quote, fully or partially (whichever is possible).
137137
* @param order Order quote to fill

0 commit comments

Comments
 (0)