πŸ‘‹ Looking for advice for a ERC721 smart contract

Hi everyone,

As mention in the title i'm looking for advice to build an NFT ERC721 smart contract for an NFT collection. I hope this topic can help a lot of peoples !!

My goal is the smart contract to be gas efficient and safe with those features:

Ownable / Pauseable

.1 - There will be 2 sales, one pre-sale for whitelisted and a public sale they'll be a week apart, so I have to set up two prices and two max amount per wallet.

Do I have to specify this on the SC ? Or can I just change the price as I'm the owner ?

.2 How I can see in advance how much the cost of deployment of the smart contract?

.3 In the future I would like to create Airdrops for the holders

Do I need to specify this in the SC, or I can just look for the wallet holders on Etherscan to do so ?

.4 I need to keep 50 NFT from the sales for giveaways, etc?

If there’s someone experimented and available to review the smart contract, let me know.

Thank you in advance !

1- you can use the standard nft contract, and create 2 contracts 1 for public pre-sale and another for private, and in them you establish their characteristics and prices

2- the implementation cost you can see when you try to implement the contracts

3- For an airdrop of holders you could several tools, from oracles, to do it manually

4- those nft you can keep in a wallet

Thank you @asmel, ok I've see the cost of deployment

Is there a more simple way such as adding the both type of sale in the smart contract with the ability to switch one of them off with a true or false function ?

For the withheld of the 50 NFTs I meant: from the smart contract minting the first 50 automatically during the smart contract deployment to the owner wallet.

Of course, you can create a contract that has 2 functions for the 2 pre-sales, already in the contract you establish your own business logic.

You can save the nft in the owner's wallet or wherever you choose

but if what you want is to do everything within the nft contract, you can do it, I do not recommend it, it is a better practice to separate everything

Why is that, safety related ?

This is for an NFT collection, 2 smart contracts for pre-sale and public sale but will this create two collections? How will it work for the connection with ipfs ?

No, the contracts will only be to send the nft deposited in the contract to the person who bought them, it is not generating another collection.

not if you know what you do you will not create security problems, only that it separates the contracts in a very good practice

1 Like

But as I told you before, it all depends on your business logic and experience in creating smart contracts.

@asmel Ook I see, thank you for your knowledges !! :+1:

1 Like

if my help was useful, you can mark the issue as solved

I would avoid any manual steps like "come back in a week and change the price"; do it in code.

A 721 was one of the first contracts I ever wrote and I did not have a lot of trouble with it though I discovered later that I had made several noob mistakes but I kept learning.

I strongly recommend the openzeppelin imports and their contract generator.

I've had vastly more trouble with solc versions than with contracts, I got mine to deploy after three days of work and an absolutely unsuitable hack.

2 Likes