solidity-patterns icon indicating copy to clipboard operation
solidity-patterns copied to clipboard

Error [contracts/oracle.sol:19:39: TypeError: Data location must be "memory"]

Open reuniware opened this issue 3 years ago • 5 comments

Hello,

When trying to run the sample at https://fravoll.github.io/solidity-patterns/oracle.html In Remix.Ethereum.Org I have the following error :

contracts/oracle.sol:19:39: TypeError: Data location must be "memory" for parameter in function, but none was given.
function __callback(bytes32 myid, string result) public {
^-----------^

reuniware avatar Sep 08 '22 10:09 reuniware

Try string memory result

CaledoniaProject avatar Sep 08 '22 23:09 CaledoniaProject

Thank you, I'll try that and will let you know if that resolves the issue.

reuniware avatar Sep 11 '22 13:09 reuniware

Write " bytes32 memory myid, string memory result ". The problem will solve.

AshishMeena137 avatar Jun 09 '23 06:06 AshishMeena137