Contract 0xAa3E82b4c4093b4bA13Cb5714382C99ADBf750cA

 
Txn Hash
Block
From
To
Value [Txn Fee]
0x17ca9edc38a96dbaf09593a156404822c98f580ed8727a3d0d7c646a917768d083482482021-06-16 13:44:464 hrs 21 mins ago0x5b217fb2dc0c2ebb5c2b35da8e6c2d15c32997a4 IN  0xaa3e82b4c4093b4ba13cb5714382c99adbf750ca0 BNB0.00017319
0x6b445b398e9c6216bf96c9600f795dc4480c11078f351f3e9ca326edd334132e83432512021-06-16 9:33:328 hrs 32 mins ago0x5b217fb2dc0c2ebb5c2b35da8e6c2d15c32997a4 IN  0xaa3e82b4c4093b4ba13cb5714382c99adbf750ca0 BNB0.00017319
0x8e9a7fc10bfdd92af10d590610bb84c7290dee072b851ee161c192cf1daacf8a83382562021-06-16 5:21:3112 hrs 44 mins ago0x5b217fb2dc0c2ebb5c2b35da8e6c2d15c32997a4 IN  0xaa3e82b4c4093b4ba13cb5714382c99adbf750ca0 BNB0.00017319
0xf0af091e4c51b4f949afeca6f341137136bfe50fcd49df31af7a786c95efabed83332622021-06-16 1:09:2416 hrs 57 mins ago0x5b217fb2dc0c2ebb5c2b35da8e6c2d15c32997a4 IN  0xaa3e82b4c4093b4ba13cb5714382c99adbf750ca0 BNB0.00017319
0xaffd43496daf96f524379989b5ebcb6bcf028dc647e3a56d8ab3b69ac18400fb83282692021-06-15 20:57:0921 hrs 9 mins ago0x5b217fb2dc0c2ebb5c2b35da8e6c2d15c32997a4 IN  0xaa3e82b4c4093b4ba13cb5714382c99adbf750ca0 BNB0.00017319
0xa83d706446c3f3c35946665d24ded624cbdfc23abd333a1c89f41cd4e2f7654a83232732021-06-15 16:46:141 day 1 hr ago0x5b217fb2dc0c2ebb5c2b35da8e6c2d15c32997a4 IN  0xaa3e82b4c4093b4ba13cb5714382c99adbf750ca0 BNB0.00017319
0xa650382e7047d8ec79713fa85a365884c3aaaefd30ff50f0a2f31089889ed76e83182752021-06-15 12:31:101 day 5 hrs ago0x5b217fb2dc0c2ebb5c2b35da8e6c2d15c32997a4 IN  0xaa3e82b4c4093b4ba13cb5714382c99adbf750ca0 BNB0.00017319
0xdc0ce5fde6ab7dd7174b5fa6c9a4e52cdf640dea5846bb88cdccb993d2bb0f9683132772021-06-15 8:15:171 day 9 hrs ago0x5b217fb2dc0c2ebb5c2b35da8e6c2d15c32997a4 IN  0xaa3e82b4c4093b4ba13cb5714382c99adbf750ca0 BNB0.00017319
0x19ecac2d21b548bcd074da287449e628a2fbfdab0fd7130c8d6a5698c6339fbf83082832021-06-15 4:02:211 day 14 hrs ago0x5b217fb2dc0c2ebb5c2b35da8e6c2d15c32997a4 IN  0xaa3e82b4c4093b4ba13cb5714382c99adbf750ca0 BNB0.00017319
0xbbc354a082a31dc7df441a70139aabe0d6d32d987e9e7ab45712475e5283403283032892021-06-14 23:49:391 day 18 hrs ago0x5b217fb2dc0c2ebb5c2b35da8e6c2d15c32997a4 IN  0xaa3e82b4c4093b4ba13cb5714382c99adbf750ca0 BNB0.00017319
0x83265416d0c273ab2c8c762dded27fd2e00507312a441117dff22d75c9ba456a82982952021-06-14 19:34:341 day 22 hrs ago0x5b217fb2dc0c2ebb5c2b35da8e6c2d15c32997a4 IN  0xaa3e82b4c4093b4ba13cb5714382c99adbf750ca0 BNB0.00017319
0x6cead10b581134878bf2fd691a35c695c1900c8a657ad612e2233f20acb696c882933022021-06-14 15:24:082 days 2 hrs ago0x5b217fb2dc0c2ebb5c2b35da8e6c2d15c32997a4 IN  0xaa3e82b4c4093b4ba13cb5714382c99adbf750ca0 BNB0.00017319
0x75a6e33131e1505b412d0a8dc1b17b4f90b4fcea58d5f228c084b5eaadcf744582883082021-06-14 11:12:382 days 6 hrs ago0x5b217fb2dc0c2ebb5c2b35da8e6c2d15c32997a4 IN  0xaa3e82b4c4093b4ba13cb5714382c99adbf750ca0 BNB0.00017319
0x286ba82dadc558483d6acdbc4ce07ac68cc20f4ad21587133e95a4e11c6009d182833142021-06-14 6:59:232 days 11 hrs ago0x5b217fb2dc0c2ebb5c2b35da8e6c2d15c32997a4 IN  0xaa3e82b4c4093b4ba13cb5714382c99adbf750ca0 BNB0.00017319
0xf7f764eb1c38c61fcdf4b571f63c86f7a62eae7817fb287f8f49dd90430cf52582783192021-06-14 2:46:302 days 15 hrs ago0x5b217fb2dc0c2ebb5c2b35da8e6c2d15c32997a4 IN  0xaa3e82b4c4093b4ba13cb5714382c99adbf750ca0 BNB0.00017319
0x0b13d059a6676c6b33d3b9761380be760b8223c80052a350ce556cde02f58abb82733242021-06-13 22:30:432 days 19 hrs ago0x5b217fb2dc0c2ebb5c2b35da8e6c2d15c32997a4 IN  0xaa3e82b4c4093b4ba13cb5714382c99adbf750ca0 BNB0.00017319
0x3773d43396b6b2af95a1c235a6f363cafa11a1f9847d2e11deb6a87e82a51cbd82683282021-06-13 18:17:192 days 23 hrs ago0x5b217fb2dc0c2ebb5c2b35da8e6c2d15c32997a4 IN  0xaa3e82b4c4093b4ba13cb5714382c99adbf750ca0 BNB0.00017319
0xf26769e2481d12c8e238d6e86ae75ac150b16a919cf33e479a09c39efe5057a182633332021-06-13 14:05:343 days 4 hrs ago0x5b217fb2dc0c2ebb5c2b35da8e6c2d15c32997a4 IN  0xaa3e82b4c4093b4ba13cb5714382c99adbf750ca0 BNB0.00017319
0xb23bcf18c5878be507fdb7afed927937c68ccf8f653feeb9786f09f369b095d682583372021-06-13 9:52:573 days 8 hrs ago0x5b217fb2dc0c2ebb5c2b35da8e6c2d15c32997a4 IN  0xaa3e82b4c4093b4ba13cb5714382c99adbf750ca0 BNB0.00017319
0x34994b0cea2446fbfe4df49a08c51a68c8421f8d3139574643e7c7389e325da782533402021-06-13 5:40:333 days 12 hrs ago0x5b217fb2dc0c2ebb5c2b35da8e6c2d15c32997a4 IN  0xaa3e82b4c4093b4ba13cb5714382c99adbf750ca0 BNB0.00017319
0xd82637959cf61dcbd80a122889cdab8f0757a1d1910a697ba33ea3b7f4cc74b482483462021-06-13 1:29:393 days 16 hrs ago0x5b217fb2dc0c2ebb5c2b35da8e6c2d15c32997a4 IN  0xaa3e82b4c4093b4ba13cb5714382c99adbf750ca0 BNB0.00017319
0x60ec10c8f7c2cb437fbfb50ed8b08d5eccc3b72e812be2b3ec70bef97cdbe2fe82433532021-06-12 21:17:093 days 20 hrs ago0x5b217fb2dc0c2ebb5c2b35da8e6c2d15c32997a4 IN  0xaa3e82b4c4093b4ba13cb5714382c99adbf750ca0 BNB0.00017319
0xc5858861ecdcd894784c2f50d638db61b9591da0199df7f4a6385f7d31a9ae5482383582021-06-12 17:04:234 days 1 hr ago0x5b217fb2dc0c2ebb5c2b35da8e6c2d15c32997a4 IN  0xaa3e82b4c4093b4ba13cb5714382c99adbf750ca0 BNB0.00017319
0x66c714639fe312d3b987f9f40961c66a568e7d9ce2d5c55e344566e31f30e92382333632021-06-12 12:54:384 days 5 hrs ago0x5b217fb2dc0c2ebb5c2b35da8e6c2d15c32997a4 IN  0xaa3e82b4c4093b4ba13cb5714382c99adbf750ca0 BNB0.00017319
0xc6f3b024d9fd0ccf513dea5066412ef46c78a454be4fa6cb15b843c2a369fd9d82283672021-06-12 8:43:424 days 9 hrs ago0x5b217fb2dc0c2ebb5c2b35da8e6c2d15c32997a4 IN  0xaa3e82b4c4093b4ba13cb5714382c99adbf750ca0 BNB0.00017319
[ Download CSV Export 
Latest 1 internal transaction
Parent Txn Hash Block From To Value
0x10a36712369188ad8afe74918e939932d4908d36a388c19e4cfe0ec072f34ef773845982021-05-13 21:05:0733 days 21 hrs ago 0x01a5a06c5ba6e5f8fc9cb060492fae1b3d03c69d 0xaa3e82b4c4093b4ba13cb5714382c99adbf750ca0.017 BNB
[ Download CSV Export 
Loading

Contract Source Code Verified (Exact Match)

Contract Name:
RelayHub

Compiler Version
v0.7.6+commit.7338295f

Optimization Enabled:
Yes with 200 runs

Other Settings:
istanbul EvmVersion, MIT license

Contract Source Code (Solidity Standard Json-Input format)

File 1 of 41 : Migrations.sol
// SPDX-License-Identifier:MIT
pragma solidity ^0.7.6;

import "@opengsn/contracts/src/RelayHub.sol";
import "@opengsn/contracts/src/StakeManager.sol";
import "@opengsn/contracts/src/Penalizer.sol";
import "@opengsn/contracts/src/BatchForwarder.sol";

import "@opengsn/contracts/src/test/PayableWithEmit.sol";
import "@opengsn/contracts/src/test/TestPaymasterConfigurableMisbehavior.sol";
import "@opengsn/contracts/src/test/TestPaymasterEverythingAccepted.sol";
import "@opengsn/contracts/src/test/PayableWithEmit.sol";
import "@opengsn/contracts/src/test/TestPaymasterOwnerSignature.sol";
import "@opengsn/contracts/src/test/TestPaymasterPreconfiguredApproval.sol";
import "@opengsn/contracts/src/test/TestPaymasterStoreContext.sol";
import "@opengsn/contracts/src/test/TestPaymasterVariableGasLimits.sol";
import "@opengsn/contracts/src/test/TestRecipient.sol";
import "@opengsn/contracts/src/test/TestRelayHubValidator.sol";
import "@opengsn/contracts/src/test/TestRelayWorkerContract.sol";
import "@opengsn/contracts/src/test/TestUtil.sol";

import "@opengsn/contracts/src/utils/GsnEip712Library.sol";
import "@opengsn/contracts/src/utils/GsnUtils.sol";
import "@opengsn/contracts/src/utils/MinLibBytes.sol";
import "@opengsn/contracts/src/utils/RLPReader.sol";
import "@opengsn/contracts/src/utils/VersionRegistry.sol";

import "@opengsn/contracts/src/forwarder/Forwarder.sol";
import "@opengsn/contracts/src/forwarder/test/TestForwarder.sol";
import "@opengsn/contracts/src/forwarder/test/TestForwarderTarget.sol";

contract Migrations {
    address public owner;
    // solhint-disable-next-line var-name-mixedcase
    uint public last_completed_migration;

    constructor() {
        owner = msg.sender;
    }

    modifier restricted() {
        if (msg.sender == owner) _;
    }

    function setCompleted(uint completed) public restricted {
        last_completed_migration = completed;
    }

    function upgrade(address newAddress) public restricted {
        Migrations upgraded = Migrations(newAddress);
        upgraded.setCompleted(last_completed_migration);
    }
}

File 2 of 41 : TestGas.sol
contract TestGas {
	function mygasleft(string calldata) public view returns(uint256) {
		return gasleft();
	}

	function mygasleft1(string calldata) public returns (uint256) {
		emit Gasleft(gasleft());
		return gasleft();
	}
	event Gasleft(uint gasleft);
}

File 3 of 41 : RelayHub.sol
/* 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:MIT
pragma solidity ^0.7.6;
pragma abicoder v2;

import "./utils/MinLibBytes.sol";
import "@openzeppelin/contracts/math/SafeMath.sol";
import "@openzeppelin/contracts/access/Ownable.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 "./StringUtils.sol";

contract RelayHub is IRelayHub, Ownable {
    using SafeMath for uint256;

    using StringUtils for *;

    string public override versionHub = "2.2.0+opengsn.hub.irelayhub";

    IStakeManager immutable override public stakeManager;
    address immutable override public penalizer;

    RelayHubConfig private config;

    function getConfiguration() public override view returns (RelayHubConfig memory) {
        return config;
    }

    function setConfiguration(RelayHubConfig memory _config) public override onlyOwner {
        config = _config;
        emit RelayHubConfigured(config);
    }

    uint256 public constant G_NONZERO = 16;

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

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

    mapping(address => uint256) private balances;

    uint256 public override deprecationBlock = type(uint).max;

    constructor (
        IStakeManager _stakeManager,
        address _penalizer,
        uint256 _maxWorkerCount,
        uint256 _gasReserve,
        uint256 _postOverhead,
        uint256 _gasOverhead,
        uint256 _maximumRecipientDeposit,
        uint256 _minimumUnstakeDelay,
        uint256 _minimumStake,
        uint256 _dataGasCostPerByte,
        uint256 _externalCallDataCostOverhead
    ) {
        stakeManager = _stakeManager;
        penalizer = _penalizer;
        setConfiguration(RelayHubConfig(
            _maxWorkerCount,
            _gasReserve,
            _postOverhead,
            _gasOverhead,
            _maximumRecipientDeposit,
            _minimumUnstakeDelay,
            _minimumStake,
            _dataGasCostPerByte,
            _externalCallDataCostOverhead
        ));
    }

    function registerRelayServer(uint256 baseRelayFee, uint256 pctRelayFee, string calldata url) external override {
        address relayManager = msg.sender;
        require(
            isRelayManagerStaked(relayManager),
            "relay manager not staked"
        );
        require(workerCount[relayManager] > 0, "no relay workers");
        emit RelayServerRegistered(relayManager, baseRelayFee, pctRelayFee, url);
    }

    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");

        require(
            isRelayManagerStaked(relayManager),
            "relay manager not staked"
        );

        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);
    }

    function depositFor(address target) public override payable {
        uint256 amount = msg.value;
        require(amount <= config.maximumRecipientDeposit, "deposit too big");

        balances[target] = balances[target].add(amount);

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

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

    function withdraw(uint256 amount, address payable dest) public override {
        address payable account = msg.sender;
        require(balances[account] >= amount, "insufficient funds");

        balances[account] = balances[account].sub(amount);
        dest.transfer(amount);

        emit Withdrawn(account, dest, amount);
    }

    function calldataGasCost(uint256 length) public override view returns (uint256) {
        return config.dataGasCostPerByte.mul(length);
}

    function verifyGasAndDataLimits(
        uint256 maxAcceptanceBudget,
        GsnTypes.RelayRequest calldata relayRequest,
        uint256 initialGasLeft,
        uint256 externalGasLimit
    )
    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" );
        uint256 dataGasCost = calldataGasCost(msg.data.length);
        uint256 externalCallDataCost = externalGasLimit - initialGasLeft - config.externalCallDataCostOverhead;
        uint256 txDataCostPerByte = externalCallDataCost/msg.data.length;
        require(txDataCostPerByte <= G_NONZERO, "invalid externalGasLimit"
            .concat(" externalGasLimit=", externalGasLimit)
            .concat(" initialGasLeft=", initialGasLeft)
            .concat( " perbyte=", txDataCostPerByte)
        );

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

        maxPossibleGas =
            config.gasOverhead.add(
            gasAndDataLimits.preRelayedCallGasLimit).add(
            gasAndDataLimits.postRelayedCallGasLimit).add(
            relayRequest.request.gas).add(
            dataGasCost).add(
            externalCallDataCost);

        // This transaction must have enough gas to forward the call to the recipient with the requested amount, and not
        // run out of gas later in this function.
        require(
            externalGasLimit >= maxPossibleGas,
            "no gas for innerRelayCall");

        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 gasBeforeInner;
        bytes retData;
        address relayManager;
        uint256 dataGasCost;
    }

    function relayCall(
        uint maxAcceptanceBudget,
        GsnTypes.RelayRequest calldata relayRequest,
        bytes calldata signature,
        bytes calldata approvalData,
        uint externalGasLimit
    )
    external
    override
    returns (bool paymasterAccepted, bytes memory returnValue)
    {
        RelayCallData memory vars;
        vars.initialGasLeft = gasleft();
        require(!isDeprecated(), "hub deprecated");
        vars.functionSelector = relayRequest.request.data.length>=4 ? MinLibBytes.readBytes4(relayRequest.request.data, 0) : bytes4(0);
//        require(msg.sender == tx.origin, "relay worker must be EOA");
        vars.relayManager = workerToManager[msg.sender];
//        require(vars.relayManager != address(0), "Unknown relay worker");
//        require(relayRequest.relayData.relayWorker == msg.sender, "Not a right worker");
//        require(
//            isRelayManagerStaked(vars.relayManager),
//            "relay manager not staked"
//        );
        require(relayRequest.relayData.gasPrice <= tx.gasprice, "Invalid gas price");
        require(externalGasLimit <= block.gaslimit, "Impossible gas limit");

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

        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.
        uint256 innerGasLimit = gasleft()*63/64- config.gasReserve;
        vars.gasBeforeInner = gasleft();

        uint256 _tmpInitialGas = innerGasLimit + externalGasLimit + 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:innerGasLimit}(
            abi.encodeWithSelector(RelayHub.innerRelayCall.selector, relayRequest, signature, approvalData, vars.gasAndDataLimits,
                _tmpInitialGas - gasleft(),
                vars.maxPossibleGas
                )
        );
        vars.success = success;
        vars.innerGasUsed = vars.gasBeforeInner-gasleft();
        (vars.status, vars.relayedCallReturnValue) = abi.decode(relayCallStatus, (RelayCallStatus, bytes));
        if ( vars.relayedCallReturnValue.length>0 ) {
            emit TransactionResult(vars.status, vars.relayedCallReturnValue);
        }
    }
    {
        vars.dataGasCost = calldataGasCost(msg.data.length);
        if (!vars.success) {
            //Failure cases where the PM doesn't pay
            if (vars.status == RelayCallStatus.RejectedByPreRelayed ||
                    (vars.innerGasUsed <= vars.gasAndDataLimits.acceptanceBudget.add(vars.dataGasCost)) && (
                    vars.status == RelayCallStatus.RejectedByForwarder ||
                    vars.status == RelayCallStatus.RejectedByRecipientRevert  //can only be thrown if rejectOnRecipientRevert==true
            )) {
                paymasterAccepted=false;

                emit TransactionRejectedByPaymaster(
                    vars.relayManager,
                    relayRequest.relayData.paymaster,
                    relayRequest.request.from,
                    relayRequest.request.to,
                    msg.sender,
                    vars.functionSelector,
                    vars.innerGasUsed,
                    vars.relayedCallReturnValue);
                return (false, vars.relayedCallReturnValue);
            }
        }
        // We now perform the actual charge calculation, based on the measured gas used
        uint256 gasUsed = (externalGasLimit - gasleft()) + config.gasOverhead;
        uint256 charge = calculateCharge(gasUsed, relayRequest.relayData);

        balances[relayRequest.relayData.paymaster] = balances[relayRequest.relayData.paymaster].sub(charge);
        balances[vars.relayManager] = balances[vars.relayManager].add(charge);

        emit TransactionRelayed(
            vars.relayManager,
            msg.sender,
            relayRequest.request.from,
            relayRequest.request.to,
            relayRequest.relayData.paymaster,
            vars.functionSelector,
            vars.status,
            charge);
        return (true, "");
    }
    }

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

    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;
        // 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,
            totalInitialGas - gasleft(), /*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)
        }
    }

    function calculateCharge(uint256 gasUsed, GsnTypes.RelayData calldata relayData) public override virtual view returns (uint256) {
        return relayData.baseRelayFee.add((gasUsed.mul(relayData.gasPrice).mul(relayData.pctRelayFee.add(100))).div(100));
    }

    function isRelayManagerStaked(address relayManager) public override view returns (bool) {
        return stakeManager.isRelayManagerStaked(relayManager, address(this), config.minimumStake, config.minimumUnstakeDelay);
    }

    function deprecateHub(uint256 fromBlock) public override onlyOwner {
        require(deprecationBlock > block.number, "Already deprecated");
        deprecationBlock = fromBlock;
        emit HubDeprecated(fromBlock);
    }

    function isDeprecated() public override view returns (bool) {
        return block.number >= deprecationBlock;
    }

    modifier penalizerOnly () {
        require(msg.sender == penalizer, "Not penalizer");
        _;
    }

    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");
        require(
            isRelayManagerStaked(relayManager),
            "relay manager not staked"
        );
        IStakeManager.StakeInfo memory stakeInfo = stakeManager.getStakeInfo(relayManager);
        stakeManager.penalizeRelayManager(relayManager, beneficiary, stakeInfo.stake);
    }
}

File 4 of 41 : StakeManager.sol
// SPDX-License-Identifier:MIT
pragma solidity ^0.7.6;
pragma abicoder v2;

import "@openzeppelin/contracts/math/SafeMath.sol";

import "./interfaces/IStakeManager.sol";

contract StakeManager is IStakeManager {
    using SafeMath for uint256;

    string public override versionSM = "2.2.0+opengsn.stakemanager.istakemanager";
    uint256 public immutable override maxUnstakeDelay;

    /// maps relay managers to their stakes
    mapping(address => StakeInfo) public stakes;
    function getStakeInfo(address relayManager) external override view returns (StakeInfo memory stakeInfo) {
        return stakes[relayManager];
    }

    /// maps relay managers to a map of addressed of their authorized hubs to the information on that hub
    mapping(address => mapping(address => RelayHubInfo)) public authorizedHubs;

    constructor(uint256 _maxUnstakeDelay) {
        maxUnstakeDelay = _maxUnstakeDelay;
    }

    function setRelayManagerOwner(address payable owner) external override {
        require(owner != address(0), "invalid owner");
        require(stakes[msg.sender].owner == address(0), "already owned");
        stakes[msg.sender].owner = owner;
        emit OwnerSet(msg.sender, owner);
    }

    /// Put a stake for a relayManager and set its unstake delay. Only the owner can call this function.
    /// @param relayManager - address that represents a stake entry and controls relay registrations on relay hubs
    /// @param unstakeDelay - number of blocks to elapse before the owner can retrieve the stake after calling 'unlock'
    function stakeForRelayManager(address relayManager, uint256 unstakeDelay) external override payable ownerOnly(relayManager) {
        require(unstakeDelay >= stakes[relayManager].unstakeDelay, "unstakeDelay cannot be decreased");
        require(unstakeDelay <= maxUnstakeDelay, "unstakeDelay too big");
        stakes[relayManager].stake += msg.value;
        stakes[relayManager].unstakeDelay = unstakeDelay;
        emit StakeAdded(relayManager, stakes[relayManager].owner, stakes[relayManager].stake, stakes[relayManager].unstakeDelay);
    }

    function unlockStake(address relayManager) external override ownerOnly(relayManager) {
        StakeInfo storage info = stakes[relayManager];
        require(info.withdrawBlock == 0, "already pending");
        uint withdrawBlock = block.number.add(info.unstakeDelay);
        info.withdrawBlock = withdrawBlock;
        emit StakeUnlocked(relayManager, msg.sender, withdrawBlock);
    }

    function withdrawStake(address relayManager) external override ownerOnly(relayManager) {
        StakeInfo storage info = stakes[relayManager];
        require(info.withdrawBlock > 0, "Withdrawal is not scheduled");
        require(info.withdrawBlock <= block.number, "Withdrawal is not due");
        uint256 amount = info.stake;
        info.stake = 0;
        info.withdrawBlock = 0;
        msg.sender.transfer(amount);
        emit StakeWithdrawn(relayManager, msg.sender, amount);
    }

    modifier ownerOnly (address relayManager) {
        StakeInfo storage info = stakes[relayManager];
        require(info.owner == msg.sender, "not owner");
        _;
    }

    modifier managerOnly () {
        StakeInfo storage info = stakes[msg.sender];
        require(info.owner != address(0), "not manager");
        _;
    }

    function authorizeHubByOwner(address relayManager, address relayHub) external ownerOnly(relayManager) override {
        _authorizeHub(relayManager, relayHub);
    }

    function authorizeHubByManager(address relayHub) external managerOnly override {
        _authorizeHub(msg.sender, relayHub);
    }

    function _authorizeHub(address relayManager, address relayHub) internal {
        authorizedHubs[relayManager][relayHub].removalBlock = uint(-1);
        emit HubAuthorized(relayManager, relayHub);
    }

    function unauthorizeHubByOwner(address relayManager, address relayHub) external override ownerOnly(relayManager) {
        _unauthorizeHub(relayManager, relayHub);
    }

    function unauthorizeHubByManager(address relayHub) external override managerOnly {
        _unauthorizeHub(msg.sender, relayHub);
    }

    function _unauthorizeHub(address relayManager, address relayHub) internal {
        RelayHubInfo storage hubInfo = authorizedHubs[relayManager][relayHub];
        require(hubInfo.removalBlock == uint(-1), "hub not authorized");
        uint256 removalBlock = block.number.add(stakes[relayManager].unstakeDelay);
        hubInfo.removalBlock = removalBlock;
        emit HubUnauthorized(relayManager, relayHub, removalBlock);
    }

    function isRelayManagerStaked(address relayManager, address relayHub, uint256 minAmount, uint256 minUnstakeDelay)
    external
    override
    view
    returns (bool) {
        StakeInfo storage info = stakes[relayManager];
        bool isAmountSufficient = info.stake >= minAmount;
        bool isDelaySufficient = info.unstakeDelay >= minUnstakeDelay;
        bool isStakeLocked = info.withdrawBlock == 0;
        bool isHubAuthorized = authorizedHubs[relayManager][relayHub].removalBlock == uint(-1);
        return
        isAmountSufficient &&
        isDelaySufficient &&
        isStakeLocked &&
        isHubAuthorized;
    }

    /// Slash the stake of the relay relayManager. In order to prevent stake kidnapping, burns half of stake on the way.
    /// @param relayManager - entry to penalize
    /// @param beneficiary - address that receives half of the penalty amount
    /// @param amount - amount to withdraw from stake
    function penalizeRelayManager(address relayManager, address payable beneficiary, uint256 amount) external override {
        uint256 removalBlock =  authorizedHubs[relayManager][msg.sender].removalBlock;
        require(removalBlock != 0, "hub not authorized");
        require(removalBlock > block.number, "hub authorization expired");

        // Half of the stake will be burned (sent to address 0)
        require(stakes[relayManager].stake >= amount, "penalty exceeds stake");
        stakes[relayManager].stake = SafeMath.sub(stakes[relayManager].stake, amount);

        uint256 toBurn = SafeMath.div(amount, 2);
        uint256 reward = SafeMath.sub(amount, toBurn);

        // Ether is burned and transferred
        address(0).transfer(toBurn);
        beneficiary.transfer(reward);
        emit StakePenalized(relayManager, beneficiary, reward);
    }
}

File 5 of 41 : Penalizer.sol
// SPDX-License-Identifier:MIT
pragma solidity >=0.7.6;
pragma abicoder v2;

import "@openzeppelin/contracts/cryptography/ECDSA.sol";

import "./utils/RLPReader.sol";
import "./utils/GsnUtils.sol";
import "./interfaces/IRelayHub.sol";
import "./interfaces/IPenalizer.sol";

contract Penalizer is IPenalizer {

    string public override versionPenalizer = "2.2.0+opengsn.penalizer.ipenalizer";

    using ECDSA for bytes32;

    uint256 public immutable override penalizeBlockDelay;
    uint256 public immutable override penalizeBlockExpiration;

    constructor(
        uint256 _penalizeBlockDelay,
        uint256 _penalizeBlockExpiration
    ) {
        penalizeBlockDelay = _penalizeBlockDelay;
        penalizeBlockExpiration = _penalizeBlockExpiration;
    }

    function isTransactionType1(bytes calldata rawTransaction) public pure returns (bool) {
        return (uint8(rawTransaction[0]) == 1);
    }

    function isTransactionTypeValid(bytes calldata rawTransaction) public pure returns(bool) {
        uint8 transactionTypeByte = uint8(rawTransaction[0]);
        return (transactionTypeByte >= 0xc0 && transactionTypeByte <= 0xfe);
    }

    function decodeTransaction(bytes calldata rawTransaction) public pure returns (Transaction memory transaction) {
        if (isTransactionType1(rawTransaction)) {
            (transaction.nonce,
            transaction.gasPrice,
            transaction.gasLimit,
            transaction.to,
            transaction.value,
            transaction.data) = RLPReader.decodeTransactionType1(rawTransaction);
        } else {
            (transaction.nonce,
            transaction.gasPrice,
            transaction.gasLimit,
            transaction.to,
            transaction.value,
            transaction.data) = RLPReader.decodeLegacyTransaction(rawTransaction);
        }
        return transaction;
    }

    mapping(bytes32 => uint) public commits;

    /**
     * any sender can call "commit(keccak(encodedPenalizeFunction))", to make sure
     * no-one can front-run it to claim this penalization
     */
    function commit(bytes32 commitHash) external override {
        uint256 readyBlockNumber = block.number + penalizeBlockDelay;
        commits[commitHash] = readyBlockNumber;
        emit CommitAdded(msg.sender, commitHash, readyBlockNumber);
    }

    modifier commitRevealOnly() {
        bytes32 commitHash = keccak256(abi.encodePacked(keccak256(msg.data), msg.sender));
        uint256 readyBlockNumber = commits[commitHash];
        delete commits[commitHash];
        // msg.sender can only be fake during off-chain view call, allowing Penalizer process to check transactions
        if(msg.sender != address(0)) {
            require(readyBlockNumber != 0, "no commit");
            require(readyBlockNumber < block.number, "reveal penalize too soon");
            require(readyBlockNumber + penalizeBlockExpiration > block.number, "reveal penalize too late");
        }
        _;
    }

    function penalizeRepeatedNonce(
        bytes calldata unsignedTx1,
        bytes calldata signature1,
        bytes calldata unsignedTx2,
        bytes calldata signature2,
        IRelayHub hub,
        uint256 randomValue
    )
    public
    override
    commitRevealOnly {
        (randomValue);
        _penalizeRepeatedNonce(unsignedTx1, signature1, unsignedTx2, signature2, hub);
    }

    function _penalizeRepeatedNonce(
        bytes calldata unsignedTx1,
        bytes calldata signature1,
        bytes calldata unsignedTx2,
        bytes calldata signature2,
        IRelayHub hub
    )
    private
    {
        // If a relay attacked the system by signing multiple transactions with the same nonce
        // (so only one is accepted), anyone can grab both transactions from the blockchain and submit them here.
        // Check whether unsignedTx1 != unsignedTx2, that both are signed by the same address,
        // and that unsignedTx1.nonce == unsignedTx2.nonce.
        // If all conditions are met, relay is considered an "offending relay".
        // The offending relay will be unregistered immediately, its stake will be forfeited and given
        // to the address who reported it (msg.sender), thus incentivizing anyone to report offending relays.
        // If reported via a relay, the forfeited stake is split between
        // msg.sender (the relay used for reporting) and the address that reported it.

        address addr1 = keccak256(unsignedTx1).recover(signature1);
        address addr2 = keccak256(unsignedTx2).recover(signature2);

        require(addr1 == addr2, "Different signer");
        require(addr1 != address(0), "ecrecover failed");

        Transaction memory decodedTx1 = decodeTransaction(unsignedTx1);
        Transaction memory decodedTx2 = decodeTransaction(unsignedTx2);

        // checking that the same nonce is used in both transaction, with both signed by the same address
        // and the actual data is different
        // note: we compare the hash of the tx to save gas over iterating both byte arrays
        require(decodedTx1.nonce == decodedTx2.nonce, "Different nonce");

        bytes memory dataToCheck1 =
        abi.encodePacked(decodedTx1.data, decodedTx1.gasLimit, decodedTx1.to, decodedTx1.value);

        bytes memory dataToCheck2 =
        abi.encodePacked(decodedTx2.data, decodedTx2.gasLimit, decodedTx2.to, decodedTx2.value);

        require(keccak256(dataToCheck1) != keccak256(dataToCheck2), "tx is equal");

        penalize(addr1, hub);
    }

    function penalizeIllegalTransaction(
        bytes calldata unsignedTx,
        bytes calldata signature,
        IRelayHub hub,
        uint256 randomValue
    )
    public
    override
    commitRevealOnly {
        (randomValue);
        _penalizeIllegalTransaction(unsignedTx, signature, hub);
    }

    function _penalizeIllegalTransaction(
        bytes calldata unsignedTx,
        bytes calldata signature,
        IRelayHub hub
    )
    private
    {
        if (isTransactionTypeValid(unsignedTx)) {
            Transaction memory decodedTx = decodeTransaction(unsignedTx);
            if (decodedTx.to == address(hub)) {
                bytes4 selector = GsnUtils.getMethodSig(decodedTx.data);
                bool isWrongMethodCall = selector != IRelayHub.relayCall.selector;
                bool isGasLimitWrong = GsnUtils.getParam(decodedTx.data, 4) != decodedTx.gasLimit;
                require(
                    isWrongMethodCall || isGasLimitWrong,
                    "Legal relay transaction");
            }
        }
        address relay = keccak256(unsignedTx).recover(signature);
        require(relay != address(0), "ecrecover failed");
        penalize(relay, hub);
    }

    function penalize(address relayWorker, IRelayHub hub) private {
        hub.penalize(relayWorker, msg.sender);
    }
}

File 6 of 41 : BatchForwarder.sol
// SPDX-License-Identifier:MIT
pragma solidity ^0.7.6;
pragma abicoder v2;

import "./forwarder/Forwarder.sol";
import "./BaseRelayRecipient.sol";
import "./utils/GsnUtils.sol";

/**
 * batch forwarder support calling a method sendBatch in the forwarder itself.
 * NOTE: the "target" of the request should be the BatchForwarder itself
 */
contract BatchForwarder is Forwarder, BaseRelayRecipient {

    string public override versionRecipient = "2.2.0+opengsn.batched.irelayrecipient";

    constructor() {
        //needed for sendBatch
        trustedForwarder = address(this);
    }

    function sendBatch(address[] calldata targets, bytes[] calldata encodedFunctions) external {
        require(targets.length == encodedFunctions.length, "BatchForwarder: wrong length");
        address sender = _msgSender();
        for (uint i = 0; i < targets.length; i++) {
            // solhint-disable-next-line avoid-low-level-calls
            (bool success, bytes memory ret) = targets[i].call(abi.encodePacked(encodedFunctions[i], sender));
            if (!success){
                //re-throw the revert with the same revert reason.
                GsnUtils.revertWithData(ret);
            }
        }
    }
}

File 7 of 41 : PayableWithEmit.sol
// SPDX-License-Identifier:MIT
pragma solidity ^0.7.6;
import "@opengsn/contracts/src/BaseRelayRecipient.sol";

//make sure that "payable" function that uses _msgSender() still works
// (its not required to use _msgSender(), since the default function
// will never be called through GSN, but still, if someone uses it,
// it should work)
contract PayableWithEmit is BaseRelayRecipient {

  string public override versionRecipient = "2.2.0+opengsn.payablewithemit.irelayrecipient";

  event Received(address sender, uint value, uint gasleft);

  receive () external payable {

    emit Received(_msgSender(), msg.value, gasleft());
  }


  //helper: send value to another contract
  function doSend(address payable target) public payable {

    uint before = gasleft();
    // solhint-disable-next-line check-send-result
    bool success = target.send(msg.value);
    uint gasAfter = gasleft();
    emit GasUsed(before-gasAfter, success);
  }
  event GasUsed(uint gasUsed, bool success);
}

File 8 of 41 : TestPaymasterConfigurableMisbehavior.sol
// SPDX-License-Identifier:MIT
pragma solidity ^0.7.6;
pragma abicoder v2;

import "./TestPaymasterEverythingAccepted.sol";

contract TestPaymasterConfigurableMisbehavior is TestPaymasterEverythingAccepted {

    bool public withdrawDuringPostRelayedCall;
    bool public withdrawDuringPreRelayedCall;
    bool public returnInvalidErrorCode;
    bool public revertPostRelayCall;
    bool public outOfGasPre;
    bool public revertPreRelayCall;
    bool public revertPreRelayCallOnEvenBlocks;
    bool public greedyAcceptanceBudget;
    bool public expensiveGasLimits;

    function setWithdrawDuringPostRelayedCall(bool val) public {
        withdrawDuringPostRelayedCall = val;
    }
    function setWithdrawDuringPreRelayedCall(bool val) public {
        withdrawDuringPreRelayedCall = val;
    }
    function setReturnInvalidErrorCode(bool val) public {
        returnInvalidErrorCode = val;
    }
    function setRevertPostRelayCall(bool val) public {
        revertPostRelayCall = val;
    }
    function setRevertPreRelayCall(bool val) public {
        revertPreRelayCall = val;
    }
    function setRevertPreRelayCallOnEvenBlocks(bool val) public {
        revertPreRelayCallOnEvenBlocks = val;
    }
    function setOutOfGasPre(bool val) public {
        outOfGasPre = val;
    }

    function setGreedyAcceptanceBudget(bool val) public {
        greedyAcceptanceBudget = val;
    }
    function setExpensiveGasLimits(bool val) public {
        expensiveGasLimits = val;
    }

    // solhint-disable reason-string
    // contains comments that are checked in tests
    function preRelayedCall(
        GsnTypes.RelayRequest calldata relayRequest,
        bytes calldata signature,
        bytes calldata approvalData,
        uint256 maxPossibleGas
    )
    external
    override
    relayHubOnly
    returns (bytes memory, bool) {
        (signature, approvalData, maxPossibleGas);
        if (outOfGasPre) {
            uint i = 0;
            while (true) {
                i++;
            }
        }

        require(!returnInvalidErrorCode, "invalid code");

        if (withdrawDuringPreRelayedCall) {
            withdrawAllBalance();
        }
        if (revertPreRelayCall) {
            revert("You asked me to revert, remember?");
        }
        if (revertPreRelayCallOnEvenBlocks && block.number % 2 == 0) {
            revert("You asked me to revert on even blocks, remember?");
        }
        _verifyForwarder(relayRequest);
        return ("", trustRecipientRevert);
    }

    function postRelayedCall(
        bytes calldata context,
        bool success,
        uint256 gasUseWithoutPost,
        GsnTypes.RelayData calldata relayData
    )
    external
    override
    relayHubOnly
    {
        (context, success, gasUseWithoutPost, relayData);
        if (withdrawDuringPostRelayedCall) {
            withdrawAllBalance();
        }
        if (revertPostRelayCall) {
            revert("You asked me to revert, remember?");
        }
    }

    /// leaving withdrawal public and unprotected
    function withdrawAllBalance() public returns (uint256) {
        require(address(relayHub) != address(0), "relay hub address not set");
        uint256 balance = relayHub.balanceOf(address(this));
        relayHub.withdraw(balance, address(this));
        return balance;
    }

    IPaymaster.GasAndDataLimits private limits = super.getGasAndDataLimits();

    function getGasAndDataLimits()
    public override view
    returns (IPaymaster.GasAndDataLimits memory) {

        if (expensiveGasLimits) {
            uint sum;
            //memory access is 700gas, so we waste ~50000
            for ( int i=0; i<60000; i+=700 ) {
                sum  = sum + limits.acceptanceBudget;
            }
        }
        if (greedyAcceptanceBudget) {
            return IPaymaster.GasAndDataLimits(limits.acceptanceBudget * 9, limits.preRelayedCallGasLimit, limits.postRelayedCallGasLimit,
            limits.calldataSizeLimit);
        }
        return limits;
    }

    bool private trustRecipientRevert;

    function setGasLimits(uint acceptanceBudget, uint preRelayedCallGasLimit, uint postRelayedCallGasLimit) public {
        limits = IPaymaster.GasAndDataLimits(
            acceptanceBudget,
            preRelayedCallGasLimit,
            postRelayedCallGasLimit,
            limits.calldataSizeLimit
        );
    }

    function setTrustRecipientRevert(bool on) public {
        trustRecipientRevert = on;
    }

    // solhint-disable-next-line no-empty-blocks
    receive() external override payable {}
}

File 9 of 41 : TestPaymasterEverythingAccepted.sol
// SPDX-License-Identifier:MIT
pragma solidity ^0.7.6;
pragma abicoder v2;

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

contract TestPaymasterEverythingAccepted is BasePaymaster {

    function versionPaymaster() external view override virtual returns (string memory){
        return "2.2.0+opengsn.test-pea.ipaymaster";
    }

    event SampleRecipientPreCall();
    event SampleRecipientPostCall(bool success, uint actualCharge);

    function preRelayedCall(
        GsnTypes.RelayRequest calldata relayRequest,
        bytes calldata signature,
        bytes calldata approvalData,
        uint256 maxPossibleGas
    )
    external
    override
    virtual
    returns (bytes memory, bool) {
        (signature);
        _verifyForwarder(relayRequest);
        (approvalData, maxPossibleGas);
        emit SampleRecipientPreCall();
        return ("no revert here",false);
    }

    function postRelayedCall(
        bytes calldata context,
        bool success,
        uint256 gasUseWithoutPost,
        GsnTypes.RelayData calldata relayData
    )
    external
    override
    virtual
    {
        (context, gasUseWithoutPost, relayData);
        emit SampleRecipientPostCall(success, gasUseWithoutPost);
    }

    function deposit() public payable {
        require(address(relayHub) != address(0), "relay hub address not set");
        relayHub.depositFor{value:msg.value}(address(this));
    }

    function withdrawAll(address payable destination) public {
        uint256 amount = relayHub.balanceOf(address(this));
        withdrawRelayHubDepositTo(amount, destination);
    }
}

File 10 of 41 : TestPaymasterOwnerSignature.sol
// SPDX-License-Identifier:MIT
pragma solidity ^0.7.6;
pragma abicoder v2;

import "@openzeppelin/contracts/cryptography/ECDSA.sol";

import "./TestPaymasterEverythingAccepted.sol";

contract TestPaymasterOwnerSignature is TestPaymasterEverythingAccepted {
    using ECDSA for bytes32;

    /**
     * This demonstrates how dapps can provide an off-chain signatures to relayed transactions.
     */
    function preRelayedCall(
        GsnTypes.RelayRequest calldata relayRequest,
        bytes calldata signature,
        bytes calldata approvalData,
        uint256 maxPossibleGas
    )
    external
    view
    override
    returns (bytes memory, bool) {
        (signature, maxPossibleGas);
        _verifyForwarder(relayRequest);

        address signer =
            keccak256(abi.encodePacked("I approve", relayRequest.request.from))
            .toEthSignedMessageHash()
            .recover(approvalData);
        require(signer == owner(), "test: not approved");
        return ("",false);
    }
}

File 11 of 41 : TestPaymasterPreconfiguredApproval.sol
// SPDX-License-Identifier:MIT
pragma solidity ^0.7.6;
pragma abicoder v2;

import "./TestPaymasterEverythingAccepted.sol";

contract TestPaymasterPreconfiguredApproval is TestPaymasterEverythingAccepted {

    bytes public expectedApprovalData;

    function setExpectedApprovalData(bytes memory val) public {
        expectedApprovalData = val;
    }

    function preRelayedCall(
        GsnTypes.RelayRequest calldata relayRequest,
        bytes calldata signature,
        bytes calldata approvalData,
        uint256 maxPossibleGas
    )
    external
    view
    override
    returns (bytes memory, bool) {
        (relayRequest, signature, approvalData, maxPossibleGas);
        _verifyForwarder(relayRequest);
        require(keccak256(expectedApprovalData) == keccak256(approvalData),
            string(abi.encodePacked(
                "test: unexpected approvalData: '", approvalData, "' instead of '", expectedApprovalData, "'")));
        return ("",false);
    }
}

File 12 of 41 : TestPaymasterStoreContext.sol
// SPDX-License-Identifier:MIT
pragma solidity ^0.7.6;
pragma abicoder v2;

import "./TestPaymasterEverythingAccepted.sol";

contract TestPaymasterStoreContext is TestPaymasterEverythingAccepted {

    event SampleRecipientPreCallWithValues(
        address relay,
        address from,
        bytes encodedFunction,
        uint256 baseRelayFee,
        uint256 pctRelayFee,
        uint256 gasPrice,
        uint256 gasLimit,
        bytes approvalData,
        uint256 maxPossibleGas
    );

    event SampleRecipientPostCallWithValues(
        string context
    );

    /**
     * This demonstrates how preRelayedCall can return 'context' data for reuse in postRelayedCall.
     */
    function preRelayedCall(
        GsnTypes.RelayRequest calldata relayRequest,
        bytes calldata signature,
        bytes calldata approvalData,
        uint256 maxPossibleGas
    )
    external
    override
    returns (bytes memory, bool) {
        (signature, approvalData, maxPossibleGas);
        _verifyForwarder(relayRequest);

        emit SampleRecipientPreCallWithValues(
            relayRequest.relayData.relayWorker,
            relayRequest.request.from,
            relayRequest.request.data,
            relayRequest.relayData.baseRelayFee,
            relayRequest.relayData.pctRelayFee,
            relayRequest.relayData.gasPrice,
            relayRequest.request.gas,
            approvalData,
            maxPossibleGas);
        return ("context passed from preRelayedCall to postRelayedCall",false);
    }

    function postRelayedCall(
        bytes calldata context,
        bool success,
        uint256 gasUseWithoutPost,
        GsnTypes.RelayData calldata relayData
    )
    external
    override
    relayHubOnly
    {
        (context, success, gasUseWithoutPost, relayData);
        emit SampleRecipientPostCallWithValues(string(context));
    }
}

File 13 of 41 : TestPaymasterVariableGasLimits.sol
// SPDX-License-Identifier:MIT
pragma solidity ^0.7.6;
pragma abicoder v2;

import "./TestPaymasterEverythingAccepted.sol";

contract TestPaymasterVariableGasLimits is TestPaymasterEverythingAccepted {

    string public override versionPaymaster = "2.2.0+opengsn.test-vgl.ipaymaster";

    event SampleRecipientPreCallWithValues(
        uint256 gasleft,
        uint256 maxPossibleGas
    );

    event SampleRecipientPostCallWithValues(
        uint256 gasleft,
        uint256 gasUseWithoutPost
    );

    function preRelayedCall(
        GsnTypes.RelayRequest calldata relayRequest,
        bytes calldata signature,
        bytes calldata approvalData,
        uint256 maxPossibleGas
    )
    external
    override
    returns (bytes memory, bool) {
        (signature, approvalData);
        _verifyForwarder(relayRequest);
        emit SampleRecipientPreCallWithValues(
            gasleft(), maxPossibleGas);
        return ("", false);
    }

    function postRelayedCall(
        bytes calldata context,
        bool success,
        uint256 gasUseWithoutPost,
        GsnTypes.RelayData calldata relayData
    )
    external
    override
    relayHubOnly
    {
        (context, success, gasUseWithoutPost, relayData);
        emit SampleRecipientPostCallWithValues(gasleft(), gasUseWithoutPost);
    }
}

File 14 of 41 : TestRecipient.sol
/* solhint-disable avoid-tx-origin */
// SPDX-License-Identifier:MIT
pragma solidity ^0.7.6;

import "../utils/GsnUtils.sol";
import "../BaseRelayRecipient.sol";
import "./TestPaymasterConfigurableMisbehavior.sol";

contract TestRecipient is BaseRelayRecipient {

    string public override versionRecipient = "2.2.0+opengsn.test.irelayrecipient";

    constructor(address forwarder) {
        setTrustedForwarder(forwarder);
    }

    function getTrustedForwarder() public view returns(address) {
        return trustedForwarder;
    }

    function setTrustedForwarder(address forwarder) internal {
        trustedForwarder = forwarder;
    }

    event Reverting(string message);

    function testRevert() public {
        require(address(this) == address(0), "always fail");
        emit Reverting("if you see this revert failed...");
    }

    address payable public paymaster;

    function setWithdrawDuringRelayedCall(address payable _paymaster) public {
        paymaster = _paymaster;
    }

    // solhint-disable-next-line no-empty-blocks
    receive() external payable {}

    event SampleRecipientEmitted(string message, address realSender, address msgSender, address origin, uint256 msgValue, uint256 gasLeft, uint256 balance);

    function emitMessage(string memory message) public payable returns (string memory) {
        uint256 gasLeft = gasleft();
        if (paymaster != address(0)) {
            withdrawAllBalance();
        }

        emit SampleRecipientEmitted(message, _msgSender(), msg.sender, tx.origin, msg.value, gasLeft, address(this).balance);
        return "emitMessage return value";
    }

    function withdrawAllBalance() public {
        TestPaymasterConfigurableMisbehavior(paymaster).withdrawAllBalance();
    }

    // solhint-disable-next-line no-empty-blocks
    function dontEmitMessage(string calldata message) public {}

    function emitMessageNoParams() public {
        emit SampleRecipientEmitted("Method with no parameters", _msgSender(), msg.sender, tx.origin, 0, gasleft(), address(this).balance);
    }

    //return (or revert) with a string in the given length
    function checkReturnValues(uint len, bool doRevert) public view returns (string memory) {
        (this);
        string memory mesg = "this is a long message that we are going to return a small part from. we don't use a loop since we want a fixed gas usage of the method itself.";
        require( bytes(mesg).length>=len, "invalid len: too large");

        /* solhint-disable no-inline-assembly */
        //cut the msg at that length
        assembly { mstore(mesg, len) }
        require(!doRevert, mesg);
        return mesg;
    }

    //function with no return value (also test revert with no msg.
    function checkNoReturnValues(bool doRevert) public view {
        (this);
        /* solhint-disable reason-string*/
        require(!doRevert);
    }

}

File 15 of 41 : TestRelayHubValidator.sol
// SPDX-License-Identifier:MIT
pragma solidity ^0.7.6;
pragma abicoder v2;

import "../utils/RelayHubValidator.sol";

contract TestRelayHubValidator {

    //for testing purposes, we must be called from a method with same param signature as RelayCall
    function dummyRelayCall(
        uint, //paymasterMaxAcceptanceBudget,
        GsnTypes.RelayRequest calldata relayRequest,
        bytes calldata signature,
        bytes calldata approvalData,
        uint //externalGasLimit
    ) external pure {
        RelayHubValidator.verifyTransactionPacking(relayRequest, signature, approvalData);
    }

    // helper method for verifyTransactionPacking
    function dynamicParamSize(bytes calldata buf) external pure returns (uint) {
        return RelayHubValidator.dynamicParamSize(buf);
    }
}

File 16 of 41 : TestRelayWorkerContract.sol
/* solhint-disable avoid-tx-origin */
// SPDX-License-Identifier:MIT
pragma solidity ^0.7.6;
pragma abicoder v2;

import "../interfaces/IRelayHub.sol";

contract TestRelayWorkerContract {

    function relayCall(
        IRelayHub hub,
        uint maxAcceptanceBudget,
        GsnTypes.RelayRequest memory relayRequest,
        bytes memory signature,
        uint externalGasLimit)
    public
    {
        hub.relayCall{gas:externalGasLimit}(maxAcceptanceBudget, relayRequest, signature, "", externalGasLimit);
    }
}

File 17 of 41 : TestUtil.sol
// SPDX-License-Identifier:MIT
pragma solidity ^0.7.6;
pragma abicoder v2;

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

contract TestUtil {

    function libRelayRequestName() public pure returns (string memory) {
        return GsnEip712Library.RELAY_REQUEST_NAME;
    }

    function libRelayRequestType() public pure returns (string memory) {
        return string(GsnEip712Library.RELAY_REQUEST_TYPE);
    }

    function libRelayRequestTypeHash() public pure returns (bytes32) {
        return GsnEip712Library.RELAY_REQUEST_TYPEHASH;
    }

    function libRelayRequestSuffix() public pure returns (string memory) {
        return GsnEip712Library.RELAY_REQUEST_SUFFIX;
    }

    //helpers for test to call the library funcs:
    function callForwarderVerify(
        GsnTypes.RelayRequest calldata relayRequest,
        bytes calldata signature
    )
    external
    view {
        GsnEip712Library.verify(relayRequest, signature);
    }

    function callForwarderVerifyAndCall(
        GsnTypes.RelayRequest calldata relayRequest,
        bytes calldata signature
    )
    external
    returns (
        bool success,
        bytes memory ret
    ) {
        bool forwarderSuccess;
        (forwarderSuccess, success, ret) = GsnEip712Library.execute(relayRequest, signature);
        if ( !forwarderSuccess) {
            GsnUtils.revertWithData(ret);
        }
        emit Called(success, success == false ? ret : bytes(""));
    }

    event Called(bool success, bytes error);

    function splitRequest(
        GsnTypes.RelayRequest calldata relayRequest
    )
    external
    pure
    returns (
        bytes32 typeHash,
        bytes memory suffixData
    ) {
        (suffixData) = GsnEip712Library.splitRequest(relayRequest);
        typeHash = GsnEip712Library.RELAY_REQUEST_TYPEHASH;
    }

    function libDomainSeparator(address forwarder) public pure returns (bytes32) {
        return GsnEip712Library.domainSeparator(forwarder);
    }

    function libGetChainID() public pure returns (uint256) {
        return GsnEip712Library.getChainID();
    }
}

File 18 of 41 : GsnEip712Library.sol
// SPDX-License-Identifier:MIT
pragma solidity >=0.7.6;
pragma abicoder v2;

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

import "./GsnUtils.sol";

/**
 * Bridge Library to map GSN RelayRequest into a call of 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 validUntil";

    bytes public constant RELAYDATA_TYPE = "RelayData(uint256 gasPrice,uint256 pctRelayFee,uint256 baseRelayFee,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(
                IRelayRecipient.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 pure returns (bytes32) {
        return hashDomain(EIP712Domain({
            name : "GSN Relayed Transaction",
            version : "2",
            chainId : getChainID(),
            verifyingContract : forwarder
            }));
    }

    function getChainID() internal pure 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.gasPrice,
                req.pctRelayFee,
                req.baseRelayFee,
                req.relayWorker,
                req.paymaster,
                req.forwarder,
                keccak256(req.paymasterData),
                req.clientId
            ));
    }
}

File 19 of 41 : GsnUtils.sol
/* solhint-disable no-inline-assembly */
// SPDX-License-Identifier:MIT
pragma solidity >=0.7.6;

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

library GsnUtils {

    /**
     * extract method sig from encoded function call
     */
    function getMethodSig(bytes memory msgData) internal pure returns (bytes4) {
        return MinLibBytes.readBytes4(msgData, 0);
    }

    /**
     * extract 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)
     */
    function getParam(bytes memory msgData, uint index) internal pure returns (uint) {
        return MinLibBytes.readUint256(msgData, 4 + index * 32);
    }

    //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 41 : MinLibBytes.sol
// SPDX-License-Identifier: MIT
// minimal bytes manipulation required by GSN
// a minimal subset from 0x/LibBytes
/* solhint-disable no-inline-assembly */
pragma solidity >=0.7.6;

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 41 : RLPReader.sol
// SPDX-License-Identifier:APACHE-2.0
/*
* Taken from https://github.com/hamdiallam/Solidity-RLP
*/
/* solhint-disable */
pragma solidity ^0.7.6;

library RLPReader {

    uint8 constant STRING_SHORT_START = 0x80;
    uint8 constant STRING_LONG_START = 0xb8;
    uint8 constant LIST_SHORT_START = 0xc0;
    uint8 constant LIST_LONG_START = 0xf8;
    uint8 constant WORD_SIZE = 32;

    struct RLPItem {
        uint len;
        uint memPtr;
    }

    using RLPReader for bytes;
    using RLPReader for uint;
    using RLPReader for RLPReader.RLPItem;

    // helper function to decode rlp encoded legacy ethereum transaction
    /*
    * @param rawTransaction RLP encoded legacy ethereum transaction rlp([nonce, gasPrice, gasLimit, to, value, data]))
    * @return tuple (nonce,gasPrice,gasLimit,to,value,data)
    */

    function decodeLegacyTransaction(bytes calldata rawTransaction) internal pure returns (uint, uint, uint, address, uint, bytes memory){
        RLPReader.RLPItem[] memory values = rawTransaction.toRlpItem().toList(); // must convert to an rlpItem first!
        return (values[0].toUint(), values[1].toUint(), values[2].toUint(), values[3].toAddress(), values[4].toUint(), values[5].toBytes());
    }

    /*
    * @param rawTransaction format: 0x01 || rlp([chainId, nonce, gasPrice, gasLimit, to, value, data, access_list]))
    * @return tuple (nonce,gasPrice,gasLimit,to,value,data)
    */
    function decodeTransactionType1(bytes calldata rawTransaction) internal pure returns (uint, uint, uint, address, uint, bytes memory){
        bytes memory payload = rawTransaction[1:rawTransaction.length];
        RLPReader.RLPItem[] memory values = payload.toRlpItem().toList(); // must convert to an rlpItem first!
        return (values[1].toUint(), values[2].toUint(), values[3].toUint(), values[4].toAddress(), values[5].toUint(), values[6].toBytes());
    }

    /*
    * @param item RLP encoded bytes
    */
    function toRlpItem(bytes memory item) internal pure returns (RLPItem memory) {
        if (item.length == 0)
            return RLPItem(0, 0);
        uint memPtr;
        assembly {
            memPtr := add(item, 0x20)
        }
        return RLPItem(item.length, memPtr);
    }
    /*
    * @param item RLP encoded list in bytes
    */
    function toList(RLPItem memory item) internal pure returns (RLPItem[] memory result) {
        require(isList(item), "isList failed");
        uint items = numItems(item);
        result = new RLPItem[](items);
        uint memPtr = item.memPtr + _payloadOffset(item.memPtr);
        uint dataLen;
        for (uint i = 0; i < items; i++) {
            dataLen = _itemLength(memPtr);
            result[i] = RLPItem(dataLen, memPtr);
            memPtr = memPtr + dataLen;
        }
    }
    /*
    * Helpers
    */
    // @return indicator whether encoded payload is a list. negate this function call for isData.
    function isList(RLPItem memory item) internal pure returns (bool) {
        uint8 byte0;
        uint memPtr = item.memPtr;
        assembly {
            byte0 := byte(0, mload(memPtr))
        }
        if (byte0 < LIST_SHORT_START)
            return false;
        return true;
    }
    // @return number of payload items inside an encoded list.
    function numItems(RLPItem memory item) internal pure returns (uint) {
        uint count = 0;
        uint currPtr = item.memPtr + _payloadOffset(item.memPtr);
        uint endPtr = item.memPtr + item.len;
        while (currPtr < endPtr) {
            currPtr = currPtr + _itemLength(currPtr);
            // skip over an item
            count++;
        }
        return count;
    }
    // @return entire rlp item byte length
    function _itemLength(uint memPtr) internal pure returns (uint len) {
        uint byte0;
        assembly {
            byte0 := byte(0, mload(memPtr))
        }
        if (byte0 < STRING_SHORT_START)
            return 1;
        else if (byte0 < STRING_LONG_START)
            return byte0 - STRING_SHORT_START + 1;
        else if (byte0 < LIST_SHORT_START) {
            assembly {
                let byteLen := sub(byte0, 0xb7) // # of bytes the actual length is
                memPtr := add(memPtr, 1) // skip over the first byte
            /* 32 byte word size */
                let dataLen := div(mload(memPtr), exp(256, sub(32, byteLen))) // right shifting to get the len
                len := add(dataLen, add(byteLen, 1))
            }
        }
        else if (byte0 < LIST_LONG_START) {
            return byte0 - LIST_SHORT_START + 1;
        }
        else {
            assembly {
                let byteLen := sub(byte0, 0xf7)
                memPtr := add(memPtr, 1)
                let dataLen := div(mload(memPtr), exp(256, sub(32, byteLen))) // right shifting to the correct length
                len := add(dataLen, add(byteLen, 1))
            }
        }
    }
    // @return number of bytes until the data
    function _payloadOffset(uint memPtr) internal pure returns (uint) {
        uint byte0;
        assembly {
            byte0 := byte(0, mload(memPtr))
        }
        if (byte0 < STRING_SHORT_START)
            return 0;
        else if (byte0 < STRING_LONG_START || (byte0 >= LIST_SHORT_START && byte0 < LIST_LONG_START))
            return 1;
        else if (byte0 < LIST_SHORT_START)  // being explicit
            return byte0 - (STRING_LONG_START - 1) + 1;
        else
            return byte0 - (LIST_LONG_START - 1) + 1;
    }
    /** RLPItem conversions into data types **/
    // @returns raw rlp encoding in bytes
    function toRlpBytes(RLPItem memory item) internal pure returns (bytes memory) {
        bytes memory result = new bytes(item.len);
        uint ptr;
        assembly {
            ptr := add(0x20, result)
        }
        copy(item.memPtr, ptr, item.len);
        return result;
    }

    function toBoolean(RLPItem memory item) internal pure returns (bool) {
        require(item.len == 1, "Invalid RLPItem. Booleans are encoded in 1 byte");
        uint result;
        uint memPtr = item.memPtr;
        assembly {
            result := byte(0, mload(memPtr))
        }
        return result == 0 ? false : true;
    }

    function toAddress(RLPItem memory item) internal pure returns (address) {
        // 1 byte for the length prefix according to RLP spec
        require(item.len <= 21, "Invalid RLPItem. Addresses are encoded in 20 bytes or less");
        return address(toUint(item));
    }

    function toUint(RLPItem memory item) internal pure returns (uint) {
        uint offset = _payloadOffset(item.memPtr);
        uint len = item.len - offset;
        uint memPtr = item.memPtr + offset;
        uint result;
        assembly {
            result := div(mload(memPtr), exp(256, sub(32, len))) // shift to the correct location
        }
        return result;
    }

    function toBytes(RLPItem memory item) internal pure returns (bytes memory) {
        uint offset = _payloadOffset(item.memPtr);
        uint len = item.len - offset;
        // data length
        bytes memory result = new bytes(len);
        uint destPtr;
        assembly {
            destPtr := add(0x20, result)
        }
        copy(item.memPtr + offset, destPtr, len);
        return result;
    }
    /*
    * @param src Pointer to source
    * @param dest Pointer to destination
    * @param len Amount of memory to copy from the source
    */
    function copy(uint src, uint dest, uint len) internal pure {
        // copy as many word sizes as possible
        for (; len >= WORD_SIZE; len -= WORD_SIZE) {
            assembly {
                mstore(dest, mload(src))
            }
            src += WORD_SIZE;
            dest += WORD_SIZE;
        }
        // left over bytes. Mask is used to remove unwanted bytes from the word
        uint mask = 256 ** (WORD_SIZE - len) - 1;
        assembly {
            let srcpart := and(mload(src), not(mask)) // zero out src
            let destpart := and(mload(dest), mask) // retrieve the bytes
            mstore(dest, or(destpart, srcpart))
        }
    }
}

File 22 of 41 : VersionRegistry.sol
// SPDX-License-Identifier:MIT
pragma solidity ^0.7.6;
// solhint-disable not-rely-on-time

import "../interfaces/IVersionRegistry.sol";
import "@openzeppelin/contracts/access/Ownable.sol";

contract VersionRegistry is IVersionRegistry, Ownable {

    function addVersion(bytes32 id, bytes32 version, string calldata value) external override onlyOwner {
        require(id != bytes32(0), "missing id");
        require(version != bytes32(0), "missing version");
        emit VersionAdded(id, version, value, block.timestamp);
    }

    function cancelVersion(bytes32 id, bytes32 version, string calldata reason) external override onlyOwner {
        emit VersionCanceled(id, version, reason);
    }
}

File 23 of 41 : Forwarder.sol
// SPDX-License-Identifier:MIT
pragma solidity ^0.7.6;
pragma abicoder v2;

import "@openzeppelin/contracts/cryptography/ECDSA.sol";
import "./IForwarder.sol";

contract Forwarder is IForwarder {
    using ECDSA for bytes32;

    string public constant GENERIC_PARAMS = "address from,address to,uint256 value,uint256 gas,uint256 nonce,bytes data,uint256 validUntil";

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

    mapping(bytes32 => bool) public typeHashes;
    mapping(bytes32 => bool) public domains;

    // Nonces of senders, used to prevent replay attacks
    mapping(address => uint256) private nonces;

    // solhint-disable-next-line no-empty-blocks
    receive() external payable {}

    function getNonce(address from)
    public view override
    returns (uint256) {
        return nonces[from];
    }

    constructor() {

        string memory requestType = string(abi.encodePacked("ForwardRequest(", GENERIC_PARAMS, ")"));
        registerRequestTypeInternal(requestType);
    }

    function verify(
        ForwardRequest calldata req,
        bytes32 domainSeparator,
        bytes32 requestTypeHash,
        bytes calldata suffixData,
        bytes calldata sig)
    external override view {

        _verifyNonce(req);
        _verifySig(req, domainSeparator, requestTypeHash, suffixData, sig);
    }

    function execute(
        ForwardRequest calldata req,
        bytes32 domainSeparator,
        bytes32 requestTypeHash,
        bytes calldata suffixData,
        bytes calldata sig
    )
    external payable
    override
    returns (bool success, bytes memory ret) {
        _verifySig(req, domainSeparator, requestTypeHash, suffixData, sig);
        _verifyAndUpdateNonce(req);

        require(req.validUntil == 0 || req.validUntil > block.number, "FWD: request expired");

        uint gasForTransfer = 0;
        if ( req.value != 0 ) {
            gasForTransfer = 40000; //buffer in case we need to move eth after the transaction.
        }
        bytes memory callData = abi.encodePacked(req.data, req.from);
        require(gasleft()*63/64 >= req.gas + gasForTransfer, "FWD: insufficient gas");
        // solhint-disable-next-line avoid-low-level-calls
        (success,ret) = req.to.call{gas : req.gas, value : req.value}(callData);
        if ( req.value != 0 && address(this).balance>0 ) {
            // can't fail: req.from signed (off-chain) the request, so it must be an EOA...
            payable(req.from).transfer(address(this).balance);
        }

        return (success,ret);
    }


    function _verifyNonce(ForwardRequest calldata req) internal view {
        require(nonces[req.from] == req.nonce, "FWD: nonce mismatch");
    }

    function _verifyAndUpdateNonce(ForwardRequest calldata req) internal {
        require(nonces[req.from]++ == req.nonce, "FWD: nonce mismatch");
    }

    function registerRequestType(string calldata typeName, string calldata typeSuffix) external override {

        for (uint i = 0; i < bytes(typeName).length; i++) {
            bytes1 c = bytes(typeName)[i];
            require(c != "(" && c != ")", "FWD: invalid typename");
        }

        string memory requestType = string(abi.encodePacked(typeName, "(", GENERIC_PARAMS, ",", typeSuffix));
        registerRequestTypeInternal(requestType);
    }

    function registerDomainSeparator(string calldata name, string calldata version) external override {
        uint256 chainId;
        /* solhint-disable-next-line no-inline-assembly */
        assembly { chainId := chainid() }

        bytes memory domainValue = abi.encode(
            keccak256(bytes(EIP712_DOMAIN_TYPE)),
            keccak256(bytes(name)),
            keccak256(bytes(version)),
            chainId,
            address(this));

        bytes32 domainHash = keccak256(domainValue);

        domains[domainHash] = true;
        emit DomainRegistered(domainHash, domainValue);
    }

    function registerRequestTypeInternal(string memory requestType) internal {

        bytes32 requestTypehash = keccak256(bytes(requestType));
        typeHashes[requestTypehash] = true;
        emit RequestTypeRegistered(requestTypehash, requestType);
    }

    function _verifySig(
        ForwardRequest calldata req,
        bytes32 domainSeparator,
        bytes32 requestTypeHash,
        bytes calldata suffixData,
        bytes calldata sig)
    internal
    view
    {
        require(domains[domainSeparator], "FWD: unregistered domain sep.");
        require(typeHashes[requestTypeHash], "FWD: unregistered typehash");
        bytes32 digest = keccak256(abi.encodePacked(
                "\x19\x01", domainSeparator,
                keccak256(_getEncoded(req, requestTypeHash, suffixData))
            ));
        require(digest.recover(sig) == req.from, "FWD: signature mismatch");
    }

    function _getEncoded(
        ForwardRequest calldata req,
        bytes32 requestTypeHash,
        bytes calldata suffixData
    )
    public
    pure
    returns (
        bytes memory
    ) {
        // we use encodePacked since we append suffixData as-is, not as dynamic param.
        // still, we must make sure all first params are encoded as abi.encode()
        // would encode them - as 256-bit-wide params.
        return abi.encodePacked(
            requestTypeHash,
            uint256(uint160(req.from)),
            uint256(uint160(req.to)),
            req.value,
            req.gas,
            req.nonce,
            keccak256(req.data),
            req.validUntil,
            suffixData
        );
    }
}

File 24 of 41 : TestForwarder.sol
// SPDX-License-Identifier:MIT
pragma solidity ^0.7.6;
pragma abicoder v2;

import "../Forwarder.sol";

// helper class for testing the forwarder.
contract TestForwarder {
    function callExecute(Forwarder forwarder, Forwarder.ForwardRequest memory req,
        bytes32 domainSeparator, bytes32 requestTypeHash, bytes memory suffixData, bytes memory sig) public payable {
        (bool success, bytes memory error) = forwarder.execute{value:msg.value}(req, domainSeparator, requestTypeHash, suffixData, sig);
        emit Result(success, success ? "" : this.decodeErrorMessage(error));
    }

    event Result(bool success, string error);

    function decodeErrorMessage(bytes calldata ret) external pure returns (string memory message) {
        //decode evert string: assume it has a standard Error(string) signature: simply skip the (selector,offset,length) fields
        if ( ret.length>4+32+32 ) {
            return abi.decode(ret[4:], (string));
        }
        //unknown buffer. return as-is
        return string(ret);
    }

    function getChainId() public pure returns (uint256 id){
        /* solhint-disable-next-line no-inline-assembly */
        assembly { id := chainid() }
    }
}

File 25 of 41 : TestForwarderTarget.sol
// SPDX-License-Identifier:MIT
pragma solidity ^0.7.6;

import "../../BaseRelayRecipient.sol";

contract TestForwarderTarget is BaseRelayRecipient {

    string public override versionRecipient = "2.2.0+opengsn.test.recipient";

    constructor(address forwarder) {
        trustedForwarder = forwarder;
    }

    // solhint-disable-next-line no-empty-blocks
    receive() external payable {}

    event TestForwarderMessage(string message, bytes realMsgData, address realSender, address msgSender, address origin);

    function emitMessage(string memory message) public {

        // solhint-disable-next-line avoid-tx-origin
        emit TestForwarderMessage(message, _msgData(), _msgSender(), msg.sender, tx.origin);
    }

    function publicMsgSender() public view returns (address) {
        return _msgSender();
    }

    function publicMsgData() public view returns (bytes memory) {
        return _msgData();
    }

    function mustReceiveEth(uint value) public payable {
        require( msg.value == value, "didn't receive value");
    }

    event Reverting(string message);

    function testRevert() public {
        require(address(this) == address(0), "always fail");
        emit Reverting("if you see this revert failed...");
    }
}

File 26 of 41 : SafeMath.sol
// SPDX-License-Identifier: MIT

pragma solidity >=0.6.0 <0.8.0;

/**
 * @dev Wrappers over Solidity's arithmetic operations with added overflow
 * checks.
 *
 * Arithmetic operations in Solidity wrap on overflow. This can easily result
 * in bugs, because programmers usually assume that an overflow raises an
 * error, which is the standard behavior in high level programming languages.
 * `SafeMath` restores this intuition by reverting the transaction when an
 * operation overflows.
 *
 * Using this library instead of the unchecked operations eliminates an entire
 * class of bugs, so it's recommended to use it always.
 */
library SafeMath {
    /**
     * @dev Returns the addition of two unsigned integers, with an overflow flag.
     *
     * _Available since v3.4._
     */
    function tryAdd(uint256 a, uint256 b) internal pure returns (bool, uint256) {
        uint256 c = a + b;
        if (c < a) return (false, 0);
        return (true, c);
    }

    /**
     * @dev Returns the substraction of two unsigned integers, with an overflow flag.
     *
     * _Available since v3.4._
     */
    function trySub(uint256 a, uint256 b) internal pure returns (bool, uint256) {
        if (b > a) return (false, 0);
        return (true, a - b);
    }

    /**
     * @dev Returns the multiplication of two unsigned integers, with an overflow flag.
     *
     * _Available since v3.4._
     */
    function tryMul(uint256 a, uint256 b) internal pure returns (bool, uint256) {
        // Gas optimization: this is cheaper than requiring 'a' not being zero, but the
        // benefit is lost if 'b' is also tested.
        // See: https://github.com/OpenZeppelin/openzeppelin-contracts/pull/522
        if (a == 0) return (true, 0);
        uint256 c = a * b;
        if (c / a != b) return (false, 0);
        return (true, c);
    }

    /**
     * @dev Returns the division of two unsigned integers, with a division by zero flag.
     *
     * _Available since v3.4._
     */
    function tryDiv(uint256 a, uint256 b) internal pure returns (bool, uint256) {
        if (b == 0) return (false, 0);
        return (true, a / b);
    }

    /**
     * @dev Returns the remainder of dividing two unsigned integers, with a division by zero flag.
     *
     * _Available since v3.4._
     */
    function tryMod(uint256 a, uint256 b) internal pure returns (bool, uint256) {
        if (b == 0) return (false, 0);
        return (true, a % b);
    }

    /**
     * @dev Returns the addition of two unsigned integers, reverting on
     * overflow.
     *
     * Counterpart to Solidity's `+` operator.
     *
     * Requirements:
     *
     * - Addition cannot overflow.
     */
    function add(uint256 a, uint256 b) internal pure returns (uint256) {
        uint256 c = a + b;
        require(c >= a, "SafeMath: addition overflow");
        return c;
    }

    /**
     * @dev Returns the subtraction of two unsigned integers, reverting on
     * overflow (when the result is negative).
     *
     * Counterpart to Solidity's `-` operator.
     *
     * Requirements:
     *
     * - Subtraction cannot overflow.
     */
    function sub(uint256 a, uint256 b) internal pure returns (uint256) {
        require(b <= a, "SafeMath: subtraction overflow");
        return a - b;
    }

    /**
     * @dev Returns the multiplication of two unsigned integers, reverting on
     * overflow.
     *
     * Counterpart to Solidity's `*` operator.
     *
     * Requirements:
     *
     * - Multiplication cannot overflow.
     */
    function mul(uint256 a, uint256 b) internal pure returns (uint256) {
        if (a == 0) return 0;
        uint256 c = a * b;
        require(c / a == b, "SafeMath: multiplication overflow");
        return c;
    }

    /**
     * @dev Returns the integer division of two unsigned integers, reverting on
     * division by zero. The result is rounded towards zero.
     *
     * Counterpart to Solidity's `/` operator. Note: this function uses a
     * `revert` opcode (which leaves remaining gas untouched) while Solidity
     * uses an invalid opcode to revert (consuming all remaining gas).
     *
     * Requirements:
     *
     * - The divisor cannot be zero.
     */
    function div(uint256 a, uint256 b) internal pure returns (uint256) {
        require(b > 0, "SafeMath: division by zero");
        return a / b;
    }

    /**
     * @dev Returns the remainder of dividing two unsigned integers. (unsigned integer modulo),
     * reverting when dividing by zero.
     *
     * Counterpart to Solidity's `%` operator. This function uses a `revert`
     * opcode (which leaves remaining gas untouched) while Solidity uses an
     * invalid opcode to revert (consuming all remaining gas).
     *
     * Requirements:
     *
     * - The divisor cannot be zero.
     */
    function mod(uint256 a, uint256 b) internal pure returns (uint256) {
        require(b > 0, "SafeMath: modulo by zero");
        return a % b;
    }

    /**
     * @dev Returns the subtraction of two unsigned integers, reverting with custom message on
     * overflow (when the result is negative).
     *
     * CAUTION: This function is deprecated because it requires allocating memory for the error
     * message unnecessarily. For custom revert reasons use {trySub}.
     *
     * Counterpart to Solidity's `-` operator.
     *
     * Requirements:
     *
     * - Subtraction cannot overflow.
     */
    function sub(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {
        require(b <= a, errorMessage);
        return a - b;
    }

    /**
     * @dev Returns the integer division of two unsigned integers, reverting with custom message on
     * division by zero. The result is rounded towards zero.
     *
     * CAUTION: This function is deprecated because it requires allocating memory for the error
     * message unnecessarily. For custom revert reasons use {tryDiv}.
     *
     * Counterpart to Solidity's `/` operator. Note: this function uses a
     * `revert` opcode (which leaves remaining gas untouched) while Solidity
     * uses an invalid opcode to revert (consuming all remaining gas).
     *
     * Requirements:
     *
     * - The divisor cannot be zero.
     */
    function div(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {
        require(b > 0, errorMessage);
        return a / b;
    }

    /**
     * @dev Returns the remainder of dividing two unsigned integers. (unsigned integer modulo),
     * reverting with custom message when dividing by zero.
     *
     * CAUTION: This function is deprecated because it requires allocating memory for the error
     * message unnecessarily. For custom revert reasons use {tryMod}.
     *
     * Counterpart to Solidity's `%` operator. This function uses a `revert`
     * opcode (which leaves remaining gas untouched) while Solidity uses an
     * invalid opcode to revert (consuming all remaining gas).
     *
     * Requirements:
     *
     * - The divisor cannot be zero.
     */
    function mod(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {
        require(b > 0, errorMessage);
        return a % b;
    }
}

File 27 of 41 : Ownable.sol
// SPDX-License-Identifier: MIT

pragma solidity >=0.6.0 <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 () /*internal*/ {
        address msgSender = _msgSender();
        _owner = msgSender;
        emit OwnershipTransferred(address(0), 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 {
        emit OwnershipTransferred(_owner, address(0));
        _owner = 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");
        emit OwnershipTransferred(_owner, newOwner);
        _owner = newOwner;
    }
}

File 28 of 41 : RelayHubValidator.sol
// SPDX-License-Identifier:MIT
pragma solidity ^0.7.5;
pragma abicoder v2;

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

library RelayHubValidator {

    // 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 22 32-byte words if all dynamic params are zero-length.
        uint expectedMsgDataLen = 4 + 22 * 32 +
            dynamicParamSize(signature) +
            dynamicParamSize(approvalData) +
            dynamicParamSize(relayRequest.request.data) +
            dynamicParamSize(relayRequest.relayData.paymasterData);
        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 (uint) {
        return 32 + ((buf.length + 31) & uint(~31));
    }
}

File 29 of 41 : GsnTypes.sol
// SPDX-License-Identifier:MIT
pragma solidity >=0.7.6;

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

interface GsnTypes {
    /// @notice gasPrice, pctRelayFee and baseRelayFee must be validated inside of the paymaster's preRelayedCall in order not to overpay
    struct RelayData {
        uint256 gasPrice;
        uint256 pctRelayFee;
        uint256 baseRelayFee;
        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 30 of 41 : IRelayHub.sol
// SPDX-License-Identifier:MIT
pragma solidity >=0.7.6;
pragma abicoder v2;

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

interface IRelayHub {
    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;
        // Maximum funds that can be deposited at once. Prevents user error by disallowing large deposits.
        uint256 maximumRecipientDeposit;
        // Minimum unstake delay blocks of a relay manager's stake on the StakeManager
        uint256 minimumUnstakeDelay;
        // Minimum stake a relay can have. An attack on the network will never cost less than half this value.
        uint256 minimumStake;
        // relayCall()'s msg.data upper bound gas cost per byte
        uint256 dataGasCostPerByte;
        // relayCalls() minimal gas overhead when calculating cost of putting tx on chain.
        uint256 externalCallDataCostOverhead;
    }

    event RelayHubConfigured(RelayHubConfig config);

    /// Emitted when a relay server registers or updates its details
    /// Looking at these events lets a client discover relay servers
    event RelayServerRegistered(
        address indexed relayManager,
        uint256 baseRelayFee,
        uint256 pctRelayFee,
        string relayUrl
    );

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

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

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

    /// Emitted when an attempt to relay a call fails and 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,
        address indexed from,
        address to,
        address relayWorker,
        bytes4 selector,
        uint256 innerGasUsed,
        bytes reason
    );

    /// Emitted when a transaction is relayed. Note that the actual encoded function might be reverted: this will be
    /// indicated in the status field.
    /// Useful when monitoring a relay's operation and relayed calls to a contract.
    /// Charge is the ether value deducted from the recipient's balance, paid to the relay's manager.
    event TransactionRelayed(
        address indexed relayManager,
        address indexed relayWorker,
        address indexed from,
        address to,
        address paymaster,
        bytes4 selector,
        RelayCallStatus status,
        uint256 charge
    );

    event TransactionResult(
        RelayCallStatus status,
        bytes returnValue
    );

    event HubDeprecated(uint256 fromBlock);

    /// Reason error codes for the TransactionRelayed event
    /// @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
    }

    /// Add new worker addresses controlled by 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;

    function registerRelayServer(uint256 baseRelayFee, uint256 pctRelayFee, string calldata url) external;

    // Balance management

    /// Deposits ether for a contract, so that it can receive (and pay for) relayed transactions. Unused balance can only
    /// be withdrawn by the contract itself, by calling withdraw.
    /// Emits a Deposited event.
    function depositFor(address target) external payable;

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

    // Relaying


    /// Relays a transaction. For this to succeed, multiple conditions must be met:
    ///  - Paymaster's "preRelayCall" method must succeed and not revert
    ///  - the sender must be a registered Relay Worker that the user signed
    ///  - the transaction's gas price must be equal or larger than the one that was 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 for the scenario when all gas is spent
    ///
    /// If all conditions are met, the call will be relayed and the recipient charged.
    ///
    /// Arguments:
    /// @param maxAcceptanceBudget - max valid value for paymaster.getGasLimits().acceptanceBudget
    /// @param relayRequest - all details of the requested relayed call
    /// @param signature - client's EIP-712 signature over the relayRequest struct
    /// @param approvalData: dapp-specific data forwarded to preRelayedCall.
    ///        This value is *not* verified by the Hub. For example, it can be used to pass a signature to the Paymaster
    /// @param externalGasLimit - the value passed as gasLimit to the transaction.
    ///
    /// Emits a TransactionRelayed event.
    function relayCall(
        uint maxAcceptanceBudget,
        GsnTypes.RelayRequest calldata relayRequest,
        bytes calldata signature,
        bytes calldata approvalData,
        uint externalGasLimit
    )
    external
    returns (bool paymasterAccepted, bytes memory returnValue);

    function penalize(address relayWorker, address payable beneficiary) external;

    function setConfiguration(RelayHubConfig memory _config) external;

    // Deprecate hub (reverting relayCall()) from block number 'fromBlock'
    // Can only be called by owner
    function deprecateHub(uint256 fromBlock) external;

    /// The fee is expressed as a base fee in wei plus percentage on actual charge.
    /// E.g. a value of 40 stands for a 40% fee, so the recipient will be
    /// charged for 1.4 times the spent amount.
    function calculateCharge(uint256 gasUsed, GsnTypes.RelayData calldata relayData) external view returns (uint256);

    /* getters */

    /// Returns the whole hub configuration
    function getConfiguration() external view returns (RelayHubConfig memory config);

    function calldataGasCost(uint256 length) external view returns (uint256);

    function workerToManager(address worker) external view returns(address);

    function workerCount(address manager) external view returns(uint256);

    /// Returns an account's deposits. It can be either a deposit of a paymaster, or a revenue of a relay manager.
    function balanceOf(address target) external view returns (uint256);

    function stakeManager() external view returns (IStakeManager);

    function penalizer() external view returns (address);

    /// Uses StakeManager info to decide if the Relay Manager can be considered staked
    /// @return true if stake size and delay satisfy all requirements
    function isRelayManagerStaked(address relayManager) external view returns(bool);

    // Checks hubs' deprecation status
    function isDeprecated() external view returns (bool);

    // Returns the block number from which the hub no longer allows relaying calls.
    function deprecationBlock() external view returns (uint256);

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

File 31 of 41 : IPaymaster.sol
// SPDX-License-Identifier:MIT
pragma solidity >=0.7.6;
pragma abicoder v2;

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

interface IPaymaster {

    /**
     * @param acceptanceBudget -
     *      Paymaster expected gas budget to accept (or reject) a request
     *      This a gas required by any calculations that might need to reject the
     *      transaction, by preRelayedCall, forwarder and recipient.
     *      See value in BasePaymaster.PAYMASTER_ACCEPTANCE_BUDGET
     *      Transaction that gets rejected above that gas usage is on the paymaster's expense.
     *      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 preRelayedCallGasLimt, it might might make Paymaster open to a "griefing" attack.
     *
     *      Specifying value too high might make the call rejected by some relayers.
     *
     *      From a Relay's point of view, this is the highest gas value a paymaster might "grief" the relay,
     *      since the paymaster will pay anything above that (regardless if the tx reverts)
     *
     * @param preRelayedCallGasLimit - the max gas usage of preRelayedCall. any revert (including OOG)
     *      of preRelayedCall is a reject by the paymaster.
     *      as long as acceptanceBudget is above preRelayedCallGasLimit, any such revert (including OOG)
     *      is not payed by the paymaster.
     * @param postRelayedCallGasLimit - the max gas usage of postRelayedCall.
     *      note that an OOG will revert the transaction, but the paymaster already committed to pay,
     *      so the relay will get compensated, at the expense of the paymaster
     */
    struct GasAndDataLimits {
        uint256 acceptanceBudget;
        uint256 preRelayedCallGasLimit;
        uint256 postRelayedCallGasLimit;
        uint256 calldataSizeLimit;
    }

    /**
     * Return the Gas Limits and msg.data max size constants used by the Paymaster.
     */
    function getGasAndDataLimits()
    external
    view
    returns (
        GasAndDataLimits memory limits
    );

    function trustedForwarder() external view returns (IForwarder);

/**
 * return the relayHub of this contract.
 */
    function getHubAddr() external view returns (address);

    /**
     * Can be used to determine if the contract can pay for incoming calls before making any.
     * @return the paymaster's deposit in the RelayHub.
     */
    function getRelayHubDeposit() external view returns (uint256);

    /**
     * Called by Relay (and RelayHub), to validate if the paymaster agrees to pay for this call.
     *
     * MUST be protected with relayHubOnly() in case it modifies state.
     *
     * The Paymaster rejects by the following "revert" operations
     *  - preRelayedCall() method reverts
     *  - the forwarder reverts because of nonce or signature error
     *  - the paymaster returned "rejectOnRecipientRevert", and the recipient contract reverted.
     * In any of the above cases, all paymaster calls (and recipient call) are reverted.
     * In any other case, the paymaster agrees to pay for the gas cost of the transaction (note
     *  that this includes also postRelayedCall revert)
     *
     * The rejectOnRecipientRevert flag means the Paymaster "delegate" the rejection to the recipient
     *  code.  It also means the Paymaster trust the recipient to reject fast: both preRelayedCall,
     *  forwarder check and receipient checks must fit into the GasLimits.acceptanceBudget,
     *  otherwise the TX is paid by the Paymaster.
     *
     *  @param relayRequest - the full relay request structure
     *  @param signature - user's EIP712-compatible signature of the {@link 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 {@link 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:
     *      a context to be passed to postRelayedCall
     *      rejectOnRecipientRevert - TRUE if paymaster want to reject the TX if the recipient reverts.
     *          FALSE means that rejects by the recipient will be completed on chain, and paid by the paymaster.
     *          (note that in the latter case, the preRelayedCall and postRelayedCall are not reverted).
     */
    function preRelayedCall(
        GsnTypes.RelayRequest calldata relayRequest,
        bytes calldata signature,
        bytes calldata approvalData,
        uint256 maxPossibleGas
    )
    external
    returns (bytes memory context, bool rejectOnRecipientRevert);

    /**
     * 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.
     *
     * MUST be protected with relayHubOnly() in case it modifies state.
     *
     * @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()
     *
     * 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.
     */
    function postRelayedCall(
        bytes calldata context,
        bool success,
        uint256 gasUseWithoutPost,
        GsnTypes.RelayData calldata relayData
    ) external;

    function versionPaymaster() external view returns (string memory);
}

File 32 of 41 : IForwarder.sol
// SPDX-License-Identifier:MIT
pragma solidity >=0.7.6;
pragma abicoder v2;

interface IForwarder {

    struct ForwardRequest {
        address from;
        address to;
        uint256 value;
        uint256 gas;
        uint256 nonce;
        bytes data;
        uint256 validUntil;
    }

    event DomainRegistered(bytes32 indexed domainSeparator, bytes domainValue);

    event RequestTypeRegistered(bytes32 indexed typeHash, string typeStr);

    function getNonce(address from)
    external view
    returns(uint256);

    /**
     * verify the transaction would execute.
     * validate the signature and the nonce of the request.
     * revert if either signature or nonce are incorrect.
     * also revert if domainSeparator or requestTypeHash are not registered.
     */
    function verify(
        ForwardRequest calldata forwardRequest,
        bytes32 domainSeparator,
        bytes32 requestTypeHash,
        bytes calldata suffixData,
        bytes calldata signature
    ) external view;

    /**
     * execute a transaction
     * @param forwardRequest - all transaction parameters
     * @param domainSeparator - domain used when signing this request
     * @param requestTypeHash - request type used when signing this request.
     * @param suffixData - the extension data used when signing this request.
     * @param signature - signature to validate.
     *
     * the transaction is verified, and then executed.
     * the success and ret of "call" are returned.
     * This method would revert only verification errors. target errors
     * are reported using the returned "success" and ret string
     */
    function execute(
        ForwardRequest calldata forwardRequest,
        bytes32 domainSeparator,
        bytes32 requestTypeHash,
        bytes calldata suffixData,
        bytes calldata signature
    )
    external payable
    returns (bool success, bytes memory ret);

    /**
     * Register a new Request typehash.
     * @param typeName - the name of the request type.
     * @param typeSuffix - any extra data after the generic params.
     *  (must add at least one param. The generic ForwardRequest type is always registered by the constructor)
     */
    function registerRequestType(string calldata typeName, string calldata typeSuffix) external;

    /**
     * Register a new domain separator.
     * 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.
     * This method is given 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 33 of 41 : IStakeManager.sol
// SPDX-License-Identifier:MIT
pragma solidity >=0.7.6;
pragma abicoder v2;

import "@openzeppelin/contracts/math/SafeMath.sol";

interface IStakeManager {

    /// Emitted when a stake or unstakeDelay are initialized or increased
    event StakeAdded(
        address indexed relayManager,
        address indexed owner,
        uint256 stake,
        uint256 unstakeDelay
    );

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

    /// Emitted when owner withdraws relayManager funds
    event StakeWithdrawn(
        address indexed relayManager,
        address indexed owner,
        uint256 amount
    );

    /// Emitted when an authorized Relay Hub penalizes a relayManager
    event StakePenalized(
        address indexed relayManager,
        address indexed beneficiary,
        uint256 reward
    );

    event HubAuthorized(
        address indexed relayManager,
        address indexed relayHub
    );

    event HubUnauthorized(
        address indexed relayManager,
        address indexed relayHub,
        uint256 removalBlock
    );

    event OwnerSet(
        address indexed relayManager,
        address indexed owner
    );

    /// @param stake - amount of ether staked for this relay
    /// @param unstakeDelay - number of blocks to elapse before the owner can retrieve the stake after calling 'unlock'
    /// @param withdrawBlock - first block number '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 withdrawBlock;
        address payable owner;
    }

    struct RelayHubInfo {
        uint256 removalBlock;
    }

    /// 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 payable owner) external;

    /// Only the owner can call this function. If the entry does not exist, reverts.
    /// @param relayManager - address that represents a stake entry and controls relay registrations on relay hubs
    /// @param unstakeDelay - number of blocks to elapse before the owner can retrieve the stake after calling 'unlock'
    function stakeForRelayManager(address relayManager, uint256 unstakeDelay) external payable;

    function unlockStake(address relayManager) external;

    function withdrawStake(address relayManager) external;

    function authorizeHubByOwner(address relayManager, address relayHub) external;

    function authorizeHubByManager(address relayHub) external;

    function unauthorizeHubByOwner(address relayManager, address relayHub) external;

    function unauthorizeHubByManager(address relayHub) external;

    function isRelayManagerStaked(address relayManager, address relayHub, uint256 minAmount, uint256 minUnstakeDelay)
    external
    view
    returns (bool);

    /// Slash the stake of the relay relayManager. In order to prevent stake kidnapping, burns half of stake on the way.
    /// @param relayManager - entry to penalize
    /// @param beneficiary - address that receives half of the penalty amount
    /// @param amount - amount to withdraw from stake
    function penalizeRelayManager(address relayManager, address payable beneficiary, uint256 amount) external;

    function getStakeInfo(address relayManager) external view returns (StakeInfo memory stakeInfo);

    function maxUnstakeDelay() external view returns (uint256);

    function versionSM() external view returns (string memory);
}

File 34 of 41 : StringUtils.sol
// SPDX-License-Identifier:MIT
pragma solidity >=0.5.0;
/**
 * add to your contract:
 *  using StringUtils for *;
 */
library StringUtils {

    function concat( string memory str, string memory title, string memory a) internal pure returns (string memory) {
        return string(abi.encodePacked(str,title,a));
    }

    function concat( string memory str, string memory a) internal pure returns (string memory) {
        return string(abi.encodePacked(str,a));
    }

    function concat( string memory str, string memory title, address a) internal pure returns (string memory) {
        return string(abi.encodePacked(str, title, toString(a)));
    }

    function concat( string memory str, address a) internal pure returns (string memory) {
        return string(abi.encodePacked(str, toString(a)));
    }

    function concat( string memory str, string memory title, uint a) internal pure returns (string memory) {
        return string(abi.encodePacked(str, title, toString(a)));
    }

    function concat( string memory str, string memory title, int a) internal pure returns (string memory) {
        return string(abi.encodePacked(str, title, toString(a)));
    }

    function concat( string memory str, uint a) internal pure returns (string memory) {
        return string(abi.encodePacked(str, toString(a)));
    }

    function concat( string memory str, int a) internal pure returns (string memory) {
        return string(abi.encodePacked(str, toString(a)));
    }

    function concat( string memory str, string memory title, bytes32 a) internal pure returns (string memory) {
        return string(abi.encodePacked(str, title, toString(a)));
    }

    function concat( string memory str, bytes32 a) internal pure returns (string memory) {
        return string(abi.encodePacked(str, toString(a)));
    }

    function toString(address _addr) internal pure returns (string memory) {
        bytes32 value = bytes32(bytes20(uint160(_addr)));
        return toString(value, 20);
    }

    function toString(bytes32 b) internal pure returns (string memory) {
        return toString(b, 32);
    }

    function toString(bytes32 value, uint nbytes) internal pure returns(string memory) {
        bytes memory alphabet = "0123456789abcdef";

        bytes memory str = new bytes(nbytes*2+2);
        str[0] = "0";
        str[1] = "x";
        for (uint i = 0; i < nbytes; i++) {
            uint8 chr = uint8(value[i]);
            str[2+i*2] = alphabet[uint(uint8(chr >> 4))];
            str[3+i*2] = alphabet[uint(uint8(chr & 0x0f))];
        }
        return string(str);
    }

    function toString(bool _i) internal pure returns (string memory _uintAsString) {
        return _i ? "true" : "false";
    }

    function toString(int _i) internal pure returns (string memory _uintAsString) {
        if (_i>0) return toString(uint(_i));
        return concat("-", toString(uint(-_i)));
    }

    function toString(uint _i) internal pure returns (string memory _uintAsString) {
        if (_i == 0) {
            return "0";
        }
        uint j = _i;
        uint len;
        while (j != 0) {
            len++;
            j /= 10;
        }
        bytes memory bstr = new bytes(len);
        uint k = len - 1;
        while (_i != 0) {
            bstr[k--] = byte(uint8(48 + _i % 10));
            _i /= 10;
        }
        return string(bstr);
    }
}

File 35 of 41 : ECDSA.sol
// SPDX-License-Identifier: MIT

pragma solidity >=0.6.0 <0.8.0;

/**
 * @dev Elliptic Curve Digital Signature Algorithm (ECDSA) operations.
 *
 * These functions can be used to verify that a message was signed by the holder
 * of the private keys of a given address.
 */
library ECDSA {
    /**
     * @dev Returns the address that signed a hashed message (`hash`) with
     * `signature`. This address can then be used for verification purposes.
     *
     * The `ecrecover` EVM opcode allows for malleable (non-unique) signatures:
     * this function rejects them by requiring the `s` value to be in the lower
     * half order, and the `v` value to be either 27 or 28.
     *
     * IMPORTANT: `hash` _must_ be the result of a hash operation for the
     * verification to be secure: it is possible to craft signatures that
     * recover to arbitrary addresses for non-hashed data. A safe way to ensure
     * this is by receiving a hash of the original message (which may otherwise
     * be too long), and then calling {toEthSignedMessageHash} on it.
     */
    function recover(bytes32 hash, bytes memory signature) internal pure returns (address) {
        // Check the signature length
        if (signature.length != 65) {
            revert("ECDSA: invalid signature length");
        }

        // Divide the signature in r, s and v variables
        bytes32 r;
        bytes32 s;
        uint8 v;

        // ecrecover takes the signature parameters, and the only way to get them
        // currently is to use assembly.
        // solhint-disable-next-line no-inline-assembly
        assembly {
            r := mload(add(signature, 0x20))
            s := mload(add(signature, 0x40))
            v := byte(0, mload(add(signature, 0x60)))
        }

        return recover(hash, v, r, s);
    }

    /**
     * @dev Overload of {ECDSA-recover-bytes32-bytes-} that receives the `v`,
     * `r` and `s` signature fields separately.
     */
    function recover(bytes32 hash, uint8 v, bytes32 r, bytes32 s) internal pure returns (address) {
        // EIP-2 still allows signature malleability for ecrecover(). Remove this possibility and make the signature
        // unique. Appendix F in the Ethereum Yellow paper (https://ethereum.github.io/yellowpaper/paper.pdf), defines
        // the valid range for s in (281): 0 < s < secp256k1n ÷ 2 + 1, and for v in (282): v ∈ {27, 28}. Most
        // signatures from current libraries generate a unique signature with an s-value in the lower half order.
        //
        // If your library generates malleable signatures, such as s-values in the upper range, calculate a new s-value
        // with 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFEBAAEDCE6AF48A03BBFD25E8CD0364141 - s1 and flip v from 27 to 28 or
        // vice versa. If your library also generates signatures with 0/1 for v instead 27/28, add 27 to v to accept
        // these malleable signatures as well.
        require(uint256(s) <= 0x7FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF5D576E7357A4501DDFE92F46681B20A0, "ECDSA: invalid signature 's' value");
        require(v == 27 || v == 28, "ECDSA: invalid signature 'v' value");

        // If the signature is valid (and not malleable), return the signer address
        address signer = ecrecover(hash, v, r, s);
        require(signer != address(0), "ECDSA: invalid signature");

        return signer;
    }

    /**
     * @dev Returns an Ethereum Signed Message, created from a `hash`. This
     * replicates the behavior of the
     * https://github.com/ethereum/wiki/wiki/JSON-RPC#eth_sign[`eth_sign`]
     * JSON-RPC method.
     *
     * See {recover}.
     */
    function toEthSignedMessageHash(bytes32 hash) internal pure returns (bytes32) {
        // 32 is the length in bytes of hash,
        // enforced by the type signature above
        return keccak256(abi.encodePacked("\x19Ethereum Signed Message:\n32", hash));
    }
}

File 36 of 41 : IPenalizer.sol
// SPDX-License-Identifier:MIT
pragma solidity >=0.7.6;

import "./IRelayHub.sol";

interface IPenalizer {

    event CommitAdded(address indexed sender, bytes32 indexed commitHash, uint256 readyBlockNumber);

    struct Transaction {
        uint256 nonce;
        uint256 gasPrice;
        uint256 gasLimit;
        address to;
        uint256 value;
        bytes data;
    }

    function commit(bytes32 commitHash) external;

    function penalizeRepeatedNonce(
        bytes calldata unsignedTx1,
        bytes calldata signature1,
        bytes calldata unsignedTx2,
        bytes calldata signature2,
        IRelayHub hub,
        uint256 randomValue
    ) external;

    function penalizeIllegalTransaction(
        bytes calldata unsignedTx,
        bytes calldata signature,
        IRelayHub hub,
        uint256 randomValue
    ) external;

    function versionPenalizer() external view returns (string memory);
    function penalizeBlockDelay() external view returns (uint256);
    function penalizeBlockExpiration() external view returns (uint256);
}

File 37 of 41 : BaseRelayRecipient.sol
// SPDX-License-Identifier:MIT
// solhint-disable no-inline-assembly
pragma solidity >=0.7.6;

import "./interfaces/IRelayRecipient.sol";

/**
 * A base contract to be inherited by any contract that want to receive relayed transactions
 * A subclass must use "_msgSender()" instead of "msg.sender"
 */
abstract contract BaseRelayRecipient is IRelayRecipient {

    /*
     * Forwarder singleton we accept calls from
     */
    address public trustedForwarder;

    function isTrustedForwarder(address forwarder) public override view returns(bool) {
        return forwarder == trustedForwarder;
    }

    /**
     * return the sender of this call.
     * if the call came through our trusted forwarder, return the original sender.
     * otherwise, return `msg.sender`.
     * should be used in the contract anywhere instead of msg.sender
     */
    function _msgSender() internal override virtual view returns (address payable ret) {
        if (msg.data.length >= 20 && isTrustedForwarder(msg.sender)) {
            // At this point we know that the sender is a trusted forwarder,
            // so we trust that the last bytes of msg.data are the verified sender address.
            // extract sender address from the end of msg.data
            assembly {
                ret := shr(96,calldataload(sub(calldatasize(),20)))
            }
        } else {
            return msg.sender;
        }
    }

    /**
     * return the msg.data of this call.
     * if the call came through our trusted forwarder, then the real sender was appended as the last 20 bytes
     * of the msg.data - so this method will strip those 20 bytes off.
     * otherwise, return `msg.data`
     * should be used in the contract instead of msg.data, where the difference matters (e.g. when explicitly
     * signing or hashing the
     */
    function _msgData() internal override virtual view returns (bytes memory ret) {
        if (msg.data.length >= 20 && isTrustedForwarder(msg.sender)) {
            return msg.data[0:msg.data.length-20];
        } else {
            return msg.data;
        }
    }
}

File 38 of 41 : BasePaymaster.sol
// SPDX-License-Identifier:MIT
pragma solidity >=0.7.6;
pragma abicoder v2;

import "@openzeppelin/contracts/access/Ownable.sol";

import "./utils/GsnTypes.sol";
import "./interfaces/IPaymaster.sol";
import "./interfaces/IRelayHub.sol";
import "./utils/GsnEip712Library.sol";
import "./forwarder/IForwarder.sol";

/**
 * Abstract base class to be inherited by a concrete Paymaster
 * A subclass must implement:
 *  - preRelayedCall
 *  - postRelayedCall
 */
abstract contract BasePaymaster is IPaymaster, Ownable {

    IRelayHub internal relayHub;
    IForwarder public override trustedForwarder;

    function getHubAddr() public override view returns (address) {
        return address(relayHub);
    }

    //overhead of forwarder verify+signature, plus hub overhead.
    uint256 constant public FORWARDER_HUB_OVERHEAD = 50000;

    //These parameters are documented in IPaymaster.GasAndDataLimits
    uint256 constant public PRE_RELAYED_CALL_GAS_LIMIT = 100000;
    uint256 constant public POST_RELAYED_CALL_GAS_LIMIT = 110000;
    uint256 constant public PAYMASTER_ACCEPTANCE_BUDGET = PRE_RELAYED_CALL_GAS_LIMIT + FORWARDER_HUB_OVERHEAD;
    uint256 constant public CALLDATA_SIZE_LIMIT = 10500;

    function getGasAndDataLimits()
    public
    override
    virtual
    view
    returns (
        IPaymaster.GasAndDataLimits memory limits
    ) {
        return IPaymaster.GasAndDataLimits(
            PAYMASTER_ACCEPTANCE_BUDGET,
            PRE_RELAYED_CALL_GAS_LIMIT,
            POST_RELAYED_CALL_GAS_LIMIT,
            CALLDATA_SIZE_LIMIT
        );
    }

    // this method must be called from preRelayedCall to validate that the forwarder
    // is approved by the paymaster as well as by the recipient contract.
    function _verifyForwarder(GsnTypes.RelayRequest calldata relayRequest)
    public
    view
    {
        require(address(trustedForwarder) == relayRequest.relayData.forwarder, "Forwarder is not trusted");
        GsnEip712Library.verifyForwarderTrusted(relayRequest);
    }

    /*
     * modifier to be used by recipients as access control protection for preRelayedCall & postRelayedCall
     */
    modifier relayHubOnly() {
        require(msg.sender == getHubAddr(), "can only be called by RelayHub");
        _;
    }

    function setRelayHub(IRelayHub hub) public onlyOwner {
        relayHub = hub;
    }

    function setTrustedForwarder(IForwarder forwarder) public onlyOwner {
        trustedForwarder = forwarder;
    }

    /// check current deposit on relay hub.
    function getRelayHubDeposit()
    public
    override
    view
    returns (uint) {
        return relayHub.balanceOf(address(this));
    }

    // any money moved into the paymaster is transferred as a deposit.
    // This way, we don't need to understand the RelayHub API in order to replenish
    // the paymaster.
    receive() external virtual payable {
        require(address(relayHub) != address(0), "relay hub address not set");
        relayHub.depositFor{value:msg.value}(address(this));
    }

    /// withdraw deposit from relayHub
    function withdrawRelayHubDepositTo(uint amount, address payable target) public onlyOwner {
        relayHub.withdraw(amount, target);
    }
}

File 39 of 41 : IRelayRecipient.sol
// SPDX-License-Identifier:MIT
pragma solidity >=0.7.6;

/**
 * a contract must implement this interface in order to support relayed transaction.
 * It is better to inherit the BaseRelayRecipient as its implementation.
 */
abstract contract IRelayRecipient {

    /**
     * return if the forwarder is trusted to forward relayed transactions to us.
     * the forwarder is required to verify the sender's signature, and verify
     * the call is not a replay.
     */
    function isTrustedForwarder(address forwarder) public virtual view returns(bool);

    /**
     * return the sender of this call.
     * if the call came through our trusted forwarder, then the real sender is appended as the last 20 bytes
     * of the msg.data.
     * otherwise, return `msg.sender`
     * should be used in the contract anywhere instead of msg.sender
     */
    function _msgSender() internal virtual view returns (address payable);

    /**
     * return the msg.data of this call.
     * if the call came through our trusted forwarder, then the real sender 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), return `msg.data`
     * should be used in the contract instead of msg.data, where this difference matters.
     */
    function _msgData() internal virtual view returns (bytes memory);

    function versionRecipient() external virtual view returns (string memory);
}

File 40 of 41 : IVersionRegistry.sol
// SPDX-License-Identifier:MIT
pragma solidity >=0.7.6;

interface IVersionRegistry {

    //event emitted whenever a version is added
    event VersionAdded(bytes32 indexed id, bytes32 version, string value, uint time);

    //event emitted whenever a version is canceled
    event VersionCanceled(bytes32 indexed id, bytes32 version, string reason);

    /**
     * add a version
     * @param id the object-id to add a version (32-byte string)
     * @param version the new version to add (32-byte string)
     * @param value value to attach to this version
     */
    function addVersion(bytes32 id, bytes32 version, string calldata value) external;

    /**
     * cancel a version.
     */
    function cancelVersion(bytes32 id, bytes32 version, string calldata reason) external;
}

File 41 of 41 : Context.sol
// SPDX-License-Identifier: MIT

pragma solidity >=0.6.0 <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 GSN 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 payable) {
        return msg.sender;
    }

    function _msgData() internal view virtual returns (bytes memory) {
        this; // silence state mutability warning without generating bytecode - see https://github.com/ethereum/solidity/issues/2691
        return msg.data;
    }
}

Settings
{
  "evmVersion": "istanbul",
  "optimizer": {
    "enabled": true,
    "runs": 200
  },
  "remappings": [],
  "outputSelection": {
    "*": {
      "*": [
        "evm.bytecode",
        "evm.deployedBytecode",
        "abi"
      ]
    }
  }
}

Contract ABI

[{"inputs":[{"internalType":"contract IStakeManager","name":"_stakeManager","type":"address"},{"internalType":"address","name":"_penalizer","type":"address"},{"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":"_maximumRecipientDeposit","type":"uint256"},{"internalType":"uint256","name":"_minimumUnstakeDelay","type":"uint256"},{"internalType":"uint256","name":"_minimumStake","type":"uint256"},{"internalType":"uint256","name":"_dataGasCostPerByte","type":"uint256"},{"internalType":"uint256","name":"_externalCallDataCostOverhead","type":"uint256"}],"stateMutability":"nonpayable","type":"constructor"},{"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":"fromBlock","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":"maximumRecipientDeposit","type":"uint256"},{"internalType":"uint256","name":"minimumUnstakeDelay","type":"uint256"},{"internalType":"uint256","name":"minimumStake","type":"uint256"},{"internalType":"uint256","name":"dataGasCostPerByte","type":"uint256"},{"internalType":"uint256","name":"externalCallDataCostOverhead","type":"uint256"}],"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":"uint256","name":"baseRelayFee","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"pctRelayFee","type":"uint256"},{"indexed":false,"internalType":"string","name":"relayUrl","type":"string"}],"name":"RelayServerRegistered","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":true,"internalType":"address","name":"relayManager","type":"address"},{"indexed":true,"internalType":"address","name":"paymaster","type":"address"},{"indexed":true,"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":"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":[],"name":"G_NONZERO","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address[]","name":"newRelayWorkers","type":"address[]"}],"name":"addRelayWorkers","outputs":[],"stateMutability":"nonpayable","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":"gasPrice","type":"uint256"},{"internalType":"uint256","name":"pctRelayFee","type":"uint256"},{"internalType":"uint256","name":"baseRelayFee","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":"length","type":"uint256"}],"name":"calldataGasCost","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":"fromBlock","type":"uint256"}],"name":"deprecateHub","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"deprecationBlock","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"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":"maximumRecipientDeposit","type":"uint256"},{"internalType":"uint256","name":"minimumUnstakeDelay","type":"uint256"},{"internalType":"uint256","name":"minimumStake","type":"uint256"},{"internalType":"uint256","name":"dataGasCostPerByte","type":"uint256"},{"internalType":"uint256","name":"externalCallDataCostOverhead","type":"uint256"}],"internalType":"struct IRelayHub.RelayHubConfig","name":"","type":"tuple"}],"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":"validUntil","type":"uint256"}],"internalType":"struct IForwarder.ForwardRequest","name":"request","type":"tuple"},{"components":[{"internalType":"uint256","name":"gasPrice","type":"uint256"},{"internalType":"uint256","name":"pctRelayFee","type":"uint256"},{"internalType":"uint256","name":"baseRelayFee","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":"isRelayManagerStaked","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","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":[],"name":"penalizer","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"baseRelayFee","type":"uint256"},{"internalType":"uint256","name":"pctRelayFee","type":"uint256"},{"internalType":"string","name":"url","type":"string"}],"name":"registerRelayServer","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":"validUntil","type":"uint256"}],"internalType":"struct IForwarder.ForwardRequest","name":"request","type":"tuple"},{"components":[{"internalType":"uint256","name":"gasPrice","type":"uint256"},{"internalType":"uint256","name":"pctRelayFee","type":"uint256"},{"internalType":"uint256","name":"baseRelayFee","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"},{"internalType":"uint256","name":"externalGasLimit","type":"uint256"}],"name":"relayCall","outputs":[{"internalType":"bool","name":"paymasterAccepted","type":"bool"},{"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":"maximumRecipientDeposit","type":"uint256"},{"internalType":"uint256","name":"minimumUnstakeDelay","type":"uint256"},{"internalType":"uint256","name":"minimumStake","type":"uint256"},{"internalType":"uint256","name":"dataGasCostPerByte","type":"uint256"},{"internalType":"uint256","name":"externalCallDataCostOverhead","type":"uint256"}],"internalType":"struct IRelayHub.RelayHubConfig","name":"_config","type":"tuple"}],"name":"setConfiguration","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"stakeManager","outputs":[{"internalType":"contract IStakeManager","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"newOwner","type":"address"}],"name":"transferOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"versionHub","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"amount","type":"uint256"},{"internalType":"address payable","name":"dest","type":"address"}],"name":"withdraw","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"}],"name":"workerCount","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"}],"name":"workerToManager","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"}]

