Use private instead of immutable in ERC2771Context (#2754)

This commit is contained in:
Hadrien Croubois
2021-07-06 19:41:03 +02:00
committed by GitHub
parent 15b92e4097
commit 23b3807ea7
2 changed files with 5 additions and 1 deletions

View File

@ -1,5 +1,9 @@
# Changelog
## Unreleased
* `ERC2771Context`: use private variable from storage to store the forwarder address. Fixes issues where `_msgSender()` was not callable from constructors. ([#2754](https://github.com/OpenZeppelin/openzeppelin-contracts/pull/2754))
## 4.2.0 (2021-06-30)
* `ERC20Votes`: add a new extension of the `ERC20` token with support for voting snapshots and delegation. ([#2632](https://github.com/OpenZeppelin/openzeppelin-contracts/pull/2632))

View File

@ -8,7 +8,7 @@ import "../utils/Context.sol";
* @dev Context variant with ERC2771 support.
*/
abstract contract ERC2771Context is Context {
address immutable _trustedForwarder;
address private _trustedForwarder;
constructor(address trustedForwarder) {
_trustedForwarder = trustedForwarder;