Thanks for reading.
I tried to deploy the smart contract code in remix ethereum IDE but I stuck with some errors.
I tried to update the version of solidity and do I added construct function in the contract.
Although there isn’t any problem in compiling but the invalid opcode happened.
invalid opcode says that “The execution might have thrown OR the EVM version used by the selected environment is not compatible with the compiler EVM version.”
How can I fix this problem?
Here is the code :
//SPDX-License-Identifier: MIT
pragma solidity ^0.8.20;
import “https://github.com/OpenZeppelin/openzeppelin-contracts/blob/master/contracts/access/Ownable.sol”;
contract SharedWallet is Ownable {
constructor() Ownable(msg.sender){
}
function isOwner() internal view returns(bool)
{
return owner() == msg.sender;
}
function withdrawMoney(address payable _to, uint _amount) public onlyOwner
{
_to.transfer(_amount);
}
receive() external payable {
}
}
I want to deploy this smart contract code properly without any error.
Thanks.
Assassin Dev is a new contributor to this site. Take care in asking for clarification, commenting, and answering.
Check out our Code of Conduct.