76a61cb3ae
* Import cw3-flex-multisig and cw4-group contracts * Add release_funds to coconut-bandwidth-contract * Create contract.rs file * Add cw multi test and a test that uses it * Use mnemonic for coconut mode too * Stricter access to config file, which contains mnemonic * Update tests * Remove signed deposits dir after merging that into sql db * Clippy nits * More clippy * Remove backtraces features to pass clippy tests * Merge the same mnemonic for rewarding and coconut * Simplify things, letting network monitor use testnet-mode with gateways * Unify the nymd clients * Sqlx common storage for buying/consuming credentials * Link credential storage to credential client * Trigger rewarded_set update on bootstrap error * Fix bug on message signing * Simplify coconut feature in code and set it in validator-api * Update some local consts * Link clients to credential storage * Simplify sql query and change socks5 too * Update attr handling such that public ones are usable * Normalize test addresses * Fix clippy * Merge storages for (non)coconut creds * Fmt miss * Disable wasm client support for now Co-authored-by: durch <durch@users.noreply.github.com>
52 lines
1.7 KiB
Markdown
52 lines
1.7 KiB
Markdown
# CW4 Group
|
|
|
|
This is a basic implementation of the [cw4 spec](../../packages/cw4/README.md).
|
|
It fulfills all elements of the spec, including the raw query lookups,
|
|
and it designed to be used as a backing storage for
|
|
[cw3 compliant contracts](../../packages/cw3/README.md).
|
|
|
|
It stores a set of members along with an admin, and allows the admin to
|
|
update the state. Raw queries (intended for cross-contract queries)
|
|
can check a given member address and the total weight. Smart queries (designed
|
|
for client API) can do the same, and also query the admin address as well as
|
|
paginate over all members.
|
|
|
|
## Init
|
|
|
|
To create it, you must pass in a list of members, as well as an optional
|
|
`admin`, if you wish it to be mutable.
|
|
|
|
```rust
|
|
pub struct InitMsg {
|
|
pub admin: Option<HumanAddr>,
|
|
pub members: Vec<Member>,
|
|
}
|
|
|
|
pub struct Member {
|
|
pub addr: HumanAddr,
|
|
pub weight: u64,
|
|
}
|
|
```
|
|
|
|
Members are defined by an address and a weight. This is transformed
|
|
and stored under their `CanonicalAddr`, in a format defined in
|
|
[cw4 raw queries](../../packages/cw4/README.md#raw).
|
|
|
|
Note that 0 *is an allowed weight*. This doesn't give any voting rights, but
|
|
it does define this address is part of the group. This could be used in
|
|
e.g. a KYC whitelist to say they are allowed, but cannot participate in
|
|
decision-making.
|
|
|
|
## Messages
|
|
|
|
Basic update messages, queries, and hooks are defined by the
|
|
[cw4 spec](../../packages/cw4/README.md). Please refer to it for more info.
|
|
|
|
`cw4-group` adds one message to control the group membership:
|
|
|
|
`UpdateMembers{add, remove}` - takes a membership diff and adds/updates the
|
|
members, as well as removing any provided addresses. If an address is on both
|
|
lists, it will be removed. If it appears multiple times in `add`, only the
|
|
last occurrence will be used.
|
|
|