Contract 0xC11Cf08ED047A1D49d2BfEBa4880cEFe290e3813 1

Contract Overview

Balance:
0.‍3 Ether
Txn Hash
Method
Block
From
To
Value
0x1b2f9d2de43311231a1fd0eaaf9a55c33f5aa449785bd6c2ed5e643c3075b1620xb1a62e72127609332022-08-10 19:40:4822 hrs 48 mins ago0x4aea3bbb208762d0dfe29246cfc7450ae8de79a2 IN 0xc11cf08ed047a1d49d2bfeba4880cefe290e38130 Ether0.‍00030978 1.‍58399997
0x30e7345de6cb50215e3dc9af73b764810eab2f0e027dd6cb3eabcee128ead7c90xb1a62e72127593062022-08-10 14:06:121 day 4 hrs ago0xb8a88edac60cc1c28020c1c574c2f2e8336a6e91 IN 0xc11cf08ed047a1d49d2bfeba4880cefe290e38130 Ether0.‍00042238 2.‍16
0xe2ebde136bc8b595186351ae37eaa04c912590251075c2331ede5cfb07abc51f0xb1a62e72127582122022-08-10 10:22:241 day 8 hrs ago0x4aea3bbb208762d0dfe29246cfc7450ae8de79a2 IN 0xc11cf08ed047a1d49d2bfeba4880cefe290e38130 Ether0.‍00023469 1.‍2
0xc373797cb6c0b0d24003b9b828c591e20f86b0efff482fb75e71dedd5ce9b6220xb1a62e72127578132022-08-10 9:00:001 day 9 hrs ago0xb8a88edac60cc1c28020c1c574c2f2e8336a6e91 IN 0xc11cf08ed047a1d49d2bfeba4880cefe290e38130 Ether0.‍00023467 1.‍2
0x7b1563cdb64951765150761ec2fb2b5f68158314432796a107b07e3fbb7d37f00xb1a62e72127577052022-08-10 8:36:481 day 9 hrs ago0xb8a88edac60cc1c28020c1c574c2f2e8336a6e91 IN 0xc11cf08ed047a1d49d2bfeba4880cefe290e38130 Ether0.‍00025297 1.‍44
0xe3a4f762e7c2e2747215f0ea1cb942f6e4b38f021fa23df4589225c3ed7fb7800xb1a62e72127577002022-08-10 8:35:481 day 9 hrs ago0xb8a88edac60cc1c28020c1c574c2f2e8336a6e91 IN 0xc11cf08ed047a1d49d2bfeba4880cefe290e38130 Ether0.‍00030978 1.‍58399999
0x98add5dcd9430d5b179d62ea392e1b8f09ee876a5019cedd439a0fc8e430614e0xb1a62e72127456302022-08-08 15:05:123 days 3 hrs ago0x4aea3bbb208762d0dfe29246cfc7450ae8de79a2 IN 0xc11cf08ed047a1d49d2bfeba4880cefe290e38130 Ether0.‍0002108 1.‍2
0x602a7ec4f8ddf4404a937b63983f063c403167a92401103700b2ca840285e5440xb1a62e72127456262022-08-08 15:04:243 days 3 hrs ago0xb8a88edac60cc1c28020c1c574c2f2e8336a6e91 IN 0xc11cf08ed047a1d49d2bfeba4880cefe290e38130 Ether0.‍00034078 1.‍74239998
0xbe9a4d29404c310e23c38396ace11a8d5df5f64ddbcf18bd5a3b36e93bb0bed00xb1a62e72127428832022-08-08 4:16:123 days 14 hrs ago0x4aea3bbb208762d0dfe29246cfc7450ae8de79a2 IN 0xc11cf08ed047a1d49d2bfeba4880cefe290e38130 Ether0.‍0003367 1.‍91663997
0xc38c3459b4a769c03b346924b18846b9a18187bd526c5e6113b33fd0027f08400xb1a62e72127428782022-08-08 4:15:123 days 14 hrs ago0x4aea3bbb208762d0dfe29246cfc7450ae8de79a2 IN 0xc11cf08ed047a1d49d2bfeba4880cefe290e38130 Ether0.‍00029883 1.‍52819998
0xab525ef9fb89268b8c4af0cbb3a2862353925f4118909db9bf3f47567b6a31cd0xb1a62e72127348302022-08-06 20:17:244 days 22 hrs ago0xb8a88edac60cc1c28020c1c574c2f2e8336a6e91 IN 0xc11cf08ed047a1d49d2bfeba4880cefe290e38130 Ether0.‍00034072 1.‍74239998
0x49430b97999899d3607a9a3e5ea7dbad254029ef2c9943fa3185ea309ab90bab0xb1a62e72127322772022-08-06 10:32:125 days 7 hrs ago0x4aea3bbb208762d0dfe29246cfc7450ae8de79a2 IN 0xc11cf08ed047a1d49d2bfeba4880cefe290e38130 Ether0.‍00034074 1.‍74239998
0xea0deac1b7f55355e783ff2498f9e800d308d51aa9cf669760e4b322f779bd630xb1a62e72127235992022-08-05 0:34:486 days 17 hrs ago0xb8a88edac60cc1c28020c1c574c2f2e8336a6e91 IN 0xc11cf08ed047a1d49d2bfeba4880cefe290e38130 Ether0.‍00034074 1.‍74239999
0x2ea0c69608ea00aa7e67064532d990163e68850cf9c30bf70872040fadb561a00xb1a62e72127190972022-08-04 6:45:247 days 11 hrs ago0x4aea3bbb208762d0dfe29246cfc7450ae8de79a2 IN 0xc11cf08ed047a1d49d2bfeba4880cefe290e38130 Ether0.‍00034072 1.‍74239999
0x4fb31625bd7c1ccba2b04e537b769844375cfba0d4c815934e95f6166822069b0xb1a62e72127171502022-08-03 22:49:127 days 19 hrs ago0x4aea3bbb208762d0dfe29246cfc7450ae8de79a2 IN 0xc11cf08ed047a1d49d2bfeba4880cefe290e38130 Ether0.‍00030612 1.‍74239999
0x9b3a1a259842bf85e8613eee37813ce849901d40faf21dae41975e15101448240xb1a62e72127171452022-08-03 22:48:007 days 19 hrs ago0x4aea3bbb208762d0dfe29246cfc7450ae8de79a2 IN 0xc11cf08ed047a1d49d2bfeba4880cefe290e38130 Ether0.‍00034072 1.‍74239999
0xe1ac7187220b293b202e4701a9ac6af307b663f66579af2ed5cbf67f9b4894ff0xb1a62e72127139542022-08-03 8:29:008 days 9 hrs ago0xb8a88edac60cc1c28020c1c574c2f2e8336a6e91 IN 0xc11cf08ed047a1d49d2bfeba4880cefe290e38130 Ether0.‍00034072 1.‍74239999
0x9b657dea3039210dcce3ab683e3c5b129ab7272fd4883d78ac494441cc6152db0xb1a62e72127132862022-08-03 5:18:248 days 13 hrs ago0x4aea3bbb208762d0dfe29246cfc7450ae8de79a2 IN 0xc11cf08ed047a1d49d2bfeba4880cefe290e38130 Ether0.‍00033085 1.‍692
0xc34157a465c58d229a7df658f0d5adaa6353b16f0c69539eaf44d15ab801010b0xb1a62e72127108242022-08-02 17:45:489 days 43 mins ago0x4aea3bbb208762d0dfe29246cfc7450ae8de79a2 IN 0xc11cf08ed047a1d49d2bfeba4880cefe290e38130 Ether0.‍00031095 1.‍74239999
0xe1de8ecb22ace3b4ad9095a71ea3d014296af93194841d812ad1b6491ef422530xb1a62e72127108212022-08-02 17:45:009 days 43 mins ago0xb8a88edac60cc1c28020c1c574c2f2e8336a6e91 IN 0xc11cf08ed047a1d49d2bfeba4880cefe290e38130 Ether0.‍00056324 2.‍88
0x5118239c82e365968e89ce5842fb62e77152c8a74bb201e1f56addf967906b010xb1a62e72127078242022-08-02 3:39:249 days 14 hrs ago0xb8a88edac60cc1c28020c1c574c2f2e8336a6e91 IN 0xc11cf08ed047a1d49d2bfeba4880cefe290e38130 Ether0.‍00034078 1.‍74239999
0x5c1ac7e20a5857254c99fd720c3c1552b33168cfc52b58978d9af809d39630580xb1a62e72127054252022-08-01 16:54:0010 days 1 hr ago0x4aea3bbb208762d0dfe29246cfc7450ae8de79a2 IN 0xc11cf08ed047a1d49d2bfeba4880cefe290e38130 Ether0.‍00028162 1.‍44
0x0ab7650ed2df3bf02e695cce77e35977672447f094df53d729558232cfb23eaa0xb1a62e72126945292022-07-30 18:44:2411 days 23 hrs ago0xb8a88edac60cc1c28020c1c574c2f2e8336a6e91 IN 0xc11cf08ed047a1d49d2bfeba4880cefe290e38130 Ether0.‍00034072 1.‍74239999
0x4af007cb2a240b52ed99870d7394633bc4b202b51ea5aa04d297ad94d148ea380xb1a62e72126941272022-07-30 17:11:3612 days 1 hr ago0xb8a88edac60cc1c28020c1c574c2f2e8336a6e91 IN 0xc11cf08ed047a1d49d2bfeba4880cefe290e38130 Ether0.‍00034074 1.‍74239999
0xefde185afa9b9fdcf558422d7d48ff7d850cca01c4566f4d5d9dbf68e63a29760xb1a62e72126937052022-07-30 15:33:0012 days 2 hrs ago0x4aea3bbb208762d0dfe29246cfc7450ae8de79a2 IN 0xc11cf08ed047a1d49d2bfeba4880cefe290e38130 Ether0.‍00023467 1.‍2
[ Download CSV Export 
Latest 25 internal transaction
Parent Txn Hash Block From To Value
0x1b2f9d2de43311231a1fd0eaaf9a55c33f5aa449785bd6c2ed5e643c3075b162127609332022-08-10 19:40:4822 hrs 48 mins ago 0xc11cf08ed047a1d49d2bfeba4880cefe290e38130x3a0b6272c2346842566ed00773298fe3c410bfb80 Ether
0x1b2f9d2de43311231a1fd0eaaf9a55c33f5aa449785bd6c2ed5e643c3075b162127609332022-08-10 19:40:4822 hrs 48 mins ago 0xc11cf08ed047a1d49d2bfeba4880cefe290e3813 0x7a95fa73250dc53556d264522150a940d4c502380 Ether
0x1b2f9d2de43311231a1fd0eaaf9a55c33f5aa449785bd6c2ed5e643c3075b162127609332022-08-10 19:40:4822 hrs 48 mins ago 0xc11cf08ed047a1d49d2bfeba4880cefe290e38130x3a0b6272c2346842566ed00773298fe3c410bfb80 Ether
0x1b2f9d2de43311231a1fd0eaaf9a55c33f5aa449785bd6c2ed5e643c3075b162127609332022-08-10 19:40:4822 hrs 48 mins ago 0xc11cf08ed047a1d49d2bfeba4880cefe290e38130xc11cf08ed047a1d49d2bfeba4880cefe290e38130 Ether
0x1b2f9d2de43311231a1fd0eaaf9a55c33f5aa449785bd6c2ed5e643c3075b162127609332022-08-10 19:40:4822 hrs 48 mins ago 0xc11cf08ed047a1d49d2bfeba4880cefe290e38130x3a0b6272c2346842566ed00773298fe3c410bfb80 Ether
0x1b2f9d2de43311231a1fd0eaaf9a55c33f5aa449785bd6c2ed5e643c3075b162127609332022-08-10 19:40:4822 hrs 48 mins ago 0xc11cf08ed047a1d49d2bfeba4880cefe290e38130x9407ceb60a383c04e7745b00313ef5a1916320c80 Ether
0x30e7345de6cb50215e3dc9af73b764810eab2f0e027dd6cb3eabcee128ead7c9127593062022-08-10 14:06:121 day 4 hrs ago 0xc11cf08ed047a1d49d2bfeba4880cefe290e38130x3a0b6272c2346842566ed00773298fe3c410bfb80 Ether
0x30e7345de6cb50215e3dc9af73b764810eab2f0e027dd6cb3eabcee128ead7c9127593062022-08-10 14:06:121 day 4 hrs ago 0xc11cf08ed047a1d49d2bfeba4880cefe290e3813 0x7a95fa73250dc53556d264522150a940d4c502380 Ether
0x30e7345de6cb50215e3dc9af73b764810eab2f0e027dd6cb3eabcee128ead7c9127593062022-08-10 14:06:121 day 4 hrs ago 0xc11cf08ed047a1d49d2bfeba4880cefe290e38130x3a0b6272c2346842566ed00773298fe3c410bfb80 Ether
0x30e7345de6cb50215e3dc9af73b764810eab2f0e027dd6cb3eabcee128ead7c9127593062022-08-10 14:06:121 day 4 hrs ago 0xc11cf08ed047a1d49d2bfeba4880cefe290e38130xc11cf08ed047a1d49d2bfeba4880cefe290e38130 Ether
0x30e7345de6cb50215e3dc9af73b764810eab2f0e027dd6cb3eabcee128ead7c9127593062022-08-10 14:06:121 day 4 hrs ago 0xc11cf08ed047a1d49d2bfeba4880cefe290e38130x3a0b6272c2346842566ed00773298fe3c410bfb80 Ether
0x30e7345de6cb50215e3dc9af73b764810eab2f0e027dd6cb3eabcee128ead7c9127593062022-08-10 14:06:121 day 4 hrs ago 0xc11cf08ed047a1d49d2bfeba4880cefe290e38130x9407ceb60a383c04e7745b00313ef5a1916320c80 Ether
0xe2ebde136bc8b595186351ae37eaa04c912590251075c2331ede5cfb07abc51f127582122022-08-10 10:22:241 day 8 hrs ago 0xc11cf08ed047a1d49d2bfeba4880cefe290e38130x3a0b6272c2346842566ed00773298fe3c410bfb80 Ether
0xe2ebde136bc8b595186351ae37eaa04c912590251075c2331ede5cfb07abc51f127582122022-08-10 10:22:241 day 8 hrs ago 0xc11cf08ed047a1d49d2bfeba4880cefe290e3813 0x7a95fa73250dc53556d264522150a940d4c502380 Ether
0xe2ebde136bc8b595186351ae37eaa04c912590251075c2331ede5cfb07abc51f127582122022-08-10 10:22:241 day 8 hrs ago 0xc11cf08ed047a1d49d2bfeba4880cefe290e38130x3a0b6272c2346842566ed00773298fe3c410bfb80 Ether
0xe2ebde136bc8b595186351ae37eaa04c912590251075c2331ede5cfb07abc51f127582122022-08-10 10:22:241 day 8 hrs ago 0xc11cf08ed047a1d49d2bfeba4880cefe290e38130xc11cf08ed047a1d49d2bfeba4880cefe290e38130 Ether
0xe2ebde136bc8b595186351ae37eaa04c912590251075c2331ede5cfb07abc51f127582122022-08-10 10:22:241 day 8 hrs ago 0xc11cf08ed047a1d49d2bfeba4880cefe290e38130x3a0b6272c2346842566ed00773298fe3c410bfb80 Ether
0xe2ebde136bc8b595186351ae37eaa04c912590251075c2331ede5cfb07abc51f127582122022-08-10 10:22:241 day 8 hrs ago 0xc11cf08ed047a1d49d2bfeba4880cefe290e38130x9407ceb60a383c04e7745b00313ef5a1916320c80 Ether
0xc373797cb6c0b0d24003b9b828c591e20f86b0efff482fb75e71dedd5ce9b622127578132022-08-10 9:00:001 day 9 hrs ago 0xc11cf08ed047a1d49d2bfeba4880cefe290e38130x3a0b6272c2346842566ed00773298fe3c410bfb80 Ether
0xc373797cb6c0b0d24003b9b828c591e20f86b0efff482fb75e71dedd5ce9b622127578132022-08-10 9:00:001 day 9 hrs ago 0xc11cf08ed047a1d49d2bfeba4880cefe290e3813 0x7a95fa73250dc53556d264522150a940d4c502380 Ether
0xc373797cb6c0b0d24003b9b828c591e20f86b0efff482fb75e71dedd5ce9b622127578132022-08-10 9:00:001 day 9 hrs ago 0xc11cf08ed047a1d49d2bfeba4880cefe290e38130x3a0b6272c2346842566ed00773298fe3c410bfb80 Ether
0xc373797cb6c0b0d24003b9b828c591e20f86b0efff482fb75e71dedd5ce9b622127578132022-08-10 9:00:001 day 9 hrs ago 0xc11cf08ed047a1d49d2bfeba4880cefe290e38130xc11cf08ed047a1d49d2bfeba4880cefe290e38130 Ether
0xc373797cb6c0b0d24003b9b828c591e20f86b0efff482fb75e71dedd5ce9b622127578132022-08-10 9:00:001 day 9 hrs ago 0xc11cf08ed047a1d49d2bfeba4880cefe290e38130x3a0b6272c2346842566ed00773298fe3c410bfb80 Ether
0xc373797cb6c0b0d24003b9b828c591e20f86b0efff482fb75e71dedd5ce9b622127578132022-08-10 9:00:001 day 9 hrs ago 0xc11cf08ed047a1d49d2bfeba4880cefe290e38130x9407ceb60a383c04e7745b00313ef5a1916320c80 Ether
0x7b1563cdb64951765150761ec2fb2b5f68158314432796a107b07e3fbb7d37f0127577052022-08-10 8:36:481 day 9 hrs ago 0xc11cf08ed047a1d49d2bfeba4880cefe290e38130x3a0b6272c2346842566ed00773298fe3c410bfb80 Ether
[ Download CSV Export 
Loading

Contract Source Code Verified (Exact Match)

Contract Name:
RelayHub

Compiler Version
v0.8.7+commit.e28d00a7

Optimization Enabled:
Yes with 200 runs

Other Settings:
default evmVersion, GNU GPLv3 license
File 1 of 21 : Ownable.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (access/Ownable.sol)

pragma solidity ^0.8.0;

import "../utils/Context.sol";

/**
 * @dev Contract module which provides a basic access control mechanism, where
 * there is an account (an owner) that can be granted exclusive access to
 * specific functions.
 *
 * By default, the owner account will be the one that deploys the contract. This
 * can later be changed with {transferOwnership}.
 *
 * This module is used through inheritance. It will make available the modifier
 * `onlyOwner`, which can be applied to your functions to restrict their use to
 * the owner.
 */
abstract contract Ownable is Context {
    address private _owner;

    event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);

    /**
     * @dev Initializes the contract setting the deployer as the initial owner.
     */
    constructor() {
        _transferOwnership(_msgSender());
    }

    /**
     * @dev Returns the address of the current owner.
     */
    function owner() public view virtual returns (address) {
        return _owner;
    }

    /**
     * @dev Throws if called by any account other than the owner.
     */
    modifier onlyOwner() {
        require(owner() == _msgSender(), "Ownable: caller is not the owner");
        _;
    }

    /**
     * @dev Leaves the contract without owner. It will not be possible to call
     * `onlyOwner` functions anymore. Can only be called by the current owner.
     *
     * NOTE: Renouncing ownership will leave the contract without an owner,
     * thereby removing any functionality that is only available to the owner.
     */
    function renounceOwnership() public virtual onlyOwner {
        _transferOwnership(address(0));
    }

    /**
     * @dev Transfers ownership of the contract to a new account (`newOwner`).
     * Can only be called by the current owner.
     */
    function transferOwnership(address newOwner) public virtual onlyOwner {
        require(newOwner != address(0), "Ownable: new owner is the zero address");
        _transferOwnership(newOwner);
    }

    /**
     * @dev Transfers ownership of the contract to a new account (`newOwner`).
     * Internal function without access restriction.
     */
    function _transferOwnership(address newOwner) internal virtual {
        address oldOwner = _owner;
        _owner = newOwner;
        emit OwnershipTransferred(oldOwner, newOwner);
    }
}

File 2 of 21 : IERC165.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (interfaces/IERC165.sol)

pragma solidity ^0.8.0;

import "../utils/introspection/IERC165.sol";

File 3 of 21 : IERC20.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.6.0) (token/ERC20/IERC20.sol)

pragma solidity ^0.8.0;

/**
 * @dev Interface of the ERC20 standard as defined in the EIP.
 */
interface IERC20 {
    /**
     * @dev Emitted when `value` tokens are moved from one account (`from`) to
     * another (`to`).
     *
     * Note that `value` may be zero.
     */
    event Transfer(address indexed from, address indexed to, uint256 value);

    /**
     * @dev Emitted when the allowance of a `spender` for an `owner` is set by
     * a call to {approve}. `value` is the new allowance.
     */
    event Approval(address indexed owner, address indexed spender, uint256 value);

    /**
     * @dev Returns the amount of tokens in existence.
     */
    function totalSupply() external view returns (uint256);

    /**
     * @dev Returns the amount of tokens owned by `account`.
     */
    function balanceOf(address account) external view returns (uint256);

    /**
     * @dev Moves `amount` tokens from the caller's account to `to`.
     *
     * Returns a boolean value indicating whether the operation succeeded.
     *
     * Emits a {Transfer} event.
     */
    function transfer(address to, uint256 amount) external returns (bool);

