Skip to content

Commit ae7e110

Browse files
committed
use asyncOrderAmount as state var name
1 parent 1f3df09 commit ae7e110

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
@@ -97,7 +97,7 @@ contract AsyncSwap is BaseHook, IAsyncSwapAMM {
9797

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

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

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

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

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

201201
/// @dev Hook event
202202
/// @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)) asyncOrder;
29+
mapping(address user => mapping(bool zeroForOne => uint256 claimable)) asyncOrderAmount;
3030
mapping(address owner => mapping(address executor => bool)) isExecutor;
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.asyncOrder[order.owner][order.zeroForOne];
75+
uint256 claimableAmount = self.asyncOrderAmount[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.asyncOrder[order.owner][order.zeroForOne] -= amountToFill;
90+
self.asyncOrderAmount[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)