2

On master branch after merged this PR, I try to build example contract and got this error. Has anyone faced this issue? enter image description here

3 Answers 3

2

It's because of cargo-contract branch hasn't merged and which is in progress, you can view details here

0
2
cargo install cargo-contract --version 2.0.0-rc

The above command will install v2 of cargo contract. This includes ink v4 which has renamed the ink_lang module to ink. Thus using cargo-contract before v2 results in the ink_lang not found error. Other changes have also been made for ink v4, such as ink_env becoming ink::env, so you will need to make the corresponding changes throughout your contract. Here's a link to the cargo-contract v2 release. And here's a link to ink v4's release, which lists the breaking changes.

0

This version of cargo-contract solved it for me:

cargo install cargo-contract --version 2.0.0-beta

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.