From cdd128e9da3eb654f07b5724597aa9181821efe4 Mon Sep 17 00:00:00 2001 From: Hadrien Croubois Date: Mon, 16 Jan 2023 16:59:32 +0100 Subject: [PATCH 1/2] make acceptOwnership virtual --- contracts/access/Ownable2Step.sol | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/contracts/access/Ownable2Step.sol b/contracts/access/Ownable2Step.sol index 2217063004a..f5a3d8047ca 100644 --- a/contracts/access/Ownable2Step.sol +++ b/contracts/access/Ownable2Step.sol @@ -49,7 +49,7 @@ abstract contract Ownable2Step is Ownable { /** * @dev The new owner accepts the ownership transfer. */ - function acceptOwnership() external { + function acceptOwnership() public virtual { address sender = _msgSender(); require(pendingOwner() == sender, "Ownable2Step: caller is not the new owner"); _transferOwnership(sender); From d25ef2cf04ba6648c8fee9727cc81bc33a87f8f2 Mon Sep 17 00:00:00 2001 From: Hadrien Croubois Date: Tue, 17 Jan 2023 22:56:31 +0100 Subject: [PATCH 2/2] add changelog entry --- CHANGELOG.md | 1 + 1 file changed, 1 insertion(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index df75069f93e..5d45e926416 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -11,6 +11,7 @@ * `Strings`: add `toString` method for signed integers. ([#3773](https://github.com/OpenZeppelin/openzeppelin-contracts/pull/3773)) * `MerkleProof`: optimize by using unchecked arithmetic. ([#3869](https://github.com/OpenZeppelin/openzeppelin-contracts/pull/3869)) * `EnumerableMap`: add a `keys()` function that returns an array containing all the keys. ([#3920](https://github.com/OpenZeppelin/openzeppelin-contracts/pull/3920)) + * `Ownable2Step`: make `acceptOwnership` public virtual to enable usecases that require overriding it. ([#3960](https://github.com/OpenZeppelin/openzeppelin-contracts/pull/3960)) ### Deprecations