Teach you how to snap up NFTs with the scientist's method from a technical level

Time:2022-02-14 Source: 713 views NFT Copy share

This article is based on my recent learning and discussions with my group friends. As a record, I finally think about the current situation of the NFT industry. It is inevitable that mistakes will be made when you are new to blockchain and Ethereum programming. You are welcome to correct and exchange.

NFT purchase process
contract

Simply put, the purchase process is the interaction between your wallet and the NFT contract, transfer 0.176ETH from your wallet to the contract, after calling the contract mint method, two NFT tokens are generated, the tokens are transferred to your wallet, and you get this NFT .

Detailed explanation of the NFT purchase process
Click the mint button on the official website of the project party, and open the end-to-end interaction process from the browser to the Ethernet network in detail:

contract

NFT purchase process

1. Click the Mint button

Everyone log in to the project website, connect their wallet on Chrome, and click the mint button. The JavaScript code on the webpage generates raw transaction data based on the mint price of the project, contract address, etc., mainly including the following key fields

nonce: nonce,
gasLimit: '21000',
maxFeePerGas: '300',
maxPriorityFeePerGas: '10',
to: '0x198478f870d97d62d640368d111b979d7ca3c38f',
value: '176000000000000000',
data: '0xa0712d680000000000000000000000
000000000000000000000000000000000000000002'
gasLimit - The maximum amount of gas a transaction can consume. Unit gwei
to – the receiving address (here is the NFT contract address, the transaction will execute the contract code)
nonce – used to track the total number of transactions executed by the account
value – the amount of ETH to transfer from (in WEI, here is 0.176 ETH to buy NFT)
data – interact with the contract, schedule mint function, the number of mint is 2
Function: mint(uint256 tokenQuantity)
MethodID: 0xa0712d68
[0]: 00000000000000000000000000000
00000000000000000000000000000000002
maxPriorityFeePerGas - maximum amount of gas to include as miner tip
maxFeePerGas - the maximum amount of gas that is willing to pay for a transaction
2. TX signature

The webpage code interacts with Metamask, and a pop-up window will let you confirm the transaction. After clicking Confirm, Metamask will use your wallet private key to sign to ensure that the transaction is authorized by you, and the subsequent Ethereum network will verify it.

3. Send TX to node for verification

The transaction TX is sent by Metamask to the Ethereum node of Metamask (default configuration), and the node verifies the TX to ensure that the transaction is not counterfeited.

4. Broadcast TX to the Ethereum network

Transactions TX are sent to neighboring nodes on the Ethereum network, which are then broadcast to each other to neighboring nodes. At this point, your transaction can be viewed on etherscan.io, and the status is pending.

5. The miner node receives the TX

The miner node will put the synchronized tx in a place called Txpool/Mempool. This place is the key to many things. It needs to be expanded to talk about:

Disclaimer : The above empty space does not represent the position of this platform. If the content of the article is not logical or has irregularities, please submit feedback and we will delete or correct it, thank you!

Top News