How can i trigger smart contract function with giving json data to a parameter that accepts string on remix.ethereum ide?

I tried this answer but didnt work.

My contract is here

pragma solidity ^0.7.0;

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

I tried this as image shows and got error

enter image description here enter image description here

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.3.1) 

Those ones dont work either

{ "name":"John"}

{ name:John}

Does anybody help me?


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.