How to submit a JPG NFT project?

金色财经 view 64208 2021-12-27 09:30
share to
Scan QR code with WeChat

This year, the popularity of NFTs has increased, and more jobs have been created and communities have been created around them.

To show their confidence or support for a project, many users choose to convert their profile picture (or "PFP short") to JPG in their NFT print. This makes it easy to identify these users as members of the community, and to have / share NFTs with different / less useful features not only to improve the quality of NFT, but also for the benefit of the community.

In fact, OpenSea, the popular NFT software industry, has seen exponential growth in user numbers and sales, in part due to the rise of art-based NFT PFPs.

By the end of this tutorial, you should understand how to create a set of charts programmatically using layers (especially NFT values ​​/ values ​​used to make a PFP project). , note the characteristics of the picture, then put everything together. of photos. Your community chained. It also describes some scam techniques to watch out for when designing an NFT project and some security commitments to consider.

To learn more, see codebase 409H / sample_nft_project at https://github.com/409H/sample_nft_project#sample-nft-project.

1. Develop the process

First we need to describe the process / features that we will be using in our project so that we know how to create the image. For this template, we are going to create a simple project with several different layers / features.

head type

head color

eye colour

eye shape

get up

nas hom

First we will create different types of heads: round, square and triangular options, with different colors.

First of all, you need graphic design software. For this project I used "8-bit Painter" and the canvas size is 16x16 (open grid).

The joint 0,0 (i.e. the horizontal and vertical intersections of the center) refers to the center of gravity. This will allow you to create another layer of the canvas, spaced from the head (the main layer of the image).

怎么部署一个JPG NFT项目?

In the image above, you can see our (process) names: 00head, 01eyes and 02mouth. The head forms the base layer of the image, and the eyes and mouth are programmatically layered above the head layer, eliminating the need to manually create each image with all of the different layers.

Remember that this is an example. There aren't many visual effects to make it look good, and there aren't many variations of the intended features. .

Each layer (except the head) has a transparent background and the same canvas size, so the images are single and evenly spaced.

Once all the other layers and transitions are done, you can start writing numbers to create the final image and write special captions for each image. name each layer

__.png

This is intentional because it helps you create a spreadsheet for each image. If you use the same code to create your own project, you must run the "Composer Run Test" to run the test on the name of the image file.

2. Combine the layers

Now that your project has the layers you need to release the final image, you need to write the numbers to give this process and add the few to your project. For example, some jobs have a "rare" attitude. This means that only part of the final image has a "burn". In our case, we will not control the rarity of everything and the layers will be selected randomly.

For this I wrote some PHP code and used the images as GD library for graphics. The final numbers might not be pretty (can't wait to use PHP's rake), but it works as needed to create the image.

There are 4 hair types, 4 hair colors, 3 eye colors, 2 eyes, 2 mouth colors and 1 inner mouth.

When code shares layers in a process (which randomly selects layers for n iterations), the code creates JSON objects required by the interface (like OpenSea) to launch. The latter is stored in the baseURI at contract level.

怎么部署一个JPG NFT项目?

3. Create an NFT smart contract

In general, NFT contracts generally adopt the EIP-721 standard, which is the standard for some regulations. These rules describe the job list, job list and type of job resumption and ensure that the use / enforcement of the contract works properly as the product is only intended to write code according to these standards without having to stand by. worry about the product when calling. Render a graph (or query contract) to get information such as “How many NFTs are in address 0x11b6A5fE2906F3354145613DB0d99CEB51f604C9 in this contract?”.

There are several basics and tools that can help you deliver EVM based blockchain contracts; We will use Remix to distribute NFT contracts and set up contracts allowing NFT purchases. It is EIP-721 compliant, which makes it ready for use in two markets such as OpenSea.

You can use OpenZepplin Wizard and Remix to update your engagements. Follow Andrew B Coathup's instructions to send Rinkeby testnet for this job. (Then when you're sure you want to spend real money, you'll send it to the mainnet.)

怎么部署一个JPG NFT项目?

Special contracts can be added to allow users to remove certain NFTs (except for unauthorized EIP-721 features, but you can add as many as you want to the total of end contracts).

We need to modify the code created by the wizard to set a limit for the mint () call time. There shouldn't be more cast time than the number of unique graphics we've previously generated. Note: You must subtract 1 from a number because of zero-based indexing (which means the number starts at 0, not 1).

sol uint immutable maxSupply; Constructor (uint _maxSupply) ERC721 ("NFT Example Project", "SNP") 

