Skip to content

Commit

Permalink
Merge branch 'master' into master
Browse files Browse the repository at this point in the history
  • Loading branch information
frangio committed Sep 1, 2022
2 parents 84f3b9f + 160bf1a commit fca0901
Show file tree
Hide file tree
Showing 25 changed files with 166 additions and 111 deletions.
4 changes: 3 additions & 1 deletion CHANGELOG.md
Expand Up @@ -17,14 +17,16 @@
* `ERC721`: use unchecked arithmetic for balance updates. ([#3524](https://github.com/OpenZeppelin/openzeppelin-contracts/pull/3524))
* `ReentrancyGuard`: Reduce code size impact of the modifier by using internal functions. ([#3515](https://github.com/OpenZeppelin/openzeppelin-contracts/pull/3515))
* `SafeCast`: optimize downcasting of signed integers. ([#3565](https://github.com/OpenZeppelin/openzeppelin-contracts/pull/3565))
* `VestingWallet`: remove unused library `Math.sol`. ([#3605](https://github.com/OpenZeppelin/openzeppelin-contracts/pull/3605))
* `ECDSA`: Remove redundant check on the `v` value. ([#3591](https://github.com/OpenZeppelin/openzeppelin-contracts/pull/3591))
* `VestingWallet`: add `releasable` getters. ([#3580](https://github.com/OpenZeppelin/openzeppelin-contracts/pull/3580))
* `VestingWallet`: remove unused library `Math.sol`. ([#3605](https://github.com/OpenZeppelin/openzeppelin-contracts/pull/3605))
* `VestingWallet`: make constructor payable. ([#3665](https://github.com/OpenZeppelin/openzeppelin-contracts/pull/3665))
* `Create2`: optimize address computation by using assembly instead of `abi.encodePacked`. ([#3600](https://github.com/OpenZeppelin/openzeppelin-contracts/pull/3600))
* `Clones`: optimized the assembly to use only the scratch space during deployments, and optimized `predictDeterministicAddress` to use lesser operations. ([#3640](https://github.com/OpenZeppelin/openzeppelin-contracts/pull/3640))
* `Checkpoints`: Use procedural generation to support multiple key/value lengths. ([#3589](https://github.com/OpenZeppelin/openzeppelin-contracts/pull/3589))
* `Checkpoints`: Add new lookup mechanisms. ([#3589](https://github.com/OpenZeppelin/openzeppelin-contracts/pull/3589))
* `Array`: Add `unsafeAccess` functions that allow reading and writing to an element in a storage array bypassing Solidity's "out-of-bounds" check. ([#3589](https://github.com/OpenZeppelin/openzeppelin-contracts/pull/3589))
* `Strings`: optimize `toString`. ([#3573](https://github.com/OpenZeppelin/openzeppelin-contracts/pull/3573))
* `Ownable2Step`: extension of `Ownable` that makes the ownership transfers a two step process. ([#3620](https://github.com/OpenZeppelin/openzeppelin-contracts/pull/3620))

### Breaking changes
Expand Down
2 changes: 1 addition & 1 deletion contracts/finance/VestingWallet.sol
Expand Up @@ -33,7 +33,7 @@ contract VestingWallet is Context {
address beneficiaryAddress,
uint64 startTimestamp,
uint64 durationSeconds
) {
) payable {
require(beneficiaryAddress != address(0), "VestingWallet: beneficiary is zero address");
_beneficiary = beneficiaryAddress;
_start = startTimestamp;
Expand Down
2 changes: 1 addition & 1 deletion contracts/mocks/AccessControlCrossChainMock.sol
Expand Up @@ -16,7 +16,7 @@ contract AccessControlCrossChainMock is AccessControlCrossChain, CrossChainEnabl

function senderProtected(bytes32 roleId) public onlyRole(roleId) {}

function crossChainRoleAlias(bytes32 role) public pure virtual returns (bytes32) {
function crossChainRoleAlias(bytes32 role) public pure returns (bytes32) {
return _crossChainRoleAlias(role);
}
}
2 changes: 1 addition & 1 deletion contracts/mocks/ERC1155PausableMock.sol
Expand Up @@ -23,7 +23,7 @@ contract ERC1155PausableMock is ERC1155Mock, ERC1155Pausable {
uint256[] memory ids,
uint256[] memory amounts,
bytes memory data
) internal virtual override(ERC1155, ERC1155Pausable) {
) internal override(ERC1155, ERC1155Pausable) {
super._beforeTokenTransfer(operator, from, to, ids, amounts, data);
}
}
2 changes: 1 addition & 1 deletion contracts/mocks/ERC1155SupplyMock.sol
Expand Up @@ -15,7 +15,7 @@ contract ERC1155SupplyMock is ERC1155Mock, ERC1155Supply {
uint256[] memory ids,
uint256[] memory amounts,
bytes memory data
) internal virtual override(ERC1155, ERC1155Supply) {
) internal override(ERC1155, ERC1155Supply) {
super._beforeTokenTransfer(operator, from, to, ids, amounts, data);
}
}
2 changes: 1 addition & 1 deletion contracts/mocks/ERC1155URIStorageMock.sol
Expand Up @@ -8,7 +8,7 @@ import "../token/ERC1155/extensions/ERC1155URIStorage.sol";
contract ERC1155URIStorageMock is ERC1155Mock, ERC1155URIStorage {
constructor(string memory _uri) ERC1155Mock(_uri) {}

function uri(uint256 tokenId) public view virtual override(ERC1155, ERC1155URIStorage) returns (string memory) {
function uri(uint256 tokenId) public view override(ERC1155, ERC1155URIStorage) returns (string memory) {
return ERC1155URIStorage.uri(tokenId);
}

Expand Down
2 changes: 1 addition & 1 deletion contracts/mocks/ERC165/ERC165ReturnBomb.sol
Expand Up @@ -5,7 +5,7 @@ pragma solidity ^0.8.0;
import "../../utils/introspection/IERC165.sol";

contract ERC165ReturnBombMock is IERC165 {
function supportsInterface(bytes4 interfaceId) public view virtual override returns (bool) {
function supportsInterface(bytes4 interfaceId) public view override returns (bool) {
if (interfaceId == type(IERC165).interfaceId) {
assembly {
mstore(0, 1)
Expand Down
2 changes: 1 addition & 1 deletion contracts/mocks/ERC20DecimalsMock.sol
Expand Up @@ -15,7 +15,7 @@ contract ERC20DecimalsMock is ERC20 {
_decimals = decimals_;
}

function decimals() public view virtual override returns (uint8) {
function decimals() public view override returns (uint8) {
return _decimals;
}

Expand Down
4 changes: 2 additions & 2 deletions contracts/mocks/ERC2771ContextMock.sol
Expand Up @@ -12,11 +12,11 @@ contract ERC2771ContextMock is ContextMock, ERC2771Context {
emit Sender(_msgSender()); // _msgSender() should be accessible during construction
}

function _msgSender() internal view virtual override(Context, ERC2771Context) returns (address) {
function _msgSender() internal view override(Context, ERC2771Context) returns (address) {
return ERC2771Context._msgSender();
}

function _msgData() internal view virtual override(Context, ERC2771Context) returns (bytes calldata) {
function _msgData() internal view override(Context, ERC2771Context) returns (bytes calldata) {
return ERC2771Context._msgData();
}
}
2 changes: 1 addition & 1 deletion contracts/mocks/ERC721EnumerableMock.sol
Expand Up @@ -13,7 +13,7 @@ contract ERC721EnumerableMock is ERC721Enumerable {

constructor(string memory name, string memory symbol) ERC721(name, symbol) {}

function _baseURI() internal view virtual override returns (string memory) {
function _baseURI() internal view override returns (string memory) {
return _baseTokenURI;
}

Expand Down
2 changes: 1 addition & 1 deletion contracts/mocks/ERC721URIStorageMock.sol
Expand Up @@ -13,7 +13,7 @@ contract ERC721URIStorageMock is ERC721URIStorage {

constructor(string memory name, string memory symbol) ERC721(name, symbol) {}

function _baseURI() internal view virtual override returns (string memory) {
function _baseURI() internal view override returns (string memory) {
return _baseTokenURI;
}

Expand Down
15 changes: 6 additions & 9 deletions contracts/mocks/GovernorCompatibilityBravoMock.sol
Expand Up @@ -30,7 +30,6 @@ contract GovernorCompatibilityBravoMock is
function supportsInterface(bytes4 interfaceId)
public
view
virtual
override(IERC165, Governor, GovernorTimelockCompound)
returns (bool)
{
Expand All @@ -44,7 +43,6 @@ contract GovernorCompatibilityBravoMock is
function state(uint256 proposalId)
public
view
virtual
override(IGovernor, Governor, GovernorTimelockCompound)
returns (ProposalState)
{
Expand All @@ -54,7 +52,6 @@ contract GovernorCompatibilityBravoMock is
function proposalEta(uint256 proposalId)
public
view
virtual
override(IGovernorTimelock, GovernorTimelockCompound)
returns (uint256)
{
Expand All @@ -70,7 +67,7 @@ contract GovernorCompatibilityBravoMock is
uint256[] memory values,
bytes[] memory calldatas,
string memory description
) public virtual override(IGovernor, Governor, GovernorCompatibilityBravo) returns (uint256) {
) public override(IGovernor, Governor, GovernorCompatibilityBravo) returns (uint256) {
return super.propose(targets, values, calldatas, description);
}

Expand All @@ -79,7 +76,7 @@ contract GovernorCompatibilityBravoMock is
uint256[] memory values,
bytes[] memory calldatas,
bytes32 salt
) public virtual override(IGovernorTimelock, GovernorTimelockCompound) returns (uint256) {
) public override(IGovernorTimelock, GovernorTimelockCompound) returns (uint256) {
return super.queue(targets, values, calldatas, salt);
}

Expand All @@ -88,7 +85,7 @@ contract GovernorCompatibilityBravoMock is
uint256[] memory values,
bytes[] memory calldatas,
bytes32 salt
) public payable virtual override(IGovernor, Governor) returns (uint256) {
) public payable override(IGovernor, Governor) returns (uint256) {
return super.execute(targets, values, calldatas, salt);
}

Expand All @@ -98,7 +95,7 @@ contract GovernorCompatibilityBravoMock is
uint256[] memory values,
bytes[] memory calldatas,
bytes32 descriptionHash
) internal virtual override(Governor, GovernorTimelockCompound) {
) internal override(Governor, GovernorTimelockCompound) {
super._execute(proposalId, targets, values, calldatas, descriptionHash);
}

Expand All @@ -120,11 +117,11 @@ contract GovernorCompatibilityBravoMock is
uint256[] memory values,
bytes[] memory calldatas,
bytes32 salt
) internal virtual override(Governor, GovernorTimelockCompound) returns (uint256 proposalId) {
) internal override(Governor, GovernorTimelockCompound) returns (uint256 proposalId) {
return super._cancel(targets, values, calldatas, salt);
}

function _executor() internal view virtual override(Governor, GovernorTimelockCompound) returns (address) {
function _executor() internal view override(Governor, GovernorTimelockCompound) returns (address) {
return super._executor();
}
}
2 changes: 1 addition & 1 deletion contracts/mocks/GovernorMock.sol
Expand Up @@ -44,7 +44,7 @@ contract GovernorMock is
uint256[] memory values,
bytes[] memory calldatas,
string memory description
) public virtual override(Governor, GovernorProposalThreshold) returns (uint256) {
) public override(Governor, GovernorProposalThreshold) returns (uint256) {
return super.propose(targets, values, calldatas, description);
}
}
7 changes: 3 additions & 4 deletions contracts/mocks/GovernorPreventLateQuorumMock.sol
Expand Up @@ -31,21 +31,20 @@ contract GovernorPreventLateQuorumMock is
_quorum = quorum_;
}

function quorum(uint256) public view virtual override returns (uint256) {
function quorum(uint256) public view override returns (uint256) {
return _quorum;
}

function proposalDeadline(uint256 proposalId)
public
view
virtual
override(Governor, GovernorPreventLateQuorum)
returns (uint256)
{
return super.proposalDeadline(proposalId);
}

function proposalThreshold() public view virtual override(Governor, GovernorSettings) returns (uint256) {
function proposalThreshold() public view override(Governor, GovernorSettings) returns (uint256) {
return super.proposalThreshold();
}

Expand All @@ -55,7 +54,7 @@ contract GovernorPreventLateQuorumMock is
uint8 support,
string memory reason,
bytes memory params
) internal virtual override(Governor, GovernorPreventLateQuorum) returns (uint256) {
) internal override(Governor, GovernorPreventLateQuorum) returns (uint256) {
return super._castVote(proposalId, account, support, reason, params);
}
}
8 changes: 3 additions & 5 deletions contracts/mocks/GovernorTimelockCompoundMock.sol
Expand Up @@ -31,7 +31,6 @@ contract GovernorTimelockCompoundMock is
function supportsInterface(bytes4 interfaceId)
public
view
virtual
override(Governor, GovernorTimelockCompound)
returns (bool)
{
Expand Down Expand Up @@ -62,7 +61,6 @@ contract GovernorTimelockCompoundMock is
function state(uint256 proposalId)
public
view
virtual
override(Governor, GovernorTimelockCompound)
returns (ProposalState)
{
Expand All @@ -79,7 +77,7 @@ contract GovernorTimelockCompoundMock is
uint256[] memory values,
bytes[] memory calldatas,
bytes32 descriptionHash
) internal virtual override(Governor, GovernorTimelockCompound) {
) internal override(Governor, GovernorTimelockCompound) {
super._execute(proposalId, targets, values, calldatas, descriptionHash);
}

Expand All @@ -88,11 +86,11 @@ contract GovernorTimelockCompoundMock is
uint256[] memory values,
bytes[] memory calldatas,
bytes32 salt
) internal virtual override(Governor, GovernorTimelockCompound) returns (uint256 proposalId) {
) internal override(Governor, GovernorTimelockCompound) returns (uint256 proposalId) {
return super._cancel(targets, values, calldatas, salt);
}

function _executor() internal view virtual override(Governor, GovernorTimelockCompound) returns (address) {
function _executor() internal view override(Governor, GovernorTimelockCompound) returns (address) {
return super._executor();
}
}
15 changes: 4 additions & 11 deletions contracts/mocks/GovernorTimelockControlMock.sol
Expand Up @@ -31,7 +31,6 @@ contract GovernorTimelockControlMock is
function supportsInterface(bytes4 interfaceId)
public
view
virtual
override(Governor, GovernorTimelockControl)
returns (bool)
{
Expand Down Expand Up @@ -59,13 +58,7 @@ contract GovernorTimelockControlMock is
/**
* Overriding nightmare
*/
function state(uint256 proposalId)
public
view
virtual
override(Governor, GovernorTimelockControl)
returns (ProposalState)
{
function state(uint256 proposalId) public view override(Governor, GovernorTimelockControl) returns (ProposalState) {
return super.state(proposalId);
}

Expand All @@ -79,7 +72,7 @@ contract GovernorTimelockControlMock is
uint256[] memory values,
bytes[] memory calldatas,
bytes32 descriptionHash
) internal virtual override(Governor, GovernorTimelockControl) {
) internal override(Governor, GovernorTimelockControl) {
super._execute(proposalId, targets, values, calldatas, descriptionHash);
}

Expand All @@ -88,11 +81,11 @@ contract GovernorTimelockControlMock is
uint256[] memory values,
bytes[] memory calldatas,
bytes32 descriptionHash
) internal virtual override(Governor, GovernorTimelockControl) returns (uint256 proposalId) {
) internal override(Governor, GovernorTimelockControl) returns (uint256 proposalId) {
return super._cancel(targets, values, calldatas, descriptionHash);
}

function _executor() internal view virtual override(Governor, GovernorTimelockControl) returns (address) {
function _executor() internal view override(Governor, GovernorTimelockControl) returns (address) {
return super._executor();
}

Expand Down
4 changes: 2 additions & 2 deletions contracts/mocks/GovernorWithParamsMock.sol
Expand Up @@ -26,7 +26,7 @@ contract GovernorWithParamsMock is GovernorVotes, GovernorCountingSimple {
address account,
uint256 blockNumber,
bytes memory params
) internal view virtual override(Governor, GovernorVotes) returns (uint256) {
) internal view override(Governor, GovernorVotes) returns (uint256) {
uint256 reduction = 0;
// If the user provides parameters, we reduce the voting weight by the amount of the integer param
if (params.length > 0) {
Expand All @@ -42,7 +42,7 @@ contract GovernorWithParamsMock is GovernorVotes, GovernorCountingSimple {
uint8 support,
uint256 weight,
bytes memory params
) internal virtual override(Governor, GovernorCountingSimple) {
) internal override(Governor, GovernorCountingSimple) {
if (params.length > 0) {
(uint256 _uintParam, string memory _strParam) = abi.decode(params, (uint256, string));
emit CountParams(_uintParam, _strParam);
Expand Down
4 changes: 2 additions & 2 deletions contracts/mocks/MultipleInheritanceInitializableMocks.sol
Expand Up @@ -42,7 +42,7 @@ contract SampleHuman is Initializable {
contract SampleMother is Initializable, SampleHuman {
uint256 public mother;

function initialize(uint256 value) public virtual initializer {
function initialize(uint256 value) public initializer {
__SampleMother_init(value);
}

Expand All @@ -64,7 +64,7 @@ contract SampleMother is Initializable, SampleHuman {
contract SampleGramps is Initializable, SampleHuman {
string public gramps;

function initialize(string memory value) public virtual initializer {
function initialize(string memory value) public initializer {
__SampleGramps_init(value);
}

Expand Down
4 changes: 2 additions & 2 deletions contracts/mocks/SafeERC20Helper.sol
Expand Up @@ -122,7 +122,7 @@ contract ERC20PermitNoRevertMock is
uint8 v,
bytes32 r,
bytes32 s
) public virtual {
) public {
super.permit(owner, spender, value, deadline, v, r, s);
}

Expand All @@ -134,7 +134,7 @@ contract ERC20PermitNoRevertMock is
uint8 v,
bytes32 r,
bytes32 s
) public virtual override {
) public override {
try this.permitThatMayRevert(owner, spender, value, deadline, v, r, s) {
// do nothing
} catch {
Expand Down
8 changes: 4 additions & 4 deletions contracts/mocks/StringsMock.sol
Expand Up @@ -5,19 +5,19 @@ pragma solidity ^0.8.0;
import "../utils/Strings.sol";

contract StringsMock {
function fromUint256(uint256 value) public pure returns (string memory) {
function toString(uint256 value) public pure returns (string memory) {
return Strings.toString(value);
}

function fromUint256Hex(uint256 value) public pure returns (string memory) {
function toHexString(uint256 value) public pure returns (string memory) {
return Strings.toHexString(value);
}

function fromUint256HexFixed(uint256 value, uint256 length) public pure returns (string memory) {
function toHexString(uint256 value, uint256 length) public pure returns (string memory) {
return Strings.toHexString(value, length);
}

function fromAddressHexFixed(address addr) public pure returns (string memory) {
function toHexString(address addr) public pure returns (string memory) {
return Strings.toHexString(addr);
}
}

0 comments on commit fca0901

Please sign in to comment.