Skip to content

Commit 75657e7

Browse files
committed
rename to single order
1 parent a9f4661 commit 75657e7

File tree

2 files changed

+8
-8
lines changed

2 files changed

+8
-8
lines changed

src/AsyncSwap.sol

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -98,7 +98,7 @@ contract AsyncSwap is BaseHook, IAsyncSwapAMM {
9898

9999
function asyncOrder(PoolId poolId, address user, bool zeroForOne) external view returns (uint256 claimable) {
100100
AsyncFiller.State storage state = asyncOrders[poolId];
101-
return state.asyncOrders[user][zeroForOne];
101+
return state.asyncOrder[user][zeroForOne];
102102
}
103103

104104
function isExecutor(PoolId poolId, address user, address executor) external view returns (bool) {
@@ -139,7 +139,7 @@ contract AsyncSwap is BaseHook, IAsyncSwapAMM {
139139

140140
/// TODO: Document what this does
141141
uint256 amountToFill = uint256(amountIn);
142-
uint256 claimableAmount = asyncOrders[poolId].asyncOrders[owner][zeroForOne];
142+
uint256 claimableAmount = asyncOrders[poolId].asyncOrder[owner][zeroForOne];
143143
require(amountToFill <= claimableAmount, "Max fill order limit exceed");
144144
AsyncFiller.State storage state = asyncOrders[poolId];
145145
require(order.isExecutor(state, msg.sender), "Caller is valid not excutor");
@@ -155,7 +155,7 @@ contract AsyncSwap is BaseHook, IAsyncSwapAMM {
155155
currencyFill = currency0;
156156
}
157157

158-
asyncOrders[poolId].asyncOrders[owner][zeroForOne] -= amountToFill;
158+
asyncOrders[poolId].asyncOrder[owner][zeroForOne] -= amountToFill;
159159
/// TODO: check if this is needed, we could just burn
160160
poolManager.transfer(owner, currencyTake.toId(), amountToFill);
161161
emit AsyncOrderFilled(poolId, owner, zeroForOne, amountToFill);
@@ -196,8 +196,8 @@ contract AsyncSwap is BaseHook, IAsyncSwapAMM {
196196

197197
/// @dev Issue 1:1 claimableAmount - pool fee to user
198198
/// @dev Add amount taken to previous claimableAmount
199-
uint256 currClaimables = asyncOrders[poolId].asyncOrders[hookData.user][params.zeroForOne];
200-
asyncOrders[poolId].asyncOrders[hookData.user][params.zeroForOne] = currClaimables + finalTaken;
199+
uint256 currClaimables = asyncOrders[poolId].asyncOrder[hookData.user][params.zeroForOne];
200+
asyncOrders[poolId].asyncOrder[hookData.user][params.zeroForOne] = currClaimables + finalTaken;
201201

202202
/// @dev Hook event
203203
/// @reference

src/libraries/AsyncFiller.sol

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ library AsyncFiller {
2626
struct State {
2727
IPoolManager poolManager;
2828
IAlgorithm algorithm;
29-
mapping(address user => mapping(bool zeroForOne => uint256 claimable)) asyncOrders;
29+
mapping(address user => mapping(bool zeroForOne => uint256 claimable)) asyncOrder;
3030
mapping(address owner => mapping(address executor => bool)) setExecutor;
3131
}
3232

@@ -72,7 +72,7 @@ library AsyncFiller {
7272

7373
PoolId poolId = order.key.toId();
7474
uint256 amountToFill = uint256(order.amountIn);
75-
uint256 claimableAmount = self.asyncOrders[order.owner][order.zeroForOne];
75+
uint256 claimableAmount = self.asyncOrder[order.owner][order.zeroForOne];
7676
require(amountToFill <= claimableAmount, "Max fill order limit exceed");
7777
require(isExecutor(order, self, msg.sender), "Caller is valid not excutor");
7878

@@ -87,7 +87,7 @@ library AsyncFiller {
8787
currencyFill = order.key.currency0;
8888
}
8989

90-
self.asyncOrders[order.owner][order.zeroForOne] -= amountToFill;
90+
self.asyncOrder[order.owner][order.zeroForOne] -= amountToFill;
9191
self.poolManager.transfer(order.owner, currencyTake.toId(), amountToFill);
9292
emit AsyncOrderFilled(poolId, order.owner, order.zeroForOne, amountToFill);
9393

0 commit comments

Comments
 (0)