当前位置:网站首页>Development, deployment and online process of NFT project (1)
Development, deployment and online process of NFT project (1)
2022-06-26 15:45:00 【NFT practitioner】
This article will start from the contract 、 Back end 、 The front three aspects describe how to NFT Try to be fair in the offering stage , Try to make real users Mint success . The structure of the article is as follows :
One 、 contract
NFT The most discussed issues in the sale of are summarized as the following :
Prohibit contract invocation
If the contract allows other contracts to call Mint , That big probability will become a stage for scientists to show their operations . Even if each address is limited, the desired number of addresses can be created through the engineering contract Mint.
Means of prevention : By judgment TX Whether the originator of the request and the source of the request received from the offering contract are consistent , Whether the call comes from other contracts . Such as Azuki Medium verification as follows :
notes : About msg.sender
and tx.origin
Examples of differences can be found in Phishing with tx.originhttps://solidity-by-example.org/hacks/phishing-with-tx-origin/
White list verification
There are two common white list verification methods :
White list of contract records
For a small number of white lists or for Merkle tree Less familiar project parties may adopt this approach , The advantage is that the logic is simple , Can be added or deleted at any time . The disadvantages are obvious , That is, the project party needs to pay the cost of modifying the whitelist data . Such as Azuki You can set the whitelist address and corresponding quantity in batch ,gas Consumption quantity can refer to seedAllowlist Tx .
Example :Azuki seedAllowlist
verification Merkle Proof
The most common and recommended method is contract verification Merkle Proof, Generated under the submission chain Proof Verification in the contract . This scheme has been verified many times , Can fully meet the actual needs , In addition to verifying the whitelist address, you can also add Mint Number 、 Airdrop quantity and other information .
Mint In the process, the user gets Proof The method can be used API Or will Merkle Tree Make it public for users to obtain , The following resources provide API An example of .
There are many ready-made schemes for reference , Resources are as follows :
- Video tutorial : OpenZeppelin Building an NFT Merkle Airdrop
- Library: Merkletreejs Library
- Demo: nft-merkle-drop
matters needing attention :
- White list address judgment : Some project white lists are in vain and have not been verified in the contract .
- White list Mint Quantity judgment :Mint The quantity shall be recorded in the contract and the address shall not be used balanceOf Judge , Otherwise, the white list will be repeated Mint The problem of .
Signature parameter verification
For the public offering stage ( Non white list ), Generally, parameter verification is used to verify whether the user data is legal , From the past cases, the following problems often arise :
- Uniform parameter value all users use the same parameter value for verification , This will reduce the difficulty of robot batch operation .
- Parameter pre exposure as the name suggests, when scientists get the validation parameters in advance , There is enough time to prepare the robot .
- Although private key leakage rarely occurs, it should also attract the attention of the project party , Do not expose the private key on the front end , The signature process and parameter generation process are executed on the back end .
Parameter verification , Recommended development mode : The development mode recommended in the parameter verification section generates different call parameters for each address , To prevent replay attacks .
The resources :
- Openzeppelin Of
ECDSA
library: Checking Signatures On-Chain - solidity-by-example: signature-replay
We will discuss the following two issues in the back-end chapter
Contract closed source
In order to reduce the possibility of contract being attacked or abused, the project party chooses not to disclose the contract source code , Not just in NFT Field in GameFi The same is true in the project . If this is taken as a defensive means, it can not prevent robot operation very well , Illustrate with examples :
SuperGucci use Contract closed source For sale , Its parameters are relatively simple, so it is inevitable to be broken by smart scientists , It's just a matter of time . Finally, scientists took away too many chips , And had to adjust the last round to be sold by lot . From the call data on the chain, we can see that the parameters are independent of the address , No other special parameters , Therefore, it is possible to replay calls with the same parameters for such contracts .
I don't recommend this way to sell , For no known IP Projects that are not open source do not give users enough confidence , Again, this is not at all Crypto .
It is a complicated problem to realize a truly fair sale , The project side may not be able to put most of its energy on the technical level . In the foreseeable future , There will be a relatively perfect sales platform, so that artists or project parties only need to pay attention to the work level , Without having to face the difficulties of technology .
NFT The sale of is just NFT Part of the project , In addition to the above precautions, there are many details worth paying attention to , For example, the setting of royalties 、 Contract and front-end and back-end testing 、NFT Metadata Deployment of 、 Randomness and rarity of attributes 、 Fairness of open graph 、 also NFT Design of pledge mechanism 、NFT Design of derivatives, etc .
I wish you all Mint To what you like NFT.
边栏推荐
- Applet: uniapp solves vendor JS is too large
- Seurat to h5ad summary
- NFT 平台安全指南(1)
- IDEA本地代理后,无法下载插件
- 面试高频 | 你追我赶的Flink双流join
- Is it safe to buy stocks and open accounts through the QR code of the securities manager? Want to open an account for stock trading
- 【TcaplusDB知识库】TcaplusDB单据受理-创建游戏区介绍
- PHP file upload 00 truncation
- 【leetcode】112. Path sum - 113 Path sum II
- 北京房山区专精特新小巨人企业认定条件,补贴50万
猜你喜欢
音视频学习(三)——sip协议
svg上升的彩色气泡动画
Restcloud ETL resolves shell script parameterization
【TcaplusDB知识库】TcaplusDB单据受理-创建游戏区介绍
如何配置使用新的单线激光雷达
1. accounting basis -- several major elements of accounting (general accounting theory, accounting subjects and accounts)
svg野人动画代码
效率超级加倍!pycharm十个小技巧就是这么神
【ceph】mkdir|mksnap流程源码分析|锁状态切换实例
JVM笔记
随机推荐
How to handle 2gcsv files that cannot be opened? Use byzer
IDEA本地代理后,无法下载插件
【ceph】CephFS 内部实现(三):快照
selenium将元素保存为图片
Secure JSON protocol
canvas三个圆点闪烁动画
评价——模糊综合评价
Compile configuration in file
手机上怎么开户?在线开户安全么?
[tcapulusdb knowledge base] tcapulusdb system user group introduction
feil_ The working directory on the left of uvission4 disappears
【TcaplusDB知识库】TcaplusDB常规单据介绍
Particle filter PF -- Application in maneuvering target tracking (particle filter vs extended Kalman filter)
Seurat to h5ad summary
js文本滚动分散动画js特效
JVM笔记
Function: crypto JS encryption and decryption
[CEPH] Introduction to cephfs caps
# 粒子滤波 PF——三维匀速运动CV目标跟踪(粒子滤波VS扩展卡尔曼滤波)
[graduation season · advanced technology Er] what is a wechat applet, which will help you open the door of the applet