MigratorZap
MigratorZap.sol
Migrates positions from NFTX V2 to V3.
Table of Contents
Constants
DEADLINE
A sufficiently large value used for Uniswap V2's deadline.
DUST_THRESHOLD
Threshold for what amount of V2 vTokens (left after redeeming) constitutes "dust." Used to determine whether to swap dust to WETH or not.
WETH
Address of WETH contract.
v2NFTXFactory
NFTX V2 vault factory address.
v2Inventory
NFTX V2 inventory staking address.
sushiRouter
Sushi router address.
positionManager
Address of NFTX V3's NonfungiblePositionManager contract.
v3NFTXFactory
Address of NFTXVaultFactoryUpgradeableV3 contract.
v3Inventory
Address of NFTXInventoryStakingV3Upgradeable contract.
Write Functions
sushiToNFTXAMM
Migrates Sushi vToken liquidity to NFTX v3 AMM.
SushiToNFTXAMMParams | Type | Description |
---|---|---|
sushiPair |
| SLP token address. |
lpAmount |
| SLP amount. |
vTokenV2 |
| vToken amount. |
idsToRedeem |
| NFT tokenIDs to redeem. |
is1155 |
| Whether NFTs use ERC1155. |
permitSig |
| Signed UniV2 Permit. |
vaultIdV3 |
| NFTX v3 vault ID. |
tickLower |
| Lower tick for v3 liquidity. |
tickUpper |
| Upper tick for v3 liquidity. |
fee |
| Fee tier of V3 AMM pool to be used. |
sqrtPriceX96 |
| Starting price, if pool is not initialized. |
amount0Min |
| Minimum token0 amount to succeed. |
amount1Min |
| Minimum token1 amount to succeed. |
deadline |
| Dealine for transaction to succeed. Unix timestamp, in seconds. |
Return values | Type | Description |
---|---|---|
positionId |
| ID number of newly created position. |
v2InventoryToXNFT
Migrates V2 inventory position to V3 xNFT inventory staking position.
Parameters | Type | Description |
---|---|---|
vaultIdV2 |
| V2 vault ID. |
shares |
| V2 xToken shares. |
idsToRedeem |
| NFT tokenIDs to redeem. |
is1155 |
| Whether NFT collection uses ERC1155. |
vaultIdV3 |
| V3 vault ID. |
minWethToReceive |
| Minimum WETH to be received. |
Return values | Type | Description |
---|---|---|
xNFTId |
| ID of newly created xNFT. |
v2VaultToXNFT
Migrates V2 vault token to V3 xNFT inventory staking position.
Parameters | Type | Description |
---|---|---|
vaultIdV2 |
| V2 vault ID. |
vTokenV2 |
| V2 vault address. |
shares |
| The amount of v2 vToken shares to withdraw. |
idsToRedeem |
| TokenIDs of NFTs to redeem. |
is1155 |
| Whether the NFT collection uses ERC1155. |
vaultIdV3 |
| V3 vault ID. |
minWethToReceive |
| Minimum required WETH to receive. |
Return values | Type | Description |
---|---|---|
xNFTId |
| ID of newly created xNFT inventory position. |
Last updated