当前位置:网站首页>NFT contract basic knowledge explanation

NFT contract basic knowledge explanation

2022-06-26 15:51:00 NFT practitioner

  One 、 Find a contract , I know there are two ways

1. Press... Directly on the official website f12 Open developer mode , then shift+f Find keywords address,contract etc. , Here we use apemfers.com For example ( This method is also applicable to those who are looking for non open source contracts ABI)

You can also find the logic of the lottery here , If you find that it's just at the front js Those verified can participate in the lottery with the new wallet , Of course, this requires some code reading ability , I won't go into details here .

2. adopt etherscan Search for , You can find the contract here ( Special attention required , A fake contract may be found this time , Please pay attention to self identification )

Let's find out LilHeros For example ,0xd78b76fcc33cd416da9d3d42f72649a23d7ac647 It's the contract address . We look for by name ( You can also find through other , For example, the total number , Price etc. ), You can see that there are two contracts here . Distinguish between true and false individuals and look at these aspects : Total supply , Price , Whether the time is consistent with the official , And whether there is a transaction ( There are usually tests ). Of course, if you can't judge the suggestion and wait for official notice , Don't take unnecessary risks .

notes : Sometimes the main network contract has not been deployed , Go to Rinkeby Test network search , The search method is the same as that of the primary network .

Two 、 Interact with contracts

1. Still with LilHeros For example , Click on Contract,Code We only need to focus on the source code part of the page ( Uppermost ), If you don't understand the source code, just read it Read,Write Part can be . Personally think that Read,Write Part of it is simpler , You can understand the function of each function by understanding English words .

Read The page can only be read but not operated , There are two kinds , A method that can be viewed directly without filling in parameters , As the first 11 term , The other is to fill in parameters , As the first 1 Item needs to fill in the address to query the token Number .

We guess that the functions of these functions are from top to bottom : Query quantity , Query whether to authorize ( It can be seen from the parameters that it refers to a particular tokenId Authorization of ), Query whether all are authorized , The largest number , name , Contract owner , some tokenid The owner , Pause , Price , private mint Number , private Mint Open or not , Each private mint The biggest deal mint Number , Each wallet is private Mint The largest number , private Mint Starting time , public Mint Open or not .

It should be noted that these read values may be changed , If you want to grab the first time , Focus on StartTime,setActive,Pause Keyword functions like , Let's continue Write page

Write The page is where we need to operate , To operate, you first need to click Connect to Web3 Link your wallet . Generally, we only need to pay attention to the belt Mint The function of ( If you are in a hurry to sell, you can also authorize in advance OPENSEA, It can help you get on the shelves faster than others ), Most other functions can only be executed by the contract owner . Here we have mintPublic For example ( Why take this as an example ? Because other functions need a signed parameter, I won't ). See that the parameter is prompted , The first parameter is the price , namely ETH The number of , The second parameter is that you want to Mint The number of , hypothesis mint price is 0.4, Do you want to mint Two , Then the first parameter is filled in 0.8, The second parameter is filled in 2. General mint Functions are both parameters , In case of self-study requiring other parameters .

It should be noted that if you execute these functions incorrectly, the little fox will prompt you for errors and give you a higher GAS, There are many reasons for this , Just refuse directly .

3、 ... and 、 Advanced applications

Still with LilHeros For example , By reading the contract source code, we can see mintPrivate The validation of this function is the same as the whitelist , So as long as you have a white list, you can call this method mint To 50 individual .

The above contents do not make any investment suggestions , Investment is risky !

原网站

版权声明
本文为[NFT practitioner]所创,转载请带上原文链接,感谢
https://yzsam.com/2022/177/202206261529208051.html