Skip to content

Commit

Permalink
update PositionHandler to correctly call NFT manager
Browse files Browse the repository at this point in the history
  • Loading branch information
eli-d committed Nov 20, 2024
1 parent da899cd commit 73e003d
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion pkg/sol/PositionHandler.sol
Original file line number Diff line number Diff line change
Expand Up @@ -4,17 +4,20 @@ pragma solidity 0.8.16;
import "./ISeawaterAMM.sol";
import "./ILeo.sol";
import "./IERC20.sol";
import "./OwnershipNFTs.sol";

contract PositionHandler {
ISeawaterAMM immutable LONGTAIL;
ILeo immutable LEO;
IERC20 immutable FUSDC;
OwnershipNFTs immutable NFT_MANAGER;

constructor(ISeawaterAMM longtail, ILeo leo, IERC20 fusdcAddr) {
constructor(ISeawaterAMM longtail, ILeo leo, OwnershipNFTs nftManager, IERC20 fusdcAddr) {
LONGTAIL = longtail;
LEO = leo;
FUSDC = fusdcAddr;
FUSDC.approve(address(longtail), type(uint256).max);
NFT_MANAGER = nftManager;
}

function proxyVestIncr(
Expand Down Expand Up @@ -44,8 +47,10 @@ contract PositionHandler {
IERC20(pool).transfer(msg.sender, amount0Max - amount0Taken);
IERC20(FUSDC).transfer(msg.sender, fusdcMax - fusdcTaken);
if (shouldVest) {
NFT_MANAGER.approve(address(LEO), id);
LEO.vestPosition(pool, id, recipient);
} else {
NFT_MANAGER.approve(recipient, id);
LONGTAIL.transferPositionEEC7A3CD(id, address(this), recipient);
}
return id;
Expand Down

0 comments on commit 73e003d

Please sign in to comment.