ContextMock.sol 862 B

1234567891011121314151617181920212223242526272829303132333435
  1. // SPDX-License-Identifier: MIT
  2. pragma solidity ^0.8.19;
  3. import {Context} from "../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. event DataShort(bytes data);
  14. function msgDataShort() public {
  15. emit DataShort(_msgData());
  16. }
  17. }
  18. contract ContextMockCaller {
  19. function callSender(ContextMock context) public {
  20. context.msgSender();
  21. }
  22. function callData(ContextMock context, uint256 integerValue, string memory stringValue) public {
  23. context.msgData(integerValue, stringValue);
  24. }
  25. }