Reputation: 1
When running a contract I am getting in remix an invalid opcode as well on Metamask, the contract that I am running is quite simple:
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;
contract WebsiteStorage {
string private storedWebsite;
function setWebsite(string calldata url) public {
storedWebsite = url;
}
function getWebsite() public view returns (string memory) {
return storedWebsite;
}
}
How to solve it?
I have tried to check the connection between Ganache and Metamask and the network was 100% working. I have checked the Ganache logs and same error was mentioned but the contract was found in the contracts section. I have tried tried to check the connection between Remix and Metamask, the connection is working properly as I have found the logs of the transactions posted from Remix on Metamask logs.
Upvotes: 0
Views: 70
Reputation: 1
Thanks. Issue Solved, just need to match the same version between remix and ganache.
Upvotes: 0