Co-authored-by: Hadrien Croubois <hadrien.croubois@gmail.com> Co-authored-by: ernestognw <ernestognw@gmail.com>
24 lines
894 B
Solidity
24 lines
894 B
Solidity
// SPDX-License-Identifier: MIT
|
|
|
|
pragma solidity ^0.8.19;
|
|
|
|
import {ContextMock} from "./ContextMock.sol";
|
|
import {Context} from "../utils/Context.sol";
|
|
import {ERC2771Context} from "../metatx/ERC2771Context.sol";
|
|
|
|
// By inheriting from ERC2771Context, Context's internal functions are overridden automatically
|
|
contract ERC2771ContextMock is ContextMock, ERC2771Context {
|
|
/// @custom:oz-upgrades-unsafe-allow constructor
|
|
constructor(address trustedForwarder) ERC2771Context(trustedForwarder) {
|
|
emit Sender(_msgSender()); // _msgSender() should be accessible during construction
|
|
}
|
|
|
|
function _msgSender() internal view override(Context, ERC2771Context) returns (address) {
|
|
return ERC2771Context._msgSender();
|
|
}
|
|
|
|
function _msgData() internal view override(Context, ERC2771Context) returns (bytes calldata) {
|
|
return ERC2771Context._msgData();
|
|
}
|
|
}
|