Our inspiration was to simplify the development of canisters in Rust on the IC, providing some much needed functionality. We wanted to make a Rust developer's life as simple as possible, by providing a means to unit-test inter-canister communications, and enabling composable APIs for canisters similar to the inheritance used in Ethereum smart-contracts.
What it does
(1) Simplifying and testing of inter-canister communications, allowing dependencies between canisters to be tested without compilation. Testing another canister is as simple as importing it into a module and testing the inter-canister calls.
(2) Canisters composition (combining APIs from different crates into a single canister) - import one canister into another canister. This means you can import one canister and override it's methods.
(3) in-memory state management and versioning of the state for canister upgrades. State should be versioned on the IC to prevent confusion when upgrading state.
(4) This project builds on top of ic-cdk and ic-kit crates. It is not intended to replace them, but adds some types and macros to considerably simplify development on the IC.
How we built it
Our team built this in Rust, using this CDK in the development of the InfinitySwap AMM and token standards.
Building this library alongside our core product helped us to understand how uses would interact with it.
Challenges we ran into
Building the macros was a challenge. Testing macro expansions can be a tricky feat in Rust.
Accomplishments that we're proud of
That we built a CDK that enables greater code re-use from developers. Any developers using our CDK can import the canisters we have built, and easily modify them to suit their own ends. We believe this could really push the IC forward by connecting devs, and allowing them to share their work with each other through composable apis.
What we learned
We learned that using Rust macros we can create powerful extensions to the existing CDK which enable game-changing new features.
What's next for InfinitySwap Canister SDK
More testing, more features. Compatibility with other SDKs.