    /**
     * @dev Returns the remaining number of tokens that `spender` will be
     * allowed to spend on behalf of `owner` through {transferFrom}. This is
     * zero by default.
     *
     * This value changes when {approve} or {transferFrom} are called.
     */
    function allowance(address owner, address spender) external view returns (uint256);

    /**
     * @dev Sets `amount` as the allowance of `spender` over the caller's tokens.
     *
     * Returns a boolean value indicating whether the operation succeeded.
     *
     * IMPORTANT: Beware that changing an allowance with this method brings the risk
     * that someone may use both the old and the new allowance by unfortunate
     * transaction ordering. One possible solution to mitigate this race
     * condition is to first reduce the spender's allowance to 0 and set the
     * desired value afterwards:
     * https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729
     *
     * Emits an {Approval} event.
     */
    function approve(address spender, uint256 amount) external returns (bool);

    /**
     * @dev Moves `amount` tokens from `from` to `to` using the
     * allowance mechanism. `amount` is then deducted from the caller's
     * allowance.
     *
     * Returns a boolean value indicating whether the operation succeeded.
     *
     * Emits a {Transfer} event.
     */
    function transferFrom(
        address from,
        address to,
        uint256 amount
    ) external returns (bool);
}

File 4 of 21 : Address.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.5.0) (utils/Address.sol)

pragma solidity ^0.8.1;

/**
 * @dev Collection of functions related to the address type
 */
library Address {
    /**
     * @dev Returns true if `account` is a contract.
     *
     * [IMPORTANT]
     * ====
     * It is unsafe to assume that an address for which this function returns
     * false is an externally-owned account (EOA) and not a contract.
     *
     * Among others, `isContract` will return false for the following
     * types of addresses:
     *
     *  - an externally-owned account
     *  - a contract in construction
     *  - an address where a contract will be created
     *  - an address where a contract lived, but was destroyed
     * ====
     *
     * [IMPORTANT]
     * ====
     * You shouldn't rely on `isContract` to protect against flash loan attacks!
     *
     * Preventing calls from contracts is highly discouraged. It breaks composability, breaks support for smart wallets
     * like Gnosis Safe, and does not provide security since it can be circumvented by calling from a contract
     * constructor.
     * ====
     */
    function isContract(address account) internal view returns (bool) {
        // This method relies on extcodesize/address.code.length, which returns 0
        // for contracts in construction, since the code is only stored at the end
        // of the constructor execution.

        return account.code.length > 0;
    }

    /**
     * @dev Replacement for Solidity's `transfer`: sends `amount` wei to
     * `recipient`, forwarding all available gas and reverting on errors.
     *
     * https://eips.ethereum.org/EIPS/eip-1884[EIP1884] increases the gas cost
     * of certain opcodes, possibly making contracts go over the 2300 gas limit
     * imposed by `transfer`, making them unable to receive funds via
     * `transfer`. {sendValue} removes this limitation.
     *
     * https://diligence.consensys.net/posts/2019/09/stop-using-soliditys-transfer-now/[Learn more].
     *
     * IMPORTANT: because control is transferred to `recipient`, care must be
     * taken to not create reentrancy vulnerabilities. Consider using
     * {ReentrancyGuard} or the
     * https://solidity.readthedocs.io/en/v0.5.11/security-considerations.html#use-the-checks-effects-interactions-pattern[checks-effects-interactions pattern].
     */
    function sendValue(address payable recipient, uint256 amount) internal {
        require(address(this).balance >= amount, "Address: insufficient balance");

        (bool success, ) = recipient.call{value: amount}("");
        require(success, "Address: unable to send value, recipient may have reverted");
    }

    /**
     * @dev Performs a Solidity function call using a low level `call`. A
     * plain `call` is an unsafe replacement for a function call: use this
     * function instead.
     *
     * If `target` reverts with a revert reason, it is bubbled up by this
     * function (like regular Solidity function calls).
     *
     * Returns the raw returned data. To convert to the expected return value,
     * use https://solidity.readthedocs.io/en/latest/units-and-global-variables.html?highlight=abi.decode#abi-encoding-and-decoding-functions[`abi.decode`].
     *
     * Requirements:
     *
     * - `target` must be a contract.
     * - calling `target` with `data` must not revert.
     *
     * _Available since v3.1._
     */
    function functionCall(address target, bytes memory data) internal returns (bytes memory) {
        return functionCall(target, data, "Address: low-level call failed");
    }

    /**
     * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], but with
     * `errorMessage` as a fallback revert reason when `target` reverts.
     *
     * _Available since v3.1._
     */
    function functionCall(
        address target,
        bytes memory data,
        string memory errorMessage
    ) internal returns (bytes memory) {
        return functionCallWithValue(target, data, 0, errorMessage);
    }

    /**
     * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],
     * but also transferring `value` wei to `target`.
     *
     * Requirements:
     *
     * - the calling contract must have an ETH balance of at least `value`.
     * - the called Solidity function must be `payable`.
     *
     * _Available since v3.1._
     */
    function functionCallWithValue(
        address target,
        bytes memory data,
        uint256 value
    ) internal returns (bytes memory) {
        return functionCallWithValue(target, data, value, "Address: low-level call with value failed");
    }

    /**
     * @dev Same as {xref-Address-functionCallWithValue-address-bytes-uint256-}[`functionCallWithValue`], but
     * with `errorMessage` as a fallback revert reason when `target` reverts.
     *
     * _Available since v3.1._
     */
    function functionCallWithValue(
        address target,
        bytes memory data,
        uint256 value,
        string memory errorMessage
    ) internal returns (bytes memory) {
        require(address(this).balance >= value, "Address: insufficient balance for call");
        require(isContract(target), "Address: call to non-contract");

        (bool success, bytes memory returndata) = target.call{value: value}(data);
        return verifyCallResult(success, returndata, errorMessage);
    }

    /**
     * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],
     * but performing a static call.
     *
     * _Available since v3.3._
     */
    function functionStaticCall(address target, bytes memory data) internal view returns (bytes memory) {
        return functionStaticCall(target, data, "Address: low-level static call failed");
    }

    /**
     * @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`],
     * but performing a static call.
     *
     * _Available since v3.3._
     */
    function functionStaticCall(
        address target,
        bytes memory data,
        string memory errorMessage
    ) internal view returns (bytes memory) {
        require(isContract(target), "Address: static call to non-contract");

        (bool success, bytes memory returndata) = target.staticcall(data);
        return verifyCallResult(success, returndata, errorMessage);
    }

    /**
     * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],
     * but performing a delegate call.
     *
     * _Available since v3.4._
     */
    function functionDelegateCall(address target, bytes memory data) internal returns (bytes memory) {
        return functionDelegateCall(target, data, "Address: low-level delegate call failed");
    }

    /**
     * @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`],
     * but performing a delegate call.
     *
     * _Available since v3.4._
     */
    function functionDelegateCall(
        address target,
        bytes memory data,
        string memory errorMessage
    ) internal returns (bytes memory) {
        require(isContract(target), "Address: delegate call to non-contract");

        (bool success, bytes memory returndata) = target.delegatecall(data);
        return verifyCallResult(success, returndata, errorMessage);
    }

    /**
     * @dev Tool to verifies that a low level call was successful, and revert if it wasn't, either by bubbling the
     * revert reason using the provided one.
     *
     * _Available since v4.3._
     */
    function verifyCallResult(
        bool success,
        bytes memory returndata,
        string memory errorMessage
    ) internal pure returns (bytes memory) {
        if (success) {
            return returndata;
        } else {
            // Look for revert reason and bubble it up if present
            if (returndata.length > 0) {
                // The easiest way to bubble the revert reason is using memory via assembly

                assembly {
                    let returndata_size := mload(returndata)
                    revert(add(32, returndata), returndata_size)
                }
            } else {
                revert(errorMessage);
            }
        }
    }
}

File 5 of 21 : Context.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (utils/Context.sol)

pragma solidity ^0.8.0;

/**
 * @dev Provides information about the current execution context, including the
 * sender of the transaction and its data. While these are generally available
 * via msg.sender and msg.data, they should not be accessed in such a direct
 * manner, since when dealing with meta-transactions the account sending and
 * paying for execution may not be the actual sender (as far as an application
 * is concerned).
 *
 * This contract is only required for intermediate, library-like contracts.
 */
abstract contract Context {
    function _msgSender() internal view virtual returns (address) {
        return msg.sender;
    }

    function _msgData() internal view virtual returns (bytes calldata) {
        return msg.data;
    }
}

File 6 of 21 : ERC165.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (utils/introspection/ERC165.sol)

pragma solidity ^0.8.0;

import "./IERC165.sol";

/**
 * @dev Implementation of the {IERC165} interface.
 *
 * Contracts that want to implement ERC165 should inherit from this contract and override {supportsInterface} to check
 * for the additional interface id that will be supported. For example:
 *
 * ```solidity
 * function supportsInterface(bytes4 interfaceId) public view virtual override returns (bool) {
 *     return interfaceId == type(MyInterface).interfaceId || super.supportsInterface(interfaceId);
 * }
 * ```
 *
 * Alternatively, {ERC165Storage} provides an easier to use but more expensive implementation.
 */
abstract contract ERC165 is IERC165 {
    /**
     * @dev See {IERC165-supportsInterface}.
     */
    function supportsInterface(bytes4 interfaceId) public view virtual override returns (bool) {
        return interfaceId == type(IERC165).interfaceId;
    }
}

File 7 of 21 : ERC165Checker.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (utils/introspection/ERC165Checker.sol)

pragma solidity ^0.8.0;

import "./IERC165.sol";

/**
 * @dev Library used to query support of an interface declared via {IERC165}.
 *
 * Note that these functions return the actual result of the query: they do not
 * `revert` if an interface is not supported. It is up to the caller to decide
 * what to do in these cases.
 */
library ERC165Checker {
    // As per the EIP-165 spec, no interface should ever match 0xffffffff
    bytes4 private constant _INTERFACE_ID_INVALID = 0xffffffff;

    /**
     * @dev Returns true if `account` supports the {IERC165} interface,
     */
    function supportsERC165(address account) internal view returns (bool) {
        // Any contract that implements ERC165 must explicitly indicate support of
        // InterfaceId_ERC165 and explicitly indicate non-support of InterfaceId_Invalid
        return
            _supportsERC165Interface(account, type(IERC165).interfaceId) &&
            !_supportsERC165Interface(account, _INTERFACE_ID_INVALID);
    }

    /**
     * @dev Returns true if `account` supports the interface defined by
     * `interfaceId`. Support for {IERC165} itself is queried automatically.
     *
     * See {IERC165-supportsInterface}.
     */
    function supportsInterface(address account, bytes4 interfaceId) internal view returns (bool) {
        // query support of both ERC165 as per the spec and support of _interfaceId
        return supportsERC165(account) && _supportsERC165Interface(account, interfaceId);
    }

    /**
     * @dev Returns a boolean array where each value corresponds to the
     * interfaces passed in and whether they're supported or not. This allows
     * you to batch check interfaces for a contract where your expectation
     * is that some interfaces may not be supported.
     *
     * See {IERC165-supportsInterface}.
     *
     * _Available since v3.4._
     */
    function getSupportedInterfaces(address account, bytes4[] memory interfaceIds)
        internal
        view
        returns (bool[] memory)
    {
        // an array of booleans corresponding to interfaceIds and whether they're supported or not
        bool[] memory interfaceIdsSupported = new bool[](interfaceIds.length);

        // query support of ERC165 itself
        if (supportsERC165(account)) {
            // query support of each interface in interfaceIds
            for (uint256 i = 0; i < interfaceIds.length; i++) {
                interfaceIdsSupported[i] = _supportsERC165Interface(account, interfaceIds[i]);
            }
        }

        return interfaceIdsSupported;
    }

    /**
     * @dev Returns true if `account` supports all the interfaces defined in
     * `interfaceIds`. Support for {IERC165} itself is queried automatically.
     *
     * Batch-querying can lead to gas savings by skipping repeated checks for
     * {IERC165} support.
     *
     * See {IERC165-supportsInterface}.
     */
    function supportsAllInterfaces(address account, bytes4[] memory interfaceIds) internal view returns (bool) {
        // query support of ERC165 itself
        if (!supportsERC165(account)) {
            return false;
        }

        // query support of each interface in _interfaceIds
        for (uint256 i = 0; i < interfaceIds.length; i++) {
            if (!_supportsERC165Interface(account, interfaceIds[i])) {
                return false;
            }
        }

        // all interfaces supported
        return true;
    }

    /**
     * @notice Query if a contract implements an interface, does not check ERC165 support
     * @param account The address of the contract to query for support of an interface
     * @param interfaceId The interface identifier, as specified in ERC-165
     * @return true if the contract at account indicates support of the interface with
     * identifier interfaceId, false otherwise
     * @dev Assumes that account contains a contract that supports ERC165, otherwise
     * the behavior of this method is undefined. This precondition can be checked
     * with {supportsERC165}.
     * Interface identification is specified in ERC-165.
     */
    function _supportsERC165Interface(address account, bytes4 interfaceId) private view returns (bool) {
        bytes memory encodedParams = abi.encodeWithSelector(IERC165.supportsInterface.selector, interfaceId);
        (bool success, bytes memory result) = account.staticcall{gas: 30000}(encodedParams);
        if (result.length < 32) return false;
        return success && abi.decode(result, (bool));
    }
}

File 8 of 21 : IERC165.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (utils/introspection/IERC165.sol)

pragma solidity ^0.8.0;

/**
 * @dev Interface of the ERC165 standard, as defined in the
 * https://eips.ethereum.org/EIPS/eip-165[EIP].
 *
 * Implementers can declare support of contract interfaces, which can then be
 * queried by others ({ERC165Checker}).
 *
 * For an implementation, see {ERC165}.
 */
interface IERC165 {
    /**
     * @dev Returns true if this contract implements the interface defined by
     * `interfaceId`. See the corresponding
     * https://eips.ethereum.org/EIPS/eip-165#how-interfaces-are-identified[EIP section]
     * to learn more about how these ids are created.
     *
     * This function call must use less than 30 000 gas.
     */
    function supportsInterface(bytes4 interfaceId) external view returns (bool);
}

File 9 of 21 : Math.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.5.0) (utils/math/Math.sol)

pragma solidity ^0.8.0;

/**
 * @dev Standard math utilities missing in the Solidity language.
 */
library Math {
    /**
     * @dev Returns the largest of two numbers.
     */
    function max(uint256 a, uint256 b) internal pure returns (uint256) {
        return a >= b ? a : b;
    }

    /**
     * @dev Returns the smallest of two numbers.
     */
    function min(uint256 a, uint256 b) internal pure returns (uint256) {
        return a < b ? a : b;
    }

    /**
     * @dev Returns the average of two numbers. The result is rounded towards
     * zero.
     */
    function average(uint256 a, uint256 b) internal pure returns (uint256) {
        // (a + b) / 2 can overflow.
        return (a & b) + (a ^ b) / 2;
    }

    /**
     * @dev Returns the ceiling of the division of two numbers.
     *
     * This differs from standard division with `/` in that it rounds up instead
     * of rounding down.
     */
    function ceilDiv(uint256 a, uint256 b) internal pure returns (uint256) {
        // (a + b - 1) / b can overflow on addition, so we distribute.
        return a / b + (a % b == 0 ? 0 : 1);
    }
}

File 10 of 21 : RelayHub.sol
pragma solidity ^0.8.0;
pragma abicoder v2;

/* solhint-disable avoid-low-level-calls */
/* solhint-disable no-inline-assembly */
/* solhint-disable not-rely-on-time */
/* solhint-disable avoid-tx-origin */
/* solhint-disable bracket-align */
// SPDX-License-Identifier: GPL-3.0-only

import "./utils/MinLibBytes.sol";
import "@openzeppelin/contracts/utils/Address.sol";
import "@openzeppelin/contracts/utils/introspection/ERC165.sol";
import "@openzeppelin/contracts/utils/introspection/ERC165Checker.sol";
import "@openzeppelin/contracts/utils/math/Math.sol";
import "@openzeppelin/contracts/access/Ownable.sol";
import "@openzeppelin/contracts/token/ERC20/IERC20.sol";

import "./utils/GsnUtils.sol";
import "./utils/GsnEip712Library.sol";
import "./utils/RelayHubValidator.sol";
import "./utils/GsnTypes.sol";
import "./interfaces/IRelayHub.sol";
import "./interfaces/IPaymaster.sol";
import "./forwarder/IForwarder.sol";
import "./interfaces/IStakeManager.sol";
import "./interfaces/IRelayRegistrar.sol";
import "./interfaces/IStakeManager.sol";

/**
 * @title The RelayHub Implementation
 * @notice This contract implements the `IRelayHub` interface for the EVM-compatible networks.
 */
contract RelayHub is IRelayHub, Ownable, ERC165 {
    using ERC165Checker for address;
    using Address for address;

    address private constant DRY_RUN_ADDRESS = 0x0000000000000000000000000000000000000000;

    /// @inheritdoc IRelayHub
    function versionHub() override virtual public pure returns (string memory){
        return "3.0.0-beta.0+opengsn.hub.irelayhub";
    }

    IStakeManager internal immutable stakeManager;
    address internal immutable penalizer;
    address internal immutable batchGateway;
    address internal immutable relayRegistrar;

    RelayHubConfig internal config;

    /// @inheritdoc IRelayHub
    function getConfiguration() public override view returns (RelayHubConfig memory) {
        return config;
    }

    /// @inheritdoc IRelayHub
    function setConfiguration(RelayHubConfig memory _config) public override onlyOwner {
        require(_config.devFee < 100, "dev fee too high");
        config = _config;
        emit RelayHubConfigured(config);
    }

    // maps ERC-20 token address to a minimum stake for it
    mapping(IERC20 => uint256) internal minimumStakePerToken;

    /// @inheritdoc IRelayHub
    function setMinimumStakes(IERC20[] memory token, uint256[] memory minimumStake) public override onlyOwner {
        require(token.length == minimumStake.length, "setMinimumStakes: wrong length");
        for (uint256 i = 0; i < token.length; i++) {
            minimumStakePerToken[token[i]] = minimumStake[i];
            emit StakingTokenDataChanged(address(token[i]), minimumStake[i]);
        }
    }

    // maps relay worker's address to its manager's address
    mapping(address => address) internal workerToManager;

    // maps relay managers to the number of their workers
    mapping(address => uint256) internal workerCount;

    mapping(address => uint256) internal balances;

    uint256 internal immutable creationBlock;
    uint256 internal deprecationTime = type(uint256).max;

    constructor (
        IStakeManager _stakeManager,
        address _penalizer,
        address _batchGateway,
        address _relayRegistrar,
        RelayHubConfig memory _config
    ) {
        creationBlock = block.number;
        stakeManager = _stakeManager;
        penalizer = _penalizer;
        batchGateway = _batchGateway;
        relayRegistrar = _relayRegistrar;
        setConfiguration(_config);
    }

    /// @inheritdoc IRelayHub
    function getCreationBlock() external override virtual view returns (uint256){
        return creationBlock;
    }

    /// @inheritdoc IRelayHub
    function getDeprecationTime() external override view returns (uint256) {
        return deprecationTime;
    }

    /// @inheritdoc IRelayHub
    function getStakeManager() external override view returns (IStakeManager) {
        return stakeManager;
    }

    /// @inheritdoc IRelayHub
    function getPenalizer() external override view returns (address) {
        return penalizer;
    }

    /// @inheritdoc IRelayHub
    function getBatchGateway() external override view returns (address) {
        return batchGateway;
    }

    /// @inheritdoc IRelayHub
    function getRelayRegistrar() external override view returns (address) {
        return relayRegistrar;
    }

    /// @inheritdoc IRelayHub
    function getMinimumStakePerToken(IERC20 token) external override view returns (uint256) {
        return minimumStakePerToken[token];
    }

    /// @inheritdoc IRelayHub
    function getWorkerManager(address worker) external override view returns (address) {
        return workerToManager[worker];
    }

    /// @inheritdoc IRelayHub
    function getWorkerCount(address manager) external override view returns (uint256) {
        return workerCount[manager];
    }

    /// @inheritdoc IERC165
    function supportsInterface(bytes4 interfaceId) public view virtual override(IERC165, ERC165) returns (bool) {
        return interfaceId == type(IRelayHub).interfaceId ||
            interfaceId == type(Ownable).interfaceId ||
            super.supportsInterface(interfaceId);
    }

    /// @inheritdoc IRelayHub
    function onRelayServerRegistered(address relayManager) external override {
        require(msg.sender == relayRegistrar, "caller is not relay registrar");
        verifyRelayManagerStaked(relayManager);
        require(workerCount[relayManager] > 0, "no relay workers");
        stakeManager.updateRelayKeepaliveTime(relayManager);
    }

    /// @inheritdoc IRelayHub
    function addRelayWorkers(address[] calldata newRelayWorkers) external override {
        address relayManager = msg.sender;
        uint256 newWorkerCount = workerCount[relayManager] + newRelayWorkers.length;
        workerCount[relayManager] = newWorkerCount;
        require(newWorkerCount <= config.maxWorkerCount, "too many workers");

        verifyRelayManagerStaked(relayManager);

        for (uint256 i = 0; i < newRelayWorkers.length; i++) {
            require(workerToManager[newRelayWorkers[i]] == address(0), "this worker has a manager");
            workerToManager[newRelayWorkers[i]] = relayManager;
        }

        emit RelayWorkersAdded(relayManager, newRelayWorkers, newWorkerCount);
    }

    /// @inheritdoc IRelayHub
    function depositFor(address target) public virtual override payable {
        require(target.supportsInterface(type(IPaymaster).interfaceId), "target is not a valid IPaymaster");
        uint256 amount = msg.value;

        balances[target] = balances[target] + amount;

        emit Deposited(target, msg.sender, amount);
    }

    /// @inheritdoc IRelayHub
    function balanceOf(address target) external override view returns (uint256) {
        return balances[target];
    }

    /// @inheritdoc IRelayHub
    function withdraw(address payable dest, uint256 amount) public override {
        uint256[] memory amounts = new uint256[](1);
        address payable[] memory destinations = new address payable[](1);
        amounts[0] = amount;
        destinations[0] = dest;
        withdrawMultiple(destinations, amounts);
    }

    /// @inheritdoc IRelayHub
    function withdrawMultiple(address payable[] memory dest, uint256[] memory amount) public override {
        address payable account = payable(msg.sender);
        for (uint256 i = 0; i < amount.length; i++) {
            uint256 balance = balances[account];
            require(balance >= amount[i], "insufficient funds");
            balances[account] = balance - amount[i];
            (bool success, ) = dest[i].call{value: amount[i]}("");
            require(success, "Transfer failed.");
            emit Withdrawn(account, dest[i], amount[i]);
        }
    }

    function verifyGasAndDataLimits(
        uint256 maxAcceptanceBudget,
        GsnTypes.RelayRequest calldata relayRequest,
        uint256 initialGasLeft
    )
    private
    view
    returns (IPaymaster.GasAndDataLimits memory gasAndDataLimits, uint256 maxPossibleGas) {
        gasAndDataLimits =
            IPaymaster(relayRequest.relayData.paymaster).getGasAndDataLimits{gas:50000}();
        require(msg.data.length <= gasAndDataLimits.calldataSizeLimit, "msg.data exceeded limit" );

        require(maxAcceptanceBudget >= gasAndDataLimits.acceptanceBudget, "acceptance budget too high");
        require(gasAndDataLimits.acceptanceBudget >= gasAndDataLimits.preRelayedCallGasLimit, "acceptance budget too low");

        maxPossibleGas = relayRequest.relayData.transactionCalldataGasUsed + initialGasLeft;

        uint256 maxPossibleCharge = calculateCharge(
            maxPossibleGas,
            relayRequest.relayData
        );

        // We don't yet know how much gas will be used by the recipient, so we make sure there are enough funds to pay
        // for the maximum possible charge.
        require(maxPossibleCharge <= balances[relayRequest.relayData.paymaster],
            "Paymaster balance too low");
    }

    struct RelayCallData {
        bool success;
        bytes4 functionSelector;
        uint256 initialGasLeft;
        bytes recipientContext;
        bytes relayedCallReturnValue;
        IPaymaster.GasAndDataLimits gasAndDataLimits;
        RelayCallStatus status;
        uint256 innerGasUsed;
        uint256 maxPossibleGas;
        uint256 innerGasLimit;
        uint256 gasBeforeInner;
        uint256 gasUsed;
        uint256 devCharge;
        bytes retData;
        address relayManager;
        bytes32 relayRequestId;
    }

    /// @inheritdoc IRelayHub
    function relayCall(
        uint256 maxAcceptanceBudget,
        GsnTypes.RelayRequest calldata relayRequest,
        bytes calldata signature,
        bytes calldata approvalData
    )
    external
    override
    returns (
        bool paymasterAccepted,
        uint256 charge,
        IRelayHub.RelayCallStatus status,
        bytes memory returnValue)
    {
        RelayCallData memory vars;
        vars.initialGasLeft = aggregateGasleft();
        vars.relayRequestId = GsnUtils.getRelayRequestID(relayRequest, signature);

        require(!isDeprecated(), "hub deprecated");
        vars.functionSelector = relayRequest.request.data.length>=4 ? MinLibBytes.readBytes4(relayRequest.request.data, 0) : bytes4(0);

        if (msg.sender != batchGateway && tx.origin != DRY_RUN_ADDRESS) {
            require(signature.length != 0, "missing signature or bad gateway");
            require(msg.sender == tx.origin, "relay worker must be EOA");
            require(msg.sender == relayRequest.relayData.relayWorker, "Not a right worker");
        }

        if (tx.origin != DRY_RUN_ADDRESS) {
            vars.relayManager = workerToManager[relayRequest.relayData.relayWorker];
            require(vars.relayManager != address(0), "Unknown relay worker");
            verifyRelayManagerStaked(vars.relayManager);
        }

        (vars.gasAndDataLimits, vars.maxPossibleGas) =
            verifyGasAndDataLimits(maxAcceptanceBudget, relayRequest, vars.initialGasLeft);

        RelayHubValidator.verifyTransactionPacking(relayRequest,signature,approvalData);

    {

        //How much gas to pass down to innerRelayCall. must be lower than the default 63/64
        // actually, min(gasleft*63/64, gasleft-GAS_RESERVE) might be enough.
        vars.innerGasLimit = gasleft()*63/64- config.gasReserve;
        vars.gasBeforeInner = aggregateGasleft();

        /*
        Preparing to calculate "gasUseWithoutPost":
        MPG = calldataGasUsage + vars.initialGasLeft :: max possible gas, an approximate gas limit for the current transaction
        GU1 = MPG - gasleft(called right before innerRelayCall) :: gas actually used by current transaction until that point
        GU2 = innerGasLimit - gasleft(called inside the innerRelayCall just before preRelayedCall) :: gas actually used by innerRelayCall before calling postRelayCall
        GWP1 = GU1 + GU2 :: gas actually used by the entire transaction before calling postRelayCall
        TGO = config.gasOverhead + config.postOverhead :: extra that will be added to the charge to cover hidden costs
        GWP = GWP1 + TGO :: transaction "gas used without postRelayCall"
        */
        uint256 _tmpInitialGas = relayRequest.relayData.transactionCalldataGasUsed + vars.initialGasLeft + vars.innerGasLimit + config.gasOverhead + config.postOverhead;
        // Calls to the recipient are performed atomically inside an inner transaction which may revert in case of
        // errors in the recipient. In either case (revert or regular execution) the return data encodes the
        // RelayCallStatus value.
        (bool success, bytes memory relayCallStatus) = address(this).call{gas:vars.innerGasLimit}(
            abi.encodeWithSelector(RelayHub.innerRelayCall.selector, relayRequest, signature, approvalData, vars.gasAndDataLimits,
            _tmpInitialGas - aggregateGasleft(), /* totalInitialGas */
            vars.maxPossibleGas
            )
        );
        vars.success = success;
        vars.innerGasUsed = vars.gasBeforeInner-aggregateGasleft();
        (vars.status, vars.relayedCallReturnValue) = abi.decode(relayCallStatus, (RelayCallStatus, bytes));
        if ( vars.relayedCallReturnValue.length>0 ) {
            emit TransactionResult(vars.status, vars.relayedCallReturnValue);
        }
    }
    {
        if (!vars.success) {
            //Failure cases where the PM doesn't pay
            if (vars.status == RelayCallStatus.RejectedByPreRelayed ||
                    (vars.innerGasUsed <= vars.gasAndDataLimits.acceptanceBudget + relayRequest.relayData.transactionCalldataGasUsed) && (
                    vars.status == RelayCallStatus.RejectedByForwarder ||
                    vars.status == RelayCallStatus.RejectedByRecipientRevert  //can only be thrown if rejectOnRecipientRevert==true
                )) {
                emit TransactionRejectedByPaymaster(
                    vars.relayManager,
                    relayRequest.relayData.paymaster,
                    vars.relayRequestId,
                    relayRequest.request.from,
                    relayRequest.request.to,
                    msg.sender,
                    vars.functionSelector,
                    vars.innerGasUsed,
                    vars.relayedCallReturnValue);
                return (false, 0, vars.status, vars.relayedCallReturnValue);
            }
        }

        // We now perform the actual charge calculation, based on the measured gas used
        vars.gasUsed = relayRequest.relayData.transactionCalldataGasUsed + (vars.initialGasLeft - aggregateGasleft()) + config.gasOverhead;
        charge = calculateCharge(vars.gasUsed, relayRequest.relayData);
        vars.devCharge = calculateDevCharge(charge);

        balances[relayRequest.relayData.paymaster] = balances[relayRequest.relayData.paymaster] - charge;
        balances[vars.relayManager] = balances[vars.relayManager] + (charge - vars.devCharge);
        if (vars.devCharge > 0) { // save some gas in case of zero dev charge
            balances[config.devAddress] = balances[config.devAddress] + vars.devCharge;
        }

        {
            address from = relayRequest.request.from;
            address to = relayRequest.request.to;
            address paymaster = relayRequest.relayData.paymaster;
            emit TransactionRelayed(
                vars.relayManager,
                msg.sender,
                vars.relayRequestId,
                from,
                to,
                paymaster,
                vars.functionSelector,
                vars.status,
                charge);
        }

        // avoid variable size memory copying after gas calculation completed on-chain
        if (tx.origin == DRY_RUN_ADDRESS) {
            return (true, charge, vars.status, vars.relayedCallReturnValue);
        }
        return (true, charge, vars.status, "");
    }
    }

    struct InnerRelayCallData {
        uint256 initialGasLeft;
        uint256 gasUsedToCallInner;
        uint256 balanceBefore;
        bytes32 preReturnValue;
        bool relayedCallSuccess;
        bytes relayedCallReturnValue;
        bytes recipientContext;
        bytes data;
        bool rejectOnRecipientRevert;
    }

    /**
     * @notice This method can only by called by this `RelayHub`.
     * It wraps the execution of the `RelayRequest` in a revertable frame context.
     */
    function innerRelayCall(
        GsnTypes.RelayRequest calldata relayRequest,
        bytes calldata signature,
        bytes calldata approvalData,
        IPaymaster.GasAndDataLimits calldata gasAndDataLimits,
        uint256 totalInitialGas,
        uint256 maxPossibleGas
    )
    external
    returns (RelayCallStatus, bytes memory)
    {
        InnerRelayCallData memory vars;
        vars.initialGasLeft = aggregateGasleft();
        vars.gasUsedToCallInner = totalInitialGas - gasleft();
        // A new gas measurement is performed inside innerRelayCall, since
        // due to EIP150 available gas amounts cannot be directly compared across external calls

        // This external function can only be called by RelayHub itself, creating an internal transaction. Calls to the
        // recipient (preRelayedCall, the relayedCall, and postRelayedCall) are called from inside this transaction.
        require(msg.sender == address(this), "Must be called by RelayHub");

        // If either pre or post reverts, the whole internal transaction will be reverted, reverting all side effects on
        // the recipient. The recipient will still be charged for the used gas by the relay.

        // The paymaster is no allowed to withdraw balance from RelayHub during a relayed transaction. We check pre and
        // post state to ensure this doesn't happen.
        vars.balanceBefore = balances[relayRequest.relayData.paymaster];

        // First preRelayedCall is executed.
        // Note: we open a new block to avoid growing the stack too much.
        vars.data = abi.encodeWithSelector(
            IPaymaster.preRelayedCall.selector,
            relayRequest, signature, approvalData, maxPossibleGas
        );
        {
            bool success;
            bytes memory retData;
            (success, retData) = relayRequest.relayData.paymaster.call{gas:gasAndDataLimits.preRelayedCallGasLimit}(vars.data);
            if (!success) {
                GsnEip712Library.truncateInPlace(retData);
                revertWithStatus(RelayCallStatus.RejectedByPreRelayed, retData);
            }
            (vars.recipientContext, vars.rejectOnRecipientRevert) = abi.decode(retData, (bytes,bool));
        }

        // The actual relayed call is now executed. The sender's address is appended at the end of the transaction data

        {
            bool forwarderSuccess;
            (forwarderSuccess, vars.relayedCallSuccess, vars.relayedCallReturnValue) = GsnEip712Library.execute(relayRequest, signature);
            if ( !forwarderSuccess ) {
                revertWithStatus(RelayCallStatus.RejectedByForwarder, vars.relayedCallReturnValue);
            }

            if (vars.rejectOnRecipientRevert && !vars.relayedCallSuccess) {
                // we trusted the recipient, but it reverted...
                revertWithStatus(RelayCallStatus.RejectedByRecipientRevert, vars.relayedCallReturnValue);
            }
        }
        // Finally, postRelayedCall is executed, with the relayedCall execution's status and a charge estimate
        // We now determine how much the recipient will be charged, to pass this value to postRelayedCall for accurate
        // accounting.
        vars.data = abi.encodeWithSelector(
            IPaymaster.postRelayedCall.selector,
            vars.recipientContext,
            vars.relayedCallSuccess,
            vars.gasUsedToCallInner + (vars.initialGasLeft - aggregateGasleft()), /*gasUseWithoutPost*/
            relayRequest.relayData
        );

        {
        (bool successPost,bytes memory ret) = relayRequest.relayData.paymaster.call{gas:gasAndDataLimits.postRelayedCallGasLimit}(vars.data);

            if (!successPost) {
                revertWithStatus(RelayCallStatus.PostRelayedFailed, ret);
            }
        }

        if (balances[relayRequest.relayData.paymaster] < vars.balanceBefore) {
            revertWithStatus(RelayCallStatus.PaymasterBalanceChanged, "");
        }

        return (vars.relayedCallSuccess ? RelayCallStatus.OK : RelayCallStatus.RelayedCallFailed, vars.relayedCallReturnValue);
    }

    /**
     * @dev Reverts the transaction with return data set to the ABI encoding of the status argument (and revert reason data)
     */
    function revertWithStatus(RelayCallStatus status, bytes memory ret) private pure {
        bytes memory data = abi.encode(status, ret);
        GsnEip712Library.truncateInPlace(data);

        assembly {
            let dataSize := mload(data)
            let dataPtr := add(data, 32)

            revert(dataPtr, dataSize)
        }
    }

    /// @inheritdoc IRelayHub
    function calculateDevCharge(uint256 charge) public override virtual view returns (uint256){
        if (config.devFee == 0){ // save some gas in case of zero dev charge
            return 0;
        }
        unchecked {
        return charge * config.devFee / 100;
        }
    }

    /// @inheritdoc IRelayHub
    function calculateCharge(uint256 gasUsed, GsnTypes.RelayData calldata relayData) public override virtual view returns (uint256) {
        uint256 basefee;
        if (relayData.maxFeePerGas == relayData.maxPriorityFeePerGas) {
            basefee = 0;
        } else {
            basefee = block.basefee;
        }
        uint256 chargeableGasPrice = Math.min(relayData.maxFeePerGas, Math.min(tx.gasprice, basefee + relayData.maxPriorityFeePerGas));
        return config.baseRelayFee + (gasUsed * chargeableGasPrice * (config.pctRelayFee + 100)) / 100;
    }

    /// @inheritdoc IRelayHub
    function verifyRelayManagerStaked(address relayManager) public override view {
        (IStakeManager.StakeInfo memory info, bool isHubAuthorized) = stakeManager.getStakeInfo(relayManager);
        uint256 minimumStake = minimumStakePerToken[info.token];
        require(info.token != IERC20(address(0)), "relay manager not staked");
        require(info.stake >= minimumStake, "stake amount is too small");
        require(minimumStake != 0, "staking this token is forbidden");
        require(info.unstakeDelay >= config.minimumUnstakeDelay, "unstake delay is too small");
        require(info.withdrawTime == 0, "stake has been withdrawn");
        require(isHubAuthorized, "this hub is not authorized by SM");
    }

    /// @inheritdoc IRelayHub
    function deprecateHub(uint256 _deprecationTime) public override onlyOwner {
        require(!isDeprecated(), "Already deprecated");
        deprecationTime = _deprecationTime;
        emit HubDeprecated(deprecationTime);
    }

    /// @inheritdoc IRelayHub
    function isDeprecated() public override view returns (bool) {
        return block.timestamp >= deprecationTime;
    }

    /// @notice Prevents any address other than the `Penalizer` from calling this method.
    modifier penalizerOnly () {
        require(msg.sender == penalizer, "Not penalizer");
        _;
    }

    /// @inheritdoc IRelayHub
    function penalize(address relayWorker, address payable beneficiary) external override penalizerOnly {
        address relayManager = workerToManager[relayWorker];
        // The worker must be controlled by a manager with a locked stake
        require(relayManager != address(0), "Unknown relay worker");
        (IStakeManager.StakeInfo memory stakeInfo,) = stakeManager.getStakeInfo(relayManager);
        require(stakeInfo.stake > 0, "relay manager not staked");
        stakeManager.penalizeRelayManager(relayManager, beneficiary, stakeInfo.stake);
    }

    /// @inheritdoc IRelayHub
    function isRelayEscheatable(address relayManager) public view override returns (bool){
        return stakeManager.isRelayEscheatable(relayManager);
    }

    /// @inheritdoc IRelayHub
    function escheatAbandonedRelayBalance(address relayManager) external override onlyOwner {
        require(stakeManager.isRelayEscheatable(relayManager), "relay server not escheatable yet");
        uint256 balance = balances[relayManager];
        balances[relayManager] = 0;
        balances[config.devAddress] = balances[config.devAddress] + balance;
        emit AbandonedRelayManagerBalanceEscheated(relayManager, balance);
    }

    /// @inheritdoc IRelayHub
    function aggregateGasleft() public override virtual view returns (uint256){
        return gasleft();
    }
}

File 11 of 21 : IForwarder.sol
pragma solidity >=0.7.6;
pragma abicoder v2;

// SPDX-License-Identifier: GPL-3.0-only

import "@openzeppelin/contracts/interfaces/IERC165.sol";

/**
 * @title The Forwarder Interface
 * @notice The contracts implementing this interface take a role of authorization, authentication and replay protection
 * for contracts that choose to trust a `Forwarder`, instead of relying on a mechanism built into the Ethereum protocol.
 *
 * @notice if the `Forwarder` contract decides that an incoming `ForwardRequest` is valid, it must append 20 bytes that
 * represent the caller to the `data` field of the request and send this new data to the target address (the `to` field)
 *
 * :warning: **Warning** :warning: The Forwarder can have a full control over a `Recipient` contract.
 * Any vulnerability in a `Forwarder` implementation can make all of its `Recipient` contracts susceptible!
 * Recipient contracts should only trust forwarders that passed through security audit,
 * otherwise they are susceptible to identity theft.
 */
interface IForwarder is IERC165 {

    /**
     * @notice A representation of a request for a `Forwarder` to send `data` on behalf of a `from` to a target (`to`).
     */
    struct ForwardRequest {
        address from;
        address to;
        uint256 value;
        uint256 gas;
        uint256 nonce;
        bytes data;
        uint256 validUntilTime;
    }

    event DomainRegistered(bytes32 indexed domainSeparator, bytes domainValue);

    event RequestTypeRegistered(bytes32 indexed typeHash, string typeStr);

    /**
     * @param from The address of a sender.
     * @return The nonce for this address.
     */
    function getNonce(address from)
    external view
    returns(uint256);

    /**
     * @notice Verify the transaction is valid and can be executed.
     * Implementations must validate the signature and the nonce of the request are correct.
     * Does not revert and returns successfully if the input is valid.
     * Reverts if any validation has failed. For instance, if either signature or nonce are incorrect.
     * Reverts if `domainSeparator` or `requestTypeHash` are not registered as well.
     */
    function verify(
        ForwardRequest calldata forwardRequest,
        bytes32 domainSeparator,
        bytes32 requestTypeHash,
        bytes calldata suffixData,
        bytes calldata signature
    ) external view;

    /**
     * @notice Executes a transaction specified by the `ForwardRequest`.
     * The transaction is first verified and then executed.
     * The success flag and returned bytes array of the `CALL` are returned as-is.
     *
     * This method would revert only in case of a verification error.
     *
     * All the target errors are reported using the returned success flag and returned bytes array.
     *
     * @param forwardRequest All requested transaction parameters.
     * @param domainSeparator The domain used when signing this request.
     * @param requestTypeHash The request type used when signing this request.
     * @param suffixData The ABI-encoded extension data for the current `RequestType` used when signing this request.
     * @param signature The client signature to be validated.
     *
     * @return success The success flag of the underlying `CALL` to the target address.
     * @return ret The byte array returned by the underlying `CALL` to the target address.
     */
    function execute(
        ForwardRequest calldata forwardRequest,
        bytes32 domainSeparator,
        bytes32 requestTypeHash,
        bytes calldata suffixData,
        bytes calldata signature
    )
    external payable
    returns (bool success, bytes memory ret);

    /**
     * @notice Register a new Request typehash.
     *
     * @notice This is necessary for the Forwarder to be able to verify the signatures conforming to the ERC-712.
     *
     * @param typeName The name of the request type.
     * @param typeSuffix Any extra data after the generic params. Must contain add at least one param.
     * The generic ForwardRequest type is always registered by the constructor.
     */
    function registerRequestType(string calldata typeName, string calldata typeSuffix) external;

    /**
     * @notice Register a new domain separator.
     *
     * @notice This is necessary for the Forwarder to be able to verify the signatures conforming to the ERC-712.
     *
     * @notice The domain separator must have the following fields: `name`, `version`, `chainId`, `verifyingContract`.
     * The `chainId` is the current network's `chainId`, and the `verifyingContract` is this Forwarder's address.
     * This method accepts the domain name and version to create and register the domain separator value.
     * @param name The domain's display name.
     * @param version The domain/protocol version.
     */
    function registerDomainSeparator(string calldata name, string calldata version) external;
}

File 12 of 21 : IERC2771Recipient.sol
pragma solidity >=0.6.0;

// SPDX-License-Identifier: MIT

/**
 * @title The ERC-2771 Recipient Base Abstract Class - Declarations
 *
 * @notice A contract must implement this interface in order to support relayed transaction.
 *
 * @notice It is recommended that your contract inherits from the ERC2771Recipient contract.
 */
abstract contract IERC2771Recipient {

    /**
     * :warning: **Warning** :warning: The Forwarder can have a full control over your Recipient. Only trust verified Forwarder.
     * @param forwarder The address of the Forwarder contract that is being used.
     * @return isTrustedForwarder `true` if the Forwarder is trusted to forward relayed transactions by this Recipient.
     */
    function isTrustedForwarder(address forwarder) public virtual view returns(bool);

    /**
     * @notice Use this method the contract anywhere instead of msg.sender to support relayed transactions.
     * @return sender The real sender of this call.
     * For a call that came through the Forwarder the real sender is extracted from the last 20 bytes of the `msg.data`.
     * Otherwise simply returns `msg.sender`.
     */
    function _msgSender() internal virtual view returns (address);

    /**
     * @notice Use this method in the contract instead of `msg.data` when difference matters (hashing, signature, etc.)
     * @return data The real `msg.data` of this call.
     * For a call that came through the Forwarder, the real sender address was appended as the last 20 bytes
     * of the `msg.data` - so this method will strip those 20 bytes off.
     * Otherwise (if the call was made directly and not through the forwarder) simply returns `msg.data`.
     */
    function _msgData() internal virtual view returns (bytes calldata);
}

File 13 of 21 : IPaymaster.sol
pragma solidity >=0.7.6;
pragma abicoder v2;

// SPDX-License-Identifier: GPL-3.0-only

import "@openzeppelin/contracts/interfaces/IERC165.sol";

import "../utils/GsnTypes.sol";

/**
 * @title The Paymaster Interface
 * @notice Contracts implementing this interface exist to make decision about paying the transaction fee to the relay.
 *
 * @notice There are two callbacks here that are executed by the RelayHub: `preRelayedCall` and `postRelayedCall`.
 *
 * @notice It is recommended that your implementation inherits from the abstract BasePaymaster contract.
*/
interface IPaymaster is IERC165 {
    /**
     * @notice The limits this Paymaster wants to be imposed by the RelayHub on user input. See `getGasAndDataLimits`.
     */
    struct GasAndDataLimits {
        uint256 acceptanceBudget;
        uint256 preRelayedCallGasLimit;
        uint256 postRelayedCallGasLimit;
        uint256 calldataSizeLimit;
    }

    /**
     * @notice Return the Gas Limits for Paymaster's functions and maximum msg.data length values for this Paymaster.
     * This function allows different paymasters to have different properties without changes to the RelayHub.
     * @return limits An instance of the `GasAndDataLimits` struct
     *
     * ##### `acceptanceBudget`
     * If the transactions consumes more than `acceptanceBudget` this Paymaster will be charged for gas no matter what.
     * Transaction that gets rejected after consuming more than `acceptanceBudget` gas is on this Paymaster's expense.
     *
     * Should be set to an amount gas this Paymaster expects to spend deciding whether to accept or reject a request.
     * This includes gas consumed by calculations in the `preRelayedCall`, `Forwarder` and the recipient contract.
     *
     * :warning: **Warning** :warning: As long this value is above `preRelayedCallGasLimit`
     * (see defaults in `BasePaymaster`), the Paymaster is guaranteed it will never pay for rejected transactions.
     * If this value is below `preRelayedCallGasLimit`, it might might make Paymaster open to a "griefing" attack.
     *
     * The relayers should prefer lower `acceptanceBudget`, as it improves their chances of being compensated.
     * From a Relay's point of view, this is the highest gas value a bad Paymaster may cost the relay,
     * since the paymaster will pay anything above that value regardless of whether the transaction succeeds or reverts.
     * Specifying value too high might make the call rejected by relayers (see `maxAcceptanceBudget` in server config).
     *
     * ##### `preRelayedCallGasLimit`
     * The max gas usage of preRelayedCall. Any revert of the `preRelayedCall` is a request rejection by the paymaster.
     * As long as `acceptanceBudget` is above `preRelayedCallGasLimit`, any such revert is not payed by the paymaster.
     *
     * ##### `postRelayedCallGasLimit`
     * The max gas usage of postRelayedCall. The Paymaster is not charged for the maximum, only for actually used gas.
     * Note that an OOG will revert the inner transaction, but the paymaster will be charged for it anyway.
     */
    function getGasAndDataLimits()
    external
    view
    returns (
        GasAndDataLimits memory limits
    );

    /**
     * @notice :warning: **Warning** :warning: using incorrect Forwarder may cause the Paymaster to agreeing to pay for invalid transactions.
     * @return trustedForwarder The address of the `Forwarder` that is trusted by this Paymaster to execute the requests.
     */
    function getTrustedForwarder() external view returns (address trustedForwarder);

    /**
     * @return relayHub The address of the `RelayHub` that is trusted by this Paymaster to execute the requests.
     */
    function getRelayHub() external view returns (address relayHub);

    /**
     * @notice Called by the Relay in view mode and later by the `RelayHub` on-chain to validate that
     * the Paymaster agrees to pay for this call.
     *
     * The request is considered to be rejected by the Paymaster in one of the following conditions:
     *  - `preRelayedCall()` method reverts
     *  - the `Forwarder` reverts because of nonce or signature error
     *  - the `Paymaster` returned `rejectOnRecipientRevert: true` and the recipient contract reverted
     *    (and all that did not consume more than `acceptanceBudget` gas).
     *
     * In any of the above cases, all Paymaster calls and the recipient call are reverted.
     * In any other case the Paymaster will pay for the gas cost of the transaction.
     * Note that even if `postRelayedCall` is reverted the Paymaster will be charged.
     *

     * @param relayRequest - the full relay request structure
     * @param signature - user's EIP712-compatible signature of the `relayRequest`.
     * Note that in most cases the paymaster shouldn't try use it at all. It is always checked
     * by the forwarder immediately after preRelayedCall returns.
     * @param approvalData - extra dapp-specific data (e.g. signature from trusted party)
     * @param maxPossibleGas - based on values returned from `getGasAndDataLimits`
     * the RelayHub will calculate the maximum possible amount of gas the user may be charged for.
     * In order to convert this value to wei, the Paymaster has to call "relayHub.calculateCharge()"
     *
     * @return context
     * A byte array to be passed to postRelayedCall.
     * Can contain any data needed by this Paymaster in any form or be empty if no extra data is needed.
     * @return rejectOnRecipientRevert
     * The flag that allows a Paymaster to "delegate" the rejection to the recipient code.
     * It also means the Paymaster trust the recipient to reject fast: both preRelayedCall,
     * forwarder check and recipient checks must fit into the GasLimits.acceptanceBudget,
     * otherwise the TX is paid by the Paymaster.
     * `true` if the Paymaster wants to reject the TX if the recipient reverts.
     * `false` if the Paymaster wants rejects by the recipient to be completed on chain and paid by the Paymaster.
     */
    function preRelayedCall(
        GsnTypes.RelayRequest calldata relayRequest,
        bytes calldata signature,
        bytes calldata approvalData,
        uint256 maxPossibleGas
    )
    external
    returns (bytes memory context, bool rejectOnRecipientRevert);

    /**
     * @notice This method is called after the actual relayed function call.
     * It may be used to record the transaction (e.g. charge the caller by some contract logic) for this call.
     *
     * Revert in this functions causes a revert of the client's relayed call (and preRelayedCall(), but the Paymaster
     * is still committed to pay the relay for the entire transaction.
     *
     * @param context The call context, as returned by the preRelayedCall
     * @param success `true` if the relayed call succeeded, false if it reverted
     * @param gasUseWithoutPost The actual amount of gas used by the entire transaction, EXCEPT
     *        the gas used by the postRelayedCall itself.
     * @param relayData The relay params of the request. can be used by relayHub.calculateCharge()
     *
     */
    function postRelayedCall(
        bytes calldata context,
        bool success,
        uint256 gasUseWithoutPost,
        GsnTypes.RelayData calldata relayData
    ) external;

    /**
     * @return version The SemVer string of this Paymaster's version.
     */
    function versionPaymaster() external view returns (string memory);
}

File 14 of 21 : IRelayHub.sol
pragma solidity >=0.7.6;
pragma abicoder v2;

// SPDX-License-Identifier: GPL-3.0-only

import "@openzeppelin/contracts/interfaces/IERC165.sol";

import "../utils/GsnTypes.sol";
import "./IStakeManager.sol";

/**
 * @title The RelayHub interface
 * @notice The implementation of this interface provides all the information the GSN client needs to
 * create a valid `RelayRequest` and also serves as an entry point for such requests.
 *
 * @notice The RelayHub also handles all the related financial records and hold the balances of participants.
 * The Paymasters keep their Ether deposited in the `RelayHub` in order to pay for the `RelayRequest`s that thay choose
 * to pay for, and Relay Servers keep their earned Ether in the `RelayHub` until they choose to `withdraw()`
 *
 * @notice The RelayHub on each supported network only needs a single instance and there is usually no need for dApp
 * developers or Relay Server operators to redeploy, reimplement, modify or override the `RelayHub`.
 */
interface IRelayHub is IERC165 {
    /**
     * @notice A struct that contains all the parameters of the `RelayHub` that can be modified after the deployment.
     */
    struct RelayHubConfig {
        // maximum number of worker accounts allowed per manager
        uint256 maxWorkerCount;
        // Gas set aside for all relayCall() instructions to prevent unexpected out-of-gas exceptions
        uint256 gasReserve;
        // Gas overhead to calculate gasUseWithoutPost
        uint256 postOverhead;
        // Gas cost of all relayCall() instructions after actual 'calculateCharge()'
        // Assume that relay has non-zero balance (costs 15'000 more otherwise).
        uint256 gasOverhead;
        // Minimum unstake delay seconds of a relay manager's stake on the StakeManager
        uint256 minimumUnstakeDelay;
        // Developers address
        address devAddress;
        // 0 < fee < 100, as percentage of total charge from paymaster to relayer
        uint8 devFee;
        // baseRelayFee The base fee the Relay Server charges for a single transaction in Ether, in wei.
        uint80 baseRelayFee;
        // pctRelayFee The percent of the total charge to add as a Relay Server fee to the total charge.
        uint16 pctRelayFee;
    }

    /// @notice Emitted when a configuration of the `RelayHub` is changed
    event RelayHubConfigured(RelayHubConfig config);

    /// @notice Emitted when relays are added by a relayManager
    event RelayWorkersAdded(
        address indexed relayManager,
        address[] newRelayWorkers,
        uint256 workersCount
    );

    /// @notice Emitted when an account withdraws funds from the `RelayHub`.
    event Withdrawn(
        address indexed account,
        address indexed dest,
        uint256 amount
    );

    /// @notice Emitted when `depositFor` is called, including the amount and account that was funded.
    event Deposited(
        address indexed paymaster,
        address indexed from,
        uint256 amount
    );

    /// @notice Emitted for each token configured for staking in setMinimumStakes
    event StakingTokenDataChanged(
        address token,
        uint256 minimumStake
    );

    /**
     * @notice Emitted when an attempt to relay a call fails and the `Paymaster` does not accept the transaction.
     * The actual relayed call was not executed, and the recipient not charged.
     * @param reason contains a revert reason returned from preRelayedCall or forwarder.
     */
    event TransactionRejectedByPaymaster(
        address indexed relayManager,
        address indexed paymaster,
        bytes32 indexed relayRequestID,
        address from,
        address to,
        address relayWorker,
        bytes4 selector,
        uint256 innerGasUsed,
        bytes reason
    );

    /**
     * @notice Emitted when a transaction is relayed. Note that the actual internal function call might be reverted.
     * The reason for a revert will be indicated in the `status` field of a corresponding `RelayCallStatus` value.
     * @notice `charge` is the Ether value deducted from the `Paymaster` balance.
     * The amount added to the `relayManager` balance will be lower if there is an activated `devFee` in the `config`.
     */
    event TransactionRelayed(
        address indexed relayManager,
        address indexed relayWorker,
        bytes32 indexed relayRequestID,
        address from,
        address to,
        address paymaster,
        bytes4 selector,
        RelayCallStatus status,
        uint256 charge
    );

    /// @notice This event is emitted in case the internal function returns a value or reverts with a revert string.
    event TransactionResult(
        RelayCallStatus status,
        bytes returnValue
    );

    /// @notice This event is emitted in case this `RelayHub` is deprecated and will stop serving transactions soon.
    event HubDeprecated(uint256 deprecationTime);

    /**
     * @notice This event is emitted in case a `relayManager` has been deemed "abandoned" for being
     * unresponsive for a prolonged period of time.
     * @notice This event means the entire balance of the relay has been transferred to the `devAddress`.
     */
    event AbandonedRelayManagerBalanceEscheated(
        address indexed relayManager,
        uint256 balance
    );

    /**
     * Error codes that describe all possible failure reasons reported in the `TransactionRelayed` event `status` field.
     *  @param OK The transaction was successfully relayed and execution successful - never included in the event.
     *  @param RelayedCallFailed The transaction was relayed, but the relayed call failed.
     *  @param RejectedByPreRelayed The transaction was not relayed due to preRelatedCall reverting.
     *  @param RejectedByForwarder The transaction was not relayed due to forwarder check (signature,nonce).
     *  @param PostRelayedFailed The transaction was relayed and reverted due to postRelatedCall reverting.
     *  @param PaymasterBalanceChanged The transaction was relayed and reverted due to the paymaster balance change.
     */
    enum RelayCallStatus {
        OK,
        RelayedCallFailed,
        RejectedByPreRelayed,
        RejectedByForwarder,
        RejectedByRecipientRevert,
        PostRelayedFailed,
        PaymasterBalanceChanged
    }

    /**
     * @notice Add new worker addresses controlled by the sender who must be a staked Relay Manager address.
     * Emits a `RelayWorkersAdded` event.
     * This function can be called multiple times, emitting new events.
     */
    function addRelayWorkers(address[] calldata newRelayWorkers) external;

    /**
     * @notice The `RelayRegistrar` callback to notify the `RelayHub` that this `relayManager` has updated registration.
     */
    function onRelayServerRegistered(address relayManager) external;

    // Balance management

    /**
     * @notice Deposits ether for a `Paymaster`, so that it can and pay for relayed transactions.
     * :warning: **Warning** :warning: Unused balance can only be withdrawn by the holder itself, by calling `withdraw`.
     * Emits a `Deposited` event.
     */
    function depositFor(address target) external payable;

    /**
     * @notice Withdraws from an account's balance, sending it back to the caller.
     * Relay Managers call this to retrieve their revenue, and `Paymasters` can also use it to reduce their funding.
     * Emits a `Withdrawn` event.
     */
    function withdraw(address payable dest, uint256 amount) external;

    /**
     * @notice Withdraws from an account's balance, sending funds to multiple provided addresses.
     * Relay Managers call this to retrieve their revenue, and `Paymasters` can also use it to reduce their funding.
     * Emits a `Withdrawn` event for each destination.
     */
    function withdrawMultiple(address payable[] memory dest, uint256[] memory amount) external;

    // Relaying

    /**
     * @notice Relays a transaction. For this to succeed, multiple conditions must be met:
     *  - `Paymaster`'s `preRelayCall` method must succeed and not revert.
     *  - the `msg.sender` must be a registered Relay Worker that the user signed to use.
     *  - the transaction's gas fees must be equal or larger than the ones that were signed by the sender.
     *  - the transaction must have enough gas to run all internal transactions if they use all gas available to them.
     *  - the `Paymaster` must have enough balance to pay the Relay Worker if all gas is spent.
     *
     * @notice If all conditions are met, the call will be relayed and the `Paymaster` charged.
     *
     * @param maxAcceptanceBudget The maximum valid value for `paymaster.getGasLimits().acceptanceBudget` to return.
     * @param relayRequest All details of the requested relayed call.
     * @param signature The client's EIP-712 signature over the `relayRequest` struct.
     * @param approvalData The dapp-specific data forwarded to the `Paymaster`'s `preRelayedCall` method.
     * This value is **not** verified by the `RelayHub` in any way.
     * As an example, it can be used to pass some kind of a third-party signature to the `Paymaster` for verification.
     *
     * Emits a `TransactionRelayed` event regardless of whether the transaction succeeded or failed.
     */
    function relayCall(
        uint256 maxAcceptanceBudget,
        GsnTypes.RelayRequest calldata relayRequest,
        bytes calldata signature,
        bytes calldata approvalData
    )
    external
    returns (
        bool paymasterAccepted,
        uint256 charge,
        IRelayHub.RelayCallStatus status,
        bytes memory returnValue
    );

    /**
     * @notice In case the Relay Worker has been found to be in violation of some rules by the `Penalizer` contract,
     * the `Penalizer` will call this method to execute a penalization.
     * The `RelayHub` will look up the Relay Manager of the given Relay Worker and will forward the call to
     * the `StakeManager` contract. The `RelayHub` does not perform the actual penalization either.
     * @param relayWorker The address of the Relay Worker that committed a penalizable offense.
     * @param beneficiary The address that called the `Penalizer` and will receive a reward for it.
     */
    function penalize(address relayWorker, address payable beneficiary) external;

    /**
     * @notice Sets or changes the configuration of this `RelayHub`.
     * @param _config The new configuration.
     */
    function setConfiguration(RelayHubConfig memory _config) external;

    /**
     * @notice Sets or changes the minimum amount of a given `token` that needs to be staked so that the Relay Manager
     * is considered to be 'staked' by this `RelayHub`. Zero value means this token is not allowed for staking.
     * @param token An array of addresses of ERC-20 compatible tokens.
     * @param minimumStake An array of minimal amounts necessary for a corresponding token, in wei.
     */
    function setMinimumStakes(IERC20[] memory token, uint256[] memory minimumStake) external;

    /**
     * @notice Deprecate hub by reverting all incoming `relayCall()` calls starting from a given timestamp
     * @param _deprecationTime The timestamp in seconds after which the `RelayHub` stops serving transactions.
     */
    function deprecateHub(uint256 _deprecationTime) external;

    /**
     * @notice
     * @param relayManager
     */
    function escheatAbandonedRelayBalance(address relayManager) external;

    /**
     * @notice The fee is expressed as a base fee in wei plus percentage of the actual charge.
     * For example, a value '40' stands for a 40% fee, so the recipient will be charged for 1.4 times the spent amount.
     * @param gasUsed An amount of gas used by the transaction.
     * @param relayData The details of a transaction signed by the sender.
     * @return The calculated charge, in wei.
     */
    function calculateCharge(uint256 gasUsed, GsnTypes.RelayData calldata relayData) external view returns (uint256);

    /**
     * @notice The fee is expressed as a  percentage of the actual charge.
     * For example, a value '40' stands for a 40% fee, so the Relay Manager will only get 60% of the `charge`.
     * @param charge The amount of Ether in wei the Paymaster will be charged for this transaction.
     * @return The calculated devFee, in wei.
     */
    function calculateDevCharge(uint256 charge) external view returns (uint256);
    /* getters */

    /// @return config The configuration of the `RelayHub`.
    function getConfiguration() external view returns (RelayHubConfig memory config);

    /**
     * @param token An address of an ERC-20 compatible tokens.
     * @return The minimum amount of a given `token` that needs to be staked so that the Relay Manager
     * is considered to be 'staked' by this `RelayHub`. Zero value means this token is not allowed for staking.
     */
    function getMinimumStakePerToken(IERC20 token) external view returns (uint256);

    /**
     * @param worker An address of the Relay Worker.
     * @return The address of its Relay Manager.
     */
    function getWorkerManager(address worker) external view returns (address);

    /**
     * @param manager An address of the Relay Manager.
     * @return The count of Relay Workers associated with this Relay Manager.
     */
    function getWorkerCount(address manager) external view returns (uint256);

    /// @return An account's balance. It can be either a deposit of a `Paymaster`, or a revenue of a Relay Manager.
    function balanceOf(address target) external view returns (uint256);

    /// @return The `StakeManager` address for this `RelayHub`.
    function getStakeManager() external view returns (IStakeManager);

    /// @return The `Penalizer` address for this `RelayHub`.
    function getPenalizer() external view returns (address);

    /// @return The `RelayRegistrar` address for this `RelayHub`.
    function getRelayRegistrar() external view returns (address);

    /// @return The `BatchGateway` address for this `RelayHub`.
    function getBatchGateway() external view returns (address);

    /**
     * @notice Uses `StakeManager` to decide if the Relay Manager can be considered staked or not.
     * Returns if the stake's token, amount and delay satisfy all requirements, reverts otherwise.
     */
    function verifyRelayManagerStaked(address relayManager) external view;

