Skip to content

Commit

Permalink
getTokenId helper of Recipt erc1155 tokens
Browse files Browse the repository at this point in the history
  • Loading branch information
abhi8960git committed Sep 15, 2024
1 parent cc3d1d3 commit 3005de6
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions src/TakeProfitHook.sol
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,19 @@ contract TakeProfitsHook is BaseHook, ERC1155 {
return intervals * tickSpacing;
}

// ERc115 helpers

function getTokenId(
PoolKey calldata key,
int24 tickLower,
bool zeroForOne
) public pure returns (uint256) {
return
uint256(
keccak256(abi.encodePacked(key.toId(), tickLower, zeroForOne))
);
}

// Hooks
function afterInitialize(
address,
Expand Down

0 comments on commit 3005de6

Please sign in to comment.