{
  "address": "0x340619ea375Da672b459769fACb9dD8b943AcA7C",
  "abi": [
    {
      "anonymous": false,
      "inputs": [
        {
          "indexed": false,
          "internalType": "address",
          "name": "provider",
          "type": "address"
        },
        {
          "indexed": false,
          "internalType": "bytes32",
          "name": "account",
          "type": "bytes32"
        },
        {
          "indexed": false,
          "internalType": "bytes",
          "name": "bills",
          "type": "bytes"
        },
        {
          "indexed": false,
          "internalType": "uint256",
          "name": "amount",
          "type": "uint256"
        },
        {
          "indexed": false,
          "internalType": "uint64",
          "name": "nonce",
          "type": "uint64"
        }
      ],
      "name": "Billing",
      "type": "event"
    },
    {
      "anonymous": false,
      "inputs": [
        {
          "indexed": false,
          "internalType": "bytes32",
          "name": "hash",
          "type": "bytes32"
        }
      ],
      "name": "BillingTypesHashUpdated",
      "type": "event"
    },
    {
      "anonymous": false,
      "inputs": [
        {
          "indexed": false,
          "internalType": "uint8",
          "name": "version",
          "type": "uint8"
        }
      ],
      "name": "Initialized",
      "type": "event"
    },
    {
      "anonymous": false,
      "inputs": [
        {
          "indexed": false,
          "internalType": "address",
          "name": "to",
          "type": "address"
        },
        {
          "indexed": false,
          "internalType": "uint256",
          "name": "value",
          "type": "uint256"
        }
      ],
      "name": "NativeWithdrawal",
      "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": [
        {
          "indexed": false,
          "internalType": "contract IRouter",
          "name": "router",
          "type": "address"
        }
      ],
      "name": "RouterUpdated",
      "type": "event"
    },
    {
      "anonymous": false,
      "inputs": [
        {
          "indexed": false,
          "internalType": "contract IERC20Upgradeable",
          "name": "token",
          "type": "address"
        },
        {
          "indexed": false,
          "internalType": "address",
          "name": "to",
          "type": "address"
        },
        {
          "indexed": false,
          "internalType": "uint256",
          "name": "value",
          "type": "uint256"
        }
      ],
      "name": "Withdrawal",
      "type": "event"
    },
    {
      "inputs": [
        {
          "internalType": "address",
          "name": "provider",
          "type": "address"
        }
      ],
      "name": "balanceOf",
      "outputs": [
        {
          "internalType": "uint256",
          "name": "",
          "type": "uint256"
        }
      ],
      "stateMutability": "view",
      "type": "function"
    },
    {
      "inputs": [
        {
          "internalType": "address",
          "name": "provider",
          "type": "address"
        },
        {
          "internalType": "bytes",
          "name": "data",
          "type": "bytes"
        }
      ],
      "name": "billFee",
      "outputs": [
        {
          "internalType": "uint256",
          "name": "value",
          "type": "uint256"
        }
      ],
      "stateMutability": "view",
      "type": "function"
    },
    {
      "inputs": [],
      "name": "billingTypesHash",
      "outputs": [
        {
          "internalType": "bytes32",
          "name": "",
          "type": "bytes32"
        }
      ],
      "stateMutability": "view",
      "type": "function"
    },
    {
      "inputs": [
        {
          "internalType": "address",
          "name": "provider",
          "type": "address"
        },
        {
          "internalType": "bytes32",
          "name": "account",
          "type": "bytes32"
        },
        {
          "internalType": "bytes",
          "name": "bills",
          "type": "bytes"
        },
        {
          "internalType": "uint256",
          "name": "timeout",
          "type": "uint256"
        },
        {
          "internalType": "uint64",
          "name": "nonce",
          "type": "uint64"
        }
      ],
      "name": "hashBillingTypes",
      "outputs": [
        {
          "internalType": "bytes32",
          "name": "",
          "type": "bytes32"
        }
      ],
      "stateMutability": "view",
      "type": "function"
    },
    {
      "inputs": [
        {
          "internalType": "address",
          "name": "provider",
          "type": "address"
        },
        {
          "internalType": "bytes32",
          "name": "account",
          "type": "bytes32"
        },
        {
          "internalType": "bytes",
          "name": "bills",
          "type": "bytes"
        },
        {
          "internalType": "uint256",
          "name": "timeout",
          "type": "uint256"
        },
        {
          "internalType": "uint64",
          "name": "nonce",
          "type": "uint64"
        }
      ],
      "name": "hashTypedDataV4ForBills",
      "outputs": [
        {
          "internalType": "bytes32",
          "name": "",
          "type": "bytes32"
        }
      ],
      "stateMutability": "view",
      "type": "function"
    },
    {
      "inputs": [
        {
          "internalType": "address",
          "name": "owner",
          "type": "address"
        },
        {
          "internalType": "string",
          "name": "name",
          "type": "string"
        },
        {
          "internalType": "string",
          "name": "version",
          "type": "string"
        },
        {
          "internalType": "string",
          "name": "billingTypes",
          "type": "string"
        },
        {
          "internalType": "contract IRouter",
          "name": "router",
          "type": "address"
        }
      ],
      "name": "initialize",
      "outputs": [],
      "stateMutability": "nonpayable",
      "type": "function"
    },
    {
      "inputs": [
        {
          "internalType": "address",
          "name": "provider",
          "type": "address"
        },
        {
          "internalType": "bytes32",
          "name": "account",
          "type": "bytes32"
        },
        {
          "internalType": "uint64",
          "name": "nonce",
          "type": "uint64"
        }
      ],
      "name": "nonceExists",
      "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": "contract IERC20Upgradeable",
          "name": "token",
          "type": "address"
        },
        {
          "internalType": "address",
          "name": "to",
          "type": "address"
        },
        {
          "internalType": "uint256",
          "name": "value",
          "type": "uint256"
        }
      ],
      "name": "ownerWithdrawERC20",
      "outputs": [],
      "stateMutability": "nonpayable",
      "type": "function"
    },
    {
      "inputs": [
        {
          "internalType": "address payable",
          "name": "to",
          "type": "address"
        },
        {
          "internalType": "uint256",
          "name": "value",
          "type": "uint256"
        }
      ],
      "name": "ownerWithdrawNative",
      "outputs": [],
      "stateMutability": "nonpayable",
      "type": "function"
    },
    {
      "inputs": [],
      "name": "renounceOwnership",
      "outputs": [],
      "stateMutability": "nonpayable",
      "type": "function"
    },
    {
      "inputs": [],
      "name": "router",
      "outputs": [
        {
          "internalType": "contract IRouter",
          "name": "",
          "type": "address"
        }
      ],
      "stateMutability": "view",
      "type": "function"
    },
    {
      "inputs": [
        {
          "internalType": "address",
          "name": "provider",
          "type": "address"
        },
        {
          "internalType": "bytes32",
          "name": "account",
          "type": "bytes32"
        },
        {
          "internalType": "bytes",
          "name": "bills",
          "type": "bytes"
        },
        {
          "internalType": "uint256",
          "name": "timeout",
          "type": "uint256"
        },
        {
          "internalType": "uint64",
          "name": "nonce",
          "type": "uint64"
        },
        {
          "internalType": "bytes",
          "name": "signature",
          "type": "bytes"
        }
      ],
      "name": "spend",
      "outputs": [
        {
          "internalType": "uint256",
          "name": "fee",
          "type": "uint256"
        }
      ],
      "stateMutability": "nonpayable",
      "type": "function"
    },
    {
      "inputs": [
        {
          "internalType": "address",
          "name": "newOwner",
          "type": "address"
        }
      ],
      "name": "transferOwnership",
      "outputs": [],
      "stateMutability": "nonpayable",
      "type": "function"
    }
  ],
  "transactionHash": "0x34d56c2d0da75110bf532ad734bbcd280f4821acd5e1c206a29485d6f1b25ac5",
  "receipt": {
    "to": null,
    "from": "0xe5bab2D79EB833FA25906Cd90540339C9aB8AE70",
    "contractAddress": "0x340619ea375Da672b459769fACb9dD8b943AcA7C",
    "transactionIndex": 0,
    "gasUsed": "2149075",
    "logsBloom": "0x00000000000000000000000400000000000000000000000000000020000000000000000000001000000000000000000000008000000000000000000000000000000000000000000000000000000000800000000000000000000100000000000000000000000000000002000000000000000000000000000080000000000000000000000000000000000000000000000000000000000000000000000000000000200000000000000000000000000000000000000000000000000000000000004000000000000000000001000000000000000000000000000000100000000000000000000002000000000000000000000000000100000000000000000000100000",
    "blockHash": "0xcf4660ca5c60904c21837338742bf4abf0f39085fa675f78f47034d2c1765937",
    "transactionHash": "0x34d56c2d0da75110bf532ad734bbcd280f4821acd5e1c206a29485d6f1b25ac5",
    "logs": [
      {
        "transactionIndex": 0,
        "blockNumber": 30085082,
        "transactionHash": "0x34d56c2d0da75110bf532ad734bbcd280f4821acd5e1c206a29485d6f1b25ac5",
        "address": "0x0000000000000000000000000000000000001010",
        "topics": [
          "0x4dfe1bbbcf077ddc3e01291eea2d5c70c2b422b415d95645b9adcfd678cb1d63",
          "0x0000000000000000000000000000000000000000000000000000000000001010",
          "0x000000000000000000000000e5bab2d79eb833fa25906cd90540339c9ab8ae70",
          "0x000000000000000000000000ec20607aa654d823dd01beb8780a44863c57ed07"
        ],
        "data": "0x00000000000000000000000000000000000000000000000005f7027716cdd69200000000000000000000000000000000000000000000000056d2dacb8411900000000000000000000000000000000000000000000000007be9712be9d208630200000000000000000000000000000000000000000000000050dbd8546d43b96e00000000000000000000000000000000000000000000007bef682e60e8d63994",
        "logIndex": 0,
        "blockHash": "0xcf4660ca5c60904c21837338742bf4abf0f39085fa675f78f47034d2c1765937"
      }
    ],
    "blockNumber": 30085082,
    "cumulativeGasUsed": "2149075",
    "status": 1,
    "byzantium": true
  },
  "args": [],
  "numDeployments": 1,
  "solcInputHash": "0c8e7ccecb4fe6e567d57bbef920b756",
  "metadata": "{\"compiler\":{\"version\":\"0.8.9+commit.e5eed63a\"},\"language\":\"Solidity\",\"output\":{\"abi\":[{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"address\",\"name\":\"provider\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"bytes32\",\"name\":\"account\",\"type\":\"bytes32\"},{\"indexed\":false,\"internalType\":\"bytes\",\"name\":\"bills\",\"type\":\"bytes\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"amount\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint64\",\"name\":\"nonce\",\"type\":\"uint64\"}],\"name\":\"Billing\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"bytes32\",\"name\":\"hash\",\"type\":\"bytes32\"}],\"name\":\"BillingTypesHashUpdated\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"uint8\",\"name\":\"version\",\"type\":\"uint8\"}],\"name\":\"Initialized\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"address\",\"name\":\"to\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"value\",\"type\":\"uint256\"}],\"name\":\"NativeWithdrawal\",\"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\":[{\"indexed\":false,\"internalType\":\"contract IRouter\",\"name\":\"router\",\"type\":\"address\"}],\"name\":\"RouterUpdated\",\"type\":\"event\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"contract IERC20Upgradeable\",\"name\":\"token\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"address\",\"name\":\"to\",\"type\":\"address\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"value\",\"type\":\"uint256\"}],\"name\":\"Withdrawal\",\"type\":\"event\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"provider\",\"type\":\"address\"}],\"name\":\"balanceOf\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"provider\",\"type\":\"address\"},{\"internalType\":\"bytes\",\"name\":\"data\",\"type\":\"bytes\"}],\"name\":\"billFee\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"value\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"billingTypesHash\",\"outputs\":[{\"internalType\":\"bytes32\",\"name\":\"\",\"type\":\"bytes32\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"provider\",\"type\":\"address\"},{\"internalType\":\"bytes32\",\"name\":\"account\",\"type\":\"bytes32\"},{\"internalType\":\"bytes\",\"name\":\"bills\",\"type\":\"bytes\"},{\"internalType\":\"uint256\",\"name\":\"timeout\",\"type\":\"uint256\"},{\"internalType\":\"uint64\",\"name\":\"nonce\",\"type\":\"uint64\"}],\"name\":\"hashBillingTypes\",\"outputs\":[{\"internalType\":\"bytes32\",\"name\":\"\",\"type\":\"bytes32\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"provider\",\"type\":\"address\"},{\"internalType\":\"bytes32\",\"name\":\"account\",\"type\":\"bytes32\"},{\"internalType\":\"bytes\",\"name\":\"bills\",\"type\":\"bytes\"},{\"internalType\":\"uint256\",\"name\":\"timeout\",\"type\":\"uint256\"},{\"internalType\":\"uint64\",\"name\":\"nonce\",\"type\":\"uint64\"}],\"name\":\"hashTypedDataV4ForBills\",\"outputs\":[{\"internalType\":\"bytes32\",\"name\":\"\",\"type\":\"bytes32\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"owner\",\"type\":\"address\"},{\"internalType\":\"string\",\"name\":\"name\",\"type\":\"string\"},{\"internalType\":\"string\",\"name\":\"version\",\"type\":\"string\"},{\"internalType\":\"string\",\"name\":\"billingTypes\",\"type\":\"string\"},{\"internalType\":\"contract IRouter\",\"name\":\"router\",\"type\":\"address\"}],\"name\":\"initialize\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"provider\",\"type\":\"address\"},{\"internalType\":\"bytes32\",\"name\":\"account\",\"type\":\"bytes32\"},{\"internalType\":\"uint64\",\"name\":\"nonce\",\"type\":\"uint64\"}],\"name\":\"nonceExists\",\"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\":\"contract IERC20Upgradeable\",\"name\":\"token\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"to\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"value\",\"type\":\"uint256\"}],\"name\":\"ownerWithdrawERC20\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address payable\",\"name\":\"to\",\"type\":\"address\"},{\"internalType\":\"uint256\",\"name\":\"value\",\"type\":\"uint256\"}],\"name\":\"ownerWithdrawNative\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"renounceOwnership\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"router\",\"outputs\":[{\"internalType\":\"contract IRouter\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"provider\",\"type\":\"address\"},{\"internalType\":\"bytes32\",\"name\":\"account\",\"type\":\"bytes32\"},{\"internalType\":\"bytes\",\"name\":\"bills\",\"type\":\"bytes\"},{\"internalType\":\"uint256\",\"name\":\"timeout\",\"type\":\"uint256\"},{\"internalType\":\"uint64\",\"name\":\"nonce\",\"type\":\"uint64\"},{\"internalType\":\"bytes\",\"name\":\"signature\",\"type\":\"bytes\"}],\"name\":\"spend\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"fee\",\"type\":\"uint256\"}],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"newOwner\",\"type\":\"address\"}],\"name\":\"transferOwnership\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"}],\"devdoc\":{\"author\":\"Alexandas\",\"details\":\"Billing contract\",\"kind\":\"dev\",\"methods\":{\"balanceOf(address)\":{\"details\":\"return balance of provider\",\"params\":{\"provider\":\"provider address\"},\"returns\":{\"_0\":\"balance of provider\"}},\"billFee(address,bytes)\":{\"details\":\"return bill fee\",\"params\":{\"data\":\"bill data\",\"provider\":\"provider address\"},\"returns\":{\"value\":\"bill fee\"}},\"hashBillingTypes(address,bytes32,bytes,uint256,uint64)\":{\"details\":\"return hash for bills\",\"params\":{\"account\":\"user account\",\"bills\":\"user bills\",\"nonce\":\"nonce\",\"provider\":\"provider address\",\"timeout\":\"tx timeout\"},\"returns\":{\"_0\":\"bills hash\"}},\"hashTypedDataV4ForBills(address,bytes32,bytes,uint256,uint64)\":{\"details\":\"return hash typed data v4 for sign bills\",\"params\":{\"account\":\"user account\",\"bills\":\"user bills\",\"nonce\":\"nonce\",\"provider\":\"provider address\",\"timeout\":\"tx timeout\"},\"returns\":{\"_0\":\"bills hash typed data v4\"}},\"initialize(address,string,string,string,address)\":{\"details\":\"proxy initialize function\",\"params\":{\"name\":\"EIP712 name\",\"owner\":\"contract owner\",\"router\":\"router contract address\",\"version\":\"EIP712 version\"}},\"nonceExists(address,bytes32,uint64)\":{\"details\":\"provider nonces for account\",\"params\":{\"account\":\"user account\",\"nonce\":\"nonce\",\"provider\":\"provider address\"},\"returns\":{\"_0\":\"whether nonce exists\"}},\"owner()\":{\"details\":\"Returns the address of the current owner.\"},\"ownerWithdrawERC20(address,address,uint256)\":{\"details\":\"withdraw token\",\"params\":{\"to\":\"receiver address\",\"token\":\"token address\",\"value\":\"token value\"}},\"ownerWithdrawNative(address,uint256)\":{\"details\":\"withdraw ETH\",\"params\":{\"to\":\"receiver address\",\"value\":\"token value\"}},\"renounceOwnership()\":{\"details\":\"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.\"},\"spend(address,bytes32,bytes,uint256,uint64,bytes)\":{\"details\":\"spend bills\",\"params\":{\"account\":\"user account\",\"bills\":\"billing data\",\"nonce\":\"billing nonce\",\"provider\":\"provider address\",\"signature\":\"billing signature\",\"timeout\":\"tx timeout\"},\"returns\":{\"fee\":\"billing fee\"}},\"transferOwnership(address)\":{\"details\":\"Transfers ownership of the contract to a new account (`newOwner`). Can only be called by the current owner.\"}},\"stateVariables\":{\"balances\":{\"details\":\"provider balances\"},\"billingTypesHash\":{\"details\":\"keccak256(\\\"Billing(address provider,bytes32 account,bytes bills,uint256 timeout,uint64 nonce)\\\")\"},\"nonces\":{\"details\":\"provider nonces for account\"}},\"version\":1},\"userdoc\":{\"kind\":\"user\",\"methods\":{},\"version\":1}},\"settings\":{\"compilationTarget\":{\"contracts/wallets/Billing.sol\":\"Billing\"},\"evmVersion\":\"london\",\"libraries\":{},\"metadata\":{\"bytecodeHash\":\"ipfs\",\"useLiteralContent\":true},\"optimizer\":{\"details\":{\"constantOptimizer\":true,\"cse\":true,\"deduplicate\":true,\"inliner\":true,\"jumpdestRemover\":true,\"orderLiterals\":true,\"peephole\":true,\"yul\":false},\"runs\":200},\"remappings\":[]},\"sources\":{\"@openzeppelin/contracts-upgradeable/access/OwnableUpgradeable.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts v4.4.1 (access/Ownable.sol)\\n\\npragma solidity ^0.8.0;\\n\\nimport \\\"../utils/ContextUpgradeable.sol\\\";\\nimport \\\"../proxy/utils/Initializable.sol\\\";\\n\\n/**\\n * @dev Contract module which provides a basic access control mechanism, where\\n * there is an account (an owner) that can be granted exclusive access to\\n * specific functions.\\n *\\n * By default, the owner account will be the one that deploys the contract. This\\n * can later be changed with {transferOwnership}.\\n *\\n * This module is used through inheritance. It will make available the modifier\\n * `onlyOwner`, which can be applied to your functions to restrict their use to\\n * the owner.\\n */\\nabstract contract OwnableUpgradeable is Initializable, ContextUpgradeable {\\n    address private _owner;\\n\\n    event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);\\n\\n    /**\\n     * @dev Initializes the contract setting the deployer as the initial owner.\\n     */\\n    function __Ownable_init() internal onlyInitializing {\\n        __Ownable_init_unchained();\\n    }\\n\\n    function __Ownable_init_unchained() internal onlyInitializing {\\n        _transferOwnership(_msgSender());\\n    }\\n\\n    /**\\n     * @dev Returns the address of the current owner.\\n     */\\n    function owner() public view virtual returns (address) {\\n        return _owner;\\n    }\\n\\n    /**\\n     * @dev Throws if called by any account other than the owner.\\n     */\\n    modifier onlyOwner() {\\n        require(owner() == _msgSender(), \\\"Ownable: caller is not the owner\\\");\\n        _;\\n    }\\n\\n    /**\\n     * @dev Leaves the contract without owner. It will not be possible to call\\n     * `onlyOwner` functions anymore. Can only be called by the current owner.\\n     *\\n     * NOTE: Renouncing ownership will leave the contract without an owner,\\n     * thereby removing any functionality that is only available to the owner.\\n     */\\n    function renounceOwnership() public virtual onlyOwner {\\n        _transferOwnership(address(0));\\n    }\\n\\n    /**\\n     * @dev Transfers ownership of the contract to a new account (`newOwner`).\\n     * Can only be called by the current owner.\\n     */\\n    function transferOwnership(address newOwner) public virtual onlyOwner {\\n        require(newOwner != address(0), \\\"Ownable: new owner is the zero address\\\");\\n        _transferOwnership(newOwner);\\n    }\\n\\n    /**\\n     * @dev Transfers ownership of the contract to a new account (`newOwner`).\\n     * Internal function without access restriction.\\n     */\\n    function _transferOwnership(address newOwner) internal virtual {\\n        address oldOwner = _owner;\\n        _owner = newOwner;\\n        emit OwnershipTransferred(oldOwner, newOwner);\\n    }\\n\\n    /**\\n     * @dev This empty reserved space is put in place to allow future versions to add new\\n     * variables without shifting down storage in the inheritance chain.\\n     * See https://docs.openzeppelin.com/contracts/4.x/upgradeable#storage_gaps\\n     */\\n    uint256[49] private __gap;\\n}\\n\",\"keccak256\":\"0x652fee292f698d8dba81bf287cb71f1682f6483b67ebe601a5f7387dcfc30b34\",\"license\":\"MIT\"},\"@openzeppelin/contracts-upgradeable/interfaces/IERC20Upgradeable.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts v4.4.1 (interfaces/IERC20.sol)\\n\\npragma solidity ^0.8.0;\\n\\nimport \\\"../token/ERC20/IERC20Upgradeable.sol\\\";\\n\",\"keccak256\":\"0xe73087c5001a37cf7186b3709377c7ceb01a0d38fb908723d1464cea66b4958c\",\"license\":\"MIT\"},\"@openzeppelin/contracts-upgradeable/proxy/utils/Initializable.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.6.0) (proxy/utils/Initializable.sol)\\n\\npragma solidity ^0.8.2;\\n\\nimport \\\"../../utils/AddressUpgradeable.sol\\\";\\n\\n/**\\n * @dev This is a base contract to aid in writing upgradeable contracts, or any kind of contract that will be deployed\\n * behind a proxy. Since proxied contracts do not make use of a constructor, it's common to move constructor logic to an\\n * external initializer function, usually called `initialize`. It then becomes necessary to protect this initializer\\n * function so it can only be called once. The {initializer} modifier provided by this contract will have this effect.\\n *\\n * The initialization functions use a version number. Once a version number is used, it is consumed and cannot be\\n * reused. This mechanism prevents re-execution of each \\\"step\\\" but allows the creation of new initialization steps in\\n * case an upgrade adds a module that needs to be initialized.\\n *\\n * For example:\\n *\\n * [.hljs-theme-light.nopadding]\\n * ```\\n * contract MyToken is ERC20Upgradeable {\\n *     function initialize() initializer public {\\n *         __ERC20_init(\\\"MyToken\\\", \\\"MTK\\\");\\n *     }\\n * }\\n * contract MyTokenV2 is MyToken, ERC20PermitUpgradeable {\\n *     function initializeV2() reinitializer(2) public {\\n *         __ERC20Permit_init(\\\"MyToken\\\");\\n *     }\\n * }\\n * ```\\n *\\n * TIP: To avoid leaving the proxy in an uninitialized state, the initializer function should be called as early as\\n * possible by providing the encoded function call as the `_data` argument to {ERC1967Proxy-constructor}.\\n *\\n * CAUTION: When used with inheritance, manual care must be taken to not invoke a parent initializer twice, or to ensure\\n * that all initializers are idempotent. This is not verified automatically as constructors are by Solidity.\\n *\\n * [CAUTION]\\n * ====\\n * Avoid leaving a contract uninitialized.\\n *\\n * An uninitialized contract can be taken over by an attacker. This applies to both a proxy and its implementation\\n * contract, which may impact the proxy. To prevent the implementation contract from being used, you should invoke\\n * the {_disableInitializers} function in the constructor to automatically lock it when it is deployed:\\n *\\n * [.hljs-theme-light.nopadding]\\n * ```\\n * /// @custom:oz-upgrades-unsafe-allow constructor\\n * constructor() {\\n *     _disableInitializers();\\n * }\\n * ```\\n * ====\\n */\\nabstract contract Initializable {\\n    /**\\n     * @dev Indicates that the contract has been initialized.\\n     * @custom:oz-retyped-from bool\\n     */\\n    uint8 private _initialized;\\n\\n    /**\\n     * @dev Indicates that the contract is in the process of being initialized.\\n     */\\n    bool private _initializing;\\n\\n    /**\\n     * @dev Triggered when the contract has been initialized or reinitialized.\\n     */\\n    event Initialized(uint8 version);\\n\\n    /**\\n     * @dev A modifier that defines a protected initializer function that can be invoked at most once. In its scope,\\n     * `onlyInitializing` functions can be used to initialize parent contracts. Equivalent to `reinitializer(1)`.\\n     */\\n    modifier initializer() {\\n        bool isTopLevelCall = _setInitializedVersion(1);\\n        if (isTopLevelCall) {\\n            _initializing = true;\\n        }\\n        _;\\n        if (isTopLevelCall) {\\n            _initializing = false;\\n            emit Initialized(1);\\n        }\\n    }\\n\\n    /**\\n     * @dev A modifier that defines a protected reinitializer function that can be invoked at most once, and only if the\\n     * contract hasn't been initialized to a greater version before. In its scope, `onlyInitializing` functions can be\\n     * used to initialize parent contracts.\\n     *\\n     * `initializer` is equivalent to `reinitializer(1)`, so a reinitializer may be used after the original\\n     * initialization step. This is essential to configure modules that are added through upgrades and that require\\n     * initialization.\\n     *\\n     * Note that versions can jump in increments greater than 1; this implies that if multiple reinitializers coexist in\\n     * a contract, executing them in the right order is up to the developer or operator.\\n     */\\n    modifier reinitializer(uint8 version) {\\n        bool isTopLevelCall = _setInitializedVersion(version);\\n        if (isTopLevelCall) {\\n            _initializing = true;\\n        }\\n        _;\\n        if (isTopLevelCall) {\\n            _initializing = false;\\n            emit Initialized(version);\\n        }\\n    }\\n\\n    /**\\n     * @dev Modifier to protect an initialization function so that it can only be invoked by functions with the\\n     * {initializer} and {reinitializer} modifiers, directly or indirectly.\\n     */\\n    modifier onlyInitializing() {\\n        require(_initializing, \\\"Initializable: contract is not initializing\\\");\\n        _;\\n    }\\n\\n    /**\\n     * @dev Locks the contract, preventing any future reinitialization. This cannot be part of an initializer call.\\n     * Calling this in the constructor of a contract will prevent that contract from being initialized or reinitialized\\n     * to any version. It is recommended to use this to lock implementation contracts that are designed to be called\\n     * through proxies.\\n     */\\n    function _disableInitializers() internal virtual {\\n        _setInitializedVersion(type(uint8).max);\\n    }\\n\\n    function _setInitializedVersion(uint8 version) private returns (bool) {\\n        // If the contract is initializing we ignore whether _initialized is set in order to support multiple\\n        // inheritance patterns, but we only do this in the context of a constructor, and for the lowest level\\n        // of initializers, because in other contexts the contract may have been reentered.\\n        if (_initializing) {\\n            require(\\n                version == 1 && !AddressUpgradeable.isContract(address(this)),\\n                \\\"Initializable: contract is already initialized\\\"\\n            );\\n            return false;\\n        } else {\\n            require(_initialized < version, \\\"Initializable: contract is already initialized\\\");\\n            _initialized = version;\\n            return true;\\n        }\\n    }\\n}\\n\",\"keccak256\":\"0x7454006cccb737612b00104d2f606d728e2818b778e7e55542f063c614ce46ba\",\"license\":\"MIT\"},\"@openzeppelin/contracts-upgradeable/security/ReentrancyGuardUpgradeable.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts v4.4.1 (security/ReentrancyGuard.sol)\\n\\npragma solidity ^0.8.0;\\nimport \\\"../proxy/utils/Initializable.sol\\\";\\n\\n/**\\n * @dev Contract module that helps prevent reentrant calls to a function.\\n *\\n * Inheriting from `ReentrancyGuard` will make the {nonReentrant} modifier\\n * available, which can be applied to functions to make sure there are no nested\\n * (reentrant) calls to them.\\n *\\n * Note that because there is a single `nonReentrant` guard, functions marked as\\n * `nonReentrant` may not call one another. This can be worked around by making\\n * those functions `private`, and then adding `external` `nonReentrant` entry\\n * points to them.\\n *\\n * TIP: If you would like to learn more about reentrancy and alternative ways\\n * to protect against it, check out our blog post\\n * https://blog.openzeppelin.com/reentrancy-after-istanbul/[Reentrancy After Istanbul].\\n */\\nabstract contract ReentrancyGuardUpgradeable is Initializable {\\n    // Booleans are more expensive than uint256 or any type that takes up a full\\n    // word because each write operation emits an extra SLOAD to first read the\\n    // slot's contents, replace the bits taken up by the boolean, and then write\\n    // back. This is the compiler's defense against contract upgrades and\\n    // pointer aliasing, and it cannot be disabled.\\n\\n    // The values being non-zero value makes deployment a bit more expensive,\\n    // but in exchange the refund on every call to nonReentrant will be lower in\\n    // amount. Since refunds are capped to a percentage of the total\\n    // transaction's gas, it is best to keep them low in cases like this one, to\\n    // increase the likelihood of the full refund coming into effect.\\n    uint256 private constant _NOT_ENTERED = 1;\\n    uint256 private constant _ENTERED = 2;\\n\\n    uint256 private _status;\\n\\n    function __ReentrancyGuard_init() internal onlyInitializing {\\n        __ReentrancyGuard_init_unchained();\\n    }\\n\\n    function __ReentrancyGuard_init_unchained() internal onlyInitializing {\\n        _status = _NOT_ENTERED;\\n    }\\n\\n    /**\\n     * @dev Prevents a contract from calling itself, directly or indirectly.\\n     * Calling a `nonReentrant` function from another `nonReentrant`\\n     * function is not supported. It is possible to prevent this from happening\\n     * by making the `nonReentrant` function external, and making it call a\\n     * `private` function that does the actual work.\\n     */\\n    modifier nonReentrant() {\\n        // On the first call to nonReentrant, _notEntered will be true\\n        require(_status != _ENTERED, \\\"ReentrancyGuard: reentrant call\\\");\\n\\n        // Any calls to nonReentrant after this point will fail\\n        _status = _ENTERED;\\n\\n        _;\\n\\n        // By storing the original value once again, a refund is triggered (see\\n        // https://eips.ethereum.org/EIPS/eip-2200)\\n        _status = _NOT_ENTERED;\\n    }\\n\\n    /**\\n     * @dev This empty reserved space is put in place to allow future versions to add new\\n     * variables without shifting down storage in the inheritance chain.\\n     * See https://docs.openzeppelin.com/contracts/4.x/upgradeable#storage_gaps\\n     */\\n    uint256[49] private __gap;\\n}\\n\",\"keccak256\":\"0x8cc03c5ac17e8a7396e487cda41fc1f1dfdb91db7d528e6da84bee3b6dd7e167\",\"license\":\"MIT\"},\"@openzeppelin/contracts-upgradeable/token/ERC20/IERC20Upgradeable.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.6.0) (token/ERC20/IERC20.sol)\\n\\npragma solidity ^0.8.0;\\n\\n/**\\n * @dev Interface of the ERC20 standard as defined in the EIP.\\n */\\ninterface IERC20Upgradeable {\\n    /**\\n     * @dev Emitted when `value` tokens are moved from one account (`from`) to\\n     * another (`to`).\\n     *\\n     * Note that `value` may be zero.\\n     */\\n    event Transfer(address indexed from, address indexed to, uint256 value);\\n\\n    /**\\n     * @dev Emitted when the allowance of a `spender` for an `owner` is set by\\n     * a call to {approve}. `value` is the new allowance.\\n     */\\n    event Approval(address indexed owner, address indexed spender, uint256 value);\\n\\n    /**\\n     * @dev Returns the amount of tokens in existence.\\n     */\\n    function totalSupply() external view returns (uint256);\\n\\n    /**\\n     * @dev Returns the amount of tokens owned by `account`.\\n     */\\n    function balanceOf(address account) external view returns (uint256);\\n\\n    /**\\n     * @dev Moves `amount` tokens from the caller's account to `to`.\\n     *\\n     * Returns a boolean value indicating whether the operation succeeded.\\n     *\\n     * Emits a {Transfer} event.\\n     */\\n    function transfer(address to, uint256 amount) external returns (bool);\\n\\n    /**\\n     * @dev Returns the remaining number of tokens that `spender` will be\\n     * allowed to spend on behalf of `owner` through {transferFrom}. This is\\n     * zero by default.\\n     *\\n     * This value changes when {approve} or {transferFrom} are called.\\n     */\\n    function allowance(address owner, address spender) external view returns (uint256);\\n\\n    /**\\n     * @dev Sets `amount` as the allowance of `spender` over the caller's tokens.\\n     *\\n     * Returns a boolean value indicating whether the operation succeeded.\\n     *\\n     * IMPORTANT: Beware that changing an allowance with this method brings the risk\\n     * that someone may use both the old and the new allowance by unfortunate\\n     * transaction ordering. One possible solution to mitigate this race\\n     * condition is to first reduce the spender's allowance to 0 and set the\\n     * desired value afterwards:\\n     * https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729\\n     *\\n     * Emits an {Approval} event.\\n     */\\n    function approve(address spender, uint256 amount) external returns (bool);\\n\\n    /**\\n     * @dev Moves `amount` tokens from `from` to `to` using the\\n     * allowance mechanism. `amount` is then deducted from the caller's\\n     * allowance.\\n     *\\n     * Returns a boolean value indicating whether the operation succeeded.\\n     *\\n     * Emits a {Transfer} event.\\n     */\\n    function transferFrom(\\n        address from,\\n        address to,\\n        uint256 amount\\n    ) external returns (bool);\\n}\\n\",\"keccak256\":\"0x4e733d3164f73f461eaf9d8087a7ad1ea180bdc8ba0d3d61b0e1ae16d8e63dff\",\"license\":\"MIT\"},\"@openzeppelin/contracts-upgradeable/token/ERC20/utils/SafeERC20Upgradeable.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts v4.4.1 (token/ERC20/utils/SafeERC20.sol)\\n\\npragma solidity ^0.8.0;\\n\\nimport \\\"../IERC20Upgradeable.sol\\\";\\nimport \\\"../../../utils/AddressUpgradeable.sol\\\";\\n\\n/**\\n * @title SafeERC20\\n * @dev Wrappers around ERC20 operations that throw on failure (when the token\\n * contract returns false). Tokens that return no value (and instead revert or\\n * throw on failure) are also supported, non-reverting calls are assumed to be\\n * successful.\\n * To use this library you can add a `using SafeERC20 for IERC20;` statement to your contract,\\n * which allows you to call the safe operations as `token.safeTransfer(...)`, etc.\\n */\\nlibrary SafeERC20Upgradeable {\\n    using AddressUpgradeable for address;\\n\\n    function safeTransfer(\\n        IERC20Upgradeable token,\\n        address to,\\n        uint256 value\\n    ) internal {\\n        _callOptionalReturn(token, abi.encodeWithSelector(token.transfer.selector, to, value));\\n    }\\n\\n    function safeTransferFrom(\\n        IERC20Upgradeable token,\\n        address from,\\n        address to,\\n        uint256 value\\n    ) internal {\\n        _callOptionalReturn(token, abi.encodeWithSelector(token.transferFrom.selector, from, to, value));\\n    }\\n\\n    /**\\n     * @dev Deprecated. This function has issues similar to the ones found in\\n     * {IERC20-approve}, and its usage is discouraged.\\n     *\\n     * Whenever possible, use {safeIncreaseAllowance} and\\n     * {safeDecreaseAllowance} instead.\\n     */\\n    function safeApprove(\\n        IERC20Upgradeable token,\\n        address spender,\\n        uint256 value\\n    ) internal {\\n        // safeApprove should only be called when setting an initial allowance,\\n        // or when resetting it to zero. To increase and decrease it, use\\n        // 'safeIncreaseAllowance' and 'safeDecreaseAllowance'\\n        require(\\n            (value == 0) || (token.allowance(address(this), spender) == 0),\\n            \\\"SafeERC20: approve from non-zero to non-zero allowance\\\"\\n        );\\n        _callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, value));\\n    }\\n\\n    function safeIncreaseAllowance(\\n        IERC20Upgradeable token,\\n        address spender,\\n        uint256 value\\n    ) internal {\\n        uint256 newAllowance = token.allowance(address(this), spender) + value;\\n        _callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, newAllowance));\\n    }\\n\\n    function safeDecreaseAllowance(\\n        IERC20Upgradeable token,\\n        address spender,\\n        uint256 value\\n    ) internal {\\n        unchecked {\\n            uint256 oldAllowance = token.allowance(address(this), spender);\\n            require(oldAllowance >= value, \\\"SafeERC20: decreased allowance below zero\\\");\\n            uint256 newAllowance = oldAllowance - value;\\n            _callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, newAllowance));\\n        }\\n    }\\n\\n    /**\\n     * @dev Imitates a Solidity high-level call (i.e. a regular function call to a contract), relaxing the requirement\\n     * on the return value: the return value is optional (but if data is returned, it must not be false).\\n     * @param token The token targeted by the call.\\n     * @param data The call data (encoded using abi.encode or one of its variants).\\n     */\\n    function _callOptionalReturn(IERC20Upgradeable token, bytes memory data) private {\\n        // We need to perform a low level call here, to bypass Solidity's return data size checking mechanism, since\\n        // we're implementing it ourselves. We use {Address.functionCall} to perform this call, which verifies that\\n        // the target address contains contract code and also asserts for success in the low-level call.\\n\\n        bytes memory returndata = address(token).functionCall(data, \\\"SafeERC20: low-level call failed\\\");\\n        if (returndata.length > 0) {\\n            // Return data is optional\\n            require(abi.decode(returndata, (bool)), \\\"SafeERC20: ERC20 operation did not succeed\\\");\\n        }\\n    }\\n}\\n\",\"keccak256\":\"0x3e26a49d2fa5ef8338b8a9467c91e54f417cb07e849b1cc0f4ebc4d2a147938e\",\"license\":\"MIT\"},\"@openzeppelin/contracts-upgradeable/utils/AddressUpgradeable.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.5.0) (utils/Address.sol)\\n\\npragma solidity ^0.8.1;\\n\\n/**\\n * @dev Collection of functions related to the address type\\n */\\nlibrary AddressUpgradeable {\\n    /**\\n     * @dev Returns true if `account` is a contract.\\n     *\\n     * [IMPORTANT]\\n     * ====\\n     * It is unsafe to assume that an address for which this function returns\\n     * false is an externally-owned account (EOA) and not a contract.\\n     *\\n     * Among others, `isContract` will return false for the following\\n     * types of addresses:\\n     *\\n     *  - an externally-owned account\\n     *  - a contract in construction\\n     *  - an address where a contract will be created\\n     *  - an address where a contract lived, but was destroyed\\n     * ====\\n     *\\n     * [IMPORTANT]\\n     * ====\\n     * You shouldn't rely on `isContract` to protect against flash loan attacks!\\n     *\\n     * Preventing calls from contracts is highly discouraged. It breaks composability, breaks support for smart wallets\\n     * like Gnosis Safe, and does not provide security since it can be circumvented by calling from a contract\\n     * constructor.\\n     * ====\\n     */\\n    function isContract(address account) internal view returns (bool) {\\n        // This method relies on extcodesize/address.code.length, which returns 0\\n        // for contracts in construction, since the code is only stored at the end\\n        // of the constructor execution.\\n\\n        return account.code.length > 0;\\n    }\\n\\n    /**\\n     * @dev Replacement for Solidity's `transfer`: sends `amount` wei to\\n     * `recipient`, forwarding all available gas and reverting on errors.\\n     *\\n     * https://eips.ethereum.org/EIPS/eip-1884[EIP1884] increases the gas cost\\n     * of certain opcodes, possibly making contracts go over the 2300 gas limit\\n     * imposed by `transfer`, making them unable to receive funds via\\n     * `transfer`. {sendValue} removes this limitation.\\n     *\\n     * https://diligence.consensys.net/posts/2019/09/stop-using-soliditys-transfer-now/[Learn more].\\n     *\\n     * IMPORTANT: because control is transferred to `recipient`, care must be\\n     * taken to not create reentrancy vulnerabilities. Consider using\\n     * {ReentrancyGuard} or the\\n     * https://solidity.readthedocs.io/en/v0.5.11/security-considerations.html#use-the-checks-effects-interactions-pattern[checks-effects-interactions pattern].\\n     */\\n    function sendValue(address payable recipient, uint256 amount) internal {\\n        require(address(this).balance >= amount, \\\"Address: insufficient balance\\\");\\n\\n        (bool success, ) = recipient.call{value: amount}(\\\"\\\");\\n        require(success, \\\"Address: unable to send value, recipient may have reverted\\\");\\n    }\\n\\n    /**\\n     * @dev Performs a Solidity function call using a low level `call`. A\\n     * plain `call` is an unsafe replacement for a function call: use this\\n     * function instead.\\n     *\\n     * If `target` reverts with a revert reason, it is bubbled up by this\\n     * function (like regular Solidity function calls).\\n     *\\n     * Returns the raw returned data. To convert to the expected return value,\\n     * use https://solidity.readthedocs.io/en/latest/units-and-global-variables.html?highlight=abi.decode#abi-encoding-and-decoding-functions[`abi.decode`].\\n     *\\n     * Requirements:\\n     *\\n     * - `target` must be a contract.\\n     * - calling `target` with `data` must not revert.\\n     *\\n     * _Available since v3.1._\\n     */\\n    function functionCall(address target, bytes memory data) internal returns (bytes memory) {\\n        return functionCall(target, data, \\\"Address: low-level call failed\\\");\\n    }\\n\\n    /**\\n     * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], but with\\n     * `errorMessage` as a fallback revert reason when `target` reverts.\\n     *\\n     * _Available since v3.1._\\n     */\\n    function functionCall(\\n        address target,\\n        bytes memory data,\\n        string memory errorMessage\\n    ) internal returns (bytes memory) {\\n        return functionCallWithValue(target, data, 0, errorMessage);\\n    }\\n\\n    /**\\n     * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],\\n     * but also transferring `value` wei to `target`.\\n     *\\n     * Requirements:\\n     *\\n     * - the calling contract must have an ETH balance of at least `value`.\\n     * - the called Solidity function must be `payable`.\\n     *\\n     * _Available since v3.1._\\n     */\\n    function functionCallWithValue(\\n        address target,\\n        bytes memory data,\\n        uint256 value\\n    ) internal returns (bytes memory) {\\n        return functionCallWithValue(target, data, value, \\\"Address: low-level call with value failed\\\");\\n    }\\n\\n    /**\\n     * @dev Same as {xref-Address-functionCallWithValue-address-bytes-uint256-}[`functionCallWithValue`], but\\n     * with `errorMessage` as a fallback revert reason when `target` reverts.\\n     *\\n     * _Available since v3.1._\\n     */\\n    function functionCallWithValue(\\n        address target,\\n        bytes memory data,\\n        uint256 value,\\n        string memory errorMessage\\n    ) internal returns (bytes memory) {\\n        require(address(this).balance >= value, \\\"Address: insufficient balance for call\\\");\\n        require(isContract(target), \\\"Address: call to non-contract\\\");\\n\\n        (bool success, bytes memory returndata) = target.call{value: value}(data);\\n        return verifyCallResult(success, returndata, errorMessage);\\n    }\\n\\n    /**\\n     * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],\\n     * but performing a static call.\\n     *\\n     * _Available since v3.3._\\n     */\\n    function functionStaticCall(address target, bytes memory data) internal view returns (bytes memory) {\\n        return functionStaticCall(target, data, \\\"Address: low-level static call failed\\\");\\n    }\\n\\n    /**\\n     * @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`],\\n     * but performing a static call.\\n     *\\n     * _Available since v3.3._\\n     */\\n    function functionStaticCall(\\n        address target,\\n        bytes memory data,\\n        string memory errorMessage\\n    ) internal view returns (bytes memory) {\\n        require(isContract(target), \\\"Address: static call to non-contract\\\");\\n\\n        (bool success, bytes memory returndata) = target.staticcall(data);\\n        return verifyCallResult(success, returndata, errorMessage);\\n    }\\n\\n    /**\\n     * @dev Tool to verifies that a low level call was successful, and revert if it wasn't, either by bubbling the\\n     * revert reason using the provided one.\\n     *\\n     * _Available since v4.3._\\n     */\\n    function verifyCallResult(\\n        bool success,\\n        bytes memory returndata,\\n        string memory errorMessage\\n    ) internal pure returns (bytes memory) {\\n        if (success) {\\n            return returndata;\\n        } else {\\n            // Look for revert reason and bubble it up if present\\n            if (returndata.length > 0) {\\n                // The easiest way to bubble the revert reason is using memory via assembly\\n\\n                assembly {\\n                    let returndata_size := mload(returndata)\\n                    revert(add(32, returndata), returndata_size)\\n                }\\n            } else {\\n                revert(errorMessage);\\n            }\\n        }\\n    }\\n}\\n\",\"keccak256\":\"0x55cf2bd9fc76704ddcdc19834cd288b7de00fc0f298a40ea16a954ae8991db2d\",\"license\":\"MIT\"},\"@openzeppelin/contracts-upgradeable/utils/ContextUpgradeable.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts v4.4.1 (utils/Context.sol)\\n\\npragma solidity ^0.8.0;\\nimport \\\"../proxy/utils/Initializable.sol\\\";\\n\\n/**\\n * @dev Provides information about the current execution context, including the\\n * sender of the transaction and its data. While these are generally available\\n * via msg.sender and msg.data, they should not be accessed in such a direct\\n * manner, since when dealing with meta-transactions the account sending and\\n * paying for execution may not be the actual sender (as far as an application\\n * is concerned).\\n *\\n * This contract is only required for intermediate, library-like contracts.\\n */\\nabstract contract ContextUpgradeable is Initializable {\\n    function __Context_init() internal onlyInitializing {\\n    }\\n\\n    function __Context_init_unchained() internal onlyInitializing {\\n    }\\n    function _msgSender() internal view virtual returns (address) {\\n        return msg.sender;\\n    }\\n\\n    function _msgData() internal view virtual returns (bytes calldata) {\\n        return msg.data;\\n    }\\n\\n    /**\\n     * @dev This empty reserved space is put in place to allow future versions to add new\\n     * variables without shifting down storage in the inheritance chain.\\n     * See https://docs.openzeppelin.com/contracts/4.x/upgradeable#storage_gaps\\n     */\\n    uint256[50] private __gap;\\n}\\n\",\"keccak256\":\"0x963ea7f0b48b032eef72fe3a7582edf78408d6f834115b9feadd673a4d5bd149\",\"license\":\"MIT\"},\"@openzeppelin/contracts-upgradeable/utils/StringsUpgradeable.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts v4.4.1 (utils/Strings.sol)\\n\\npragma solidity ^0.8.0;\\n\\n/**\\n * @dev String operations.\\n */\\nlibrary StringsUpgradeable {\\n    bytes16 private constant _HEX_SYMBOLS = \\\"0123456789abcdef\\\";\\n\\n    /**\\n     * @dev Converts a `uint256` to its ASCII `string` decimal representation.\\n     */\\n    function toString(uint256 value) internal pure returns (string memory) {\\n        // Inspired by OraclizeAPI's implementation - MIT licence\\n        // https://github.com/oraclize/ethereum-api/blob/b42146b063c7d6ee1358846c198246239e9360e8/oraclizeAPI_0.4.25.sol\\n\\n        if (value == 0) {\\n            return \\\"0\\\";\\n        }\\n        uint256 temp = value;\\n        uint256 digits;\\n        while (temp != 0) {\\n            digits++;\\n            temp /= 10;\\n        }\\n        bytes memory buffer = new bytes(digits);\\n        while (value != 0) {\\n            digits -= 1;\\n            buffer[digits] = bytes1(uint8(48 + uint256(value % 10)));\\n            value /= 10;\\n        }\\n        return string(buffer);\\n    }\\n\\n    /**\\n     * @dev Converts a `uint256` to its ASCII `string` hexadecimal representation.\\n     */\\n    function toHexString(uint256 value) internal pure returns (string memory) {\\n        if (value == 0) {\\n            return \\\"0x00\\\";\\n        }\\n        uint256 temp = value;\\n        uint256 length = 0;\\n        while (temp != 0) {\\n            length++;\\n            temp >>= 8;\\n        }\\n        return toHexString(value, length);\\n    }\\n\\n    /**\\n     * @dev Converts a `uint256` to its ASCII `string` hexadecimal representation with fixed length.\\n     */\\n    function toHexString(uint256 value, uint256 length) internal pure returns (string memory) {\\n        bytes memory buffer = new bytes(2 * length + 2);\\n        buffer[0] = \\\"0\\\";\\n        buffer[1] = \\\"x\\\";\\n        for (uint256 i = 2 * length + 1; i > 1; --i) {\\n            buffer[i] = _HEX_SYMBOLS[value & 0xf];\\n            value >>= 4;\\n        }\\n        require(value == 0, \\\"Strings: hex length insufficient\\\");\\n        return string(buffer);\\n    }\\n}\\n\",\"keccak256\":\"0x398d3323c1932a5986bf36be7c57593e121e69d5db5b6574b4ee0d031443de37\",\"license\":\"MIT\"},\"@openzeppelin/contracts-upgradeable/utils/cryptography/ECDSAUpgradeable.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.5.0) (utils/cryptography/ECDSA.sol)\\n\\npragma solidity ^0.8.0;\\n\\nimport \\\"../StringsUpgradeable.sol\\\";\\n\\n/**\\n * @dev Elliptic Curve Digital Signature Algorithm (ECDSA) operations.\\n *\\n * These functions can be used to verify that a message was signed by the holder\\n * of the private keys of a given address.\\n */\\nlibrary ECDSAUpgradeable {\\n    enum RecoverError {\\n        NoError,\\n        InvalidSignature,\\n        InvalidSignatureLength,\\n        InvalidSignatureS,\\n        InvalidSignatureV\\n    }\\n\\n    function _throwError(RecoverError error) private pure {\\n        if (error == RecoverError.NoError) {\\n            return; // no error: do nothing\\n        } else if (error == RecoverError.InvalidSignature) {\\n            revert(\\\"ECDSA: invalid signature\\\");\\n        } else if (error == RecoverError.InvalidSignatureLength) {\\n            revert(\\\"ECDSA: invalid signature length\\\");\\n        } else if (error == RecoverError.InvalidSignatureS) {\\n            revert(\\\"ECDSA: invalid signature 's' value\\\");\\n        } else if (error == RecoverError.InvalidSignatureV) {\\n            revert(\\\"ECDSA: invalid signature 'v' value\\\");\\n        }\\n    }\\n\\n    /**\\n     * @dev Returns the address that signed a hashed message (`hash`) with\\n     * `signature` or error string. This address can then be used for verification purposes.\\n     *\\n     * The `ecrecover` EVM opcode allows for malleable (non-unique) signatures:\\n     * this function rejects them by requiring the `s` value to be in the lower\\n     * half order, and the `v` value to be either 27 or 28.\\n     *\\n     * IMPORTANT: `hash` _must_ be the result of a hash operation for the\\n     * verification to be secure: it is possible to craft signatures that\\n     * recover to arbitrary addresses for non-hashed data. A safe way to ensure\\n     * this is by receiving a hash of the original message (which may otherwise\\n     * be too long), and then calling {toEthSignedMessageHash} on it.\\n     *\\n     * Documentation for signature generation:\\n     * - with https://web3js.readthedocs.io/en/v1.3.4/web3-eth-accounts.html#sign[Web3.js]\\n     * - with https://docs.ethers.io/v5/api/signer/#Signer-signMessage[ethers]\\n     *\\n     * _Available since v4.3._\\n     */\\n    function tryRecover(bytes32 hash, bytes memory signature) internal pure returns (address, RecoverError) {\\n        // Check the signature length\\n        // - case 65: r,s,v signature (standard)\\n        // - case 64: r,vs signature (cf https://eips.ethereum.org/EIPS/eip-2098) _Available since v4.1._\\n        if (signature.length == 65) {\\n            bytes32 r;\\n            bytes32 s;\\n            uint8 v;\\n            // ecrecover takes the signature parameters, and the only way to get them\\n            // currently is to use assembly.\\n            assembly {\\n                r := mload(add(signature, 0x20))\\n                s := mload(add(signature, 0x40))\\n                v := byte(0, mload(add(signature, 0x60)))\\n            }\\n            return tryRecover(hash, v, r, s);\\n        } else if (signature.length == 64) {\\n            bytes32 r;\\n            bytes32 vs;\\n            // ecrecover takes the signature parameters, and the only way to get them\\n            // currently is to use assembly.\\n            assembly {\\n                r := mload(add(signature, 0x20))\\n                vs := mload(add(signature, 0x40))\\n            }\\n            return tryRecover(hash, r, vs);\\n        } else {\\n            return (address(0), RecoverError.InvalidSignatureLength);\\n        }\\n    }\\n\\n    /**\\n     * @dev Returns the address that signed a hashed message (`hash`) with\\n     * `signature`. This address can then be used for verification purposes.\\n     *\\n     * The `ecrecover` EVM opcode allows for malleable (non-unique) signatures:\\n     * this function rejects them by requiring the `s` value to be in the lower\\n     * half order, and the `v` value to be either 27 or 28.\\n     *\\n     * IMPORTANT: `hash` _must_ be the result of a hash operation for the\\n     * verification to be secure: it is possible to craft signatures that\\n     * recover to arbitrary addresses for non-hashed data. A safe way to ensure\\n     * this is by receiving a hash of the original message (which may otherwise\\n     * be too long), and then calling {toEthSignedMessageHash} on it.\\n     */\\n    function recover(bytes32 hash, bytes memory signature) internal pure returns (address) {\\n        (address recovered, RecoverError error) = tryRecover(hash, signature);\\n        _throwError(error);\\n        return recovered;\\n    }\\n\\n    /**\\n     * @dev Overload of {ECDSA-tryRecover} that receives the `r` and `vs` short-signature fields separately.\\n     *\\n     * See https://eips.ethereum.org/EIPS/eip-2098[EIP-2098 short signatures]\\n     *\\n     * _Available since v4.3._\\n     */\\n    function tryRecover(\\n        bytes32 hash,\\n        bytes32 r,\\n        bytes32 vs\\n    ) internal pure returns (address, RecoverError) {\\n        bytes32 s = vs & bytes32(0x7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff);\\n        uint8 v = uint8((uint256(vs) >> 255) + 27);\\n        return tryRecover(hash, v, r, s);\\n    }\\n\\n    /**\\n     * @dev Overload of {ECDSA-recover} that receives the `r and `vs` short-signature fields separately.\\n     *\\n     * _Available since v4.2._\\n     */\\n    function recover(\\n        bytes32 hash,\\n        bytes32 r,\\n        bytes32 vs\\n    ) internal pure returns (address) {\\n        (address recovered, RecoverError error) = tryRecover(hash, r, vs);\\n        _throwError(error);\\n        return recovered;\\n    }\\n\\n    /**\\n     * @dev Overload of {ECDSA-tryRecover} that receives the `v`,\\n     * `r` and `s` signature fields separately.\\n     *\\n     * _Available since v4.3._\\n     */\\n    function tryRecover(\\n        bytes32 hash,\\n        uint8 v,\\n        bytes32 r,\\n        bytes32 s\\n    ) internal pure returns (address, RecoverError) {\\n        // EIP-2 still allows signature malleability for ecrecover(). Remove this possibility and make the signature\\n        // unique. Appendix F in the Ethereum Yellow paper (https://ethereum.github.io/yellowpaper/paper.pdf), defines\\n        // the valid range for s in (301): 0 < s < secp256k1n \\u00f7 2 + 1, and for v in (302): v \\u2208 {27, 28}. Most\\n        // signatures from current libraries generate a unique signature with an s-value in the lower half order.\\n        //\\n        // If your library generates malleable signatures, such as s-values in the upper range, calculate a new s-value\\n        // with 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFEBAAEDCE6AF48A03BBFD25E8CD0364141 - s1 and flip v from 27 to 28 or\\n        // vice versa. If your library also generates signatures with 0/1 for v instead 27/28, add 27 to v to accept\\n        // these malleable signatures as well.\\n        if (uint256(s) > 0x7FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF5D576E7357A4501DDFE92F46681B20A0) {\\n            return (address(0), RecoverError.InvalidSignatureS);\\n        }\\n        if (v != 27 && v != 28) {\\n            return (address(0), RecoverError.InvalidSignatureV);\\n        }\\n\\n        // If the signature is valid (and not malleable), return the signer address\\n        address signer = ecrecover(hash, v, r, s);\\n        if (signer == address(0)) {\\n            return (address(0), RecoverError.InvalidSignature);\\n        }\\n\\n        return (signer, RecoverError.NoError);\\n    }\\n\\n    /**\\n     * @dev Overload of {ECDSA-recover} that receives the `v`,\\n     * `r` and `s` signature fields separately.\\n     */\\n    function recover(\\n        bytes32 hash,\\n        uint8 v,\\n        bytes32 r,\\n        bytes32 s\\n    ) internal pure returns (address) {\\n        (address recovered, RecoverError error) = tryRecover(hash, v, r, s);\\n        _throwError(error);\\n        return recovered;\\n    }\\n\\n    /**\\n     * @dev Returns an Ethereum Signed Message, created from a `hash`. This\\n     * produces hash corresponding to the one signed with the\\n     * https://eth.wiki/json-rpc/API#eth_sign[`eth_sign`]\\n     * JSON-RPC method as part of EIP-191.\\n     *\\n     * See {recover}.\\n     */\\n    function toEthSignedMessageHash(bytes32 hash) internal pure returns (bytes32) {\\n        // 32 is the length in bytes of hash,\\n        // enforced by the type signature above\\n        return keccak256(abi.encodePacked(\\\"\\\\x19Ethereum Signed Message:\\\\n32\\\", hash));\\n    }\\n\\n    /**\\n     * @dev Returns an Ethereum Signed Message, created from `s`. This\\n     * produces hash corresponding to the one signed with the\\n     * https://eth.wiki/json-rpc/API#eth_sign[`eth_sign`]\\n     * JSON-RPC method as part of EIP-191.\\n     *\\n     * See {recover}.\\n     */\\n    function toEthSignedMessageHash(bytes memory s) internal pure returns (bytes32) {\\n        return keccak256(abi.encodePacked(\\\"\\\\x19Ethereum Signed Message:\\\\n\\\", StringsUpgradeable.toString(s.length), s));\\n    }\\n\\n    /**\\n     * @dev Returns an Ethereum Signed Typed Data, created from a\\n     * `domainSeparator` and a `structHash`. This produces hash corresponding\\n     * to the one signed with the\\n     * https://eips.ethereum.org/EIPS/eip-712[`eth_signTypedData`]\\n     * JSON-RPC method as part of EIP-712.\\n     *\\n     * See {recover}.\\n     */\\n    function toTypedDataHash(bytes32 domainSeparator, bytes32 structHash) internal pure returns (bytes32) {\\n        return keccak256(abi.encodePacked(\\\"\\\\x19\\\\x01\\\", domainSeparator, structHash));\\n    }\\n}\\n\",\"keccak256\":\"0x6602a65e0277f31f45cad4c7a15b024fd182f2f0e01eaa1954103b0d57848a27\",\"license\":\"MIT\"},\"@openzeppelin/contracts-upgradeable/utils/cryptography/draft-EIP712Upgradeable.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts v4.4.1 (utils/cryptography/draft-EIP712.sol)\\n\\npragma solidity ^0.8.0;\\n\\nimport \\\"./ECDSAUpgradeable.sol\\\";\\nimport \\\"../../proxy/utils/Initializable.sol\\\";\\n\\n/**\\n * @dev https://eips.ethereum.org/EIPS/eip-712[EIP 712] is a standard for hashing and signing of typed structured data.\\n *\\n * The encoding specified in the EIP is very generic, and such a generic implementation in Solidity is not feasible,\\n * thus this contract does not implement the encoding itself. Protocols need to implement the type-specific encoding\\n * they need in their contracts using a combination of `abi.encode` and `keccak256`.\\n *\\n * This contract implements the EIP 712 domain separator ({_domainSeparatorV4}) that is used as part of the encoding\\n * scheme, and the final step of the encoding to obtain the message digest that is then signed via ECDSA\\n * ({_hashTypedDataV4}).\\n *\\n * The implementation of the domain separator was designed to be as efficient as possible while still properly updating\\n * the chain id to protect against replay attacks on an eventual fork of the chain.\\n *\\n * NOTE: This contract implements the version of the encoding known as \\\"v4\\\", as implemented by the JSON RPC method\\n * https://docs.metamask.io/guide/signing-data.html[`eth_signTypedDataV4` in MetaMask].\\n *\\n * _Available since v3.4._\\n *\\n * @custom:storage-size 52\\n */\\nabstract contract EIP712Upgradeable is Initializable {\\n    /* solhint-disable var-name-mixedcase */\\n    bytes32 private _HASHED_NAME;\\n    bytes32 private _HASHED_VERSION;\\n    bytes32 private constant _TYPE_HASH = keccak256(\\\"EIP712Domain(string name,string version,uint256 chainId,address verifyingContract)\\\");\\n\\n    /* solhint-enable var-name-mixedcase */\\n\\n    /**\\n     * @dev Initializes the domain separator and parameter caches.\\n     *\\n     * The meaning of `name` and `version` is specified in\\n     * https://eips.ethereum.org/EIPS/eip-712#definition-of-domainseparator[EIP 712]:\\n     *\\n     * - `name`: the user readable name of the signing domain, i.e. the name of the DApp or the protocol.\\n     * - `version`: the current major version of the signing domain.\\n     *\\n     * NOTE: These parameters cannot be changed except through a xref:learn::upgrading-smart-contracts.adoc[smart\\n     * contract upgrade].\\n     */\\n    function __EIP712_init(string memory name, string memory version) internal onlyInitializing {\\n        __EIP712_init_unchained(name, version);\\n    }\\n\\n    function __EIP712_init_unchained(string memory name, string memory version) internal onlyInitializing {\\n        bytes32 hashedName = keccak256(bytes(name));\\n        bytes32 hashedVersion = keccak256(bytes(version));\\n        _HASHED_NAME = hashedName;\\n        _HASHED_VERSION = hashedVersion;\\n    }\\n\\n    /**\\n     * @dev Returns the domain separator for the current chain.\\n     */\\n    function _domainSeparatorV4() internal view returns (bytes32) {\\n        return _buildDomainSeparator(_TYPE_HASH, _EIP712NameHash(), _EIP712VersionHash());\\n    }\\n\\n    function _buildDomainSeparator(\\n        bytes32 typeHash,\\n        bytes32 nameHash,\\n        bytes32 versionHash\\n    ) private view returns (bytes32) {\\n        return keccak256(abi.encode(typeHash, nameHash, versionHash, block.chainid, address(this)));\\n    }\\n\\n    /**\\n     * @dev Given an already https://eips.ethereum.org/EIPS/eip-712#definition-of-hashstruct[hashed struct], this\\n     * function returns the hash of the fully encoded EIP712 message for this domain.\\n     *\\n     * This hash can be used together with {ECDSA-recover} to obtain the signer of a message. For example:\\n     *\\n     * ```solidity\\n     * bytes32 digest = _hashTypedDataV4(keccak256(abi.encode(\\n     *     keccak256(\\\"Mail(address to,string contents)\\\"),\\n     *     mailTo,\\n     *     keccak256(bytes(mailContents))\\n     * )));\\n     * address signer = ECDSA.recover(digest, signature);\\n     * ```\\n     */\\n    function _hashTypedDataV4(bytes32 structHash) internal view virtual returns (bytes32) {\\n        return ECDSAUpgradeable.toTypedDataHash(_domainSeparatorV4(), structHash);\\n    }\\n\\n    /**\\n     * @dev The hash of the name parameter for the EIP712 domain.\\n     *\\n     * NOTE: This function reads from storage by default, but can be redefined to return a constant value if gas costs\\n     * are a concern.\\n     */\\n    function _EIP712NameHash() internal virtual view returns (bytes32) {\\n        return _HASHED_NAME;\\n    }\\n\\n    /**\\n     * @dev The hash of the version parameter for the EIP712 domain.\\n     *\\n     * NOTE: This function reads from storage by default, but can be redefined to return a constant value if gas costs\\n     * are a concern.\\n     */\\n    function _EIP712VersionHash() internal virtual view returns (bytes32) {\\n        return _HASHED_VERSION;\\n    }\\n\\n    /**\\n     * @dev This empty reserved space is put in place to allow future versions to add new\\n     * variables without shifting down storage in the inheritance chain.\\n     * See https://docs.openzeppelin.com/contracts/4.x/upgradeable#storage_gaps\\n     */\\n    uint256[50] private __gap;\\n}\\n\",\"keccak256\":\"0xaf5a96100f421d61693605349511e43221d3c2e47d4b3efa87af2b936e2567fc\",\"license\":\"MIT\"},\"@openzeppelin/contracts-upgradeable/utils/math/SafeMathUpgradeable.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n// OpenZeppelin Contracts (last updated v4.6.0) (utils/math/SafeMath.sol)\\n\\npragma solidity ^0.8.0;\\n\\n// CAUTION\\n// This version of SafeMath should only be used with Solidity 0.8 or later,\\n// because it relies on the compiler's built in overflow checks.\\n\\n/**\\n * @dev Wrappers over Solidity's arithmetic operations.\\n *\\n * NOTE: `SafeMath` is generally not needed starting with Solidity 0.8, since the compiler\\n * now has built in overflow checking.\\n */\\nlibrary SafeMathUpgradeable {\\n    /**\\n     * @dev Returns the addition of two unsigned integers, with an overflow flag.\\n     *\\n     * _Available since v3.4._\\n     */\\n    function tryAdd(uint256 a, uint256 b) internal pure returns (bool, uint256) {\\n        unchecked {\\n            uint256 c = a + b;\\n            if (c < a) return (false, 0);\\n            return (true, c);\\n        }\\n    }\\n\\n    /**\\n     * @dev Returns the subtraction of two unsigned integers, with an overflow flag.\\n     *\\n     * _Available since v3.4._\\n     */\\n    function trySub(uint256 a, uint256 b) internal pure returns (bool, uint256) {\\n        unchecked {\\n            if (b > a) return (false, 0);\\n            return (true, a - b);\\n        }\\n    }\\n\\n    /**\\n     * @dev Returns the multiplication of two unsigned integers, with an overflow flag.\\n     *\\n     * _Available since v3.4._\\n     */\\n    function tryMul(uint256 a, uint256 b) internal pure returns (bool, uint256) {\\n        unchecked {\\n            // Gas optimization: this is cheaper than requiring 'a' not being zero, but the\\n            // benefit is lost if 'b' is also tested.\\n            // See: https://github.com/OpenZeppelin/openzeppelin-contracts/pull/522\\n            if (a == 0) return (true, 0);\\n            uint256 c = a * b;\\n            if (c / a != b) return (false, 0);\\n            return (true, c);\\n        }\\n    }\\n\\n    /**\\n     * @dev Returns the division of two unsigned integers, with a division by zero flag.\\n     *\\n     * _Available since v3.4._\\n     */\\n    function tryDiv(uint256 a, uint256 b) internal pure returns (bool, uint256) {\\n        unchecked {\\n            if (b == 0) return (false, 0);\\n            return (true, a / b);\\n        }\\n    }\\n\\n    /**\\n     * @dev Returns the remainder of dividing two unsigned integers, with a division by zero flag.\\n     *\\n     * _Available since v3.4._\\n     */\\n    function tryMod(uint256 a, uint256 b) internal pure returns (bool, uint256) {\\n        unchecked {\\n            if (b == 0) return (false, 0);\\n            return (true, a % b);\\n        }\\n    }\\n\\n    /**\\n     * @dev Returns the addition of two unsigned integers, reverting on\\n     * overflow.\\n     *\\n     * Counterpart to Solidity's `+` operator.\\n     *\\n     * Requirements:\\n     *\\n     * - Addition cannot overflow.\\n     */\\n    function add(uint256 a, uint256 b) internal pure returns (uint256) {\\n        return a + b;\\n    }\\n\\n    /**\\n     * @dev Returns the subtraction of two unsigned integers, reverting on\\n     * overflow (when the result is negative).\\n     *\\n     * Counterpart to Solidity's `-` operator.\\n     *\\n     * Requirements:\\n     *\\n     * - Subtraction cannot overflow.\\n     */\\n    function sub(uint256 a, uint256 b) internal pure returns (uint256) {\\n        return a - b;\\n    }\\n\\n    /**\\n     * @dev Returns the multiplication of two unsigned integers, reverting on\\n     * overflow.\\n     *\\n     * Counterpart to Solidity's `*` operator.\\n     *\\n     * Requirements:\\n     *\\n     * - Multiplication cannot overflow.\\n     */\\n    function mul(uint256 a, uint256 b) internal pure returns (uint256) {\\n        return a * b;\\n    }\\n\\n    /**\\n     * @dev Returns the integer division of two unsigned integers, reverting on\\n     * division by zero. The result is rounded towards zero.\\n     *\\n     * Counterpart to Solidity's `/` operator.\\n     *\\n     * Requirements:\\n     *\\n     * - The divisor cannot be zero.\\n     */\\n    function div(uint256 a, uint256 b) internal pure returns (uint256) {\\n        return a / b;\\n    }\\n\\n    /**\\n     * @dev Returns the remainder of dividing two unsigned integers. (unsigned integer modulo),\\n     * reverting when dividing by zero.\\n     *\\n     * Counterpart to Solidity's `%` operator. This function uses a `revert`\\n     * opcode (which leaves remaining gas untouched) while Solidity uses an\\n     * invalid opcode to revert (consuming all remaining gas).\\n     *\\n     * Requirements:\\n     *\\n     * - The divisor cannot be zero.\\n     */\\n    function mod(uint256 a, uint256 b) internal pure returns (uint256) {\\n        return a % b;\\n    }\\n\\n    /**\\n     * @dev Returns the subtraction of two unsigned integers, reverting with custom message on\\n     * overflow (when the result is negative).\\n     *\\n     * CAUTION: This function is deprecated because it requires allocating memory for the error\\n     * message unnecessarily. For custom revert reasons use {trySub}.\\n     *\\n     * Counterpart to Solidity's `-` operator.\\n     *\\n     * Requirements:\\n     *\\n     * - Subtraction cannot overflow.\\n     */\\n    function sub(\\n        uint256 a,\\n        uint256 b,\\n        string memory errorMessage\\n    ) internal pure returns (uint256) {\\n        unchecked {\\n            require(b <= a, errorMessage);\\n            return a - b;\\n        }\\n    }\\n\\n    /**\\n     * @dev Returns the integer division of two unsigned integers, reverting with custom message on\\n     * division by zero. The result is rounded towards zero.\\n     *\\n     * Counterpart to Solidity's `/` operator. Note: this function uses a\\n     * `revert` opcode (which leaves remaining gas untouched) while Solidity\\n     * uses an invalid opcode to revert (consuming all remaining gas).\\n     *\\n     * Requirements:\\n     *\\n     * - The divisor cannot be zero.\\n     */\\n    function div(\\n        uint256 a,\\n        uint256 b,\\n        string memory errorMessage\\n    ) internal pure returns (uint256) {\\n        unchecked {\\n            require(b > 0, errorMessage);\\n            return a / b;\\n        }\\n    }\\n\\n    /**\\n     * @dev Returns the remainder of dividing two unsigned integers. (unsigned integer modulo),\\n     * reverting with custom message when dividing by zero.\\n     *\\n     * CAUTION: This function is deprecated because it requires allocating memory for the error\\n     * message unnecessarily. For custom revert reasons use {tryMod}.\\n     *\\n     * Counterpart to Solidity's `%` operator. This function uses a `revert`\\n     * opcode (which leaves remaining gas untouched) while Solidity uses an\\n     * invalid opcode to revert (consuming all remaining gas).\\n     *\\n     * Requirements:\\n     *\\n     * - The divisor cannot be zero.\\n     */\\n    function mod(\\n        uint256 a,\\n        uint256 b,\\n        string memory errorMessage\\n    ) internal pure returns (uint256) {\\n        unchecked {\\n            require(b > 0, errorMessage);\\n            return a % b;\\n        }\\n    }\\n}\\n\",\"keccak256\":\"0xcaa8b7861115ea691c77ddbeac140a444e0edcd1d9812a43942c0f6b42b36a49\",\"license\":\"MIT\"},\"contracts/access/OwnerWithdrawable.sol\":{\"content\":\"// SPDX-License-Identifier: UNLICENSE\\n\\npragma solidity >=0.8.0;\\n\\nimport '@openzeppelin/contracts-upgradeable/access/OwnableUpgradeable.sol';\\nimport '@openzeppelin/contracts-upgradeable/interfaces/IERC20Upgradeable.sol';\\nimport '@openzeppelin/contracts-upgradeable/token/ERC20/utils/SafeERC20Upgradeable.sol';\\n\\n/// @author Alexandas\\n/// @dev Make the contract owner can withdraw token and eth\\nabstract contract OwnerWithdrawable is OwnableUpgradeable {\\n\\tusing SafeERC20Upgradeable for IERC20Upgradeable;\\n\\n\\t/// @dev emit when token is withdrawn\\n\\t/// @param token token address\\n\\t/// @param to receiver address\\n\\t/// @param value token value\\n\\tevent Withdrawal(IERC20Upgradeable token, address to, uint256 value);\\n\\n\\t/// @dev emit when ETH is withdrawn\\n\\t/// @param to receiver address\\n\\t/// @param value token value\\n\\tevent NativeWithdrawal(address to, uint256 value);\\n\\n\\t/// @dev withdraw token\\n\\t/// @param token token address\\n\\t/// @param to receiver address\\n\\t/// @param value token value\\n\\tfunction ownerWithdrawERC20(\\n\\t\\tIERC20Upgradeable token,\\n\\t\\taddress to,\\n\\t\\tuint256 value\\n\\t) external onlyOwner {\\n\\t\\ttoken.safeTransfer(to, value);\\n\\t\\temit Withdrawal(token, to, value);\\n\\t}\\n\\n\\t/// @dev withdraw ETH\\n\\t/// @param to receiver address\\n\\t/// @param value token value\\n\\tfunction ownerWithdrawNative(address payable to, uint256 value) external onlyOwner {\\n\\t\\tbool success = to.send(value);\\n\\t\\trequire(success, 'OwnerWithdrawable: withdraw native token failed');\\n\\t\\temit NativeWithdrawal(to, value);\\n\\t}\\n}\\n\",\"keccak256\":\"0x0f36a2a9ed2839c2530c4e27f9b1797f13e8a6a3d3c9bcaa4c87202f14757954\",\"license\":\"UNLICENSE\"},\"contracts/govers/RouterWrapper.sol\":{\"content\":\"// SPDX-License-Identifier: UNLICENSE\\n\\npragma solidity >=0.8.0;\\nimport '@openzeppelin/contracts-upgradeable/proxy/utils/Initializable.sol';\\nimport '../interfaces/IRouter.sol';\\n\\n/// @author Alexandas\\n/// @dev Router wrapper contract\\nabstract contract RouterWrapper is Initializable {\\n\\t/// @dev router contract address\\n\\tIRouter public router;\\n\\n\\t/// @dev emit when provider registry contract updated\\n\\t/// @param router contract address\\n\\tevent RouterUpdated(IRouter router);\\n\\n\\tmodifier onlyGovernance() {\\n\\t\\tIGovernance governance = router.Governance();\\n\\t\\trequire(msg.sender == address(governance), 'RouterWrapper: caller is not the governance');\\n\\t\\t_;\\n\\t}\\n\\n\\tmodifier onlyProviderController() {\\n\\t\\tIProviderController controller = router.ProviderController();\\n\\t\\trequire(msg.sender == address(controller), 'RouterWrapper: caller is not the provider controller');\\n\\t\\t_;\\n\\t}\\n\\n\\tmodifier onlyProvider() {\\n\\t\\tIProviderRegistry providerRegistry = router.ProviderRegistry();\\n\\t\\trequire(providerRegistry.isProvider(msg.sender), 'RouterWrapper: caller is not the provider');\\n\\t\\t_;\\n\\t}\\n\\n\\tmodifier onlyMessageReceiver() {\\n\\t\\taddress messageReceiver = router.MessageReceiver();\\n\\t\\trequire(msg.sender == messageReceiver, 'RouterWrapper: caller is not message receiver');\\n\\t\\t_;\\n\\t}\\n\\n\\tmodifier onlyDstChainPayment() {\\n\\t\\tIDstChainPayment dstChainPayment = router.DstChainPayment();\\n\\t\\trequire(msg.sender == address(dstChainPayment), 'RouterWrapper: caller is not dst chain payment');\\n\\t\\t_;\\n\\t}\\n\\n\\tmodifier onlyFundPool() {\\n\\t\\tIFundPool pool = router.FundPool();\\n\\t\\trequire(msg.sender == address(pool), 'RouterWrapper: caller is not fund pool');\\n\\t\\t_;\\n\\t}\\n\\n\\t/// @dev initialize provider registry contract\\n\\t/// @param _router contract address\\n\\tfunction __Init_Router(IRouter _router) internal onlyInitializing {\\n\\t\\t_setRouter(_router);\\n\\t}\\n\\n\\tfunction _setRouter(IRouter _router) internal {\\n\\t\\trequire(address(_router) != address(0), 'RouterWrapper: zero address');\\n\\t\\trouter = _router;\\n\\t\\temit RouterUpdated(_router);\\n\\t}\\n}\\n\",\"keccak256\":\"0x0867787020dc7ff95048c08570a69761ebdb8608517829cd122ef9677da8c45f\",\"license\":\"UNLICENSE\"},\"contracts/interfaces/IBilling.sol\":{\"content\":\"// SPDX-License-Identifier: UNLICENSE\\n\\npragma solidity >=0.8.0;\\n\\nimport '@openzeppelin/contracts-upgradeable/interfaces/IERC20Upgradeable.sol';\\nimport '../libraries/ResourceData.sol';\\nimport '../resources/interfaces/IResourcePriceAdaptor.sol';\\n\\n/// @author Alexandas\\n/// @dev Billing interface\\ninterface IBilling {\\n\\tstruct BillEntry {\\n\\t\\tResourceData.ResourceType resourceType;\\n\\t\\tuint256 amount;\\n\\t}\\n\\n\\tstruct Bill {\\n\\t\\tuint256 indexBlock;\\n\\t\\tBillEntry[] entries;\\n\\t}\\n\\n\\t/// @dev emit when billing types hash updated\\n\\t/// @param hash billing types Hash\\n\\tevent BillingTypesHashUpdated(bytes32 hash);\\n\\n\\t/// @dev emit when bills finalized\\n\\t/// @param provider provider address\\n\\t/// @param account user account\\n\\t/// @param bills bills data\\n\\t/// @param amount fee\\n\\t/// @param nonce nonce\\n\\tevent Billing(address provider, bytes32 account, bytes bills, uint256 amount, uint64 nonce);\\n\\n\\t/// @dev get billing types hash\\n\\t/// @return billing types hash\\n\\tfunction billingTypesHash() external view returns (bytes32);\\n\\n\\t/// @dev spend bills\\n\\t/// @param provider provider address\\n\\t/// @param account user account\\n\\t/// @param bills billing data\\n\\t/// @param timeout tx timeout\\n\\t/// @param nonce billing nonce\\n\\t/// @param signature billing signature\\n\\t/// @return fee billing fee\\n\\tfunction spend(\\n\\t\\taddress provider,\\n\\t\\tbytes32 account,\\n\\t\\tbytes memory bills,\\n\\t\\tuint256 timeout,\\n\\t\\tuint64 nonce,\\n\\t\\tbytes memory signature\\n\\t) external returns (uint256 fee);\\n\\n\\t/// @dev return balance of provider\\n\\t/// @param provider provider address\\n\\t/// @return balance of provider\\n\\tfunction balanceOf(address provider) external view returns (uint256);\\n\\n\\t/// @dev provider nonces for account\\n\\t/// @param provider provider address\\n\\t/// @param account user account\\n\\t/// @param nonce nonce\\n\\t/// @return whether nonce exists\\n\\tfunction nonceExists(\\n\\t\\taddress provider,\\n\\t\\tbytes32 account,\\n\\t\\tuint64 nonce\\n\\t) external view returns (bool);\\n}\\n\",\"keccak256\":\"0x28413ecc2f7477ad5f216bc9e6d543fc567af662ee6a278abad15505ddf19597\",\"license\":\"UNLICENSE\"},\"contracts/interfaces/IDstChainPayment.sol\":{\"content\":\"// SPDX-License-Identifier: UNLICENSE\\n\\npragma solidity >=0.8.0;\\n\\nimport '@openzeppelin/contracts-upgradeable/interfaces/IERC20Upgradeable.sol';\\nimport '../libraries/ResourceData.sol';\\n\\n/// @author Alexandas\\n/// @dev DstChainPayment interface\\ninterface IDstChainPayment {\\n\\tstruct PaymentPayload {\\n\\t\\taddress provider;\\n\\t\\tuint64 nonce;\\n\\t\\tbytes32 account;\\n\\t\\tResourceData.ValuePayload[] payloads;\\n\\t}\\n\\n\\t/// @dev emit when a user paid\\n\\t/// @param token token address\\n\\t/// @param payload payment payload\\n\\tevent Paid(IERC20Upgradeable token, PaymentPayload payload);\\n\\n\\t/// @dev pay from source chain only called by message receiver\\n\\t/// @param _token token address\\n\\t/// @param dstAmount token amount\\n\\t/// @param message payment payload message bytes\\n\\tfunction payFromSourceChain(\\n\\t\\tIERC20Upgradeable _token,\\n\\t\\tuint256 dstAmount,\\n\\t\\tbytes calldata message\\n\\t) external;\\n\\n\\t/// @dev pay on dst chain\\n\\t/// @param payload payment payload\\n\\t/// @return value payment value\\n\\tfunction pay(PaymentPayload memory payload) external returns (uint256 value);\\n\\n\\t/// @dev decode source chain message\\n\\t/// @param message message bytes\\n\\t/// @return provider provider address\\n\\t/// @return nonce nonce\\n\\t/// @return account user account\\n\\t/// @return payloads payment payloads\\n\\tfunction decodeSourceChainMessage(bytes memory message)\\n\\t\\texternal\\n\\t\\tview\\n\\t\\treturns (\\n\\t\\t\\taddress provider,\\n\\t\\t\\tuint64 nonce,\\n\\t\\t\\tbytes32 account,\\n\\t\\t\\tResourceData.ValuePayload[] memory payloads\\n\\t\\t);\\n\\n\\t/// @dev calculate fee for ipfs storage and expiration\\n\\t/// @param provider provider address\\n\\t/// @param account user account\\n\\t/// @param amount ipfs storage amount\\n\\t/// @param expiration ipfs expiration(in seconds)\\n\\t/// @return storageFee ipfs storage fee\\n\\t/// @return expirationFee ipfs expiration fee\\n\\tfunction ipfsAlloctionsFee(\\n\\t\\taddress provider,\\n\\t\\tbytes32 account,\\n\\t\\tuint256 amount,\\n\\t\\tuint256 expiration\\n\\t) external view returns (uint256 storageFee, uint256 expirationFee);\\n\\n\\t/// @dev calculate ipfs storage and expiration with storage fee and expiration fee\\n\\t/// @param provider provider address\\n\\t/// @param account user account\\n\\t/// @param storageFee storage fee\\n\\t/// @param expirationFee expiration fee\\n\\t/// @return amount ipfs storage amount\\n\\t/// @return expiration ipfs expiration(in seconds)\\n\\tfunction ipfsAllocations(\\n\\t\\taddress provider,\\n\\t\\tbytes32 account,\\n\\t\\tuint256 storageFee,\\n\\t\\tuint256 expirationFee\\n\\t) external view returns (uint256 amount, uint256 expiration);\\n\\n\\t/// @dev return balance of provider\\n\\t/// @param provider provider address\\n\\t/// @return balance of provider\\n\\tfunction balanceOf(address provider) external view returns (uint256);\\n\\n\\t/// @dev return resource price\\n\\t/// @param provider provider address\\n\\t/// @param resourceType resource type\\n\\t/// @return resource price\\n\\tfunction priceOf(address provider, ResourceData.ResourceType resourceType) external view returns (uint256);\\n\\n\\t/// @dev return value of amount resource\\n\\t/// @param provider provider address\\n\\t/// @param resourceType resource type\\n\\t/// @param amount resource amount\\n\\t/// @return token value\\n\\tfunction getValueOf(\\n\\t\\taddress provider,\\n\\t\\tResourceData.ResourceType resourceType,\\n\\t\\tuint256 amount\\n\\t) external view returns (uint256);\\n\\n\\t/// @dev return resource amount with value\\n\\t/// @param provider provider address\\n\\t/// @param resourceType resource type\\n\\t/// @param value token value\\n\\t/// @return resource amount\\n\\tfunction getAmountOf(\\n\\t\\taddress provider,\\n\\t\\tResourceData.ResourceType resourceType,\\n\\t\\tuint256 value\\n\\t) external view returns (uint256);\\n}\\n\",\"keccak256\":\"0xb291ce3c1e53e0904a98a9a6578b90caa7b5907db3f1f633a388476fe1dd9b5d\",\"license\":\"UNLICENSE\"},\"contracts/interfaces/IFundPool.sol\":{\"content\":\"// SPDX-License-Identifier: UNLICENSE\\n\\npragma solidity >=0.8.0;\\n\\n/// @author Alexandas\\n/// @dev FundPool interface\\ninterface IFundPool {\\n\\n\\t/// @dev emit when bill spent\\n\\t/// @param provider provider address\\n\\t/// @param account user account\\n\\t/// @param amount token amount\\n\\tevent Spent(address provider, bytes32 account, uint256 amount);\\n\\n\\t/// @dev emit when account recharged\\n\\t/// @param provider provider address\\n\\t/// @param account user account\\n\\t/// @param amount token amount\\n\\tevent Recharged(address provider, bytes32 account, uint256 amount);\\n\\n\\t/// @dev emit when user withdrawn\\n\\t/// @param provider provider address\\n\\t/// @param account user account\\n\\t/// @param to token receiver\\n\\t/// @param amount token amount\\n\\tevent Withdrawn(address provider, bytes32 account, address to, uint256 amount);\\n\\n\\t/// @dev recharge for account\\n\\t/// @param provider provider address\\n\\t/// @param account user account\\n\\t/// @param amount token amount\\n\\tfunction recharge(\\n\\t\\taddress provider,\\n\\t\\tbytes32 account,\\n\\t\\tuint256 amount\\n\\t) external;\\n\\n\\t/// @dev spend bills for account\\n\\t/// @param provider provider address\\n\\t/// @param account user account\\n\\t/// @param bills billing data\\n\\t/// @param timeout tx timeout\\n\\t/// @param nonce billing nonce\\n\\t/// @param signature provider signature\\n\\t/// @return fee bills fee\\n\\tfunction spend(\\n\\t\\taddress provider,\\n\\t\\tbytes32 account,\\n\\t\\tbytes memory bills,\\n\\t\\tuint256 timeout,\\n\\t\\tuint64 nonce,\\n\\t\\tbytes memory signature\\n\\t) external returns (uint256 fee);\\n\\n\\t/// @dev withdraw token for account\\n\\t/// @param provider provider address\\n\\t/// @param account user account\\n\\t/// @param bills billing data\\n\\t/// @param timeout tx timeout\\n\\t/// @param nonce billing nonce\\n\\t/// @param signature billing signature\\n\\t/// @param to token receiver\\n\\t/// @param amount token amount\\n\\t/// @param signature provider signature\\n\\t/// @return fee bill fee\\n\\tfunction withdraw(\\n\\t\\taddress provider,\\n\\t\\tbytes32 account,\\n\\t\\tbytes memory bills,\\n\\t\\tuint256 timeout,\\n\\t\\tuint64 nonce,\\n\\t\\tbytes memory signature,\\n\\t\\taddress to,\\n\\t\\tuint256 amount\\n\\t) external returns (uint256 fee);\\n\\n\\t/// @dev return wallet of the account\\n\\t/// @param provider provider address\\n\\t/// @param account user account\\n\\t/// @return wallet of the account\\n\\tfunction walletOf(address provider, bytes32 account) external view returns (address);\\n\\n\\t/// @dev return balance of account\\n\\t/// @param provider provider address\\n\\t/// @param account user account\\n\\t/// @return balance of account account\\n\\tfunction balanceOf(address provider, bytes32 account) external view returns (uint256);\\n}\\n\",\"keccak256\":\"0x6612ea3955dc515aa88c904f58f044ebb82753881c4b0cfb128b60f5e949b666\",\"license\":\"UNLICENSE\"},\"contracts/interfaces/IGovernance.sol\":{\"content\":\"// SPDX-License-Identifier: UNLICENSE\\n\\npragma solidity >=0.8.0;\\n\\nimport './IProviderRegistry.sol';\\nimport '../libraries/ResourceData.sol';\\n\\n/// @author Alexandas\\n/// @dev Governance interface\\ninterface IGovernance {\\n\\t/// @dev emit when governance drip resource to provider\\n\\t/// @param provider provider address\\n\\tevent GovernanceDrip(address provider);\\n\\n\\t/// @dev add a provider\\n\\t/// @param provider address\\n\\tfunction addProvider(address provider) external;\\n\\n\\t/// @dev remove a provider\\n\\t/// @param provider address\\n\\tfunction removeProvider(address provider) external;\\n\\n\\t/// @dev drip resource to provider\\n\\t/// @param provider provider address\\n\\t/// @param payloads resource payloads\\n\\tfunction drip(address provider, ResourceData.AmountPayload[] memory payloads) external;\\n}\\n\",\"keccak256\":\"0xfa284b7879ce25372f1f6c74ee8c7df6d41dedae6f3298b788086473c0d4c215\",\"license\":\"UNLICENSE\"},\"contracts/interfaces/IProviderController.sol\":{\"content\":\"// SPDX-License-Identifier: UNLICENSE\\n\\npragma solidity >=0.8.0;\\n\\nimport '../libraries/ResourceData.sol';\\n\\n/// @author Alexandas\\n/// @dev provider controller interface\\ninterface IProviderController {\\n\\t/// @dev emit when account registered in provider\\n\\t/// @param provider provider address\\n\\t/// @param account user account\\n\\tevent AccountRegistered(address provider, bytes32 account);\\n\\n\\t/// @dev emit when provider drip resource to account\\n\\t/// @param provider provider address\\n\\t/// @param account user account\\n\\tevent ProviderDripped(address provider, bytes32 account);\\n\\n\\t/// @dev emit when wallet types hash updated\\n\\t/// @param hash wallet types hash\\n\\tevent WalletTypesHashUpdated(bytes32 hash);\\n\\n\\t/// @dev emit when wallet transferred\\n\\t/// @param provider provider address\\n\\t/// @param account user account\\n\\t/// @param from original wallet address\\n\\t/// @param to new wallet address\\n\\tevent WalletTransferred(address provider, bytes32 account, address from, address to);\\n\\n\\t/// @dev keccak256(\\\"Wallet(address provider,bytes32 account,address wallet)\\\")\\n\\tfunction walletTypesHash() external view returns (bytes32);\\n\\n\\t/// @dev register account\\n\\t/// @param account user account\\n\\tfunction registerAccount(bytes32 account) external;\\n\\n\\t/// @dev register multiple account\\n\\t/// @param accounts user accounts\\n\\tfunction registerMult(bytes32[] memory accounts) external;\\n\\n\\t/// @dev Explain to a developer any extra details\\n\\t/// @param provider provider address\\n\\t/// @param account user account\\n\\t/// @return whether account exists\\n\\tfunction accountExists(address provider, bytes32 account) external view returns (bool);\\n\\n\\t/// @dev provider drip resource to multiple accounts\\n\\t/// @param accounts user accounts\\n\\t/// @param payloads resource amount payloads\\n\\tfunction dripMult(\\n\\t\\tbytes32[] memory accounts,\\n\\t\\tResourceData.AmountPayload[][] memory payloads\\n\\t) external;\\n\\n\\t/// @dev provider drip resource to user account\\n\\t/// @param account user account\\n\\t/// @param payloads resource amount payloads\\n\\tfunction drip(\\n\\t\\tbytes32 account,\\n\\t\\tResourceData.AmountPayload[] memory payloads\\n\\t) external;\\n\\n\\t/// @dev provider register and drip resource for multiple accounts\\n\\t/// @param accounts user accounts\\n\\t/// @param payloads resource amount payloads\\n\\tfunction registerAndDripMult(\\n\\t\\tbytes32[] memory accounts,\\n\\t\\tResourceData.AmountPayload[][] memory payloads\\n\\t) external;\\n\\n\\t/// @dev initialize wallet for the given account\\n\\t/// @param provider provider address\\n\\t/// @param account user account\\n\\t/// @param wallet account wallet\\n\\t/// @param signature provider signature\\n\\tfunction initWallet(\\n\\t\\taddress provider,\\n\\t\\tbytes32 account,\\n\\t\\taddress wallet,\\n\\t\\tbytes memory signature\\n\\t) external;\\n\\n\\t/// @dev transfer wallet for the account\\n\\t/// @param provider provider address\\n\\t/// @param account user account\\n\\t/// @param newWallet account wallet\\n\\tfunction transferWallet(\\n\\t\\taddress provider,\\n\\t\\tbytes32 account,\\n\\t\\taddress newWallet\\n\\t) external;\\n\\n\\t/// @dev return wallet for the account\\n\\t/// @param provider provider address\\n\\t/// @param account user account\\n\\t/// @return wallet for the account\\n\\tfunction walletOf(address provider, bytes32 account) external view returns (address);\\n\\n\\t/// @dev return whether wallet exists\\n\\t/// @param provider provider address\\n\\t/// @param account user account\\n\\t/// @return whether wallet exists\\n\\tfunction walletExists(address provider, bytes32 account) external view returns (bool);\\n}\\n\",\"keccak256\":\"0x659cb15e3bf5e88e20b9d09ca05f6d748eac4d51c9251a6d1043fe2fca217dcb\",\"license\":\"UNLICENSE\"},\"contracts/interfaces/IProviderRegistry.sol\":{\"content\":\"// SPDX-License-Identifier: UNLICENSE\\n\\npragma solidity >=0.8.0;\\n\\n/// @author Alexandas\\n/// @dev provider registry interface\\ninterface IProviderRegistry {\\n\\t/// @dev emit when provider is added\\n\\t/// @param provider provider address\\n\\tevent AddProvider(address provider);\\n\\n\\t/// @dev emit when provider removed\\n\\t/// @param provider provider address\\n\\tevent RemoveProvider(address provider);\\n\\n\\tevent AddProivderWallet(address provider, address wallet);\\n\\n\\tevent RemoveProviderWallet(address provider, address wallet);\\n\\n\\t/// @dev add a provider\\n\\t/// @param provider address\\n\\tfunction addProvider(address provider) external;\\n\\n\\t/// @dev remove a provider\\n\\t/// @param provider address\\n\\tfunction removeProvider(address provider) external;\\n\\n\\t/// @dev return whether address is a provider\\n\\t/// @param provider address\\n\\tfunction isProvider(address provider) external view returns (bool);\\n\\n\\t/// @dev return provider wallet\\n\\t/// @param provider address\\n\\t/// @return provider wallet\\n\\tfunction providerWallet(address provider) external view returns (address);\\n\\n\\t/// @dev return provider wallet exists\\n\\t/// @param provider address\\n\\t/// @return whether provider wallet exists\\n\\tfunction providerWalletExists(address provider) external view returns (bool);\\n\\n\\t/// @dev return whether a valid signature\\n\\t/// @param provider address\\n\\t/// @param hash message hash\\n\\t/// @param signature provider signature for message hash\\n\\t/// @return is valid signature\\n\\tfunction isValidSignature(\\n\\t\\taddress provider,\\n\\t\\tbytes32 hash,\\n\\t\\tbytes memory signature\\n\\t) external returns (bool);\\n}\\n\",\"keccak256\":\"0xa51e867c83ef543d6aa67facb3df5952b83ed6aea7fc9c2129a4105377d29bf2\",\"license\":\"UNLICENSE\"},\"contracts/interfaces/IRouter.sol\":{\"content\":\"// SPDX-License-Identifier: UNLICENSE\\n\\npragma solidity >=0.8.0;\\n\\nimport '@openzeppelin/contracts-upgradeable/interfaces/IERC20Upgradeable.sol';\\n\\nimport '../interfaces/IGovernance.sol';\\nimport '../interfaces/IProviderRegistry.sol';\\nimport '../interfaces/IProviderController.sol';\\nimport '../interfaces/IDstChainPayment.sol';\\nimport '../interfaces/IBilling.sol';\\nimport '../interfaces/IFundPool.sol';\\nimport '../resources/interfaces/INormalResourceController.sol';\\nimport '../resources/interfaces/IIPFSStorageController.sol';\\nimport '../resources/interfaces/IResourcePriceAdaptor.sol';\\n\\n/// @author Alexandas\\n/// @dev Router interface\\ninterface IRouter {\\n\\t/// @dev emit when governance contract address updated\\n\\t/// @param governance governance contract address\\n\\tevent GovernanceUpdated(IGovernance governance);\\n\\n\\t/// @dev emit when message receiver updated\\n\\t/// @param messageReceiver message receiver contract address\\n\\tevent MessageReceiverUpdated(address messageReceiver);\\n\\n\\t/// @dev emit when provider registry contract updated\\n\\t/// @param _providerRegistry provider registry contract\\n\\tevent ProviderRegistryUpdated(IProviderRegistry _providerRegistry);\\n\\n\\t/// @dev emit when dst ProviderController contract address updated\\n\\t/// @param providerController ProviderController contract address\\n\\tevent ProviderControllerUpdated(IProviderController providerController);\\n\\n\\t/// @dev emit when token updated\\n\\t/// @param token token address\\n\\tevent TokenUpdated(IERC20Upgradeable token);\\n\\n\\t/// @dev emit when building time controller updated\\n\\t/// @param buildingTimeController building time controller contract\\n\\tevent BuildingTimeControllerUpdated(INormalResourceController buildingTimeController);\\n\\n\\t/// @dev emit when bandwidth controller updated\\n\\t/// @param bandwidthController bandwidth controller contract\\n\\tevent BandwidthControllerUpdated(INormalResourceController bandwidthController);\\n\\n\\t/// @dev emit when AR storage controller updated\\n\\t/// @param arStorageController AR storage controller contract\\n\\tevent ARStorageControllerUpdated(INormalResourceController arStorageController);\\n\\n\\t/// @dev emit when ipfs storage controller updated\\n\\t/// @param ipfsStorageController IPFS storage controller contract\\n\\tevent IPFSStorageControllerUpdated(IIPFSStorageController ipfsStorageController);\\n\\n\\t/// @dev emit when resource price adaptor updated\\n\\t/// @param resourcePriceAdaptor resource price adaptor contract\\n\\tevent ResourcePriceAdaptorUpdated(IResourcePriceAdaptor resourcePriceAdaptor);\\n\\n\\t/// @dev emit when dst chain payment contract address updated\\n\\t/// @param dstChainPayment dst chain payment contract address\\n\\tevent DstChainPaymentUpdated(IDstChainPayment dstChainPayment);\\n\\n\\t/// @dev emit when billing contract updated\\n\\t/// @param billing billing contract\\n\\tevent BillingUpdated(IBilling billing);\\n\\n\\t/// @dev emit when fund pool contract updated\\n\\t/// @param fundPool fund pool contract\\n\\tevent FundPoolUpdated(IFundPool fundPool);\\n\\n\\t/// @dev message receiver contract address\\n\\tfunction MessageReceiver() external view returns (address);\\n\\n\\t/// @dev Governance contract address\\n\\tfunction Governance() external view returns (IGovernance);\\n\\n\\t/// @dev providers contract address\\n\\tfunction ProviderRegistry() external view returns (IProviderRegistry);\\n\\n\\t/// @dev provider controller contract address\\n\\tfunction ProviderController() external view returns (IProviderController);\\n\\n\\t/// @dev token address\\n\\tfunction Token() external view returns (IERC20Upgradeable);\\n\\n\\t/// @dev return building time controller\\n\\tfunction BuildingTimeController() external view returns (INormalResourceController);\\n\\n\\t/// @dev return bandwidth controller\\n\\tfunction BandwidthController() external view returns (INormalResourceController);\\n\\n\\t/// @dev return AR storage controller\\n\\tfunction ARStorageController() external view returns (INormalResourceController);\\n\\n\\t/// @dev return ipfs storage controller\\n\\tfunction IPFSStorageController() external view returns (IIPFSStorageController);\\n\\n\\t/// @dev return resource price adaptor contract address\\n\\tfunction ResourcePriceAdaptor() external view returns (IResourcePriceAdaptor);\\n\\n\\t/// @dev dst chain payment contract address\\n\\tfunction DstChainPayment() external view returns (IDstChainPayment);\\n\\n\\t/// @dev billing contract address\\n\\tfunction Billing() external view returns (IBilling);\\n\\n\\t/// @dev fund pool contract address\\n\\tfunction FundPool() external view returns (IFundPool);\\n}\\n\",\"keccak256\":\"0x32c01e0f705a5c96ad7550e7cb0e885c5479fa9353445c256eab4e8c0e14e8cf\",\"license\":\"UNLICENSE\"},\"contracts/libraries/ResourceData.sol\":{\"content\":\"// SPDX-License-Identifier: UNLICENSE\\n\\npragma solidity >=0.8.0;\\nimport '@openzeppelin/contracts-upgradeable/utils/math/SafeMathUpgradeable.sol';\\nimport '@openzeppelin/contracts-upgradeable/interfaces/IERC20Upgradeable.sol';\\n\\n/// @author Alexandas\\n/// @dev resource data library\\nlibrary ResourceData {\\n\\tusing SafeMathUpgradeable for uint256;\\n\\n\\tenum ResourceType {\\n\\t\\tNull,\\n\\t\\tBuildingTime,\\n\\t\\tBandwidth,\\n\\t\\tARStorage,\\n\\t\\tIPFSStorage\\n\\t}\\n\\n\\tstruct ValuePayload {\\n\\t\\tResourceData.ResourceType resourceType;\\n\\t\\tuint256[] values;\\n\\t}\\n\\n\\tstruct AmountPayload {\\n\\t\\tResourceData.ResourceType resourceType;\\n\\t\\tuint256[] amounts;\\n\\t}\\n\\n\\tstruct ValuePayloads {\\n\\t\\tResourceData.ValuePayload[] payloads;\\n\\t}\\n\\n\\tfunction convertSourceChainPayloads(ValuePayloads memory valuePayloads, uint256 dstAmount)\\n\\t\\tinternal\\n\\t\\tpure\\n\\t\\treturns (ResourceData.ValuePayload[] memory newPayloads)\\n\\t{\\n\\t\\tResourceData.ValuePayload[] memory payloads = valuePayloads.payloads;\\n\\t\\trequire(payloads.length > 0, 'ResourceData: invalid payload length');\\n\\t\\tuint256 total = totalValue(payloads);\\n\\t\\trequire(total > 0, 'ResourceData: zero total value');\\n\\t\\tfor (uint256 i = 0; i < payloads.length; i++) {\\n\\t\\t\\trequire(payloads[i].values.length > 0, 'ResourceData: invalid value length');\\n\\t\\t\\tfor (uint256 j = 0; j < payloads[i].values.length; j++) {\\n\\t\\t\\t\\tpayloads[i].values[j] = payloads[i].values[j].mul(dstAmount).div(total);\\n\\t\\t\\t}\\n\\t\\t}\\n\\t\\treturn payloads;\\n\\t}\\n\\n\\t/// @dev payment payload total value\\n\\t/// @param payloads payment payloads\\n\\t/// @return value total value\\n\\tfunction totalValue(ResourceData.ValuePayload[] memory payloads) internal pure returns (uint256 value) {\\n\\t\\trequire(payloads.length > 0, 'ResourceData: invalid payloads length');\\n\\t\\tfor (uint256 i = 0; i < payloads.length; i++) {\\n\\t\\t\\tfor (uint256 j = 0; j < payloads[i].values.length; j++) {\\n\\t\\t\\t\\tvalue = value.add(payloads[i].values[j]);\\n\\t\\t\\t}\\n\\t\\t}\\n\\t}\\n\\n\\t/// @dev match token amount to resource decimals\\n\\t/// @param token token contract address\\n\\t/// @param value token amount with resource decimals\\n\\t/// @return resource value\\n\\tfunction matchTokenToResource(IERC20Upgradeable token, uint256 value) internal view returns (uint256) {\\n\\t\\tuint256 _tokenDecimals = tokenDecimals(token);\\n\\t\\tuint256 _resourceDecimals = decimals();\\n\\t\\tif (_tokenDecimals <= _resourceDecimals) {\\n\\t\\t\\treturn value.mul(10**(_resourceDecimals.sub(_tokenDecimals)));\\n\\t\\t}\\n\\t\\treturn value.div(10**(_tokenDecimals.sub(_resourceDecimals)));\\n\\t}\\n\\n\\t/// @dev match value to token decimals\\n\\t/// @param token token contract address\\n\\t/// @param value resource value\\n\\t/// @return token value\\n\\tfunction matchResourceToToken(IERC20Upgradeable token, uint256 value) internal view returns (uint256) {\\n\\t\\tuint256 _tokenDecimals = tokenDecimals(token);\\n\\t\\tuint256 _resourceDecimals = decimals();\\n\\t\\tif (_tokenDecimals <= _resourceDecimals) {\\n\\t\\t\\treturn value.div(10**(_resourceDecimals.sub(_tokenDecimals)));\\n\\t\\t}\\n\\t\\treturn value.mul(10**(_tokenDecimals.sub(_resourceDecimals)));\\n\\t}\\n\\n\\t/// @dev return resource decimals\\n\\t/// @return resource decimals\\n\\tfunction decimals() internal pure returns (uint256) {\\n\\t\\treturn 18;\\n\\t}\\n\\n\\t/// @dev return token decimals\\n\\t/// @return token decimals\\n\\tfunction tokenDecimals(IERC20Upgradeable token) internal view returns (uint256) {\\n\\t\\t// keccak256(bytes4('decimals()'))\\n\\t\\t(bool success, bytes memory data) = address(token).staticcall(hex'313ce567');\\n\\t\\trequire(success, 'ResourceData: invalid token');\\n\\t\\treturn abi.decode(data, (uint256));\\n\\t}\\n}\\n\",\"keccak256\":\"0x0a952dc446468e24ad4fed971632b1c8408818ed86649ff01e662aa93decb050\",\"license\":\"UNLICENSE\"},\"contracts/resources/interfaces/IIPFSStorageController.sol\":{\"content\":\"// SPDX-License-Identifier: UNLICENSE\\n\\npragma solidity >=0.8.0;\\nimport '@openzeppelin/contracts-upgradeable/utils/math/SafeMathUpgradeable.sol';\\n\\n/// @author Alexandas\\n/// @dev IPFS storage controller interface\\ninterface IIPFSStorageController {\\n\\tstruct Storage {\\n\\t\\tuint256 startTime;\\n\\t\\tuint256 expiration;\\n\\t\\tuint256 amount;\\n\\t}\\n\\n\\t/// @dev emit when ipfs storage allocated for the provider\\n\\t/// @param provider provider address\\n\\t/// @param amount ipfs storage amount\\n\\t/// @param expiration ipfs storage expiration\\n\\tevent ProviderAllocated(address provider, uint256 amount, uint256 expiration);\\n\\n\\t/// @dev emit when ipfs storage allocated for the account\\n\\t/// @param provider provider address\\n\\t/// @param account user account\\n\\t/// @param amount ipfs storage amount\\n\\t/// @param expiration ipfs storage expiration\\n\\tevent AccountAllocated(address provider, bytes32 account, uint256 amount, uint256 expiration);\\n\\n\\t/// @dev emit when provider recovered ipfs storage\\n\\t/// @param provider provider address\\n\\t/// @param account user account\\n\\t/// @param amount ipfs storage amount\\n\\tevent ProviderRecovered(address provider, bytes32 account, uint256 amount);\\n\\n\\t/// @dev allocate user's normal resource balance\\n\\t/// @param provider provider address\\n\\t/// @param amount resource amount\\n\\t/// @param expiration ipfs expiration\\n\\tfunction allocateProvider(address provider, uint256 amount, uint256 expiration) external;\\n\\n\\t/// @dev provider drip resource to account directly\\n\\t/// @param provider provider address\\n\\t/// @param account user account\\n\\t/// @param amount ipfs storage amount\\n\\t/// @param expiration ipfs expiration\\n\\tfunction drip(address provider, bytes32 account, uint256 amount, uint256 expiration) external;\\n\\n\\t/// @dev allocate user's resource balance\\n\\t/// @param provider provider address\\n\\t/// @param account user account\\n\\t/// @param amount ipfs storage amount\\n\\t/// @param expiration ipfs expiration\\n\\tfunction paymentAllocate(address provider, bytes32 account, uint256 amount, uint256 expiration) external;\\n\\n\\t/// @dev recover provider storage\\n\\t/// @param provider provider address\\n\\t/// @param account user account\\n\\tfunction recoverStorage(address provider, bytes32 account) external;\\n\\n\\t/// @dev return whether ipfs storage is expired for the provider\\n\\t/// @param provider provider address\\n\\t/// @return whether ipfs storage is expired for the provider\\n\\tfunction isProviderExpired(address provider) external view returns (bool);\\n\\n\\t/// @dev return ipfs storage start time for the provider\\n\\t/// @param provider provider address\\n\\t/// @return start time for the provider\\n\\tfunction providerStartTime(address provider) external view returns (uint256);\\n\\n\\t/// @dev return total expiration time for the provider\\n\\t/// @param provider provider address\\n\\t/// @return total expiration time for the provider\\n\\tfunction providerExpiration(address provider) external view returns (uint256);\\n\\n\\t/// @dev return available expiration time for the provider\\n\\t/// @param provider provider address\\n\\t/// @return available expiration time for the provider\\n\\tfunction providerAvailableExpiration(address provider) external view returns (uint256);\\n\\n\\t/// @dev return when the provider will expire\\n\\t/// @param provider provider address\\n\\t/// @return when the provider will expire\\n\\tfunction providerExpiredAt(address provider) external view returns (uint256);\\n\\n\\t/// @dev return ipfs storage amount for the provider\\n\\t/// @param provider provider address\\n\\t/// @return ipfs storage amount for the provider\\n\\tfunction providerBalanceOf(address provider) external view returns (uint256);\\n\\n\\t/// @dev return whether ipfs storage is expired for the account\\n\\t/// @param provider provider address\\n\\t/// @param account user account\\n\\t/// @return whether ipfs storage is expired for the account\\n\\tfunction isExpired(address provider, bytes32 account) external view returns (bool);\\n\\n\\t/// @dev return available expiration time for the account\\n\\t/// @param provider provider address\\n\\t/// @param account user account\\n\\t/// @return available expiration time for the account\\n\\tfunction availableExpiration(address provider, bytes32 account) external view returns (uint256);\\n\\n\\t/// @dev return when the account will expire\\n\\t/// @param provider provider address\\n\\t/// @param account user account\\n\\t/// @return when the account will expire\\n\\tfunction expiredAt(address provider, bytes32 account) external view returns (uint256);\\n\\n\\t/// @dev return ipfs storage start time for the account\\n\\t/// @param provider provider address\\n\\t/// @param account user account\\n\\t/// @return start time for the account\\n\\tfunction startTime(address provider, bytes32 account) external view returns (uint256);\\n\\n\\t/// @dev return total expiration time for the account\\n\\t/// @param provider provider address\\n\\t/// @param account user account\\n\\t/// @return total expiration time for the account\\n\\tfunction expiration(address provider, bytes32 account) external view returns (uint256);\\n\\n\\t/// @dev return ipfs storage amount for the account\\n\\t/// @param provider provider address\\n\\t/// @param account user account\\n\\t/// @return ipfs storage amount for the account\\n\\tfunction balanceOf(address provider, bytes32 account) external view returns (uint256);\\n}\\n\",\"keccak256\":\"0x737cd8d689d7a0ef9211d92c8d052bda00bc16ddb06ce326ee473c3ffc09a654\",\"license\":\"UNLICENSE\"},\"contracts/resources/interfaces/INormalResourceController.sol\":{\"content\":\"// SPDX-License-Identifier: UNLICENSE\\n\\npragma solidity >=0.8.0;\\n\\n/// @author Alexandas\\n/// @dev normal resource controller interface\\ninterface INormalResourceController {\\n\\n\\t/// @dev emit when resource allocated for the provider\\n\\t/// @param provider provider address\\n\\t/// @param amount ipfs storage amount\\n\\tevent ProviderAllocated(address provider, uint256 amount);\\n\\n\\t/// @dev emit when resource allocated for the account\\n\\t/// @param provider provider address\\n\\t/// @param account user account\\n\\t/// @param amount ipfs storage amount\\n\\tevent AccountAllocated(address provider, bytes32 account, uint256 amount);\\n\\n\\t/// @dev allocate resource for the provider\\n\\t/// @param provider provider address\\n\\t/// @param amount resource amount\\n\\tfunction allocateProvider(address provider, uint256 amount) external;\\n\\n\\t/// @dev allocate user's resource balance\\n\\t/// @param provider provider address\\n\\t/// @param account user account\\n\\t/// @param amount resource amount\\n\\tfunction paymentAllocate(address provider, bytes32 account, uint256 amount) external;\\n\\n\\t/// @dev provider drip resource to account directly\\n\\t/// @param provider provider address\\n\\t/// @param account user account\\n\\t/// @param amount resource amount\\n\\tfunction drip(address provider, bytes32 account, uint256 amount) external;\\n\\n\\t/// @dev resource balance\\n\\t/// @param provider provider address\\n\\t/// @param account user account\\n\\t/// @return balance of the account\\n\\tfunction balanceOf(address provider, bytes32 account) external view returns (uint256);\\n\\n\\t/// @dev resource balance\\n\\t/// @param provider provider address\\n\\t/// @return balance of the account\\n\\tfunction providerBalanceOf(address provider) external view returns (uint256);\\n\\n}\\n\",\"keccak256\":\"0x7bf2ade38bde962e0b1430090225c343458a2fa9d002d413468e442a64fe76e7\",\"license\":\"UNLICENSE\"},\"contracts/resources/interfaces/IResourcePriceAdaptor.sol\":{\"content\":\"// SPDX-License-Identifier: UNLICENSE\\n\\npragma solidity >=0.8.0;\\n\\nimport '../../libraries/ResourceData.sol';\\n\\n/// @author Alexandas\\n/// @dev resource adpator interface\\ninterface IResourcePriceAdaptor {\\n\\tstruct PriceAdaptor {\\n\\t\\tResourceData.ResourceType resourceType;\\n\\t\\tuint256 price;\\n\\t}\\n\\n\\t/// @dev emit when index block updated\\n\\t/// @param provider provider address\\n\\t/// @param priceIndexBlock price index block\\n\\tevent PriceIndexBlockUpdated(address provider, uint256 priceIndexBlock);\\n\\n\\t/// @dev emit when price updated\\n\\t/// @param provider provider address\\n\\t/// @param adaptors price adaptors\\n\\tevent PriceAdaptorsUpdated(address provider, PriceAdaptor[] adaptors);\\n\\n\\t/// @dev get price for resource at a specific block\\n\\t/// @param provider provider address\\n\\t/// @param resourceType resource type\\n\\t/// @param priceIndexBlock block number\\n\\t/// @return price for resource at a specific block\\n\\tfunction priceAt(address provider, ResourceData.ResourceType resourceType, uint256 priceIndexBlock) external view returns (uint256);\\n\\n\\t/// @dev get value for `amount` resource at a specific block\\n\\t/// @param provider provider address\\n\\t/// @param resourceType resource type\\n\\t/// @param amount resource amount\\n\\t/// @param priceIndexBlock block number\\n\\t/// @return token value in resource decimals(18)\\n\\tfunction getValueAt(\\n\\t\\taddress provider,\\n\\t\\tResourceData.ResourceType resourceType,\\n\\t\\tuint256 amount,\\n\\t\\tuint256 priceIndexBlock\\n\\t) external view returns (uint256);\\n\\n\\t/// @dev get amount resource with value at a specific block\\n\\t/// @param provider provider address\\n\\t/// @param resourceType resource type\\n\\t/// @param value token value\\n\\t/// @param priceIndexBlock block numer\\n\\t/// @return resource amount\\n\\tfunction getAmountAt(\\n\\t\\taddress provider,\\n\\t\\tResourceData.ResourceType resourceType,\\n\\t\\tuint256 value,\\n\\t\\tuint256 priceIndexBlock\\n\\t) external view returns (uint256);\\n\\n\\t/// @dev return resource price\\n\\t/// @param provider provider address\\n\\t/// @param resourceType resource type\\n\\t/// @return resource price\\n\\tfunction priceOf(address provider, ResourceData.ResourceType resourceType) external view returns (uint256);\\n\\n\\t/// @dev return value of amount resource\\n\\t/// @param provider provider address\\n\\t/// @param resourceType resource type\\n\\t/// @param amount resource amount\\n\\t/// @return token value in resource decimals(18)\\n\\tfunction getValueOf(address provider, ResourceData.ResourceType resourceType, uint256 amount) external view returns (uint256);\\n\\n\\t/// @dev return resource amount with value\\n\\t/// @param provider provider address\\n\\t/// @param resourceType resource type\\n\\t/// @param value token value in resource decimals(18)\\n\\t/// @return resource amount\\n\\tfunction getAmountOf(address provider, ResourceData.ResourceType resourceType, uint256 value) external view returns (uint256);\\n\\n}\\n\",\"keccak256\":\"0x777f11784c9b845ea144fa0eb3b33596e123e1f70f2952e9d7c24ce576fcf10d\",\"license\":\"UNLICENSE\"},\"contracts/wallets/Billing.sol\":{\"content\":\"// SPDX-License-Identifier: UNLICENSE\\n\\npragma solidity >=0.8.0;\\n\\nimport '@openzeppelin/contracts-upgradeable/security/ReentrancyGuardUpgradeable.sol';\\nimport '@openzeppelin/contracts-upgradeable/token/ERC20/utils/SafeERC20Upgradeable.sol';\\nimport '@openzeppelin/contracts-upgradeable/utils/math/SafeMathUpgradeable.sol';\\nimport '@openzeppelin/contracts-upgradeable/utils/cryptography/draft-EIP712Upgradeable.sol';\\n\\nimport '../libraries/ResourceData.sol';\\nimport '../govers/RouterWrapper.sol';\\nimport '../access/OwnerWithdrawable.sol';\\n\\n/// @author Alexandas\\n/// @dev Billing contract\\ncontract Billing is IBilling, OwnerWithdrawable, EIP712Upgradeable, ReentrancyGuardUpgradeable, RouterWrapper {\\n\\tusing SafeMathUpgradeable for uint256;\\n\\tusing SafeERC20Upgradeable for IERC20Upgradeable;\\n\\n\\t/// @dev keccak256(\\\"Billing(address provider,bytes32 account,bytes bills,uint256 timeout,uint64 nonce)\\\")\\n\\tbytes32 public override billingTypesHash;\\n\\n\\t/// @dev provider nonces for account\\n\\tmapping(address => mapping(bytes32 => mapping(uint64 => bool))) internal nonces;\\n\\n\\t/// @dev provider balances\\n\\tmapping(address => uint256) internal balances;\\n\\n\\t/// @dev proxy initialize function\\n\\t/// @param owner contract owner\\n\\t/// @param name EIP712 name\\n\\t/// @param version EIP712 version\\n\\t/// @param router router contract address\\n\\tfunction initialize(\\n\\t\\taddress owner,\\n\\t\\tstring memory name,\\n\\t\\tstring memory version,\\n\\t\\tstring memory billingTypes,\\n\\t\\tIRouter router\\n\\t) external initializer {\\n\\t\\t_transferOwnership(owner);\\n\\t\\t__EIP712_init(name, version);\\n\\t\\t__Init_Billing_Typed_Hash(billingTypes);\\n\\t\\t__Init_Router(router);\\n\\t}\\n\\n\\t/// @dev initialize billing types hash\\n\\t/// @param types billing types\\n\\tfunction __Init_Billing_Typed_Hash(string memory types) internal onlyInitializing {\\n\\t\\t_setBillingTypedHash(keccak256(bytes(types)));\\n\\t}\\n\\n\\t/// @dev spend bills\\n\\t/// @param provider provider address\\n\\t/// @param account user account\\n\\t/// @param bills billing data\\n\\t/// @param timeout tx timeout\\n\\t/// @param nonce billing nonce\\n\\t/// @param signature billing signature\\n\\t/// @return fee billing fee\\n\\tfunction spend(\\n\\t\\taddress provider,\\n\\t\\tbytes32 account,\\n\\t\\tbytes memory bills,\\n\\t\\tuint256 timeout,\\n\\t\\tuint64 nonce,\\n\\t\\tbytes memory signature\\n\\t) external nonReentrant onlyFundPool returns (uint256 fee) {\\n\\t\\trequire(nonce > 0, 'Billing: invalid nonce');\\n\\t\\trequire(timeout > block.timestamp, 'Billing: tx expires');\\n\\t\\trequire(!nonces[provider][account][nonce], 'Billing: nonce exists');\\n\\t\\tbytes32 hash = hashTypedDataV4ForBills(provider, account, bills, timeout, nonce);\\n\\t\\trequire(router.ProviderRegistry().isValidSignature(provider, hash, signature), 'Billing: invalid signature');\\n\\t\\tfee = _spend(provider, account, bills, nonce);\\n\\n\\t\\temit Billing(provider, account, bills, fee, nonce);\\n\\t}\\n\\n\\tfunction _spend(\\n\\t\\taddress provider,\\n\\t\\tbytes32 account,\\n\\t\\tbytes memory bills,\\n\\t\\tuint64 nonce\\n\\t) internal returns (uint256 fee) {\\n\\t\\tIERC20Upgradeable token = router.Token();\\n\\t\\tfee = _validateBills(provider, bills);\\n\\t\\tif(fee > 0) {\\n\\t\\t\\tfee = ResourceData.matchResourceToToken(token, fee);\\n\\t\\t\\tbalances[provider] = balances[provider].add(fee);\\n\\t\\t}\\n\\t\\tnonces[provider][account][nonce] = true;\\n\\t}\\n\\n\\tfunction _validateBills(address provider, bytes memory data) internal view returns (uint256 value) {\\n\\t\\tBill[] memory bills = abi.decode(data, (Bill[]));\\n\\t\\tif (bills.length > 0) {\\n\\t\\t\\tfor (uint256 i = 0; i < bills.length; i++) {\\n\\t\\t\\t\\tBill memory bill = bills[i];\\n\\t\\t\\t\\trequire(bill.entries.length > 0, 'Billing: empty bill entry');\\n\\t\\t\\t\\tfor (uint256 j = 0; j < bill.entries.length; j++) {\\n\\t\\t\\t\\t\\tBillEntry memory entry = bill.entries[j];\\n\\t\\t\\t\\t\\tuint256 billing = router.ResourcePriceAdaptor().getValueAt(provider, entry.resourceType, entry.amount, bill.indexBlock);\\n\\t\\t\\t\\t\\tvalue = value.add(billing);\\n\\t\\t\\t\\t}\\n\\t\\t\\t}\\n\\t\\t}\\n\\t}\\n\\n\\t/// @dev return bill fee\\n\\t/// @param provider provider address\\n\\t/// @param data bill data\\n\\t/// @return value bill fee\\n\\tfunction billFee(address provider, bytes memory data) external view returns (uint256 value) { \\n\\t\\treturn _validateBills(provider, data);\\n\\t}\\n\\n\\t/// @dev return hash for bills\\n\\t/// @param provider provider address\\n\\t/// @param account user account\\n\\t/// @param bills user bills\\n\\t/// @param timeout tx timeout\\n\\t/// @param nonce nonce\\n\\t/// @return bills hash\\n\\tfunction hashBillingTypes(\\n\\t\\taddress provider,\\n\\t\\tbytes32 account,\\n\\t\\tbytes memory bills,\\n\\t\\tuint256 timeout,\\n\\t\\tuint64 nonce\\n\\t) public view returns (bytes32) {\\n\\t\\treturn keccak256(abi.encode(billingTypesHash, provider, account, keccak256(bills), timeout, nonce));\\n\\t}\\n\\n\\t/// @dev return hash typed data v4 for sign bills\\n\\t/// @param provider provider address\\n\\t/// @param account user account\\n\\t/// @param bills user bills\\n\\t/// @param timeout tx timeout\\n\\t/// @param nonce nonce\\n\\t/// @return bills hash typed data v4\\n\\tfunction hashTypedDataV4ForBills(\\n\\t\\taddress provider,\\n\\t\\tbytes32 account,\\n\\t\\tbytes memory bills,\\n\\t\\tuint256 timeout,\\n\\t\\tuint64 nonce\\n\\t) public view returns (bytes32) {\\n\\t\\treturn _hashTypedDataV4(hashBillingTypes(provider, account, bills, timeout, nonce));\\n\\t}\\n\\n\\tfunction _setBillingTypedHash(bytes32 hash) internal {\\n\\t\\tbillingTypesHash = hash;\\n\\t\\temit BillingTypesHashUpdated(hash);\\n\\t}\\n\\n\\t/// @dev return balance of provider\\n\\t/// @param provider provider address\\n\\t/// @return balance of provider\\n\\tfunction balanceOf(address provider) public view override returns (uint256) {\\n\\t\\trequire(router.ProviderRegistry().isProvider(provider), 'Billing: nonexistent provider');\\n\\t\\treturn balances[provider];\\n\\t}\\n\\n\\t/// @dev provider nonces for account\\n\\t/// @param provider provider address\\n\\t/// @param account user account\\n\\t/// @param nonce nonce\\n\\t/// @return whether nonce exists\\n\\tfunction nonceExists(\\n\\t\\taddress provider,\\n\\t\\tbytes32 account,\\n\\t\\tuint64 nonce\\n\\t) public view override returns (bool) {\\n\\t\\trequire(router.ProviderController().accountExists(provider, account), 'Billing: nonexistent provider');\\n\\t\\treturn nonces[provider][account][nonce];\\n\\t}\\n}\\n\",\"keccak256\":\"0x09c05dc868a83ad512809e3e92e8c1ac14190f4cd62bef8f83a7b4ee82210f7f\",\"license\":\"UNLICENSE\"}},\"version\":1}",
  "bytecode": "0x608060405234801561001057600080fd5b506125ec806100206000396000f3fe608060405234801561001057600080fd5b50600436106100ea5760003560e01c80638da5cb5b1161008c578063c025303e11610066578063c025303e146101b6578063de7c8e58146101d6578063f2fde38b146101e9578063f887ea40146101fc57600080fd5b80638da5cb5b1461017757806393563a9514610190578063a29ee11e146101a357600080fd5b8063699256f4116100c8578063699256f41461013657806370a0823114610149578063715018a61461015c578063851981d21461016457600080fd5b806308277dda146100ef57806317a6020b1461010457806360bcb0ce1461012d575b600080fd5b6101026100fd366004611526565b61021c565b005b610117610112366004611617565b6102b8565b60405161012491906116dd565b60405180910390f35b61011760cc5481565b6101026101443660046116eb565b6105c1565b610117610157366004611728565b61066f565b61010261079f565b610117610172366004611749565b6107d5565b6033546001600160a01b031660405161012491906117d7565b61010261019e3660046117e5565b61081d565b6101176101b1366004611835565b61088e565b6101c96101c4366004611882565b6108a3565b60405161012491906118d0565b6101176101e4366004611749565b6109fa565b6101026101f7366004611728565b610a1b565b60cb5461020f906001600160a01b031681565b60405161012491906118f2565b60006102286001610a77565b90508015610240576000805461ff0019166101001790555b61024986610b04565b6102538585610b56565b61025c83610b8b565b61026582610bc2565b80156102b0576000805461ff00191690556040517f7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb3847402498906102a790600190611914565b60405180910390a15b505050505050565b6000600260995414156102e65760405162461bcd60e51b81526004016102dd90611959565b60405180910390fd5b600260995560cb546040805163e70b7acb60e01b815290516000926001600160a01b03169163e70b7acb916004808301926020929190829003018186803b15801561033057600080fd5b505afa158015610344573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906103689190611974565b9050336001600160a01b038216146103925760405162461bcd60e51b81526004016102dd906119db565b6000846001600160401b0316116103bb5760405162461bcd60e51b81526004016102dd90611a18565b4285116103da5760405162461bcd60e51b81526004016102dd90611a52565b6001600160a01b038816600090815260cd602090815260408083208a845282528083206001600160401b038816845290915290205460ff161561042f5760405162461bcd60e51b81526004016102dd90611a8e565b600061043e89898989896109fa565b905060cb60009054906101000a90046001600160a01b03166001600160a01b031663a5a3f6c86040518163ffffffff1660e01b815260040160206040518083038186803b15801561048e57600080fd5b505afa1580156104a2573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906104c69190611974565b6001600160a01b031663238a4d1e8a83876040518463ffffffff1660e01b81526004016104f593929190611b00565b602060405180830381600087803b15801561050f57600080fd5b505af1158015610523573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906105479190611b40565b6105635760405162461bcd60e51b81526004016102dd90611b95565b61056f89898988610bf2565b92507fb23a1eee6a70af817a758fd091feb704a6bd3edc57e7fa7d2f8a5bfa5894929889898986896040516105a8959493929190611bb4565b60405180910390a1505060016099559695505050505050565b6033546001600160a01b031633146105eb5760405162461bcd60e51b81526004016102dd90611c2f565b6040516000906001600160a01b0384169083156108fc0290849084818181858888f193505050509050806106315760405162461bcd60e51b81526004016102dd90611c8b565b7f2c876ecb97b3c6854f2488d373403f903eacb800e51c159a5c0c7a9c857e48278383604051610662929190611c9b565b60405180910390a1505050565b60cb54604080516314b47ed960e31b815290516000926001600160a01b03169163a5a3f6c8916004808301926020929190829003018186803b1580156106b457600080fd5b505afa1580156106c8573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906106ec9190611974565b6001600160a01b0316636b074a07836040518263ffffffff1660e01b815260040161071791906117d7565b60206040518083038186803b15801561072f57600080fd5b505afa158015610743573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906107679190611b40565b6107835760405162461bcd60e51b81526004016102dd90611cea565b506001600160a01b0316600090815260ce602052604090205490565b6033546001600160a01b031633146107c95760405162461bcd60e51b81526004016102dd90611c2f565b6107d36000610b04565b565b600060cc548686868051906020012086866040516020016107fb96959493929190611cfa565b6040516020818303038152906040528051906020012090505b95945050505050565b6033546001600160a01b031633146108475760405162461bcd60e51b81526004016102dd90611c2f565b61085b6001600160a01b0384168383610d23565b7f2717ead6b9200dd235aad468c9809ea400fe33ac69b5bfaa6d3e90fc922b639883838360405161066293929190611d49565b600061089a8383610d7e565b90505b92915050565b60cb54604080516350e420e560e11b815290516000926001600160a01b03169163a1c841ca916004808301926020929190829003018186803b1580156108e857600080fd5b505afa1580156108fc573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906109209190611974565b6001600160a01b0316632d52976485856040518363ffffffff1660e01b815260040161094d929190611d71565b60206040518083038186803b15801561096557600080fd5b505afa158015610979573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061099d9190611b40565b6109b95760405162461bcd60e51b81526004016102dd90611cea565b506001600160a01b038316600090815260cd6020908152604080832085845282528083206001600160401b038516845290915290205460ff165b9392505050565b6000610a11610a0c87878787876107d5565b610f75565b9695505050505050565b6033546001600160a01b03163314610a455760405162461bcd60e51b81526004016102dd90611c2f565b6001600160a01b038116610a6b5760405162461bcd60e51b81526004016102dd90611dc2565b610a7481610b04565b50565b60008054610100900460ff1615610abe578160ff166001148015610a9a5750303b155b610ab65760405162461bcd60e51b81526004016102dd90611e1d565b506000919050565b60005460ff808416911610610ae55760405162461bcd60e51b81526004016102dd90611e1d565b506000805460ff191660ff92909216919091179055600190565b919050565b603380546001600160a01b038381166001600160a01b0319831681179093556040519116919082907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a35050565b600054610100900460ff16610b7d5760405162461bcd60e51b81526004016102dd90611e75565b610b878282610f88565b5050565b600054610100900460ff16610bb25760405162461bcd60e51b81526004016102dd90611e75565b610a748180519060200120610fc9565b600054610100900460ff16610be95760405162461bcd60e51b81526004016102dd90611e75565b610a7481611009565b60008060cb60009054906101000a90046001600160a01b03166001600160a01b031663c24126766040518163ffffffff1660e01b815260040160206040518083038186803b158015610c4357600080fd5b505afa158015610c57573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610c7b9190611974565b9050610c878685610d7e565b91508115610cd957610c99818361107a565b6001600160a01b038716600090815260ce6020526040902054909250610cbf90836110d8565b6001600160a01b038716600090815260ce60205260409020555b506001600160a01b03909416600090815260cd602090815260408083209583529481528482206001600160401b0390931682529190915291909120805460ff191660011790555090565b610d798363a9059cbb60e01b8484604051602401610d42929190611d71565b60408051601f198184030181529190526020810180516001600160e01b03166001600160e01b0319909316929092179091526110e4565b505050565b60008082806020019051810190610d95919061207f565b805190915015610f6e5760005b8151811015610f6c576000828281518110610dbf57610dbf6120b9565b60200260200101519050600081602001515111610dee5760405162461bcd60e51b81526004016102dd90612103565b60005b816020015151811015610f5757600082602001518281518110610e1657610e166120b9565b60200260200101519050600060cb60009054906101000a90046001600160a01b03166001600160a01b03166337187fc36040518163ffffffff1660e01b815260040160206040518083038186803b158015610e7057600080fd5b505afa158015610e84573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610ea89190611974565b825160208401518651604051630ace4d5d60e41b81526001600160a01b03949094169363ace4d5d093610ee4938f939192909190600401612157565b60206040518083038186803b158015610efc57600080fd5b505afa158015610f10573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610f34919061218c565b9050610f4087826110d8565b965050508080610f4f906121c3565b915050610df1565b50508080610f64906121c3565b915050610da2565b505b5092915050565b600061089d610f82611173565b836111af565b600054610100900460ff16610faf5760405162461bcd60e51b81526004016102dd90611e75565b815160209283012081519190920120606591909155606655565b60cc8190556040517fcf56a45f18d68202ed136bed985143964e07246be70e444cc5d94d670de61f5390610ffe9083906116dd565b60405180910390a150565b6001600160a01b03811661102f5760405162461bcd60e51b81526004016102dd90612212565b60cb80546001600160a01b0319166001600160a01b0383161790556040517f7aed1d3e8155a07ccf395e44ea3109a0e2d6c9b29bbbe9f142d9790596f4dc8090610ffe9083906118f2565b600080611086846111e2565b905060128082116110b9576110b061109e828461127b565b6110a990600a612330565b8590611287565b9250505061089d565b6108146110c6838361127b565b6110d190600a612330565b8590611293565b600061089a828461233f565b6000611139826040518060400160405280602081526020017f5361666545524332303a206c6f772d6c6576656c2063616c6c206661696c6564815250856001600160a01b031661129f9092919063ffffffff16565b805190915015610d7957808060200190518101906111579190611b40565b610d795760405162461bcd60e51b81526004016102dd9061239e565b60006111aa7f8b73c3c69bb8fe3d512ecc4cf759cc79239f7b179b0ffacaa9a75d522b39400f6111a260655490565b6066546112ae565b905090565b600082826040516020016111c49291906123b4565b60405160208183030381529060405280519060200120905092915050565b6000806000836001600160a01b03166040516111fd906123e5565b600060405180830381855afa9150503d8060008114611238576040519150601f19603f3d011682016040523d82523d6000602084013e61123d565b606091505b50915091508161125f5760405162461bcd60e51b81526004016102dd9061242e565b80806020019051810190611273919061218c565b949350505050565b600061089a828461243e565b600061089a828461246b565b600061089a828461247f565b606061127384846000856112e8565b600083838346306040516020016112c995949392919061249e565b6040516020818303038152906040528051906020012090509392505050565b60608247101561130a5760405162461bcd60e51b81526004016102dd90612523565b6001600160a01b0385163b6113315760405162461bcd60e51b81526004016102dd90612567565b600080866001600160a01b0316858760405161134d9190612599565b60006040518083038185875af1925050503d806000811461138a576040519150601f19603f3d011682016040523d82523d6000602084013e61138f565b606091505b509150915061139f8282866113aa565b979650505050505050565b606083156113b95750816109f3565b8251156113c95782518084602001fd5b8160405162461bcd60e51b81526004016102dd91906125a5565b60006001600160a01b03821661089d565b6113fd816113e3565b8114610a7457600080fd5b803561089d816113f4565b634e487b7160e01b600052604160045260246000fd5b601f19601f83011681018181106001600160401b038211171561144e5761144e611413565b6040525050565b600061146060405190565b9050610aff8282611429565b60006001600160401b0382111561148557611485611413565b601f19601f83011660200192915050565b82818337506000910152565b60006114b56114b08461146c565b611455565b9050828152602081018484840111156114d0576114d0600080fd5b6114db848285611496565b509392505050565b600082601f8301126114f7576114f7600080fd5b81356112738482602086016114a2565b600061089d826113e3565b6113fd81611507565b803561089d81611512565b600080600080600060a0868803121561154157611541600080fd5b600061154d8888611408565b95505060208601356001600160401b0381111561156c5761156c600080fd5b611578888289016114e3565b94505060408601356001600160401b0381111561159757611597600080fd5b6115a3888289016114e3565b93505060608601356001600160401b038111156115c2576115c2600080fd5b6115ce888289016114e3565b92505060806115df8882890161151b565b9150509295509295909350565b806113fd565b803561089d816115ec565b6001600160401b0381166113fd565b803561089d816115fd565b60008060008060008060c0878903121561163357611633600080fd5b600061163f8989611408565b965050602061165089828a016115f2565b95505060408701356001600160401b0381111561166f5761166f600080fd5b61167b89828a016114e3565b945050606061168c89828a016115f2565b935050608061169d89828a0161160c565b92505060a08701356001600160401b038111156116bc576116bc600080fd5b6116c889828a016114e3565b9150509295509295509295565b805b82525050565b6020810161089d82846116d5565b6000806040838503121561170157611701600080fd5b600061170d8585611408565b925050602061171e858286016115f2565b9150509250929050565b60006020828403121561173d5761173d600080fd5b60006112738484611408565b600080600080600060a0868803121561176457611764600080fd5b60006117708888611408565b9550506020611781888289016115f2565b94505060408601356001600160401b038111156117a0576117a0600080fd5b6117ac888289016114e3565b93505060606117bd888289016115f2565b92505060806115df8882890161160c565b6116d7816113e3565b6020810161089d82846117ce565b6000806000606084860312156117fd576117fd600080fd5b6000611809868661151b565b935050602061181a86828701611408565b925050604061182b868287016115f2565b9150509250925092565b6000806040838503121561184b5761184b600080fd5b60006118578585611408565b92505060208301356001600160401b0381111561187657611876600080fd5b61171e858286016114e3565b60008060006060848603121561189a5761189a600080fd5b60006118a68686611408565b93505060206118b7868287016115f2565b925050604061182b8682870161160c565b8015156116d7565b6020810161089d82846118c8565b600061089d82611507565b6116d7816118de565b6020810161089d82846118e9565b600060ff821661089d565b6116d781611900565b6020810161089d828461190b565b601f81526000602082017f5265656e7472616e637947756172643a207265656e7472616e742063616c6c00815291505b5060200190565b6020808252810161089d81611922565b805161089d81611512565b60006020828403121561198957611989600080fd5b60006112738484611969565b602681526000602082017f526f75746572577261707065723a2063616c6c6572206973206e6f742066756e81526519081c1bdbdb60d21b602082015291505b5060400190565b6020808252810161089d81611995565b601681526000602082017542696c6c696e673a20696e76616c6964206e6f6e636560501b81529150611952565b6020808252810161089d816119eb565b601381526000602082017242696c6c696e673a207478206578706972657360681b81529150611952565b6020808252810161089d81611a28565b601581526000602082017442696c6c696e673a206e6f6e63652065786973747360581b81529150611952565b6020808252810161089d81611a62565b60005b83811015611ab9578181015183820152602001611aa1565b83811115611ac8576000848401525b50505050565b6000611ad8825190565b808452602084019350611aef818560208601611a9e565b601f01601f19169290920192915050565b60608101611b0e82866117ce565b611b1b60208301856116d5565b81810360408301526108148184611ace565b8015156113fd565b805161089d81611b2d565b600060208284031215611b5557611b55600080fd5b60006112738484611b35565b601a81526000602082017f42696c6c696e673a20696e76616c6964207369676e617475726500000000000081529150611952565b6020808252810161089d81611b61565b6001600160401b0381166116d7565b60a08101611bc282886117ce565b611bcf60208301876116d5565b8181036040830152611be18186611ace565b9050611bf060608301856116d5565b610a116080830184611ba5565b60208082527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657291019081526000611952565b6020808252810161089d81611bfd565b602f81526000602082017f4f776e6572576974686472617761626c653a207769746864726177206e61746981526e1d99481d1bdad95b8819985a5b1959608a1b602082015291506119d4565b6020808252810161089d81611c3f565b60408101611ca982856118e9565b6109f360208301846116d5565b601d81526000602082017f42696c6c696e673a206e6f6e6578697374656e742070726f766964657200000081529150611952565b6020808252810161089d81611cb6565b60c08101611d0882896116d5565b611d1560208301886117ce565b611d2260408301876116d5565b611d2f60608301866116d5565b611d3c60808301856116d5565b61139f60a0830184611ba5565b60608101611d5782866118e9565b611d6460208301856117ce565b61127360408301846116d5565b60408101611ca982856117ce565b602681526000602082017f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206181526564647265737360d01b602082015291506119d4565b6020808252810161089d81611d7f565b602e81526000602082017f496e697469616c697a61626c653a20636f6e747261637420697320616c72656181526d191e481a5b9a5d1a585b1a5e995960921b602082015291506119d4565b6020808252810161089d81611dd2565b602b81526000602082017f496e697469616c697a61626c653a20636f6e7472616374206973206e6f74206981526a6e697469616c697a696e6760a81b602082015291506119d4565b6020808252810161089d81611e2d565b60006001600160401b03821115611e9e57611e9e611413565b5060209081020190565b805161089d816115ec565b60058110610a7457600080fd5b805161089d81611eb3565b600060408284031215611ee057611ee0600080fd5b611eea6040611455565b90506000611ef88484611ec0565b8252506020611f0984848301611ea8565b60208301525092915050565b6000611f236114b084611e85565b83815290506020810160408402830185811115611f4257611f42600080fd5b835b81811015611f685780611f578882611ecb565b845250602090920191604001611f44565b5050509392505050565b600082601f830112611f8657611f86600080fd5b8151611273848260208601611f15565b600060408284031215611fab57611fab600080fd5b611fb56040611455565b90506000611fc38484611ea8565b82525060208201516001600160401b03811115611fe257611fe2600080fd5b611f0984828501611f72565b6000611ffc6114b084611e85565b8381529050602080820190840283018581111561201b5761201b600080fd5b835b81811015611f685780516001600160401b0381111561203e5761203e600080fd5b80860161204b8982611f96565b855250506020928301920161201d565b600082601f83011261206f5761206f600080fd5b8151611273848260208601611fee565b60006020828403121561209457612094600080fd5b81516001600160401b038111156120ad576120ad600080fd5b6112738482850161205b565b634e487b7160e01b600052603260045260246000fd5b601981526000602082017f42696c6c696e673a20656d7074792062696c6c20656e7472790000000000000081529150611952565b6020808252810161089d816120cf565b634e487b7160e01b600052602160045260246000fd5b60058110610a7457610a74612113565b80610aff81612129565b600061089d82612139565b6116d781612143565b6080810161216582876117ce565b612172602083018661214e565b61217f60408301856116d5565b61081460608301846116d5565b6000602082840312156121a1576121a1600080fd5b60006112738484611ea8565b634e487b7160e01b600052601160045260246000fd5b60006000198214156121d7576121d76121ad565b5060010190565b601b81526000602082017f526f75746572577261707065723a207a65726f2061646472657373000000000081529150611952565b6020808252810161089d816121de565b80825b600185111561226157808604811115612240576122406121ad565b600185161561224e57908102905b800261225a8560011c90565b9450612225565b94509492505050565b600082612279575060016109f3565b81612286575060006109f3565b816001811461229c57600281146122a6576122d3565b60019150506109f3565b60ff8411156122b7576122b76121ad565b8360020a9150848211156122cd576122cd6121ad565b506109f3565b5060208310610133831016604e8410600b8410161715612306575081810a83811115612301576123016121ad565b6109f3565b6123138484846001612222565b92509050818404811115612329576123296121ad565b0292915050565b600061089a600019848461226a565b60008219821115612352576123526121ad565b500190565b602a81526000602082017f5361666545524332303a204552433230206f7065726174696f6e20646964206e8152691bdd081cdd58d8d9595960b21b602082015291506119d4565b6020808252810161089d81612357565b806116d7565b61190160f01b815260020160006123cb82856123ae565b6020820191506123db82846123ae565b5060200192915050565b63313ce56760e01b815260006004820161089d565b601b81526000602082017f5265736f75726365446174613a20696e76616c696420746f6b656e000000000081529150611952565b6020808252810161089d816123fa565b600082821015612450576124506121ad565b500390565b634e487b7160e01b600052601260045260246000fd5b60008261247a5761247a612455565b500490565b6000816000190483118215151615612499576124996121ad565b500290565b60a081016124ac82886116d5565b6124b960208301876116d5565b6124c660408301866116d5565b6124d360608301856116d5565b610a1160808301846117ce565b602681526000602082017f416464726573733a20696e73756666696369656e742062616c616e636520666f8152651c8818d85b1b60d21b602082015291506119d4565b6020808252810161089d816124e0565b601d81526000602082017f416464726573733a2063616c6c20746f206e6f6e2d636f6e747261637400000081529150611952565b6020808252810161089d81612533565b6000612581825190565b61258f818560208601611a9e565b9290920192915050565b60006109f38284612577565b6020808252810161089a8184611ace56fea2646970667358221220c44367f81d6111d5a6cc966f441cc014e262e888d6f808490bbf7f2b95a9a6aa64736f6c63430008090033",
  "deployedBytecode": "0x608060405234801561001057600080fd5b50600436106100ea5760003560e01c80638da5cb5b1161008c578063c025303e11610066578063c025303e146101b6578063de7c8e58146101d6578063f2fde38b146101e9578063f887ea40146101fc57600080fd5b80638da5cb5b1461017757806393563a9514610190578063a29ee11e146101a357600080fd5b8063699256f4116100c8578063699256f41461013657806370a0823114610149578063715018a61461015c578063851981d21461016457600080fd5b806308277dda146100ef57806317a6020b1461010457806360bcb0ce1461012d575b600080fd5b6101026100fd366004611526565b61021c565b005b610117610112366004611617565b6102b8565b60405161012491906116dd565b60405180910390f35b61011760cc5481565b6101026101443660046116eb565b6105c1565b610117610157366004611728565b61066f565b61010261079f565b610117610172366004611749565b6107d5565b6033546001600160a01b031660405161012491906117d7565b61010261019e3660046117e5565b61081d565b6101176101b1366004611835565b61088e565b6101c96101c4366004611882565b6108a3565b60405161012491906118d0565b6101176101e4366004611749565b6109fa565b6101026101f7366004611728565b610a1b565b60cb5461020f906001600160a01b031681565b60405161012491906118f2565b60006102286001610a77565b90508015610240576000805461ff0019166101001790555b61024986610b04565b6102538585610b56565b61025c83610b8b565b61026582610bc2565b80156102b0576000805461ff00191690556040517f7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb3847402498906102a790600190611914565b60405180910390a15b505050505050565b6000600260995414156102e65760405162461bcd60e51b81526004016102dd90611959565b60405180910390fd5b600260995560cb546040805163e70b7acb60e01b815290516000926001600160a01b03169163e70b7acb916004808301926020929190829003018186803b15801561033057600080fd5b505afa158015610344573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906103689190611974565b9050336001600160a01b038216146103925760405162461bcd60e51b81526004016102dd906119db565b6000846001600160401b0316116103bb5760405162461bcd60e51b81526004016102dd90611a18565b4285116103da5760405162461bcd60e51b81526004016102dd90611a52565b6001600160a01b038816600090815260cd602090815260408083208a845282528083206001600160401b038816845290915290205460ff161561042f5760405162461bcd60e51b81526004016102dd90611a8e565b600061043e89898989896109fa565b905060cb60009054906101000a90046001600160a01b03166001600160a01b031663a5a3f6c86040518163ffffffff1660e01b815260040160206040518083038186803b15801561048e57600080fd5b505afa1580156104a2573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906104c69190611974565b6001600160a01b031663238a4d1e8a83876040518463ffffffff1660e01b81526004016104f593929190611b00565b602060405180830381600087803b15801561050f57600080fd5b505af1158015610523573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906105479190611b40565b6105635760405162461bcd60e51b81526004016102dd90611b95565b61056f89898988610bf2565b92507fb23a1eee6a70af817a758fd091feb704a6bd3edc57e7fa7d2f8a5bfa5894929889898986896040516105a8959493929190611bb4565b60405180910390a1505060016099559695505050505050565b6033546001600160a01b031633146105eb5760405162461bcd60e51b81526004016102dd90611c2f565b6040516000906001600160a01b0384169083156108fc0290849084818181858888f193505050509050806106315760405162461bcd60e51b81526004016102dd90611c8b565b7f2c876ecb97b3c6854f2488d373403f903eacb800e51c159a5c0c7a9c857e48278383604051610662929190611c9b565b60405180910390a1505050565b60cb54604080516314b47ed960e31b815290516000926001600160a01b03169163a5a3f6c8916004808301926020929190829003018186803b1580156106b457600080fd5b505afa1580156106c8573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906106ec9190611974565b6001600160a01b0316636b074a07836040518263ffffffff1660e01b815260040161071791906117d7565b60206040518083038186803b15801561072f57600080fd5b505afa158015610743573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906107679190611b40565b6107835760405162461bcd60e51b81526004016102dd90611cea565b506001600160a01b0316600090815260ce602052604090205490565b6033546001600160a01b031633146107c95760405162461bcd60e51b81526004016102dd90611c2f565b6107d36000610b04565b565b600060cc548686868051906020012086866040516020016107fb96959493929190611cfa565b6040516020818303038152906040528051906020012090505b95945050505050565b6033546001600160a01b031633146108475760405162461bcd60e51b81526004016102dd90611c2f565b61085b6001600160a01b0384168383610d23565b7f2717ead6b9200dd235aad468c9809ea400fe33ac69b5bfaa6d3e90fc922b639883838360405161066293929190611d49565b600061089a8383610d7e565b90505b92915050565b60cb54604080516350e420e560e11b815290516000926001600160a01b03169163a1c841ca916004808301926020929190829003018186803b1580156108e857600080fd5b505afa1580156108fc573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906109209190611974565b6001600160a01b0316632d52976485856040518363ffffffff1660e01b815260040161094d929190611d71565b60206040518083038186803b15801561096557600080fd5b505afa158015610979573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061099d9190611b40565b6109b95760405162461bcd60e51b81526004016102dd90611cea565b506001600160a01b038316600090815260cd6020908152604080832085845282528083206001600160401b038516845290915290205460ff165b9392505050565b6000610a11610a0c87878787876107d5565b610f75565b9695505050505050565b6033546001600160a01b03163314610a455760405162461bcd60e51b81526004016102dd90611c2f565b6001600160a01b038116610a6b5760405162461bcd60e51b81526004016102dd90611dc2565b610a7481610b04565b50565b60008054610100900460ff1615610abe578160ff166001148015610a9a5750303b155b610ab65760405162461bcd60e51b81526004016102dd90611e1d565b506000919050565b60005460ff808416911610610ae55760405162461bcd60e51b81526004016102dd90611e1d565b506000805460ff191660ff92909216919091179055600190565b919050565b603380546001600160a01b038381166001600160a01b0319831681179093556040519116919082907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a35050565b600054610100900460ff16610b7d5760405162461bcd60e51b81526004016102dd90611e75565b610b878282610f88565b5050565b600054610100900460ff16610bb25760405162461bcd60e51b81526004016102dd90611e75565b610a748180519060200120610fc9565b600054610100900460ff16610be95760405162461bcd60e51b81526004016102dd90611e75565b610a7481611009565b60008060cb60009054906101000a90046001600160a01b03166001600160a01b031663c24126766040518163ffffffff1660e01b815260040160206040518083038186803b158015610c4357600080fd5b505afa158015610c57573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610c7b9190611974565b9050610c878685610d7e565b91508115610cd957610c99818361107a565b6001600160a01b038716600090815260ce6020526040902054909250610cbf90836110d8565b6001600160a01b038716600090815260ce60205260409020555b506001600160a01b03909416600090815260cd602090815260408083209583529481528482206001600160401b0390931682529190915291909120805460ff191660011790555090565b610d798363a9059cbb60e01b8484604051602401610d42929190611d71565b60408051601f198184030181529190526020810180516001600160e01b03166001600160e01b0319909316929092179091526110e4565b505050565b60008082806020019051810190610d95919061207f565b805190915015610f6e5760005b8151811015610f6c576000828281518110610dbf57610dbf6120b9565b60200260200101519050600081602001515111610dee5760405162461bcd60e51b81526004016102dd90612103565b60005b816020015151811015610f5757600082602001518281518110610e1657610e166120b9565b60200260200101519050600060cb60009054906101000a90046001600160a01b03166001600160a01b03166337187fc36040518163ffffffff1660e01b815260040160206040518083038186803b158015610e7057600080fd5b505afa158015610e84573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610ea89190611974565b825160208401518651604051630ace4d5d60e41b81526001600160a01b03949094169363ace4d5d093610ee4938f939192909190600401612157565b60206040518083038186803b158015610efc57600080fd5b505afa158015610f10573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610f34919061218c565b9050610f4087826110d8565b965050508080610f4f906121c3565b915050610df1565b50508080610f64906121c3565b915050610da2565b505b5092915050565b600061089d610f82611173565b836111af565b600054610100900460ff16610faf5760405162461bcd60e51b81526004016102dd90611e75565b815160209283012081519190920120606591909155606655565b60cc8190556040517fcf56a45f18d68202ed136bed985143964e07246be70e444cc5d94d670de61f5390610ffe9083906116dd565b60405180910390a150565b6001600160a01b03811661102f5760405162461bcd60e51b81526004016102dd90612212565b60cb80546001600160a01b0319166001600160a01b0383161790556040517f7aed1d3e8155a07ccf395e44ea3109a0e2d6c9b29bbbe9f142d9790596f4dc8090610ffe9083906118f2565b600080611086846111e2565b905060128082116110b9576110b061109e828461127b565b6110a990600a612330565b8590611287565b9250505061089d565b6108146110c6838361127b565b6110d190600a612330565b8590611293565b600061089a828461233f565b6000611139826040518060400160405280602081526020017f5361666545524332303a206c6f772d6c6576656c2063616c6c206661696c6564815250856001600160a01b031661129f9092919063ffffffff16565b805190915015610d7957808060200190518101906111579190611b40565b610d795760405162461bcd60e51b81526004016102dd9061239e565b60006111aa7f8b73c3c69bb8fe3d512ecc4cf759cc79239f7b179b0ffacaa9a75d522b39400f6111a260655490565b6066546112ae565b905090565b600082826040516020016111c49291906123b4565b60405160208183030381529060405280519060200120905092915050565b6000806000836001600160a01b03166040516111fd906123e5565b600060405180830381855afa9150503d8060008114611238576040519150601f19603f3d011682016040523d82523d6000602084013e61123d565b606091505b50915091508161125f5760405162461bcd60e51b81526004016102dd9061242e565b80806020019051810190611273919061218c565b949350505050565b600061089a828461243e565b600061089a828461246b565b600061089a828461247f565b606061127384846000856112e8565b600083838346306040516020016112c995949392919061249e565b6040516020818303038152906040528051906020012090509392505050565b60608247101561130a5760405162461bcd60e51b81526004016102dd90612523565b6001600160a01b0385163b6113315760405162461bcd60e51b81526004016102dd90612567565b600080866001600160a01b0316858760405161134d9190612599565b60006040518083038185875af1925050503d806000811461138a576040519150601f19603f3d011682016040523d82523d6000602084013e61138f565b606091505b509150915061139f8282866113aa565b979650505050505050565b606083156113b95750816109f3565b8251156113c95782518084602001fd5b8160405162461bcd60e51b81526004016102dd91906125a5565b60006001600160a01b03821661089d565b6113fd816113e3565b8114610a7457600080fd5b803561089d816113f4565b634e487b7160e01b600052604160045260246000fd5b601f19601f83011681018181106001600160401b038211171561144e5761144e611413565b6040525050565b600061146060405190565b9050610aff8282611429565b60006001600160401b0382111561148557611485611413565b601f19601f83011660200192915050565b82818337506000910152565b60006114b56114b08461146c565b611455565b9050828152602081018484840111156114d0576114d0600080fd5b6114db848285611496565b509392505050565b600082601f8301126114f7576114f7600080fd5b81356112738482602086016114a2565b600061089d826113e3565b6113fd81611507565b803561089d81611512565b600080600080600060a0868803121561154157611541600080fd5b600061154d8888611408565b95505060208601356001600160401b0381111561156c5761156c600080fd5b611578888289016114e3565b94505060408601356001600160401b0381111561159757611597600080fd5b6115a3888289016114e3565b93505060608601356001600160401b038111156115c2576115c2600080fd5b6115ce888289016114e3565b92505060806115df8882890161151b565b9150509295509295909350565b806113fd565b803561089d816115ec565b6001600160401b0381166113fd565b803561089d816115fd565b60008060008060008060c0878903121561163357611633600080fd5b600061163f8989611408565b965050602061165089828a016115f2565b95505060408701356001600160401b0381111561166f5761166f600080fd5b61167b89828a016114e3565b945050606061168c89828a016115f2565b935050608061169d89828a0161160c565b92505060a08701356001600160401b038111156116bc576116bc600080fd5b6116c889828a016114e3565b9150509295509295509295565b805b82525050565b6020810161089d82846116d5565b6000806040838503121561170157611701600080fd5b600061170d8585611408565b925050602061171e858286016115f2565b9150509250929050565b60006020828403121561173d5761173d600080fd5b60006112738484611408565b600080600080600060a0868803121561176457611764600080fd5b60006117708888611408565b9550506020611781888289016115f2565b94505060408601356001600160401b038111156117a0576117a0600080fd5b6117ac888289016114e3565b93505060606117bd888289016115f2565b92505060806115df8882890161160c565b6116d7816113e3565b6020810161089d82846117ce565b6000806000606084860312156117fd576117fd600080fd5b6000611809868661151b565b935050602061181a86828701611408565b925050604061182b868287016115f2565b9150509250925092565b6000806040838503121561184b5761184b600080fd5b60006118578585611408565b92505060208301356001600160401b0381111561187657611876600080fd5b61171e858286016114e3565b60008060006060848603121561189a5761189a600080fd5b60006118a68686611408565b93505060206118b7868287016115f2565b925050604061182b8682870161160c565b8015156116d7565b6020810161089d82846118c8565b600061089d82611507565b6116d7816118de565b6020810161089d82846118e9565b600060ff821661089d565b6116d781611900565b6020810161089d828461190b565b601f81526000602082017f5265656e7472616e637947756172643a207265656e7472616e742063616c6c00815291505b5060200190565b6020808252810161089d81611922565b805161089d81611512565b60006020828403121561198957611989600080fd5b60006112738484611969565b602681526000602082017f526f75746572577261707065723a2063616c6c6572206973206e6f742066756e81526519081c1bdbdb60d21b602082015291505b5060400190565b6020808252810161089d81611995565b601681526000602082017542696c6c696e673a20696e76616c6964206e6f6e636560501b81529150611952565b6020808252810161089d816119eb565b601381526000602082017242696c6c696e673a207478206578706972657360681b81529150611952565b6020808252810161089d81611a28565b601581526000602082017442696c6c696e673a206e6f6e63652065786973747360581b81529150611952565b6020808252810161089d81611a62565b60005b83811015611ab9578181015183820152602001611aa1565b83811115611ac8576000848401525b50505050565b6000611ad8825190565b808452602084019350611aef818560208601611a9e565b601f01601f19169290920192915050565b60608101611b0e82866117ce565b611b1b60208301856116d5565b81810360408301526108148184611ace565b8015156113fd565b805161089d81611b2d565b600060208284031215611b5557611b55600080fd5b60006112738484611b35565b601a81526000602082017f42696c6c696e673a20696e76616c6964207369676e617475726500000000000081529150611952565b6020808252810161089d81611b61565b6001600160401b0381166116d7565b60a08101611bc282886117ce565b611bcf60208301876116d5565b8181036040830152611be18186611ace565b9050611bf060608301856116d5565b610a116080830184611ba5565b60208082527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657291019081526000611952565b6020808252810161089d81611bfd565b602f81526000602082017f4f776e6572576974686472617761626c653a207769746864726177206e61746981526e1d99481d1bdad95b8819985a5b1959608a1b602082015291506119d4565b6020808252810161089d81611c3f565b60408101611ca982856118e9565b6109f360208301846116d5565b601d81526000602082017f42696c6c696e673a206e6f6e6578697374656e742070726f766964657200000081529150611952565b6020808252810161089d81611cb6565b60c08101611d0882896116d5565b611d1560208301886117ce565b611d2260408301876116d5565b611d2f60608301866116d5565b611d3c60808301856116d5565b61139f60a0830184611ba5565b60608101611d5782866118e9565b611d6460208301856117ce565b61127360408301846116d5565b60408101611ca982856117ce565b602681526000602082017f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206181526564647265737360d01b602082015291506119d4565b6020808252810161089d81611d7f565b602e81526000602082017f496e697469616c697a61626c653a20636f6e747261637420697320616c72656181526d191e481a5b9a5d1a585b1a5e995960921b602082015291506119d4565b6020808252810161089d81611dd2565b602b81526000602082017f496e697469616c697a61626c653a20636f6e7472616374206973206e6f74206981526a6e697469616c697a696e6760a81b602082015291506119d4565b6020808252810161089d81611e2d565b60006001600160401b03821115611e9e57611e9e611413565b5060209081020190565b805161089d816115ec565b60058110610a7457600080fd5b805161089d81611eb3565b600060408284031215611ee057611ee0600080fd5b611eea6040611455565b90506000611ef88484611ec0565b8252506020611f0984848301611ea8565b60208301525092915050565b6000611f236114b084611e85565b83815290506020810160408402830185811115611f4257611f42600080fd5b835b81811015611f685780611f578882611ecb565b845250602090920191604001611f44565b5050509392505050565b600082601f830112611f8657611f86600080fd5b8151611273848260208601611f15565b600060408284031215611fab57611fab600080fd5b611fb56040611455565b90506000611fc38484611ea8565b82525060208201516001600160401b03811115611fe257611fe2600080fd5b611f0984828501611f72565b6000611ffc6114b084611e85565b8381529050602080820190840283018581111561201b5761201b600080fd5b835b81811015611f685780516001600160401b0381111561203e5761203e600080fd5b80860161204b8982611f96565b855250506020928301920161201d565b600082601f83011261206f5761206f600080fd5b8151611273848260208601611fee565b60006020828403121561209457612094600080fd5b81516001600160401b038111156120ad576120ad600080fd5b6112738482850161205b565b634e487b7160e01b600052603260045260246000fd5b601981526000602082017f42696c6c696e673a20656d7074792062696c6c20656e7472790000000000000081529150611952565b6020808252810161089d816120cf565b634e487b7160e01b600052602160045260246000fd5b60058110610a7457610a74612113565b80610aff81612129565b600061089d82612139565b6116d781612143565b6080810161216582876117ce565b612172602083018661214e565b61217f60408301856116d5565b61081460608301846116d5565b6000602082840312156121a1576121a1600080fd5b60006112738484611ea8565b634e487b7160e01b600052601160045260246000fd5b60006000198214156121d7576121d76121ad565b5060010190565b601b81526000602082017f526f75746572577261707065723a207a65726f2061646472657373000000000081529150611952565b6020808252810161089d816121de565b80825b600185111561226157808604811115612240576122406121ad565b600185161561224e57908102905b800261225a8560011c90565b9450612225565b94509492505050565b600082612279575060016109f3565b81612286575060006109f3565b816001811461229c57600281146122a6576122d3565b60019150506109f3565b60ff8411156122b7576122b76121ad565b8360020a9150848211156122cd576122cd6121ad565b506109f3565b5060208310610133831016604e8410600b8410161715612306575081810a83811115612301576123016121ad565b6109f3565b6123138484846001612222565b92509050818404811115612329576123296121ad565b0292915050565b600061089a600019848461226a565b60008219821115612352576123526121ad565b500190565b602a81526000602082017f5361666545524332303a204552433230206f7065726174696f6e20646964206e8152691bdd081cdd58d8d9595960b21b602082015291506119d4565b6020808252810161089d81612357565b806116d7565b61190160f01b815260020160006123cb82856123ae565b6020820191506123db82846123ae565b5060200192915050565b63313ce56760e01b815260006004820161089d565b601b81526000602082017f5265736f75726365446174613a20696e76616c696420746f6b656e000000000081529150611952565b6020808252810161089d816123fa565b600082821015612450576124506121ad565b500390565b634e487b7160e01b600052601260045260246000fd5b60008261247a5761247a612455565b500490565b6000816000190483118215151615612499576124996121ad565b500290565b60a081016124ac82886116d5565b6124b960208301876116d5565b6124c660408301866116d5565b6124d360608301856116d5565b610a1160808301846117ce565b602681526000602082017f416464726573733a20696e73756666696369656e742062616c616e636520666f8152651c8818d85b1b60d21b602082015291506119d4565b6020808252810161089d816124e0565b601d81526000602082017f416464726573733a2063616c6c20746f206e6f6e2d636f6e747261637400000081529150611952565b6020808252810161089d81612533565b6000612581825190565b61258f818560208601611a9e565b9290920192915050565b60006109f38284612577565b6020808252810161089a8184611ace56fea2646970667358221220c44367f81d6111d5a6cc966f441cc014e262e888d6f808490bbf7f2b95a9a6aa64736f6c63430008090033",
  "devdoc": {
    "author": "Alexandas",
    "details": "Billing contract",
    "kind": "dev",
    "methods": {
      "balanceOf(address)": {
        "details": "return balance of provider",
        "params": {
          "provider": "provider address"
        },
        "returns": {
          "_0": "balance of provider"
        }
      },
      "billFee(address,bytes)": {
        "details": "return bill fee",
        "params": {
          "data": "bill data",
          "provider": "provider address"
        },
        "returns": {
          "value": "bill fee"
        }
      },
      "hashBillingTypes(address,bytes32,bytes,uint256,uint64)": {
        "details": "return hash for bills",
        "params": {
          "account": "user account",
          "bills": "user bills",
          "nonce": "nonce",
          "provider": "provider address",
          "timeout": "tx timeout"
        },
        "returns": {
          "_0": "bills hash"
        }
      },
      "hashTypedDataV4ForBills(address,bytes32,bytes,uint256,uint64)": {
        "details": "return hash typed data v4 for sign bills",
        "params": {
          "account": "user account",
          "bills": "user bills",
          "nonce": "nonce",
          "provider": "provider address",
          "timeout": "tx timeout"
        },
        "returns": {
          "_0": "bills hash typed data v4"
        }
      },
      "initialize(address,string,string,string,address)": {
        "details": "proxy initialize function",
        "params": {
          "name": "EIP712 name",
          "owner": "contract owner",
          "router": "router contract address",
          "version": "EIP712 version"
        }
      },
      "nonceExists(address,bytes32,uint64)": {
        "details": "provider nonces for account",
        "params": {
          "account": "user account",
          "nonce": "nonce",
          "provider": "provider address"
        },
        "returns": {
          "_0": "whether nonce exists"
        }
      },
      "owner()": {
        "details": "Returns the address of the current owner."
      },
      "ownerWithdrawERC20(address,address,uint256)": {
        "details": "withdraw token",
        "params": {
          "to": "receiver address",
          "token": "token address",
          "value": "token value"
        }
      },
      "ownerWithdrawNative(address,uint256)": {
        "details": "withdraw ETH",
        "params": {
          "to": "receiver address",
          "value": "token value"
        }
      },
      "renounceOwnership()": {
        "details": "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."
      },
      "spend(address,bytes32,bytes,uint256,uint64,bytes)": {
        "details": "spend bills",
        "params": {
          "account": "user account",
          "bills": "billing data",
          "nonce": "billing nonce",
          "provider": "provider address",
          "signature": "billing signature",
          "timeout": "tx timeout"
        },
        "returns": {
          "fee": "billing fee"
        }
      },
      "transferOwnership(address)": {
        "details": "Transfers ownership of the contract to a new account (`newOwner`). Can only be called by the current owner."
      }
    },
    "stateVariables": {
      "balances": {
        "details": "provider balances"
      },
      "billingTypesHash": {
        "details": "keccak256(\"Billing(address provider,bytes32 account,bytes bills,uint256 timeout,uint64 nonce)\")"
      },
      "nonces": {
        "details": "provider nonces for account"
      }
    },
    "version": 1
  },
  "userdoc": {
    "kind": "user",
    "methods": {},
    "version": 1
  },
  "storageLayout": {
    "storage": [
      {
        "astId": 147,
        "contract": "contracts/wallets/Billing.sol:Billing",
        "label": "_initialized",
        "offset": 0,
        "slot": "0",
        "type": "t_uint8"
      },
      {
        "astId": 150,
        "contract": "contracts/wallets/Billing.sol:Billing",
        "label": "_initializing",
        "offset": 1,
        "slot": "0",
        "type": "t_bool"
      },
      {
        "astId": 1038,
        "contract": "contracts/wallets/Billing.sol:Billing",
        "label": "__gap",
        "offset": 0,
        "slot": "1",
        "type": "t_array(t_uint256)50_storage"
      },
      {
        "astId": 10,
        "contract": "contracts/wallets/Billing.sol:Billing",
        "label": "_owner",
        "offset": 0,
        "slot": "51",
        "type": "t_address"
      },
      {
        "astId": 122,
        "contract": "contracts/wallets/Billing.sol:Billing",
        "label": "__gap",
        "offset": 0,
        "slot": "52",
        "type": "t_array(t_uint256)49_storage"
      },
      {
        "astId": 1738,
        "contract": "contracts/wallets/Billing.sol:Billing",
        "label": "_HASHED_NAME",
        "offset": 0,
        "slot": "101",
        "type": "t_bytes32"
      },
      {
        "astId": 1740,
        "contract": "contracts/wallets/Billing.sol:Billing",
        "label": "_HASHED_VERSION",
        "offset": 0,
        "slot": "102",
        "type": "t_bytes32"
      },
      {
        "astId": 1878,
        "contract": "contracts/wallets/Billing.sol:Billing",
        "label": "__gap",
        "offset": 0,
        "slot": "103",
        "type": "t_array(t_uint256)50_storage"
      },
      {
        "astId": 407,
        "contract": "contracts/wallets/Billing.sol:Billing",
        "label": "_status",
        "offset": 0,
        "slot": "153",
        "type": "t_uint256"
      },
      {
        "astId": 451,
        "contract": "contracts/wallets/Billing.sol:Billing",
        "label": "__gap",
        "offset": 0,
        "slot": "154",
        "type": "t_array(t_uint256)49_storage"
      },
      {
        "astId": 5834,
        "contract": "contracts/wallets/Billing.sol:Billing",
        "label": "router",
        "offset": 0,
        "slot": "203",
        "type": "t_contract(IRouter)6848"
      },
      {
        "astId": 11387,
        "contract": "contracts/wallets/Billing.sol:Billing",
        "label": "billingTypesHash",
        "offset": 0,
        "slot": "204",
        "type": "t_bytes32"
      },
      {
        "astId": 11396,
        "contract": "contracts/wallets/Billing.sol:Billing",
        "label": "nonces",
        "offset": 0,
        "slot": "205",
        "type": "t_mapping(t_address,t_mapping(t_bytes32,t_mapping(t_uint64,t_bool)))"
      },
      {
        "astId": 11401,
        "contract": "contracts/wallets/Billing.sol:Billing",
        "label": "balances",
        "offset": 0,
        "slot": "206",
        "type": "t_mapping(t_address,t_uint256)"
      }
    ],
    "types": {
      "t_address": {
        "encoding": "inplace",
        "label": "address",
        "numberOfBytes": "20"
      },
      "t_array(t_uint256)49_storage": {
        "base": "t_uint256",
        "encoding": "inplace",
        "label": "uint256[49]",
        "numberOfBytes": "1568"
      },
      "t_array(t_uint256)50_storage": {
        "base": "t_uint256",
        "encoding": "inplace",
        "label": "uint256[50]",
        "numberOfBytes": "1600"
      },
      "t_bool": {
        "encoding": "inplace",
        "label": "bool",
        "numberOfBytes": "1"
      },
      "t_bytes32": {
        "encoding": "inplace",
        "label": "bytes32",
        "numberOfBytes": "32"
      },
      "t_contract(IRouter)6848": {
        "encoding": "inplace",
        "label": "contract IRouter",
        "numberOfBytes": "20"
      },
      "t_mapping(t_address,t_mapping(t_bytes32,t_mapping(t_uint64,t_bool)))": {
        "encoding": "mapping",
        "key": "t_address",
        "label": "mapping(address => mapping(bytes32 => mapping(uint64 => bool)))",
        "numberOfBytes": "32",
        "value": "t_mapping(t_bytes32,t_mapping(t_uint64,t_bool))"
      },
      "t_mapping(t_address,t_uint256)": {
        "encoding": "mapping",
        "key": "t_address",
        "label": "mapping(address => uint256)",
        "numberOfBytes": "32",
        "value": "t_uint256"
      },
      "t_mapping(t_bytes32,t_mapping(t_uint64,t_bool))": {
        "encoding": "mapping",
        "key": "t_bytes32",
        "label": "mapping(bytes32 => mapping(uint64 => bool))",
        "numberOfBytes": "32",
        "value": "t_mapping(t_uint64,t_bool)"
      },
      "t_mapping(t_uint64,t_bool)": {
        "encoding": "mapping",
        "key": "t_uint64",
        "label": "mapping(uint64 => bool)",
        "numberOfBytes": "32",
        "value": "t_bool"
      },
      "t_uint256": {
        "encoding": "inplace",
        "label": "uint256",
        "numberOfBytes": "32"
      },
      "t_uint64": {
        "encoding": "inplace",
        "label": "uint64",
        "numberOfBytes": "8"
      },
      "t_uint8": {
        "encoding": "inplace",
        "label": "uint8",
        "numberOfBytes": "1"
      }
    }
  }
}