moonbeam-foundation / moonbeam

An Ethereum-compatible smart contract parachain on Polkadot
https://moonbeam.network
GNU General Public License v3.0
920 stars 333 forks source link

Errors encountered according to the tutorial instructions #2822

Open ytqaljn opened 4 months ago

ytqaljn commented 4 months ago

Hi, I am following your tutorial to write a Cross Chain DAO.

However, an error occurred when deploying the contract, resulting in deployment failure.

Here is the tutorial document I referred to:

https://docs.moonbeam.network/tutorials/interoperability/cross-chain-dao/

This is the code for the contract CrossChainDAOToken that I want to deploy:

image

Exactly the same as in the tutorial.

I deploy using the following command:

npx hardhat ignition deploy ignition/modules/Box.js --network localhost

Then this is the error I encountered:

Hardhat Ignition 🚀

Deploying [ Box ]

Batch #1 Failed Box#CrossChainDAOToken

[ Box ] failed â›”

Futures failed during execution:

  • Box#CrossChainDAOToken: Simulating the transaction failed with error: Reverted without reason

To learn how to handle these errors: https://hardhat.org/ignition-errors

Finally, this is the code of my ignition module: image

Can someone help me solve this problem?

albertov19 commented 3 months ago

Hey @ytqaljn thanks for bringing this up.

Have you tried forcing compiler version to 0.8.24?

Also I think your deployment script is not really correct. Check this one here -> https://github.com/jboetticher/cross-chain-dao/blob/main/scripts/deploy-dao.js

ytqaljn commented 3 months ago

OK, thank you. Let me try and see if it works.

The last one uses Factory. Is there any example of ignition?

albertov19 commented 3 months ago

Unfortunately not, but you should be able to migrate the code to Ignition by following some online guides. For example: https://blog.nomic.foundation/migrating-to-hardhat-ignition-from-hardhat-deploy-c17311bb658f

ytqaljn commented 3 months ago

OK, thank you. Although the deployment is still not successful, thank you for your help. Maybe it is because the contract is too old. I am going to rewrite some contracts to try and deploy them through the examples you provided.