Skip to main content

NFT Developer Guide

Welcome to the ElectroSwap NFT Marketplace! This guide provides developers with all the necessary details to integrate and utilize our marketplace effectively. Below are the features, requirements, and best practices for developers building and listing NFTs on our platform.

Supported Standards

  • ERC-721: Our marketplace fully supports the ERC-721 standard, including metadata and tokenURI functionality. Creators are encouraged to use @openzeppelin/contracts (e.g., ERC721Enumerable, ERC721URIStorage, etc) for ERC-721 implementation
ERC-1155 Support

Support for ERC-1155 is not available at this time but is planned for future updates.

Implementing token URI

For ElectroSwap to pull in off-chain metadata for ERC721 assets, your contract will need to return a URI where we can find the metadata. To find this URI, we use the tokenURI method in ERC721.

/**
* @dev Returns the metadata URI for a given token ID.
*/
function tokenURI(uint256 _tokenId) public view returns (string) {
return string.concat(
baseTokenURI(),
Strings.uint2str(_tokenId)
);
}

The tokenURI function in your ERC721 contract should return an HTTPS or IPFS (preferred) URL unique to the token. When queried, this URL should return a JSON blob of data with the metadata for your token. You can see an example.

Metadata Best Practices

ElectroSwap supports metadata that is structured according to the official ERC721 metadata standard.

{
"name": "Electric Legends #1",
"description": "Bolt Vanguard is the captain of the Electric Legends",
"image": "ipfs://bafy...so3na/1",
"external_url": "https://creator.io/electric-legends/1",
"attributes": [], // See more below
"fee_recipient": "0xD6Cf49CbCF84B2cd2472a376B5f791689A0769d0",
"seller_fee_basis_points": 200,
}

Here's how each of these properties work:

FieldDescription
nameUnique name of the item/token.
descriptionA human-readable description of the item.
imageThis is the URL to the image of the item. Can be just about any type of image (including SVGs, which will be cached into WEBPs by ElectroSwap), IPFS or URLs.

We recommend using a minimum 1500 x 1500 image.
external_urlThis is the URL that will appear below the asset's image on ElectroSwap and will allow users to leave ElectroSwap and view the item on your site.
attributesThese are the attributes for the item, which will show up on the ElectroSwap page for the item. See more below
fee_recipient(optional) This is the creator defined address that will receive royalties (if defined) from secondary sales. See more below
seller_fee_basis_points(optional) This is the percentage of the sale price that will be sent to the creator as royalties.
Content Policy

Absolutely no adult, pornographic or NSFW content is allowed on ElectroSwap's NFT marketplace. Any content that violates this policy will be removed, and offending contracts will be blacklisted.

Attributes

To give your items a little more flare, we also allow you to add custom "attributes" to your metadata that will show up underneath each of your assets. For example, here are the attributes for one of the ElectroSwap Electric Legends:

{
...
"attributes": [
{
"trait_type": "Background",
"value": "Neon City"
},
{
"trait_type": "Character",
"value": "Bolt Vanguard"
},
{
"trait_type": "Clothing",
"value": "Combat Suit"
},
{
"trait_type": "Weapon",
"value": "Plasma Blade"
}
],
...
}

Rarity Rankings

ElectroSwap automatically applies a rarity ranking to NFTs listed on the marketplace. This ranking is based on the frequency of various traits across the collection.

How it Works:

  • The marketplace analyzes metadata attributes (e.g., trait_type and value pairs).
  • Traits with lower occurrence rates are considered rarer and are weighted more heavily in the ranking algorithm.
  • Rarity rankings are updated automatically when new tokens are minted or when metadata is updated.

Benefits:

  • Provides users with insights into the relative rarity of each NFT.
  • Enhances the visibility of unique and highly sought-after tokens within your collection.

IPFS

To ensure optimal performance and accessibility we recommend using the IPFS protocol:

  • Use IPFS pinning services such as Pinata, Infura, NFT.storage or 4everland to host your metadata and assets securely.
  • Provide IPFS links (e.g., ipfs://bafy...) for both tokenURI and associated images.
  • This approach ensures decentralization and enhances the longevity of your content.

Minting NFTs

We offer direct minting functionality within our marketplace for NFTs implementing the below IMintable interface. You can find the required interface specification in the provided IMintable.sol file.

Requirements for Minting:

  • Implement the IMintable interface in your NFT contract.
  • Ensure your contract adheres to the ERC-721 standard for compatibility.
interface IMintable {
// Returns the price of a single mint in ETN
// (padded with 18 zeros due to decimals not being supported)
function mintPrice() external view returns (uint256);

// Returns the number of tokens that can be minted by an account
//(ensuring the returned count does not exceed the max supply)
function mintableCount(address account) external view returns (uint256);

// Mints the specified number of tokens
function mint(uint256 mintCount) external payable;
}

Royalties

Creator defined royalty metadata fields are optional. If defined, the ElectroSwap marketplace supports and enforces creator royalties at the collection level using the following fields:

  • fee_recipient: The address receiving the royalty payments.
  • seller_fee_basis_points: The percentage of royalties in basis points (1% = 100 basis points).
Note

Royalties, if defined, apply to all post-mint secondary sales but at this time are configured on a collection basis, not per-token (subject to change).

Royalty configuration overrides may be requested by contacting our team.

Integration Details

  • Protocol: The marketplace operates using OpenSea's Seaport v1.5 protocol, ensuring robust and widely recognized transaction mechanics.
  • Automatic Indexing: Once minted, new NFTs are automatically indexed for seamless display in our marketplace UI.
  • Listing: Additional steps such as providing collection and banner images, and description are required for developers to list their collections.

Future Plans

While we currently focus on ERC-721 tokens, future updates will expand support to ERC-1155 and additional features based on community feedback and demand. We also plan to add support for animations and videos.

For any additional queries or technical assistance, feel free to reach out to our team on Telegram or X.

Happy building!