Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

发起交易页面上的solidity智能合约参数数据结构说明有误,误导用户 #499

Open
AndyLvVip opened this issue Jun 29, 2023 · 0 comments
Labels
good first issue Good for newcomers

Comments

@AndyLvVip
Copy link

版本:1.5.5

问题1:在页面上根本看不出下面这段话的转义符是什么

例如: set(bytes1[] a) -> ["0x12","0x34"];如果数组参数包含双引号,需转义,例如:set(string[] s) -> ["aaa"bbb","ccc"]。

问题2:struct里面的数组是不需要放在双引号内的,也就不存在双引号内的双引号需要转义问题

如set(StructA a) -> StructA{bool a, string[] b} -> [true,"["test string"]"]。struct中的数组需要放在双引号内,双引号内的双引号需要转义。

测试的智能合约

//SPDX-License-Identifier: UNLICENSED

pragma solidity >=0.6.0 <0.9.0;
pragma experimental ABIEncoderV2;

contract StructAContract {

    struct StructA {
        bool b;
        string[] a;
    }
    
    function testStruct(StructA memory a) public view returns (StructA memory s) {
        return a;
    }
}

测试通过的数据

[true, ["test string"]]
@CodingCattwo CodingCattwo added the good first issue Good for newcomers label Sep 26, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
good first issue Good for newcomers
Projects
None yet
Development

No branches or pull requests

2 participants