I am trying to implement the PSP22 token standard but getting errors when building my contract. The errors are:


| ^^^^^^^^^^^^^^^^^^ use of undeclared crate or module psp22metadata_external

impl PSP22 for MyPSP22 {}

| ^^^^^ use of undeclared type PSP22

impl PSP22Metadata for MyPSP22 {}

| ^^^^^^^^^^^^^ use of undeclared type PSP22Metadata

#[derive(Default, SpreadAllocate, PSP22Storage, PSP22MetadataStorage)] | ^^^^^^^^^^^^^^^^^^^^

error: cannot find attribute PSP22StorageField in this scope

I am following this tutorial put up here via here.

My brush crate version is v1.6.1

I noticed the import statement which is

use brush::contracts::psp22::extensions::metadata::*; is not resolving at all.

How can i go about this?

1 Answer 1


Turns out i was missing a features flag on my brush dependency. This solved it for me:

brush = { tag = "v1.6.1", git = "https://github.com/Supercolony-net/openbrush-contracts", default-features = false, features = ["psp22"] }

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.