Skip to content

Commit 06ab69e

Browse files
Transpile 79cb606
1 parent 3ff38d8 commit 06ab69e

File tree

9 files changed

+422
-616
lines changed

9 files changed

+422
-616
lines changed

CHANGELOG.md

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,10 @@
11
# Changelog
22

3+
## 4.4.2 (2022-01-11)
4+
5+
### Bugfixes
6+
* `GovernorCompatibilityBravo`: Fix error in the encoding of calldata for proposals submitted through the compatibility interface with explicit signatures. ([#3100](https://github.com/OpenZeppelin/openzeppelin-contracts/pull/#3100))
7+
38
## 4.4.1 (2021-12-14)
49

510
* `Initializable`: change the existing `initializer` modifier and add a new `onlyInitializing` modifier to prevent reentrancy risk. ([#3006](https://github.com/OpenZeppelin/openzeppelin-contracts/pull/3006))

contracts/governance/compatibility/GovernorCompatibilityBravoUpgradeable.sol

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
// SPDX-License-Identifier: MIT
2-
// OpenZeppelin Contracts v4.4.1 (governance/compatibility/GovernorCompatibilityBravo.sol)
2+
// OpenZeppelin Contracts (last updated v4.4.2) (governance/compatibility/GovernorCompatibilityBravo.sol)
33

44
pragma solidity ^0.8.0;
55

@@ -144,7 +144,7 @@ abstract contract GovernorCompatibilityBravoUpgradeable is Initializable, IGover
144144
for (uint256 i = 0; i < signatures.length; ++i) {
145145
fullcalldatas[i] = bytes(signatures[i]).length == 0
146146
? calldatas[i]
147-
: abi.encodeWithSignature(signatures[i], calldatas[i]);
147+
: abi.encodePacked(bytes4(keccak256(bytes(signatures[i]))), calldatas[i]);
148148
}
149149

150150
return fullcalldatas;

contracts/mocks/CallReceiverMockUpgradeable.sol

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ contract CallReceiverMockUpgradeable is Initializable {
1313
string public sharedAnswer;
1414

1515
event MockFunctionCalled();
16+
event MockFunctionCalledWithArgs(uint256 a, uint256 b);
1617

1718
uint256[] private _array;
1819

@@ -22,6 +23,12 @@ contract CallReceiverMockUpgradeable is Initializable {
2223
return "0x1234";
2324
}
2425

26+
function mockFunctionWithArgs(uint256 a, uint256 b) public payable returns (string memory) {
27+
emit MockFunctionCalledWithArgs(a, b);
28+
29+
return "0x1234";
30+
}
31+
2532
function mockFunctionNonPayable() public returns (string memory) {
2633
emit MockFunctionCalled();
2734

contracts/package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
{
22
"name": "@openzeppelin/contracts-upgradeable",
33
"description": "Secure Smart Contract library for Solidity",
4-
"version": "4.4.1",
4+
"version": "4.4.2",
55
"files": [
66
"**/*.sol",
77
"/build/contracts/*.json",

0 commit comments

Comments
 (0)