{
  "address": "0x72Edd573E230C7d68274Bf718A4C6aD82b5d5f90",
  "abi": [
    {
      "inputs": [],
      "stateMutability": "nonpayable",
      "type": "constructor"
    },
    {
      "anonymous": false,
      "inputs": [
        {
          "indexed": false,
          "internalType": "address",
          "name": "proxy",
          "type": "address"
        }
      ],
      "name": "ProxyCreated",
      "type": "event"
    },
    {
      "inputs": [],
      "name": "create",
      "outputs": [
        {
          "internalType": "contract Ticket",
          "name": "",
          "type": "address"
        }
      ],
      "stateMutability": "nonpayable",
      "type": "function"
    },
    {
      "inputs": [
        {
          "internalType": "address",
          "name": "_logic",
          "type": "address"
        },
        {
          "internalType": "bytes",
          "name": "_data",
          "type": "bytes"
        }
      ],
      "name": "deployMinimal",
      "outputs": [
        {
          "internalType": "address",
          "name": "proxy",
          "type": "address"
        }
      ],
      "stateMutability": "nonpayable",
      "type": "function"
    },
    {
      "inputs": [],
      "name": "instance",
      "outputs": [
        {
          "internalType": "contract Ticket",
          "name": "",
          "type": "address"
        }
      ],
      "stateMutability": "view",
      "type": "function"
    }
  ],
  "transactionHash": "0xe6c018cb2b6cfb60278b14d3294a8624acdc444b5b48b5a4dd24fc5e2205bf20",
  "receipt": {
    "to": null,
    "from": "0xE0F4217390221aF47855E094F6e112D43C8698fE",
    "contractAddress": "0x72Edd573E230C7d68274Bf718A4C6aD82b5d5f90",
    "transactionIndex": 58,
    "gasUsed": "2481630",
    "logsBloom": "0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000",
    "blockHash": "0x85cdee84118c5d26b191e387d6d90cc18898a7765648e4fcae530f33eb278358",
    "transactionHash": "0xe6c018cb2b6cfb60278b14d3294a8624acdc444b5b48b5a4dd24fc5e2205bf20",
    "logs": [],
    "blockNumber": 9218905,
    "cumulativeGasUsed": "12344001",
    "status": 1,
    "byzantium": true
  },
  "args": [],
  "solcInputHash": "07113fc1ebb7a05ae49ea4c62cff423c",
  "metadata": "{\"compiler\":{\"version\":\"0.6.12+commit.27d51765\"},\"language\":\"Solidity\",\"output\":{\"abi\":[{\"inputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"constructor\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"address\",\"name\":\"proxy\",\"type\":\"address\"}],\"name\":\"ProxyCreated\",\"type\":\"event\"},{\"inputs\":[],\"name\":\"create\",\"outputs\":[{\"internalType\":\"contract Ticket\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[{\"internalType\":\"address\",\"name\":\"_logic\",\"type\":\"address\"},{\"internalType\":\"bytes\",\"name\":\"_data\",\"type\":\"bytes\"}],\"name\":\"deployMinimal\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"proxy\",\"type\":\"address\"}],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"instance\",\"outputs\":[{\"internalType\":\"contract Ticket\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"}],\"devdoc\":{\"kind\":\"dev\",\"methods\":{\"create()\":{\"returns\":{\"_0\":\"A reference to the new proxied Controlled ERC20 Token\"}}},\"title\":\"Controlled ERC20 Token Factory\",\"version\":1},\"userdoc\":{\"kind\":\"user\",\"methods\":{\"constructor\":\"Initializes the Factory with an instance of the Controlled ERC20 Token\",\"create()\":{\"notice\":\"Creates a new Controlled ERC20 Token as a proxy of the template instance\"},\"instance()\":{\"notice\":\"Contract template for deploying proxied tokens\"}},\"notice\":\"Minimal proxy pattern for creating new Controlled ERC20 Tokens\",\"version\":1}},\"settings\":{\"compilationTarget\":{\"contracts/token/TicketProxyFactory.sol\":\"TicketProxyFactory\"},\"evmVersion\":\"istanbul\",\"libraries\":{},\"metadata\":{\"bytecodeHash\":\"ipfs\",\"useLiteralContent\":true},\"optimizer\":{\"enabled\":true,\"runs\":200},\"remappings\":[]},\"sources\":{\"@openzeppelin/contracts-upgradeable/cryptography/ECDSAUpgradeable.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity >=0.6.0 <0.8.0;\\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    /**\\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        // Check the signature length\\n        if (signature.length != 65) {\\n            revert(\\\"ECDSA: invalid signature length\\\");\\n        }\\n\\n        // Divide the signature in r, s and v variables\\n        bytes32 r;\\n        bytes32 s;\\n        uint8 v;\\n\\n        // ecrecover takes the signature parameters, and the only way to get them\\n        // currently is to use assembly.\\n        // solhint-disable-next-line no-inline-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\\n        return recover(hash, v, r, s);\\n    }\\n\\n    /**\\n     * @dev Overload of {ECDSA-recover-bytes32-bytes-} that receives the `v`,\\n     * `r` and `s` signature fields separately.\\n     */\\n    function recover(bytes32 hash, uint8 v, bytes32 r, bytes32 s) internal pure returns (address) {\\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 (281): 0 < s < secp256k1n \\u00f7 2 + 1, and for v in (282): 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        require(uint256(s) <= 0x7FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF5D576E7357A4501DDFE92F46681B20A0, \\\"ECDSA: invalid signature 's' value\\\");\\n        require(v == 27 || v == 28, \\\"ECDSA: invalid signature 'v' value\\\");\\n\\n        // If the signature is valid (and not malleable), return the signer address\\n        address signer = ecrecover(hash, v, r, s);\\n        require(signer != address(0), \\\"ECDSA: invalid signature\\\");\\n\\n        return signer;\\n    }\\n\\n    /**\\n     * @dev Returns an Ethereum Signed Message, created from a `hash`. This\\n     * replicates the behavior of the\\n     * https://github.com/ethereum/wiki/wiki/JSON-RPC#eth_sign[`eth_sign`]\\n     * JSON-RPC method.\\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\",\"keccak256\":\"0xe348c45df01e0705c50ede5063d77111a996722ffb83f0a22979338a32b06887\",\"license\":\"MIT\"},\"@openzeppelin/contracts-upgradeable/drafts/EIP712Upgradeable.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity >=0.6.0 <0.8.0;\\nimport \\\"../proxy/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 */\\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    /* 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 initializer {\\n        __EIP712_init_unchained(name, version);\\n    }\\n\\n    function __EIP712_init_unchained(string memory name, string memory version) internal initializer {\\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(bytes32 typeHash, bytes32 name, bytes32 version) private view returns (bytes32) {\\n        return keccak256(\\n            abi.encode(\\n                typeHash,\\n                name,\\n                version,\\n                _getChainId(),\\n                address(this)\\n            )\\n        );\\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 keccak256(abi.encodePacked(\\\"\\\\x19\\\\x01\\\", _domainSeparatorV4(), structHash));\\n    }\\n\\n    function _getChainId() private view returns (uint256 chainId) {\\n        this; // silence state mutability warning without generating bytecode - see https://github.com/ethereum/solidity/issues/2691\\n        // solhint-disable-next-line no-inline-assembly\\n        assembly {\\n            chainId := chainid()\\n        }\\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    uint256[50] private __gap;\\n}\\n\",\"keccak256\":\"0x6cd0bc8c149150614ca3d4a3d3d21f844a0ab3032625f34fcfcf1c2c8b351638\",\"license\":\"MIT\"},\"@openzeppelin/contracts-upgradeable/drafts/ERC20PermitUpgradeable.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity >=0.6.5 <0.8.0;\\n\\nimport \\\"../token/ERC20/ERC20Upgradeable.sol\\\";\\nimport \\\"./IERC20PermitUpgradeable.sol\\\";\\nimport \\\"../cryptography/ECDSAUpgradeable.sol\\\";\\nimport \\\"../utils/CountersUpgradeable.sol\\\";\\nimport \\\"./EIP712Upgradeable.sol\\\";\\nimport \\\"../proxy/Initializable.sol\\\";\\n\\n/**\\n * @dev Implementation of the ERC20 Permit extension allowing approvals to be made via signatures, as defined in\\n * https://eips.ethereum.org/EIPS/eip-2612[EIP-2612].\\n *\\n * Adds the {permit} method, which can be used to change an account's ERC20 allowance (see {IERC20-allowance}) by\\n * presenting a message signed by the account. By not relying on `{IERC20-approve}`, the token holder account doesn't\\n * need to send a transaction, and thus is not required to hold Ether at all.\\n *\\n * _Available since v3.4._\\n */\\nabstract contract ERC20PermitUpgradeable is Initializable, ERC20Upgradeable, IERC20PermitUpgradeable, EIP712Upgradeable {\\n    using CountersUpgradeable for CountersUpgradeable.Counter;\\n\\n    mapping (address => CountersUpgradeable.Counter) private _nonces;\\n\\n    // solhint-disable-next-line var-name-mixedcase\\n    bytes32 private _PERMIT_TYPEHASH;\\n\\n    /**\\n     * @dev Initializes the {EIP712} domain separator using the `name` parameter, and setting `version` to `\\\"1\\\"`.\\n     *\\n     * It's a good idea to use the same `name` that is defined as the ERC20 token name.\\n     */\\n    function __ERC20Permit_init(string memory name) internal initializer {\\n        __Context_init_unchained();\\n        __EIP712_init_unchained(name, \\\"1\\\");\\n        __ERC20Permit_init_unchained(name);\\n    }\\n\\n    function __ERC20Permit_init_unchained(string memory name) internal initializer {\\n        _PERMIT_TYPEHASH = keccak256(\\\"Permit(address owner,address spender,uint256 value,uint256 nonce,uint256 deadline)\\\");\\n    }\\n\\n    /**\\n     * @dev See {IERC20Permit-permit}.\\n     */\\n    function permit(address owner, address spender, uint256 value, uint256 deadline, uint8 v, bytes32 r, bytes32 s) public virtual override {\\n        // solhint-disable-next-line not-rely-on-time\\n        require(block.timestamp <= deadline, \\\"ERC20Permit: expired deadline\\\");\\n\\n        bytes32 structHash = keccak256(\\n            abi.encode(\\n                _PERMIT_TYPEHASH,\\n                owner,\\n                spender,\\n                value,\\n                _nonces[owner].current(),\\n                deadline\\n            )\\n        );\\n\\n        bytes32 hash = _hashTypedDataV4(structHash);\\n\\n        address signer = ECDSAUpgradeable.recover(hash, v, r, s);\\n        require(signer == owner, \\\"ERC20Permit: invalid signature\\\");\\n\\n        _nonces[owner].increment();\\n        _approve(owner, spender, value);\\n    }\\n\\n    /**\\n     * @dev See {IERC20Permit-nonces}.\\n     */\\n    function nonces(address owner) public view override returns (uint256) {\\n        return _nonces[owner].current();\\n    }\\n\\n    /**\\n     * @dev See {IERC20Permit-DOMAIN_SEPARATOR}.\\n     */\\n    // solhint-disable-next-line func-name-mixedcase\\n    function DOMAIN_SEPARATOR() external view override returns (bytes32) {\\n        return _domainSeparatorV4();\\n    }\\n    uint256[49] private __gap;\\n}\\n\",\"keccak256\":\"0xb30c40eb91411e29d23c8184b19fd37e6c2447f685631b798af2871ede483157\",\"license\":\"MIT\"},\"@openzeppelin/contracts-upgradeable/drafts/IERC20PermitUpgradeable.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity >=0.6.0 <0.8.0;\\n\\n/**\\n * @dev Interface of the ERC20 Permit extension allowing approvals to be made via signatures, as defined in\\n * https://eips.ethereum.org/EIPS/eip-2612[EIP-2612].\\n *\\n * Adds the {permit} method, which can be used to change an account's ERC20 allowance (see {IERC20-allowance}) by\\n * presenting a message signed by the account. By not relying on `{IERC20-approve}`, the token holder account doesn't\\n * need to send a transaction, and thus is not required to hold Ether at all.\\n */\\ninterface IERC20PermitUpgradeable {\\n    /**\\n     * @dev Sets `value` as the allowance of `spender` over `owner`'s tokens,\\n     * given `owner`'s signed approval.\\n     *\\n     * IMPORTANT: The same issues {IERC20-approve} has related to transaction\\n     * ordering also apply here.\\n     *\\n     * Emits an {Approval} event.\\n     *\\n     * Requirements:\\n     *\\n     * - `spender` cannot be the zero address.\\n     * - `deadline` must be a timestamp in the future.\\n     * - `v`, `r` and `s` must be a valid `secp256k1` signature from `owner`\\n     * over the EIP712-formatted function arguments.\\n     * - the signature must use ``owner``'s current nonce (see {nonces}).\\n     *\\n     * For more information on the signature format, see the\\n     * https://eips.ethereum.org/EIPS/eip-2612#specification[relevant EIP\\n     * section].\\n     */\\n    function permit(address owner, address spender, uint256 value, uint256 deadline, uint8 v, bytes32 r, bytes32 s) external;\\n\\n    /**\\n     * @dev Returns the current nonce for `owner`. This value must be\\n     * included whenever a signature is generated for {permit}.\\n     *\\n     * Every successful call to {permit} increases ``owner``'s nonce by one. This\\n     * prevents a signature from being used multiple times.\\n     */\\n    function nonces(address owner) external view returns (uint256);\\n\\n    /**\\n     * @dev Returns the domain separator used in the encoding of the signature for `permit`, as defined by {EIP712}.\\n     */\\n    // solhint-disable-next-line func-name-mixedcase\\n    function DOMAIN_SEPARATOR() external view returns (bytes32);\\n}\\n\",\"keccak256\":\"0x30c000f3a68d252b09a738c782e0fc9dbf168b81021a195de6102f8d095681ae\",\"license\":\"MIT\"},\"@openzeppelin/contracts-upgradeable/math/SafeMathUpgradeable.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity >=0.6.0 <0.8.0;\\n\\n/**\\n * @dev Wrappers over Solidity's arithmetic operations with added overflow\\n * checks.\\n *\\n * Arithmetic operations in Solidity wrap on overflow. This can easily result\\n * in bugs, because programmers usually assume that an overflow raises an\\n * error, which is the standard behavior in high level programming languages.\\n * `SafeMath` restores this intuition by reverting the transaction when an\\n * operation overflows.\\n *\\n * Using this library instead of the unchecked operations eliminates an entire\\n * class of bugs, so it's recommended to use it always.\\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        uint256 c = a + b;\\n        if (c < a) return (false, 0);\\n        return (true, c);\\n    }\\n\\n    /**\\n     * @dev Returns the substraction 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        if (b > a) return (false, 0);\\n        return (true, a - b);\\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        // 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     * @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        if (b == 0) return (false, 0);\\n        return (true, a / b);\\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        if (b == 0) return (false, 0);\\n        return (true, a % b);\\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        uint256 c = a + b;\\n        require(c >= a, \\\"SafeMath: addition overflow\\\");\\n        return c;\\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        require(b <= a, \\\"SafeMath: subtraction overflow\\\");\\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        if (a == 0) return 0;\\n        uint256 c = a * b;\\n        require(c / a == b, \\\"SafeMath: multiplication overflow\\\");\\n        return c;\\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. 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(uint256 a, uint256 b) internal pure returns (uint256) {\\n        require(b > 0, \\\"SafeMath: division by zero\\\");\\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        require(b > 0, \\\"SafeMath: modulo by zero\\\");\\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(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {\\n        require(b <= a, errorMessage);\\n        return a - b;\\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     * CAUTION: This function is deprecated because it requires allocating memory for the error\\n     * message unnecessarily. For custom revert reasons use {tryDiv}.\\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(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {\\n        require(b > 0, errorMessage);\\n        return a / b;\\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(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {\\n        require(b > 0, errorMessage);\\n        return a % b;\\n    }\\n}\\n\",\"keccak256\":\"0x0dd1e9b19801e3e7d900fbf4182d81e1afd23ad7be39504e33df6bbcba91d724\",\"license\":\"MIT\"},\"@openzeppelin/contracts-upgradeable/proxy/Initializable.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\n// solhint-disable-next-line compiler-version\\npragma solidity >=0.4.24 <0.8.0;\\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 a proxied contract can't have 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 * 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 {UpgradeableProxy-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 */\\nabstract contract Initializable {\\n\\n    /**\\n     * @dev Indicates that the contract has been initialized.\\n     */\\n    bool 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 Modifier to protect an initializer function from being invoked twice.\\n     */\\n    modifier initializer() {\\n        require(_initializing || _isConstructor() || !_initialized, \\\"Initializable: contract is already initialized\\\");\\n\\n        bool isTopLevelCall = !_initializing;\\n        if (isTopLevelCall) {\\n            _initializing = true;\\n            _initialized = true;\\n        }\\n\\n        _;\\n\\n        if (isTopLevelCall) {\\n            _initializing = false;\\n        }\\n    }\\n\\n    /// @dev Returns true if and only if the function is running in the constructor\\n    function _isConstructor() private view returns (bool) {\\n        return !AddressUpgradeable.isContract(address(this));\\n    }\\n}\\n\",\"keccak256\":\"0xd8e4eb08dcc1d1860fb347ba5ffd595242b9a1b66d49a47f2b4cb51c3f35017e\",\"license\":\"MIT\"},\"@openzeppelin/contracts-upgradeable/token/ERC20/ERC20Upgradeable.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity >=0.6.0 <0.8.0;\\n\\nimport \\\"../../utils/ContextUpgradeable.sol\\\";\\nimport \\\"./IERC20Upgradeable.sol\\\";\\nimport \\\"../../math/SafeMathUpgradeable.sol\\\";\\nimport \\\"../../proxy/Initializable.sol\\\";\\n\\n/**\\n * @dev Implementation of the {IERC20} interface.\\n *\\n * This implementation is agnostic to the way tokens are created. This means\\n * that a supply mechanism has to be added in a derived contract using {_mint}.\\n * For a generic mechanism see {ERC20PresetMinterPauser}.\\n *\\n * TIP: For a detailed writeup see our guide\\n * https://forum.zeppelin.solutions/t/how-to-implement-erc20-supply-mechanisms/226[How\\n * to implement supply mechanisms].\\n *\\n * We have followed general OpenZeppelin guidelines: functions revert instead\\n * of returning `false` on failure. This behavior is nonetheless conventional\\n * and does not conflict with the expectations of ERC20 applications.\\n *\\n * Additionally, an {Approval} event is emitted on calls to {transferFrom}.\\n * This allows applications to reconstruct the allowance for all accounts just\\n * by listening to said events. Other implementations of the EIP may not emit\\n * these events, as it isn't required by the specification.\\n *\\n * Finally, the non-standard {decreaseAllowance} and {increaseAllowance}\\n * functions have been added to mitigate the well-known issues around setting\\n * allowances. See {IERC20-approve}.\\n */\\ncontract ERC20Upgradeable is Initializable, ContextUpgradeable, IERC20Upgradeable {\\n    using SafeMathUpgradeable for uint256;\\n\\n    mapping (address => uint256) private _balances;\\n\\n    mapping (address => mapping (address => uint256)) private _allowances;\\n\\n    uint256 private _totalSupply;\\n\\n    string private _name;\\n    string private _symbol;\\n    uint8 private _decimals;\\n\\n    /**\\n     * @dev Sets the values for {name} and {symbol}, initializes {decimals} with\\n     * a default value of 18.\\n     *\\n     * To select a different value for {decimals}, use {_setupDecimals}.\\n     *\\n     * All three of these values are immutable: they can only be set once during\\n     * construction.\\n     */\\n    function __ERC20_init(string memory name_, string memory symbol_) internal initializer {\\n        __Context_init_unchained();\\n        __ERC20_init_unchained(name_, symbol_);\\n    }\\n\\n    function __ERC20_init_unchained(string memory name_, string memory symbol_) internal initializer {\\n        _name = name_;\\n        _symbol = symbol_;\\n        _decimals = 18;\\n    }\\n\\n    /**\\n     * @dev Returns the name of the token.\\n     */\\n    function name() public view virtual returns (string memory) {\\n        return _name;\\n    }\\n\\n    /**\\n     * @dev Returns the symbol of the token, usually a shorter version of the\\n     * name.\\n     */\\n    function symbol() public view virtual returns (string memory) {\\n        return _symbol;\\n    }\\n\\n    /**\\n     * @dev Returns the number of decimals used to get its user representation.\\n     * For example, if `decimals` equals `2`, a balance of `505` tokens should\\n     * be displayed to a user as `5,05` (`505 / 10 ** 2`).\\n     *\\n     * Tokens usually opt for a value of 18, imitating the relationship between\\n     * Ether and Wei. This is the value {ERC20} uses, unless {_setupDecimals} is\\n     * called.\\n     *\\n     * NOTE: This information is only used for _display_ purposes: it in\\n     * no way affects any of the arithmetic of the contract, including\\n     * {IERC20-balanceOf} and {IERC20-transfer}.\\n     */\\n    function decimals() public view virtual returns (uint8) {\\n        return _decimals;\\n    }\\n\\n    /**\\n     * @dev See {IERC20-totalSupply}.\\n     */\\n    function totalSupply() public view virtual override returns (uint256) {\\n        return _totalSupply;\\n    }\\n\\n    /**\\n     * @dev See {IERC20-balanceOf}.\\n     */\\n    function balanceOf(address account) public view virtual override returns (uint256) {\\n        return _balances[account];\\n    }\\n\\n    /**\\n     * @dev See {IERC20-transfer}.\\n     *\\n     * Requirements:\\n     *\\n     * - `recipient` cannot be the zero address.\\n     * - the caller must have a balance of at least `amount`.\\n     */\\n    function transfer(address recipient, uint256 amount) public virtual override returns (bool) {\\n        _transfer(_msgSender(), recipient, amount);\\n        return true;\\n    }\\n\\n    /**\\n     * @dev See {IERC20-allowance}.\\n     */\\n    function allowance(address owner, address spender) public view virtual override returns (uint256) {\\n        return _allowances[owner][spender];\\n    }\\n\\n    /**\\n     * @dev See {IERC20-approve}.\\n     *\\n     * Requirements:\\n     *\\n     * - `spender` cannot be the zero address.\\n     */\\n    function approve(address spender, uint256 amount) public virtual override returns (bool) {\\n        _approve(_msgSender(), spender, amount);\\n        return true;\\n    }\\n\\n    /**\\n     * @dev See {IERC20-transferFrom}.\\n     *\\n     * Emits an {Approval} event indicating the updated allowance. This is not\\n     * required by the EIP. See the note at the beginning of {ERC20}.\\n     *\\n     * Requirements:\\n     *\\n     * - `sender` and `recipient` cannot be the zero address.\\n     * - `sender` must have a balance of at least `amount`.\\n     * - the caller must have allowance for ``sender``'s tokens of at least\\n     * `amount`.\\n     */\\n    function transferFrom(address sender, address recipient, uint256 amount) public virtual override returns (bool) {\\n        _transfer(sender, recipient, amount);\\n        _approve(sender, _msgSender(), _allowances[sender][_msgSender()].sub(amount, \\\"ERC20: transfer amount exceeds allowance\\\"));\\n        return true;\\n    }\\n\\n    /**\\n     * @dev Atomically increases the allowance granted to `spender` by the caller.\\n     *\\n     * This is an alternative to {approve} that can be used as a mitigation for\\n     * problems described in {IERC20-approve}.\\n     *\\n     * Emits an {Approval} event indicating the updated allowance.\\n     *\\n     * Requirements:\\n     *\\n     * - `spender` cannot be the zero address.\\n     */\\n    function increaseAllowance(address spender, uint256 addedValue) public virtual returns (bool) {\\n        _approve(_msgSender(), spender, _allowances[_msgSender()][spender].add(addedValue));\\n        return true;\\n    }\\n\\n    /**\\n     * @dev Atomically decreases the allowance granted to `spender` by the caller.\\n     *\\n     * This is an alternative to {approve} that can be used as a mitigation for\\n     * problems described in {IERC20-approve}.\\n     *\\n     * Emits an {Approval} event indicating the updated allowance.\\n     *\\n     * Requirements:\\n     *\\n     * - `spender` cannot be the zero address.\\n     * - `spender` must have allowance for the caller of at least\\n     * `subtractedValue`.\\n     */\\n    function decreaseAllowance(address spender, uint256 subtractedValue) public virtual returns (bool) {\\n        _approve(_msgSender(), spender, _allowances[_msgSender()][spender].sub(subtractedValue, \\\"ERC20: decreased allowance below zero\\\"));\\n        return true;\\n    }\\n\\n    /**\\n     * @dev Moves tokens `amount` from `sender` to `recipient`.\\n     *\\n     * This is internal function is equivalent to {transfer}, and can be used to\\n     * e.g. implement automatic token fees, slashing mechanisms, etc.\\n     *\\n     * Emits a {Transfer} event.\\n     *\\n     * Requirements:\\n     *\\n     * - `sender` cannot be the zero address.\\n     * - `recipient` cannot be the zero address.\\n     * - `sender` must have a balance of at least `amount`.\\n     */\\n    function _transfer(address sender, address recipient, uint256 amount) internal virtual {\\n        require(sender != address(0), \\\"ERC20: transfer from the zero address\\\");\\n        require(recipient != address(0), \\\"ERC20: transfer to the zero address\\\");\\n\\n        _beforeTokenTransfer(sender, recipient, amount);\\n\\n        _balances[sender] = _balances[sender].sub(amount, \\\"ERC20: transfer amount exceeds balance\\\");\\n        _balances[recipient] = _balances[recipient].add(amount);\\n        emit Transfer(sender, recipient, amount);\\n    }\\n\\n    /** @dev Creates `amount` tokens and assigns them to `account`, increasing\\n     * the total supply.\\n     *\\n     * Emits a {Transfer} event with `from` set to the zero address.\\n     *\\n     * Requirements:\\n     *\\n     * - `to` cannot be the zero address.\\n     */\\n    function _mint(address account, uint256 amount) internal virtual {\\n        require(account != address(0), \\\"ERC20: mint to the zero address\\\");\\n\\n        _beforeTokenTransfer(address(0), account, amount);\\n\\n        _totalSupply = _totalSupply.add(amount);\\n        _balances[account] = _balances[account].add(amount);\\n        emit Transfer(address(0), account, amount);\\n    }\\n\\n    /**\\n     * @dev Destroys `amount` tokens from `account`, reducing the\\n     * total supply.\\n     *\\n     * Emits a {Transfer} event with `to` set to the zero address.\\n     *\\n     * Requirements:\\n     *\\n     * - `account` cannot be the zero address.\\n     * - `account` must have at least `amount` tokens.\\n     */\\n    function _burn(address account, uint256 amount) internal virtual {\\n        require(account != address(0), \\\"ERC20: burn from the zero address\\\");\\n\\n        _beforeTokenTransfer(account, address(0), amount);\\n\\n        _balances[account] = _balances[account].sub(amount, \\\"ERC20: burn amount exceeds balance\\\");\\n        _totalSupply = _totalSupply.sub(amount);\\n        emit Transfer(account, address(0), amount);\\n    }\\n\\n    /**\\n     * @dev Sets `amount` as the allowance of `spender` over the `owner` s tokens.\\n     *\\n     * This internal function is equivalent to `approve`, and can be used to\\n     * e.g. set automatic allowances for certain subsystems, etc.\\n     *\\n     * Emits an {Approval} event.\\n     *\\n     * Requirements:\\n     *\\n     * - `owner` cannot be the zero address.\\n     * - `spender` cannot be the zero address.\\n     */\\n    function _approve(address owner, address spender, uint256 amount) internal virtual {\\n        require(owner != address(0), \\\"ERC20: approve from the zero address\\\");\\n        require(spender != address(0), \\\"ERC20: approve to the zero address\\\");\\n\\n        _allowances[owner][spender] = amount;\\n        emit Approval(owner, spender, amount);\\n    }\\n\\n    /**\\n     * @dev Sets {decimals} to a value other than the default one of 18.\\n     *\\n     * WARNING: This function should only be called from the constructor. Most\\n     * applications that interact with token contracts will not expect\\n     * {decimals} to ever change, and may work incorrectly if it does.\\n     */\\n    function _setupDecimals(uint8 decimals_) internal virtual {\\n        _decimals = decimals_;\\n    }\\n\\n    /**\\n     * @dev Hook that is called before any transfer of tokens. This includes\\n     * minting and burning.\\n     *\\n     * Calling conditions:\\n     *\\n     * - when `from` and `to` are both non-zero, `amount` of ``from``'s tokens\\n     * will be to transferred to `to`.\\n     * - when `from` is zero, `amount` tokens will be minted for `to`.\\n     * - when `to` is zero, `amount` of ``from``'s tokens will be burned.\\n     * - `from` and `to` are never both zero.\\n     *\\n     * To learn more about hooks, head to xref:ROOT:extending-contracts.adoc#using-hooks[Using Hooks].\\n     */\\n    function _beforeTokenTransfer(address from, address to, uint256 amount) internal virtual { }\\n    uint256[44] private __gap;\\n}\\n\",\"keccak256\":\"0x506dd0718f9ace50588c13848167df5e04ae16abb56341afb10c31ff149bc79b\",\"license\":\"MIT\"},\"@openzeppelin/contracts-upgradeable/token/ERC20/IERC20Upgradeable.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity >=0.6.0 <0.8.0;\\n\\n/**\\n * @dev Interface of the ERC20 standard as defined in the EIP.\\n */\\ninterface IERC20Upgradeable {\\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 `recipient`.\\n     *\\n     * Returns a boolean value indicating whether the operation succeeded.\\n     *\\n     * Emits a {Transfer} event.\\n     */\\n    function transfer(address recipient, 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 `sender` to `recipient` 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(address sender, address recipient, uint256 amount) external returns (bool);\\n\\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\",\"keccak256\":\"0xa1931c47a617014f858580db625aa0dcf343796f39acd4b5b51effc092a1f0a9\",\"license\":\"MIT\"},\"@openzeppelin/contracts-upgradeable/utils/AddressUpgradeable.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity >=0.6.2 <0.8.0;\\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    function isContract(address account) internal view returns (bool) {\\n        // This method relies on extcodesize, which returns 0 for contracts in\\n        // construction, since the code is only stored at the end of the\\n        // constructor execution.\\n\\n        uint256 size;\\n        // solhint-disable-next-line no-inline-assembly\\n        assembly { size := extcodesize(account) }\\n        return size > 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        // solhint-disable-next-line avoid-low-level-calls, avoid-call-value\\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(address target, bytes memory data, string memory errorMessage) 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(address target, bytes memory data, uint256 value) 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(address target, bytes memory data, uint256 value, string memory errorMessage) 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        // solhint-disable-next-line avoid-low-level-calls\\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(address target, bytes memory data, string memory errorMessage) internal view returns (bytes memory) {\\n        require(isContract(target), \\\"Address: static call to non-contract\\\");\\n\\n        // solhint-disable-next-line avoid-low-level-calls\\n        (bool success, bytes memory returndata) = target.staticcall(data);\\n        return _verifyCallResult(success, returndata, errorMessage);\\n    }\\n\\n    function _verifyCallResult(bool success, bytes memory returndata, string memory errorMessage) private 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                // solhint-disable-next-line no-inline-assembly\\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\":\"0xfc5ea91fa9ceb1961023b2a6c978b902888c52b90847ac7813fe3b79524165f6\",\"license\":\"MIT\"},\"@openzeppelin/contracts-upgradeable/utils/ContextUpgradeable.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity >=0.6.0 <0.8.0;\\nimport \\\"../proxy/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 GSN 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 initializer {\\n        __Context_init_unchained();\\n    }\\n\\n    function __Context_init_unchained() internal initializer {\\n    }\\n    function _msgSender() internal view virtual returns (address payable) {\\n        return msg.sender;\\n    }\\n\\n    function _msgData() internal view virtual returns (bytes memory) {\\n        this; // silence state mutability warning without generating bytecode - see https://github.com/ethereum/solidity/issues/2691\\n        return msg.data;\\n    }\\n    uint256[50] private __gap;\\n}\\n\",\"keccak256\":\"0xbbf8a21b9a66c48d45ff771b8563c6df19ba451d63dfb8380a865c1e1f29d1a0\",\"license\":\"MIT\"},\"@openzeppelin/contracts-upgradeable/utils/CountersUpgradeable.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\n\\npragma solidity >=0.6.0 <0.8.0;\\n\\nimport \\\"../math/SafeMathUpgradeable.sol\\\";\\n\\n/**\\n * @title Counters\\n * @author Matt Condon (@shrugs)\\n * @dev Provides counters that can only be incremented or decremented by one. This can be used e.g. to track the number\\n * of elements in a mapping, issuing ERC721 ids, or counting request ids.\\n *\\n * Include with `using Counters for Counters.Counter;`\\n * Since it is not possible to overflow a 256 bit integer with increments of one, `increment` can skip the {SafeMath}\\n * overflow check, thereby saving gas. This does assume however correct usage, in that the underlying `_value` is never\\n * directly accessed.\\n */\\nlibrary CountersUpgradeable {\\n    using SafeMathUpgradeable for uint256;\\n\\n    struct Counter {\\n        // This variable should never be directly accessed by users of the library: interactions must be restricted to\\n        // the library's function. As of Solidity v0.5.2, this cannot be enforced, though there is a proposal to add\\n        // this feature: see https://github.com/ethereum/solidity/issues/4637\\n        uint256 _value; // default: 0\\n    }\\n\\n    function current(Counter storage counter) internal view returns (uint256) {\\n        return counter._value;\\n    }\\n\\n    function increment(Counter storage counter) internal {\\n        // The {SafeMath} overflow check can be skipped here, see the comment at the top\\n        counter._value += 1;\\n    }\\n\\n    function decrement(Counter storage counter) internal {\\n        counter._value = counter._value.sub(1);\\n    }\\n}\\n\",\"keccak256\":\"0xe0162cc9b4d619790be38ce4c184a1cd33d41698629ae6bcac00049f24f6cce8\",\"license\":\"MIT\"},\"@pooltogether/uniform-random-number/contracts/UniformRandomNumber.sol\":{\"content\":\"/**\\nCopyright 2019 PoolTogether LLC\\n\\nThis file is part of PoolTogether.\\n\\nPoolTogether is free software: you can redistribute it and/or modify\\nit under the terms of the GNU General Public License as published by\\nthe Free Software Foundation under version 3 of the License.\\n\\nPoolTogether is distributed in the hope that it will be useful,\\nbut WITHOUT ANY WARRANTY; without even the implied warranty of\\nMERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\\nGNU General Public License for more details.\\n\\nYou should have received a copy of the GNU General Public License\\nalong with PoolTogether.  If not, see <https://www.gnu.org/licenses/>.\\n*/\\n\\npragma solidity >=0.6.0 <0.8.0;\\n\\n/**\\n * @author Brendan Asselstine\\n * @notice A library that uses entropy to select a random number within a bound.  Compensates for modulo bias.\\n * @dev Thanks to https://medium.com/hownetworks/dont-waste-cycles-with-modulo-bias-35b6fdafcf94\\n */\\nlibrary UniformRandomNumber {\\n  /// @notice Select a random number without modulo bias using a random seed and upper bound\\n  /// @param _entropy The seed for randomness\\n  /// @param _upperBound The upper bound of the desired number\\n  /// @return A random number less than the _upperBound\\n  function uniform(uint256 _entropy, uint256 _upperBound) internal pure returns (uint256) {\\n    require(_upperBound > 0, \\\"UniformRand/min-bound\\\");\\n    uint256 min = -_upperBound % _upperBound;\\n    uint256 random = _entropy;\\n    while (true) {\\n      if (random >= min) {\\n        break;\\n      }\\n      random = uint256(keccak256(abi.encodePacked(random)));\\n    }\\n    return random % _upperBound;\\n  }\\n}\",\"keccak256\":\"0x0d86eb3349d8a9e226ff6f3328a6a79bbf872859a4afbe489051fbf3b8550df4\"},\"contracts/external/openzeppelin/ProxyFactory.sol\":{\"content\":\"pragma solidity 0.6.12;\\n\\n// solium-disable security/no-inline-assembly\\n// solium-disable security/no-low-level-calls\\ncontract ProxyFactory {\\n\\n  event ProxyCreated(address proxy);\\n\\n  function deployMinimal(address _logic, bytes memory _data) public returns (address proxy) {\\n    // Adapted from https://github.com/optionality/clone-factory/blob/32782f82dfc5a00d103a7e61a17a5dedbd1e8e9d/contracts/CloneFactory.sol\\n    bytes20 targetBytes = bytes20(_logic);\\n    assembly {\\n      let clone := mload(0x40)\\n      mstore(clone, 0x3d602d80600a3d3981f3363d3d373d3d3d363d73000000000000000000000000)\\n      mstore(add(clone, 0x14), targetBytes)\\n      mstore(add(clone, 0x28), 0x5af43d82803e903d91602b57fd5bf30000000000000000000000000000000000)\\n      proxy := create(0, clone, 0x37)\\n    }\\n\\n    emit ProxyCreated(address(proxy));\\n\\n    if(_data.length > 0) {\\n      (bool success,) = proxy.call(_data);\\n      require(success, \\\"ProxyFactory/constructor-call-failed\\\");\\n    }\\n  }\\n}\\n\",\"keccak256\":\"0xf0422303985796fdd8bdf772ac8e34331e2e63006f657989cca010fa4776d735\"},\"contracts/token/ControlledToken.sol\":{\"content\":\"// SPDX-License-Identifier: GPL-3.0\\n\\npragma solidity 0.6.12;\\n\\nimport \\\"@openzeppelin/contracts-upgradeable/drafts/ERC20PermitUpgradeable.sol\\\";\\n\\nimport \\\"./TokenControllerInterface.sol\\\";\\nimport \\\"./ControlledTokenInterface.sol\\\";\\n\\n/// @title Controlled ERC20 Token\\n/// @notice ERC20 Tokens with a controller for minting & burning\\ncontract ControlledToken is ERC20PermitUpgradeable, ControlledTokenInterface {\\n\\n  /// @dev Emitted when an instance is initialized\\n  event Initialized(\\n    string _name,\\n    string _symbol,\\n    uint8 _decimals,\\n    TokenControllerInterface _controller\\n  );\\n\\n  /// @notice Interface to the contract responsible for controlling mint/burn\\n  TokenControllerInterface public override controller;\\n\\n  /// @notice Initializes the Controlled Token with Token Details and the Controller\\n  /// @param _name The name of the Token\\n  /// @param _symbol The symbol for the Token\\n  /// @param _decimals The number of decimals for the Token\\n  /// @param _controller Address of the Controller contract for minting & burning\\n  function initialize(\\n    string memory _name,\\n    string memory _symbol,\\n    uint8 _decimals,\\n    TokenControllerInterface _controller\\n  )\\n    public\\n    virtual\\n    initializer\\n  {\\n    require(address(_controller) != address(0), \\\"ControlledToken/controller-not-zero\\\");\\n    __ERC20_init(_name, _symbol);\\n    __ERC20Permit_init(\\\"PoolTogether ControlledToken\\\");\\n    controller = _controller;\\n    _setupDecimals(_decimals);\\n\\n    emit Initialized(\\n      _name,\\n      _symbol,\\n      _decimals,\\n      _controller\\n    );\\n  }\\n\\n  /// @notice Allows the controller to mint tokens for a user account\\n  /// @dev May be overridden to provide more granular control over minting\\n  /// @param _user Address of the receiver of the minted tokens\\n  /// @param _amount Amount of tokens to mint\\n  function controllerMint(address _user, uint256 _amount) external virtual override onlyController {\\n    _mint(_user, _amount);\\n  }\\n\\n  /// @notice Allows the controller to burn tokens from a user account\\n  /// @dev May be overridden to provide more granular control over burning\\n  /// @param _user Address of the holder account to burn tokens from\\n  /// @param _amount Amount of tokens to burn\\n  function controllerBurn(address _user, uint256 _amount) external virtual override onlyController {\\n    _burn(_user, _amount);\\n  }\\n\\n  /// @notice Allows an operator via the controller to burn tokens on behalf of a user account\\n  /// @dev May be overridden to provide more granular control over operator-burning\\n  /// @param _operator Address of the operator performing the burn action via the controller contract\\n  /// @param _user Address of the holder account to burn tokens from\\n  /// @param _amount Amount of tokens to burn\\n  function controllerBurnFrom(address _operator, address _user, uint256 _amount) external virtual override onlyController {\\n    if (_operator != _user) {\\n      uint256 decreasedAllowance = allowance(_user, _operator).sub(_amount, \\\"ControlledToken/exceeds-allowance\\\");\\n      _approve(_user, _operator, decreasedAllowance);\\n    }\\n    _burn(_user, _amount);\\n  }\\n\\n  /// @dev Function modifier to ensure that the caller is the controller contract\\n  modifier onlyController {\\n    require(_msgSender() == address(controller), \\\"ControlledToken/only-controller\\\");\\n    _;\\n  }\\n\\n  /// @dev Controller hook to provide notifications & rule validations on token transfers to the controller.\\n  /// This includes minting and burning.\\n  /// May be overridden to provide more granular control over operator-burning\\n  /// @param from Address of the account sending the tokens (address(0x0) on minting)\\n  /// @param to Address of the account receiving the tokens (address(0x0) on burning)\\n  /// @param amount Amount of tokens being transferred\\n  function _beforeTokenTransfer(address from, address to, uint256 amount) internal virtual override {\\n    controller.beforeTokenTransfer(from, to, amount);\\n  }\\n}\\n\",\"keccak256\":\"0x55f2393331e58b48d9bdb40a09c41704d4e5ac59aaf7fa29dc5d17de08a9363e\",\"license\":\"GPL-3.0\"},\"contracts/token/ControlledTokenInterface.sol\":{\"content\":\"// SPDX-License-Identifier: GPL-3.0\\n\\npragma solidity 0.6.12;\\n\\nimport \\\"@openzeppelin/contracts-upgradeable/token/ERC20/IERC20Upgradeable.sol\\\";\\n\\nimport \\\"./TokenControllerInterface.sol\\\";\\n\\n/// @title Controlled ERC20 Token\\n/// @notice ERC20 Tokens with a controller for minting & burning\\ninterface ControlledTokenInterface is IERC20Upgradeable {\\n\\n  /// @notice Interface to the contract responsible for controlling mint/burn\\n  function controller() external view returns (TokenControllerInterface);\\n\\n  /// @notice Allows the controller to mint tokens for a user account\\n  /// @dev May be overridden to provide more granular control over minting\\n  /// @param _user Address of the receiver of the minted tokens\\n  /// @param _amount Amount of tokens to mint\\n  function controllerMint(address _user, uint256 _amount) external;\\n\\n  /// @notice Allows the controller to burn tokens from a user account\\n  /// @dev May be overridden to provide more granular control over burning\\n  /// @param _user Address of the holder account to burn tokens from\\n  /// @param _amount Amount of tokens to burn\\n  function controllerBurn(address _user, uint256 _amount) external;\\n\\n  /// @notice Allows an operator via the controller to burn tokens on behalf of a user account\\n  /// @dev May be overridden to provide more granular control over operator-burning\\n  /// @param _operator Address of the operator performing the burn action via the controller contract\\n  /// @param _user Address of the holder account to burn tokens from\\n  /// @param _amount Amount of tokens to burn\\n  function controllerBurnFrom(address _operator, address _user, uint256 _amount) external;\\n}\\n\",\"keccak256\":\"0x13d454412d09227357e89355d7803149663982634aab16e3d5e35b3ebd34a851\",\"license\":\"GPL-3.0\"},\"contracts/token/Ticket.sol\":{\"content\":\"// SPDX-License-Identifier: GPL-3.0\\n\\npragma solidity 0.6.12;\\n\\nimport \\\"sortition-sum-tree-factory/contracts/SortitionSumTreeFactory.sol\\\";\\nimport \\\"@pooltogether/uniform-random-number/contracts/UniformRandomNumber.sol\\\";\\n\\nimport \\\"./ControlledToken.sol\\\";\\nimport \\\"./TicketInterface.sol\\\";\\n\\ncontract Ticket is ControlledToken, TicketInterface {\\n  using SortitionSumTreeFactory for SortitionSumTreeFactory.SortitionSumTrees;\\n\\n  bytes32 constant private TREE_KEY = keccak256(\\\"PoolTogether/Ticket\\\");\\n  uint256 constant private MAX_TREE_LEAVES = 5;\\n\\n  /// @dev Emitted when an instance is initialized\\n  event Initialized(\\n    string _name,\\n    string _symbol,\\n    uint8 _decimals,\\n    TokenControllerInterface _controller\\n  );\\n\\n  // Ticket-weighted odds\\n  SortitionSumTreeFactory.SortitionSumTrees internal sortitionSumTrees;\\n\\n  /// @notice Initializes the Controlled Token with Token Details and the Controller\\n  /// @param _name The name of the Token\\n  /// @param _symbol The symbol for the Token\\n  /// @param _decimals The number of decimals for the Token\\n  /// @param _controller Address of the Controller contract for minting & burning\\n  function initialize(\\n    string memory _name,\\n    string memory _symbol,\\n    uint8 _decimals,\\n    TokenControllerInterface _controller\\n  )\\n    public\\n    virtual\\n    override\\n    initializer\\n  {\\n    require(address(_controller) != address(0), \\\"Ticket/controller-not-zero\\\");\\n    ControlledToken.initialize(_name, _symbol, _decimals, _controller);\\n    sortitionSumTrees.createTree(TREE_KEY, MAX_TREE_LEAVES);\\n    emit Initialized(\\n      _name,\\n      _symbol,\\n      _decimals,\\n      _controller\\n    );\\n  }\\n\\n  /// @notice Returns the user's chance of winning.\\n  function chanceOf(address user) external view returns (uint256) {\\n    return sortitionSumTrees.stakeOf(TREE_KEY, bytes32(uint256(user)));\\n  }\\n\\n  /// @notice Selects a user using a random number.  The random number will be uniformly bounded to the ticket totalSupply.\\n  /// @param randomNumber The random number to use to select a user.\\n  /// @return The winner\\n  function draw(uint256 randomNumber) external view override returns (address) {\\n    uint256 bound = totalSupply();\\n    address selected;\\n    if (bound == 0) {\\n      selected = address(0);\\n    } else {\\n      uint256 token = UniformRandomNumber.uniform(randomNumber, bound);\\n      selected = address(uint256(sortitionSumTrees.draw(TREE_KEY, token)));\\n    }\\n    return selected;\\n  }\\n\\n  /// @dev Controller hook to provide notifications & rule validations on token transfers to the controller.\\n  /// This includes minting and burning.\\n  /// May be overridden to provide more granular control over operator-burning\\n  /// @param from Address of the account sending the tokens (address(0x0) on minting)\\n  /// @param to Address of the account receiving the tokens (address(0x0) on burning)\\n  /// @param amount Amount of tokens being transferred\\n  function _beforeTokenTransfer(address from, address to, uint256 amount) internal virtual override {\\n    super._beforeTokenTransfer(from, to, amount);\\n\\n    // optimize: ignore transfers to self\\n    if (from == to) {\\n      return;\\n    }\\n\\n    if (from != address(0)) {\\n      uint256 fromBalance = balanceOf(from).sub(amount);\\n      sortitionSumTrees.set(TREE_KEY, fromBalance, bytes32(uint256(from)));\\n    }\\n\\n    if (to != address(0)) {\\n      uint256 toBalance = balanceOf(to).add(amount);\\n      sortitionSumTrees.set(TREE_KEY, toBalance, bytes32(uint256(to)));\\n    }\\n  }\\n\\n}\",\"keccak256\":\"0xf659dcfda626c713b7dd64525476d282e141163977edd881b647e83f505c4044\",\"license\":\"GPL-3.0\"},\"contracts/token/TicketInterface.sol\":{\"content\":\"// SPDX-License-Identifier: GPL-3.0\\n\\npragma solidity >=0.5.0 <0.7.0;\\n\\n/// @title Interface that allows a user to draw an address using an index\\ninterface TicketInterface {\\n  /// @notice Selects a user using a random number.  The random number will be uniformly bounded to the ticket totalSupply.\\n  /// @param randomNumber The random number to use to select a user.\\n  /// @return The winner\\n  function draw(uint256 randomNumber) external view returns (address);\\n}\",\"keccak256\":\"0x5201a9a22748781592abd2003801289224d4899292195b7de937cd5748be87dd\",\"license\":\"GPL-3.0\"},\"contracts/token/TicketProxyFactory.sol\":{\"content\":\"// SPDX-License-Identifier: GPL-3.0\\n\\npragma solidity 0.6.12;\\n\\nimport \\\"@openzeppelin/contracts-upgradeable/proxy/Initializable.sol\\\";\\n\\nimport \\\"./Ticket.sol\\\";\\nimport \\\"../external/openzeppelin/ProxyFactory.sol\\\";\\n\\n/// @title Controlled ERC20 Token Factory\\n/// @notice Minimal proxy pattern for creating new Controlled ERC20 Tokens\\ncontract TicketProxyFactory is ProxyFactory {\\n\\n  /// @notice Contract template for deploying proxied tokens\\n  Ticket public instance;\\n\\n  /// @notice Initializes the Factory with an instance of the Controlled ERC20 Token\\n  constructor () public {\\n    instance = new Ticket();\\n  }\\n\\n  /// @notice Creates a new Controlled ERC20 Token as a proxy of the template instance\\n  /// @return A reference to the new proxied Controlled ERC20 Token\\n  function create() external returns (Ticket) {\\n    return Ticket(deployMinimal(address(instance), \\\"\\\"));\\n  }\\n}\\n\",\"keccak256\":\"0xb68f1cd27e8caaab3f69d6ccd14e70ff2d7c3685c9c45733f62690087833410e\",\"license\":\"GPL-3.0\"},\"contracts/token/TokenControllerInterface.sol\":{\"content\":\"// SPDX-License-Identifier: GPL-3.0\\n\\npragma solidity >=0.5.0 <0.7.0;\\n\\n/// @title Controlled ERC20 Token Interface\\n/// @notice Required interface for Controlled ERC20 Tokens linked to a Prize Pool\\n/// @dev Defines the spec required to be implemented by a Controlled ERC20 Token\\ninterface TokenControllerInterface {\\n\\n  /// @dev Controller hook to provide notifications & rule validations on token transfers to the controller.\\n  /// This includes minting and burning.\\n  /// @param from Address of the account sending the tokens (address(0x0) on minting)\\n  /// @param to Address of the account receiving the tokens (address(0x0) on burning)\\n  /// @param amount Amount of tokens being transferred\\n  function beforeTokenTransfer(address from, address to, uint256 amount) external;\\n}\\n\",\"keccak256\":\"0x5dd2346b0d9616b15bfad6bd8dab3a34ad41aa77a5d0c5f4c1b54c0d5009b77f\",\"license\":\"GPL-3.0\"},\"sortition-sum-tree-factory/contracts/SortitionSumTreeFactory.sol\":{\"content\":\"/**\\n *  @reviewers: [@clesaege, @unknownunknown1, @ferittuncer]\\n *  @auditors: []\\n *  @bounties: [<14 days 10 ETH max payout>]\\n *  @deployments: []\\n */\\n\\npragma solidity ^0.6.0;\\n\\n/**\\n *  @title SortitionSumTreeFactory\\n *  @author Enrique Piqueras - <epiquerass@gmail.com>\\n *  @dev A factory of trees that keep track of staked values for sortition.\\n */\\nlibrary SortitionSumTreeFactory {\\n    /* Structs */\\n\\n    struct SortitionSumTree {\\n        uint K; // The maximum number of childs per node.\\n        // We use this to keep track of vacant positions in the tree after removing a leaf. This is for keeping the tree as balanced as possible without spending gas on moving nodes around.\\n        uint[] stack;\\n        uint[] nodes;\\n        // Two-way mapping of IDs to node indexes. Note that node index 0 is reserved for the root node, and means the ID does not have a node.\\n        mapping(bytes32 => uint) IDsToNodeIndexes;\\n        mapping(uint => bytes32) nodeIndexesToIDs;\\n    }\\n\\n    /* Storage */\\n\\n    struct SortitionSumTrees {\\n        mapping(bytes32 => SortitionSumTree) sortitionSumTrees;\\n    }\\n\\n    /* internal */\\n\\n    /**\\n     *  @dev Create a sortition sum tree at the specified key.\\n     *  @param _key The key of the new tree.\\n     *  @param _K The number of children each node in the tree should have.\\n     */\\n    function createTree(SortitionSumTrees storage self, bytes32 _key, uint _K) internal {\\n        SortitionSumTree storage tree = self.sortitionSumTrees[_key];\\n        require(tree.K == 0, \\\"Tree already exists.\\\");\\n        require(_K > 1, \\\"K must be greater than one.\\\");\\n        tree.K = _K;\\n        tree.stack = new uint[](0);\\n        tree.nodes = new uint[](0);\\n        tree.nodes.push(0);\\n    }\\n\\n    /**\\n     *  @dev Set a value of a tree.\\n     *  @param _key The key of the tree.\\n     *  @param _value The new value.\\n     *  @param _ID The ID of the value.\\n     *  `O(log_k(n))` where\\n     *  `k` is the maximum number of childs per node in the tree,\\n     *   and `n` is the maximum number of nodes ever appended.\\n     */\\n    function set(SortitionSumTrees storage self, bytes32 _key, uint _value, bytes32 _ID) internal {\\n        SortitionSumTree storage tree = self.sortitionSumTrees[_key];\\n        uint treeIndex = tree.IDsToNodeIndexes[_ID];\\n\\n        if (treeIndex == 0) { // No existing node.\\n            if (_value != 0) { // Non zero value.\\n                // Append.\\n                // Add node.\\n                if (tree.stack.length == 0) { // No vacant spots.\\n                    // Get the index and append the value.\\n                    treeIndex = tree.nodes.length;\\n                    tree.nodes.push(_value);\\n\\n                    // Potentially append a new node and make the parent a sum node.\\n                    if (treeIndex != 1 && (treeIndex - 1) % tree.K == 0) { // Is first child.\\n                        uint parentIndex = treeIndex / tree.K;\\n                        bytes32 parentID = tree.nodeIndexesToIDs[parentIndex];\\n                        uint newIndex = treeIndex + 1;\\n                        tree.nodes.push(tree.nodes[parentIndex]);\\n                        delete tree.nodeIndexesToIDs[parentIndex];\\n                        tree.IDsToNodeIndexes[parentID] = newIndex;\\n                        tree.nodeIndexesToIDs[newIndex] = parentID;\\n                    }\\n                } else { // Some vacant spot.\\n                    // Pop the stack and append the value.\\n                    treeIndex = tree.stack[tree.stack.length - 1];\\n                    tree.stack.pop();\\n                    tree.nodes[treeIndex] = _value;\\n                }\\n\\n                // Add label.\\n                tree.IDsToNodeIndexes[_ID] = treeIndex;\\n                tree.nodeIndexesToIDs[treeIndex] = _ID;\\n\\n                updateParents(self, _key, treeIndex, true, _value);\\n            }\\n        } else { // Existing node.\\n            if (_value == 0) { // Zero value.\\n                // Remove.\\n                // Remember value and set to 0.\\n                uint value = tree.nodes[treeIndex];\\n                tree.nodes[treeIndex] = 0;\\n\\n                // Push to stack.\\n                tree.stack.push(treeIndex);\\n\\n                // Clear label.\\n                delete tree.IDsToNodeIndexes[_ID];\\n                delete tree.nodeIndexesToIDs[treeIndex];\\n\\n                updateParents(self, _key, treeIndex, false, value);\\n            } else if (_value != tree.nodes[treeIndex]) { // New, non zero value.\\n                // Set.\\n                bool plusOrMinus = tree.nodes[treeIndex] <= _value;\\n                uint plusOrMinusValue = plusOrMinus ? _value - tree.nodes[treeIndex] : tree.nodes[treeIndex] - _value;\\n                tree.nodes[treeIndex] = _value;\\n\\n                updateParents(self, _key, treeIndex, plusOrMinus, plusOrMinusValue);\\n            }\\n        }\\n    }\\n\\n    /* internal Views */\\n\\n    /**\\n     *  @dev Query the leaves of a tree. Note that if `startIndex == 0`, the tree is empty and the root node will be returned.\\n     *  @param _key The key of the tree to get the leaves from.\\n     *  @param _cursor The pagination cursor.\\n     *  @param _count The number of items to return.\\n     *  @return startIndex The index at which leaves start\\n     *  @return values The values of the returned leaves\\n     *  @return hasMore Whether there are more for pagination.\\n     *  `O(n)` where\\n     *  `n` is the maximum number of nodes ever appended.\\n     */\\n    function queryLeafs(\\n        SortitionSumTrees storage self,\\n        bytes32 _key,\\n        uint _cursor,\\n        uint _count\\n    ) internal view returns(uint startIndex, uint[] memory values, bool hasMore) {\\n        SortitionSumTree storage tree = self.sortitionSumTrees[_key];\\n\\n        // Find the start index.\\n        for (uint i = 0; i < tree.nodes.length; i++) {\\n            if ((tree.K * i) + 1 >= tree.nodes.length) {\\n                startIndex = i;\\n                break;\\n            }\\n        }\\n\\n        // Get the values.\\n        uint loopStartIndex = startIndex + _cursor;\\n        values = new uint[](loopStartIndex + _count > tree.nodes.length ? tree.nodes.length - loopStartIndex : _count);\\n        uint valuesIndex = 0;\\n        for (uint j = loopStartIndex; j < tree.nodes.length; j++) {\\n            if (valuesIndex < _count) {\\n                values[valuesIndex] = tree.nodes[j];\\n                valuesIndex++;\\n            } else {\\n                hasMore = true;\\n                break;\\n            }\\n        }\\n    }\\n\\n    /**\\n     *  @dev Draw an ID from a tree using a number. Note that this function reverts if the sum of all values in the tree is 0.\\n     *  @param _key The key of the tree.\\n     *  @param _drawnNumber The drawn number.\\n     *  @return ID The drawn ID.\\n     *  `O(k * log_k(n))` where\\n     *  `k` is the maximum number of childs per node in the tree,\\n     *   and `n` is the maximum number of nodes ever appended.\\n     */\\n    function draw(SortitionSumTrees storage self, bytes32 _key, uint _drawnNumber) internal view returns(bytes32 ID) {\\n        SortitionSumTree storage tree = self.sortitionSumTrees[_key];\\n        uint treeIndex = 0;\\n        uint currentDrawnNumber = _drawnNumber % tree.nodes[0];\\n\\n        while ((tree.K * treeIndex) + 1 < tree.nodes.length)  // While it still has children.\\n            for (uint i = 1; i <= tree.K; i++) { // Loop over children.\\n                uint nodeIndex = (tree.K * treeIndex) + i;\\n                uint nodeValue = tree.nodes[nodeIndex];\\n\\n                if (currentDrawnNumber >= nodeValue) currentDrawnNumber -= nodeValue; // Go to the next child.\\n                else { // Pick this child.\\n                    treeIndex = nodeIndex;\\n                    break;\\n                }\\n            }\\n        \\n        ID = tree.nodeIndexesToIDs[treeIndex];\\n    }\\n\\n    /** @dev Gets a specified ID's associated value.\\n     *  @param _key The key of the tree.\\n     *  @param _ID The ID of the value.\\n     *  @return value The associated value.\\n     */\\n    function stakeOf(SortitionSumTrees storage self, bytes32 _key, bytes32 _ID) internal view returns(uint value) {\\n        SortitionSumTree storage tree = self.sortitionSumTrees[_key];\\n        uint treeIndex = tree.IDsToNodeIndexes[_ID];\\n\\n        if (treeIndex == 0) value = 0;\\n        else value = tree.nodes[treeIndex];\\n    }\\n\\n    function total(SortitionSumTrees storage self, bytes32 _key) internal view returns (uint) {\\n        SortitionSumTree storage tree = self.sortitionSumTrees[_key];\\n        if (tree.nodes.length == 0) {\\n            return 0;\\n        } else {\\n            return tree.nodes[0];\\n        }\\n    }\\n\\n    /* Private */\\n\\n    /**\\n     *  @dev Update all the parents of a node.\\n     *  @param _key The key of the tree to update.\\n     *  @param _treeIndex The index of the node to start from.\\n     *  @param _plusOrMinus Wether to add (true) or substract (false).\\n     *  @param _value The value to add or substract.\\n     *  `O(log_k(n))` where\\n     *  `k` is the maximum number of childs per node in the tree,\\n     *   and `n` is the maximum number of nodes ever appended.\\n     */\\n    function updateParents(SortitionSumTrees storage self, bytes32 _key, uint _treeIndex, bool _plusOrMinus, uint _value) private {\\n        SortitionSumTree storage tree = self.sortitionSumTrees[_key];\\n\\n        uint parentIndex = _treeIndex;\\n        while (parentIndex != 0) {\\n            parentIndex = (parentIndex - 1) / tree.K;\\n            tree.nodes[parentIndex] = _plusOrMinus ? tree.nodes[parentIndex] + _value : tree.nodes[parentIndex] - _value;\\n        }\\n    }\\n}\\n\",\"keccak256\":\"0xa20ece2e1ddeaa6432549a7c38cd02594000b93a54b92399b89bae0dd76dbc7e\"}},\"version\":1}",
  "bytecode": "0x608060405234801561001057600080fd5b5060405161001d9061005f565b604051809103906000f080158015610039573d6000803e3d6000fd5b50600080546001600160a01b0319166001600160a01b039290921691909117905561006c565b6127d4806103b283390190565b6103378061007b6000396000f3fe608060405234801561001057600080fd5b50600436106100415760003560e01c8063022ec09514610046578063b3eeb5e21461006a578063efc81a8c14610120575b600080fd5b61004e610128565b604080516001600160a01b039092168252519081900360200190f35b61004e6004803603604081101561008057600080fd5b6001600160a01b0382351691908101906040810160208201356401000000008111156100ab57600080fd5b8201836020820111156100bd57600080fd5b803590602001918460018302840111640100000000831117156100df57600080fd5b91908080601f016020809104026020016040519081016040528093929190818152602001838380828437600092019190915250929550610137945050505050565b61004e6102b3565b6000546001600160a01b031681565b6000808360601b9050604051733d602d80600a3d3981f3363d3d373d3d3d363d7360601b81528160148201526e5af43d82803e903d91602b57fd5bf360881b60288201526037816000f0604080516001600160a01b038316815290519194507efffc2da0b561cae30d9826d37709e9421c4725faebc226cbbb7ef5fc5e7349925081900360200190a18251156102ac576000826001600160a01b0316846040518082805190602001908083835b602083106102035780518252601f1990920191602091820191016101e4565b6001836020036101000a0380198251168184511680821785525050505050509050019150506000604051808303816000865af19150503d8060008114610265576040519150601f19603f3d011682016040523d82523d6000602084013e61026a565b606091505b50509050806102aa5760405162461bcd60e51b81526004018080602001828103825260248152602001806102de6024913960400191505060405180910390fd5b505b5092915050565b6000805460408051602081019091528281526102d8916001600160a01b031690610137565b90509056fe50726f7879466163746f72792f636f6e7374727563746f722d63616c6c2d6661696c6564a26469706673582212205ae3412cec8c2db03f6c7ec02aac9a02672e7d53a07498e960daa42ca4a37a2564736f6c634300060c0033608060405234801561001057600080fd5b506127b4806100206000396000f3fe608060405234801561001057600080fd5b50600436106101375760003560e01c806370a08231116100b8578063a457c2d71161007c578063a457c2d7146103de578063a9059cbb1461040a578063d505accf14610436578063dd62ed3e14610487578063de7ea79d146104b5578063f77c4791146105f357610137565b806370a08231146103385780637ecebe001461035e578063885d194d1461038457806390596dd1146103aa57806395d89b41146103d657610137565b80633644e515116100ff5780633644e51514610267578063395093511461026f5780633b3041471461029b5780635d7b0758146102d4578063631b5dfb1461030257610137565b806306fdde031461013c578063095ea7b3146101b957806318160ddd146101f957806323b872dd14610213578063313ce56714610249575b600080fd5b6101446105fb565b6040805160208082528351818301528351919283929083019185019080838360005b8381101561017e578181015183820152602001610166565b50505050905090810190601f1680156101ab5780820380516001836020036101000a031916815260200191505b509250505060405180910390f35b6101e5600480360360408110156101cf57600080fd5b506001600160a01b038135169060200135610691565b604080519115158252519081900360200190f35b6102016106ae565b60408051918252519081900360200190f35b6101e56004803603606081101561022957600080fd5b506001600160a01b038135811691602081013590911690604001356106b4565b61025161073b565b6040805160ff9092168252519081900360200190f35b610201610744565b6101e56004803603604081101561028557600080fd5b506001600160a01b038135169060200135610753565b6102b8600480360360208110156102b157600080fd5b50356107a1565b604080516001600160a01b039092168252519081900360200190f35b610300600480360360408110156102ea57600080fd5b506001600160a01b0381351690602001356107f0565b005b6103006004803603606081101561031857600080fd5b506001600160a01b0381358116916020810135909116906040013561086d565b6102016004803603602081101561034e57600080fd5b50356001600160a01b0316610943565b6102016004803603602081101561037457600080fd5b50356001600160a01b031661095e565b6102016004803603602081101561039a57600080fd5b50356001600160a01b0316610985565b610300600480360360408110156103c057600080fd5b506001600160a01b0381351690602001356109aa565b610144610a23565b6101e5600480360360408110156103f457600080fd5b506001600160a01b038135169060200135610a84565b6101e56004803603604081101561042057600080fd5b506001600160a01b038135169060200135610aec565b610300600480360360e081101561044c57600080fd5b506001600160a01b03813581169160208101359091169060408101359060608101359060ff6080820135169060a08101359060c00135610b00565b6102016004803603604081101561049d57600080fd5b506001600160a01b0381358116916020013516610ca3565b610300600480360360808110156104cb57600080fd5b8101906020810181356401000000008111156104e657600080fd5b8201836020820111156104f857600080fd5b8035906020019184600183028401116401000000008311171561051a57600080fd5b91908080601f016020809104026020016040519081016040528093929190818152602001838380828437600092019190915250929594936020810193503591505064010000000081111561056d57600080fd5b82018360208201111561057f57600080fd5b803590602001918460018302840111640100000000831117156105a157600080fd5b91908080601f0160208091040260200160405190810160405280939291908181526020018383808284376000920191909152509295505050813560ff16925050602001356001600160a01b0316610cce565b6102b8610f12565b60368054604080516020601f60026000196101006001881615020190951694909404938401819004810282018101909252828152606093909290918301828280156106875780601f1061065c57610100808354040283529160200191610687565b820191906000526020600020905b81548152906001019060200180831161066a57829003601f168201915b5050505050905090565b60006106a561069e610f21565b8484610f25565b50600192915050565b60355490565b60006106c1848484611011565b610731846106cd610f21565b61072c85604051806060016040528060288152602001612684602891396001600160a01b038a1660009081526034602052604081209061070b610f21565b6001600160a01b03168152602081019190915260400160002054919061116e565b610f25565b5060019392505050565b60385460ff1690565b600061074e611205565b905090565b60006106a5610760610f21565b8461072c8560346000610771610f21565b6001600160a01b03908116825260208083019390935260409182016000908120918c168152925290205490611240565b6000806107ac6106ae565b90506000816107bd575060006107e9565b60006107c9858461129a565b90506107e560cd60008051602061266483398151915283611340565b9150505b9392505050565b60cc546001600160a01b0316610804610f21565b6001600160a01b03161461085f576040805162461bcd60e51b815260206004820152601f60248201527f436f6e74726f6c6c6564546f6b656e2f6f6e6c792d636f6e74726f6c6c657200604482015290519081900360640190fd5b6108698282611403565b5050565b60cc546001600160a01b0316610881610f21565b6001600160a01b0316146108dc576040805162461bcd60e51b815260206004820152601f60248201527f436f6e74726f6c6c6564546f6b656e2f6f6e6c792d636f6e74726f6c6c657200604482015290519081900360640190fd5b816001600160a01b0316836001600160a01b031614610934576000610925826040518060600160405280602181526020016126ac6021913961091e8688610ca3565b919061116e565b9050610932838583610f25565b505b61093e82826114f5565b505050565b6001600160a01b031660009081526033602052604090205490565b6001600160a01b038116600090815260996020526040812061097f906115f1565b92915050565b600061097f60cd6000805160206126648339815191526001600160a01b0385166115f5565b60cc546001600160a01b03166109be610f21565b6001600160a01b031614610a19576040805162461bcd60e51b815260206004820152601f60248201527f436f6e74726f6c6c6564546f6b656e2f6f6e6c792d636f6e74726f6c6c657200604482015290519081900360640190fd5b61086982826114f5565b60378054604080516020601f60026000196101006001881615020190951694909404938401819004810282018101909252828152606093909290918301828280156106875780601f1061065c57610100808354040283529160200191610687565b60006106a5610a91610f21565b8461072c8560405180606001604052806025815260200161275a6025913960346000610abb610f21565b6001600160a01b03908116825260208083019390935260409182016000908120918d1681529252902054919061116e565b60006106a5610af9610f21565b8484611011565b83421115610b55576040805162461bcd60e51b815260206004820152601d60248201527f45524332305065726d69743a206578706972656420646561646c696e65000000604482015290519081900360640190fd5b6000609a54888888610b8a609960008e6001600160a01b03166001600160a01b031681526020019081526020016000206115f1565b8960405160200180878152602001866001600160a01b03168152602001856001600160a01b0316815260200184815260200183815260200182815260200196505050505050506040516020818303038152906040528051906020012090506000610bf382611645565b90506000610c0382878787611691565b9050896001600160a01b0316816001600160a01b031614610c6b576040805162461bcd60e51b815260206004820152601e60248201527f45524332305065726d69743a20696e76616c6964207369676e61747572650000604482015290519081900360640190fd5b6001600160a01b038a166000908152609960205260409020610c8c9061180f565b610c978a8a8a610f25565b50505050505050505050565b6001600160a01b03918216600090815260346020908152604080832093909416825291909152205490565b600054610100900460ff1680610ce75750610ce7611818565b80610cf5575060005460ff16155b610d305760405162461bcd60e51b815260040180806020018281038252602e815260200180612614602e913960400191505060405180910390fd5b600054610100900460ff16158015610d5b576000805460ff1961ff0019909116610100171660011790555b6001600160a01b038216610db6576040805162461bcd60e51b815260206004820152601a60248201527f5469636b65742f636f6e74726f6c6c65722d6e6f742d7a65726f000000000000604482015290519081900360640190fd5b610dc285858585611829565b610ddd60cd6000805160206126648339815191526005611967565b7f41bc1176d7b9b7bc036f385a7e5b08b0662a7afa0844af8a599ad431150227e1858585856040518080602001806020018560ff168152602001846001600160a01b03168152602001838103835287818151815260200191508051906020019080838360005b83811015610e5b578181015183820152602001610e43565b50505050905090810190601f168015610e885780820380516001836020036101000a031916815260200191505b50838103825286518152865160209182019188019080838360005b83811015610ebb578181015183820152602001610ea3565b50505050905090810190601f168015610ee85780820380516001836020036101000a031916815260200191505b50965050505050505060405180910390a18015610f0b576000805461ff00191690555b5050505050565b60cc546001600160a01b031681565b3390565b6001600160a01b038316610f6a5760405162461bcd60e51b81526004018080602001828103825260248152602001806127136024913960400191505060405180910390fd5b6001600160a01b038216610faf5760405162461bcd60e51b81526004018080602001828103825260228152602001806125aa6022913960400191505060405180910390fd5b6001600160a01b03808416600081815260346020908152604080832094871680845294825291829020859055815185815291517f8c5be1e5ebec7d5bd14f71427d1e84f3dd0314c0f7b2291e5b200ac8c7c3b9259281900390910190a3505050565b6001600160a01b0383166110565760405162461bcd60e51b81526004018080602001828103825260258152602001806126ee6025913960400191505060405180910390fd5b6001600160a01b03821661109b5760405162461bcd60e51b81526004018080602001828103825260238152602001806125656023913960400191505060405180910390fd5b6110a6838383611a73565b6110e3816040518060600160405280602681526020016125cc602691396001600160a01b038616600090815260336020526040902054919061116e565b6001600160a01b0380851660009081526033602052604080822093909355908416815220546111129082611240565b6001600160a01b0380841660008181526033602090815260409182902094909455805185815290519193928716927fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef92918290030190a3505050565b600081848411156111fd5760405162461bcd60e51b81526004018080602001828103825283818151815260200191508051906020019080838360005b838110156111c25781810151838201526020016111aa565b50505050905090810190601f1680156111ef5780820380516001836020036101000a031916815260200191505b509250505060405180910390fd5b505050900390565b600061074e7f8b73c3c69bb8fe3d512ecc4cf759cc79239f7b179b0ffacaa9a75d522b39400f611233611b39565b61123b611b3f565b611b45565b6000828201838110156107e9576040805162461bcd60e51b815260206004820152601b60248201527f536166654d6174683a206164646974696f6e206f766572666c6f770000000000604482015290519081900360640190fd5b60008082116112e8576040805162461bcd60e51b8152602060048201526015602482015274155b9a599bdc9b54985b990bdb5a5b8b589bdd5b99605a1b604482015290519081900360640190fd5b60008283600003816112f657fe5b069050835b8181106113075761132d565b6040805160208082019390935281518082038401815290820190915280519101206112fb565b83818161133657fe5b0695945050505050565b600082815260208490526040812060028101805483918291829061136057fe5b9060005260206000200154858161137357fe5b0690505b60028301548354830260010110156113e85760015b835481116113e2576000818486600001540201905060008560020182815481106113b257fe5b906000526020600020015490508084106113d05780840393506113d8565b5092506113e2565b505060010161138c565b50611377565b50600090815260049091016020526040902054949350505050565b6001600160a01b03821661145e576040805162461bcd60e51b815260206004820152601f60248201527f45524332303a206d696e7420746f20746865207a65726f206164647265737300604482015290519081900360640190fd5b61146a60008383611a73565b6035546114779082611240565b6035556001600160a01b03821660009081526033602052604090205461149d9082611240565b6001600160a01b03831660008181526033602090815260408083209490945583518581529351929391927fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef9281900390910190a35050565b6001600160a01b03821661153a5760405162461bcd60e51b81526004018080602001828103825260218152602001806126cd6021913960400191505060405180910390fd5b61154682600083611a73565b61158381604051806060016040528060228152602001612588602291396001600160a01b038516600090815260336020526040902054919061116e565b6001600160a01b0383166000908152603360205260409020556035546115a99082611ba7565b6035556040805182815290516000916001600160a01b038516917fddf252ad1be2c89b69c2b068fc378daa952ba7f163c4a11628f55a4df523b3ef9181900360200190a35050565b5490565b600082815260208481526040808320848452600381019092528220548061161f576000925061163c565b81600201818154811061162e57fe5b906000526020600020015492505b50509392505050565b600061164f611205565b82604051602001808061190160f01b81525060020183815260200182815260200192505050604051602081830303815290604052805190602001209050919050565b60007f7fffffffffffffffffffffffffffffff5d576e7357a4501ddfe92f46681b20a08211156116f25760405162461bcd60e51b81526004018080602001828103825260228152602001806125f26022913960400191505060405180910390fd5b8360ff16601b148061170757508360ff16601c145b6117425760405162461bcd60e51b81526004018080602001828103825260228152602001806126426022913960400191505060405180910390fd5b600060018686868660405160008152602001604052604051808581526020018460ff1681526020018381526020018281526020019450505050506020604051602081039080840390855afa15801561179e573d6000803e3d6000fd5b5050604051601f1901519150506001600160a01b038116611806576040805162461bcd60e51b815260206004820152601860248201527f45434453413a20696e76616c6964207369676e61747572650000000000000000604482015290519081900360640190fd5b95945050505050565b80546001019055565b600061182330611c04565b15905090565b600054610100900460ff16806118425750611842611818565b80611850575060005460ff16155b61188b5760405162461bcd60e51b815260040180806020018281038252602e815260200180612614602e913960400191505060405180910390fd5b600054610100900460ff161580156118b6576000805460ff1961ff0019909116610100171660011790555b6001600160a01b0382166118fb5760405162461bcd60e51b81526004018080602001828103825260238152602001806127376023913960400191505060405180910390fd5b6119058585611c0a565b6119436040518060400160405280601c81526020017f506f6f6c546f67657468657220436f6e74726f6c6c6564546f6b656e00000000815250611cbf565b60cc80546001600160a01b0319166001600160a01b038416179055610ddd83611d95565b60008281526020849052604090208054156119c0576040805162461bcd60e51b81526020600482015260146024820152732a3932b29030b63932b0b23c9032bc34b9ba399760611b604482015290519081900360640190fd5b60018211611a15576040805162461bcd60e51b815260206004820152601b60248201527f4b206d7573742062652067726561746572207468616e206f6e652e0000000000604482015290519081900360640190fd5b8181556040805160008152602081019182905251611a37916001840191612497565b506040805160008152602081019182905251611a57916002840191612497565b5060020180546001810182556000918252602082200155505050565b611a7e838383611dab565b816001600160a01b0316836001600160a01b03161415611a9d5761093e565b6001600160a01b03831615611ae9576000611ac182611abb86610943565b90611ba7565b9050611ae760cd600080516020612664833981519152836001600160a01b038816611e25565b505b6001600160a01b0382161561093e576000611b0d82611b0785610943565b90611240565b9050611b3360cd600080516020612664833981519152836001600160a01b038716611e25565b50505050565b60655490565b60665490565b6000838383611b52612109565b3060405160200180868152602001858152602001848152602001838152602001826001600160a01b03168152602001955050505050506040516020818303038152906040528051906020012090509392505050565b600082821115611bfe576040805162461bcd60e51b815260206004820152601e60248201527f536166654d6174683a207375627472616374696f6e206f766572666c6f770000604482015290519081900360640190fd5b50900390565b3b151590565b600054610100900460ff1680611c235750611c23611818565b80611c31575060005460ff16155b611c6c5760405162461bcd60e51b815260040180806020018281038252602e815260200180612614602e913960400191505060405180910390fd5b600054610100900460ff16158015611c97576000805460ff1961ff0019909116610100171660011790555b611c9f61210d565b611ca983836121af565b801561093e576000805461ff0019169055505050565b600054610100900460ff1680611cd85750611cd8611818565b80611ce6575060005460ff16155b611d215760405162461bcd60e51b815260040180806020018281038252602e815260200180612614602e913960400191505060405180910390fd5b600054610100900460ff16158015611d4c576000805460ff1961ff0019909116610100171660011790555b611d5461210d565b611d7782604051806040016040528060018152602001603160f81b815250612287565b611d8082612347565b8015610869576000805461ff00191690555050565b6038805460ff191660ff92909216919091179055565b60cc5460408051637cbab1c760e01b81526001600160a01b03868116600483015285811660248301526044820185905291519190921691637cbab1c791606480830192600092919082900301818387803b158015611e0857600080fd5b505af1158015611e1c573d6000803e3d6000fd5b50505050505050565b600083815260208581526040808320848452600381019092529091205480611fbc578315611fb7576001820154611f23575060028101805460018082018355600092835260209092208101859055908114801590611e8f57508154600019820181611e8c57fe5b06155b15611f1e5781546000908281611ea157fe5b0460008181526004850160205260409020546002850180549293509091600185019190819085908110611ed057fe5b60009182526020808320909101548354600181018555938352818320909301929092559384526004860180825260408086208690558486526003880183528086208490559285529052909120555b611f84565b6001820180546000198101908110611f3757fe5b9060005260206000200154905081600101805480611f5157fe5b6001900381819060005260206000200160009055905583826002018281548110611f7757fe5b6000918252602090912001555b60008381526003830160209081526040808320849055838352600485019091529020839055611fb786868360018861240d565b612101565b8361204d576000826002018281548110611fd257fe5b906000526020600020015490506000836002018381548110611ff057fe5b6000918252602080832090910192909255600180860180549182018155825282822001849055858152600385018252604080822082905584825260048601909252908120819055612047908890889085908561240d565b50612101565b81600201818154811061205c57fe5b906000526020600020015484146121015760008483600201838154811061207f57fe5b9060005260206000200154111590506000816120b657858460020184815481106120a557fe5b9060005260206000200154036120d3565b8360020183815481106120c557fe5b906000526020600020015486035b9050858460020184815481106120e557fe5b6000918252602090912001556120fe888885858561240d565b50505b505050505050565b4690565b600054610100900460ff16806121265750612126611818565b80612134575060005460ff16155b61216f5760405162461bcd60e51b815260040180806020018281038252602e815260200180612614602e913960400191505060405180910390fd5b600054610100900460ff1615801561219a576000805460ff1961ff0019909116610100171660011790555b80156121ac576000805461ff00191690555b50565b600054610100900460ff16806121c857506121c8611818565b806121d6575060005460ff16155b6122115760405162461bcd60e51b815260040180806020018281038252602e815260200180612614602e913960400191505060405180910390fd5b600054610100900460ff1615801561223c576000805460ff1961ff0019909116610100171660011790555b825161224f9060369060208601906124e2565b5081516122639060379060208501906124e2565b506038805460ff19166012179055801561093e576000805461ff0019169055505050565b600054610100900460ff16806122a057506122a0611818565b806122ae575060005460ff16155b6122e95760405162461bcd60e51b815260040180806020018281038252602e815260200180612614602e913960400191505060405180910390fd5b600054610100900460ff16158015612314576000805460ff1961ff0019909116610100171660011790555b8251602080850191909120835191840191909120606591909155606655801561093e576000805461ff0019169055505050565b600054610100900460ff16806123605750612360611818565b8061236e575060005460ff16155b6123a95760405162461bcd60e51b815260040180806020018281038252602e815260200180612614602e913960400191505060405180910390fd5b600054610100900460ff161580156123d4576000805460ff1961ff0019909116610100171660011790555b7f6e71edae12b1b97f4d1f60370fef10105fa2faae0126114a169c64845d6126c9609a558015610869576000805461ff00191690555050565b6000848152602086905260409020835b8015611e1c57815460001982018161243157fe5b0490508361245a578282600201828154811061244957fe5b906000526020600020015403612477565b8282600201828154811061246a57fe5b9060005260206000200154015b82600201828154811061248657fe5b60009182526020909120015561241d565b8280548282559060005260206000209081019282156124d2579160200282015b828111156124d25782518255916020019190600101906124b7565b506124de92915061254f565b5090565b828054600181600116156101000203166002900490600052602060002090601f016020900481019282601f1061252357805160ff19168380011785556124d2565b828001600101855582156124d257918201828111156124d25782518255916020019190600101906124b7565b5b808211156124de576000815560010161255056fe45524332303a207472616e7366657220746f20746865207a65726f206164647265737345524332303a206275726e20616d6f756e7420657863656564732062616c616e636545524332303a20617070726f766520746f20746865207a65726f206164647265737345524332303a207472616e7366657220616d6f756e7420657863656564732062616c616e636545434453413a20696e76616c6964207369676e6174757265202773272076616c7565496e697469616c697a61626c653a20636f6e747261637420697320616c726561647920696e697469616c697a656445434453413a20696e76616c6964207369676e6174757265202776272076616c7565af45c4fb9ef70911e5444b8eedce607366e494224d52e6feab07fbd62a53b26f45524332303a207472616e7366657220616d6f756e74206578636565647320616c6c6f77616e6365436f6e74726f6c6c6564546f6b656e2f657863656564732d616c6c6f77616e636545524332303a206275726e2066726f6d20746865207a65726f206164647265737345524332303a207472616e736665722066726f6d20746865207a65726f206164647265737345524332303a20617070726f76652066726f6d20746865207a65726f2061646472657373436f6e74726f6c6c6564546f6b656e2f636f6e74726f6c6c65722d6e6f742d7a65726f45524332303a2064656372656173656420616c6c6f77616e63652062656c6f77207a65726fa2646970667358221220249ea71f3d53c945962821ae2787942e0997b146abdb205938e3ea4d4543472864736f6c634300060c0033",
  "deployedBytecode": "0x608060405234801561001057600080fd5b50600436106100415760003560e01c8063022ec09514610046578063b3eeb5e21461006a578063efc81a8c14610120575b600080fd5b61004e610128565b604080516001600160a01b039092168252519081900360200190f35b61004e6004803603604081101561008057600080fd5b6001600160a01b0382351691908101906040810160208201356401000000008111156100ab57600080fd5b8201836020820111156100bd57600080fd5b803590602001918460018302840111640100000000831117156100df57600080fd5b91908080601f016020809104026020016040519081016040528093929190818152602001838380828437600092019190915250929550610137945050505050565b61004e6102b3565b6000546001600160a01b031681565b6000808360601b9050604051733d602d80600a3d3981f3363d3d373d3d3d363d7360601b81528160148201526e5af43d82803e903d91602b57fd5bf360881b60288201526037816000f0604080516001600160a01b038316815290519194507efffc2da0b561cae30d9826d37709e9421c4725faebc226cbbb7ef5fc5e7349925081900360200190a18251156102ac576000826001600160a01b0316846040518082805190602001908083835b602083106102035780518252601f1990920191602091820191016101e4565b6001836020036101000a0380198251168184511680821785525050505050509050019150506000604051808303816000865af19150503d8060008114610265576040519150601f19603f3d011682016040523d82523d6000602084013e61026a565b606091505b50509050806102aa5760405162461bcd60e51b81526004018080602001828103825260248152602001806102de6024913960400191505060405180910390fd5b505b5092915050565b6000805460408051602081019091528281526102d8916001600160a01b031690610137565b90509056fe50726f7879466163746f72792f636f6e7374727563746f722d63616c6c2d6661696c6564a26469706673582212205ae3412cec8c2db03f6c7ec02aac9a02672e7d53a07498e960daa42ca4a37a2564736f6c634300060c0033",
  "devdoc": {
    "kind": "dev",
    "methods": {
      "create()": {
        "returns": {
          "_0": "A reference to the new proxied Controlled ERC20 Token"
        }
      }
    },
    "title": "Controlled ERC20 Token Factory",
    "version": 1
  },
  "userdoc": {
    "kind": "user",
    "methods": {
      "constructor": "Initializes the Factory with an instance of the Controlled ERC20 Token",
      "create()": {
        "notice": "Creates a new Controlled ERC20 Token as a proxy of the template instance"
      },
      "instance()": {
        "notice": "Contract template for deploying proxied tokens"
      }
    },
    "notice": "Minimal proxy pattern for creating new Controlled ERC20 Tokens",
    "version": 1
  },
  "storageLayout": {
    "storage": [
      {
        "astId": 16381,
        "contract": "contracts/token/TicketProxyFactory.sol:TicketProxyFactory",
        "label": "instance",
        "offset": 0,
        "slot": "0",
        "type": "t_contract(Ticket)16358"
      }
    ],
    "types": {
      "t_contract(Ticket)16358": {
        "encoding": "inplace",
        "label": "contract Ticket",
        "numberOfBytes": "20"
      }
    }
  }
}