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 3363/week @ 2024-05-11 3367/week @ 2024-05-18 3077/week @ 2024-05-25 3944/week @ 2024-06-01 3438/week @ 2024-06-08 3579/week @ 2024-06-15 3755/week @ 2024-06-22 2591/week @ 2024-06-29 2999/week @ 2024-07-06 3700/week @ 2024-07-13 4431/week @ 2024-07-20 3194/week @ 2024-07-27 2559/week @ 2024-08-03 3906/week @ 2024-08-10 3011/week @ 2024-08-17 2037/week @ 2024-08-24

12,423 downloads per month
Used in 123 crates (57 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

~4–7.5MB
~150K SLoC