Concordium/concordium-rust-smart-contracts

Create CIS-0 library and defined all `STANDARD_IDENTIFIER` constants in it

DOBEN opened this issue · 1 comments

Task description

Currently, the CIS-2 library includes types and helper functions for both (CIS-2 and CIS-0). Since some contracts implement only CIS-0, it would be beneficial to have a better separation between the two standards in two libraries.

As part of the CIS-0 library, the CIS0_STANDARD_IDENTIFIER, CIS1_STANDARD_IDENTIFIER, CIS2_STANDARD_IDENTIFIER, ... should be defined to avoid having to define these constants at the top of every smart contract.

Sub-tasks

  • Separate CIS-2 and CIS-0 into their respective libraries.
  • Define the constants CIS0_STANDARD_IDENTIFIER, CIS1_STANDARD_IDENTIFIER, ... in the CIS-0 library.

Some benchmarking is needed to compare the different approaches.

A more efficient approach (but requires more refactoring/breaking changes) would likely be to move the CIS2-library and (logic-related for an equivalent CIS0-library) into the concordium-std crate. The reason is that when Rust complies the smart contract project, it can more efficiently optimize the project (smaller module size) when everything lives in one module/library (concordium-std) rather than across several independent crates/code units.