-
Notifications
You must be signed in to change notification settings - Fork 11.9k
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
GovernorCompatibilityBravo encodes calldata incorrectly #3099
Comments
Thank you for reporting this I believe you're correct, we'll release a fix as soon as possible. |
3 tasks
@GeraldHost can you confirm #3100 addresses your findings? |
@Amxx yes looks good thank you! |
This was referenced Jan 13, 2022
Merged
This was referenced Jan 21, 2022
This was referenced Feb 9, 2022
1 task
1 task
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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)
.The text was updated successfully, but these errors were encountered: