-
Notifications
You must be signed in to change notification settings - Fork 142
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Proposal Module Message Limits #694
Comments
Strawman implementation idea... the first version can be very simple, the intention of this is not to recreate Authz but to build a better user experience around DAOs (i.e. I want a DAO that only does one thing). We could make a Limit the number of messages, specify an exact message, or specified allowed keys for generic CosmWasm smart contract calls. #[cw_serde]
pub struct MsgLimit {
/// Specify exact messages a DAO can execute
/// If set to None only `count` will be used for validation
allowed_msgs: Option<Vec<AllowedMsg>>,
/// The number of messages that can be included in a prop?
/// Must be greater than zero?
count: u8
}
#[cw_serde]
pub enum AllowedMsg {
/// An exact message to call, the message must match this message
Exact(CosmosMsg),
/// A generic smart contract message that only checks the method
/// being called, allowing for the proposer to customize the contents /// of the message.
GenericWasmExecuteMsg {
/// The smart contract this message is intended for
contract: Option<String>,
/// Validation deserializes the binary and checks key matches
key: String,
/// Specify funds a DAO proposal can't exceed
funds: Option<Vec<Coin>>,
}
} Validation:
Questions:
|
Might also be cool to add a custom validation hook, which could be a separate smart contract that does custom validation. |
Currently, proposal modules that are enabled on a DAO can execute any message. This was a natural first step, but limitations on messages that can be executed via proposal modules can be very useful.
Polkadot's OpenGov has the notion of Origins and Tracks, the idea behind that you should have different governance processes and settings for different types of proposals (i.e. software upgrade should have a different process than treasury spend).
This can be sort of done today with proposal modules (and pre-propose modules), but what's missing is being able to scope the permissions for the type of message a proposal module is able to execute.
There are many forms these permissions might take, for example:
allow
anddeny
variantsObviously, this will need design. There are many in the wild examples to pull inspiration from including
Authz
.Ideally as part of the create proposal flow, any messages should be validated to ensure the proposal module has permissions to execute them.
Some user stories for inspiration:
The text was updated successfully, but these errors were encountered: