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.
Raed Diab is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.