在哪里可以找到AbiEncoderV2编码元组算法?
我想添加元组支持到一个红宝石库。
发布于 2020-03-11 11:21:47
基本上,元组的编码方式就好像它的所有成员都是单独的参数一样,因此下面的函数返回true:
struct Foo {
uint x;
uint y;
uint z;
}
function foo () public pure returns (bool) {
return keccak256 (abi.encode (1, 2, 3)) ==
keccak256 (abi.encode (Foo (1, 2, 3)));
}https://ethereum.stackexchange.com/questions/80520
复制相似问题