Search code examples
blockchainweb3jssolananftmetaplex

Split money on minting between more than one wallet solana metaplex & candymachine


I am new to blockchain and i am trying to play with blockchain so I used metaplex and candy-machine to upload and mint dummy nft's which is working fine. The opensource repositories that I am playing with are below:

https://github.com/metaplex-foundation/metaplex https://github.com/exiled-apes/candy-machine-mint

Then for learning purposes, I wanted to divide minting and secondary sales into more than one wallet so I changed JSON and added three test wallets into the creator's array.

{
  "name": "#0",
  "symbol": "%$%",
  "description": "description goes here",
  "seller_fee_basis_points": 500,
  "image": "image.png",
  "external_url": "",
  "edition": 0,
  "attributes": [
    {
      "trait_type": "Background",
      "value": "Street"
    }
  ],
  "properties": {
    "files": [
      {
        "uri": "image.png",
        "type": "image/png"
      }
    ],
    "category": "image",
    "creators": [
      {
        "address": "<public address 1>",
        "share": 34
      },
      {
        "address": "<public address 1>",
        "share": 33
      },
      {
        "address": "<public address 1>",
        "share": 33
      }
    ]
  }
}

But the problem is splitting is happening on secondary sales and not on minting. On minting the wallet set as treasury resource is getting all amount. I want to split the transaction amount on minting too.


Solution

  • Interestingly, I found this quote in the metaplex documentation:

    The SPL Metadata program supports storing up to five co-creators that share potential future profits from sales for the items as defined by seller_fee_basis_points . Each creator needs to be added as part of the minting process and is required to approve metadata that was used in his name using the sign_metadata endpoint. Unverified artwork cannot be sold with Metaplex.

    During the first sale, creators share in 100% of the proceeds, while in follow up sales, they share in proceeds as a percentage determined by seller_fee_basis_points. Whether or not a metadata is considered in second sale or not is determined by the primary_sale_happened boolean on the Metadata account.

    My interpretation of this is that the expected behavior should be for the initial sale to get divided between creators using the ratios defined by each creator's share. Sounds like you're experiencing something different.

    Keep in mind that this documentation is for the parent project. Candy-machine-mint seems to be a fork and they may have altered some of that behavior.