610100604052601b60c08190527f322e322e302b6f70656e67736e2e6875622e6972656c6179687562000000000060e090815262000041916001919062000277565b50600019600e553480156200005557600080fd5b5060405162003e2d38038062003e2d833981016040819052620000789162000323565b60006200008462000169565b600080546001600160a01b0319166001600160a01b0383169081178255604051929350917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908290a3508a6001600160a01b03166080816001600160a01b031660601b81525050896001600160a01b031660a0816001600160a01b031660601b81525050620001586040518061012001604052808b81526020018a8152602001898152602001888152602001878152602001868152602001858152602001848152602001838152506200016d60201b60201c565b505050505050505050505062000431565b3390565b6200017762000169565b6001600160a01b03166200018a62000268565b6001600160a01b031614620001e6576040805162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604482015290519081900360640190fd5b8051600290815560208201516003556040808301516004556060830151600555608083015160065560a083015160075560c083015160085560e0830151600955610100830151600a55517f918ee002eb112844e457f37ea6b320c5572bc73957ebb0423ffcfb03d7b939d7916200025d91620003bb565b60405180910390a150565b6000546001600160a01b031690565b828054600181600116156101000203166002900490600052602060002090601f016020900481019282620002af5760008555620002fa565b82601f10620002ca57805160ff1916838001178555620002fa565b82800160010185558215620002fa579182015b82811115620002fa578251825591602001919060010190620002dd565b50620003089291506200030c565b5090565b5b808211156200030857600081556001016200030d565b60008060008060008060008060008060006101608c8e03121562000345578687fd5b8b51620003528162000418565b60208d0151909b50620003658162000418565b809a505060408c0151985060608c0151975060808c0151965060a08c0151955060c08c0151945060e08c015193506101008c015192506101208c015191506101408c015190509295989b509295989b9093969950565b8154815260018201546020820152600282015460408201526003820154606082015260048201546080820152600582015460a0820152600682015460c0820152600782015460e08201526008909101546101008201526101200190565b6001600160a01b03811681146200042e57600080fd5b50565b60805160601c60a05160601c6139be6200046f600039806114f452806116af525080610bcb52806110f85280611763528061180452506139be6000f3fe6080604052600436106101655760003560e01c80638da5cb5b116100d1578063c651bce81161008a578063d6a71c0d11610064578063d6a71c0d1461040b578063d904c73214610420578063ebcd31ac14610442578063f2fde38b1461046257610165565b8063c651bce8146103b6578063c7178230146103d6578063ca998f56146103eb57610165565b80638da5cb5b146103195780638e53548b1461032e578063aa67c9191461034e578063af595dfc14610361578063c2da078614610381578063c4775a68146103a157610165565b80636bd50cef116101235780636bd50cef1461025257806370a0823114610274578063715018a614610294578063746d300c146102a95780637542ff95146102d757806383b71871146102f957610165565b8062f714ce1461016a5780630dd3eded1461018c57806310c45431146101b7578063194ac307146101e557806326595b9d146102055780632ad311b514610225575b600080fd5b34801561017657600080fd5b5061018a610185366004612ad3565b610482565b005b34801561019857600080fd5b506101a1610578565b6040516101ae9190613058565b60405180910390f35b3480156101c357600080fd5b506101d76101d2366004612b37565b61057d565b6040516101ae92919061303d565b3480156101f157600080fd5b506101a1610200366004612710565b610b81565b34801561021157600080fd5b506101a1610220366004612abb565b610b93565b34801561023157600080fd5b50610245610240366004612710565b610bab565b6040516101ae9190613032565b34801561025e57600080fd5b50610267610c52565b6040516101ae9190613558565b34801561028057600080fd5b506101a161028f366004612710565b610cb1565b3480156102a057600080fd5b5061018a610ccc565b3480156102b557600080fd5b506102c96102c4366004612999565b610d78565b6040516101ae92919061310a565b3480156102e357600080fd5b506102ec6110f6565b6040516101ae9190612ee8565b34801561030557600080fd5b5061018a610314366004612bd9565b61111a565b34801561032557600080fd5b506102ec6111c3565b34801561033a57600080fd5b506101a1610349366004612af7565b6111d2565b61018a61035c366004612710565b611218565b34801561036d57600080fd5b5061018a61037c366004612abb565b6112bb565b34801561038d57600080fd5b5061018a61039c366004612764565b61137e565b3480156103ad57600080fd5b506102ec6114f2565b3480156103c257600080fd5b5061018a6103d136600461291b565b611516565b3480156103e257600080fd5b506102456115ed565b3480156103f757600080fd5b506102ec610406366004612710565b6115f6565b34801561041757600080fd5b506101a1611611565b34801561042c57600080fd5b50610435611617565b6040516101ae919061312a565b34801561044e57600080fd5b5061018a61045d36600461272c565b6116a4565b34801561046e57600080fd5b5061018a61047d366004612710565b611873565b336000818152600d60205260409020548311156104ba5760405162461bcd60e51b81526004016104b19061340f565b60405180910390fd5b6001600160a01b0381166000908152600d60205260409020546104dd9084611975565b6001600160a01b038083166000908152600d60205260408082209390935591519084169185156108fc02918691818181858888f19350505050158015610527573d6000803e3d6000fd5b50816001600160a01b0316816001600160a01b03167fd1c19fbcd4551a5edfb66d43d2e337c04837afda3482b42bdf569a8fccdae5fb8560405161056b9190613058565b60405180910390a3505050565b601081565b6000606061058961250e565b5a60408201526105976115ed565b156105b45760405162461bcd60e51b81526004016104b19061316b565b60046105c08a8061374d565b6105ce9060a0810190613709565b905010156105dd576000610632565b6106326105ea8a8061374d565b6105f89060a0810190613709565b8080601f016020809104026020016040519081016040528093929190818152602001838380828437600092018290525092506119d2915050565b6001600160e01b031916602080830191909152336000908152600b825260409020546001600160a01b03166101608301523a90610671908b018b613762565b3511156106905760405162461bcd60e51b81526004016104b190613264565b458411156106b05760405162461bcd60e51b81526004016104b19061313d565b6106c08a8a836040015187611a40565b61010083015260a08201526106d88989898989611d45565b60035460009060405a603f02816106eb57fe5b040390505a826101200181815250506000600280015460026003015487840101019050600080306001600160a01b03168463746d300c60e01b8f8f8f8f8f8c60a001515a8c038e610100015160405160240161074e98979695949392919061361a565b60408051601f198184030181529181526020820180516001600160e01b03166001600160e01b031990941693909317909252905161078c9190612e31565b60006040518083038160008787f1925050503d80600081146107ca576040519150601f19603f3d011682016040523d82523d6000602084013e6107cf565b606091505b50811515875290925090505a6101208601510360e086015280516107fc9082016020908101908301612882565b8660c0018760800182905282600681111561081357fe5b600681111561081e57fe5b905250506080850151511561086f577fa1478a4242848419db824250a0dddc645dca0d6a9b12ab1fd79b00145a0ba98e8560c00151866080015160405161086692919061310a565b60405180910390a15b505050506108806000369050610b93565b61018082015280516109c45760028160c00151600681111561089e57fe5b14806108f5575061018081015160a0820151516108ba91611dea565b8160e00151111580156108f5575060038160c0015160068111156108da57fe5b14806108f5575060048160c0015160068111156108f357fe5b145b156109c45760009250610908898061374d565b610916906020810190612710565b6001600160a01b031661092c60208b018b613762565b61093d9060a0810190608001612710565b6101608301516001600160a01b0391821691167fddb88484d11f800b80fe63aa67488ec56ee001d85896d528912c5d850cbcd06a61097b8d8061374d565b61098c906040810190602001612710565b3386602001518760e0015188608001516040516109ad959493929190612efc565b60405180910390a460800151600092509050610b75565b6005546000905a860301905060006109e38261034960208e018e613762565b9050610a2e81600d60008e80602001906109fd9190613762565b610a0e9060a0810190608001612710565b6001600160a01b0316815260208101919091526040016000205490611975565b600d6000610a3f60208f018f613762565b610a509060a0810190608001612710565b6001600160a01b0390811682526020808301939093526040918201600090812094909455610160870151168352600d909152902054610a8f9082611dea565b6101608401516001600160a01b03166000908152600d6020526040902055610ab78b8061374d565b610ac5906020810190612710565b6101608401516001600160a01b03918216913391167fc9aa709786a3d5fe2cc947abc1ba8cbb0f6decb57aa74b84eb7f558125fee454610b058f8061374d565b610b16906040810190602001612710565b8f8060200190610b269190613762565b610b379060a0810190608001612710565b88602001518960c0015188604051610b53959493929190612f6e565b60405180910390a4600160405180602001604052806000815250945094505050505b97509795505050505050565b600c6020526000908152604090205481565b600954600090610ba39083611e44565b90505b919050565b600854600754604051636de8dd4160e01b81526000926001600160a01b037f00000000000000000000000000000000000000000000000000000000000000001692636de8dd4192610c029287923092600401612fb3565b60206040518083038186803b158015610c1a57600080fd5b505afa158015610c2e573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610ba391906127d2565b610c5a612591565b50604080516101208101825260025481526003546020820152600454918101919091526005546060820152600654608082015260075460a082015260085460c082015260095460e0820152600a5461010082015290565b6001600160a01b03166000908152600d602052604090205490565b610cd4611e9d565b6001600160a01b0316610ce56111c3565b6001600160a01b031614610d2e576040805162461bcd60e51b81526020600482018190526024820152600080516020613969833981519152604482015290519081900360640190fd5b600080546040516001600160a01b03909116907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0908390a3600080546001600160a01b0319169055565b60006060610d846125dd565b333014610da35760405162461bcd60e51b81526004016104b19061322d565b600d6000610db460208e018e613762565b610dc59060a0810190608001612710565b6001600160a01b031681526020810191909152604090810160002054825251622f977560e21b90610e04908d908d908d908d908d908b9060240161369a565b60408051601f19818403018152919052602080820180516001600160e01b03166001600160e01b03199094169390931790925260a0830152600090606090610e4e908e018e613762565b610e5f9060a0810190608001612710565b6001600160a01b031688602001358460a00151604051610e7f9190612e31565b60006040518083038160008787f1925050503d8060008114610ebd576040519150601f19603f3d011682016040523d82523d6000602084013e610ec2565b606091505b50909250905081610ee157610ed681611ea1565b610ee1600282611eb0565b80806020019051810190610ef59190612837565b151560c085015260808401525060009050610f118c8c8c611ee9565b606085015215156040840152905080610f3357610f3360038360600151611eb0565b8160c001518015610f4657508160400151155b15610f5a57610f5a60048360600151611eb0565b506376fa01c360e01b816080015182604001515a88038e8060200190610f809190613762565b604051602401610f9394939291906130d7565b60408051601f19818403018152919052602080820180516001600160e01b03166001600160e01b03199094169390931790925260a08301526000908190610fdc908e018e613762565b610fed9060a0810190608001612710565b6001600160a01b031688604001358460a0015160405161100d9190612e31565b60006040518083038160008787f1925050503d806000811461104b576040519150601f19603f3d011682016040523d82523d6000602084013e611050565b606091505b50915091508161106557611065600582611eb0565b50508051600d600061107a60208f018f613762565b61108b9060a0810190608001612710565b6001600160a01b03166001600160a01b031681526020019081526020016000205410156110cc576110cc600660405180602001604052806000815250611eb0565b80604001516110dc5760016110df565b60005b816060015192509250509850989650505050505050565b7f000000000000000000000000000000000000000000000000000000000000000081565b3361112481610bab565b6111405760405162461bcd60e51b81526004016104b1906132b8565b6001600160a01b0381166000908152600c60205260409020546111755760405162461bcd60e51b81526004016104b1906132ef565b806001600160a01b03167f77f2d8afec4b9d82ffa0dea525320620292bd1067f575964994d5c4501479aed868686866040516111b494939291906136e9565b60405180910390a25050505050565b6000546001600160a01b031690565b600061120f61120460646111fe6111ed602087013583611dea565b6111f8888835611e44565b90611e44565b906120cd565b604084013590611dea565b90505b92915050565b600654349081111561123c5760405162461bcd60e51b81526004016104b19061328f565b6001600160a01b0382166000908152600d602052604090205461125f9082611dea565b6001600160a01b0383166000818152600d6020526040908190209290925590513391907f8752a472e571a816aea92eec8dae9baf628e840f4929fbcc2d155e6233ff68a7906112af908590613058565b60405180910390a35050565b6112c3611e9d565b6001600160a01b03166112d46111c3565b6001600160a01b03161461131d576040805162461bcd60e51b81526020600482018190526024820152600080516020613969833981519152604482015290519081900360640190fd5b43600e541161133e5760405162461bcd60e51b81526004016104b190613193565b600e8190556040517f1c0aa0c666483fbf0cf795d9d646ea3552d1e3008162ba9ab1d6d6dfd8c6ec6b90611373908390613058565b60405180910390a150565b336000818152600c6020526040902080548301908190556002548111156113b75760405162461bcd60e51b81526004016104b1906133ae565b6113c082610bab565b6113dc5760405162461bcd60e51b81526004016104b1906132b8565b60005b838110156114a6576000600b818787858181106113f857fe5b905060200201602081019061140d9190612710565b6001600160a01b03908116825260208201929092526040016000205416146114475760405162461bcd60e51b81526004016104b1906131bf565b82600b600087878581811061145857fe5b905060200201602081019061146d9190612710565b6001600160a01b039081168252602082019290925260400160002080546001600160a01b031916929091169190911790556001016113df565b50816001600160a01b03167febf4a9bffb39f7c5dbf3f65540183b9381ae226ac3d0a45b4cad484713bd4a288585846040516114e493929190612fdc565b60405180910390a250505050565b7f000000000000000000000000000000000000000000000000000000000000000081565b61151e611e9d565b6001600160a01b031661152f6111c3565b6001600160a01b031614611578576040805162461bcd60e51b81526020600482018190526024820152600080516020613969833981519152604482015290519081900360640190fd5b8051600290815560208201516003556040808301516004556060830151600555608083015160065560a083015160075560c083015160085560e0830151600955610100830151600a55517f918ee002eb112844e457f37ea6b320c5572bc73957ebb0423ffcfb03d7b939d791611373916135bd565b600e5443101590565b600b602052600090815260409020546001600160a01b031681565b600e5481565b60018054604080516020600284861615610100026000190190941693909304601f8101849004840282018401909252818152929183018282801561169c5780601f106116715761010080835404028352916020019161169c565b820191906000526020600020905b81548152906001019060200180831161167f57829003601f168201915b505050505081565b336001600160a01b037f000000000000000000000000000000000000000000000000000000000000000016146116ec5760405162461bcd60e51b81526004016104b190613350565b6001600160a01b038083166000908152600b602052604090205416806117245760405162461bcd60e51b81526004016104b1906134d7565b61172d81610bab565b6117495760405162461bcd60e51b81526004016104b1906132b8565b60405163c345315360e01b81526000906001600160a01b037f0000000000000000000000000000000000000000000000000000000000000000169063c345315390611798908590600401612ee8565b60806040518083038186803b1580156117b057600080fd5b505afa1580156117c4573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906117e89190612a57565b805160405163026822bd60e21b81529192506001600160a01b037f000000000000000000000000000000000000000000000000000000000000000016916309a08af49161183b9186918891600401612f4a565b600060405180830381600087803b15801561185557600080fd5b505af1158015611869573d6000803e3d6000fd5b5050505050505050565b61187b611e9d565b6001600160a01b031661188c6111c3565b6001600160a01b0316146118d5576040805162461bcd60e51b81526020600482018190526024820152600080516020613969833981519152604482015290519081900360640190fd5b6001600160a01b03811661191a5760405162461bcd60e51b81526004018080602001828103825260268152602001806138816026913960400191505060405180910390fd5b600080546040516001600160a01b03808516939216917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e091a3600080546001600160a01b0319166001600160a01b0392909216919091179055565b6000828211156119cc576040805162461bcd60e51b815260206004820152601e60248201527f536166654d6174683a207375627472616374696f6e206f766572666c6f770000604482015290519081900360640190fd5b50900390565b60008160040183511015611a2d576040805162461bcd60e51b815260206004820152601a60248201527f726561644279746573343a206461746120746f6f2073686f7274000000000000604482015290519081900360640190fd5b5001602001516001600160e01b03191690565b611a48612618565b6000611a576020860186613762565b611a689060a0810190608001612710565b6001600160a01b031663b039a88f61c3506040518263ffffffff1660e01b815260040160806040518083038187803b158015611aa357600080fd5b5086fa158015611ab7573d6000803e3d6000fd5b50505050506040513d601f19601f82011682018060405250810190611adc91906128bd565b6060810151909250361115611b035760405162461bcd60e51b81526004016104b190613319565b6000611b0e36610b93565b600a54909150858503036000368281611b2357fe5b0490506010811115611bf96040518060400160405280600981526020016820706572627974653d60b81b81525083611bf26040518060400160405280601081526020016f20696e697469616c4761734c6566743d60801b8152508c611bf2604051806040016040528060128152602001712065787465726e616c4761734c696d69743d60701b8152508e6040518060400160405280601881526020017f696e76616c69642065787465726e616c4761734c696d697400000000000000008152506121349092919063ffffffff16565b9190612134565b90611c175760405162461bcd60e51b81526004016104b1919061312a565b508451891015611c395760405162461bcd60e51b81526004016104b1906133d8565b602085015185511015611c5e5760405162461bcd60e51b81526004016104b1906131f6565b611c9f82611c998581611c718d8061374d565b60600135611c998b60400151611c998d60200151600260030154611dea90919063ffffffff16565b90611dea565b935083861015611cc15760405162461bcd60e51b81526004016104b190613377565b6000611cd48561034960208c018c613762565b9050600d6000611ce760208c018c613762565b611cf89060a0810190608001612710565b6001600160a01b03166001600160a01b0316815260200190815260200160002054811115611d385760405162461bcd60e51b81526004016104b190613469565b5050505094509492505050565b6000611d6a611d576020880188613762565b611d659060c0810190613709565b612242565b611d85611d77888061374d565b611d659060a0810190613709565b611d8f8585612242565b611d998888612242565b0101016102c40190506041841115611dc35760405162461bcd60e51b81526004016104b1906134a0565b368114611de25760405162461bcd60e51b81526004016104b19061343b565b505050505050565b60008282018381101561120f576040805162461bcd60e51b815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f770000000000604482015290519081900360640190fd5b600082611e5357506000611212565b82820282848281611e6057fe5b041461120f5760405162461bcd60e51b81526004018080602001828103825260218152602001806139486021913960400191505060405180910390fd5b3390565b611ead81610400612253565b50565b60008282604051602001611ec592919061310a565b6040516020818303038152906040529050611edf81611ea1565b8051602082018181fd5b60008060606000611ef987612264565b90506000611f23611f0d60208a018a613762565b611f1e9060c081019060a001612710565b6122a1565b9050611f326020890189613762565b611f439060c081019060a001612710565b6001600160a01b031663e024dc7f60e01b611f5e8a8061374d565b836040518060400160405280600c81526020016b14995b185e54995c5d595cdd60a21b8152506040518060800160405280605d8152602001613824605d91396040518060e0016040528060a181526020016138a760a19139604051602001611fc69190612eac565b60408051601f1981840301815290829052611fe5939291602001612e4d565b60405160208183030381529060405280519060200120868c8c60405160240161201396959493929190613505565b60408051601f198184030181529181526020820180516001600160e01b03166001600160e01b03199094169390931790925290516120519190612e31565b6000604051808303816000865af19150503d806000811461208e576040519150601f19603f3d011682016040523d82523d6000602084013e612093565b606091505b50909550925084156120b957828060200190518101906120b391906127ec565b90945092505b6120c283611ea1565b505093509350939050565b6000808211612123576040805162461bcd60e51b815260206004820152601a60248201527f536166654d6174683a206469766973696f6e206279207a65726f000000000000604482015290519081900360640190fd5b81838161212c57fe5b049392505050565b6060838361214184612321565b6040516020018084805190602001908083835b602083106121735780518252601f199092019160209182019101612154565b51815160209384036101000a600019018019909216911617905286519190930192860191508083835b602083106121bb5780518252601f19909201916020918201910161219c565b51815160209384036101000a600019018019909216911617905285519190930192850191508083835b602083106122035780518252601f1990920191602091820191016121e4565b6001836020036101000a038019825116818451168082178552505050505050905001935050505060405160208183030381529060405290509392505050565b6020601f8201601f19160192915050565b8082511115612260578082525b5050565b606061227b6122766020840184613762565b6123f8565b60405160200161228b9190613058565b6040516020818303038152906040529050919050565b6040805160c0810182526017608082019081527f47534e2052656c61796564205472616e73616374696f6e00000000000000000060a083015281528151808301835260018152601960f91b602082810191909152820152600091610ba39190810161230a6124b1565b8152602001846001600160a01b03168152506124b5565b60608161234657506040805180820190915260018152600360fc1b6020820152610ba6565b8160005b811561235e57600101600a8204915061234a565b6000816001600160401b038111801561237657600080fd5b506040519080825280601f01601f1916602001820160405280156123a1576020820181803683370190505b50905060001982015b85156123ef57600a860660300160f81b828280600190039350815181106123cd57fe5b60200101906001600160f81b031916908160001a905350600a860495506123aa565b50949350505050565b60006040518060e0016040528060a181526020016138a760a1913980516020918201209083359084013560408501356124376080870160608801612710565b61244760a0880160808901612710565b61245760c0890160a08a01612710565b61246460c08a018a613709565b604051612472929190612e21565b604051908190038120612494989796959493929160e08c01359060200161308d565b604051602081830303815290604052805190602001209050919050565b4690565b60007f8b73c3c69bb8fe3d512ecc4cf759cc79239f7b179b0ffacaa9a75d522b39400f82600001518051906020012083602001518051906020012084604001518560600151604051602001612494959493929190613061565b604051806101a0016040528060001515815260200160006001600160e01b0319168152602001600081526020016060815260200160608152602001612551612618565b8152602001600081526020016000815260200160008152602001600081526020016060815260200160006001600160a01b03168152602001600081525090565b6040518061012001604052806000815260200160008152602001600081526020016000815260200160008152602001600081526020016000815260200160008152602001600081525090565b6040805160e08101825260008082526020820181905291810182905260608082018190526080820181905260a082015260c081019190915290565b6040518060800160405280600081526020016000815260200160008152602001600081525090565b80518015158114610ba657600080fd5b60008083601f840112612661578182fd5b5081356001600160401b03811115612677578182fd5b60208301915083602082850101111561268f57600080fd5b9250929050565b600082601f8301126126a6578081fd5b81516001600160401b038111156126b957fe5b6126cc601f8201601f1916602001613777565b8181528460208386010111156126e0578283fd5b6126f18260208301602087016137de565b949350505050565b60006040828403121561270a578081fd5b50919050565b600060208284031215612721578081fd5b813561120f8161380e565b6000806040838503121561273e578081fd5b82356127498161380e565b915060208301356127598161380e565b809150509250929050565b60008060208385031215612776578182fd5b82356001600160401b038082111561278c578384fd5b818501915085601f83011261279f578384fd5b8135818111156127ad578485fd5b86602080830285010111156127c0578485fd5b60209290920196919550909350505050565b6000602082840312156127e3578081fd5b61120f82612640565b600080604083850312156127fe578182fd5b61280783612640565b915060208301516001600160401b03811115612821578182fd5b61282d85828601612696565b9150509250929050565b60008060408385031215612849578182fd5b82516001600160401b0381111561285e578283fd5b61286a85828601612696565b92505061287960208401612640565b90509250929050565b60008060408385031215612894578081fd5b8251600781106128a2578182fd5b60208401519092506001600160401b03811115612821578182fd5b6000608082840312156128ce578081fd5b604051608081018181106001600160401b03821117156128ea57fe5b8060405250825181526020830151602082015260408301516040820152606083015160608201528091505092915050565b600061012080838503121561292e578182fd5b61293781613777565b9050823581526020830135602082015260408301356040820152606083013560608201526080830135608082015260a083013560a082015260c083013560c082015260e083013560e08201526101008084013581830152508091505092915050565b600080600080600080600080888a036101208112156129b6578485fd5b89356001600160401b03808211156129cc578687fd5b6129d88d838e016126f9565b9a5060208c01359150808211156129ed578687fd5b6129f98d838e01612650565b909a50985060408c0135915080821115612a11578687fd5b50612a1e8c828d01612650565b9097509550506080605f1982011215612a35578384fd5b5096999598509396929550909360608301935060e08301359261010001359150565b600060808284031215612a68578081fd5b604051608081018181106001600160401b0382111715612a8457fe5b80604052508251815260208301516020820152604083015160408201526060830151612aaf8161380e565b60608201529392505050565b600060208284031215612acc578081fd5b5035919050565b60008060408385031215612ae5578182fd5b8235915060208301356127598161380e565b60008060408385031215612b09578182fd5b8235915060208301356001600160401b03811115612b25578182fd5b83016101008186031215612759578182fd5b600080600080600080600060a0888a031215612b51578081fd5b8735965060208801356001600160401b0380821115612b6e578283fd5b612b7a8b838c016126f9565b975060408a0135915080821115612b8f578283fd5b612b9b8b838c01612650565b909750955060608a0135915080821115612bb3578283fd5b50612bc08a828b01612650565b989b979a50959894979596608090950135949350505050565b60008060008060608587031215612bee578182fd5b843593506020850135925060408501356001600160401b03811115612c11578283fd5b612c1d87828801612650565b95989497509550505050565b6001600160a01b03169052565b60008284528282602086013780602084860101526020601f19601f85011685010190509392505050565b60008151808452612c788160208601602086016137de565b601f01601f19169290920160200192915050565b60078110612c9657fe5b9052565b60008135612ca78161380e565b6001600160a01b039081168452602083013590612cc38261380e565b166020840152604082810135908401526060808301359084015260808083013590840152612cf460a083018361379a565b60e060a0860152612d0960e086018284612c36565b91505060c083013560c08501528091505092915050565b60006101008235845260208301356020850152604083013560408501526060830135612d4b8161380e565b6001600160a01b039081166060860152608084013590612d6a8261380e565b16608085015260a0830135612d7e8161380e565b612d8b60a0860182612c29565b50612d9960c084018461379a565b8260c0870152612dac8387018284612c36565b9250505060e083013560e08501528091505092915050565b6000813582360360de1981018212612dda578283fd5b60408552612ded60408601858401612c9a565b9150602084013560fe1982018112612e03578384fd5b8583036020870152612e1783868301612d20565b9695505050505050565b6000828483379101908152919050565b60008251612e438184602087016137de565b9190910192915050565b60008451612e5f8184602089016137de565b600560fb1b9083019081528451612e7d8160018401602089016137de565b600b60fa1b600192909101918201528351612e9f8160028401602088016137de565b0160020195945050505050565b60007352656c6179446174612072656c6179446174612960601b82528251612edb8160148501602087016137de565b9190910160140192915050565b6001600160a01b0391909116815260200190565b6001600160a01b038681168252851660208201526001600160e01b0319841660408201526060810183905260a060808201819052600090612f3f90830184612c60565b979650505050505050565b6001600160a01b039384168152919092166020820152604081019190915260600190565b6001600160a01b038681168252851660208201526001600160e01b03198416604082015260a08101612fa36060830185612c8c565b8260808301529695505050505050565b6001600160a01b0394851681529290931660208301526040820152606081019190915260800190565b6040808252810183905260008460608301825b8681101561301f5782356130028161380e565b6001600160a01b0316825260209283019290910190600101612fef565b5060209390930193909352509392505050565b901515815260200190565b60008315158252604060208301526126f16040830184612c60565b90815260200190565b9485526020850193909352604084019190915260608301526001600160a01b0316608082015260a00190565b9889526020890197909752604088019590955260608701939093526001600160a01b039182166080870152811660a08601521660c084015260e08301526101008201526101200190565b6000608082526130ea6080830187612c60565b85151560208401528460408401528281036060840152612f3f8185612d20565b60006131168285612c8c565b604060208301526126f16040830184612c60565b60006020825261120f6020830184612c60565b602080825260149082015273125b5c1bdcdcda589b194819d85cc81b1a5b5a5d60621b604082015260600190565b6020808252600e908201526d1a1d588819195c1c9958d85d195960921b604082015260600190565b602080825260129082015271105b1c9958591e4819195c1c9958d85d195960721b604082015260600190565b60208082526019908201527f7468697320776f726b6572206861732061206d616e6167657200000000000000604082015260600190565b60208082526019908201527f616363657074616e63652062756467657420746f6f206c6f7700000000000000604082015260600190565b6020808252601a908201527f4d7573742062652063616c6c65642062792052656c6179487562000000000000604082015260600190565b602080825260119082015270496e76616c69642067617320707269636560781b604082015260600190565b6020808252600f908201526e6465706f73697420746f6f2062696760881b604082015260600190565b60208082526018908201527f72656c6179206d616e61676572206e6f74207374616b65640000000000000000604082015260600190565b60208082526010908201526f6e6f2072656c617920776f726b65727360801b604082015260600190565b60208082526017908201527f6d73672e64617461206578636565646564206c696d6974000000000000000000604082015260600190565b6020808252600d908201526c2737ba103832b730b634bd32b960991b604082015260600190565b60208082526019908201527f6e6f2067617320666f7220696e6e657252656c617943616c6c00000000000000604082015260600190565b60208082526010908201526f746f6f206d616e7920776f726b65727360801b604082015260600190565b6020808252601a908201527f616363657074616e63652062756467657420746f6f2068696768000000000000604082015260600190565b602080825260129082015271696e73756666696369656e742066756e647360701b604082015260600190565b6020808252601490820152736578747261206d73672e6461746120627974657360601b604082015260600190565b60208082526019908201527f5061796d61737465722062616c616e636520746f6f206c6f7700000000000000604082015260600190565b60208082526018908201527f696e76616c6964207369676e6174757265206c656e6774680000000000000000604082015260600190565b6020808252601490820152732ab735b737bbb7103932b630bc903bb7b935b2b960611b604082015260600190565b600060a0825261351860a0830189612c9a565b87602084015286604084015282810360608401526135368187612c60565b9050828103608084015261354b818587612c36565b9998505050505050505050565b600061012082019050825182526020830151602083015260408301516040830152606083015160608301526080830151608083015260a083015160a083015260c083015160c083015260e083015160e083015261010080840151818401525092915050565b8154815260018201546020820152600282015460408201526003820154606082015260048201546080820152600582015460a0820152600682015460c0820152600782015460e08201526008909101546101008201526101200190565b600061012080835261362e8184018c612dc4565b90508281036020840152613643818a8c612c36565b9050828103604084015261365881888a612c36565b9150508451606083015260208501516080830152604085015160a0830152606085015160c08301528360e0830152826101008301529998505050505050505050565b6000608082526136ad6080830189612dc4565b82810360208401526136c081888a612c36565b905082810360408401526136d5818688612c36565b915050826060830152979650505050505050565b600085825284602083015260606040830152612e17606083018486612c36565b6000808335601e1984360301811261371f578283fd5b8301803591506001600160401b03821115613738578283fd5b60200191503681900382131561268f57600080fd5b6000823560de19833603018112612e43578182fd5b6000823560fe19833603018112612e43578182fd5b6040518181016001600160401b038111828210171561379257fe5b604052919050565b6000808335601e198436030181126137b0578283fd5b83016020810192503590506001600160401b038111156137cf57600080fd5b80360383131561268f57600080fd5b60005b838110156137f95781810151838201526020016137e1565b83811115613808576000848401525b50505050565b6001600160a01b0381168114611ead57600080fdfe616464726573732066726f6d2c6164647265737320746f2c75696e743235362076616c75652c75696e74323536206761732c75696e74323536206e6f6e63652c627974657320646174612c75696e743235362076616c6964556e74696c4f776e61626c653a206e6577206f776e657220697320746865207a65726f206164647265737352656c6179446174612875696e743235362067617350726963652c75696e743235362070637452656c61794665652c75696e74323536206261736552656c61794665652c616464726573732072656c6179576f726b65722c61646472657373207061796d61737465722c6164647265737320666f727761726465722c6279746573207061796d6173746572446174612c75696e7432353620636c69656e74496429536166654d6174683a206d756c7469706c69636174696f6e206f766572666c6f774f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572a26469706673582212209ff0bf8fe5876b99f5fbe7dcb11ee13db761ce56cef78cbcae6f3bea7b55bab964736f6c63430007060033000000000000000000000000754a2292d8b21f4b83b503f02d7356da2f6088000000000000000000000000002d5304836e29242399479e44ff916bc1ba2a1999000000000000000000000000000000000000000000000000000000000000000a00000000000000000000000000000000000000000000000000000000000186a00000000000000000000000000000000000000000000000000000000000003ada000000000000000000000000000000000000000000000000000000000000816f0000000000000000000000000000000000000000000000001bc16d674ec8000000000000000000000000000000000000000000000000000000000000000003e80000000000000000000000000000000000000000000000000de0b6b3a7640000000000000000000000000000000000000000000000000000000000000000000d000000000000000000000000000000000000000000000000000000000000578e

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

