Skip to content

feat(multisig): validate amount > 0 and to != from in submit_transaction - #337

Closed
benzy018 wants to merge 1 commit into
VertexChainLabs:mainfrom
benzy018:feat/multisig-submit-tx-validation
Closed

feat(multisig): validate amount > 0 and to != from in submit_transaction#337
benzy018 wants to merge 1 commit into
VertexChainLabs:mainfrom
benzy018:feat/multisig-submit-tx-validation

Conversation

@benzy018

Copy link
Copy Markdown
Contributor

Summary

Fixes two missing input validations in submit_transaction that allowed griefing and silent storage inflation.

Changes

contracts/multisig/src/lib.rs

Why

  • amount <= 0: Storing pending transactions with zero or negative amounts silently inflates the persistent storage budget with useless entries.
  • to == from (self-transfer): A signer sending to themselves is a semantic no-op and can be used to grief the contract by burning approvals.

Testing

Tests use #[should_panic(expected = "Error(Contract, #N)")] matching the #[repr(u32)] discriminants, consistent with existing test patterns in the file.

Closes #130

- Add SelfTransfer = 14 to MultiSigError enum
- Reject amount <= 0 with InvalidAmount (VertexChainLabs#6) in submit_transaction
- Reject to == from (self-transfer) with SelfTransfer (VertexChainLabs#14)
- Add tests: rejects zero amount, negative amount, and self-transfer

Closes VertexChainLabs#130
@benzy018 benzy018 closed this Jul 20, 2026
@benzy018
benzy018 deleted the feat/multisig-submit-tx-validation branch July 20, 2026 13:08
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Multisig: validate amount > 0 and validate to != from in submit_transaction

1 participant