Bulk Actions on PaintSwap

PaintSwap
Paint Swap Finance
Published in
15 min readDec 15, 2022

Transfer/Burn/Buy/List/Remove Listing/Offer/Edit/Liquidate

PaintSwap and its team are well known as proponents of the ERC1155 standard. Its high efficiency and malleability as a contract standard are undeniable, and we wanted to bring that same streamlined, low gas experience into play with all aspects of our marketplace. Because the majority of marketplaces have yet to adopt and develop around ERC1155, many of the collections on our site use the ERC721 standard, which presented a unique challenge in developing the proprietary functions that PaintSwap put into place to handle bulk actions such as Transfer, List, and Buy, and others to be mentioned in this article. The final product, however, was well worth the effort, as users of PaintSwap are already aware.

Transfer

We’ll begin with the Bulk Transfer functionality. This was an easy decision to include for PaintSwap, as creators have been manually airdropping NFTs to users since the dawn of NFT airdrops. The Bulk Transfer function is native to ERC1155 NFT standards, but has never been easily available to holders/creators of ERC721, ERC721Enum contracts. Additionally, even utilizing safeBatchTransferFrom through an ERC1155 contract requires a degree of syntax with which the average user is entirely unfamiliar and can only target a single receiving address.

The Bulk Wrapper (the contract which makes all of this possible) works differently. The most noticeable advantage is, of course, the visual representation through the UI. One-click selection and a visual indicator of target items (see below image) create a smooth and understandable user experience when initiating Bulk actions. In fact, the same selection mechanism is utilized throughout the site, with uniform placement and icons, making interaction with the Wrapper intuitive and accessible for all. These selections persist from page to page, even on refresh. As for bulk transfer, the action begins in the ‘NFTs’ tab of the user profile.

The Bulk Action button on the bottom, right-hand corner of every asset card (also on individual asset pages) is used to select the target items for the Bulk Transfer; targeted items are then encased in a yellow frame to give a visual indication of selection. While there is no limit on the number of NFTs that can be included in a single bulk transfer action, the recommended maximum is 100 items due to compounding gas and additional UI constraints. Once the desired targets are selected, clicking the ‘Bulk Transfer’ button will take the user into the actual transfer interface itself. Many notable indicators, tools, and safeguards have been put into place here.

The ‘Approve’ button is used to approve the Transfer interaction between the Bulk Wrapper and the NFTs in your wallet. One approval will allow the wrapper to include all NFTs on a singular contract in safeBatchTransferFrom and/or safeTransferFrom function interactions. Please note that MetaMask will display a warning when offering the approval transaction. The warning states that PaintSwap will be given the power to Transfer any and all NFTs from said contract using our wrapper. It is important to note that this is the standard disclaimer/warning provided by MetaMask to its users and is not unusual.

The ‘Remove’ button recycles the familiar imagery of the Bulk Action button seen previously on the ‘NFTs’ tab. As one would expect, this removes the targeted item from the list of items to be included in the Transfer action. Once removed from this interface, the item is also deselected on the ‘NFTs’ tab, and it will not be included in any subsequent Bulk Actions unless targeted again.

‘Not Ready’, is the basic warning attached to an NFT that cannot currently be transferred, which can have a variety of causes. Most common among those are missing contract approval, NFT contract limitations such as non-transferrable (for which there is a visible indicator on the ‘NFTs’ tab), or an NFT that has been transferred independently from the Bulk Transfer process, as pictured above. Below is an example of an NFT that is ‘Ready’ to be assigned a recipient.

Unverified collections do not display the expected blue checkmark, shown below in the mobile layout, distinguishing Community/unverified NFTs from fully tracked and verified collections. As PaintSwap continues to grow and implements a “Track All” functionality on supported chains, this feature will become vastly more important.

One of the most popular features among those with highly crowded wallets is the ‘Edit All Addresses’ toggle, which can be used to move items from one wallet to another, allowing organization of collections, transfer into cold storage, etc. with maximum efficiency. This is also an excellent tool to have around in the event of a compromised wallet, which is always a race against the clock to secure assets before the malicious user or bot. Pictured in action below, notice how input is forbidden in all but the first ‘To’ address field.

To prevent potential malicious changing of text field input, the user is required to take the additional step of verifying the intended recipient address after the ‘Transfer X NFTs’ (where ‘X’ represents the number of NFTs remaining in the selection). This step of the process disables all text input and displays the previously entered address directly below all text input fields. Lastly, a bright yellow message warns the user of the irreversible nature of an asset transfer. Once the messages and addresses are reviewed, the user clicks ‘Confirm Transfer of X NFTs’ to transfer the entire selection in a single transaction.

Burn

It’s also prudent to discuss the Bulk Burn, or ‘Destroy All’, functionality in the same context as Bulk Transfer, as the function is built directly into the same interface. Bulk Burn should not be used on items that are meant to be destroyed at a contract level, as it instead utilizes the 0xDead method* to remove the targeted assets from circulation. The ‘burn’ function is not present on a large majority of ERC721 contracts; therefore, PaintSwap determined a check for this function to be inefficient and generally not worthwhile.

To utilize the Bulk Burn functionality, simply click the ‘Destroy All’ toggle. All user input will become disabled, leaving only ‘Approve’ and ‘Remove Item’ actions available. Once all approvals and removals are carried out as intended, the user may click ‘Destroy X NFTs’. Much like the Bulk Transfer functionality, the user is required to verify the 0xDead address as the intended recipient and shown various warning messages about the finality of the action and the method that is used.

Buy (Shopping Cart)

As part of our ongoing mission to make NFTs more accessible to users at all levels of ecosystem knowledge, a logical addition to the site was the ‘Bulk Buy’ or ‘Shopping Cart’ functionality. It is recognizable to any user that has shopped online, and comes with time and gas saving capabilities that are extremely useful for all users.

The process itself is extremely simple for the user. On any ‘Listings’ page, whether within a collection or in the ‘Explore’ area, listing cards feature the comforting Shopping Cart button in the bottom, right-hand corner. Like the Bulk Action button, Shopping Cart selections persist from page to page and on refresh. Selection indication follows the same logic as Bulk Action as well.

As the user adds items to their Cart, a rolling counter appears over the Shopping Cart itself in the top, right-hand corner of the web page.

As demonstrated by the previous image, the Shopping Cart can hold virtually as many NFTs as a user would reasonably buy in a singular visit to the site. The only limitation on quantity is the gas constraints put forward by the final contract interactions with whatever items are being purchased. For example, if an NFT contract also Buys/Burns an ERC 20 token at the time of purchase, that contract will demand more gas, lowering the overall quantity. A reasonable cap (with margin of error for gas fluctuation) is 30–50 NFTs. Once the user has entered into the Shopping Cart interface, there are some data points and actions that become available.

‘Remaining’ refers to the quantity of a given item that is currently listed. This data point only applies to ERC1155 contracts, which allow for multiple identical items to be minted on the same ID. Similarly, ‘Quantity’ refers to the number of those Remaining in the listing that the user wishes to purchase at the time of ‘Checkout’. The ‘Price’ is always per item, and will not change when multiple are being purchased. Total pricing is always found directly above the Checkout button. ‘NFT Ready’ and ‘Remove’ functionalities directly parody the Bulk Transfer interface (icon notwithstanding).

Once the user has clicked the ‘Checkout X NFTs’ button, all of the purchases will be processed in a single transaction. All purchases are final and irreversible.

List

Bulk list utilizes all of the same Bulk Action functionality as the Bulk Transfer mechanism. Reference back to the Transfer section for details on how to interact with the selection button, or see above for a visual representation of this interaction in List View. As with Bulk Transfer, the user simply makes the desired selections and clicks the button labeled ‘Bulk List’ located at the top of the NFTs tab. The Bulk Listing interface can be a lot to digest, but the strength of this functionality is its malleability.

As shown in the previous image, there is a Legend in the bottom left corner of the page defining all of the relevant terms that are found on the page. Find that same information below.

Sale:

Normal listing with a set buy price.

Auction:

When put up for auction, buyers can bid, starting at your reserve price, and the auction will run for the full chosen duration.

Bids placed within the last 3 minutes will automatically extend the auction so that 3 minutes remain.

Highest bid wins the whole quantity as a batch, and if no bids are given, the item will be reclaimable after the listing has ended.

Flash Auction:
Flash auctions are like auctions, but faster. Bids made within the last 90sec will automatically extend the auction so that 90sec remain. Flash auctions can be as fast as 5min, but the grace period for removal is only 90sec.

Make Custodial:
Auctions must be custodial, and it is also strongly suggested for fNFTs. Any listing can be made custodial.

With that information in mind, the interface is actually very simple to navigate. The user simply sets the parameters as they want them and clicks ‘List X NFTs’ to complete the process in a single transaction. Because the Listing transaction is more complex than some of the other bulk functions, groups are limited to 15 at a time. If more than 15 are selected on NFTs, the user will interact with the first 15, and upon listing, the next set of 15 will be made available for interaction. That means 15 Listings are possible at a time, per transaction. When listing similar items, note that the ‘Edit All’ toggle is available at the top of the interface.

Edit Listing

When editing listings, there is often a need to change multiple. From the ‘Listings’ tab, select any listings that need to be edited using the Bulk Action button on the bottom, right-hand corner of the Listing card. Once the desired selections have been made, the ‘Edit Listings’ button can be found at the top of the page.

On this page, prices may be changed based upon the individual listing for both Verified and Unverified NFTs. Note that until the price is changed on all items (or items unchanged have been removed), the ‘Edit X Listings’ button will not illuminate. Once all changes have been made, click ‘Edit X Listings’ to prompt the single wallet interaction required to perform this action. There is no fee for this, only the gas required for the interaction with our Bulk Wrapper.

Remove Listing

Bulk Remove Listing once again uses all of the same Bulk Action interactions as Transfer and list, though it takes in the ‘Listings’ tab rather than the ‘NFTs’ tab, as one might expect.

The user may make their selections and begin the process of removing the targeted listings by clicking the ‘Remove Listings’ button at the top of the Listings page (see previous image). The simplest of all Bulk Actions on PaintSwap, Bulk Remove Listing only requires one additional click to prompt the transaction and remove the selected listings in a single Transaction.

Offer

Bulk Offer is a bit different from the other Bulk Actions on PaintSwap. In order to maintain a clear UI, we elected for this function to be mainly utilized on the NFTs tab of a Collection or directly from a Listing or Asset itself. The icon is found in the same location on the card as all other action buttons and is represented in the top, right-hand corner of the page alongside the Cart with a similar rolling counter. Selections made are persistent across page navigation and refresh, and users can also browse one another’s wallets to make selections from there. This allows for multiple Collections/Assets to be targeted for offers at one time, in a single transaction. Once selections have been made, the user may click the icon at the top of the page to proceed into the Bulk Offer interface.

The only text input field available is the offer price. Though you will remain in possession of your tokens, they must be converted into wFTM and remain in the offering wallet and wrapped for the duration of the offer, or else the Offer will become invalid. Once the Offer has become invalid, the owner of the offered upon NFT is unable to accept it. There are two types of Bulk Offer, which will be described below-

Individual Offers:

These are just like singular offer actions, but multiples are bundled into a single transaction. All offers in this list can be accepted by any owner of the targeted NFT IDs as long as the offers remain valid. Price and duration can be edited later.

If you want a single acceptance to invalidate the other offers in this batch, use Filtered Collection Offers.

Filtered Collection Offers:

Any offer in this list can be accepted by any owner of the targeted NFT IDs, but only ONE of them may be accepted. The first accepted offer in a given collection will invalidate all other offers in this list made toward THAT SAME COLLECTION.

Though price and duration can be edited later, duration will always be the same for all to save gas. If the initial price is the same for all, then the prices will all be adjusted simultaneously to reflect any change. A Filtered Collection Offer is created for each different collection in this list!