000000000000000000000000754a2292d8b21f4b83b503f02d7356da2f6088000000000000000000000000002d5304836e29242399479e44ff916bc1ba2a1999000000000000000000000000000000000000000000000000000000000000000a00000000000000000000000000000000000000000000000000000000000186a00000000000000000000000000000000000000000000000000000000000003ada000000000000000000000000000000000000000000000000000000000000816f0000000000000000000000000000000000000000000000001bc16d674ec8000000000000000000000000000000000000000000000000000000000000000003e80000000000000000000000000000000000000000000000000de0b6b3a7640000000000000000000000000000000000000000000000000000000000000000000d000000000000000000000000000000000000000000000000000000000000578e

-----Encoded View---------------
11 Constructor Arguments found :
Arg [0] : 000000000000000000000000754a2292d8b21f4b83b503f02d7356da2f608800
Arg [1] : 0000000000000000000000002d5304836e29242399479e44ff916bc1ba2a1999
Arg [2] : 000000000000000000000000000000000000000000000000000000000000000a
Arg [3] : 00000000000000000000000000000000000000000000000000000000000186a0
Arg [4] : 0000000000000000000000000000000000000000000000000000000000003ada
Arg [5] : 000000000000000000000000000000000000000000000000000000000000816f
Arg [6] : 0000000000000000000000000000000000000000000000001bc16d674ec80000
Arg [7] : 00000000000000000000000000000000000000000000000000000000000003e8
Arg [8] : 0000000000000000000000000000000000000000000000000de0b6b3a7640000
Arg [9] : 000000000000000000000000000000000000000000000000000000000000000d
Arg [10] : 000000000000000000000000000000000000000000000000000000000000578e


