Type Alias PreProposeHookMsg

Source
pub type PreProposeHookMsg = ExecuteMsg<Empty, Empty>;
Expand description

Message type used for firing hooks to a proposal module’s pre-propose module, if one is installed.

Aliased Type§

pub enum PreProposeHookMsg {
    Propose {
        msg: Empty,
    },
    UpdateConfig {
        deposit_info: Option<UncheckedDepositInfo>,
        submission_policy: Option<PreProposeSubmissionPolicy>,
    },
    UpdateSubmissionPolicy {
        denylist_add: Option<Vec<String>>,
        denylist_remove: Option<Vec<String>>,
        set_dao_members: Option<bool>,
        allowlist_add: Option<Vec<String>>,
        allowlist_remove: Option<Vec<String>>,
    },
    Withdraw {
        denom: Option<UncheckedDenom>,
    },
    Extension {
        msg: Empty,
    },
    AddProposalSubmittedHook {
        address: String,
    },
    RemoveProposalSubmittedHook {
        address: String,
    },
    ProposalCompletedHook {
        proposal_id: u64,
        new_status: Status,
    },
}

Variants§

§

Propose

Creates a new proposal in the pre-propose module. MSG will be serialized and used as the proposal creation message.

Fields

§msg: Empty
§

UpdateConfig

Updates the configuration of this module. This will completely override the existing configuration. This new configuration will only apply to proposals created after the config is updated. Only the DAO may execute this message.

Fields

§deposit_info: Option<UncheckedDepositInfo>

If None, will remove the deposit. Backwards compatible.

§submission_policy: Option<PreProposeSubmissionPolicy>

If None, will leave the submission policy in the config as-is.

§

UpdateSubmissionPolicy

Perform more granular submission policy updates to allow for atomic operations that don’t override others.

Fields

§denylist_add: Option<Vec<String>>

Optionally add to the denylist. Works for any submission policy.

§denylist_remove: Option<Vec<String>>

Optionally remove from denylist. Works for any submission policy.

§set_dao_members: Option<bool>

If using specific policy, optionally update the dao_members flag.

§allowlist_add: Option<Vec<String>>

If using specific policy, optionally add to the allowlist.

§allowlist_remove: Option<Vec<String>>

If using specific policy, optionally remove from the allowlist.

§

Withdraw

Withdraws funds inside of this contract to the message sender. The contracts entire balance for the specifed DENOM is withdrawn to the message sender. Only the DAO may call this method.

This is intended only as an escape hatch in the event of a critical bug in this contract or it’s proposal module. Withdrawing funds will cause future attempts to return proposal deposits to fail their transactions as the contract will have insufficent balance to return them. In the case of cw-proposal-single this transaction failure will cause the module to remove the pre-propose module from its proposal hook receivers.

More likely than not, this should NEVER BE CALLED unless a bug in this contract or the proposal module it is associated with has caused it to stop receiving proposal hook messages, or if a critical security vulnerability has been found that allows an attacker to drain proposal deposits.

Fields

§denom: Option<UncheckedDenom>

The denom to withdraw funds for. If no denom is specified, the denomination currently configured for proposal deposits will be used.

You may want to specify a denomination here if you are withdrawing funds that were previously accepted for proposal deposits but are not longer used due to an UpdateConfig message being executed on the contract.

§

Extension

Extension message. Contracts that extend this one should put their custom execute logic here. The default implementation will do nothing if this variant is executed.

Fields

§msg: Empty
§

AddProposalSubmittedHook

Adds a proposal submitted hook. Fires when a new proposal is submitted to the pre-propose contract. Only the DAO may call this method.

Fields

§address: String
§

RemoveProposalSubmittedHook

Removes a proposal submitted hook. Only the DAO may call this method.

Fields

§address: String
§

ProposalCompletedHook

Handles proposal hook fired by the associated proposal module when a proposal is completed (ie executed or rejected). By default, the base contract will return deposits proposals, when they are closed, when proposals are executed, or, if it is refunding failed.

Fields

§proposal_id: u64
§new_status: Status