Concorduim-build could not build contract

Hello, I’m trying to implement reflective tokens on concordium. so i enabled the u256_amount feature on the concordium_cis2 crate. I also added the primitive_types crate v0.11.1 to my contract so i can use the u256 int type. This is my cargo.toml

[package]
name = "gate_token"
version = "0.1.0"
edition = "2021"
license = "MPL-2.0"
authors = [ "BukiOffor <ebuka2264@yahoo.com>" ]
description = "The Gateway Token on the concordium blockchain"

[features]
default = ["std"]
std = ["concordium-std/std", "concordium-cis2/std"]
bump_alloc = ["concordium-std/bump_alloc"]

[dependencies]
concordium-std = {version = "10.0.0", default-features = false}
concordium-cis2 = {version = "6.1", default-features = false, features = ["u256_amount"]}
primitive-types = {version= "0.11.1", features = ["std"]}


[dev-dependencies]
concordium-smart-contract-testing = "4.1"

[lib]
crate-type=["cdylib", "rlib"]

[profile.release]
codegen-units = 1
opt-level = "s"

The smart contract has no issues with rust analyzer because no errors are being shown. but when i try to build, it throws this error

The problem stems from you including the primitive-types crate with default features std and rand. In particular the rand feature is a problem.

I recommend setting default-features=false for this dependency (this is also what concordium-cis2 does). Unless you know specific things you need from other features.

1 Like

worked like magic, Thank you

1 Like