Skip to content

Commit

Permalink
Merge pull request #156 from CosmWasm/add-cw4-hooks
Browse files Browse the repository at this point in the history
Add cw4 hooks
  • Loading branch information
ethanfrey authored Dec 6, 2020
2 parents df3f2d6 + 11400dd commit ae587a1
Show file tree
Hide file tree
Showing 16 changed files with 566 additions and 30 deletions.
14 changes: 10 additions & 4 deletions contracts/cw3-flex-multisig/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -29,10 +29,16 @@ with the desired member set. For now, this only is supported by
(TODO).

If you create a `cw4-group` contract and want a multisig to be able
to modify it's own group, set the admin as your personal key, then init the
multisig pointing to the group, then modify the admin of the group to point
back to the multisig. This is the current practice to create such circular
dependencies (TODO: document better).
to modify it's own group, do the following in multiple transactions:

* init cw4-group, with your personal key as admin
* init a multisig pointing to the group
* TODO: `AddHook{multisig}` on the group contract
* `UpdateAdmin{multisig}` on the group contract

This is the current practice to create such circular dependencies,
and depends on an external driver (hard to impossible to script such a
self-deploying contract on-chain). (TODO: document better).

When creating the multisig, you must set the required weight to pass a vote
as well as the max/default voting period. (TODO: allow more threshold types)
Expand Down
40 changes: 40 additions & 0 deletions contracts/cw4-group/schema/handle_msg.json
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,46 @@
}
}
}
},
{
"description": "Add a new hook to be informed of all membership changes. Must be called by Admin",
"type": "object",
"required": [
"add_hook"
],
"properties": {
"add_hook": {
"type": "object",
"required": [
"addr"
],
"properties": {
"addr": {
"$ref": "#/definitions/HumanAddr"
}
}
}
}
},
{
"description": "Remove a hook. Must be called by Admin",
"type": "object",
"required": [
"remove_hook"
],
"properties": {
"remove_hook": {
"type": "object",
"required": [
"addr"
],
"properties": {
"addr": {
"$ref": "#/definitions/HumanAddr"
}
}
}
}
}
],
"definitions": {
Expand Down
12 changes: 12 additions & 0 deletions contracts/cw4-group/schema/query_msg.json
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,18 @@
}
}
}
},
{
"description": "Shows all registered hooks. Returns HooksResponse.",
"type": "object",
"required": [
"hooks"
],
"properties": {
"hooks": {
"type": "object"
}
}
}
],
"definitions": {
Expand Down
Loading

0 comments on commit ae587a1

Please sign in to comment.