1

I am trying to compile my Rust (ink!) source code for an AMM DEX on Substrate (Aleph Zero), but this is the error I am receiving from the logs:

Screenshot of logs

The following are the files:

[azero_trading_pair/cargo.toml]

[package]
name = "azero_trading_pair"
version = "0.9.6"
authors = ["Edinyanga Ottoho <[email protected]>"]
edition = "2021"
overflow-checks = true

[dependencies]

ink = { version = "4.3.0", default-features = false }

scale = { package = "parity-scale-codec", version = "3", default-features = false, features = ["derive"] }
scale-info = { version = "2.6", default-features = false, features = ["derive"], optional = true }

openbrush = { tag = "4.0.0-beta.1", git = "https://github.com/Brushfam/openbrush-contracts", default-features = false, features = ["psp22"] }

[lib]
overflow-checks = false
name = "azero_trading_pair"
path = "lib.rs"
crate-type = []

[profile.release]
overflow-checks = false

[features]
default = ["std"]
std = [
    "ink/std",
    "scale/std",
    "scale-info/std",
    "openbrush/std"
]
psp22 = ["openbrush/psp22"]
ink-as-dependency = []

Then the actual router file [router/cargo.toml] is:

[package]
name = "router"
version = "0.9.6"
authors = ["Edinyanga Ottoho <[email protected]>"]
edition = "2021"
overflow-checks = false

[dependencies]

ink = { version = "4.3.0", default-features = false }

scale = { package = "parity-scale-codec", version = "3", default-features = false, features = ["derive"] }
scale-info = { version = "2.6", default-features = false, features = ["derive"], optional = true }

openbrush = { tag = "4.0.0-beta.1", git = "https://github.com/Brushfam/openbrush-contracts", default-features = false, features = ["psp22"] }

azero_trading_pair = { path = "../azero_trading_pair",version="0.9.6",default-features = false, features = ["ink-as-dependency"] }
psp22_trading_pair = { path = "../psp22_trading_pair",version="0.9.6",default-features = false, features = ["ink-as-dependency"] }

[lib]
overflow-checks = false
name = "router"
path = "lib.rs"
crate-type = []

[profile.release]
overflow-checks = false

[features]
default = ["std"]
std = [
    "ink/std",
    "scale/std",
    "scale-info/std",
    "openbrush/std",
    "azero_trading_pair/std",
    "psp22_trading_pair/std"
]
psp22 = ["openbrush/psp22"]
ink-as-dependency = []

Please, if more information is needed to solve this, let me know, but for now, this is the only error here:

"Cannot compile as the target wasm32-unknown-unknown does not support any of the output".

Help would be much appreciated, thanks.

1 Answer 1

1

I simply fixed this problem by removing the crate-type = []

For some reason, new versions of ink! must not be provisioned with crate-types as cdylib, rlib, or both as the case may be.

It now works like a charm!

Your Answer

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

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