diff --git a/contracts/metatx/ERC2771Context.sol b/contracts/metatx/ERC2771Context.sol index d6b50a28aac..ae0a284f897 100644 --- a/contracts/metatx/ERC2771Context.sol +++ b/contracts/metatx/ERC2771Context.sol @@ -1,6 +1,6 @@ // SPDX-License-Identifier: MIT -pragma solidity ^0.8.0; +pragma solidity ^0.8.8; import "../utils/Context.sol"; @@ -8,7 +8,7 @@ import "../utils/Context.sol"; * @dev Context variant with ERC2771 support. */ abstract contract ERC2771Context is Context { - address private _trustedForwarder; + address private immutable _trustedForwarder; constructor(address trustedForwarder) { _trustedForwarder = trustedForwarder; diff --git a/contracts/mocks/ERC2771ContextMock.sol b/contracts/mocks/ERC2771ContextMock.sol index 7bc1c4538dc..e466c07db21 100644 --- a/contracts/mocks/ERC2771ContextMock.sol +++ b/contracts/mocks/ERC2771ContextMock.sol @@ -1,13 +1,15 @@ // SPDX-License-Identifier: MIT -pragma solidity ^0.8.0; +pragma solidity ^0.8.8; import "./ContextMock.sol"; import "../metatx/ERC2771Context.sol"; // By inheriting from ERC2771Context, Context's internal functions are overridden automatically contract ERC2771ContextMock is ContextMock, ERC2771Context { - constructor(address trustedForwarder) ERC2771Context(trustedForwarder) {} + constructor(address trustedForwarder) ERC2771Context(trustedForwarder) { + emit Sender(_msgSender()); // _msgSender() should be accessible during construction + } function _msgSender() internal view virtual override(Context, ERC2771Context) returns (address) { return ERC2771Context._msgSender(); diff --git a/hardhat.config.js b/hardhat.config.js index aaa1ca03606..d12a1914c56 100644 --- a/hardhat.config.js +++ b/hardhat.config.js @@ -33,7 +33,7 @@ const argv = require('yargs/yargs')() compiler: { alias: 'compileVersion', type: 'string', - default: '0.8.3', + default: '0.8.9', }, coinmarketcap: { alias: 'coinmarketcapApiKey',