当前位置:网站首页>BSC parsing input data of transaction
BSC parsing input data of transaction
2022-06-25 03:54:00 【Blockchain research】
Take this as an example :https://bscscan.com/tx/0x46ab3eda9ca611bbb839bab26b67425f38d577ede8fb350cc3b30b5431483acf

See this line of small letters ? Click in , There is a library dedicated to parsing .
analysis input To get rid of At the beginning 10 Characters , Because that is the encrypted character of the method .
The complete code is as follows :
let input_data = `0x7ff36ab500000000000000000000000000000000000000000073ef44020e785db242c9dd000000000000000000000000000000000000000000000000000000000000008000000000000000000000000060675dbb66f2c58b5ab07cdc7b034b95c59289090000000000000000000000000000000000000000000000000000000061e1cd290000000000000000000000000000000000000000000000000000000000000002000000000000000000000000bb4cdb9cbd36b01bd1cbaebf2de08d9173bc095c0000000000000000000000007fb4ed1b35d8f8638056913bece78b8cd624ca0d`;
input_data = input_data.substring(10);
const {
decodeConstructorArgs} = require('canoe-solidity');
let abiExample = {
'abi': [
{
"inputs": [
{
"internalType": "uint256", "name": "amountOutMin", "type": "uint256"},
{
"internalType": "address[]",
"name": "path",
"type": "address[]"
}, {
"internalType": "address", "name": "to", "type": "address"},
{
"internalType": "uint256",
"name": "deadline",
"type": "uint256"
}
],
'type': 'constructor'
}
]
};
console.log(decodeConstructorArgs(abiExample.abi, input_data));
Output :
[
{
name: 'amountOutMin',
type: 'uint256',
data: '140156369371873394114611677'
},
{
name: 'path',
type: 'address[]',
data: [
'bb4cdb9cbd36b01bd1cbaebf2de08d9173bc095c',
'7fb4ed1b35d8f8638056913bece78b8cd624ca0d'
]
},
{
name: 'to',
type: 'address',
data: '60675dbb66f2c58b5ab07cdc7b034b95c5928909'
},
{
name: 'deadline', type: 'uint256', data: '1642188073' }
]
边栏推荐
- Install ffmpeg in LNMP environment and use it in yii2
- 【Rust投稿】捋捋 Rust 中的 impl Trait 和 dyn Trait
- ICML 2022 | 字节跳动 AI Lab 提出多模态模型:X-VLM,学习视觉和语言的多粒度对齐...
- Apple's legendary design team disbanded after jobs refused to obey cook
- Is it safe to open an account on your mobile phone?
- 北大换新校长!中国科学院院士龚旗煌接任,15岁考上北大物理系
- Configuration source code
- Sleep more, you can lose weight. According to the latest research from the University of Chicago, sleeping more than 1 hour a day is equivalent to eating less than one fried chicken leg
- 孙武玩《魔兽》?有图有真相
- x86 CPU,危!最新漏洞引发热议,黑客可远程窃取密钥,英特尔“全部处理器”受影响...
猜你喜欢

Amazon's other side in China

马斯克被诉传销索赔2580亿美元,台积电公布2nm制程,中科院发现月壤中含有羟基形式的水,今日更多大新闻在此...

TCC mode explanation and code implementation of Seata's four modes

The era of copilot free is over! The official version is 67 yuan / month, and the student party and the defenders of popular open source projects can prostitute for nothing

你真的需要自动化测试吗?

Zuckerberg's latest VR prototype is coming. It is necessary to confuse virtual reality with reality

騰訊開源項目「應龍」成Apache頂級項目:前身長期服務微信支付,能hold住百萬億級數據流處理...

TC object structure and abbreviation

IE寿终正寝,网友们搞起了真·墓碑……

老叶的祝福
随机推荐
Maybe it's the wrong reason
Maintenant, les oreilles vont entrer dans le métacosme.
吴恩达机器学习新课程又来了!旁听免费,小白友好
用CPU方案打破内存墙?学PayPal堆傲腾扩容量,漏查欺诈交易量可降至1/30
Is it safe to open an account with flush securities?
Rebeco: using machine learning to predict stock crash risk
老叶的祝福
A new generation of cascadable Ethernet Remote i/o data acquisition module
西电AI专业排名超清北,南大蝉联全国第一 | 2022软科中国大学专业排名
后台页制作01《ivx低代码签到系统制作》
中国天眼发现地外文明可疑信号,马斯克称星舰7月开始轨道试飞,网信办:APP不得强制要求用户同意处理个人信息,今日更多大新闻在此...
Huawei failed to appeal and was prohibited from selling 5g equipment in Sweden; Apple regained the first place in the world in terms of market value; DeNO completes round a financing of USD 21million
TCC mode explanation and code implementation of Seata's four modes
JS tool function, self encapsulating a throttling function
Skywalking implements cross thread trace delivery
Internet Explorer died, and netizens started to build a true tombstone
Self cultivation and learning encouragement
Is it safe to open an account on your mobile phone?
JS tool function, self encapsulating a throttling function
马斯克:推特要学习微信,让10亿人「活在上面」成为超级APP