With custom function calls you’re able to do many things in your DAO, like buying NFTs, voting etc.

For the upcoming event for #maksimourhero the Marma J Foundation has added a number of minters to the store to create Valentine’s Day cards and the profit will go to Maksim in order to support his treatment. Amongst the minters, you can also find some DAOs. Let’s use this opportunity to explain how to mint NFTs directly from your DAO.

Set Up

To do that, we’ll need the JSON code, and in order to practice and avoid mistakes on the actual mint, let’s work on the Mintbase Testnet to get the necessary code. If this is the first time that you are working with Mintbase, I’d recommend this blog post which explains how to mint from a personal wallet, to get used to the interface and process.

Here are some links upfront, in case you don’t have a Testnet login yet:

NEAR Testnet Wallet

Mintbase Testnet

(login there with your Testnet NEAR wallet and create a store to practice)

Let’s Get Started

  1. Log in to the Mintbase testnet with your testnet NEAR wallet and go through the process of minting an NFT (make sure to use all the correct info/text, as this will be the template for the real NFT which will be minted):

  • uploading the image
  • adding the correct description for the image
  • adding the tags
  • add 2 splits (as you are currently using the Testnet, you can only add testnet wallets, which you can change before adding the custom function call to your DAO)
  • add more info, forever media, website as desired

 

2. Click on “mint me” once all the info is inserted

You will be redirected to your testnet wallet to confirm.

3. Click on “+ More information” (NOT approve) to get the JSON code for the custom function call

 

4. Click on the Function, in this case, “nft_batch_mint” to see the full JSON code

Congratulations! You have discovered the code! Copy the code from the first “{” to the last “}”

 

Some Explanations:

owner_ID: the owner of the NFT of that moment; add a nearname which is a minter in the store so they can list it after minting

reference: The hash of the NFT incl all the metadata

extra: the chosen categories from Mintbase (for ex. art, photography, VR, etc.)

num_to_mint: the amount of NFTs you want to mint

royalty_args: the split royalties of the NFT

split_owners: the split of the revenue/first sale

In both cases, the number behind the names reflects the percentage. 100% corresponds to 1000, so in our case tabear.testnet would receive 10%, chloe.testnet would receive 90% of splits and royalties.

 

5. Open the DAO that is supposed to mint in Astro in a new window and create a new proposal, choose the “Custom function call”

 

6. Add the following information:

  • Description: minting an NFT through the DAO (or similar)
  • Smart contract address: the address of the store where it should be minted. You can find this when you open the store on Mintbase, in this case, we have this example

 

  • Method name: nft_batch_mint
  • JSON: copy the code from step 3. and adjust it:
    • you can edit the number of NFTs
    • update the split addresses (in our case from the testnet accounts to maksimj.near & marmaj.sputnik-dao.near)
    • confirm the revenue & royalty split percentages (1000 = 10%; 9000= 90%)
    • Deposit: min. 0.0001 N (so it can be minted)
    • TGas: 0.3
  • Click on “Propose” once all the info is added

 

7. The DAO that is supposed to mint votes on the proposal

Now the DAO which has received the proposal and is supposed to mint the NFT will vote with its council. Once it got approved, the NFT is visible in the store (in this case the Marma J cards one).