怎么部署一个JPG NFT项目?

When submitting a contract, you must enter the maximum amount that can be provided (the number of unique images that have been previously published) in the design. This means that each mint () has an image and a character.

The advertising function of the NFT is generally paid for by the user. This means that in order to receive NFTs, the advertiser must submit ETH to the contract. To this end, we will add new positions to the contract which will be issued at a rate of 0.01 ETH. ETH will remain in the contract until the contract owner calls the new alternative "delete ()". You can set whatever price you want, and keep in mind that some items may offer free coins as well.

function sol mint () public payable 

After submitting a contract to Rinkeby using the init parameter, you can call mint () to NFT.

Create a contract: https://rinkeby.etherscan.io/tx/0x46ce4ad1cacae757ee12252b5e214509d829bcc0626aaf325965ae99b5249f74

Casting NFT : https://rinkeby.etherscan.io/tx/0x4d4102264edfe4aee9a58d1cbc405b0e5b308708c92ffce5413d80459e0e7c1c

Claim ETH: https://rinkeby.etherscan.io/tx/0xb6eb339e065c9cb573af2496cef3d2ca67e9b9852c08b2492e9eaed11cbc3bbd

Now that you have created the contract between the strings (0xab9d2c623ec60a60a08a87e22adc83b91a486f2c) and NFT (with flag 0), you can use the OpenSea endpoint to use the metadata data.

Then you can see NFT and all the features of NFT in OpenSea!

怎么部署一个JPG NFT项目?

4. Review the contract

Blockchain browsers like Etherscan now display the contract because it has been transferred, but only the bytecode until you confirm the contract. Sometimes this is a manual process, but tools are available to do it at the time of referral. When the contract carries another contract from the OpenZeppelin repository, we will use a powerful tool called truffle-plugin-design to save time.

Recognition of the contract makes it more readable because stable laws are enacted to prevent researchers and individuals from more easily accessing the logic of the contract. Because everyone has a common understanding of the rights behind the project, it builds trust with the community and the developers.

Create a new .env file, add an API key for Etherscan and QuickNode, then select [For testing purposes only! ! ] The key phrase refers to the use of the Rinkeby testnet contract and the use of the two contract confirmation commands.

truffle shell migrate --network rinkeby # Provide a contract to Rinkeby using the truffle truffle.

5. Order before shipment

If you follow the sample_nft_project repository:

related images

Add more graphic images to the image_raw directory and name the files correctly.

As rarity / uniqueness is not currently in use, please read the PHP script to make sure that the final image and features are suitable for you.

Secure and reliable hosting of image metadata is essential. If it is held by your own registrar (in this case the recording is held at harrydenley.com) you run the risk of the image not being resized. Some sites recommend using IPFS to store data.

smart contract

You need to change the metadata endpoint to where the metadata is hosted.

You need to change the contract name and symbol to something that affects your project.

Make sure you are happy with the price of each DTV, and if not, change the price.

When submitting the contract, maxSupply should be set to the highest number in the image_processed directory.

Use Remix with JavascriptVM or doctor on web3 by clicking on Rinkeby to not try to spend real money.

5. Attention after release

You can add / modify features to the contract, including changing BaseURI (where metadata is stored), so it's best to set this value or call renounceOwnership () later. point everything to the server and change the final result to the "NFT public" event. Especially if the metadata on the intermediate server (ie not on "immutable" servers like IPFS, Arweave, etc.) someone accessing the server can modify it. change the behavior and occurrence of NFTs.

Consider calling renounceOwnership () when the shipment reaches its maximum value (the price specified in the manufacturer when the shipment ships) and remove the ETH from the contract. As the TVNs are regulated, membership of the contract is no longer required.

This smart NFT contract is not modified and requires ETH in exchange for NFT, which can lead to an "oil war", especially if NFTs are highly anticipated.

We also looked at how developers receive the ETH they pay for NFTs. Instead of adding logic to pass the ETH payment to the owner's contract when calling mint (), we've added another option to call delete () so the owner can call it at any time. This means that the fuel limit (and the exchange rate) for non-DTV consumers will be lower.

Buying and selling NFTs can be fun, but creating your own NFT project can be difficult. Hope this gives you some insight into this process!

btcfans公众号

Scan QR code with WeChat

Disclaimer:

Previous: BIS: Embedded Supervision: How to get involved in Blockchain Finance Next: Snapshot 2021: End-of-year memory of the encrypted world

Related