Skip to content

Instantly share code, notes, and snippets.

@phijfry
phijfry / get-position-amounts.js
Created May 28, 2024 12:20
Get Position Amounts
import { ethers, JsonRpcProvider } from "ethers";
const JSON_RPC = new JsonRpcProvider(process.env.NODE_URL);
const MIN_TICK = -887272;
const MAX_TICK = 887272;
const Q96 = BigInt(1) << BigInt(96); // Represents 1 << 96
const HYPERLOCK_DEPOSIT_CONTRACT = "0xc28EffdfEF75448243c1d9bA972b97e32dF60d06";
const NFP_MANAGER = "0x434575EaEa081b735C985FA9bf63CD7b87e227F9";
@phijfry
phijfry / PointsDeposits.sol
Created February 16, 2024 17:37
points-deposits.sol
// SPDX-License-Identifier: MIT
pragma solidity 0.6.12;
pragma experimental ABIEncoderV2;
import { Ownable } from "@openzeppelin/contracts-0.6/access/Ownable.sol";
import { ERC20 } from "@openzeppelin/contracts-0.6/token/ERC20/ERC20.sol";
import { IERC20 } from "@openzeppelin/contracts-0.6/token/ERC20/IERC20.sol";
import { ERC721 } from "@openzeppelin/contracts-0.6/token/ERC721/ERC721.sol";
import { INonfungiblePositionManager } from "../nfp/INonfungiblePositionManager.sol";
import { INonfungiblePositionManagerStruct } from "../nfp/INonfungiblePositionManagerStruct.sol";