ElvenTools / elven-nft-minter-sc

Elven Tools NFT Minter Smart Contract - launching NFTs collections on the MultiversX blockchain
https://www.elven.tools
50 stars 32 forks source link

Clearing storage when setting new drops is not optimal #28

Closed juliancwirko closed 2 years ago

juliancwirko commented 2 years ago

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.

juliancwirko commented 2 years ago

It should be fixed on the development branch. The new version will be published soon.

Solution: Because one Smart Contract instance is used for one collection, there is no need to clear MapMapper on every new drop setup. This operation is way too expensive. It is why each MapMapper for each drop will get an id from now. Remember that still, only one drop can be active at the exact moment. Additionally, all SetMappers were replaced with SingleValueMappers because there was no need to use SetMappers.

juliancwirko commented 2 years ago

published