    /**
     * @notice Uses `StakeManager` to check if the Relay Manager can be considered abandoned or not.
     * Returns true if the stake's abandonment time is in the past including the escheatment delay, false otherwise.
     */
    function isRelayEscheatable(address relayManager) external view returns (bool);

    /// @return `true` if the `RelayHub` is deprecated, `false` it it is not deprecated and can serve transactions.
    function isDeprecated() external view returns (bool);

    /// @return The timestamp from which the hub no longer allows relaying calls.
    function getDeprecationTime() external view returns (uint256);

    /// @return The block number in which the contract has been deployed.
    function getCreationBlock() external view returns (uint256);

    /// @return a SemVer-compliant version of the `RelayHub` contract.
    function versionHub() external view returns (string memory);

    /// @return A total measurable amount of gas left to current execution. Same as 'gasleft()' for pure EVMs.
    function aggregateGasleft() external view returns (uint256);
}

File 15 of 21 : IRelayRegistrar.sol
pragma solidity ^0.8.6;

//SPDX-License-Identifier: GPL-3.0-only

import "@openzeppelin/contracts/interfaces/IERC165.sol";

/**
 * @title The RelayRegistrar Interface
 * @notice The on-chain registrar for all registered Relay Managers.
 *
 * @notice The client can use an implementation of a `RelayRegistrar` to find relay registration info.
 *
 */
interface IRelayRegistrar is IERC165 {

    /**
     * @notice A struct containing all the information necessary to client to interact with the Relay Server.
     */
    struct RelayInfo {
        //last registration block number
        uint32 lastSeenBlockNumber;
        //last registration block timestamp
        uint40 lastSeenTimestamp;
        //stake (first registration) block number
        uint32 firstSeenBlockNumber;
        //stake (first registration) block timestamp
        uint40 firstSeenTimestamp;
        bytes32[3] urlParts;
        address relayManager;
    }

    /**
     * @notice Emitted when a relay server registers or updates its details.
     * Looking up these events allows a client to discover registered Relay Servers.
     */
    event RelayServerRegistered(
        address indexed relayManager,
        address indexed relayHub,
        bytes32[3] relayUrl
    );

    /**
     * @notice This function is called by Relay Servers in order to register or to update their registration.
     * @param relayHub The address of the `RelayHub` contract for which this action is performed.
     * @param url The URL of the Relay Server that is listening to the clients' requests.
     */
    function registerRelayServer(
        address relayHub,
        bytes32[3] calldata url
    ) external;

    /**
     * @return The block number in which the contract has been deployed.
     */
    function getCreationBlock() external view returns (uint256);

    /**
     * @return The maximum age the relay is considered registered by default by this `RelayRegistrar`, in seconds.
     */
    function getRelayRegistrationMaxAge() external view returns (uint256);

    /**
     * @notice Change the maximum relay registration age.
     */
    function setRelayRegistrationMaxAge(uint256) external;

    /**
     * @param relayManager An address of a Relay Manager.
     * @param relayHub The address of the `RelayHub` contract for which this action is performed.
     * @return info All the details of the given Relay Manager's registration. Throws if relay not found for `RelayHub`.
     */
    function getRelayInfo(address relayHub, address relayManager) external view returns (RelayInfo memory info);

    /**
     * @notice Read relay info of registered Relay Server from an on-chain storage.
     * @param relayHub The address of the `RelayHub` contract for which this action is performed.
     * @return info The list of `RelayInfo`s of registered Relay Servers
     */
    function readRelayInfos(
        address relayHub
    ) external view returns (
        RelayInfo[] memory info
    );

    /**
     * @notice Read relay info of registered Relay Server from an on-chain storage.
     * @param relayHub The address of the `RelayHub` contract for which this action is performed.
     * @param maxCount The maximum amount of relays to be returned by this function.
     * @param oldestBlockNumber The latest block number in which a Relay Server may be registered.
     * @param oldestBlockTimestamp The latest block timestamp in which a Relay Server may be registered.
     * @return info The list of `RelayInfo`s of registered Relay Servers
     */
    function readRelayInfosInRange(
        address relayHub,
        uint256 oldestBlockNumber,
        uint256 oldestBlockTimestamp,
        uint256 maxCount
    ) external view returns (
        RelayInfo[] memory info
    );
}

File 16 of 21 : IStakeManager.sol
pragma solidity >=0.7.6;
pragma abicoder v2;

// SPDX-License-Identifier: GPL-3.0-only

import "@openzeppelin/contracts/token/ERC20/IERC20.sol";
import "@openzeppelin/contracts/utils/introspection/ERC165.sol";

/**
 * @title The StakeManager Interface
 * @notice In order to prevent an attacker from registering a large number of unresponsive relays, the GSN requires
 * the Relay Server to maintain a permanently locked stake in the system before being able to register.
 *
 * @notice Also, in some cases the behavior of a Relay Server may be found to be illegal by a `Penalizer` contract.
 * In such case, the stake will never be returned to the Relay Server operator and will be slashed.
 *
 * @notice An implementation of this interface is tasked with keeping Relay Servers' stakes, made in any ERC-20 token.
 * Note that the `RelayHub` chooses which ERC-20 tokens to support and how much stake is needed.
 */
interface IStakeManager is IERC165 {

    /// @notice Emitted when a `stake` or `unstakeDelay` are initialized or increased.
    event StakeAdded(
        address indexed relayManager,
        address indexed owner,
        IERC20 token,
        uint256 stake,
        uint256 unstakeDelay
    );

    /// @notice Emitted once a stake is scheduled for withdrawal.
    event StakeUnlocked(
        address indexed relayManager,
        address indexed owner,
        uint256 withdrawTime
    );

    /// @notice Emitted when owner withdraws `relayManager` funds.
    event StakeWithdrawn(
        address indexed relayManager,
        address indexed owner,
        IERC20 token,
        uint256 amount
    );

    /// @notice Emitted when an authorized `RelayHub` penalizes a `relayManager`.
    event StakePenalized(
        address indexed relayManager,
        address indexed beneficiary,
        IERC20 token,
        uint256 reward
    );

    /// @notice Emitted when a `relayManager` adds a new `RelayHub` to a list of authorized.
    event HubAuthorized(
        address indexed relayManager,
        address indexed relayHub
    );

    /// @notice Emitted when a `relayManager` removes a `RelayHub` from a list of authorized.
    event HubUnauthorized(
        address indexed relayManager,
        address indexed relayHub,
        uint256 removalTime
    );

    /// @notice Emitted when a `relayManager` sets its `owner`. This is necessary to prevent stake hijacking.
    event OwnerSet(
        address indexed relayManager,
        address indexed owner
    );

    /// @notice Emitted when a `burnAddress` is changed.
    event BurnAddressSet(
        address indexed burnAddress
    );

    /// @notice Emitted when a `devAddress` is changed.
    event DevAddressSet(
        address indexed devAddress
    );

    /// @notice Emitted if Relay Server is inactive for an `abandonmentDelay` and contract owner initiates its removal.
    event RelayServerAbandoned(
        address indexed relayManager,
        uint256 abandonedTime
    );

    /// @notice Emitted to indicate an action performed by a relay server to prevent it from being marked as abandoned.
    event RelayServerKeepalive(
        address indexed relayManager,
        uint256 keepaliveTime
    );

    /// @notice Emitted when the stake of an abandoned relayer has been confiscated and transferred to the `devAddress`.
    event AbandonedRelayManagerStakeEscheated(
        address indexed relayManager,
        address indexed owner,
        IERC20 token,
        uint256 amount
    );

    /**
     * @param stake - amount of ether staked for this relay
     * @param unstakeDelay - number of seconds to elapse before the owner can retrieve the stake after calling 'unlock'
     * @param withdrawTime - timestamp in seconds when 'withdraw' will be callable, or zero if the unlock has not been called
     * @param owner - address that receives revenue and manages relayManager's stake
     */
    struct StakeInfo {
        uint256 stake;
        uint256 unstakeDelay;
        uint256 withdrawTime;
        uint256 abandonedTime;
        uint256 keepaliveTime;
        IERC20 token;
        address owner;
    }

    struct RelayHubInfo {
        uint256 removalTime;
    }

    /**
     * @param devAddress - the address that will receive the 'abandoned' stake
     * @param abandonmentDelay - the amount of time after which the relay can be marked as 'abandoned'
     * @param escheatmentDelay - the amount of time after which the abandoned relay's stake and balance may be withdrawn to the `devAddress`
     */
    struct AbandonedRelayServerConfig {
        address devAddress;
        uint256 abandonmentDelay;
        uint256 escheatmentDelay;
    }

    /**
     * @notice Set the owner of a Relay Manager. Called only by the RelayManager itself.
     * Note that owners cannot transfer ownership - if the entry already exists, reverts.
     * @param owner - owner of the relay (as configured off-chain)
     */
    function setRelayManagerOwner(address owner) external;

    /**
     * @notice Put a stake for a relayManager and set its unstake delay.
     * Only the owner can call this function. If the entry does not exist, reverts.
     * The owner must give allowance of the ERC-20 token to the StakeManager before calling this method.
     * It is the RelayHub who has a configurable list of minimum stakes per token. StakeManager accepts all tokens.
     * @param token The address of an ERC-20 token that is used by the relayManager as a stake
     * @param relayManager The address that represents a stake entry and controls relay registrations on relay hubs
     * @param unstakeDelay The number of seconds to elapse before an owner can retrieve the stake after calling `unlock`
     * @param amount The amount of tokens to be taken from the relayOwner and locked in the StakeManager as a stake
     */
    function stakeForRelayManager(IERC20 token, address relayManager, uint256 unstakeDelay, uint256 amount) external;

    /**
     * @notice Schedule the unlocking of the stake. The `unstakeDelay` must pass before owner can call `withdrawStake`.
     * @param relayManager The address of a Relay Manager whose stake is to be unlocked.
     */
    function unlockStake(address relayManager) external;
    /**
     * @notice Withdraw the unlocked stake.
     * @param relayManager The address of a Relay Manager whose stake is to be withdrawn.
     */
    function withdrawStake(address relayManager) external;

    /**
     * @notice Add the `RelayHub` to a list of authorized by this Relay Manager.
     * This allows the RelayHub to penalize this Relay Manager. The `RelayHub` cannot trust a Relay it cannot penalize.
     * @param relayManager The address of a Relay Manager whose stake is to be authorized for the new `RelayHub`.
     * @param relayHub The address of a `RelayHub` to be authorized.
     */
    function authorizeHubByOwner(address relayManager, address relayHub) external;

    /**
     * @notice Same as `authorizeHubByOwner` but can be called by the RelayManager itself.
     */
    function authorizeHubByManager(address relayHub) external;

    /**
     * @notice Remove the `RelayHub` from a list of authorized by this Relay Manager.
     * @param relayManager The address of a Relay Manager.
     * @param relayHub The address of a `RelayHub` to be unauthorized.
     */
    function unauthorizeHubByOwner(address relayManager, address relayHub) external;

    /**
     * @notice Same as `unauthorizeHubByOwner` but can be called by the RelayManager itself.
     */
    function unauthorizeHubByManager(address relayHub) external;

    /**
     * Slash the stake of the relay relayManager. In order to prevent stake kidnapping, burns part of stake on the way.
     * @param relayManager The address of a Relay Manager to be penalized.
     * @param beneficiary The address that receives part of the penalty amount.
     * @param amount A total amount of penalty to be withdrawn from stake.
     */
    function penalizeRelayManager(address relayManager, address beneficiary, uint256 amount) external;

    /**
     * @notice Allows the contract owner to set the given `relayManager` as abandoned after a configurable delay.
     * Its entire stake and balance will be taken from a relay if it does not respond to being marked as abandoned.
     */
    function markRelayAbandoned(address relayManager) external;

    /**
     * @notice If more than `abandonmentDelay` has passed since the last Keepalive transaction, and relay manager
     * has been marked as abandoned, and after that more that `escheatmentDelay` have passed, entire stake and
     * balance will be taken from this relay.
     */
    function escheatAbandonedRelayStake(address relayManager) external;

    /**
     * @notice Sets a new `keepaliveTime` for the given `relayManager`, preventing it from being marked as abandoned.
     * Can be called by an authorized `RelayHub` or by the `relayOwner` address.
     */
    function updateRelayKeepaliveTime(address relayManager) external;

    /**
     * @notice Check if the Relay Manager can be considered abandoned or not.
     * Returns true if the stake's abandonment time is in the past including the escheatment delay, false otherwise.
     */
    function isRelayEscheatable(address relayManager) external view returns(bool);

    /**
     * @notice Get the stake details information for the given Relay Manager.
     * @param relayManager The address of a Relay Manager.
     * @return stakeInfo The `StakeInfo` structure.
     * @return isSenderAuthorizedHub `true` if the `msg.sender` for this call was a `RelayHub` that is authorized now.
     * `false` if the `msg.sender` for this call is not authorized.
     */
    function getStakeInfo(address relayManager) external view returns (StakeInfo memory stakeInfo, bool isSenderAuthorizedHub);

    /**
     * @return The maximum unstake delay this `StakeManger` allows. This is to prevent locking money forever by mistake.
     */
    function getMaxUnstakeDelay() external view returns (uint256);

    /**
     * @notice Change the address that will receive the 'burned' part of the penalized stake.
     * This is done to prevent malicious Relay Server from penalizing itself and breaking even.
     */
    function setBurnAddress(address _burnAddress) external;

    /**
     * @return The address that will receive the 'burned' part of the penalized stake.
     */
    function getBurnAddress() external view returns (address);

    /**
     * @notice Change the address that will receive the 'abandoned' stake.
     * This is done to prevent Relay Servers that lost their keys from losing access to funds.
     */
    function setDevAddress(address _burnAddress) external;

    /**
     * @return The structure that contains all configuration values for the 'abandoned' stake.
     */
    function getAbandonedRelayServerConfig() external view returns (AbandonedRelayServerConfig memory);

    /**
     * @return the block number in which the contract has been deployed.
     */
    function getCreationBlock() external view returns (uint256);

    /**
     * @return a SemVer-compliant version of the `StakeManager` contract.
     */
    function versionSM() external view returns (string memory);
}

File 17 of 21 : GsnEip712Library.sol
pragma solidity ^0.8.0;
pragma abicoder v2;

// SPDX-License-Identifier: GPL-3.0-only

import "../utils/GsnTypes.sol";
import "../interfaces/IERC2771Recipient.sol";
import "../forwarder/IForwarder.sol";

import "./GsnUtils.sol";

/**
 * @title The ERC-712 Library for GSN
 * @notice Bridge Library to convert a GSN RelayRequest into a valid `ForwardRequest` for a `Forwarder`.
 */
library GsnEip712Library {
    // maximum length of return value/revert reason for 'execute' method. Will truncate result if exceeded.
    uint256 private constant MAX_RETURN_SIZE = 1024;

    //copied from Forwarder (can't reference string constants even from another library)
    string public constant GENERIC_PARAMS = "address from,address to,uint256 value,uint256 gas,uint256 nonce,bytes data,uint256 validUntilTime";

    bytes public constant RELAYDATA_TYPE = "RelayData(uint256 maxFeePerGas,uint256 maxPriorityFeePerGas,uint256 transactionCalldataGasUsed,address relayWorker,address paymaster,address forwarder,bytes paymasterData,uint256 clientId)";

    string public constant RELAY_REQUEST_NAME = "RelayRequest";
    string public constant RELAY_REQUEST_SUFFIX = string(abi.encodePacked("RelayData relayData)", RELAYDATA_TYPE));

    bytes public constant RELAY_REQUEST_TYPE = abi.encodePacked(
        RELAY_REQUEST_NAME,"(",GENERIC_PARAMS,",", RELAY_REQUEST_SUFFIX);

    bytes32 public constant RELAYDATA_TYPEHASH = keccak256(RELAYDATA_TYPE);
    bytes32 public constant RELAY_REQUEST_TYPEHASH = keccak256(RELAY_REQUEST_TYPE);

    struct EIP712Domain {
        string name;
        string version;
        uint256 chainId;
        address verifyingContract;
    }

    bytes32 public constant EIP712DOMAIN_TYPEHASH = keccak256(
        "EIP712Domain(string name,string version,uint256 chainId,address verifyingContract)"
    );

    function splitRequest(
        GsnTypes.RelayRequest calldata req
    )
    internal
    pure
    returns (
        bytes memory suffixData
    ) {
        suffixData = abi.encode(
            hashRelayData(req.relayData));
    }

    //verify that the recipient trusts the given forwarder
    // MUST be called by paymaster
    function verifyForwarderTrusted(GsnTypes.RelayRequest calldata relayRequest) internal view {
        (bool success, bytes memory ret) = relayRequest.request.to.staticcall(
            abi.encodeWithSelector(
                IERC2771Recipient.isTrustedForwarder.selector, relayRequest.relayData.forwarder
            )
        );
        require(success, "isTrustedForwarder: reverted");
        require(ret.length == 32, "isTrustedForwarder: bad response");
        require(abi.decode(ret, (bool)), "invalid forwarder for recipient");
    }

    function verifySignature(GsnTypes.RelayRequest calldata relayRequest, bytes calldata signature) internal view {
        (bytes memory suffixData) = splitRequest(relayRequest);
        bytes32 _domainSeparator = domainSeparator(relayRequest.relayData.forwarder);
        IForwarder forwarder = IForwarder(payable(relayRequest.relayData.forwarder));
        forwarder.verify(relayRequest.request, _domainSeparator, RELAY_REQUEST_TYPEHASH, suffixData, signature);
    }

    function verify(GsnTypes.RelayRequest calldata relayRequest, bytes calldata signature) internal view {
        verifyForwarderTrusted(relayRequest);
        verifySignature(relayRequest, signature);
    }

    function execute(GsnTypes.RelayRequest calldata relayRequest, bytes calldata signature) internal returns (bool forwarderSuccess, bool callSuccess, bytes memory ret) {
        (bytes memory suffixData) = splitRequest(relayRequest);
        bytes32 _domainSeparator = domainSeparator(relayRequest.relayData.forwarder);
        /* solhint-disable-next-line avoid-low-level-calls */
        (forwarderSuccess, ret) = relayRequest.relayData.forwarder.call(
            abi.encodeWithSelector(IForwarder.execute.selector,
            relayRequest.request, _domainSeparator, RELAY_REQUEST_TYPEHASH, suffixData, signature
        ));
        if ( forwarderSuccess ) {

          //decode return value of execute:
          (callSuccess, ret) = abi.decode(ret, (bool, bytes));
        }
        truncateInPlace(ret);
    }

    //truncate the given parameter (in-place) if its length is above the given maximum length
    // do nothing otherwise.
    //NOTE: solidity warns unless the method is marked "pure", but it DOES modify its parameter.
    function truncateInPlace(bytes memory data) internal pure {
        MinLibBytes.truncateInPlace(data, MAX_RETURN_SIZE);
    }

    function domainSeparator(address forwarder) internal view returns (bytes32) {
        return hashDomain(EIP712Domain({
            name : "GSN Relayed Transaction",
            version : "3",
            chainId : getChainID(),
            verifyingContract : forwarder
            }));
    }

    function getChainID() internal view returns (uint256 id) {
        /* solhint-disable no-inline-assembly */
        assembly {
            id := chainid()
        }
    }

    function hashDomain(EIP712Domain memory req) internal pure returns (bytes32) {
        return keccak256(abi.encode(
                EIP712DOMAIN_TYPEHASH,
                keccak256(bytes(req.name)),
                keccak256(bytes(req.version)),
                req.chainId,
                req.verifyingContract));
    }

    function hashRelayData(GsnTypes.RelayData calldata req) internal pure returns (bytes32) {
        return keccak256(abi.encode(
                RELAYDATA_TYPEHASH,
                req.maxFeePerGas,
                req.maxPriorityFeePerGas,
                req.transactionCalldataGasUsed,
                req.relayWorker,
                req.paymaster,
                req.forwarder,
                keccak256(req.paymasterData),
                req.clientId
            ));
    }
}

File 18 of 21 : GsnTypes.sol
pragma solidity ^0.8.0;

// SPDX-License-Identifier: GPL-3.0-only

import "../forwarder/IForwarder.sol";

interface GsnTypes {
    /// @notice maxFeePerGas, maxPriorityFeePerGas, pctRelayFee and baseRelayFee must be validated inside of the paymaster's preRelayedCall in order not to overpay
    struct RelayData {
        uint256 maxFeePerGas;
        uint256 maxPriorityFeePerGas;
        uint256 transactionCalldataGasUsed;
        address relayWorker;
        address paymaster;
        address forwarder;
        bytes paymasterData;
        uint256 clientId;
    }

    //note: must start with the ForwardRequest to be an extension of the generic forwarder
    struct RelayRequest {
        IForwarder.ForwardRequest request;
        RelayData relayData;
    }
}

File 19 of 21 : GsnUtils.sol
pragma solidity ^0.8.0;

/* solhint-disable no-inline-assembly */
// SPDX-License-Identifier: GPL-3.0-only

import "../utils/MinLibBytes.sol";
import "./GsnTypes.sol";

/**
 * @title The GSN Solidity Utils Library
 * @notice Some library functions used throughout the GSN Solidity codebase.
 */
