Skip to content

Conversation

@SynnekOG
Copy link

Summary

This PR enhances MultiSigContractV2 by introducing new custom errors related to signer management and signature validation. These errors strengthen the security, auditability, and maintainability of multisignature operations, while improving gas efficiency compared to string-based reverts.


Changes

src/MultiSigContractV2.sol

  • Added 4 new custom errors:

    • MultiSigContract__SignerAlreadyExists
      Raised when attempting to add a signer that is already part of the multisig group.
    • MultiSigContract__SignerNotFound
      Thrown when an operation references a signer that does not exist in the multisig group.
    • MultiSigContract__InsufficientSignatures
      Raised if a transaction does not have enough valid signatures to meet the quorum requirement.
    • MultiSigContract__InvalidAddress
      Prevents use of invalid or zero addresses in critical signer-related operations.
  • Ran forge fmt to apply consistent formatting across the contract.


Motivation

  • Strengthen signer lifecycle management by clearly handling duplicate or missing signers.
  • Prevent execution of under-signed transactions, reinforcing quorum requirements.
  • Enhance developer experience with explicit error messages that simplify debugging and auditing.
  • Reduce gas costs by replacing revert strings with efficient custom errors.

Next Steps

  • Integrate these errors into signer management functions (addSigner, removeSigner, replaceSigner) and transaction execution logic.
  • Expand test coverage to validate each new error path (e.g., duplicate signers, missing signers, insufficient quorum).
  • Update Natspec documentation to reflect new error semantics for external auditors and developers.

@2PykeETH 2PykeETH self-requested a review September 27, 2025 20:32
@2PykeETH 2PykeETH added documentation Improvements or additions to documentation enhancement New feature or request labels Sep 27, 2025
@2PykeETH 2PykeETH merged commit ac77358 into CraftMeme:main Sep 27, 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