0

I was going through the Opensea Creatures factory contract. But I couldnt find why the Transfer event is emitted NUM_OPTIONS times? What is the relevance of NUM_OPTIONS here?

function fireTransferEvents(address _from, address _to) private {
        for (uint256 i = 0; i < NUM_OPTIONS; i++) {
            emit Transfer(_from, _to, i);
        }
}

Tried searching for the answer, the only hint available was a question posted on ProjectOpenSea Github issues page, but that didn't answer the query at all. Any idea?

1 Answer 1

0

In the factory contract of OpenSea (CreaturesFactory.sol) there are three options

  • 0: Mint one random NFT
  • 1: Mint NUM_NFTS_IN_MULTIPLE_NFT_OPTION random NFTs
  • 2: Mint one LootBox

For options 0 and 1 the NFT contract Creature is called for each NFT to be minted

For option 2 the lootbox NFT contract CreatureLootBox is called for creating a lootbox NFT (the lootbox NFT represents the right to mint 3 random NFTs)

If you display the factory contract in OpenSea you do not see any NFTs but only these three options. And the contract creator ist the owner of these three options. From OpenSea the three options are handled like NFTs in the real NFT contracts, but there are no NFTs minted for the three options.

For what the event for each option is needed I don't know. Maybe OpenSea uses them? Can somebody answer this question? I would appreciate a answer

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.