The OpenBrush library uses Rust features to allow users to selectively integrate contracts
and modules into their codebases, thereby only importing the contracts they need. However,
the system operates differently for traits. Traits are not governed by features and are loaded
automatically. This means that regardless of the features chosen by the end user, all traits get
loaded. This leads to unnecessary overhead at compilation time, especially for trait-related
macros ( trait_definition and wrapper ). Moreover, metadata files are produced for all
traits, even for contracts that are not utilized in the user's project.
Reorganize the traits folder so that the traits within also use Rust features .
This ensures that only relevant traits, those corresponding to the contracts users have
integrated from the library, are loaded into user codebases.
The OpenBrush library uses Rust features to allow users to selectively integrate contracts and modules into their codebases, thereby only importing the contracts they need. However, the system operates differently for traits. Traits are not governed by features and are loaded automatically. This means that regardless of the features chosen by the end user, all traits get loaded. This leads to unnecessary overhead at compilation time, especially for trait-related macros (
trait_definition
andwrapper
). Moreover, metadata files are produced for all traits, even for contracts that are not utilized in the user's project. Reorganize the traits folder so that the traits within also use Rust features . This ensures that only relevant traits, those corresponding to the contracts users have integrated from the library, are loaded into user codebases.