Skip to content

fix(governance): reject mismatched proposal target/function/arg arrays - #1756

Merged
Gbangbolaoluwagbemiga merged 2 commits into
HyperSafeD:mainfrom
libby-coder:fix/issues-1640-1365-1639-1357
Sep 30, 2026
Merged

Gbangbolaoluwagbemiga merged 2 commits into
HyperSafeD:mainfrom
libby-coder:fix/issues-1640-1365-1639-1357

Conversation

@libby-coder

Copy link
Copy Markdown
Contributor

Closes #1640
Closes #1365
Closes #1639
Closes #1357

Summary

Prevents out-of-bounds panics when a proposal's targets, functions, and args vectors have different lengths (#1640).

  • Adds Error::MismatchedProposalArrays (= 10) to the governance contract's error enum.
  • Adds a validate_proposal_arrays helper that checks all three vectors have the same length.
  • Calls the check in propose, so bad proposals are rejected up front.
  • Calls it again in queue and execute before the loop over proposal actions, so proposals that are already stored are covered too.
  • proposal_action now returns MismatchedProposalArrays instead of the generic InvalidState if an index is missing.

Files changed

  • contracts/governance/src/lib.rs

Validate that targets, functions, and args have equal length in propose,
queue, and execute, returning Error::MismatchedProposalArrays instead of
risking an out-of-bounds trap.
@vercel

vercel Bot commented Sep 29, 2026

Copy link
Copy Markdown

@libby-coder is attempting to deploy a commit to the gbangbolaoluwagbemiga's projects Team on Vercel.

A member of the Team first needs to authorize it.

@drips-wave

drips-wave Bot commented Sep 29, 2026

Copy link
Copy Markdown

@libby-coder Great news! 🎉 Based on an automated assessment of this PR, the linked Wave issue(s) no longer count against your application limits.

You can now already apply to more issues while waiting for a review of this PR. Keep up the great work! 🚀

Learn more about application limits

@Gbangbolaoluwagbemiga
Gbangbolaoluwagbemiga merged commit 8cdd388 into HyperSafeD:main Sep 30, 2026
35 of 50 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

2 participants