将以太坊交易的智能合约输入数据转换为人类可读形式。

huangapple go评论50阅读模式
英文:

Making Ethereum transaction smart contarct input data in human readable

问题

我尝试过使用 base64 解码器,但没有成功。

英文:

In the following tx on testnet I'm looking to understand what the bytes value being passed as an input parameter actually is in a human readable form:

Tx: https://goerli.etherscan.io/tx/0x05da01fee2338a71956d8209b53364b1e9b9eaab3bf29e58f089438d7b06d7d1

Input data decoded using etherscan:
0

_palette

bytes
0x000000ff713f1dff8b532cff562600ff723709ffae8b61ffb69f82ff86581effa77c47ffdbb180ffe7cba9ffa66e2cffd29d60ffead9d9ffffffffffa58d8dffc9b2b2ff4a1201ff5f1d09ff711010ff7da269ff9bbc88ff5e7253ffff0000ff352410ff856f56ff6a563fffa98c6bffc8fbfbff9be0e0fff1ffffff75bdbdffd6000033692f08ff28b143ff794b11ff502f05ff00000099d60000ffc6c6c6ffdedede80e25b26ff80dbdaffca4e11ff933709ff0000004d86581e4d353535ff515151ff221e1766710cc7ff000000915c390fffc77514ff595959ff0040ffffdfdfdfff8c0d5bff690c45ffad2160ff555555ff0060c3ffe4eb17ff3cc300ffd60404ff8119b7ffb261dcff2c9541ff296434ffc9c9c9ffb1b1b1ff8d8d8dffb4b4b4ffdc1d1dff1a43c8ff1637a4ff142c7cffc28946ff2a2a2affe22626ff26314affffd800ff4c4c4cff636363ff000000403d2f1effffd926ffcae7fe701a6ed5ff855114ffbababa80683c08ff68461fffffc926ffd7d7d7fff0f0f0ff328dfdfffd3232ff2858b1ff2c5195ff293e64ff85561eff2d6b62ff005580ff229000ffc42110ff2c779599fff68eff8d5b4099ffba00ffff2a00ffe65700ffb500af99cd00cbff1c1a00ff534c00ffff8ebeff2c95419951360cff96200526

How can I convert this bytes value into a string or something human readable?

I've tried base64 decoders and i've had no luck.

答案1

得分: 1

为了使交易可读,您需要:

  • 拥有已编译智能合约的ABI文件,以了解交易中的函数调用是什么

  • 拥有智能合约的源代码,并阅读它以了解当调用该函数时它执行了什么操作

然后,您可以将数据字段与Solidity函数选择器和函数参数进行匹配

英文:

To make a transaction human readable you need

  • To have the ABI files of the compiled smart contract to know what is the function call in the transaction

  • To have the source code of the smart contract and read it what it does when this function is called

Then you can match the data field to the Solidity function selector and the function arguments.

huangapple
  • 本文由 发表于 2023年3月1日 15:21:55
  • 转载请务必保留本文链接:https://go.coder-hub.com/75600602.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定