library GsnUtils {

    bytes32 constant private RELAY_REQUEST_ID_MASK = 0x00000000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF;

    /**
     * @notice Calculate an identifier for the meta-transaction in a format similar to a transaction hash.
     * Note that uniqueness relies on signature and may not be enforced if meta-transactions are verified
     * with a different algorithm, e.g. when batching.
     * @param relayRequest The `RelayRequest` for which an ID is being calculated.
     * @param signature The signature for the `RelayRequest`. It is not validated here and may even remain empty.
     */
    function getRelayRequestID(GsnTypes.RelayRequest calldata relayRequest, bytes calldata signature)
    internal
    pure
    returns (bytes32) {
        return keccak256(abi.encode(relayRequest.request.from, relayRequest.request.nonce, signature)) & RELAY_REQUEST_ID_MASK;
    }

    /**
     * @notice Extract the method identifier signature from the encoded function call.
     */
    function getMethodSig(bytes memory msgData) internal pure returns (bytes4) {
        return MinLibBytes.readBytes4(msgData, 0);
    }

    /**
     * @notice Extract a parameter from encoded-function block.
     * see: https://solidity.readthedocs.io/en/develop/abi-spec.html#formal-specification-of-the-encoding
     * The return value should be casted to the right type (`uintXXX`/`bytesXXX`/`address`/`bool`/`enum`).
     * @param msgData Byte array containing a uint256 value.
     * @param index Index in byte array of uint256 value.
     * @return result uint256 value from byte array.
     */
    function getParam(bytes memory msgData, uint256 index) internal pure returns (uint256 result) {
        return MinLibBytes.readUint256(msgData, 4 + index * 32);
    }

    /// @notice Re-throw revert with the same revert data.
    function revertWithData(bytes memory data) internal pure {
        assembly {
            revert(add(data,32), mload(data))
        }
    }

}

File 20 of 21 : MinLibBytes.sol
pragma solidity ^0.8.0;

// SPDX-License-Identifier: MIT
// minimal bytes manipulation required by GSN
// a minimal subset from 0x/LibBytes
/* solhint-disable no-inline-assembly */

library MinLibBytes {

    //truncate the given parameter (in-place) if its length is above the given maximum length
    // do nothing otherwise.
    //NOTE: solidity warns unless the method is marked "pure", but it DOES modify its parameter.
    function truncateInPlace(bytes memory data, uint256 maxlen) internal pure {
        if (data.length > maxlen) {
            assembly { mstore(data, maxlen) }
        }
    }

    /// @dev Reads an address from a position in a byte array.
    /// @param b Byte array containing an address.
    /// @param index Index in byte array of address.
    /// @return result address from byte array.
    function readAddress(
        bytes memory b,
        uint256 index
    )
        internal
        pure
        returns (address result)
    {
        require (b.length >= index + 20, "readAddress: data too short");

        // Add offset to index:
        // 1. Arrays are prefixed by 32-byte length parameter (add 32 to index)
        // 2. Account for size difference between address length and 32-byte storage word (subtract 12 from index)
        index += 20;

        // Read address from array memory
        assembly {
            // 1. Add index to address of bytes array
            // 2. Load 32-byte word from memory
            // 3. Apply 20-byte mask to obtain address
            result := and(mload(add(b, index)), 0xffffffffffffffffffffffffffffffffffffffff)
        }
        return result;
    }

    function readBytes32(
        bytes memory b,
        uint256 index
    )
        internal
        pure
        returns (bytes32 result)
    {
        require(b.length >= index + 32, "readBytes32: data too short" );

        // Read the bytes32 from array memory
        assembly {
            result := mload(add(b, add(index,32)))
        }
        return result;
    }

    /// @dev Reads a uint256 value from a position in a byte array.
    /// @param b Byte array containing a uint256 value.
    /// @param index Index in byte array of uint256 value.
    /// @return result uint256 value from byte array.
    function readUint256(
        bytes memory b,
        uint256 index
    )
        internal
        pure
        returns (uint256 result)
    {
        result = uint256(readBytes32(b, index));
        return result;
    }

    function readBytes4(
        bytes memory b,
        uint256 index
    )
        internal
        pure
        returns (bytes4 result)
    {
        require(b.length >= index + 4, "readBytes4: data too short");

        // Read the bytes4 from array memory
        assembly {
            result := mload(add(b, add(index,32)))
            // Solidity does not require us to clean the trailing bytes.
            // We do it anyway
            result := and(result, 0xFFFFFFFF00000000000000000000000000000000000000000000000000000000)
        }
        return result;
    }
}

File 21 of 21 : RelayHubValidator.sol
pragma solidity ^0.8.0;
pragma abicoder v2;

// SPDX-License-Identifier: GPL-3.0-only

import "../utils/GsnTypes.sol";

/**
 * @title The RelayHub Validator Library
 * @notice Validates the `msg.data` received by the `RelayHub` does not contain unnecessary bytes.
 * Including these extra bytes would allow the Relay Server to inflate transaction costs and overcharge the client.
 */
library RelayHubValidator {

    /// @notice Validate that encoded `relayCall` is properly packed without any extra bytes
    function verifyTransactionPacking(
        GsnTypes.RelayRequest calldata relayRequest,
        bytes calldata signature,
        bytes calldata approvalData
    ) internal pure {
        // abicoder v2: https://docs.soliditylang.org/en/latest/abi-spec.html
        // each static param/member is 1 word
        // struct (with dynamic members) has offset to struct which is 1 word
        // dynamic member is 1 word offset to actual value, which is 1-word length and ceil(length/32) words for data
        // relayCall has 5 method params,
        // relayRequest: 2 members
        // relayData 8 members
        // ForwardRequest: 7 members
        // total 21 32-byte words if all dynamic params are zero-length.
        uint256 expectedMsgDataLen = 4 + 21 * 32 +
            dynamicParamSize(signature) +
            dynamicParamSize(approvalData) +
            dynamicParamSize(relayRequest.request.data) +
            dynamicParamSize(relayRequest.relayData.paymasterData);
        // zero-length signature is allowed in a batch relay transaction
        require(signature.length <= 65, "invalid signature length");
        require(expectedMsgDataLen == msg.data.length, "extra msg.data bytes" );
    }

    // helper method for verifyTransactionPacking:
    // size (in bytes) of the given "bytes" parameter. size include the length (32-byte word),
    // and actual data size, rounded up to full 32-byte words
    function dynamicParamSize(bytes calldata buf) internal pure returns (uint256) {
        return 32 + ((buf.length + 31) & (type(uint256).max - 31));
    }
}

Settings
{
  "evmVersion": "london",
  "libraries": {},
  "metadata": {
    "bytecodeHash": "ipfs",
    "useLiteralContent": true
  },
  "optimizer": {
    "enabled": true,
    "runs": 200
  },
  "remappings": [],
  "outputSelection": {
    "*": {
      "*": [
        "evm.bytecode",
        "evm.deployedBytecode",
        "devdoc",
        "userdoc",
        "metadata",
        "abi"
      ]
    }
  }
}

Contract ABI

[{"inputs":[{"internalType":"contract IStakeManager","name":"_stakeManager","type":"address"},{"internalType":"address","name":"_penalizer","type":"address"},{"internalType":"address","name":"_batchGateway","type":"address"},{"internalType":"address","name":"_relayRegistrar","type":"address"},{"components":[{"internalType":"uint256","name":"maxWorkerCount","type":"uint256"},{"internalType":"uint256","name":"gasReserve","type":"uint256"},{"internalType":"uint256","name":"postOverhead","type":"uint256"},{"internalType":"uint256","name":"gasOverhead","type":"uint256"},{"internalType":"uint256","name":"minimumUnstakeDelay","type":"uint256"},{"internalType":"address","name":"devAddress","type":"address"},{"internalType":"uint8","name":"devFee","type":"uint8"},{"internalType":"uint80","name":"baseRelayFee","type":"uint80"},{"internalType":"uint16","name":"pctRelayFee","type":"uint16"}],"internalType":"struct IRelayHub.RelayHubConfig","name":"_config","type":"tuple"}],"stateMutability":"nonpayable","type":"constructor"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"relayManager","type":"address"},{"indexed":false,"internalType":"uint256","name":"balance","type":"uint256"}],"name":"AbandonedRelayManagerBalanceEscheated","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"paymaster","type":"address"},{"indexed":true,"internalType":"address","name":"from","type":"address"},{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"}],"name":"Deposited","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint256","name":"deprecationTime","type":"uint256"}],"name":"HubDeprecated","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"previousOwner","type":"address"},{"indexed":true,"internalType":"address","name":"newOwner","type":"address"}],"name":"OwnershipTransferred","type":"event"},{"anonymous":false,"inputs":[{"components":[{"internalType":"uint256","name":"maxWorkerCount","type":"uint256"},{"internalType":"uint256","name":"gasReserve","type":"uint256"},{"internalType":"uint256","name":"postOverhead","type":"uint256"},{"internalType":"uint256","name":"gasOverhead","type":"uint256"},{"internalType":"uint256","name":"minimumUnstakeDelay","type":"uint256"},{"internalType":"address","name":"devAddress","type":"address"},{"internalType":"uint8","name":"devFee","type":"uint8"},{"internalType":"uint80","name":"baseRelayFee","type":"uint80"},{"internalType":"uint16","name":"pctRelayFee","type":"uint16"}],"indexed":false,"internalType":"struct IRelayHub.RelayHubConfig","name":"config","type":"tuple"}],"name":"RelayHubConfigured","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"relayManager","type":"address"},{"indexed":false,"internalType":"address[]","name":"newRelayWorkers","type":"address[]"},{"indexed":false,"internalType":"uint256","name":"workersCount","type":"uint256"}],"name":"RelayWorkersAdded","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"token","type":"address"},{"indexed":false,"internalType":"uint256","name":"minimumStake","type":"uint256"}],"name":"StakingTokenDataChanged","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"relayManager","type":"address"},{"indexed":true,"internalType":"address","name":"paymaster","type":"address"},{"indexed":true,"internalType":"bytes32","name":"relayRequestID","type":"bytes32"},{"indexed":false,"internalType":"address","name":"from","type":"address"},{"indexed":false,"internalType":"address","name":"to","type":"address"},{"indexed":false,"internalType":"address","name":"relayWorker","type":"address"},{"indexed":false,"internalType":"bytes4","name":"selector","type":"bytes4"},{"indexed":false,"internalType":"uint256","name":"innerGasUsed","type":"uint256"},{"indexed":false,"internalType":"bytes","name":"reason","type":"bytes"}],"name":"TransactionRejectedByPaymaster","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"relayManager","type":"address"},{"indexed":true,"internalType":"address","name":"relayWorker","type":"address"},{"indexed":true,"internalType":"bytes32","name":"relayRequestID","type":"bytes32"},{"indexed":false,"internalType":"address","name":"from","type":"address"},{"indexed":false,"internalType":"address","name":"to","type":"address"},{"indexed":false,"internalType":"address","name":"paymaster","type":"address"},{"indexed":false,"internalType":"bytes4","name":"selector","type":"bytes4"},{"indexed":false,"internalType":"enum IRelayHub.RelayCallStatus","name":"status","type":"uint8"},{"indexed":false,"internalType":"uint256","name":"charge","type":"uint256"}],"name":"TransactionRelayed","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"enum IRelayHub.RelayCallStatus","name":"status","type":"uint8"},{"indexed":false,"internalType":"bytes","name":"returnValue","type":"bytes"}],"name":"TransactionResult","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"account","type":"address"},{"indexed":true,"internalType":"address","name":"dest","type":"address"},{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"}],"name":"Withdrawn","type":"event"},{"inputs":[{"internalType":"address[]","name":"newRelayWorkers","type":"address[]"}],"name":"addRelayWorkers","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"aggregateGasleft","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"target","type":"address"}],"name":"balanceOf","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"gasUsed","type":"uint256"},{"components":[{"internalType":"uint256","name":"maxFeePerGas","type":"uint256"},{"internalType":"uint256","name":"maxPriorityFeePerGas","type":"uint256"},{"internalType":"uint256","name":"transactionCalldataGasUsed","type":"uint256"},{"internalType":"address","name":"relayWorker","type":"address"},{"internalType":"address","name":"paymaster","type":"address"},{"internalType":"address","name":"forwarder","type":"address"},{"internalType":"bytes","name":"paymasterData","type":"bytes"},{"internalType":"uint256","name":"clientId","type":"uint256"}],"internalType":"struct GsnTypes.RelayData","name":"relayData","type":"tuple"}],"name":"calculateCharge","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"charge","type":"uint256"}],"name":"calculateDevCharge","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"target","type":"address"}],"name":"depositFor","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_deprecationTime","type":"uint256"}],"name":"deprecateHub","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"relayManager","type":"address"}],"name":"escheatAbandonedRelayBalance","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"getBatchGateway","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getConfiguration","outputs":[{"components":[{"internalType":"uint256","name":"maxWorkerCount","type":"uint256"},{"internalType":"uint256","name":"gasReserve","type":"uint256"},{"internalType":"uint256","name":"postOverhead","type":"uint256"},{"internalType":"uint256","name":"gasOverhead","type":"uint256"},{"internalType":"uint256","name":"minimumUnstakeDelay","type":"uint256"},{"internalType":"address","name":"devAddress","type":"address"},{"internalType":"uint8","name":"devFee","type":"uint8"},{"internalType":"uint80","name":"baseRelayFee","type":"uint80"},{"internalType":"uint16","name":"pctRelayFee","type":"uint16"}],"internalType":"struct IRelayHub.RelayHubConfig","name":"","type":"tuple"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getCreationBlock","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getDeprecationTime","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"contract IERC20","name":"token","type":"address"}],"name":"getMinimumStakePerToken","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getPenalizer","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getRelayRegistrar","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getStakeManager","outputs":[{"internalType":"contract IStakeManager","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"manager","type":"address"}],"name":"getWorkerCount","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"worker","type":"address"}],"name":"getWorkerManager","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"components":[{"components":[{"internalType":"address","name":"from","type":"address"},{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256","name":"value","type":"uint256"},{"internalType":"uint256","name":"gas","type":"uint256"},{"internalType":"uint256","name":"nonce","type":"uint256"},{"internalType":"bytes","name":"data","type":"bytes"},{"internalType":"uint256","name":"validUntilTime","type":"uint256"}],"internalType":"struct IForwarder.ForwardRequest","name":"request","type":"tuple"},{"components":[{"internalType":"uint256","name":"maxFeePerGas","type":"uint256"},{"internalType":"uint256","name":"maxPriorityFeePerGas","type":"uint256"},{"internalType":"uint256","name":"transactionCalldataGasUsed","type":"uint256"},{"internalType":"address","name":"relayWorker","type":"address"},{"internalType":"address","name":"paymaster","type":"address"},{"internalType":"address","name":"forwarder","type":"address"},{"internalType":"bytes","name":"paymasterData","type":"bytes"},{"internalType":"uint256","name":"clientId","type":"uint256"}],"internalType":"struct GsnTypes.RelayData","name":"relayData","type":"tuple"}],"internalType":"struct GsnTypes.RelayRequest","name":"relayRequest","type":"tuple"},{"internalType":"bytes","name":"signature","type":"bytes"},{"internalType":"bytes","name":"approvalData","type":"bytes"},{"components":[{"internalType":"uint256","name":"acceptanceBudget","type":"uint256"},{"internalType":"uint256","name":"preRelayedCallGasLimit","type":"uint256"},{"internalType":"uint256","name":"postRelayedCallGasLimit","type":"uint256"},{"internalType":"uint256","name":"calldataSizeLimit","type":"uint256"}],"internalType":"struct IPaymaster.GasAndDataLimits","name":"gasAndDataLimits","type":"tuple"},{"internalType":"uint256","name":"totalInitialGas","type":"uint256"},{"internalType":"uint256","name":"maxPossibleGas","type":"uint256"}],"name":"innerRelayCall","outputs":[{"internalType":"enum IRelayHub.RelayCallStatus","name":"","type":"uint8"},{"internalType":"bytes","name":"","type":"bytes"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"isDeprecated","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"relayManager","type":"address"}],"name":"isRelayEscheatable","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"relayManager","type":"address"}],"name":"onRelayServerRegistered","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"owner","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"relayWorker","type":"address"},{"internalType":"address payable","name":"beneficiary","type":"address"}],"name":"penalize","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"maxAcceptanceBudget","type":"uint256"},{"components":[{"components":[{"internalType":"address","name":"from","type":"address"},{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256","name":"value","type":"uint256"},{"internalType":"uint256","name":"gas","type":"uint256"},{"internalType":"uint256","name":"nonce","type":"uint256"},{"internalType":"bytes","name":"data","type":"bytes"},{"internalType":"uint256","name":"validUntilTime","type":"uint256"}],"internalType":"struct IForwarder.ForwardRequest","name":"request","type":"tuple"},{"components":[{"internalType":"uint256","name":"maxFeePerGas","type":"uint256"},{"internalType":"uint256","name":"maxPriorityFeePerGas","type":"uint256"},{"internalType":"uint256","name":"transactionCalldataGasUsed","type":"uint256"},{"internalType":"address","name":"relayWorker","type":"address"},{"internalType":"address","name":"paymaster","type":"address"},{"internalType":"address","name":"forwarder","type":"address"},{"internalType":"bytes","name":"paymasterData","type":"bytes"},{"internalType":"uint256","name":"clientId","type":"uint256"}],"internalType":"struct GsnTypes.RelayData","name":"relayData","type":"tuple"}],"internalType":"struct GsnTypes.RelayRequest","name":"relayRequest","type":"tuple"},{"internalType":"bytes","name":"signature","type":"bytes"},{"internalType":"bytes","name":"approvalData","type":"bytes"}],"name":"relayCall","outputs":[{"internalType":"bool","name":"paymasterAccepted","type":"bool"},{"internalType":"uint256","name":"charge","type":"uint256"},{"internalType":"enum IRelayHub.RelayCallStatus","name":"status","type":"uint8"},{"internalType":"bytes","name":"returnValue","type":"bytes"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"renounceOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"components":[{"internalType":"uint256","name":"maxWorkerCount","type":"uint256"},{"internalType":"uint256","name":"gasReserve","type":"uint256"},{"internalType":"uint256","name":"postOverhead","type":"uint256"},{"internalType":"uint256","name":"gasOverhead","type":"uint256"},{"internalType":"uint256","name":"minimumUnstakeDelay","type":"uint256"},{"internalType":"address","name":"devAddress","type":"address"},{"internalType":"uint8","name":"devFee","type":"uint8"},{"internalType":"uint80","name":"baseRelayFee","type":"uint80"},{"internalType":"uint16","name":"pctRelayFee","type":"uint16"}],"internalType":"struct IRelayHub.RelayHubConfig","name":"_config","type":"tuple"}],"name":"setConfiguration","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"contract IERC20[]","name":"token","type":"address[]"},{"internalType":"uint256[]","name":"minimumStake","type":"uint256[]"}],"name":"setMinimumStakes","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes4","name":"interfaceId","type":"bytes4"}],"name":"supportsInterface","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"newOwner","type":"address"}],"name":"transferOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"relayManager","type":"address"}],"name":"verifyRelayManagerStaked","outputs":[],"stateMutability":"view","type":"function"},{"inputs":[],"name":"versionHub","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"pure","type":"function"},{"inputs":[{"internalType":"address payable","name":"dest","type":"address"},{"internalType":"uint256","name":"amount","type":"uint256"}],"name":"withdraw","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address payable[]","name":"dest","type":"address[]"},{"internalType":"uint256[]","name":"amount","type":"uint256[]"}],"name":"withdrawMultiple","outputs":[],"stateMutability":"nonpayable","type":"function"}]

