Skip to content

GovernorCompatibilityBravo encodes calldata incorrectly #3099

Closed
@GeraldHost

Description

When using the propose function in GovernorCompatibilityBravo with function signatures along with calldata the resulting encoded calldata is incorrect.

💻 Environment

4.4.1

📝 Details

It seems that calling propose in GovernorCompatibilityBravo with signatures and calldata ends up calling
function _encodeCalldata(string[] memory signatures, bytes[] memory calldatas)
which then calls
abi.encodeWithSignature(signatures[i], calldatas[i]).
This causes the calldata + signature to be encoded incorrectly.

In GovernorBravo the calldata and signatures get sent to the timelock seperatley and they then get encoded with: abi.encodePacked(bytes4(keccak256(bytes(signature))), data);

As I understand it the issue is that abi.encodeWithSignature is expecting the arguments to be like this: abi.encodeWithSignature(add(uint256, uint256), 1, 2)
but really it is getting this
abi.encodeWithSignature("add(uint256,uint256)", 0x0...010....02).

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions