Code Monkey home page Code Monkey logo

elven-nft-minter-sc's Introduction

NFT minter Smart Contract

Be aware that the Smart Contract doesn't have any audits. It has complete functionality for the first version but still needs some improvements. Test it first on the devnet/testnet.

You can use elven-tools-cli for deployment, setup and interactions!

You can use elven-tools-dapp as your frontend dapp for minting process! (NextJS based app with 4 auth providers)

Also check elven-tools-sft-minter-sc - SFT minter and vending machine smart contract

What is it?

You are reading about the Smart Contract designed for the MultiversX blockchain. Its primary purpose is to provide a simple logic for minting and buying a previously configured collection of NFTs. It does it in a randomized way. Version 1 of it supports:

  • issuing the collection token
  • setting the proper roles
  • pausing/unpausing the process
  • random mint and distribution
  • minting multiple NFTs in one transaction
  • giveaway options + multiple addresses distribution in one transaction
  • possibility to split the process into drops (waves/batches). It is named 'drop'
  • configuring the allowlist, populating from a file or providing by hand
  • claiming the developer rewards
  • changing basic setup where it is possible
  • and more...

Start here: Elven Tools Jumpstart

Check the abi file for more information.

Also, check how simple it is to deploy and interact with it using elven-tools-cli.

Check out possible workflows

Examples of how you can configure your Smart Contract in a couple of scenarios and how to use the CLI to do this faster and more efficiently: www.elven.tools/docs/elven-tools-workflows.html

All endpoints with short descriptions

For all commands, check out the docs: www.elven.tools/docs/sc-endpoints.html

Other ways of using it

You can always clone it and change it as you need. The best is to use the Elven Tools CLI tool, which can also be configured after changes. But nothing stops you from using the mxpy. It is all up to you. Of course, you will need to do more work when using the mxpy.

Tracking the progress

Contact

You may also like

  • Buildo.dev - Buildo.dev is a MultiversX app that helps with blockchain interactions, like issuing tokens and querying smart contracts.
  • elven.js - simplified wrapper over JS SDK, designed to work as a plug-n-play solution for browser based use cases. No build steps and frameworks, just one file to rule it all! Check usage examples!
  • NFT Art Maker - generates images and metadata files and packs them into CAR files, all from provided PNG layers.
  • Buildo Begins - CLI toolset for interacting with the MultiversX blockchain, APIs and smart contracts
  • Export collection owners to CSV

Issues and ideas

Please post issues and ideas here.

License

MIT + GPLv3 (MultiversX tooling)

elven-nft-minter-sc's People

Contributors

dorin-iancu avatar juliancwirko avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

elven-nft-minter-sc's Issues

Token amount limit per address per drop

  • there is a problem with the general limit per address when we have the mint process split into drops
  • when the drops are set, there should be a limit per drop
  • think how to do this best not to mess the code too much

Check the impact on performance if the initial shuffle is moved to the issue_token callback

Because of performance improvements, we have some tradeoffs in the user experience. For example, we are forced to run the initial shuffle function. There were changes in the logic, and maybe it could be moved to the init. It shouldn't consume much more gas, and it shouldn't be a problem when SC is upgraded. But it needs a couple of tests.

edit: consider moving it to issue collection token callback maybe?
edit: it will be probably moved to issue_token callback, seems to work ok like that

Additional entries in the URIs/Asset section

The only assets, for now, are the ipfs schema with the base CID and the image file name, and additionally, there is an ipfs gateway URI with the same CID and image name.

Some marketplaces require additional Assets/URIs entries like metadata JSON or collection JSON files. IMO this isn't a place for them. The metadata file for the image is encoded in the attributes, and it can include all additional URIs inside.

But I could implement it as an option. Should it be implemented? Can someone explain why marketplaces require that?

populateIndexes - investigate new ElrondNetwork repos

There is a lot of new code in the ElrondNetwork organization. The core team started work on a more advanced minter smart contract, similar to this one, but of course, there will be a lot more stuff. There is an excellent way of getting the random indexes for the minting process (at least from what I understand):

It would be good to do some research on that. It will probably remove the need to have the populateIndexes calls for initial setup.

edit: newest elrond-wasm has UniqueIdMapper the same which is used in the sc-nft-minter

[Docs] on Elven Tools workflows

There is a couple of ways of creating the collection sell and distribution. There should be a longer explainer article. Topics:

  • allowlist
  • drops
  • giveaway
  • pausing
  • changing prices
  • limits per address (per drop)

Mint left NFTs

If there are only 5 NFTs left to mint and you mint 6 NFTs at once the transaction will fail.
The mint should loop through each mint and check if's available for minting. Or this will trigger more gas fees?

[Docs] with examples on how to use it with erdpy

It would be good to have a docs section on elven.tools website with examples written for erdpy CLI usage for every endpoint and query. This will also be a perfect occasion to test all of them with erdpy properly.

Just a reminder: It is much simpler when you are using the CLI

Clearing storage when setting new drops is not optimal

There is a bug related to a setting or unsetting drops. The logic assumes that it will clear related storage, but it takes too much gas when there are many items already.

Until solved, the functionality of the drop will be unusable (with CLI in most cases, without the CLI, it can work for drops with a small number of tokens and adjusted gas limits)

The 'pause and resume minting' functionality could be used as a temporary workaround.

2 new things on explorer

I use elven-tools nft-minter , the problem is on explorer for collection now appear 2 more things Rarities and Attributes there u have a link : https://explorer.multiversx.com/nfts/STAFF-1b295e-13

