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

Error: 2 UNKNOWN: arg name not found #3

Open
leonlianght opened this issue Jul 19, 2021 · 0 comments
Open

Error: 2 UNKNOWN: arg name not found #3

leonlianght opened this issue Jul 19, 2021 · 0 comments

Comments

@leonlianght
Copy link
Contributor

Error: 2 UNKNOWN: arg name not found 该错误为链返回的错误,具体原因是因为代码中使用了 public 的 state variable,编译出来的 ABI 对应的 view 的 input 的 name 为空字符串,如:

  {
    "inputs": [
      {
        "internalType": "uint256",
        "name": "",
        "type": "uint256"
      }
    ],
    "name": "Id",
    "outputs": [
      {
        "internalType": "string",
        "name": "name",
        "type": "string"
      }
    ],
    "stateMutability": "view",
    "type": "function"
  },

目前建议使用 private/internal state 配合 view 函数使用

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant