Skip to content
This repository has been archived by the owner on Feb 26, 2024. It is now read-only.

deploy successfully in development network but failed with the ganache ui blockchain #6125

Closed
chenqping opened this issue Jun 25, 2023 · 1 comment

Comments

@chenqping
Copy link


Issue

Deploy a contract passing in another contract's address as a constructor argument, but failed with the following error:

 *** Deployment Failed ***

"MyMetaTxDemo" hit an invalid opcode while deploying. Try:
   * Verifying that your constructor params satisfy all assert conditions.
   * Verifying your constructor code doesn't access an array out of bounds.
   * Adding reason strings to your assert statements.

migrate script as follows:

const MetaTxDemo = artifacts.require("MetaTxDemo");

module.exports = function(deployer) {
  deployer.deploy(MetaTxDemo, "0x85a34a43BeFBaEc40bcC63eb19F8D0E7FD6B4495");
};

but this script works with the embedded development local ganache instance, don't know why it doesn't work with ganache ui

Steps to Reproduce

truffle migrate

Expected Behavior

deploy successfully or give more detail to diagnose the error

Actual Results

deploy falied with ganache ui but succeed with the embedded development instance

Environment

  • Operating System: macOS Big Sur
  • Ethereum client: Ganache-ui 2.7.1
  • Truffle version (truffle version): 5.10.0
  • node version (node --version): 16.17.1
  • npm version (npm --version): 9.7.1
@chenqping chenqping changed the title deploy successfully in development network but failed with the ganache ui deploy successfully in development network but failed with the ganache ui blockchain Jun 25, 2023
@chenqping
Copy link
Author

chenqping commented Jun 25, 2023

It seems because Ganache UI latest version 2.7.1 only supports up to Merge hard fork, but my truffle config uses solc 0.8.20, which corresponds to shanghai(default), so may some OP code not compatible. Use ganache-cli latest version is ok.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant