Skip to content

Conversation

@SynnekOG
Copy link

Summary

This PR enhances MultiSigContractV2 with new custom error definitions to improve transaction validation, debugging clarity, and gas efficiency compared to traditional require strings. These errors provide precise failure reasons in multisignature transaction flows.


Changes

src/MultiSigContractV2.sol

  • Added 5 new custom errors:

    • MultiSigContract__NotSigned
      Thrown when a signer attempts to execute or finalize a transaction without having signed it.
    • MultiSigContract__InvalidTransaction
      Raised if the transaction does not meet validity checks (e.g., malformed or nonexistent).
    • MultiSigContract__TransactionExpired
      Ensures transactions past their expiration window cannot be executed.
    • MultiSigContract__TransactionNotReady
      Indicates an attempt to execute a transaction before required conditions (e.g., sufficient signatures) are met.
    • MultiSigContract__InvalidSignerCount
      Prevents execution if signer count is below quorum or exceeds allowable thresholds.
  • Ran forge fmt to enforce consistent formatting.


Motivation

  • Improved Error Handling: Provides explicit, gas-efficient error reporting to users and developers.
  • Transaction Safety: Ensures invalid, expired, or premature transactions cannot be executed.
  • Governance Clarity: Custom errors clearly define failure modes, making multisig governance flows easier to audit and debug.

Next Steps

  • Integrate these errors into transaction lifecycle functions (propose, sign, execute).
  • Expand test coverage to assert these errors are thrown under invalid conditions.
  • Update Natspec documentation to reference new error semantics for auditors and integrators.

@2PykeETH 2PykeETH self-requested a review September 26, 2025 17:02
@2PykeETH 2PykeETH added documentation Improvements or additions to documentation enhancement New feature or request labels Sep 26, 2025
@2PykeETH 2PykeETH merged commit f00c061 into CraftMeme:main Sep 26, 2025
1 check failed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

documentation Improvements or additions to documentation enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants