@@ -8,6 +8,47 @@ import { LimitOrder } from "../libraries/LimitOrder.sol";
88/// @notice Interface for a limit order swap contract.
99/// @dev This interface defines functions and events related to executing and managing limit orders.
1010interface ILimitOrderSwap {
11+ /// @notice Struct containing parameters for the taker.
12+ /// @dev This struct encapsulates the parameters necessary for a taker to fill a limit order.
13+ struct TakerParams {
14+ uint256 takerTokenAmount; // Amount of tokens taken by the taker.
15+ uint256 makerTokenAmount; // Amount of tokens provided by the maker.
16+ address recipient; // Address to receive the tokens.
17+ bytes extraAction; // Additional action to be performed.
18+ bytes takerTokenPermit; // Permit for spending taker's tokens.
19+ }
20+
21+ /// @notice Emitted when the fee collector address is updated.
22+ /// @param newFeeCollector The address of the new fee collector.
23+ event SetFeeCollector (address newFeeCollector );
24+
25+ /// @notice Emitted when a limit order is successfully filled.
26+ /// @param orderHash The hash of the limit order.
27+ /// @param taker The address of the taker filling the order.
28+ /// @param maker The address of the maker who created the order.
29+ /// @param takerToken The address of the token taken by the taker.
30+ /// @param takerTokenFilledAmount The amount of taker tokens filled.
31+ /// @param makerToken The address of the token received by the maker.
32+ /// @param makerTokenSettleAmount The amount of maker tokens settled.
33+ /// @param fee The fee amount paid for the order.
34+ /// @param recipient The address receiving the tokens.
35+ event LimitOrderFilled (
36+ bytes32 indexed orderHash ,
37+ address indexed taker ,
38+ address indexed maker ,
39+ address takerToken ,
40+ uint256 takerTokenFilledAmount ,
41+ address makerToken ,
42+ uint256 makerTokenSettleAmount ,
43+ uint256 fee ,
44+ address recipient
45+ );
46+
47+ /// @notice Emitted when an order is canceled.
48+ /// @param orderHash The hash of the canceled order.
49+ /// @param maker The address of the maker who canceled the order.
50+ event OrderCanceled (bytes32 orderHash , address maker );
51+
1152 /// @notice Error to be thrown when an order has expired.
1253 /// @dev Thrown when attempting to fill an order that has already expired.
1354 error ExpiredOrder ();
@@ -68,47 +109,6 @@ interface ILimitOrderSwap {
68109 /// @dev Thrown when an operation is attempted by an unauthorized caller who is not the maker of the order.
69110 error NotOrderMaker ();
70111
71- /// @notice Emitted when the fee collector address is updated.
72- /// @param newFeeCollector The address of the new fee collector.
73- event SetFeeCollector (address newFeeCollector );
74-
75- /// @notice Emitted when a limit order is successfully filled.
76- /// @param orderHash The hash of the limit order.
77- /// @param taker The address of the taker filling the order.
78- /// @param maker The address of the maker who created the order.
79- /// @param takerToken The address of the token taken by the taker.
80- /// @param takerTokenFilledAmount The amount of taker tokens filled.
81- /// @param makerToken The address of the token received by the maker.
82- /// @param makerTokenSettleAmount The amount of maker tokens settled.
83- /// @param fee The fee amount paid for the order.
84- /// @param recipient The address receiving the tokens.
85- event LimitOrderFilled (
86- bytes32 indexed orderHash ,
87- address indexed taker ,
88- address indexed maker ,
89- address takerToken ,
90- uint256 takerTokenFilledAmount ,
91- address makerToken ,
92- uint256 makerTokenSettleAmount ,
93- uint256 fee ,
94- address recipient
95- );
96-
97- /// @notice Emitted when an order is canceled.
98- /// @param orderHash The hash of the canceled order.
99- /// @param maker The address of the maker who canceled the order.
100- event OrderCanceled (bytes32 orderHash , address maker );
101-
102- /// @notice Struct containing parameters for the taker.
103- /// @dev This struct encapsulates the parameters necessary for a taker to fill a limit order.
104- struct TakerParams {
105- uint256 takerTokenAmount; // Amount of tokens taken by the taker.
106- uint256 makerTokenAmount; // Amount of tokens provided by the maker.
107- address recipient; // Address to receive the tokens.
108- bytes extraAction; // Additional action to be performed.
109- bytes takerTokenPermit; // Permit for spending taker's tokens.
110- }
111-
112112 /// @notice Fills a limit order.
113113 /// @param order The limit order to be filled.
114114 /// @param makerSignature The signature of the maker authorizing the fill.
0 commit comments