Skip to content

Commit 7e701e5

Browse files
committed
improve some natspecs on BasicSwap7683 contract
1 parent 9be950e commit 7e701e5

File tree

1 file changed

+11
-4
lines changed

1 file changed

+11
-4
lines changed

solidity/src/BasicSwap7683.sol

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -85,6 +85,9 @@ abstract contract BasicSwap7683 is Base7683 {
8585

8686
/**
8787
* @dev Settles multiple orders by dispatching the settlement instructions.
88+
* The proper status of all the orders (filled) is validated on the Base7683 before calling this function.
89+
* It assumes that all orders were originated in the same originDomain so it uses the the one from the first one for
90+
* dispatching the message, but if some order differs on the originDomain it can be re-settle later.
8891
* @param _orderIds The IDs of the orders to settle.
8992
* @param _ordersOriginData The original data of the orders.
9093
* @param _ordersFillerData The filler data for the orders.
@@ -104,23 +107,27 @@ abstract contract BasicSwap7683 is Base7683 {
104107

105108
/**
106109
* @dev Refunds multiple OnchainCrossChain orders by dispatching refund instructions.
110+
* The proper status of all the orders (NOT filled and expired) is validated on the Base7683 before calling this
111+
* function.
112+
* It assumes that all orders were originated in the same originDomain so it uses the the one from the first one for
113+
* dispatching the message, but if some order differs on the originDomain it can be re-refunded later.
107114
* @param _orders The orders to refund.
108115
* @param _orderIds The IDs of the orders to refund.
109116
*/
110117
function _refundOrders(OnchainCrossChainOrder[] memory _orders, bytes32[] memory _orderIds) internal override {
111-
// at this point we are sure all orders are NOT filled, use the first order to get the originDomain
112-
// if some order differs on the originDomain it can be re-refunded later
113118
_dispatchRefund(OrderEncoder.decode(_orders[0].orderData).originDomain, _orderIds);
114119
}
115120

116121
/**
117122
* @dev Refunds multiple GaslessCrossChain orders by dispatching refund instructions.
123+
* The proper status of all the orders (NOT filled and expired) is validated on the Base7683 before calling this
124+
* function.
125+
* It assumes that all orders were originated in the same originDomain so it uses the the one from the first one for
126+
* dispatching the message, but if some order differs on the originDomain it can be re-refunded later.
118127
* @param _orders The orders to refund.
119128
* @param _orderIds The IDs of the orders to refund.
120129
*/
121130
function _refundOrders(GaslessCrossChainOrder[] memory _orders, bytes32[] memory _orderIds) internal override {
122-
// at this point we are sure all orders are NOT filled, use the first order to get the originDomain
123-
// if some order differs on the originDomain it can be re-refunded later
124131
_dispatchRefund(OrderEncoder.decode(_orders[0].orderData).originDomain, _orderIds);
125132
}
126133

0 commit comments

Comments
 (0)