610120604052600019600c553480156200001857600080fd5b5060405162004cc038038062004cc08339810160408190526200003b9162000325565b62000046336200008b565b43610100526001600160601b0319606086811b821660805285811b821660a05284811b821660c05283901b1660e0526200008081620000db565b505050505062000487565b600080546001600160a01b038381166001600160a01b0319831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b6000546001600160a01b031633146200013b5760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657260448201526064015b60405180910390fd5b60648160c0015160ff1610620001875760405162461bcd60e51b815260206004820152601060248201526f0c8caec40cccaca40e8dede40d0d2ced60831b604482015260640162000132565b8051600190815560208201516002556040808301516003556060830151600455608083015160055560a08301516006805460c086015160e08701516001600160501b0316600160a81b02600160a81b600160f81b031960ff909216600160a01b026001600160a81b03199093166001600160a01b039095169490941791909117169190911790556101008301516007805461ffff90921661ffff19909216919091179055517f4812ada68f7c2cdc9f4a4a09e157ea6b924e0ef40a4fa7aa074fa8f70b1e724791620002cb91815481526001820154602082015260028201546040820152600382015460608201526004820154608082015260058201546001600160a01b03811660a08084019190915260ff9082901c1660c083015260a81c6001600160501b031660e082015260069091015461ffff166101008201526101200190565b60405180910390a150565b8051620002e3816200046e565b919050565b805161ffff81168114620002e357600080fd5b80516001600160501b0381168114620002e357600080fd5b805160ff81168114620002e357600080fd5b60008060008060008587036101a08112156200034057600080fd5b86516200034d816200046e565b602088015190965062000360816200046e565b604088015190955062000373816200046e565b606088015190945062000386816200046e565b9250610120607f1982018113156200039d57600080fd5b620003a762000436565b91506080880151825260a0880151602083015260c0880151604083015260e08801516060830152610100808901516080840152620003e7828a01620002d6565b60a0840152620003fb6101408a0162000313565b60c08401526200040f6101608a01620002fb565b60e0840152620004236101808a01620002e8565b9083015250949793965091945092919050565b60405161012081016001600160401b03811182821017156200046857634e487b7160e01b600052604160045260246000fd5b60405290565b6001600160a01b03811681146200048457600080fd5b50565b60805160601c60a05160601c60c05160601c60e05160601c610100516147a96200051760003960006102420152600081816102eb015261081a0152600081816106f30152611781015260008181610423015261260e0152600081816105c80152818161078b0152818161090c015281816121e901528181612384015281816126ec01526127e701526147a96000f3fe6080604052600436106101f95760003560e01c80638e53548b1161010d578063ca64f9e7116100a0578063e6e22e121161006f578063e6e22e1214610664578063ebcd31ac14610684578063f2fde38b146106a4578063f3fef3a3146106c4578063f7908a74146106e457600080fd5b8063ca64f9e7146105b9578063d26152f9146105ec578063d904c7321461060c578063ddf737891461062e57600080fd5b8063b1a62e72116100dc578063b1a62e7214610518578063be7c76ad14610548578063c2da078614610581578063c7178230146105a157600080fd5b80638e53548b146104a55780639bcde3f3146104c5578063aa67c919146104e5578063af595dfc146104f857600080fd5b80636bd50cef11610190578063746d300c1161015f578063746d300c146103e657806375dc7b4e146104145780638a09fb56146104475780638ac3b845146104675780638da5cb5b1461048757600080fd5b80636bd50cef1461035957806370a082311461037b578063715018a6146103b157806372c1ab0c146103c657600080fd5b806345bdade7116101cc57806345bdade7146102a55780634f7de031146102ba57806351d85156146102dc57806359c4afc01461032357600080fd5b806301ffc9a7146101fe57806320ffd56d1461023357806339622167146102705780633c16e59a14610290575b600080fd5b34801561020a57600080fd5b5061021e610219366004613948565b610717565b60405190151581526020015b60405180910390f35b34801561023f57600080fd5b507f00000000000000000000000000000000000000000000000000000000000000005b60405190815260200161022a565b34801561027c57600080fd5b5061021e61028b366004613692565b610769565b34801561029c57600080fd5b50600c54610262565b3480156102b157600080fd5b50610262610807565b3480156102c657600080fd5b506102da6102d5366004613692565b61080f565b005b3480156102e857600080fd5b507f00000000000000000000000000000000000000000000000000000000000000005b6040516001600160a01b03909116815260200161022a565b34801561032f57600080fd5b5061026261033e366004613692565b6001600160a01b03166000908152600a602052604090205490565b34801561036557600080fd5b5061036e61096b565b60405161022a9190614244565b34801561038757600080fd5b50610262610396366004613692565b6001600160a01b03166000908152600b602052604090205490565b3480156103bd57600080fd5b506102da610a4c565b3480156103d257600080fd5b506102da6103e1366004613788565b610a82565b3480156103f257600080fd5b50610406610401366004613af5565b610cab565b60405161022a929190614189565b34801561042057600080fd5b507f000000000000000000000000000000000000000000000000000000000000000061030b565b34801561045357600080fd5b506102da610462366004613850565b6110e8565b34801561047357600080fd5b50610262610482366004613c44565b611261565b34801561049357600080fd5b506000546001600160a01b031661030b565b3480156104b157600080fd5b506102626104c0366004613c5d565b611296565b3480156104d157600080fd5b506102da6104e0366004613a62565b61132c565b6102da6104f3366004613692565b6114f4565b34801561050457600080fd5b506102da610513366004613c44565b6115d5565b34801561052457600080fd5b50610538610533366004613ca0565b61167a565b60405161022a949392919061411d565b34801561055457600080fd5b5061030b610563366004613692565b6001600160a01b039081166000908152600960205260409020541690565b34801561058d57600080fd5b506102da61059c366004613714565b611fbd565b3480156105ad57600080fd5b50600c5442101561021e565b3480156105c557600080fd5b507f000000000000000000000000000000000000000000000000000000000000000061030b565b3480156105f857600080fd5b506102da610607366004613692565b6121a0565b34801561061857600080fd5b50610621612340565b60405161022a91906141a9565b34801561063a57600080fd5b50610262610649366004613692565b6001600160a01b031660009081526008602052604090205490565b34801561067057600080fd5b506102da61067f366004613692565b612360565b34801561069057600080fd5b506102da61069f3660046136db565b612603565b3480156106b057600080fd5b506102da6106bf366004613692565b61284b565b3480156106d057600080fd5b506102da6106df3660046136af565b6128e6565b3480156106f057600080fd5b507f000000000000000000000000000000000000000000000000000000000000000061030b565b60006001600160e01b031982166334f57c6760e01b148061074857506001600160e01b03198216630704183b60e11b145b8061076357506301ffc9a760e01b6001600160e01b03198316145b92915050565b604051633962216760e01b81526001600160a01b0382811660048301526000917f00000000000000000000000000000000000000000000000000000000000000009091169063396221679060240160206040518083038186803b1580156107cf57600080fd5b505afa1580156107e3573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061076391906138ea565b60005a905090565b336001600160a01b037f0000000000000000000000000000000000000000000000000000000000000000161461088c5760405162461bcd60e51b815260206004820152601d60248201527f63616c6c6572206973206e6f742072656c61792072656769737472617200000060448201526064015b60405180910390fd5b61089581612360565b6001600160a01b0381166000908152600a60205260409020546108ed5760405162461bcd60e51b815260206004820152601060248201526f6e6f2072656c617920776f726b65727360801b6044820152606401610883565b6040516346dcbf0b60e01b81526001600160a01b0382811660048301527f000000000000000000000000000000000000000000000000000000000000000016906346dcbf0b90602401600060405180830381600087803b15801561095057600080fd5b505af1158015610964573d6000803e3d6000fd5b5050505050565b6109d3604051806101200160405280600081526020016000815260200160008152602001600081526020016000815260200160006001600160a01b03168152602001600060ff16815260200160006001600160501b03168152602001600061ffff1681525090565b5060408051610120810182526001548152600254602082015260035491810191909152600454606082015260055460808201526006546001600160a01b03811660a0830152600160a01b810460ff1660c0830152600160a81b90046001600160501b031660e082015260075461ffff1661010082015290565b6000546001600160a01b03163314610a765760405162461bcd60e51b8152600401610883906141bc565b610a806000612989565b565b3360005b8251811015610ca5576001600160a01b0382166000908152600b60205260409020548351849083908110610abc57610abc6145f3565b6020026020010151811015610b085760405162461bcd60e51b8152602060048201526012602482015271696e73756666696369656e742066756e647360701b6044820152606401610883565b838281518110610b1a57610b1a6145f3565b602002602001015181610b2d9190614569565b6001600160a01b0384166000908152600b60205260408120919091558551869084908110610b5d57610b5d6145f3565b60200260200101516001600160a01b0316858481518110610b8057610b806145f3565b602002602001015160405160006040518083038185875af1925050503d8060008114610bc8576040519150601f19603f3d011682016040523d82523d6000602084013e610bcd565b606091505b5050905080610c115760405162461bcd60e51b815260206004820152601060248201526f2a3930b739b332b9103330b4b632b21760811b6044820152606401610883565b858381518110610c2357610c236145f3565b60200260200101516001600160a01b0316846001600160a01b03167fd1c19fbcd4551a5edfb66d43d2e337c04837afda3482b42bdf569a8fccdae5fb878681518110610c7157610c716145f3565b6020026020010151604051610c8891815260200190565b60405180910390a350508080610c9d906145ac565b915050610a86565b50505050565b60006060610d05604051806101200160405280600081526020016000815260200160008152602001600080191681526020016000151581526020016060815260200160608152602001606081526020016000151581525090565b610d0d610807565b81525a610d1a9086614569565b6020820152333014610d6e5760405162461bcd60e51b815260206004820152601a60248201527f4d7573742062652063616c6c65642062792052656c61794875620000000000006044820152606401610883565b600b6000610d7f60208e018e6143f1565b610d909060a0810190608001613692565b6001600160a01b0316815260208101919091526040908101600020548282015251622f977560e21b90610dd1908d908d908d908d908d908b90602401614346565b60408051601f19818403018152919052602080820180516001600160e01b03166001600160e01b03199094169390931790925260e0830152600090606090610e1b908e018e6143f1565b610e2c9060a0810190608001613692565b6001600160a01b031688602001358460e00151604051610e4c9190613f43565b60006040518083038160008787f1925050503d8060008114610e8a576040519150601f19603f3d011682016040523d82523d6000602084013e610e8f565b606091505b50909250905081610eae57610ea3816129d9565b610eae6002826129e5565b80806020019051810190610ec29190613972565b151561010085015260c08401525060009050610edf8c8c8c612a1e565b60a085015215156080840152905080610f0157610f0160038360a001516129e5565b8161010001518015610f1557508160800151155b15610f2957610f2960048360a001516129e5565b506376fa01c360e01b8160c001518260800151610f44610807565b8451610f509190614569565b8460200151610f5f9190614510565b8e8060200190610f6f91906143f1565b604051602401610f82949392919061414b565b60408051601f19818403018152919052602080820180516001600160e01b03166001600160e01b03199094169390931790925260e08301526000908190610fcb908e018e6143f1565b610fdc9060a0810190608001613692565b6001600160a01b031688604001358460e00151604051610ffc9190613f43565b60006040518083038160008787f1925050503d806000811461103a576040519150601f19603f3d011682016040523d82523d6000602084013e61103f565b606091505b509150915081611054576110546005826129e5565b50506040810151600b600061106c60208f018f6143f1565b61107d9060a0810190608001613692565b6001600160a01b03166001600160a01b031681526020019081526020016000205410156110be576110be6006604051806020016040528060008152506129e5565b80608001516110ce5760016110d1565b60005b8160a0015192509250509850989650505050505050565b6000546001600160a01b031633146111125760405162461bcd60e51b8152600401610883906141bc565b80518251146111635760405162461bcd60e51b815260206004820152601e60248201527f7365744d696e696d756d5374616b65733a2077726f6e67206c656e67746800006044820152606401610883565b60005b825181101561125c57818181518110611181576111816145f3565b60200260200101516008600085848151811061119f5761119f6145f3565b60200260200101516001600160a01b03166001600160a01b03168152602001908152602001600020819055507ffb7510fe755f485459ee8ed619d4a0addc092c230ff47e760a62aeba78ebb9e38382815181106111fe576111fe6145f3565b6020026020010151838381518110611218576112186145f3565b60200260200101516040516112429291906001600160a01b03929092168252602082015260400190565b60405180910390a180611254816145ac565b915050611166565b505050565b600654600090600160a01b900460ff1661127d57506000919050565b600654606490600160a01b900460ff1683020492915050565b6000808235602084013514156112ae575060006112b1565b50485b60006112cd84356112c83a81602089013587614510565b612c02565b6007549091506064906112e49061ffff16826144ea565b61ffff166112f2838861454a565b6112fc919061454a565b6113069190614528565b6006546113239190600160a81b90046001600160501b0316614510565b95945050505050565b6000546001600160a01b031633146113565760405162461bcd60e51b8152600401610883906141bc565b60648160c0015160ff16106113a05760405162461bcd60e51b815260206004820152601060248201526f0c8caec40cccaca40e8dede40d0d2ced60831b6044820152606401610883565b8051600190815560208201516002556040808301516003556060830151600455608083015160055560a08301516006805460c086015160e08701516001600160501b0316600160a81b0269ffffffffffffffffffff60a81b1960ff909216600160a01b026001600160a81b03199093166001600160a01b039095169490941791909117169190911790556101008301516007805461ffff90921661ffff19909216919091179055517f4812ada68f7c2cdc9f4a4a09e157ea6b924e0ef40a4fa7aa074fa8f70b1e7247916114e991815481526001820154602082015260028201546040820152600382015460608201526004820154608082015260058201546001600160a01b03811660a08084019190915260ff9082901c1660c08301526001600160501b0360a89190911c1660e082015260069091015461ffff166101008201526101200190565b60405180910390a150565b61150e6001600160a01b0382166370d596f560e11b612c1a565b61155a5760405162461bcd60e51b815260206004820181905260248201527f746172676574206973206e6f7420612076616c696420495061796d61737465726044820152606401610883565b6001600160a01b0381166000908152600b60205260409020543490611580908290614510565b6001600160a01b0383166000818152600b6020908152604091829020939093555183815233927f8752a472e571a816aea92eec8dae9baf628e840f4929fbcc2d155e6233ff68a7910160405180910390a35050565b6000546001600160a01b031633146115ff5760405162461bcd60e51b8152600401610883906141bc565b600c5442106116455760405162461bcd60e51b8152602060048201526012602482015271105b1c9958591e4819195c1c9958d85d195960721b6044820152606401610883565b600c8190556040518181527f1c0aa0c666483fbf0cf795d9d646ea3552d1e3008162ba9ab1d6d6dfd8c6ec6b906020016114e9565b6000806000606061168961343d565b611691610807565b60408201526116a18a8a8a612c36565b6101e0820152600c5442106116e95760405162461bcd60e51b815260206004820152600e60248201526d1a1d588819195c1c9958d85d195960921b6044820152606401610883565b60046116f58b806143db565b6117039060a0810190614395565b90501015611712576000611767565b61176761171f8b806143db565b61172d9060a0810190614395565b8080601f01602080910402602001604051908101604052809392919081815260200183838082843760009201829052509250612c9b915050565b6001600160e01b0319166020820152336001600160a01b037f000000000000000000000000000000000000000000000000000000000000000016148015906117ae57503215155b156118c257876118005760405162461bcd60e51b815260206004820181905260248201527f6d697373696e67207369676e6174757265206f722062616420676174657761796044820152606401610883565b33321461184f5760405162461bcd60e51b815260206004820152601860248201527f72656c617920776f726b6572206d75737420626520454f4100000000000000006044820152606401610883565b61185c60208b018b6143f1565b61186d906080810190606001613692565b6001600160a01b0316336001600160a01b0316146118c25760405162461bcd60e51b81526020600482015260126024820152712737ba1030903934b3b43a103bb7b935b2b960711b6044820152606401610883565b321561196057600960006118d960208d018d6143f1565b6118ea906080810190606001613692565b6001600160a01b039081168252602082019290925260400160002054166101c082018190526119525760405162461bcd60e51b81526020600482015260146024820152732ab735b737bbb7103932b630bc903bb7b935b2b960611b6044820152606401610883565b611960816101c00151612360565b61196f8b8b8360400151612d0b565b61010083015260a08201526119878a8a8a8a8a612f95565b60025460405a61199890603f61454a565b6119a29190614528565b6119ac9190614569565b6101208201526119ba610807565b81610140018181525050600060016002015460016003015483610120015184604001518e80602001906119ed91906143f1565b604001356119fb9190614510565b611a059190614510565b611a0f9190614510565b611a199190614510565b9050600080306001600160a01b031684610120015163746d300c60e01b8f8f8f8f8f8b60a00151611a48610807565b611a52908d614569565b8d6101000151604051602401611a6f9897969594939291906142c6565b60408051601f198184030181529181526020820180516001600160e01b03166001600160e01b0319909416939093179092529051611aad9190613f43565b60006040518083038160008787f1925050503d8060008114611aeb576040519150601f19603f3d011682016040523d82523d6000602084013e611af0565b606091505b5081151586529092509050611b03610807565b846101400151611b139190614569565b60e08501528051611b2d90820160209081019083016139bf565b8560c00186608001829052826006811115611b4a57611b4a6145dd565b6006811115611b5b57611b5b6145dd565b9052505060808401515115611bac577fa1478a4242848419db824250a0dddc645dca0d6a9b12ab1fd79b00145a0ba98e8460c001518560800151604051611ba3929190614189565b60405180910390a15b505081519050611d125760028160c001516006811115611bce57611bce6145dd565b1480611c3d5750611be260208b018b6143f1565b60a082015151611bf6916040013590614510565b8160e0015111158015611c3d575060038160c001516006811115611c1c57611c1c6145dd565b1480611c3d575060048160c001516006811115611c3b57611c3b6145dd565b145b15611d12576101e0810151611c5560208c018c6143f1565b611c669060a0810190608001613692565b6101c08301516001600160a01b0391821691167f0c47510cb900901afca7c9e926892582a36fd3bb7f908142ccf0fb4382a2b684611ca48e806143db565b611cb2906020810190613692565b611cbc8f806143db565b611ccd906040810190602001613692565b3387602001518860e001518960800151604051611cef96959493929190614048565b60405180910390a46000808260c001518360800151945094509450945050611fb0565b600454611d1d610807565b8260400151611d2c9190614569565b611d3960208d018d6143f1565b60400135611d479190614510565b611d519190614510565b6101608201819052611d6a906104c060208d018d6143f1565b9350611d7584611261565b61018082015283600b6000611d8d60208e018e6143f1565b611d9e9060a0810190608001613692565b6001600160a01b03166001600160a01b0316815260200190815260200160002054611dc99190614569565b600b6000611dda60208e018e6143f1565b611deb9060a0810190608001613692565b6001600160a01b03168152602081019190915260400160002055610180810151611e159085614569565b6101c08201516001600160a01b03166000908152600b6020526040902054611e3d9190614510565b6101c08201516001600160a01b03166000908152600b602052604090205561018081015115611ead576101808101516006546001600160a01b03166000908152600b6020526040902054611e919190614510565b6006546001600160a01b03166000908152600b60205260409020555b6000611eb98b806143db565b611ec7906020810190613692565b90506000611ed58c806143db565b611ee6906040810190602001613692565b90506000611ef760208e018e6143f1565b611f089060a0810190608001613692565b9050836101e00151336001600160a01b0316856101c001516001600160a01b03167fd51ac07012398c2059ec53c6005fa8639657917bd2dbd72bc489a3c0eaaa7f168686868a602001518b60c001518f604051611f6a96959493929190613ffa565b60405180910390a450505032611f935760c0810151608090910151600195509092509050611fb0565b60c001516040805160208101909152600081526001955090925090505b9650965096509692505050565b336000818152600a6020526040812054611fd8908490614510565b6001600160a01b0383166000908152600a6020526040902081905560015490915081111561203b5760405162461bcd60e51b815260206004820152601060248201526f746f6f206d616e7920776f726b65727360801b6044820152606401610883565b61204482612360565b60005b83811015612154576000600981878785818110612066576120666145f3565b905060200201602081019061207b9190613692565b6001600160a01b03908116825260208201929092526040016000205416146120e55760405162461bcd60e51b815260206004820152601960248201527f7468697320776f726b6572206861732061206d616e61676572000000000000006044820152606401610883565b82600960008787858181106120fc576120fc6145f3565b90506020020160208101906121119190613692565b6001600160a01b039081168252602082019290925260400160002080546001600160a01b031916929091169190911790558061214c816145ac565b915050612047565b50816001600160a01b03167febf4a9bffb39f7c5dbf3f65540183b9381ae226ac3d0a45b4cad484713bd4a28858584604051612192939291906140c7565b60405180910390a250505050565b6000546001600160a01b031633146121ca5760405162461bcd60e51b8152600401610883906141bc565b604051633962216760e01b81526001600160a01b0382811660048301527f0000000000000000000000000000000000000000000000000000000000000000169063396221679060240160206040518083038186803b15801561222b57600080fd5b505afa15801561223f573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061226391906138ea565b6122af5760405162461bcd60e51b815260206004820181905260248201527f72656c617920736572766572206e6f74206573636865617461626c65207965746044820152606401610883565b6001600160a01b038082166000908152600b602052604080822080549083905560065490931682529020546122e5908290614510565b6006546001600160a01b039081166000908152600b60209081526040918290209390935551838152908416917f3fb672a061b9c3ab083062a9a8ff532d341e5fa42145b91f3922a711ae135659910160405180910390a25050565b606060405180606001604052806022815260200161469660229139905090565b60405163c345315360e01b81526001600160a01b03828116600483015260009182917f0000000000000000000000000000000000000000000000000000000000000000169063c3453153906024016101006040518083038186803b1580156123c757600080fd5b505afa1580156123db573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906123ff9190613bb8565b60a0820180516001600160a01b03908116600090815260086020526040902054915193955091935091166124705760405162461bcd60e51b81526020600482015260186024820152771c995b185e481b585b9859d95c881b9bdd081cdd185ad95960421b6044820152606401610883565b82518111156124c15760405162461bcd60e51b815260206004820152601960248201527f7374616b6520616d6f756e7420697320746f6f20736d616c6c000000000000006044820152606401610883565b8061250e5760405162461bcd60e51b815260206004820152601f60248201527f7374616b696e67207468697320746f6b656e20697320666f7262696464656e006044820152606401610883565b600554602084015110156125645760405162461bcd60e51b815260206004820152601a60248201527f756e7374616b652064656c617920697320746f6f20736d616c6c0000000000006044820152606401610883565b6040830151156125b65760405162461bcd60e51b815260206004820152601860248201527f7374616b6520686173206265656e2077697468647261776e00000000000000006044820152606401610883565b81610ca55760405162461bcd60e51b815260206004820181905260248201527f7468697320687562206973206e6f7420617574686f72697a656420627920534d6044820152606401610883565b336001600160a01b037f0000000000000000000000000000000000000000000000000000000000000000161461266b5760405162461bcd60e51b815260206004820152600d60248201526c2737ba103832b730b634bd32b960991b6044820152606401610883565b6001600160a01b0380831660009081526009602052604090205416806126ca5760405162461bcd60e51b81526020600482015260146024820152732ab735b737bbb7103932b630bc903bb7b935b2b960611b6044820152606401610883565b60405163c345315360e01b81526001600160a01b0382811660048301526000917f00000000000000000000000000000000000000000000000000000000000000009091169063c3453153906024016101006040518083038186803b15801561273157600080fd5b505afa158015612745573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906127699190613bb8565b5080519091506127b65760405162461bcd60e51b81526020600482015260186024820152771c995b185e481b585b9859d95c881b9bdd081cdd185ad95960421b6044820152606401610883565b805160405163026822bd60e21b81526001600160a01b038481166004830152858116602483015260448201929092527f0000000000000000000000000000000000000000000000000000000000000000909116906309a08af490606401600060405180830381600087803b15801561282d57600080fd5b505af1158015612841573d6000803e3d6000fd5b5050505050505050565b6000546001600160a01b031633146128755760405162461bcd60e51b8152600401610883906141bc565b6001600160a01b0381166128da5760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b6064820152608401610883565b6128e381612989565b50565b604080516001808252818301909252600091602080830190803683375050604080516001808252818301909252929350600092915060208083019080368337019050509050828260008151811061293f5761293f6145f3565b602002602001018181525050838160008151811061295f5761295f6145f3565b60200260200101906001600160a01b031690816001600160a01b031681525050610ca58183610a82565b600080546001600160a01b038381166001600160a01b0319831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b6128e3816104006130b4565b600082826040516020016129fa929190614189565b6040516020818303038152906040529050612a14816129d9565b8051602082018181fd5b60008060606000612a2e876130c5565b90506000612a58612a4260208a018a6143f1565b612a539060c081019060a001613692565b613104565b9050612a6760208901896143f1565b612a789060c081019060a001613692565b6001600160a01b031663e024dc7f60e01b612a938a806143db565b836040518060400160405280600c81526020016b14995b185e54995c5d595cdd60a21b8152506040518060a0016040528060618152602001614635606191396040518060e0016040528060bc81526020016146b860bc9139604051602001612afb9190613fbe565b60408051601f1981840301815290829052612b1a939291602001613f5f565b60405160208183030381529060405280519060200120868c8c604051602401612b48969594939291906141f1565b60408051601f198184030181529181526020820180516001600160e01b03166001600160e01b0319909416939093179092529051612b869190613f43565b6000604051808303816000865af19150503d8060008114612bc3576040519150601f19603f3d011682016040523d82523d6000602084013e612bc8565b606091505b5090955092508415612bee5782806020019051810190612be89190613905565b90945092505b612bf7836129d9565b505093509350939050565b6000818310612c115781612c13565b825b9392505050565b6000612c258361317d565b8015612c135750612c1383836131b0565b60006001600160e01b03612c4a85806143db565b612c58906020810190613692565b612c6286806143db565b608001358585604051602001612c7b949392919061409f565b604051602081830303815290604052805190602001201690509392505050565b6000612ca8826004614510565b83511015612cf85760405162461bcd60e51b815260206004820152601a60248201527f726561644279746573343a206461746120746f6f2073686f72740000000000006044820152606401610883565b5001602001516001600160e01b03191690565b612d366040518060800160405280600081526020016000815260200160008152602001600081525090565b6000612d4560208501856143f1565b612d569060a0810190608001613692565b6001600160a01b031663b039a88f61c3506040518263ffffffff1660e01b815260040160806040518083038187803b158015612d9157600080fd5b5086fa158015612da5573d6000803e3d6000fd5b50505050506040513d601f19601f82011682018060405250810190612dca91906139fd565b6060810151909250361115612e215760405162461bcd60e51b815260206004820152601760248201527f6d73672e64617461206578636565646564206c696d69740000000000000000006044820152606401610883565b8151851015612e725760405162461bcd60e51b815260206004820152601a60248201527f616363657074616e63652062756467657420746f6f20686967680000000000006044820152606401610883565b602082015182511015612ec75760405162461bcd60e51b815260206004820152601960248201527f616363657074616e63652062756467657420746f6f206c6f77000000000000006044820152606401610883565b82612ed560208601866143f1565b60400135612ee39190614510565b90506000612ef8826104c060208801886143f1565b9050600b6000612f0b60208801886143f1565b612f1c9060a0810190608001613692565b6001600160a01b03166001600160a01b0316815260200190815260200160002054811115612f8c5760405162461bcd60e51b815260206004820152601960248201527f5061796d61737465722062616c616e636520746f6f206c6f77000000000000006044820152606401610883565b50935093915050565b6000612fba612fa760208801886143f1565b612fb59060c0810190614395565b613299565b612fd5612fc788806143db565b612fb59060a0810190614395565b612fdf8585613299565b612fe98888613299565b612ff5906102a4614510565b612fff9190614510565b6130099190614510565b6130139190614510565b905060418411156130665760405162461bcd60e51b815260206004820152601860248201527f696e76616c6964207369676e6174757265206c656e67746800000000000000006044820152606401610883565b3681146130ac5760405162461bcd60e51b81526020600482015260146024820152736578747261206d73672e6461746120627974657360601b6044820152606401610883565b505050505050565b80825111156130c1578082525b5050565b60606130dc6130d760208401846143f1565b6132bf565b6040516020016130ee91815260200190565b6040516020818303038152906040529050919050565b6040805160c0810182526017608082019081527f47534e2052656c61796564205472616e73616374696f6e00000000000000000060a083015281528151808301835260018152603360f81b60208083019190915282015260009161076391908101468152602001846001600160a01b03168152506133bd565b6000613190826301ffc9a760e01b6131b0565b801561076357506131a9826001600160e01b03196131b0565b1592915050565b604080516001600160e01b0319831660248083019190915282518083039091018152604490910182526020810180516001600160e01b03166301ffc9a760e01b179052905160009190829081906001600160a01b0387169061753090613217908690613f43565b6000604051808303818686fa925050503d8060008114613253576040519150601f19603f3d011682016040523d82523d6000602084013e613258565b606091505b50915091506020815110156132735760009350505050610763565b81801561328f57508080602001905181019061328f91906138ea565b9695505050505050565b60006132a8601f600019614569565b6132b383601f614510565b612c1391166020614510565b60006040518060e0016040528060bc81526020016146b860bc913980516020918201209083359084013560408501356132fe6080870160608801613692565b61330e60a0880160808901613692565b61331e60c0890160a08a01613692565b61332b60c08a018a614395565b604051613339929190613f33565b6040519081900381206133a0989796959493929160e08c0135906020019889526020890197909752604088019590955260608701939093526001600160a01b039182166080870152811660a08601521660c084015260e08301526101008201526101200190565b604051602081830303815290604052805190602001209050919050565b60007f8b73c3c69bb8fe3d512ecc4cf759cc79239f7b179b0ffacaa9a75d522b39400f826000015180519060200120836020015180519060200120846040015185606001516040516020016133a09594939291909485526020850193909352604084019190915260608301526001600160a01b0316608082015260a00190565b60405180610200016040528060001515815260200160006001600160e01b03191681526020016000815260200160608152602001606081526020016134a36040518060800160405280600081526020016000815260200160008152602001600081525090565b8152602001600081526020016000815260200160008152602001600081526020016000815260200160008152602001600081526020016060815260200160006001600160a01b03168152602001600080191681525090565b80356135068161461f565b919050565b600082601f83011261351c57600080fd5b8135602061353161352c83614482565b614452565b80838252828201915082860187848660051b890101111561355157600080fd5b60005b8581101561357057813584529284019290840190600101613554565b5090979650505050505050565b8051801515811461350657600080fd5b60008083601f84011261359f57600080fd5b5081356001600160401b038111156135b657600080fd5b6020830191508360208285010111156135ce57600080fd5b9250929050565b600082601f8301126135e657600080fd5b81516001600160401b038111156135ff576135ff614609565b613612601f8201601f1916602001614452565b81815284602083860101111561362757600080fd5b613638826020830160208701614580565b949350505050565b60006040828403121561365257600080fd5b50919050565b803561ffff8116811461350657600080fd5b803560ff8116811461350657600080fd5b80356001600160501b038116811461350657600080fd5b6000602082840312156136a457600080fd5b8135612c138161461f565b600080604083850312156136c257600080fd5b82356136cd8161461f565b946020939093013593505050565b600080604083850312156136ee57600080fd5b82356136f98161461f565b915060208301356137098161461f565b809150509250929050565b6000806020838503121561372757600080fd5b82356001600160401b038082111561373e57600080fd5b818501915085601f83011261375257600080fd5b81358181111561376157600080fd5b8660208260051b850101111561377657600080fd5b60209290920196919550909350505050565b6000806040838503121561379b57600080fd5b82356001600160401b03808211156137b257600080fd5b818501915085601f8301126137c657600080fd5b813560206137d661352c83614482565b8083825282820191508286018a848660051b89010111156137f657600080fd5b600096505b8487101561382257803561380e8161461f565b8352600196909601959183019183016137fb565b509650508601359250508082111561383957600080fd5b506138468582860161350b565b9150509250929050565b6000806040838503121561386357600080fd5b82356001600160401b038082111561387a57600080fd5b818501915085601f83011261388e57600080fd5b8135602061389e61352c83614482565b8083825282820191508286018a848660051b89010111156138be57600080fd5b600096505b848710156138225780356138d68161461f565b8352600196909601959183019183016138c3565b6000602082840312156138fc57600080fd5b612c138261357d565b6000806040838503121561391857600080fd5b6139218361357d565b915060208301516001600160401b0381111561393c57600080fd5b613846858286016135d5565b60006020828403121561395a57600080fd5b81356001600160e01b031981168114612c1357600080fd5b6000806040838503121561398557600080fd5b82516001600160401b0381111561399b57600080fd5b6139a7858286016135d5565b9250506139b66020840161357d565b90509250929050565b600080604083850312156139d257600080fd5b8251600781106139e157600080fd5b60208401519092506001600160401b0381111561393c57600080fd5b600060808284031215613a0f57600080fd5b604051608081018181106001600160401b0382111715613a3157613a31614609565b8060405250825181526020830151602082015260408301516040820152606083015160608201528091505092915050565b60006101208284031215613a7557600080fd5b613a7d614407565b8235815260208301356020820152604083013560408201526060830135606082015260808301356080820152613ab560a084016134fb565b60a0820152613ac660c0840161366a565b60c0820152613ad760e0840161367b565b60e0820152610100613aea818501613658565b908201529392505050565b600080600080600080600080888a03610120811215613b1357600080fd5b89356001600160401b0380821115613b2a57600080fd5b613b368d838e01613640565b9a5060208c0135915080821115613b4c57600080fd5b613b588d838e0161358d565b909a50985060408c0135915080821115613b7157600080fd5b50613b7e8c828d0161358d565b9097509550506080605f1982011215613b9657600080fd5b5096999598509396929550909360608301935060e08301359261010001359150565b600080828403610100811215613bcd57600080fd5b60e0811215613bdb57600080fd5b50613be4614430565b835181526020840151602082015260408401516040820152606084015160608201526080840151608082015260a0840151613c1e8161461f565b60a082015260c0840151613c318161461f565b60c082015291506139b660e0840161357d565b600060208284031215613c5657600080fd5b5035919050565b60008060408385031215613c7057600080fd5b8235915060208301356001600160401b03811115613c8d57600080fd5b8301610100818603121561370957600080fd5b60008060008060008060808789031215613cb957600080fd5b8635955060208701356001600160401b0380821115613cd757600080fd5b613ce38a838b01613640565b96506040890135915080821115613cf957600080fd5b613d058a838b0161358d565b90965094506060890135915080821115613d1e57600080fd5b50613d2b89828a0161358d565b979a9699509497509295939492505050565b81835281816020850137506000828201602090810191909152601f909101601f19169091010190565b60008151808452613d7e816020860160208601614580565b601f01601f19169290920160200192915050565b60078110613db057634e487b7160e01b600052602160045260246000fd5b9052565b60008135613dc18161461f565b6001600160a01b039081168452602083013590613ddd8261461f565b166020840152604082810135908401526060808301359084015260808083013590840152613e0e60a08301836144a5565b60e060a0860152613e2360e086018284613d3d565b91505060c083013560c08501528091505092915050565b60006101008235845260208301356020850152604083013560408501526060830135613e658161461f565b6001600160a01b039081166060860152608084013590613e848261461f565b16608085015260a0830135613e988161461f565b6001600160a01b031660a0850152613eb360c08401846144a5565b8260c0870152613ec68387018284613d3d565b9250505060e083013560e08501528091505092915050565b6000813582360360de1981018212613ef557600080fd5b60408552613f0860408601858401613db4565b9150602084013560fe1982018112613f1f57600080fd5b858303602087015261328f83868301613e3a565b8183823760009101908152919050565b60008251613f55818460208701614580565b9190910192915050565b60008451613f71818460208901614580565b600560fb1b9083019081528451613f8f816001840160208901614580565b600b60fa1b600192909101918201528351613fb1816002840160208801614580565b0160020195945050505050565b7352656c6179446174612072656c6179446174612960601b815260008251613fed816014850160208701614580565b9190910160140192915050565b6001600160a01b0387811682528681166020830152851660408201526001600160e01b03198416606082015260c081016140376080830185613d92565b8260a0830152979650505050505050565b6001600160a01b0387811682528681166020830152851660408201526001600160e01b0319841660608201526080810183905260c060a0820181905260009061409390830184613d66565b98975050505050505050565b60018060a01b038516815283602082015260606040820152600061328f606083018486613d3d565b6040808252810183905260008460608301825b8681101561410a5782356140ed8161461f565b6001600160a01b03168252602092830192909101906001016140da565b5060209390930193909352509392505050565b84151581528360208201526141356040820184613d92565b60806060820152600061328f6080830184613d66565b60808152600061415e6080830187613d66565b8515156020840152846040840152828103606084015261417e8185613e3a565b979650505050505050565b6141938184613d92565b6040602082015260006136386040830184613d66565b602081526000612c136020830184613d66565b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b60a08152600061420460a0830189613db4565b87602084015286604084015282810360608401526142228187613d66565b90508281036080840152614237818587613d3d565b9998505050505050505050565b600061012082019050825182526020830151602083015260408301516040830152606083015160608301526080830151608083015260018060a01b0360a08401511660a083015260ff60c08401511660c083015260e08301516142b260e08401826001600160501b03169052565b506101009283015161ffff16919092015290565b60006101208083526142da8184018c613ede565b905082810360208401526142ef818a8c613d3d565b9050828103604084015261430481888a613d3d565b9150508451606083015260208501516080830152604085015160a0830152606085015160c08301528360e0830152826101008301529998505050505050505050565b6080815260006143596080830189613ede565b828103602084015261436c81888a613d3d565b90508281036040840152614381818688613d3d565b915050826060830152979650505050505050565b6000808335601e198436030181126143ac57600080fd5b8301803591506001600160401b038211156143c657600080fd5b6020019150368190038213156135ce57600080fd5b6000823560de19833603018112613f5557600080fd5b6000823560fe19833603018112613f5557600080fd5b60405161012081016001600160401b038111828210171561442a5761442a614609565b60405290565b60405160e081016001600160401b038111828210171561442a5761442a614609565b604051601f8201601f191681016001600160401b038111828210171561447a5761447a614609565b604052919050565b60006001600160401b0382111561449b5761449b614609565b5060051b60200190565b6000808335601e198436030181126144bc57600080fd5b83016020810192503590506001600160401b038111156144db57600080fd5b8036038313156135ce57600080fd5b600061ffff808316818516808303821115614507576145076145c7565b01949350505050565b60008219821115614523576145236145c7565b500190565b60008261454557634e487b7160e01b600052601260045260246000fd5b500490565b6000816000190483118215151615614564576145646145c7565b500290565b60008282101561457b5761457b6145c7565b500390565b60005b8381101561459b578181015183820152602001614583565b83811115610ca55750506000910152565b60006000198214156145c0576145c06145c7565b5060010190565b634e487b7160e01b600052601160045260246000fd5b634e487b7160e01b600052602160045260246000fd5b634e487b7160e01b600052603260045260246000fd5b634e487b7160e01b600052604160045260246000fd5b6001600160a01b03811681146128e357600080fdfe616464726573732066726f6d2c6164647265737320746f2c75696e743235362076616c75652c75696e74323536206761732c75696e74323536206e6f6e63652c627974657320646174612c75696e743235362076616c6964556e74696c54696d65332e302e302d626574612e302b6f70656e67736e2e6875622e6972656c617968756252656c6179446174612875696e74323536206d61784665655065724761732c75696e74323536206d61785072696f726974794665655065724761732c75696e74323536207472616e73616374696f6e43616c6c64617461476173557365642c616464726573732072656c6179576f726b65722c61646472657373207061796d61737465722c6164647265737320666f727761726465722c6279746573207061796d6173746572446174612c75696e7432353620636c69656e74496429a2646970667358221220ef137c0ceaa4ff6388385b5911e82c255a8a52c5ebfeb89aed96950deeb92c3664736f6c634300080700330000000000000000000000009407ceb60a383c04e7745b00313ef5a1916320c8000000000000000000000000a3e0f3ded0bc0904063ccb910e885de8f683e72f00000000000000000000000000000000000000000000000000000000000000000000000000000000000000007bf1ab205d74201f038ffc7fad95e5729e103199000000000000000000000000000000000000000000000000000000000000000a00000000000000000000000000000000000000000000000000000000000186a00000000000000000000000000000000000000000000000000000000000004029000000000000000000000000000000000000000000000000000000000000d92c0000000000000000000000000000000000000000000000000000000000003a98000000000000000000000000d21934ed8eaf27a67f0a70042af50a1d6d195e81000000000000000000000000000000000000000000000000000000000000000a00000000000000000000000000000000000000000000000000038d7ea4c680000000000000000000000000000000000000000000000000000000000000000032

