Crate cw4

source ·
Expand description

CW4 is a spec for storing group membership, which can be combined with CW3 multisigs. The purpose is to store a set of members/voters that can be accessed to determine permissions in another section.

Since this is often deployed as a contract pair, we expect this contract to often be queried with QueryRaw and the internal layout of some of the data structures becomes part of the public API. Implementations may add more data structures, but at least the ones laid out here should be under the specified keys and in the same format.

In this case, a cw3 contract could read an external group contract with no significant cost besides reading local storage. However, updating that group contract (if allowed), would be an external message and will be charged as part of the overhead for each contract.

For more information on this specification, please check out the README.

Structs§

  • Cw4Contract is a wrapper around Addr that provides a lot of helpers for working with cw4 contracts
  • A group member has a weight associated with them. This may all be equal, or may have meaning in the app that makes use of the group (eg. voting power)
  • MemberChangedHookMsg should be de/serialized under MemberChangedHook() variant in a ExecuteMsg. This contains a list of all diffs on the given transaction.
  • MemberDiff shows the old and new states for a given cw4 member They cannot both be None. old = None, new = Some -> Insert old = Some, new = Some -> Update old = Some, new = None -> Delete

Enums§

Constants§

Functions§

  • member_key is meant for raw queries for one member, given address