Skip to content

Commit

Permalink
governance: do not allow UndelegateClaim inside DaoSpend
Browse files Browse the repository at this point in the history
  • Loading branch information
redshiftzero committed Sep 21, 2023
1 parent ebb9f90 commit b09eb92
Showing 1 changed file with 7 additions and 4 deletions.
11 changes: 7 additions & 4 deletions crates/core/app/src/action_handler/actions/submit.rs
Original file line number Diff line number Diff line change
Expand Up @@ -84,21 +84,24 @@ impl ActionHandler for ProposalSubmit {

for action in &parsed_transaction_plan.actions {
match action {
Spend(_) | Output(_) | Swap(_) | SwapClaim(_) | DelegatorVote(_) => {
Spend(_) | Output(_) | Swap(_) | SwapClaim(_) | DelegatorVote(_) | UndelegateClaim(_) => {
// These actions all require proving, so they are banned from DAO spend
// proposals to prevent DoS attacks.
anyhow::bail!(
"invalid action in DAO spend proposal (would require proving)"
)
}
Delegate(_) | Undelegate(_) => {
// Delegation and undelegation is disallowed due to Undelegateclaim requiring proving.
anyhow::bail!(
"invalid action in DAO spend proposal (can't claim outputs of undelegation)"
)
}
ProposalSubmit(_) | ProposalWithdraw(_) | ProposalDepositClaim(_) => {
// These actions manipulate proposals, so they are banned from DAO spend
// actions because they could cause recursion.
anyhow::bail!("invalid action in DAO spend proposal (not allowed to manipulate proposals from within proposals)")
}
Delegate(_)
| Undelegate(_)
| UndelegateClaim(_)
| ValidatorDefinition(_)
| IbcAction(_)
| ValidatorVote(_)
Expand Down

0 comments on commit b09eb92

Please sign in to comment.