MarketplaceUniversalRouterZap
MarketplaceUniversalRouterZap.sol
This contract is a marketplace zap that uses the NFTX Universal Router.
Table of Contents
Constants
Variables
Events
Public Write Functions
Owner Write Functions
Address of WETH contract.
Address of PERMIT2 contract.
nftxVaultFactory
Address of NFTXVaultFactory contract.
inventoryStaking
Address of NFTXInventoryStakingV3 contract.
universalRouter
Address of NFTX's UniversalRouter contract.
Is the contract paused.
The maximum vToken amount that constitutes "dust."
Emitted by sell721() and sell1155().
Parameters
Type
Description
Total number of NFTs sold.
Emitted by swap721().
Parameters
Type
Description
Recipient that received NFT idsOut.
Emitted by swap1155().
Parameters
Type
Description
Amounts of tokenIDs (sent and received).
Amount of ETH paid for swap.
Recipient that received NFT idsOut.
Emitted by buyNFTsWithETH(), buyNFTsWithERC20() and buyNFTsWithERC20WithPermit2().
Parameters
Type
Description
Total ETH paid for purchase.
Total royalty paid, in ETH.
Emitted by buyNFTsWithETH(), buyNFTsWithERC20() and buyNFTsWithERC20WithPermit2().
Parameters
Type
Description
Amount of ETH dust returned.
Amount of vToken dust returned.
Emitted by pause().
Parameters
Type
Description
True if paused, false if un-paused.
NewUniversalRouter
Emitted by setUniversalRouter().
Parameters
Type
Description
New NFTX UniversalRouter address.
NewDustThreshold
Emitted by setDustThreshold().
Parameters
Type
Description
New dust threshold amount.
Write Functions
Sells one or more ERC721 NFTs for ETH.
Parameters
Type
Description
ID of vault that NFTs are being sold into.
Recipient of ETH proceeds.
Whether a royalty is deducted.
Swaps one or more ERC721 NFTs for one or more other ERC721 NFTs.
Parameters
Type
Description
ID of vault that NFTs are being swapped out of.
IDs of NFTs being sent to vault.
IDs of NFTs exiting vault.
Max premium fee to be paid (in vToken).
Address that NFTs from vault are sent to.
Buys one or more NFTs with ETH.
Parameters
Type
Description
ID of vault holding desired NFTs.
Address that NFTs are sent to.
Max premium fee to be paid (measured in vToken despite payment being in ETH).
Whether a royalty is deducted.
buyNFTsWithERC20
Purchases NFTs via NFTX's UniversalRouter and pay with any ERC20 supported by the NFTX AMM.
Parameters
Type
Description
BuyNFTsWithERC20Params
Type
Description
Vault ID of vToken holding desired NFTs.
Max premium fee to be paid (measured in vToken).
Encoded call data for "ERC20 to WETH swap" for NFTX UniversalRouter's execute function.
Encoded call data for "WETH to vToken swap" for NFTX Universal Router's execute function.
Recipient of purchased NFT IDs.
Whether a royalty is deducted.
buyNFTsWithERC20WithPermit2
Buys one or more NFTs with ERC20, using Permit2 for token approval.
Parameters
Type
Description
Sells one or more ERC1155 NFTs.
Parameters
Type
Description
ID of vault to sell into.
Quantities of each NFT token ID to send.
Address to receive ETH from sale.
Whether a royalty is deducted.
Swaps one or more ERC1155 NFTs for one or more other ERC1155 NFTs.
Parameters
Type
Description
ID of vault being swapped into.
IDs of NFTs being sent to vault.
Quantities of each NFT being sent.
IDs of NFTs exiting the vault.
Max premium fee to be paid (in vToken).
Address that receives NFTs leaving the vault.
Owner Functions
Pauses this contract.
Parameters
Type
Description
True to pause, false to un-pause.
setUniversalRouter
Sets address of NFTX Universal Router.
Parameters
Type
Description
New NFTX universal router address.
setDustThreshold
Sets (max) threshold for what is considered token dust.