Context.sol 1.1 KB

12345678910111213141516171819202122232425262728
  1. // SPDX-License-Identifier: MIT
  2. pragma solidity ^0.6.0;
  3. /*
  4. * @dev Provides information about the current execution context, including the
  5. * sender of the transaction and its data. While these are generally available
  6. * via msg.sender and msg.data, they should not be accessed in such a direct
  7. * manner, since when dealing with GSN meta-transactions the account sending and
  8. * paying for execution may not be the actual sender (as far as an application
  9. * is concerned).
  10. *
  11. * This contract is only required for intermediate, library-like contracts.
  12. */
  13. contract Context {
  14. // Empty internal constructor, to prevent people from mistakenly deploying
  15. // an instance of this contract, which should be used via inheritance.
  16. constructor () internal { }
  17. function _msgSender() internal view virtual returns (address payable) {
  18. return msg.sender;
  19. }
  20. function _msgData() internal view virtual returns (bytes memory) {
  21. this; // silence state mutability warning without generating bytecode - see https://github.com/ethereum/solidity/issues/2691
  22. return msg.data;
  23. }
  24. }