One main takeaway here should be that both of these offers are ID specific. If a user has no preference on the ID of a collection for which an offer is accepted, then traditional Collection Offers (not bulk) are more appropriate for that user. Also, there have been allusions to gas saving measures that have been put into place for the Filtered Collection Offer. These are very important to be aware of. They will be reiterated here for clarity-

  • When making a Filtered Collection Offer, the duration is shared between all targeted NFT IDs in the specified collection. This is always the case.
  • When making a Filtered Collection Offer, if all NFT IDs included are initially assigned the same offer price, then the price will be permanently linked as a single variable. That means that any change in offer price will impact the offers on each NFT ID identically.

Once the user has determined the preferred type of Bulk Offer, all that remains is setting the desired price, choosing an expiration date (default is one month), and zapping the necessary tokens for the offer to the wrapped token. The use of wrapped tokens allows the user to sign a spending request from PaintSwap and maintain custody of offered funds. The user may zap either the amount of their highest offer or the amount of all offers combined. This is possible because each offer considers the amount of wrapped tokens in the user’s wallet individually, not cumulatively. Therefore, if there are enough wrapped tokens to fulfill Offer A or Offer B but not Offer A + Offer B, both offers remain valid until such a time as the wrapped token count drops below the offered amount of either one. If the user hopes for every single offer to be valid regardless of the acceptance status of the others, then the user’s wallet should contain enough wrapped tokens to fulfill all offers.

Liquidate

Bulk Liquidate is a unique solution to the classic issue of crawling through a wallet in an attempt to determine the most profitable avenue to turn NFTs into liquidity quickly. This function searches all available offers, spanning Collection, Filtered Collection, and Individual Offers and presents the user with the highest of these offers on each targeted NFT. If there are not enough offers available to satisfy all items in the user’s list, then the earlier items in the list will be given priority. Like most Bulk Actions, Liquidation begins with selecting NFTs that a user wishes to sell on the NFTs tab of the Profile. In order to maintain the speed of the computation and ensure a smooth, pleasant user experience, the maximum number of items that may be included is currently 12. This is strictly a UI limit that has the potential to be expanded, as the contract level action can support many more without reaching any gas limitation. Once the desired NFTs have been targeted, the ‘Liquidate’ button may be found alongside the other bulk actions at the top of this same page.

On the Liquidate interface (pictured at the start of the section), the user need only approve the contract interaction and define the desired quantity to liquidate. In the case of ERC721 contracts, this field is not usable (as with all other areas of the site), but ERC1155 contracts may have enough offers available to fulfill multiples of the same ID. Once the quantities are set appropriately, the user may click the ‘Determine Optimum Offers’ button beneath the table (pictured below).

Please note that the ‘Total amount from offer:’ will always reflect a zero value until this button has been clicked. Once the total amount has been updated, the ‘Liquidate X NFTs’ button becomes available to prompt the sale transaction. All items that remain in the selection at the time of Liquidation will be sold in a single transaction, using the multi-transfer made possible by the Bulk Wrapper contract. If the user is unsatisfied with the offer value one a specific NFT, the ‘Remove Item’ button may be used at any time prior to the sale transaction to exclude an item from the table and, therefore, from sale. Additionally, bright yellow text indicates when an offer is more than 50% below floor price. This text appears both within and beneath the table, and the user is required to type ‘ACCEPT LOW OFFERS’ in a newly appeared text field in order to continue. As an additional safeguard, the button to initiate the sale action also includes the language ‘Liquidate With X Low Offers’ (pictured below).

Conclusion

This article contains all information pertaining to the bulk actions available on PaintSwap. These Bulk Actions are made possible through the superior engineering of the Bulk Wrapper contract combined with a painstakingly thorough UI implementation of the aforementioned concepts. These are only a handful of the consistent innovations that PaintSwap has brought and will continue to bring to the NFT community at large. Focusing on decentralization and ease of use is what has built this site into the product that it is today. Keep Painting.

‘the 0xDead method’ | Transferring an asset to 0x000000000000000000000000000000000000dEaD is widely considered an acceptable method of burning. This is not an accessible wallet, and sending items here completely removes them from further market circulation. PaintSwap does not track NFTs located in the 0xDead wallet.

--

--