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

json input parameter in remix appear error #419

Open
lyh169 opened this issue Sep 17, 2022 · 1 comment
Open

json input parameter in remix appear error #419

lyh169 opened this issue Sep 17, 2022 · 1 comment

Comments

@lyh169
Copy link

lyh169 commented Sep 17, 2022

pragma solidity ^0.8.7;

contract Json {
    function getParameter(string memory jsonData) public view returns (string memory) {
        return jsonData;
    }
}

I want to store JSON input in my Smart Contract. Like

{ "name":"John" }

when i input { "name":"John" } or "{ "name":"John" }" ,Remix says, that there is an SyntaxError:

call to Json.getParameter errored: Error encoding arguments: Error: types/values length mismatch (count={"types":1,"values":3}, value={"types":["string"],"values":["{ \",":\"," }"]}, code=INVALID_ARGUMENT, version=abi/5.5.0)
image

Can someone help me?

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

2 participants
@lyh169 and others