NFT20Pair
Last updated
Last updated
is an ERC20 token contract representing a pool of ERC721/ERC1155 NFT tokens. It allows users to deposit their ERC721/ERC1155 tokens in exchange for corresponding ERC20 tokens, and vice versa. Users may also use this contract to trade their ERC721/ERC1155 tokens for other tokens in the pool.
The currently deployed base () contract can be found at 0x7824948612d5F6d3dBC54d1c1173715B997403a1
on mainnet Ethereum.
When creating new pairs will instantiate a new instance of this contract (via a ) to represent the pair.
You should never interact with this base contract directly, and should instead use to find the deployed contract for the pair you wish to use.
Sending ERC721/ERC1155 tokens directly to a pair address will result in the transfer of the corresponding ERC20 pair tokens to the sender upon receipt.
In general, you must approve the pair contract address to transfer the relevant tokens on your behalf before calling these methods.
function withdraw(uint256[] calldata _tokenIds,uint256[] calldata amounts,address receipient) external
Burns ERC20 tokens to redeem ERC721/ERC1155 tokens from the pool.
_tokenIds
uint256[]
An array of tokenIds to withdraw.
amounts
uint256[]
The amount of each token in _tokenIds to withdraw.
receipient
address
Address where ERC721/ERC1155 tokens should be transfered to.
function multi721Deposit(uint256[] memory _ids, address _referral) public;
Deposits multiple ERC721 tokens in exchange for the pair’s ERC20 token in one transaction.
_ids
uint256[]
An array of tokenIds to deposit.
_referral
address
function swap721(uint256 _in, uint256 _out) external;
Swaps an ERC721 token for a different ERC721 token in the pool.
_in
uint256
tokenId to deposit.
_out
uint256
tokenId to withdraw.
function swap1155(uint256[] calldata in_ids,uint256[] calldata in_amounts,uint256[] calldata out_ids,uint256[] calldata out_amounts) external;
Swaps ERC1155 token(s) for different ERC115 token(s) in the pool.
_in_ids
uint256[]
An array of tokenIds to deposit.
_in_amounts
uint256[]
An array of amounts of tokens to deposit.
_out_ids
uint256[]
An array of tokenIds to withdraw.
_out_amounts
uint256[]
An array of amounts of tokens to withdraw.
address public factory;
address
address public nftAddress;
Returns the address of the ERC721/ERC1155 token held in this pair.
address
ERC721/ERC1155 contract address.
uint256 public nftType;
Returns the type of NFT held in this pair, 721 for ERC721 or 1155 for ERC1155.
uint256
721 for ERC721 or 1155 for ERC1155.
uint256 public nftValue;
Returns the amount of ERC20 tokens to be issued per ERC721/ERC1155 deposit.
uint256
amount of ERC20 tokens issued on deposit
This contract conforms to and in order to mint pair tokens in exchange for ERC721/ERC1155 NFTs.
Referring address to recieve 40% of the .
Returns the contract that created this pair.
contract address.