Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Not panic when we ADD more signatures than required. #499

Open
Ethnical opened this issue Jan 29, 2025 · 0 comments
Open

Not panic when we ADD more signatures than required. #499

Ethnical opened this issue Jan 29, 2025 · 0 comments

Comments

@Ethnical
Copy link
Contributor

Ethnical commented Jan 29, 2025

During an execution if one of the signer was a nested safe this and we add more signature this will cause a panic because the array is too big..
Image

This is because the code here append the signature with the address making the array to big and will iterate on an incorrect count instead of counting the exact number of sig this will count the exact number of sig + 1.
Like this:

    function prepareSignatures(
        address _safe,
        bytes32 hash,
        bytes memory _signatures
    ) internal view returns (bytes memory) {
        // prepend the prevalidated signatures to the signatures
        address[] memory approvers = getApprovers(_safe, hash);
        bytes memory prevalidatedSignatures = genPrevalidatedSignatures(
            approvers
        );
        _signatures = bytes.concat(prevalidatedSignatures, _signatures); //Not sure why this also append the nested approver (signer that used the ApprovalHash method). 

https://github.com/base-org/contracts/blob/494586571e1a4d845ee6f381b65229d63c630986/script/universal/Signatures.sol#L18

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

No branches or pull requests

1 participant