47 releases (6 stable)

new 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

#1307 in Magic Beans

Download history 2701/week @ 2023-11-23 2638/week @ 2023-11-30 2519/week @ 2023-12-07 3185/week @ 2023-12-14 1524/week @ 2023-12-21 1379/week @ 2023-12-28 2415/week @ 2024-01-04 2732/week @ 2024-01-11 2469/week @ 2024-01-18 2945/week @ 2024-01-25 3514/week @ 2024-02-01 3276/week @ 2024-02-08 3167/week @ 2024-02-15 2086/week @ 2024-02-22 2116/week @ 2024-02-29 1896/week @ 2024-03-07

9,797 downloads per month
Used in 106 crates (53 directly)

Apache-2.0

95KB
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

~3.5–5.5MB
~117K SLoC