Constructor Arguments (ABI-Encoded and is the last bytes of the Contract Creation Code above)

0000000000000000000000009407ceb60a383c04e7745b00313ef5a1916320c8000000000000000000000000a3e0f3ded0bc0904063ccb910e885de8f683e72f00000000000000000000000000000000000000000000000000000000000000000000000000000000000000007bf1ab205d74201f038ffc7fad95e5729e103199000000000000000000000000000000000000000000000000000000000000000a00000000000000000000000000000000000000000000000000000000000186a00000000000000000000000000000000000000000000000000000000000004029000000000000000000000000000000000000000000000000000000000000d92c0000000000000000000000000000000000000000000000000000000000003a98000000000000000000000000d21934ed8eaf27a67f0a70042af50a1d6d195e81000000000000000000000000000000000000000000000000000000000000000a00000000000000000000000000000000000000000000000000038d7ea4c680000000000000000000000000000000000000000000000000000000000000000032

-----Decoded View---------------
Arg [0] : _stakeManager (address): 0x9407ceb60a383c04e7745b00313ef5a1916320c8
Arg [1] : _penalizer (address): 0xa3e0f3ded0bc0904063ccb910e885de8f683e72f
Arg [2] : _batchGateway (address): 0x0000000000000000000000000000000000000000
Arg [3] : _relayRegistrar (address): 0x7bf1ab205d74201f038ffc7fad95e5729e103199
Arg [4] : _config (tuple): System.Collections.Generic.List`1[Nethereum.ABI.FunctionEncoding.ParameterOutput]

-----Encoded View---------------
13 Constructor Arguments found :
Arg [0] : 0000000000000000000000009407ceb60a383c04e7745b00313ef5a1916320c8
Arg [1] : 000000000000000000000000a3e0f3ded0bc0904063ccb910e885de8f683e72f
Arg [2] : 0000000000000000000000000000000000000000000000000000000000000000
Arg [3] : 0000000000000000000000007bf1ab205d74201f038ffc7fad95e5729e103199
Arg [4] : 000000000000000000000000000000000000000000000000000000000000000a
Arg [5] : 00000000000000000000000000000000000000000000000000000000000186a0
Arg [6] : 0000000000000000000000000000000000000000000000000000000000004029
Arg [7] : 000000000000000000000000000000000000000000000000000000000000d92c
Arg [8] : 0000000000000000000000000000000000000000000000000000000000003a98
Arg [9] : 000000000000000000000000d21934ed8eaf27a67f0a70042af50a1d6d195e81
Arg [10] : 000000000000000000000000000000000000000000000000000000000000000a
Arg [11] : 00000000000000000000000000000000000000000000000000038d7ea4c68000
Arg [12] : 0000000000000000000000000000000000000000000000000000000000000032


Block Transaction Difficulty Gas Used Reward
Block Uncle Number Difficulty Gas Used Reward
Loading

A contract address hosts a smart contract, which is a set of code stored on the blockchain that runs when predetermined conditions are met. Learn more about addresses in our Knowledge Base.