Freee Docs
  • Guide
  • Getting Started
    • How do I connect my wallet to Freee?
    • How do I mint on Freee?
    • Gas Fees
  • Freee Create
    • What can I create on Freee?
    • Single-Edition (ERC-721)
      • How to create a Edition
      • Managing your Edition (ERC-721)
    • Drop (ERC-721)
      • How to create a Drop (ERC-721)
      • How to set up the artwork folder for your Drops collection
      • How to set up the .csv file in your Drops collection
      • Managing your Drop (ERC-721)
    • Collection (ERC-721)
      • How to create a collection (ERC721)
      • How to upload collection artworks?
      • Managing your Collection (ERC721)
        • Manage Sale Stages
        • Manage Pre-reveal & Reveal
        • General Settings
      • Others
        • In depth outline of collection artworks folder
        • In-depth Outline of collection metadata CSV
    • Multi-Edition (ERC-1155)
      • How to Create a Multi-Edition
      • Managing your Collection (Onchain)
    • More Features
      • How can I create an Airdrop?
      • How can I create an Allowlist?
      • Receive blast rewards
    • Create FAQs
      • Can I connect a multi-sig wallet?
      • How do I use a split contract with my collection?
      • How do I withdraw my earnings?
      • Do I have to pay a fee to collect my earnings?
      • Can I add a custom payout address to my collection?
  • Smart Contracts
    • Deployed Contract Addresses
      • Mainnets
      • Testnets
    • Smart Contracts Event-based Overview
    • 1155 Contracts
      • Creating a Contract
      • Creating a Token
      • Selling a Token
      • Minting Tokens
      • Permissions
    • 721 Contracts
      • NFT Creator Factory
      • NFT Implementation
      • Edition Metadata Renderer
      • Drop Metadata Renderer
      • Collection Metadata Renderer
  • Freee Platform Fees
  • Create, share, and collect to earn
    • Understanding Rewards on Freee
    • How to create to earn
    • How to share to earn
    • How to collect to earn
    • Diamond Rewards Chart
  • Freee FAQs
    • Why can't I mint from a collection ?
    • Why can't I see my minted NFT(s) ?
    • Why did my mint transaction fail ?
  • Legal
    • Privacy Policy
    • Terms of Service
Powered by GitBook
On this page
  • Fixed Price Sale
  • Merkle Sale
  • Royalty
  • Withdrawing Funds
  1. Smart Contracts
  2. 1155 Contracts

Selling a Token

PreviousCreating a TokenNextMinting Tokens

Last updated 1 year ago

Once a token has been created, it can then be put up for sale.

Minter strategy contracts are separate contracts that hold minting logic, but the main 1155 is called for minting.

Check out the [minting](./Minting Tokens.md) section to learn more about minters.

View the list of deployed contract addresses .

To create a sale you must use the callSale function on the 1155 contract.

This will set the sale in the appropriate minter.

function callSale(
    uint256 tokenId,
    IMinter1155 salesConfig, // Minter Strategy Contract
    bytes memory data
) 

The data that is passed into the minter is used to call the setSale function.

Each minter has a unique salesConfig.

function setSale(uint256 tokenId, SalesConfig memory salesConfig) 

Fixed Price Sale

Calling callSale on an 1155 contract will create a sale for an NFT, but the FIXED_PRICE_SALE_STRATEGY address must be specified.

The salesConfig for a fixed price is structured as follows:

struct SalesConfig {
    uint64 saleStart; 
    uint64 saleEnd; 
    uint64 maxTokensPerAddress; 
    uint96 pricePerToken; // Price in Wei
    address fundsRecipient; // Where to send the funds
}

Merkle Sale

Create a allow list sale with a Merkle proof.

Note, the price and the max mint amount per address are specified when creating the Merkle tree.

The Merkle sales config is as follows:

struct MerkleSaleSettings {
    uint64 presaleStart;
    uint64 presaleEnd;
    address fundsRecipient;
    bytes32 merkleRoot;
}

Royalty

Royalties are set on the main 1155 contract.

  • royaltyBPS: The royalty amount in basis points for secondary sales.

  • royaltyRecipient: The address that will receive the royalty payments.

struct RoyaltyConfiguration {
    uint32 royaltyMintSchedule;
    uint32 royaltyBPS;
    address royaltyRecipient;
}

This can be set at both the contract and token level.

function updateRoyaltiesForToken(
    uint256 tokenId, 
    RoyaltyConfiguration memory newConfiguration
)

Withdrawing Funds

Admin can withdraw all funds to the msg.sender.

function withdrawAll() public onlyAdminOrRole(CONTRACT_BASE_ID, PERMISSION_BIT_FUNDS_MANAGER)

Admin can withdraw a certain amount to a specific address.

function withdrawCustom(
    address recipient, 
    uint256 amounts
) public onlyAdminOrRole(CONTRACT_BASE_ID, PERMISSION_BIT_FUNDS_MANAGER)
here