Request form
Cookbook may introduce a token in the future. Share and contribute to be eligible for future airdrops.
close icon
relevant tag icon
SudoSwap Missing Enumerable NFT Pair
copy icon
sudoswap
• version 1.0.0
AMM
Pair
NFT

SudoSwap Missing Enumerable NFT Pair

Pairs are either LSSVMPairEnumerable or LSSVMPairMissingEnumerable depending on whether or not the pair's ERC721 contract supports Enumerable or not. If it doesn't, we implement our own ID set to allow for easy access to NFT IDs in the pool.

*Visit desktop site to download or deploy

Version

1.0.0

Creator

sudoswap

Recent Use

🍞 0xa57C downloaded

Last Publish

1/27/2023
Any contract you deploy is yours.
Fully owned and controlled by your wallet.
Documentation
Source Code
_sendAnyNFTsToRecipient(address,uint256) :
This function is used to send any number of Non-Fungible Tokens (NFTs) from the contract to a recipient. It takes in three parameters: an IERC721 interface, the address of the recipient, and the number of NFTs to be sent. The function first sets the last index of the idSet array to the length of the array minus one. It then iterates through the array, starting from the last index, and sends each NFT to the recipient using the safeTransferFrom() function. The NFT ID is then removed from the idSet array. (autogenerated documentation)
_sendSpecificNFTsToRecipient(address,uint256[]) :
This function is used to send specific Non-Fungible Tokens (NFTs) from the contract to a recipient address. It takes in an IERC721 contract, a recipient address, and an array of NFT IDs as parameters. It then loops through the array of NFT IDs and calls the safeTransferFrom() function on the IERC721 contract to transfer each NFT from the contract to the recipient address. Finally, it removes each NFT ID from the idSet. (autogenerated documentation)
getAllHeldIds() :
This function is an override of the getAllHeldIds() function from the ERC721 interface. It returns an array of all the ids of the Non-Fungible Tokens (NFTs) that are held by the contract. It does this by looping through the idSet array and adding each id to the ids array. It then returns the ids array. (autogenerated documentation)
onERC721Received(uint256) :
This function is used to detect when a new ERC721 token has been received. It takes in four parameters: the sender address, the recipient address, the token ID, and a byte array of data. It then checks to see if the sender address matches the address of the ERC721 contract, and if so, adds the token ID to the idSet. Finally, it returns the selector of the onERC721Received function. (autogenerated documentation)
withdrawERC721(uint256[]) :
This function allows the owner of the contract to withdraw ERC721 tokens from the contract. It takes in an IERC721 interface and an array of uint256 values (nftIds) as parameters. It first checks to see if the IERC721 interface passed in is the same as the one stored in the contract. If it is, it will loop through the array of uint256 values and use the safeTransferFrom function to transfer the tokens from the contract to the msg.sender. It will also remove the token IDs from the idSet. If the IERC721 interface passed in is not the same as the one stored in the contract, it will still loop through the array of uint256 values (autogenerated documentation)

Get Cookin'
share iconShare

copy iconDownload Source
copy iconnpx cookbookdev i sudoswap-pair-not-enumerable
copy icon

Recent Use

🍞 0xa57C downloaded

Last Publish

1/27/2023

Version

1.0.0

Creator

sudoswap

Cookbook is free.
Any contract you deploy is yours.
Your contract is owned and controlled by you.