47 releases (6 stable)

2.0.0 Mar 15, 2024
1.1.2 Nov 23, 2023
1.1.0 Jun 19, 2023
1.0.1 Dec 19, 2022
0.4.0 Dec 22, 2020

#6 in #controllers

Download history 3416/week @ 2024-09-01 4005/week @ 2024-09-08 3331/week @ 2024-09-15 3690/week @ 2024-09-22 3254/week @ 2024-09-29 3700/week @ 2024-10-06 4119/week @ 2024-10-13 4483/week @ 2024-10-20 4358/week @ 2024-10-27 4485/week @ 2024-11-03 2973/week @ 2024-11-10 4514/week @ 2024-11-17 3600/week @ 2024-11-24 3885/week @ 2024-12-01 3906/week @ 2024-12-08 4184/week @ 2024-12-15

15,693 downloads per month
Used in 134 crates (61 directly)

Apache-2.0

94KB
2K SLoC

CW Controllers: Common controllers for many contracts

This is a collection of "controllers" that we end up reimplementing in many contracts. I use the word "controller" similar to the MVC framework style, where it is an element that encapsulated business logic and data access. We can also directly handle some ExecuteMsg and QueryMsg variants by adding a sub-router to these controllers.

This is the beginning of an experiment in code composition, and how best to reuse code among multiple contracts. We have already seen some "extend" and existing base contract (like cw20-staking extends cw20-base), but this goes for smaller scale units.

Supported controllers:

  • Admin (UpdateAdmin handler, Admin querier, set_admin and is_admin methods)

lib.rs:

This is a collection of "controllers" that we end up reimplementing in many contracts. I use the word "controller" similar to the MVC framework style, where it is an element that encapsulated business logic and data access. We can also directly handle some ExecuteMsg and QueryMsg variants by adding a sub-router to these controllers.

This is the beginning of an experiment in code composition, and how best to reuse code among multiple contracts. We have already seen some "extend" and existing base contract (like cw20-staking extends cw20-base), but this goes for smaller scale units.

Supported controllers:

  • Admin (UpdateAdmin handler, Admin querier, set_admin and is_admin methods)

Dependencies

~4.5–7.5MB
~157K SLoC