Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Standardised verifiable builds #110

Open
sourabhniyogi opened this issue Jul 14, 2023 · 1 comment
Open

Standardised verifiable builds #110

sourabhniyogi opened this issue Jul 14, 2023 · 1 comment
Assignees

Comments

@sourabhniyogi
Copy link

I tried Standardised verifiable builds on 4 cases (where all 4 cases were generated from ChainIDE WASM Contract templates and compiled in ChainIDE), and flipper compiled but the other 3 did not. Errors are included below:

  1. flipper

NO ERRORS

  1. my_psp22
# docker run -d --name ink-container --mount type=bind,source="./src",target="/contract" paritytech/contracts-verifiable:master build
# docker logs [...]
 [1/*] Building cargo project
error: failed to parse manifest at `/tmp/cargo-contract_RqgRr5/Cargo.toml`

Caused by:
  the target `my_psp22` is a binary and can't have any crate-types set (currentlERROR: command ["/usr/local/rustup/toolchains/1.69-x86_64-unknown-linux-gnu/bin/cargo", "build", "--color=always", "--target=wasm32-unknown-unknown", "-Zbuild-std=core,alloc", "--no-default-features", "--release", "--target-dir=/contract/target/ink", "--features", "ink/ink-debug"] exited with code 101
  1. shiden34
# docker run -d --name ink-container --mount type=bind,source="./src",target="/contract" paritytech/contracts-verifiable:master build
# docker logs [...]
Some errors have detailed explanations: E0405, E0408, E0412, E0425, E0433, E0463, E0531.
For more information about an error, try `rustc --explain E0405`.
error: could not compile `proc-macro2` due to 451 prevERROR: command ["/usr/local/rustup/toolchains/1.69-x86_64-unknown-linux-gnu/bin/cargo", "build", "--color=always", "--target=wasm32-unknown-unknown", "-Zbuild-std=core,alloc", "--no-default-features", "--release", "--target-dir=/contract/target/ink", "--features", "ink/ink-debug"] exited with code 101
  1. factory_contract
# docker run -d --name ink-container --mount type=bind,source="./src",target="/contract" paritytech/contracts-verifiable:master build
# docker logs [...]
ERROR: Error invoking `cargo metadata` for Cargo.toml

Caused by:
    `cargo metadata` exited with an error:     Updating crates.io index
        Updating git repository `https://github.com/727-Ventures/openbrush-contracts`
    error: failed to get `pair_contract` as a dependency of package `factory_contract v0.1.0 (/contract)`
    
    Caused by:
      failed to load source for dependency `pair_contract`
    
    Caused by:
      Unable to update /pair
    
    Caused by:
      failed to read `/pair/Cargo.toml`
    
    Caused by:
      No such file or directory (os error 2)

We were happy that case 1 generated the same codehash as chainide but any insights to cases 2/3/4 would be appreciated!

@SkymanOne advises that this is not an issue with the (new!) "paritytech/contracts-verifiable" and recommended opening an issue here.

At the end of the day we wish for PSP22/34/Uniswapv2 contract code that can serve as templates that can be verified in paritytech/contracts-verifiable.

@coreggon11
Copy link
Contributor

Hi @sourabhniyogi , I can see the contracts that failed can not be built with cargo contract v3. Could you try changing #![cfg_attr(not(feature = "std"), no_std)] to #![cfg_attr(not(feature = "std"), no_std, no_main)] and removing the crate-type from Cargo.toml?

@coreggon11 coreggon11 self-assigned this Jul 14, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants