当前位置:网站首页>Transaction input data of Ethereum
Transaction input data of Ethereum
2022-06-26 15:45:00 【NFT practitioner】
Here I share with you the principle behind the hexadecimal data call contract , I hope that's helpful .
Transaction The main field
You know that every time you interact with the Ethereum network , Whether it is a direct transfer or a call contract, it actually initiates a transaction to the Ethereum network Transaction, This Transaction adopt Metamask After signing and sending to the Ethereum node , Ethereum miners will carry out this transaction.
Transaction There are several important fields in :
- from: On behalf of who initiated this Transaction, It's usually your wallet address
- to: To whom . If it's a transfer ,to Is the address of the wallet you want to transfer money to ; If this transaction is a call contract ,to Is the contract address to be called
- value: How much ETH
- Input Data: input data . If it's a transfer ,Input Data Namely 0x It's empty , Don't pass in , because “from”、“to” and “value” The field has been able to determine that the transaction was made by “ who ”, turn “ How many? ETH”, To “ who ” Went to the ; But if the deal is a call contract ,Input Data You need to include all the information you need to invoke the contract , For example, the contract method 、 Parameters ( The hexadecimal data in the above screenshot , What you enter is actually Input Data)
With this WomenUniteNFT Of Mint transaction For example ,tx=0x64c55a520934460ef87a1bd5f0e86c837babae86897ddf285ae4dc2feafa166d, You can see from yes mint This guy's wallet ,to yes WomenUniteNFT Contract address ,value yes 0, It means no money ( But there are gas),data Is the hexadecimal data he passed in .

Input Data analysis
Or the above transaction Input Data “0xa0712d6800000000000000000000000000000000000000000000000000000000000000fa” For example .
Method identification
First of all, there are loopholes in the contract “def mint(uint256 _wad) payable:”, use keccak256 Work out ”mint(uint256)” Hexadecimal of the hash value of , Take the top eight at the same time to get Input Data Method name ID of “a0712d68” 了 .( Note that the computed hash only needs to be the function name + Parameter type )

Method parameter
After the method id is confirmed , You need to pass in mint Number , If you need one mint 250 individual , The introduction 250 The hexadecimal of “fa”.

Above mint The parameter in the method is uint256 Type of , You need to use the corresponding number of digits when spelling in parameters ,uint256 If the parameter of type is changed to 16 In hexadecimal, you need 64 position , So will “fa” repair 0 To 64 Bit is “00000000000000000000000000000000000000000000000000000000000000fa”.
Pieced together Input Data
At this time, it is identified with the previously calculated method name “a0712d68” Piece together , You can get “a0712d6800000000000000000000000000000000000000000000000000000000000000fa” Of Input Data Data. , With the above Mint Of this transaction Of Input Data identical .( If you have more than one parameter , It is OK to continue to spell according to the length of the parameter type )
Put this Input Data The data is in Metamask Enter... When transferring to the contract address , The Ethereum miner node knows which method to execute the contract and what parameters to pass in .
Last
If you still don't understand , It's just Etherscan Compare the contract and transaction Of InputData, In fact, they can work it out by themselves .
The above contents do not make any investment suggestions , Investment is risky !
边栏推荐
- CNN优化trick
- 【SNMP】snmp trap 介绍、安装、命令|Trap的发送与接收代码实现
- [CEPH] Lock Notes of cephfs
- Using restcloud ETL shell component to schedule dataX offline tasks
- 【leetcode】112. Path sum - 113 Path sum II
- How to handle 2gcsv files that cannot be opened? Use byzer
- Comparative analysis of restcloud ETL and kettle
- 学习内存屏障
- Golang temporary object pool optimization
- golang 临时对象池优化
猜你喜欢
![[tcapulusdb knowledge base] tcapulusdb OMS business personnel permission introduction](/img/7b/8c4f1549054ee8c0184495d9e8e378.png)
[tcapulusdb knowledge base] tcapulusdb OMS business personnel permission introduction

【ceph】cephfs caps简介

AbortController的使用
![[problem solving] the loading / downloading time of the new version of webots texture and other resource files is too long](/img/31/d14316dca740590c1871efe6587e04.png)
[problem solving] the loading / downloading time of the new version of webots texture and other resource files is too long

Applet: uniapp solves vendor JS is too large

PCIe Capabilities List
![[tcapulusdb knowledge base] tcapulusdb system user group introduction](/img/7b/8c4f1549054ee8c0184495d9e8e378.png)
[tcapulusdb knowledge base] tcapulusdb system user group introduction

Particle filter PF - 3D CV target tracking with uniform motion (particle filter vs extended Kalman filter)

canvas三个圆点闪烁动画

Evaluation - TOPSIS
随机推荐
Applet: uniapp solves vendor JS is too large
/etc/profile、/etc/bashrc、~/.bashrc的区别
Reflection modification final
【微信小程序】事件绑定,你搞懂了吗?
Is it safe to open a stock account through the account opening link of the broker manager? Or is it safe to open an account in a securities company?
【问题解决】新版webots纹理等资源文件加载/下载时间过长
CNN optimized trick
# 粒子滤波 PF——三维匀速运动CV目标跟踪(粒子滤波VS扩展卡尔曼滤波)
Restcloud ETL resolves shell script parameterization
Using restcloud ETL shell component to schedule dataX offline tasks
[tcapulusdb knowledge base] Introduction to tcapulusdb data structure
AUTO sharding policy will apply DATA sharding policy as it failed to apply FILE sharding policy
Unable to download Plug-in after idea local agent
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
canvas三个圆点闪烁动画
[tcapulusdb knowledge base] tcapulusdb doc acceptance - Introduction to creating game area
2022北京石景山区专精特新中小企业申报流程,补贴10-20万
Summary of students' learning career (2022)
NFT 平台安全指南(2)
Is it safe to open a new bond registration account? Is there any risk?