solidity - How solidity make function signature with tuple(nested abi)?
问题描述
struct Test {
uint ui;
string s;
}
function test(Test t) public {
emit Log(t.ui, t.s);
}
I have some knowledge about ABI. I made this contract with experimental ABIEncoderV2 option. In conclusion, this function's signature is 0x6056f4cc, I found this value in opcode. I tried some case test(uint256,string), test(tuple(uint256,string)), test(tuple), test(tuple[uint256,string])) with sha3... but no one make correct signature. How solidity make function signature with tuple?
解决方案
你和第一个很接近。实际编码是从test((uint256,string))
.
bytes4(keccak256("test((uint256,string))"): 6056f4cc
推荐阅读
- ruby-on-rails - 为什么我之前没有插入这样的中间件:“ActionDispatch::Static”(RuntimeError)
- c# - 当 validationKey 和 encryptionKey 设置为自动生成的值时,为什么 MachineKey.Unprotect 会失败?
- html - 如何在 div 中以角度创建滚动到顶部功能?
- excel - 在一个操作中以不同格式分隔 Excel
- node.js - 如何在我的 gcp 函数上实现 csrf 攻击
- python - Sympy:使用solve()来解决一个平等
- angular - 循环访问来自 Angular 订阅的数据
- android - Play 商店有新版本的应用程序,但显示打开按钮而不是更新
- node.js - 以同步方式使nodejs http get调用
- sql - 为给定数据类型创建 Redshift 表查询