ContextMock.sol 733 B

1234567891011121314151617181920212223242526272829
  1. // SPDX-License-Identifier: MIT
  2. pragma solidity ^0.8.19;
  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(ContextMock context, uint256 integerValue, string memory stringValue) public {
  19. context.msgData(integerValue, stringValue);
  20. }
  21. }