Deployed ByteCode Sourcemap

737:17516:6:-:0;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;4204:332;;;;;;;;;;-1:-1:-1;4204:332:6;;;;;:::i;:::-;;:::i;:::-;;1342:38;;;;;;;;;;;;;:::i;:::-;;;;;;;:::i;:::-;;;;;;;;7390:4596;;;;;;;;;;-1:-1:-1;7390:4596:6;;;;;:::i;:::-;;:::i;:::-;;;;;;;;:::i;1571:55::-;;;;;;;;;;-1:-1:-1;1571:55:6;;;;;:::i;:::-;;:::i;4542:137::-;;;;;;;;;;-1:-1:-1;4542:137:6;;;;;:::i;:::-;;:::i;16957:223::-;;;;;;;;;;-1:-1:-1;16957:223:6;;;;;:::i;:::-;;:::i;:::-;;;;;;;:::i;1062:111::-;;;;;;;;;;;;;:::i;:::-;;;;;;;:::i;4082:116::-;;;;;;;;;;-1:-1:-1;4082:116:6;;;;;:::i;:::-;;:::i;1721:145:37:-;;;;;;;;;;;;;:::i;12255:3946:6:-;;;;;;;;;;-1:-1:-1;12255:3946:6;;;;;:::i;:::-;;:::i;:::-;;;;;;;;:::i;918:52::-;;;;;;;;;;;;;:::i;:::-;;;;;;;:::i;2567:426::-;;;;;;;;;;-1:-1:-1;2567:426:6;;;;;:::i;:::-;;:::i;1089:85:37:-;;;;;;;;;;;;;:::i;16693:258:6:-;;;;;;;;;;-1:-1:-1;16693:258:6;;;;;:::i;:::-;;:::i;3784:292::-;;;;;;:::i;:::-;;:::i;17186:223::-;;;;;;;;;;-1:-1:-1;17186:223:6;;;;;:::i;:::-;;:::i;2999:779::-;;;;;;;;;;-1:-1:-1;2999:779:6;;;;;:::i;:::-;;:::i;976:43::-;;;;;;;;;;;;;:::i;1179:157::-;;;;;;;;;;-1:-1:-1;1179:157:6;;;;;:::i;:::-;;:::i;17415:116::-;;;;;;;;;;;;;:::i;1447:59::-;;;;;;;;;;-1:-1:-1;1447:59:6;;;;;:::i;:::-;;:::i;1684:57::-;;;;;;;;;;;;;:::i;846:65::-;;;;;;;;;;;;;:::i;:::-;;;;;;;:::i;17646:605::-;;;;;;;;;;-1:-1:-1;17646:605:6;;;;;:::i;:::-;;:::i;2015:240:37:-;;;;;;;;;;-1:-1:-1;2015:240:37;;;;;:::i;:::-;;:::i;4204:332:6:-;4312:10;4286:23;4340:17;;;:8;:17;;;;;;:27;-1:-1:-1;4340:27:6;4332:58;;;;-1:-1:-1;;;4332:58:6;;;;;;;:::i;:::-;;;;;;;;;-1:-1:-1;;;;;4421:17:6;;;;;;:8;:17;;;;;;:29;;4443:6;4421:21;:29::i;:::-;-1:-1:-1;;;;;4401:17:6;;;;;;;:8;:17;;;;;;:49;;;;4460:21;;:13;;;;:21;;;;;4474:6;;4460:21;4401:17;4460:21;4474:6;4460:13;:21;;;;;;;;;;;;;;;;;;;;;4516:4;-1:-1:-1;;;;;4497:32:6;4507:7;-1:-1:-1;;;;;4497:32:6;;4522:6;4497:32;;;;;;:::i;:::-;;;;;;;;4204:332;;;:::o;1342:38::-;1378:2;1342:38;:::o;7390:4596::-;7643:22;7667:24;7707:25;;:::i;:::-;7764:9;7742:19;;;:31;7792:14;:12;:14::i;:::-;7791:15;7783:42;;;;-1:-1:-1;;;7783:42:6;;;;;;;:::i;:::-;7893:1;7859:20;:12;;:20;:::i;:::-;:25;;;;;;;:::i;:::-;:32;;:35;;:102;;7959:1;7859:102;;;7897:52;7920:20;:12;;:20;:::i;:::-;:25;;;;;;;:::i;:::-;7897:52;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;-1:-1:-1;7897:52:6;-1:-1:-1;7897:22:6;;-1:-1:-1;;7897:52:6:i;:::-;-1:-1:-1;;;;;;7835:126:6;:21;;;;:126;;;;8079:10;8063:27;;;;:15;:27;;;;;;-1:-1:-1;;;;;8063:27:6;8043:17;;;:47;8438:11;;8403:22;;;;:12;:22;:::i;:::-;:31;:46;;8395:76;;;;-1:-1:-1;;;8395:76:6;;;;;;;:::i;:::-;8509:14;8489:16;:34;;8481:67;;;;-1:-1:-1;;;8481:67:6;;;;;;;:::i;:::-;8619:96;8642:19;8663:12;8677:4;:19;;;8698:16;8619:22;:96::i;:::-;8583:19;;;8559:156;8560:21;;;8559:156;8726:79;8769:12;8782:9;;8792:12;;8726:42;:79::i;:::-;9034:17;;8993:21;;9030:2;9017:9;9027:2;9017:12;:15;;;;;;:34;8993:58;;9083:9;9061:4;:19;;:31;;;;;9103:22;9184:6;:19;;;9163:6;:18;;;9144:16;9128:13;:32;:53;:75;9103:100;;9472:12;9486:28;9526:4;-1:-1:-1;;;;;9518:18:6;9541:13;9592:32;;;9626:12;9640:9;;9651:12;;9665:4;:21;;;9721:9;9704:14;:26;9748:4;:19;;;9569:216;;;;;;;;;;;;;;;:::i;:::-;;;;-1:-1:-1;;9569:216:6;;;;;;;;;;;;;;-1:-1:-1;;;;;9569:216:6;-1:-1:-1;;;;;;9569:216:6;;;;;;;;;;9518:277;;;;9569:216;9518:277;:::i;:::-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;-1:-1:-1;9805:22:6;;;;;9471:324;;-1:-1:-1;9471:324:6;-1:-1:-1;9877:9:6;9857:19;;;;:29;9837:17;;;:49;9941:53;;;;;;;;;;;;;;:::i;:::-;9897:4;:11;;9910:4;:27;;9896:98;;;;;;;;;;;;;;;;;;;;;;-1:-1:-1;;10009:27:6;;;;:34;:36;10004:133;;10067:59;10085:4;:11;;;10098:4;:27;;;10067:59;;;;;;;:::i;:::-;;;;;;;;10004:133;7390:4596;;;;10177:32;10193:8;;:15;;10177;:32::i;:::-;10158:16;;;:51;10224:12;;10219:1005;;10324:36;10309:4;:11;;;:51;;;;;;;;;:383;;;-1:-1:-1;10449:16:6;;;;10406:21;;;;:38;:60;;:42;:60::i;:::-;10385:4;:17;;;:81;;10384:308;;;;-1:-1:-1;10508:35:6;10493:4;:11;;;:50;;;;;;;;;:130;;;-1:-1:-1;10582:41:6;10567:4;:11;;;:56;;;;;;;;;10493:130;10305:909;;;10730:5;;-1:-1:-1;10904:20:6;:12;;:20;:::i;:::-;:25;;;;;;;:::i;:::-;-1:-1:-1;;;;;10759:379:6;10850:22;;;;:12;:22;:::i;:::-;:32;;;;;;;;;:::i;:::-;10811:17;;;;-1:-1:-1;;;;;10759:379:6;;;;;;10951:20;:12;;:20;:::i;:::-;:23;;;;;;;;;:::i;:::-;10996:10;11028:4;:21;;;11071:4;:17;;;11110:4;:27;;;10759:379;;;;;;;;;;:::i;:::-;;;;;;;;11171:27;;;11164:5;;-1:-1:-1;11171:27:6;-1:-1:-1;11156:43:6;;10305:909;11372:18;;11321:15;;11359:9;11340:28;;11339:51;;-1:-1:-1;11400:14:6;11417:48;11339:51;11442:22;;;;:12;:22;:::i;11417:48::-;11400:65;;11521:54;11568:6;11521:8;:42;11530:12;:22;;;;;;;;:::i;:::-;:32;;;;;;;;;:::i;:::-;-1:-1:-1;;;;;11521:42:6;;;;;;;;;;;;-1:-1:-1;11521:42:6;;;:46;:54::i;:::-;11476:8;:42;11485:22;;;;:12;:22;:::i;:::-;:32;;;;;;;;;:::i;:::-;-1:-1:-1;;;;;11476:42:6;;;;;;;;;;;;;;;;;-1:-1:-1;11476:42:6;;;:99;;;;11624:17;;;;11615:27;;;:8;:27;;;;;;:39;;11647:6;11615:31;:39::i;:::-;11594:17;;;;-1:-1:-1;;;;;11585:27:6;;;;;:8;:27;;;;;:69;11757:20;:12;;:20;:::i;:::-;:25;;;;;;;:::i;:::-;11702:17;;;;-1:-1:-1;;;;;11670:276:6;;;;11733:10;;11670:276;;11796:20;:12;;:20;:::i;:::-;:23;;;;;;;;;:::i;:::-;11833:12;:22;;;;;;;;:::i;:::-;:32;;;;;;;;;:::i;:::-;11879:4;:21;;;11914:4;:11;;;11939:6;11670:276;;;;;;;;;;:::i;:::-;;;;;;;;11964:4;11956:17;;;;;;;;;;;;;;;;;;;7390:4596;;;;;;;;;;;:::o;1571:55::-;;;;;;;;;;;;;:::o;4542:137::-;4639:25;;4613:7;;4639:37;;4669:6;4639:29;:37::i;:::-;4632:44;;4542:137;;;;:::o;16957:223::-;17125:19;;17146:26;;17062:111;;-1:-1:-1;;;17062:111:6;;17039:4;;-1:-1:-1;;;;;17062:12:6;:33;;;;:111;;17096:12;;17118:4;;17062:111;;;:::i;:::-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;:::i;1062:::-;1120:21;;:::i;:::-;-1:-1:-1;1153:13:6;;;;;;;;1160:6;1153:13;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;1062:111;:::o;4082:116::-;-1:-1:-1;;;;;4175:16:6;4149:7;4175:16;;;:8;:16;;;;;;;4082:116::o;1721:145:37:-;1312:12;:10;:12::i;:::-;-1:-1:-1;;;;;1301:23:37;:7;:5;:7::i;:::-;-1:-1:-1;;;;;1301:23:37;;1293:68;;;;;-1:-1:-1;;;1293:68:37;;;;;;;;;;;;;-1:-1:-1;;;;;;;;;;;1293:68:37;;;;;;;;;;;;;;;1827:1:::1;1811:6:::0;;1790:40:::1;::::0;-1:-1:-1;;;;;1811:6:37;;::::1;::::0;1790:40:::1;::::0;1827:1;;1790:40:::1;1857:1;1840:19:::0;;-1:-1:-1;;;;;;1840:19:37::1;::::0;;1721:145::o;12255:3946:6:-;12563:15;12580:12;12608:30;;:::i;:::-;13066:10;13088:4;13066:27;13058:66;;;;-1:-1:-1;;;13058:66:6;;;;;;;:::i;:::-;13544:8;:42;13553:22;;;;:12;:22;:::i;:::-;:32;;;;;;;;;:::i;:::-;-1:-1:-1;;;;;13544:42:6;;;;;;;;;;;;;;-1:-1:-1;13544:42:6;;13523:63;;13728:151;-1:-1:-1;;;13764:34:6;13728:151;;13816:12;;13830:9;;;;13841:12;;;;13855:14;;13728:151;;;:::i;:::-;;;;-1:-1:-1;;13728:151:6;;;;;;;;;;;;;;;-1:-1:-1;;;;;13728:151:6;-1:-1:-1;;;;;;13728:151:6;;;;;;;;;;13716:9;;;:163;-1:-1:-1;;13929:20:6;;13984:22;;;;:12;:22;:::i;:::-;:32;;;;;;;;;:::i;:::-;-1:-1:-1;;;;;13984:37:6;14026:16;:39;;;14067:4;:9;;;13984:93;;;;;;:::i;:::-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;-1:-1:-1;13963:114:6;;-1:-1:-1;13963:114:6;-1:-1:-1;13963:114:6;14091:169;;14123:41;14156:7;14123:32;:41::i;:::-;14182:63;14199:36;14237:7;14182:16;:63::i;:::-;14340:7;14329:33;;;;;;;;;;;;:::i;:::-;14273:89;;14297:28;;;14273:89;14274:21;;;14273:89;-1:-1:-1;;;;14628:49:6;14653:12;14667:9;;14628:24;:49::i;:::-;14597:27;;;14553:124;;;14572:23;;;14553:124;;-1:-1:-1;14553:124:6;14691:140;;14734:82;14751:35;14788:4;:27;;;14734:16;:82::i;:::-;14849:4;:28;;;:56;;;;;14882:4;:23;;;14881:24;14849:56;14845:247;;;14989:88;15006:41;15049:4;:27;;;14989:16;:88::i;:::-;12255:3946;15412:35;;;15461:4;:21;;;15496:4;:23;;;15551:9;15533:15;:27;15596:12;:22;;;;;;;;:::i;:::-;15376:252;;;;;;;;;;;:::i;:::-;;;;-1:-1:-1;;15376:252:6;;;;;;;;;;;;;;;-1:-1:-1;;;;;15376:252:6;-1:-1:-1;;;;;;15376:252:6;;;;;;;;;;15364:9;;;:264;-1:-1:-1;;;;15687:22:6;;;;:12;:22;:::i;:::-;:32;;;;;;;;;:::i;:::-;-1:-1:-1;;;;;15687:37:6;15729:16;:40;;;15771:4;:9;;;15687:94;;;;;;:::i;:::-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;15649:132;;;;15797:11;15792:99;;15824:56;15841:33;15876:3;15824:16;:56::i;:::-;-1:-1:-1;;15960:18:6;;15915:8;15960:18;15924:22;;;;:12;:22;:::i;:::-;:32;;;;;;;;;:::i;:::-;-1:-1:-1;;;;;15915:42:6;-1:-1:-1;;;;;15915:42:6;;;;;;;;;;;;;:63;15911:155;;;15994:61;16011:39;15994:61;;;;;;;;;;;;:16;:61::i;:::-;16084:4;:23;;;:80;;16131:33;16084:80;;;16110:18;16084:80;16166:4;:27;;;16076:118;;;;;12255:3946;;;;;;;;;;;:::o;918:52::-;;;:::o;2567:426::-;2711:10;2752:34;2711:10;2752:20;:34::i;:::-;2731:105;;;;-1:-1:-1;;;2731:105:6;;;;;;;:::i;:::-;-1:-1:-1;;;;;2854:25:6;;2882:1;2854:25;;;:11;:25;;;;;;2846:58;;;;-1:-1:-1;;;2846:58:6;;;;;;;:::i;:::-;2941:12;-1:-1:-1;;;;;2919:67:6;;2955:12;2969:11;2982:3;;2919:67;;;;;;;;;:::i;:::-;;;;;;;;2567:426;;;;;:::o;1089:85:37:-;1135:7;1161:6;-1:-1:-1;;;;;1161:6:37;1089:85;:::o;16693:258:6:-;16812:7;16838:106;16865:78;16939:3;16866:67;16902:30;:21;;;;16939:3;16902:25;:30::i;:::-;16866:31;:7;16878:18;;16866:11;:31::i;:::-;:35;;:67::i;:::-;16865:73;;:78::i;:::-;16838:22;;;;;:26;:106::i;:::-;16831:113;;16693:258;;;;;:::o;3784:292::-;3908:30;;3871:9;;3898:40;;;3890:68;;;;-1:-1:-1;;;3890:68:6;;;;;;;:::i;:::-;-1:-1:-1;;;;;3988:16:6;;;;;;:8;:16;;;;;;:28;;4009:6;3988:20;:28::i;:::-;-1:-1:-1;;;;;3969:16:6;;;;;;:8;:16;;;;;;;:47;;;;4032:37;;4050:10;;3969:16;4032:37;;;;4062:6;;4032:37;:::i;:::-;;;;;;;;3784:292;;:::o;17186:223::-;1312:12:37;:10;:12::i;:::-;-1:-1:-1;;;;;1301:23:37;:7;:5;:7::i;:::-;-1:-1:-1;;;;;1301:23:37;;1293:68;;;;;-1:-1:-1;;;1293:68:37;;;;;;;;;;;;;-1:-1:-1;;;;;;;;;;;1293:68:37;;;;;;;;;;;;;;;17290:12:6::1;17271:16;;:31;17263:62;;;;-1:-1:-1::0;;;17263:62:6::1;;;;;;;:::i;:::-;17335:16;:28:::0;;;17378:24:::1;::::0;::::1;::::0;::::1;::::0;17354:9;;17378:24:::1;:::i;:::-;;;;;;;;17186:223:::0;:::o;2999:779::-;3111:10;3088:20;3156:25;;;:11;:25;;;;;;;:50;;3216:42;;;;3294:6;:21;3276:39;;;3268:68;;;;-1:-1:-1;;;3268:68:6;;;;;;;:::i;:::-;3368:34;3389:12;3368:20;:34::i;:::-;3347:105;;;;-1:-1:-1;;;3347:105:6;;;;;;;:::i;:::-;3468:9;3463:229;3483:26;;;3463:229;;;3585:1;3538:15;3585:1;3554:15;;3570:1;3554:18;;;;;;;;;;;;;;;;;;;;:::i;:::-;-1:-1:-1;;;;;3538:35:6;;;;;;;;;;;;;;-1:-1:-1;3538:35:6;;;:49;3530:87;;;;-1:-1:-1;;;3530:87:6;;;;;;;:::i;:::-;3669:12;3631:15;:35;3647:15;;3663:1;3647:18;;;;;;;;;;;;;;;;;;;;:::i;:::-;-1:-1:-1;;;;;3631:35:6;;;;;;;;;;;;;;-1:-1:-1;3631:35:6;:50;;-1:-1:-1;;;;;;3631:50:6;;;;;;;;;;;-1:-1:-1;3511:3:6;3463:229;;;;3725:12;-1:-1:-1;;;;;3707:64:6;;3739:15;;3756:14;3707:64;;;;;;;;:::i;:::-;;;;;;;;2999:779;;;;:::o;976:43::-;;;:::o;1179:157::-;1312:12:37;:10;:12::i;:::-;-1:-1:-1;;;;;1301:23:37;:7;:5;:7::i;:::-;-1:-1:-1;;;;;1301:23:37;;1293:68;;;;;-1:-1:-1;;;1293:68:37;;;;;;;;;;;;;-1:-1:-1;;;;;;;;;;;1293:68:37;;;;;;;;;;;;;;;1272:16:6;;:6:::1;:16:::0;;;::::1;::::0;::::1;::::0;;;::::1;::::0;;::::1;::::0;;;::::1;::::0;::::1;::::0;;;::::1;::::0;::::1;::::0;;;::::1;::::0;::::1;::::0;;;::::1;::::0;::::1;::::0;;;::::1;::::0;::::1;::::0;;;::::1;::::0;::::1;::::0;;;1303:26;::::1;::::0;::::1;::::0;::::1;:::i;17415:116::-:0;17508:16;;17492:12;:32;;17415:116;:::o;1447:59::-;;;;;;;;;;;;-1:-1:-1;;;;;1447:59:6;;:::o;1684:57::-;;;;:::o;846:65::-;;;;;;;;;;;;;;;-1:-1:-1;;846:65:6;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;:::o;17646:605::-;17581:10;-1:-1:-1;;;;;17595:9:6;17581:23;;17573:49;;;;-1:-1:-1;;;17573:49:6;;;;;;;:::i;:::-;-1:-1:-1;;;;;17779:28:6;;::::1;17756:20;17779:28:::0;;;:15:::1;:28;::::0;;;;;::::1;17899:26:::0;17891:59:::1;;;;-1:-1:-1::0;;;17891:59:6::1;;;;;;;:::i;:::-;17981:34;18002:12;17981:20;:34::i;:::-;17960:105;;;;-1:-1:-1::0;;;17960:105:6::1;;;;;;;:::i;:::-;18118:39;::::0;-1:-1:-1;;;18118:39:6;;18075:40:::1;::::0;-1:-1:-1;;;;;18118:12:6::1;:25;::::0;::::1;::::0;:39:::1;::::0;18144:12;;18118:39:::1;;;:::i;:::-;;;;;;;;;;;;;;;;;::::0;::::1;;;;;;;;;;;;::::0;::::1;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;:::i;:::-;18228:15:::0;;18167:77:::1;::::0;-1:-1:-1;;;18167:77:6;;18075:82;;-1:-1:-1;;;;;;18167:12:6::1;:33;::::0;::::1;::::0;:77:::1;::::0;18201:12;;18215:11;;18167:77:::1;;;:::i;:::-;;;;;;;;;;;;;;;;;;::::0;::::1;;;;;;;;;;;;::::0;::::1;;;;;;;;;17632:1;;17646:605:::0;;:::o;2015:240:37:-;1312:12;:10;:12::i;:::-;-1:-1:-1;;;;;1301:23:37;:7;:5;:7::i;:::-;-1:-1:-1;;;;;1301:23:37;;1293:68;;;;;-1:-1:-1;;;1293:68:37;;;;;;;;;;;;;-1:-1:-1;;;;;;;;;;;1293:68:37;;;;;;;;;;;;;;;-1:-1:-1;;;;;2103:22:37;::::1;2095:73;;;;-1:-1:-1::0;;;2095:73:37::1;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;2204:6;::::0;;2183:38:::1;::::0;-1:-1:-1;;;;;2183:38:37;;::::1;::::0;2204:6;::::1;::::0;2183:38:::1;::::0;::::1;2231:6;:17:::0;;-1:-1:-1;;;;;;2231:17:37::1;-1:-1:-1::0;;;;;2231:17:37;;;::::1;::::0;;;::::1;::::0;;2015:240::o;3136:155:39:-;3194:7;3226:1;3221;:6;;3213:49;;;;;-1:-1:-1;;;3213:49:39;;;;;;;;;;;;;;;;;;;;;;;;;;;;-1:-1:-1;3279:5:39;;;3136:155::o;2483:571:33:-;2603:13;2652:5;2660:1;2652:9;2640:1;:8;:21;;2632:60;;;;;-1:-1:-1;;;2632:60:33;;;;;;;;;;;;;;;;;;;;;;;;;;;;-1:-1:-1;2787:21:33;2804:2;2787:21;2781:28;-1:-1:-1;;;;;;2936:79:33;;2483:571::o;4685:2246:6:-;4913:51;;:::i;:::-;4966:22;5042;;;;:12;:22;:::i;:::-;:32;;;;;;;;;:::i;:::-;-1:-1:-1;;;;;5031:64:6;;5100:5;5031:77;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;:::i;:::-;5145:34;;;;5000:108;;-1:-1:-1;5126:8:6;:53;;5118:90;;;;-1:-1:-1;;;5118:90:6;;;;;;;:::i;:::-;5218:19;5240:32;5256:8;5240:15;:32::i;:::-;5349:35;;5218:54;;-1:-1:-1;5313:33:6;;;:71;5282:28;5443:8;5313:71;5443:8;5422:36;;;;;5394:64;;1378:2;5476:17;:30;;5508:195;;;;;;;;;;;;;;-1:-1:-1;;;5508:195:6;;;5685:17;5508:142;;;;;;;;;;;;;;-1:-1:-1;;;5508:142:6;;;5635:14;5508:86;;;;;;;;;;;;;;-1:-1:-1;;;5508:86:6;;;5577:16;5508:46;;;;;;;;;;;;;;;;;;;:86;;;;;:::i;:::-;:106;:142;:106;:142::i;:195::-;5468:245;;;;;-1:-1:-1;;;5468:245:6;;;;;;;;:::i;:::-;-1:-1:-1;5755:33:6;;5732:56;;;5724:95;;;;-1:-1:-1;;;5724:95:6;;;;;;;:::i;:::-;5874:39;;;;5837:33;;:76;;5829:114;;;;-1:-1:-1;;;5829:114:6;;;;;;;:::i;:::-;5983:247;6209:20;5983:208;6179:11;5983:208;6136:20;:12;;:20;:::i;:::-;:24;;;5983:135;6077:16;:40;;;5983:76;6019:16;:39;;;5983:6;:18;;;:22;;:76;;;;:::i;:::-;:80;;:135::i;:247::-;5954:276;;6453:14;6433:16;:34;;6412:97;;;;-1:-1:-1;;;6412:97:6;;;;;;;:::i;:::-;6520:25;6548:89;6577:14;6605:22;;;;:12;:22;:::i;6548:89::-;6520:117;-1:-1:-1;6840:8:6;:42;6849:22;;;;:12;:22;:::i;:::-;:32;;;;;;;;;:::i;:::-;-1:-1:-1;;;;;6840:42:6;-1:-1:-1;;;;;6840:42:6;;;;;;;;;;;;;6819:17;:63;;6811:113;;;;-1:-1:-1;;;6811:113:6;;;;;;;:::i;:::-;4685:2246;;;;;;;;;;;:::o;224:1134:35:-;950:23;1147:54;1164:22;;;;:12;:22;:::i;:::-;:36;;;;;;;:::i;:::-;1147:16;:54::i;:::-;1089:43;1106:20;:12;;:20;:::i;:::-;:25;;;;;;;:::i;1089:43::-;1044:30;1061:12;;1044:16;:30::i;:::-;1002:27;1019:9;;1002:16;:27::i;:::-;976:98;:156;:225;:11;:225;;-1:-1:-1;1239:2:35;1219:22;;;1211:59;;;;-1:-1:-1;;;1211:59:35;;;;;;;:::i;:::-;1310:8;1288:37;;1280:71;;;;-1:-1:-1;;;1280:71:35;;;;;;;:::i;:::-;224:1134;;;;;;:::o;2690:175:39:-;2748:7;2779:5;;;2802:6;;;;2794:46;;;;;-1:-1:-1;;;2794:46:39;;;;;;;;;;;;;;;;;;;;;;;;;;;3538:215;3596:7;3619:6;3615:20;;-1:-1:-1;3634:1:39;3627:8;;3615:20;3657:5;;;3661:1;3657;:5;:1;3680:5;;;;;:10;3672:56;;;;-1:-1:-1;;;3672:56:39;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;598:104:40;685:10;598:104;:::o;4307:125:30:-;4375:50;4403:4;477;4375:27;:50::i;:::-;4307:125;:::o;16348:339:6:-;16439:17;16470:6;16478:3;16459:23;;;;;;;;;:::i;:::-;;;;;;;;;;;;;16439:43;;16492:38;16525:4;16492:32;:38::i;:::-;16586:4;16580:11;16629:2;16623:4;16619:13;16662:8;16653:7;16646:25;3268:813:30;3374:21;3397:16;3415;3444:23;3471:26;3484:12;3471;:26::i;:::-;3443:54;-1:-1:-1;3507:24:30;3534:49;3550:22;;;;:12;:22;:::i;:::-;:32;;;;;;;;;:::i;:::-;3534:15;:49::i;:::-;3507:76;-1:-1:-1;3681:22:30;;;;:12;:22;:::i;:::-;:32;;;;;;;;;:::i;:::-;-1:-1:-1;;;;;3681:37:30;-1:-1:-1;;;3796:20:30;:12;;:20;:::i;:::-;3818:16;1178:18;;;;;;;;;;;;;-1:-1:-1;;;1178:18:30;;;1201:14;;;;;;;;;;;;;;;;;1086;;;;;;;;;;;;;;;;;1045:56;;;;;;;;:::i;:::-;;;;-1:-1:-1;;1045:56:30;;;;;;;;;;1152:90;;;;1045:56;1152:90;;:::i;:::-;;;;;;;;;;;;;1374:29;;;;;;3860:10;3872:9;;3732:159;;;;;;;;;;;;;:::i;:::-;;;;-1:-1:-1;;3732:159:30;;;;;;;;;;;;;;-1:-1:-1;;;;;3732:159:30;-1:-1:-1;;;;;;3732:159:30;;;;;;;;;;3681:211;;;;3732:159;3681:211;:::i;:::-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;-1:-1:-1;3655:237:30;;-1:-1:-1;3655:237:30;-1:-1:-1;3902:143:30;;;;4015:3;4004:30;;;;;;;;;;;;:::i;:::-;3983:51;;-1:-1:-1;3983:51:30;-1:-1:-1;3902:143:30;4054:20;4070:3;4054:15;:20::i;:::-;3268:813;;;;;;;;;:::o;4217:150:39:-;4275:7;4306:1;4302;:5;4294:44;;;;;-1:-1:-1;;;4294:44:39;;;;;;;;;;;;;;;;;;;;;;;;;;;;4359:1;4355;:5;;;;;;;4217:150;-1:-1:-1;;;4217:150:39:o;818:176:8:-;906:13;962:3;967:5;974:11;983:1;974:8;:11::i;:::-;945:41;;;;;;;;;;;;;;;;;;;;;;;;;-1:-1:-1;;945:41:8;;;;;;;;;;;;;;;;;;;;;;-1:-1:-1;;945:41:8;;;;;;;;;;;;;;;;;;;;;-1:-1:-1;945:41:8;;;;;;;;;;;;;-1:-1:-1;;945:41:8;;;;;;;;;;;;;;;;;;;;;;-1:-1:-1;;945:41:8;;;;;;;;;;;;;;;;;;;;;-1:-1:-1;945:41:8;;;;;;;;;;;;;-1:-1:-1;;945:41:8;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;931:56;;818:176;;;;;:::o;1572:135:35:-;1664:2;1684;1671:15;;-1:-1:-1;;1670:29:35;1664:36;1572:135;;;;:::o;429:173:33:-;531:6;517:4;:11;:20;513:83;;;577:6;571:4;564:20;562:24;429:173;;:::o;1713:229:30:-;1829:23;1906:28;1920:13;;;;:3;:13;:::i;:::-;1906;:28::i;:::-;1882:53;;;;;;;;:::i;:::-;;;;;;;;;;;;;1869:66;;1713:229;;;:::o;4438:292::-;4542:180;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;-1:-1:-1;;;4542:180:30;;;;;;;;;;;4505:7;;4531:192;;4542:180;-1:-1:-1;;4652:12:30;:10;:12::i;:::-;4542:180;;;;4698:9;-1:-1:-1;;;;;4542:180:30;;;;4531:10;:192::i;2919:465:8:-;2969:27;3012:7;3008:48;;-1:-1:-1;3035:10:8;;;;;;;;;;;;-1:-1:-1;;;3035:10:8;;;;;;3008:48;3074:2;3065:6;3104:66;3111:6;;3104:66;;3133:5;;3157:2;3152:7;;;;3104:66;;;3179:17;3209:3;-1:-1:-1;;;;;3199:14:8;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;-1:-1:-1;3199:14:8;-1:-1:-1;3179:34:8;-1:-1:-1;;;3232:7:8;;3249:100;3256:7;;3249:100;;3312:2;3307;:7;3302:2;:12;3291:25;;3279:4;3284:3;;;;;;;3279:9;;;;;;;;;;;:37;-1:-1:-1;;;;;3279:37:8;;;;;;;;-1:-1:-1;3336:2:8;3330:8;;;;3249:100;;;-1:-1:-1;3372:4:8;2919:465;-1:-1:-1;;;;2919:465:8:o;5239:451:30:-;5318:7;1304:14;;;;;;;;;;;;;;;;;1294:25;;;;;;;;5418:12;;;5448:15;;;5481:16;;;;5515:15;;;;;;;;:::i;:::-;5548:13;;;;;;;;:::i;:::-;5579;;;;;;;;:::i;:::-;5620:17;;;;:3;:17;:::i;:::-;5610:28;;;;;;;:::i;:::-;;;;;;;;;5354:328;;;;;;;;;5656:12;;;;;5354:328;;;:::i;:::-;;;;;;;;;;;;;5344:339;;;;;;5337:346;;5239:451;;;:::o;4736:170::-;4881:9;;4861:39::o;4912:321::-;4980:7;1597:109;5099:3;:8;;;5083:26;;;;;;5143:3;:11;;;5127:29;;;;;;5174:3;:11;;;5203:3;:21;;;5016:209;;;;;;;;;;;;:::i;-1:-1:-1:-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;:::i;:::-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;:::o;:::-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;:::o;:::-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;:::o;:::-;;;;;;;;;;;;;;;;;;;;;;;;;;;;;:::o;14:166:41:-;92:13;;141;;134:21;124:32;;114:2;;170:1;167;160:12;185:377;;;302:3;295:4;287:6;283:17;279:27;269:2;;327:8;317;310:26;269:2;-1:-1:-1;357:20:41;;-1:-1:-1;;;;;389:30:41;;386:2;;;439:8;429;422:26;386:2;483:4;475:6;471:17;459:29;;535:3;528:4;519:6;511;507:19;503:30;500:39;497:2;;;552:1;549;542:12;497:2;259:303;;;;;:::o;567:504::-;;675:3;668:4;660:6;656:17;652:27;642:2;;697:5;690;683:20;642:2;730:6;724:13;-1:-1:-1;;;;;752:2:41;749:26;746:2;;;778:9;746:2;813:54;855:2;836:13;;-1:-1:-1;;832:27:41;861:4;828:38;813:54;:::i;:::-;892:2;883:7;876:19;938:3;931:4;926:2;918:6;914:15;910:26;907:35;904:2;;;959:5;952;945:20;904:2;976:64;1037:2;1030:4;1021:7;1017:18;1010:4;1002:6;998:17;976:64;:::i;:::-;1058:7;632:439;-1:-1:-1;;;;632:439:41:o;1076:171::-;;1189:2;1180:6;1175:3;1171:16;1167:25;1164:2;;;1209:5;1202;1195:20;1164:2;-1:-1:-1;1235:6:41;1154:93;-1:-1:-1;1154:93:41:o;1252:259::-;;1364:2;1352:9;1343:7;1339:23;1335:32;1332:2;;;1385:6;1377;1370:22;1332:2;1429:9;1416:23;1448:33;1475:5;1448:33;:::i;1516:410::-;;;1653:2;1641:9;1632:7;1628:23;1624:32;1621:2;;;1674:6;1666;1659:22;1621:2;1718:9;1705:23;1737:33;1764:5;1737:33;:::i;:::-;1789:5;-1:-1:-1;1846:2:41;1831:18;;1818:32;1859:35;1818:32;1859:35;:::i;:::-;1913:7;1903:17;;;1611:315;;;;;:::o;1931:666::-;;;2078:2;2066:9;2057:7;2053:23;2049:32;2046:2;;;2099:6;2091;2084:22;2046:2;2144:9;2131:23;-1:-1:-1;;;;;2214:2:41;2206:6;2203:14;2200:2;;;2235:6;2227;2220:22;2200:2;2278:6;2267:9;2263:22;2253:32;;2323:7;2316:4;2312:2;2308:13;2304:27;2294:2;;2350:6;2342;2335:22;2294:2;2395;2382:16;2421:2;2413:6;2410:14;2407:2;;;2442:6;2434;2427:22;2407:2;2501:7;2496:2;2490;2482:6;2478:15;2474:2;2470:24;2466:33;2463:46;2460:2;;;2527:6;2519;2512:22;2460:2;2563;2555:11;;;;;2585:6;;-1:-1:-1;2036:561:41;;-1:-1:-1;;;;2036:561:41:o;2602:214::-;;2722:2;2710:9;2701:7;2697:23;2693:32;2690:2;;;2743:6;2735;2728:22;2690:2;2771:39;2800:9;2771:39;:::i;2821:438::-;;;2967:2;2955:9;2946:7;2942:23;2938:32;2935:2;;;2988:6;2980;2973:22;2935:2;3016:39;3045:9;3016:39;:::i;:::-;3006:49;;3099:2;3088:9;3084:18;3078:25;-1:-1:-1;;;;;3118:6:41;3115:30;3112:2;;;3163:6;3155;3148:22;3112:2;3191:62;3245:7;3236:6;3225:9;3221:22;3191:62;:::i;:::-;3181:72;;;2925:334;;;;;:::o;3264:438::-;;;3410:2;3398:9;3389:7;3385:23;3381:32;3378:2;;;3431:6;3423;3416:22;3378:2;3469:9;3463:16;-1:-1:-1;;;;;3494:6:41;3491:30;3488:2;;;3539:6;3531;3524:22;3488:2;3567:62;3621:7;3612:6;3601:9;3597:22;3567:62;:::i;:::-;3557:72;;;3648:48;3692:2;3681:9;3677:18;3648:48;:::i;:::-;3638:58;;3368:334;;;;;:::o;3707:524::-;;;3876:2;3864:9;3855:7;3851:23;3847:32;3844:2;;;3897:6;3889;3882:22;3844:2;3934:9;3928:16;3973:1;3966:5;3963:12;3953:2;;3994:6;3986;3979:22;3953:2;4071;4056:18;;4050:25;4022:5;;-1:-1:-1;;;;;;4087:30:41;;4084:2;;;4135:6;4127;4120:22;4236:631;;4393:3;4381:9;4372:7;4368:23;4364:33;4361:2;;;4415:6;4407;4400:22;4361:2;4453;4447:9;4495:3;4487:6;4483:16;4565:6;4553:10;4550:22;-1:-1:-1;;;;;4517:10:41;4514:34;4511:62;4508:2;;;4576:9;4508:2;4607:10;4603:2;4596:22;;4648:9;4642:16;4634:6;4627:32;4713:2;4702:9;4698:18;4692:25;4687:2;4679:6;4675:15;4668:50;4772:2;4761:9;4757:18;4751:25;4746:2;4738:6;4734:15;4727:50;4831:2;4820:9;4816:18;4810:25;4805:2;4797:6;4793:15;4786:50;4855:6;4845:16;;;4351:516;;;;:::o;4872:863::-;;4994:3;5038:2;5026:9;5017:7;5013:23;5009:32;5006:2;;;5059:6;5051;5044:22;5006:2;5090:18;5105:2;5090:18;:::i;:::-;5077:31;;5144:9;5131:23;5124:5;5117:38;5215:2;5204:9;5200:18;5187:32;5182:2;5175:5;5171:14;5164:56;5280:2;5269:9;5265:18;5252:32;5247:2;5240:5;5236:14;5229:56;5345:2;5334:9;5330:18;5317:32;5312:2;5305:5;5301:14;5294:56;5411:3;5400:9;5396:19;5383:33;5377:3;5370:5;5366:15;5359:58;5478:3;5467:9;5463:19;5450:33;5444:3;5437:5;5433:15;5426:58;5545:3;5534:9;5530:19;5517:33;5511:3;5504:5;5500:15;5493:58;5612:3;5601:9;5597:19;5584:33;5578:3;5571:5;5567:15;5560:58;5637:3;5700:2;5689:9;5685:18;5672:32;5667:2;5660:5;5656:14;5649:56;;5724:5;5714:15;;;4974:761;;;;:::o;5740:1323::-;;;;;;;;;6034:9;6025:7;6021:23;6064:3;6060:2;6056:12;6053:2;;;6086:6;6078;6071:22;6053:2;6131:9;6118:23;-1:-1:-1;;;;;6201:2:41;6193:6;6190:14;6187:2;;;6222:6;6214;6207:22;6187:2;6250:75;6317:7;6308:6;6297:9;6293:22;6250:75;:::i;:::-;6240:85;;6378:2;6367:9;6363:18;6350:32;6334:48;;6407:2;6397:8;6394:16;6391:2;;;6428:6;6420;6413:22;6391:2;6472:62;6526:7;6515:8;6504:9;6500:24;6472:62;:::i;:::-;6553:8;;-1:-1:-1;6446:88:41;-1:-1:-1;6641:2:41;6626:18;;6613:32;;-1:-1:-1;6657:16:41;;;6654:2;;;6691:6;6683;6676:22;6654:2;;6735:62;6789:7;6778:8;6767:9;6763:24;6735:62;:::i;:::-;6816:8;;-1:-1:-1;6709:88:41;-1:-1:-1;;6885:3:41;-1:-1:-1;;6867:16:41;;6863:26;6860:2;;;6907:6;6899;6892:22;6860:2;-1:-1:-1;6001:1062:41;;;;-1:-1:-1;6001:1062:41;;;;-1:-1:-1;6001:1062:41;;6950:2;6935:18;;;-1:-1:-1;7000:3:41;6985:19;;6972:33;;7052:3;7037:19;7024:33;;-1:-1:-1;6001:1062:41:o;7068:693::-;;7218:3;7206:9;7197:7;7193:23;7189:33;7186:2;;;7240:6;7232;7225:22;7186:2;7278;7272:9;7320:3;7312:6;7308:16;7390:6;7378:10;7375:22;-1:-1:-1;;;;;7342:10:41;7339:34;7336:62;7333:2;;;7401:9;7333:2;7432:10;7428:2;7421:22;;7473:9;7467:16;7459:6;7452:32;7538:2;7527:9;7523:18;7517:25;7512:2;7504:6;7500:15;7493:50;7597:2;7586:9;7582:18;7576:25;7571:2;7563:6;7559:15;7552:50;7645:2;7634:9;7630:18;7624:25;7658:33;7685:5;7658:33;:::i;:::-;7719:2;7707:15;;7700:30;7711:6;7176:585;-1:-1:-1;;;7176:585:41:o;7766:190::-;;7878:2;7866:9;7857:7;7853:23;7849:32;7846:2;;;7899:6;7891;7884:22;7846:2;-1:-1:-1;7927:23:41;;7836:120;-1:-1:-1;7836:120:41:o;7961:335::-;;;8098:2;8086:9;8077:7;8073:23;8069:32;8066:2;;;8119:6;8111;8104:22;8066:2;8160:9;8147:23;8137:33;;8220:2;8209:9;8205:18;8192:32;8233:33;8260:5;8233:33;:::i;8301:487::-;;;8459:2;8447:9;8438:7;8434:23;8430:32;8427:2;;;8480:6;8472;8465:22;8427:2;8521:9;8508:23;8498:33;;8582:2;8571:9;8567:18;8554:32;-1:-1:-1;;;;;8601:6:41;8598:30;8595:2;;;8646:6;8638;8631:22;8595:2;8674:22;;8730:3;8712:16;;;8708:26;8705:2;;;8752:6;8744;8737:22;8793:1146;;;;;;;;9043:3;9031:9;9022:7;9018:23;9014:33;9011:2;;;9065:6;9057;9050:22;9011:2;9106:9;9093:23;9083:33;;9167:2;9156:9;9152:18;9139:32;-1:-1:-1;;;;;9231:2:41;9223:6;9220:14;9217:2;;;9252:6;9244;9237:22;9217:2;9280:75;9347:7;9338:6;9327:9;9323:22;9280:75;:::i;:::-;9270:85;;9408:2;9397:9;9393:18;9380:32;9364:48;;9437:2;9427:8;9424:16;9421:2;;;9458:6;9450;9443:22;9421:2;9502:62;9556:7;9545:8;9534:9;9530:24;9502:62;:::i;:::-;9583:8;;-1:-1:-1;9476:88:41;-1:-1:-1;9671:2:41;9656:18;;9643:32;;-1:-1:-1;9687:16:41;;;9684:2;;;9721:6;9713;9706:22;9684:2;;9765:62;9819:7;9808:8;9797:9;9793:24;9765:62;:::i;:::-;9001:938;;;;-1:-1:-1;9001:938:41;;;;;;9928:3;9913:19;;;9900:33;;9001:938;-1:-1:-1;;;;9001:938:41:o;9944:568::-;;;;;10110:2;10098:9;10089:7;10085:23;10081:32;10078:2;;;10131:6;10123;10116:22;10078:2;10172:9;10159:23;10149:33;;10229:2;10218:9;10214:18;10201:32;10191:42;;10284:2;10273:9;10269:18;10256:32;-1:-1:-1;;;;;10303:6:41;10300:30;10297:2;;;10348:6;10340;10333:22;10297:2;10392:60;10444:7;10435:6;10424:9;10420:22;10392:60;:::i;:::-;10068:444;;;;-1:-1:-1;10471:8:41;-1:-1:-1;;;;10068:444:41:o;10517:114::-;-1:-1:-1;;;;;10593:31:41;10581:44;;10571:60::o;10636:270::-;;10726:6;10721:3;10714:19;10778:6;10771:5;10764:4;10759:3;10755:14;10742:43;10830:3;10823:4;10814:6;10809:3;10805:16;10801:27;10794:40;10895:4;10888:2;10884:7;10879:2;10871:6;10867:15;10863:29;10858:3;10854:39;10850:50;10843:57;;10704:202;;;;;:::o;10911:259::-;;10992:5;10986:12;11019:6;11014:3;11007:19;11035:63;11091:6;11084:4;11079:3;11075:14;11068:4;11061:5;11057:16;11035:63;:::i;:::-;11152:2;11131:15;-1:-1:-1;;11127:29:41;11118:39;;;;11159:4;11114:50;;10962:208;-1:-1:-1;;10962:208:41:o;11175:140::-;11265:1;11258:5;11255:12;11245:2;;11271:9;11245:2;11291:18;;11235:80::o;11320:895::-;;11435:5;11422:19;11450:35;11477:7;11450:35;:::i;:::-;-1:-1:-1;;;;;11544:16:41;;;11532:29;;11609:4;11598:16;;11585:30;;11624:35;11585:30;11624:35;:::i;:::-;11691:16;11684:4;11675:14;;11668:40;11764:4;11753:16;;;11740:30;11724:14;;;11717:54;11827:4;11816:16;;;11803:30;11787:14;;;11780:54;11890:4;11879:16;;;11866:30;11850:14;;;11843:54;11940:57;11991:4;11980:16;;11757:5;11940:57;:::i;:::-;12029:4;12022;12017:3;12013:14;12006:28;12055:71;12120:4;12115:3;12111:14;12097:12;12083;12055:71;:::i;:::-;12043:83;;;12182:4;12175:5;12171:16;12158:30;12151:4;12146:3;12142:14;12135:54;12205:4;12198:11;;;11397:818;;;;:::o;12220:1071::-;;12312:6;12352:5;12339:19;12334:3;12327:32;12415:4;12408:5;12404:16;12391:30;12384:4;12379:3;12375:14;12368:54;12478:4;12471:5;12467:16;12454:30;12447:4;12442:3;12438:14;12431:54;12533:4;12526:5;12522:16;12509:30;12548:35;12575:7;12548:35;:::i;:::-;-1:-1:-1;;;;;12653:16:41;;;12646:4;12637:14;;12630:40;12718:4;12707:16;;12694:30;;12733:35;12694:30;12733:35;:::i;:::-;12800:16;12793:4;12784:14;;12777:40;12865:4;12854:16;;12841:30;12880:35;12841:30;12880:35;:::i;:::-;12924:53;12971:4;12966:3;12962:14;12953:7;12924:53;:::i;:::-;;13020:57;13071:4;13064:5;13060:16;13053:5;13020:57;:::i;:::-;13109:2;13102:4;13097:3;13093:14;13086:26;13133:69;13198:2;13193:3;13189:12;13175;13161;13133:69;:::i;:::-;13121:81;;;;13258:4;13251:5;13247:16;13234:30;13227:4;13222:3;13218:14;13211:54;13281:4;13274:11;;;12292:999;;;;:::o;13296:697::-;;13420:5;13407:19;13465:5;13449:14;13445:26;13526:3;13522:8;13518:2;13514:17;13494:18;13490:42;13480:2;;13548:3;13543;13536:16;13480:2;13575:4;13570:3;13563:17;13601:92;13687:4;13682:3;13678:14;13670:5;13650:18;13646:30;13601:92;:::i;:::-;13589:104;-1:-1:-1;13754:4:41;13743:16;;13730:30;-1:-1:-1;;13805:17:41;;13779:44;;13769:2;;13839:3;13834;13827:16;13769:2;13887:3;13881:4;13877:14;13870:4;13865:3;13861:14;13854:38;13908:79;13982:4;13974:5;13952:20;13948:32;13908:79;:::i;:::-;13901:86;13371:622;-1:-1:-1;;;;;;13371:622:41:o;13998:273::-;;14181:6;14173;14168:3;14155:33;14207:16;;14232:15;;;14207:16;14145:126;-1:-1:-1;14145:126:41:o;14276:274::-;;14443:6;14437:13;14459:53;14505:6;14500:3;14493:4;14485:6;14481:17;14459:53;:::i;:::-;14528:16;;;;;14413:137;-1:-1:-1;;14413:137:41:o;14555:940::-;;15022:6;15016:13;15038:53;15084:6;15079:3;15072:4;15064:6;15060:17;15038:53;:::i;:::-;-1:-1:-1;;;15113:16:41;;;15138:18;;;15181:13;;15203:65;15181:13;15255:1;15244:13;;15237:4;15225:17;;15203:65;:::i;:::-;-1:-1:-1;;;15331:1:41;15287:20;;;;15323:10;;;15316:23;15364:13;;15386:62;15364:13;15435:1;15427:10;;15420:4;15408:17;;15386:62;:::i;:::-;15468:17;15487:1;15464:25;;14992:503;-1:-1:-1;;;;;14992:503:41:o;15500:437::-;;-1:-1:-1;;;15755:3:41;15748:35;15812:6;15806:13;15828:62;15883:6;15878:2;15873:3;15869:12;15862:4;15854:6;15850:17;15828:62;:::i;:::-;15910:16;;;;15928:2;15906:25;;15738:199;-1:-1:-1;;15738:199:41:o;15942:203::-;-1:-1:-1;;;;;16106:32:41;;;;16088:51;;16076:2;16061:18;;16043:102::o;16150:595::-;-1:-1:-1;;;;;16453:15:41;;;16435:34;;16505:15;;16500:2;16485:18;;16478:43;-1:-1:-1;;;;;;16557:33:41;;16552:2;16537:18;;16530:61;16622:2;16607:18;;16600:34;;;16415:3;16665;16650:19;;16643:32;;;16150:595;;16692:47;;16719:19;;16711:6;16692:47;:::i;:::-;16684:55;16387:358;-1:-1:-1;;;;;;;16387:358:41:o;16750:391::-;-1:-1:-1;;;;;17024:15:41;;;17006:34;;17076:15;;;;17071:2;17056:18;;17049:43;17123:2;17108:18;;17101:34;;;;16956:2;16941:18;;16923:218::o;17146:590::-;-1:-1:-1;;;;;17477:15:41;;;17459:34;;17529:15;;17524:2;17509:18;;17502:43;-1:-1:-1;;;;;;17581:33:41;;17576:2;17561:18;;17554:61;17408:3;17393:19;;17624:62;17682:2;17667:18;;17659:6;17624:62;:::i;:::-;17723:6;17717:3;17706:9;17702:19;17695:35;17375:361;;;;;;;;:::o;17741:447::-;-1:-1:-1;;;;;18028:15:41;;;18010:34;;18080:15;;;;18075:2;18060:18;;18053:43;18127:2;18112:18;;18105:34;18170:2;18155:18;;18148:34;;;;17959:3;17944:19;;17926:262::o;18193:789::-;18421:2;18433:21;;;18406:18;;18489:22;;;18193:789;18568:6;18542:2;18527:18;;18193:789;18605:306;18619:6;18616:1;18613:13;18605:306;;;18694:6;18681:20;18714:33;18741:5;18714:33;:::i;:::-;-1:-1:-1;;;;;18772:31:41;18760:44;;18827:4;18886:15;;;;18851:12;;;;18800:1;18634:9;18605:306;;;-1:-1:-1;18962:4:41;18947:20;;;;18940:36;;;;-1:-1:-1;18928:3:41;18382:600;-1:-1:-1;;;18382:600:41:o;18987:187::-;19152:14;;19145:22;19127:41;;19115:2;19100:18;;19082:92::o;19179:300::-;;19362:6;19355:14;19348:22;19337:9;19330:41;19407:2;19402;19391:9;19387:18;19380:30;19427:46;19469:2;19458:9;19454:18;19446:6;19427:46;:::i;19484:177::-;19630:25;;;19618:2;19603:18;;19585:76::o;19666:489::-;19925:25;;;19981:2;19966:18;;19959:34;;;;20024:2;20009:18;;20002:34;;;;20067:2;20052:18;;20045:34;-1:-1:-1;;;;;20116:32:41;20110:3;20095:19;;20088:61;19912:3;19897:19;;19879:276::o;20160:816::-;20531:25;;;20587:2;20572:18;;20565:34;;;;20630:2;20615:18;;20608:34;;;;20673:2;20658:18;;20651:34;;;;-1:-1:-1;;;;;20760:15:41;;;20754:3;20739:19;;20732:44;20813:15;;20712:3;20792:19;;20785:44;20866:15;20860:3;20845:19;;20838:44;20913:3;20898:19;;20891:35;20957:3;20942:19;;20935:35;20518:3;20503:19;;20485:491::o;20981:594::-;;21262:3;21251:9;21244:22;21289:47;21331:3;21320:9;21316:19;21308:6;21289:47;:::i;:::-;21386:6;21379:14;21372:22;21367:2;21356:9;21352:18;21345:50;21431:6;21426:2;21415:9;21411:18;21404:34;21486:9;21478:6;21474:22;21469:2;21458:9;21454:18;21447:50;21514:55;21562:6;21554;21514:55;:::i;21810:336::-;;21985:53;22028:9;22020:6;21985:53;:::i;:::-;22074:2;22069;22058:9;22054:18;22047:30;22094:46;22136:2;22125:9;22121:18;22113:6;22094:46;:::i;22151:221::-;;22300:2;22289:9;22282:21;22320:46;22362:2;22351:9;22347:18;22339:6;22320:46;:::i;22377:344::-;22579:2;22561:21;;;22618:2;22598:18;;;22591:30;-1:-1:-1;;;22652:2:41;22637:18;;22630:50;22712:2;22697:18;;22551:170::o;22726:338::-;22928:2;22910:21;;;22967:2;22947:18;;;22940:30;-1:-1:-1;;;23001:2:41;22986:18;;22979:44;23055:2;23040:18;;22900:164::o;23069:342::-;23271:2;23253:21;;;23310:2;23290:18;;;23283:30;-1:-1:-1;;;23344:2:41;23329:18;;23322:48;23402:2;23387:18;;23243:168::o;23416:349::-;23618:2;23600:21;;;23657:2;23637:18;;;23630:30;23696:27;23691:2;23676:18;;23669:55;23756:2;23741:18;;23590:175::o;23770:349::-;23972:2;23954:21;;;24011:2;23991:18;;;23984:30;24050:27;24045:2;24030:18;;24023:55;24110:2;24095:18;;23944:175::o;24124:350::-;24326:2;24308:21;;;24365:2;24345:18;;;24338:30;24404:28;24399:2;24384:18;;24377:56;24465:2;24450:18;;24298:176::o;24479:341::-;24681:2;24663:21;;;24720:2;24700:18;;;24693:30;-1:-1:-1;;;24754:2:41;24739:18;;24732:47;24811:2;24796:18;;24653:167::o;24825:339::-;25027:2;25009:21;;;25066:2;25046:18;;;25039:30;-1:-1:-1;;;25100:2:41;25085:18;;25078:45;25155:2;25140:18;;24999:165::o;25169:348::-;25371:2;25353:21;;;25410:2;25390:18;;;25383:30;25449:26;25444:2;25429:18;;25422:54;25508:2;25493:18;;25343:174::o;25522:340::-;25724:2;25706:21;;;25763:2;25743:18;;;25736:30;-1:-1:-1;;;25797:2:41;25782:18;;25775:46;25853:2;25838:18;;25696:166::o;25867:347::-;26069:2;26051:21;;;26108:2;26088:18;;;26081:30;26147:25;26142:2;26127:18;;26120:53;26205:2;26190:18;;26041:173::o;26219:337::-;26421:2;26403:21;;;26460:2;26440:18;;;26433:30;-1:-1:-1;;;26494:2:41;26479:18;;26472:43;26547:2;26532:18;;26393:163::o;26561:349::-;26763:2;26745:21;;;26802:2;26782:18;;;26775:30;26841:27;26836:2;26821:18;;26814:55;26901:2;26886:18;;26735:175::o;26915:340::-;27117:2;27099:21;;;27156:2;27136:18;;;27129:30;-1:-1:-1;;;27190:2:41;27175:18;;27168:46;27246:2;27231:18;;27089:166::o;27260:350::-;27462:2;27444:21;;;27501:2;27481:18;;;27474:30;27540:28;27535:2;27520:18;;27513:56;27601:2;27586:18;;27434:176::o;27615:342::-;27817:2;27799:21;;;27856:2;27836:18;;;27829:30;-1:-1:-1;;;27890:2:41;27875:18;;27868:48;27948:2;27933:18;;27789:168::o;27962:344::-;28164:2;28146:21;;;28203:2;28183:18;;;28176:30;-1:-1:-1;;;28237:2:41;28222:18;;28215:50;28297:2;28282:18;;28136:170::o;28311:349::-;28513:2;28495:21;;;28552:2;28532:18;;;28525:30;28591:27;28586:2;28571:18;;28564:55;28651:2;28636:18;;28485:175::o;28665:348::-;28867:2;28849:21;;;28906:2;28886:18;;;28879:30;28945:26;28940:2;28925:18;;28918:54;29004:2;28989:18;;28839:174::o;29018:344::-;29220:2;29202:21;;;29259:2;29239:18;;;29232:30;-1:-1:-1;;;29293:2:41;29278:18;;29271:50;29353:2;29338:18;;29192:170::o;29367:789::-;;29720:3;29709:9;29702:22;29747:73;29815:3;29804:9;29800:19;29792:6;29747:73;:::i;:::-;29856:6;29851:2;29840:9;29836:18;29829:34;29899:6;29894:2;29883:9;29879:18;29872:34;29954:9;29946:6;29942:22;29937:2;29926:9;29922:18;29915:50;29988:34;30015:6;30007;29988:34;:::i;:::-;29974:48;;30071:9;30063:6;30059:22;30053:3;30042:9;30038:19;30031:51;30099;30143:6;30135;30127;30099:51;:::i;:::-;30091:59;29692:464;-1:-1:-1;;;;;;;;;29692:464:41:o;30161:774::-;;30359:3;30348:9;30344:19;30336:27;;30396:6;30390:13;30379:9;30372:32;30460:4;30452:6;30448:17;30442:24;30435:4;30424:9;30420:20;30413:54;30523:4;30515:6;30511:17;30505:24;30498:4;30487:9;30483:20;30476:54;30586:4;30578:6;30574:17;30568:24;30561:4;30550:9;30546:20;30539:54;30649:4;30641:6;30637:17;30631:24;30624:4;30613:9;30609:20;30602:54;30712:4;30704:6;30700:17;30694:24;30687:4;30676:9;30672:20;30665:54;30775:4;30767:6;30763:17;30757:24;30750:4;30739:9;30735:20;30728:54;30838:4;30830:6;30826:17;30820:24;30813:4;30802:9;30798:20;30791:54;30864:6;30924:2;30916:6;30912:15;30906:22;30901:2;30890:9;30886:18;30879:50;;30326:609;;;;:::o;30940:752::-;31166:13;;31148:32;;31236:4;31224:17;;31218:24;31211:4;31196:20;;31189:54;31299:4;31287:17;;31281:24;31274:4;31259:20;;31252:54;31362:4;31350:17;;31344:24;31337:4;31322:20;;31315:54;31425:4;31413:17;;31407:24;31400:4;31385:20;;31378:54;31488:4;31476:17;;31470:24;31463:4;31448:20;;31441:54;31551:4;31539:17;;31533:24;31526:4;31511:20;;31504:54;31614:4;31602:17;;31596:24;31589:4;31574:20;;31567:54;31679:4;31667:17;;;31661:24;31652:6;31637:22;;31630:56;31135:3;31120:19;;31102:590::o;31697:1157::-;;32144:3;32174:2;32163:9;32156:21;32200:70;32266:2;32255:9;32251:18;32243:6;32200:70;:::i;:::-;32186:84;;32318:9;32310:6;32306:22;32301:2;32290:9;32286:18;32279:50;32352:51;32396:6;32388;32380;32352:51;:::i;:::-;32338:65;;32451:9;32443:6;32439:22;32434:2;32423:9;32419:18;32412:50;32479:51;32523:6;32515;32507;32479:51;:::i;:::-;32471:59;;;32572:6;32566:13;32561:2;32550:9;32546:18;32539:41;32635:2;32627:6;32623:15;32617:22;32611:3;32600:9;32596:19;32589:51;32695:2;32687:6;32683:15;32677:22;32671:3;32660:9;32656:19;32649:51;32755:2;32747:6;32743:15;32737:22;32731:3;32720:9;32716:19;32709:51;32797:6;32791:3;32780:9;32776:19;32769:35;32841:6;32835:3;32824:9;32820:19;32813:35;32124:730;;;;;;;;;;;:::o;32859:738::-;;33190:3;33179:9;33172:22;33217:71;33283:3;33272:9;33268:19;33260:6;33217:71;:::i;:::-;33336:9;33328:6;33324:22;33319:2;33308:9;33304:18;33297:50;33370:51;33414:6;33406;33398;33370:51;:::i;:::-;33356:65;;33469:9;33461:6;33457:22;33452:2;33441:9;33437:18;33430:50;33497:51;33541:6;33533;33525;33497:51;:::i;:::-;33489:59;;;33584:6;33579:2;33568:9;33564:18;33557:34;33162:435;;;;;;;;;:::o;33784:390::-;;33999:6;33988:9;33981:25;34042:6;34037:2;34026:9;34022:18;34015:34;34085:2;34080;34069:9;34065:18;34058:30;34105:63;34164:2;34153:9;34149:18;34141:6;34133;34105:63;:::i;34179:533::-;;;34322:11;34309:25;34416:2;34412:7;34401:8;34385:14;34381:29;34377:43;34357:18;34353:68;34343:2;;34438:4;34432;34425:18;34343:2;34468:33;;34520:20;;;-1:-1:-1;;;;;;34552:30:41;;34549:2;;;34598:4;34592;34585:18;34549:2;34634:4;34622:17;;-1:-1:-1;34665:14:41;34661:27;;;34651:38;;34648:2;;;34702:1;34699;34692:12;34717:338;;34875:11;34862:25;34969:3;34965:8;34954;34938:14;34934:29;34930:44;34910:18;34906:69;34896:2;;34992:4;34986;34979:18;35060:333;;35213:11;35200:25;35307:3;35303:8;35292;35276:14;35272:29;35268:44;35248:18;35244:69;35234:2;;35330:4;35324;35317:18;35398:242;35468:2;35462:9;35498:17;;;-1:-1:-1;;;;;35530:34:41;;35566:22;;;35527:62;35524:2;;;35592:9;35524:2;35619;35612:22;35442:198;;-1:-1:-1;35442:198:41:o;35645:513::-;;;35772:3;35759:17;35858:2;35854:7;35843:8;35827:14;35823:29;35819:43;35799:18;35795:68;35785:2;;35881:5;35874;35867:20;35785:2;35913:33;;36017:4;36004:18;;;-1:-1:-1;35965:21:41;;-1:-1:-1;;;;;;36034:30:41;;36031:2;;;36077:1;36074;36067:12;36031:2;36127:6;36111:14;36107:27;36097:8;36093:42;36090:2;;;36148:1;36145;36138:12;36163:258;36235:1;36245:113;36259:6;36256:1;36253:13;36245:113;;;36335:11;;;36329:18;36316:11;;;36309:39;36281:2;36274:10;36245:113;;;36376:6;36373:1;36370:13;36367:2;;;36411:1;36402:6;36397:3;36393:16;36386:27;36367:2;;36216:205;;;:::o;36426:133::-;-1:-1:-1;;;;;36503:31:41;;36493:42;;36483:2;;36549:1;36546;36539:12

Swarm Source

ipfs://9ff0bf8fe5876b99f5fbe7dcb11ee13db761ce56cef78cbcae6f3bea7b55bab9
Block Transaction Gas Used Reward
Age Block Fee Address BC Fee Address Voting Power Jailed Incoming
Block Uncle Number Difficulty Gas Used Reward
Loading
Loading
Make sure to use the "Vote Down" button for any spammy posts, and the "Vote Up" for interesting conversations.