GSNRecipient.sol 998 B

12345678910111213141516171819202122232425262728
  1. pragma solidity ^0.5.0;
  2. import "./IRelayRecipient.sol";
  3. import "./GSNContext.sol";
  4. import "./bouncers/GSNBouncerBase.sol";
  5. import "./IRelayHub.sol";
  6. /*
  7. * @dev Base GSN recipient contract, adding the recipient interface and enabling
  8. * GSN support. Not all interface methods are implemented, derived contracts
  9. * must do so themselves.
  10. */
  11. contract GSNRecipient is IRelayRecipient, GSNContext, GSNBouncerBase {
  12. function getHubAddr() public view returns (address) {
  13. return _getRelayHub();
  14. }
  15. // This function is view for future-proofing, it may require reading from
  16. // storage in the future.
  17. function relayHubVersion() public view returns (string memory) {
  18. this; // silence state mutability warning without generating bytecode - see https://github.com/ethereum/solidity/issues/2691
  19. return "1.0.0";
  20. }
  21. function _withdrawDeposits(uint256 amount, address payable payee) internal {
  22. IRelayHub(_getRelayHub()).withdraw(amount, payee);
  23. }
  24. }