ContextMock.sol 762 B

123456789101112131415161718192021222324252627282930313233
  1. // SPDX-License-Identifier: MIT
  2. pragma solidity ^0.8.0;
  3. import "../utils/Context.sol";
  4. contract ContextMock is Context {
  5. event Sender(address sender);
  6. function msgSender() public {
  7. emit Sender(_msgSender());
  8. }
  9. event Data(bytes data, uint256 integerValue, string stringValue);
  10. function msgData(uint256 integerValue, string memory stringValue) public {
  11. emit Data(_msgData(), integerValue, stringValue);
  12. }
  13. }
  14. contract ContextMockCaller {
  15. function callSender(ContextMock context) public {
  16. context.msgSender();
  17. }
  18. function callData(
  19. ContextMock context,
  20. uint256 integerValue,
  21. string memory stringValue
  22. ) public {
  23. context.msgData(integerValue, stringValue);
  24. }
  25. }