And there is my explorer thing : https://devnet-explorer.multiversx.com/nfts/NATURE-bc41aa-02

u can do something about that , a little update for that creator , i use windows and i like more to work on windows than ubuntu and i don t know at all to use mxpy or erdpy cuz i started learn what u created there :))

Be able to mint from the creator wallet without paying the mint fee

It would be nice if you are trying to pre-mint a collection to be able to mint all the NFTs from the creator wallet not having to pay the mint price as it just gets sent to the same wallet (and royalties).

Maybe a CI flag or something? Happy to see if I can implement it, but I am very unfamiliar with rust.

Thanks for your work so far. It's awesome.

[Improvement] Ability to turn on minting for owner only (not public mint)

I had a use case that I needed the ability to turn on minting, but only want the owner of the collection to be able to mint. This is because we have a controlled collection that I don't want to be publically purchasable (yet). I went ahead and coded that functionality into the SC & the CLI as commands.

I'll attach a PR so you can check it out. I am not in love with my naming convention...

Adjust the SC for elrond-wasm 0.29.*

A separate issue because the SC would need some more work and tests. I think the sha256 custom logic could be removed and replaced with self.crypto().sha256_legacy_managed::<>(), but it will need some tests.

Upgrade SC

Hey @juliancwirko, I am using the minter SC since April and I wanted to upgrade it to the new version.

To do so I have to update is in .elventoolsrc with the version I want to target

{
    "chain": "mainnet",
    "nftMinterSc": {
        **"version": "v1.10.0",**
        "deployNftMinterSC": "erd1qqqqqqqqqqqqqpgq......."
    }
}

And then I have to trigger the init endpoint with elven-tools nft-minter init ?

Is it the only things to do ?

Make sure that the api's metadata and media are properly generated for the NFT

The Elrond's API service will take the data from the metadata JSON file and recreate the metadata object to be returned when calling the nft API endpoint, similar to the custom ipfs gateway and media object. The process is probably optimized and delayed. They won't be created after the NFT was created but after some time. What should be done here is good research on the API repository to be 100% how it works precisely. There are also probably differences between different NFT endpoints (id, search, etc.).

If someone has more info about that, please jump in.

Token amount checks for giveaway endpoint

  • giveaway endpoint is only for the owner, but it doesn't respect the limits per address, so it needs some checks and improvements for big amounts in one transaction because it will reach the max gas limit per one transaction - it should be probably also improved for the standard mint endpoint. Something around 55 tokens per one transaction should be ok. So it will likely be never reached because most of the collections will add lower limits than that. But it should adequately handle that.

Prepare init for contract upgrade

  • review the initial mappers' setup
  • add set_if_empty instead of set wherever it makes sense, not to overwrite these when upgrading, for example, cids, provenance, etc.

[critical!] Shuffle mechanism optimization required

The shuffling mechanism requires some optimization or a different approach because there are problems with gas when there are a lot of minted tokens already. It works well initially, but when there are more and more tokens minted, the mint endpoint starts to fail.

[important] Changes in populateIndexes required soon!

https://stackoverflow.com/questions/71108759/vecmapper-extend-from-slice-differences-between-testnet-and-devnet

There are some limitations regarding Rust's dynamic allocation, which can cause some sc calls to fail. We recommend using managed types instead, which only allocate memory inside the VM, or use static buffers.

The simplest and fastest solution is to use only VecMapper and 'push', which will consume over twice as much gas. As a temporary solution, it should be a quick fix.

Claim royalties from marketplaces?

Question: How do marketplaces manage royalties? Shouldn't they use sell_nft, which is design for that?

For now, this smart contract is open for taking royalties and has an option to claim the funds on it (by owner only), but if marketplaces don't send them automatically, we are missing a claim_royalties_from_marketplace endpoint. IMO, the contract owner should think only to make the contract payable. Otherwise, the owner of the contract needs additional logic to get royalties.

How do marketplaces manage that?

Tests

  • automated tests are required

waits for black-box testing docs (??)

Change Royalties [Optional]

It would be great to change the royalties, if it's possible on Elrond chain and it's not encoded on the SC at deploy.
But also make a limitation, to avoid very high changes after the launch.
If it's set to 20% at deploy, you can change it only 1-10% after that.

Remove the gateway entry and leave only the ipfs:// schema based uri

For now, in the assets in the explorer, there are two uris for the same image. One with the ipfs:// schema and one with the ipfs.io gateway. I think it is worth removing the gateway entry and leaving only the ipfs://schema-based URI. There are at least three reasons:

  1. There is an Elrond gateway anyway, so everyone can use it or take the cid and use a different gateway.
  2. The Explorer is now supporting previews also for the ipfs:// based uris (on hover)
  3. It is misleading for many people. They see one gateway, and then there is another one after mint. With the ipfs:// based uris, it will be more precise.
  4. It will also be better for the SC because the performance will be better.

Cons:

  1. You won't be able to click on the link in the assets section in the explorer. You would need to use the gateway with the displayed CID.
  2. Again, I don't know what with marketplaces. They shouldn't rely on the assets link as a whole. They should have their logic for that.

How i can add these things ?

Hi sorry to open the topic again, how do I add the stuff in the picture (Social, Atributes and Rarites)
And if you can't use what you have created for the moment, do you think you can make an update please?

Soon I want to get a collection of NFTs, and I would like to add these because I don't know how to use mxpy or erdpy, no matter how hard I try to install them there are a lot of problems .....

image
Link :
https://explorer.multiversx.com/nfts/COW-cd463d-16af

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.