Skip to content

Commit

Permalink
fix: warning
Browse files Browse the repository at this point in the history
  • Loading branch information
yutingzhao1991 committed Aug 2, 2024
1 parent 180130b commit ebb6840
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
5 changes: 2 additions & 3 deletions demo-contract/contracts/wtfswap/Pool.sol
Original file line number Diff line number Diff line change
Expand Up @@ -61,10 +61,9 @@ contract Pool is IPool {
function collect(
address recipient
) external override returns (uint128 amount0, uint128 amount1) {
// 获取当前用户的 position
Position storage position = positions[msg.sender];
// 获取当前用户的 position,TODO recipient 应该改为 msg.sender
Position storage position = positions[recipient];
// TODO 把钱退给用户 recipient

// 修改 position 中的信息
position.tokensOwed0 -= amount0;
position.tokensOwed1 -= amount1;
Expand Down
1 change: 1 addition & 0 deletions demo-contract/contracts/wtfswap/SwapRouter.sol
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ contract SwapRouter is ISwapRouter {
bytes memory data;
// 交易的钱统一转给本合约,最后都完成之后在 swapCallback 中打给用户
pool.swap(msg.sender, true, 12, 12, data);
amountOut += 2;
index++;
}
}
Expand Down

0 comments on commit ebb6840

Please sign in to comment.