当前位置:网站首页>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' }
]
边栏推荐
- Now, the ear is going into the metauniverse
- Xidian AI ranked higher than Qingbei in terms of AI majors, and Nantah ranked the first in China in 2022 in terms of soft science majors
- Self cultivation and learning encouragement
- ICML 2022 | 字节跳动 AI Lab 提出多模态模型:X-VLM,学习视觉和语言的多粒度对齐...
- IE寿终正寝,网友们搞起了真·墓碑……
- 陆奇首次出手投资量子计算
- 現在,耳朵也要進入元宇宙了
- 教你如何在winpe里安装win11系统
- 威马招股书拆解:电动竞争已结束,智能排位赛刚开始
- Time management understood after working at home | community essay solicitation
猜你喜欢

Musk was sued for $258billion in MLM claims. TSMC announced the 2nm process. The Chinese Academy of Sciences found that the lunar soil contained water in the form of hydroxyl. Today, more big news is

(超详细onenet TCP协议接入)arduino+esp8266-01s接入物联网平台,上传实时采集数据/TCP透传(以及lua脚本如何获取和编写

【Harmony OS】【ArkUI】ets开发 图形与动画绘制

Copilot免费时代结束!正式版67元/月,学生党和热门开源项目维护者可白嫖

TensorFlow,危!抛弃者正是谷歌自己

JSP cannot be resolved to a type error reporting solution

老叶的祝福

北大换新校长!中国科学院院士龚旗煌接任,15岁考上北大物理系

Mobile mall project operation

如何使用IDE自动签名调试鸿蒙应用
随机推荐
Perfect shuffle problem
AI自己写代码让智能体进化!OpenAI的大模型有“人类思想”那味了
Copilot免费时代结束!正式版67元/月,学生党和热门开源项目维护者可白嫖
Comprehensive assignment of thesis writing instruction of Dongcai
Why can banana be a random number generator? Because it is the "king of radiation" in the fruit industry
马斯克:推特要学习微信,让10亿人「活在上面」成为超级APP
BGP biplane architecture
马斯克被诉传销索赔2580亿美元,台积电公布2nm制程,中科院发现月壤中含有羟基形式的水,今日更多大新闻在此...
Jilin University 22 spring March "career design" assignment assessment-00072
Sorting of poor cattle (winter vacation daily question 40)
Preparedstatement principle of preventing SQL injection
协作+安全+存储,云盒子助力深圳爱德泰重构数据中心
Standing at the center of the storm: how to change the engine of Tencent
教你如何在winpe里安装win11系统
TC object structure and abbreviation
Disassembly of Weima prospectus: the electric competition has ended and the intelligent qualifying has just begun
Configuration source code
ASP.NET会议室预约小程序源码 预约小程序源码
Void* pointer
TensorFlow,危!抛弃者正是谷歌自己