0

I can not deploy any contracts with remix today even contracts I have previously deployed successfully. I get invalid opcode. i have even tried switching browsers still the same issue. here is the example contract I was trying to deploy to test calling other contract.

//SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;
contract Deployed {
    
    function setA(uint) public returns (uint) {}
    
    function a() public pure returns (uint) {}
    
}
contract Existing  {
    
    Deployed dc;
    
    function ExistingContract(address _t) public {
        dc = Deployed(_t);
    }
 
    function getA() public view returns (uint result) {
        return dc.a();
    }
    
    function setA(uint _val) public returns (uint result) {
        dc.setA(_val);
        return _val;
    }
    
}

I was able to deploy the first contract not sure why.

//SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;
contract Deployed {
    uint public a = 1;
    
    function setA(uint _a) public returns (uint) {
        a = _a;
        return a;
    }
    
}
2
  • Just more fyi. I tried a remix standard erc20 project and I get the same error trying to deploy the token contrat. These are the default contracts with no changes. Also interesting the token contract needs constructor parameters but you do not get he option for to add them if you select to deploy the erc20 contract the options appear but still fails to deploy.
    – Jeff
    May 23, 2023 at 1:25
  • Which network are you deploying to? What's the error message? It could be related to this ethereum.stackexchange.com/questions/150281/….
    – Ismael
    May 24, 2023 at 0:23

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Browse other questions tagged or ask your own question.