Closed dengyanyu closed 3 years ago
@dengyanyu Hey, could you please replace the Chinese characters with English ones. Thanks
We should also mention that we don't support ABIEncoderV2 yet.
@josh-richardson thank you~
we use utf8 encode ,so it just not support in array struct encode?
if i want use web3j decode ABIEncoderV2 ,can you give me some way for it? thank you
We should also mention that we don't support ABIEncoderV2 yet.
@josh-richardson thank you~ we use utf8 encode ,so it just not support in array struct encode? if i want use web3j decode ABIEncoderV2 ,can you give me some way for it? thank you
We should also mention that we don't support ABIEncoderV2 yet.
so i just do it sample ~ , i decode it by this ,when the DefaultFunctionReturnDecoder.build be call , if outputParameters is dynamic_array use my self code all DefaultFunctionReturnDecoder.only_dynamic_array_return method, it just for myself ,you must correction In your own projects, you can refer to this : en:https://solidity.readthedocs.io/en/v0.6.0/abi-spec.html cn:https://learnblockchain.cn/docs/solidity/abi-spec.html
where i modify it~ ,
also i found thing in abi encode . here,
the source code of encoding is clac len by java string.length ,but if i use utf8 should use the byte[].length , so There may be a mistake here ,
It's also possible that I used the wrong method~~~
geth version 1.9.8-unstable solidity code:
i call the test2 when i use param ["中","国"],["你","好"] return error ,as img 我经过解析java逻辑 对照参数发现 结果如下:
i found when i read the array firt element must forward 128 offset,i can get right char ,
i have a bad idea ,if i want back ["1","2","3"] in Contract, i use ["0","1","2","3"] instead, i give up "0" when i get it in java.
but when i use a long array param for test , i get other error
Exception in thread "main" java.lang.IndexOutOfBoundsException: Index: 0 at java.util.Collections$EmptyList.get(Collections.java:4454) at test.x.SampleContract$6.call(SampleContract.java:89) at test.x.SampleContract$6.call(SampleContract.java:1) at org.web3j.protocol.core.RemoteCall.send(RemoteCall.java:42) at test.x.QklUtil.getJzywHc(QklUtil.java:140) at test.x.QklUtil.main(QklUtil.java:221)
if i use it the wrong way??