Contract 0xD906D192e2503Aafd1BC5F5fc4163E842D5B1d6e

 
Txn Hash Method
Block
From
To
Value [Txn Fee]
0xdaa64809811cf7427e116b6d2c3e9d71dd5650f0ae9dbae0eacb322630b58a980x6080604073718092022-03-03 19:08:2683 days 19 hrs ago0xb5af4138f0f33be0d6414eb25271b9c2dc245fb5 IN  Create: TicketBroker0 ETH0.020808541966 ETH
[ Download CSV Export 
Latest 25 internal transaction
Parent Txn Hash Block From To Value
0x7dc356f57cef50ec95344acb87ec8d3edce60a19220171eb4d6464753528e6eb129944382022-05-26 13:16:2752 mins ago 0xa8bb618b1520e284046f3dfc448851a1ff26e41b0xd906d192e2503aafd1bc5f5fc4163e842d5b1d6e0 ETH
0xc388b1f0547fdca09e929d376583114241ef79368c56b241d41972fbc96012ae129712702022-05-26 6:30:177 hrs 38 mins ago 0xa8bb618b1520e284046f3dfc448851a1ff26e41b0xd906d192e2503aafd1bc5f5fc4163e842d5b1d6e0 ETH
0x08048d7d1d37cbcd318a8d6a802a29a91969f33e0ae08c118bfb19468f7664be129629802022-05-26 3:04:2311 hrs 4 mins ago 0xa8bb618b1520e284046f3dfc448851a1ff26e41b0xd906d192e2503aafd1bc5f5fc4163e842d5b1d6e0 ETH
0xe41b74a02628b00fbeeaff9c16216e6b11bbf824bcc2983617908d1c2f135bd7129611752022-05-26 2:17:1611 hrs 51 mins ago 0xa8bb618b1520e284046f3dfc448851a1ff26e41b0xd906d192e2503aafd1bc5f5fc4163e842d5b1d6e0 ETH
0x1980c95f3bc940c9027b9f54ac2715150e8c34167a445049b4ca486ef831b3e4129577042022-05-26 0:29:5713 hrs 39 mins ago 0xa8bb618b1520e284046f3dfc448851a1ff26e41b0xd906d192e2503aafd1bc5f5fc4163e842d5b1d6e0 ETH
0x913cb56588fe406352dd731a197346142c2d722c85901ed94772c6bb3b77e828129543842022-05-25 22:27:0215 hrs 42 mins ago 0xa8bb618b1520e284046f3dfc448851a1ff26e41b0xd906d192e2503aafd1bc5f5fc4163e842d5b1d6e0 ETH
0xbbbf8246ecfd73bda239207cb7c000418d865a33d1f27441b97cd054de08ca6e129477882022-05-25 18:56:1419 hrs 12 mins ago 0xa8bb618b1520e284046f3dfc448851a1ff26e41b0xd906d192e2503aafd1bc5f5fc4163e842d5b1d6e0 ETH
0x4591ba29788de24d6eb042bb1f81e648d43b1e2287750bc8f3763b5138a6eb31129390602022-05-25 15:29:2022 hrs 39 mins ago 0xa8bb618b1520e284046f3dfc448851a1ff26e41b0xd906d192e2503aafd1bc5f5fc4163e842d5b1d6e0 ETH
0xba4628445fc93a9f8509287f75c8eee5f550be9d95d277b50c00f2a92173e5dc129371532022-05-25 14:50:4223 hrs 18 mins ago 0xa8bb618b1520e284046f3dfc448851a1ff26e41b0xd906d192e2503aafd1bc5f5fc4163e842d5b1d6e0 ETH
0xc5a4aac17170fd548aa2cebc65f8425653d37925d5bcba6c9973508954a52b24129233342022-05-25 11:02:511 day 3 hrs ago 0xa8bb618b1520e284046f3dfc448851a1ff26e41b0xd906d192e2503aafd1bc5f5fc4163e842d5b1d6e0 ETH
0x6559d22390f1a4a2dc6a5bc67dfc49ae4f4166561339143b717684c684b48285129170102022-05-25 9:16:221 day 4 hrs ago 0xa8bb618b1520e284046f3dfc448851a1ff26e41b0xd906d192e2503aafd1bc5f5fc4163e842d5b1d6e0 ETH
0xfcb0fd9a07ea25c36f56a6ce5085e2101cd6d3286484abdadca54934a2db94e6128996592022-05-25 3:45:061 day 10 hrs ago 0xa8bb618b1520e284046f3dfc448851a1ff26e41b0xd906d192e2503aafd1bc5f5fc4163e842d5b1d6e0 ETH
0x54329de334cf53f375cb1ffe4c2d3661921c71b6883ea990be3517e3324b2d3c128983582022-05-25 3:21:051 day 10 hrs ago 0xa8bb618b1520e284046f3dfc448851a1ff26e41b0xd906d192e2503aafd1bc5f5fc4163e842d5b1d6e0 ETH
0xdc4cfeec1b2c132e9923e55171acf94e71544c07f64da8c7c130e8e3c6b980f1128954692022-05-25 2:37:181 day 11 hrs ago 0xa8bb618b1520e284046f3dfc448851a1ff26e41b0xd906d192e2503aafd1bc5f5fc4163e842d5b1d6e0 ETH
0xa8816859001b2fbbe0fe8593be5e9b797551da57d094587e7e689595f2f97331128935202022-05-25 2:08:201 day 12 hrs ago 0xa8bb618b1520e284046f3dfc448851a1ff26e41b0xd906d192e2503aafd1bc5f5fc4163e842d5b1d6e0 ETH
0xc0a46ac6f422a60d45b701fef2b2f2c67c23ccd72de02a17f3341f95d6479cac128913342022-05-25 1:09:081 day 12 hrs ago 0xa8bb618b1520e284046f3dfc448851a1ff26e41b0xd906d192e2503aafd1bc5f5fc4163e842d5b1d6e0 ETH
0x32cb42af9650325091f52a6b7a41e3961c31435c56fab4fcc52e7edcc004eed1128900142022-05-25 0:25:221 day 13 hrs ago 0xa8bb618b1520e284046f3dfc448851a1ff26e41b0xd906d192e2503aafd1bc5f5fc4163e842d5b1d6e0 ETH
0x9cbdb4f2bac7923f5807a3f976fce0fc6a5cc228da5e4c27268034ab50dcd45d128868952022-05-24 22:51:151 day 15 hrs ago 0xa8bb618b1520e284046f3dfc448851a1ff26e41b0xd906d192e2503aafd1bc5f5fc4163e842d5b1d6e0 ETH
0xf62910e4f943f0cd327a63ea960226bb168497f4e24bb22fac52fff7dcaacfb1128835442022-05-24 21:17:261 day 16 hrs ago 0xa8bb618b1520e284046f3dfc448851a1ff26e41b0xd906d192e2503aafd1bc5f5fc4163e842d5b1d6e0 ETH
0x4aa3949841d4e9d98a48691fd28d30cd066bce4be6c13876d2aeb390b3c5e6c9128818882022-05-24 20:34:141 day 17 hrs ago 0xa8bb618b1520e284046f3dfc448851a1ff26e41b0xd906d192e2503aafd1bc5f5fc4163e842d5b1d6e0 ETH
0xdd143c1ccdaf0bfc65160437f505a5385e8277c2bbe5637c420475457756f7f0128799352022-05-24 19:46:551 day 18 hrs ago 0xa8bb618b1520e284046f3dfc448851a1ff26e41b0xd906d192e2503aafd1bc5f5fc4163e842d5b1d6e0 ETH
0x7eadf26e10c836832b5a0c516489cf5392b4c7d26a4d0a15f1f4a1214511bb7d128702322022-05-24 16:08:281 day 22 hrs ago 0xa8bb618b1520e284046f3dfc448851a1ff26e41b0xd906d192e2503aafd1bc5f5fc4163e842d5b1d6e0 ETH
0xae10bce818f2cd0506404716ba279e34315a660f9e8a45a2ddba83dbf8a6c880128586472022-05-24 12:56:522 days 1 hr ago 0xa8bb618b1520e284046f3dfc448851a1ff26e41b0xd906d192e2503aafd1bc5f5fc4163e842d5b1d6e0 ETH
0xf21caf5462c51abfef653702a0531493af38a35acb3f24b4603a335ea80db4ea128556652022-05-24 12:02:462 days 2 hrs ago 0xa8bb618b1520e284046f3dfc448851a1ff26e41b0xd906d192e2503aafd1bc5f5fc4163e842d5b1d6e0 ETH
0xce1c539a7860d7740b78ce147686b76ef3d9d3888929cdababff510045210656128541072022-05-24 11:35:552 days 2 hrs ago 0xa8bb618b1520e284046f3dfc448851a1ff26e41b0xd906d192e2503aafd1bc5f5fc4163e842d5b1d6e0 ETH
[ Download CSV Export 
Loading

Contract Source Code Verified (Exact Match)

Contract Name:
TicketBroker

Compiler Version
v0.8.9+commit.e5eed63a

Optimization Enabled:
Yes with 200 runs

Other Settings:
default evmVersion, MIT license

Contract Source Code (Solidity Standard Json-Input format)

File 1 of 22 : Strings.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (utils/Strings.sol)

pragma solidity ^0.8.0;

/**
 * @dev String operations.
 */
library Strings {
    bytes16 private constant _HEX_SYMBOLS = "0123456789abcdef";

    /**
     * @dev Converts a `uint256` to its ASCII `string` decimal representation.
     */
    function toString(uint256 value) internal pure returns (string memory) {
        // Inspired by OraclizeAPI's implementation - MIT licence
        // https://github.com/oraclize/ethereum-api/blob/b42146b063c7d6ee1358846c198246239e9360e8/oraclizeAPI_0.4.25.sol

        if (value == 0) {
            return "0";
        }
        uint256 temp = value;
        uint256 digits;
        while (temp != 0) {
            digits++;
            temp /= 10;
        }
        bytes memory buffer = new bytes(digits);
        while (value != 0) {
            digits -= 1;
            buffer[digits] = bytes1(uint8(48 + uint256(value % 10)));
            value /= 10;
        }
        return string(buffer);
    }

    /**
     * @dev Converts a `uint256` to its ASCII `string` hexadecimal representation.
     */
    function toHexString(uint256 value) internal pure returns (string memory) {
        if (value == 0) {
            return "0x00";
        }
        uint256 temp = value;
        uint256 length = 0;
        while (temp != 0) {
            length++;
            temp >>= 8;
        }
        return toHexString(value, length);
    }

    /**
     * @dev Converts a `uint256` to its ASCII `string` hexadecimal representation with fixed length.
     */
    function toHexString(uint256 value, uint256 length) internal pure returns (string memory) {
        bytes memory buffer = new bytes(2 * length + 2);
        buffer[0] = "0";
        buffer[1] = "x";
        for (uint256 i = 2 * length + 1; i > 1; --i) {
            buffer[i] = _HEX_SYMBOLS[value & 0xf];
            value >>= 4;
        }
        require(value == 0, "Strings: hex length insufficient");
        return string(buffer);
    }
}

File 2 of 22 : ECDSA.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (utils/cryptography/ECDSA.sol)

pragma solidity ^0.8.0;

import "../Strings.sol";

/**
 * @dev Elliptic Curve Digital Signature Algorithm (ECDSA) operations.
 *
 * These functions can be used to verify that a message was signed by the holder
 * of the private keys of a given address.
 */
library ECDSA {
    enum RecoverError {
        NoError,
        InvalidSignature,
        InvalidSignatureLength,
        InvalidSignatureS,
        InvalidSignatureV
    }

    function _throwError(RecoverError error) private pure {
        if (error == RecoverError.NoError) {
            return; // no error: do nothing
        } else if (error == RecoverError.InvalidSignature) {
            revert("ECDSA: invalid signature");
        } else if (error == RecoverError.InvalidSignatureLength) {
            revert("ECDSA: invalid signature length");
        } else if (error == RecoverError.InvalidSignatureS) {
            revert("ECDSA: invalid signature 's' value");
        } else if (error == RecoverError.InvalidSignatureV) {
            revert("ECDSA: invalid signature 'v' value");
        }
    }

    /**
     * @dev Returns the address that signed a hashed message (`hash`) with
     * `signature` or error string. This address can then be used for verification purposes.
     *
     * The `ecrecover` EVM opcode allows for malleable (non-unique) signatures:
     * this function rejects them by requiring the `s` value to be in the lower
     * half order, and the `v` value to be either 27 or 28.
     *
     * IMPORTANT: `hash` _must_ be the result of a hash operation for the
     * verification to be secure: it is possible to craft signatures that
     * recover to arbitrary addresses for non-hashed data. A safe way to ensure
     * this is by receiving a hash of the original message (which may otherwise
     * be too long), and then calling {toEthSignedMessageHash} on it.
     *
     * Documentation for signature generation:
     * - with https://web3js.readthedocs.io/en/v1.3.4/web3-eth-accounts.html#sign[Web3.js]
     * - with https://docs.ethers.io/v5/api/signer/#Signer-signMessage[ethers]
     *
     * _Available since v4.3._
     */
    function tryRecover(bytes32 hash, bytes memory signature) internal pure returns (address, RecoverError) {
        // Check the signature length
        // - case 65: r,s,v signature (standard)
        // - case 64: r,vs signature (cf https://eips.ethereum.org/EIPS/eip-2098) _Available since v4.1._
        if (signature.length == 65) {
            bytes32 r;
            bytes32 s;
            uint8 v;
            // ecrecover takes the signature parameters, and the only way to get them
            // currently is to use assembly.
            assembly {
                r := mload(add(signature, 0x20))
                s := mload(add(signature, 0x40))
                v := byte(0, mload(add(signature, 0x60)))
            }
            return tryRecover(hash, v, r, s);
        } else if (signature.length == 64) {
            bytes32 r;
            bytes32 vs;
            // ecrecover takes the signature parameters, and the only way to get them
            // currently is to use assembly.
            assembly {
                r := mload(add(signature, 0x20))
                vs := mload(add(signature, 0x40))
            }
            return tryRecover(hash, r, vs);
        } else {
            return (address(0), RecoverError.InvalidSignatureLength);
        }
    }

    /**
     * @dev Returns the address that signed a hashed message (`hash`) with
     * `signature`. This address can then be used for verification purposes.
     *
     * The `ecrecover` EVM opcode allows for malleable (non-unique) signatures:
     * this function rejects them by requiring the `s` value to be in the lower
     * half order, and the `v` value to be either 27 or 28.
     *
     * IMPORTANT: `hash` _must_ be the result of a hash operation for the
     * verification to be secure: it is possible to craft signatures that
     * recover to arbitrary addresses for non-hashed data. A safe way to ensure
     * this is by receiving a hash of the original message (which may otherwise
     * be too long), and then calling {toEthSignedMessageHash} on it.
     */
    function recover(bytes32 hash, bytes memory signature) internal pure returns (address) {
        (address recovered, RecoverError error) = tryRecover(hash, signature);
        _throwError(error);
        return recovered;
    }

    /**
     * @dev Overload of {ECDSA-tryRecover} that receives the `r` and `vs` short-signature fields separately.
     *
     * See https://eips.ethereum.org/EIPS/eip-2098[EIP-2098 short signatures]
     *
     * _Available since v4.3._
     */
    function tryRecover(
        bytes32 hash,
        bytes32 r,
        bytes32 vs
    ) internal pure returns (address, RecoverError) {
        bytes32 s;
        uint8 v;
        assembly {
            s := and(vs, 0x7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff)
            v := add(shr(255, vs), 27)
        }
        return tryRecover(hash, v, r, s);
    }

    /**
     * @dev Overload of {ECDSA-recover} that receives the `r and `vs` short-signature fields separately.
     *
     * _Available since v4.2._
     */
    function recover(
        bytes32 hash,
        bytes32 r,
        bytes32 vs
    ) internal pure returns (address) {
        (address recovered, RecoverError error) = tryRecover(hash, r, vs);
        _throwError(error);
        return recovered;
    }

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

        // If the signature is valid (and not malleable), return the signer address
        address signer = ecrecover(hash, v, r, s);
        if (signer == address(0)) {
            return (address(0), RecoverError.InvalidSignature);
        }

        return (signer, RecoverError.NoError);
    }

    /**
     * @dev Overload of {ECDSA-recover} that receives the `v`,
     * `r` and `s` signature fields separately.
     */
    function recover(
        bytes32 hash,
        uint8 v,
        bytes32 r,
        bytes32 s
    ) internal pure returns (address) {
        (address recovered, RecoverError error) = tryRecover(hash, v, r, s);
        _throwError(error);
        return recovered;
    }

    /**
     * @dev Returns an Ethereum Signed Message, created from a `hash`. This
     * produces hash corresponding to the one signed with the
     * https://eth.wiki/json-rpc/API#eth_sign[`eth_sign`]
     * JSON-RPC method as part of EIP-191.
     *
     * See {recover}.
     */
    function toEthSignedMessageHash(bytes32 hash) internal pure returns (bytes32) {
        // 32 is the length in bytes of hash,
        // enforced by the type signature above
        return keccak256(abi.encodePacked("\x19Ethereum Signed Message:\n32", hash));
    }

    /**
     * @dev Returns an Ethereum Signed Message, created from `s`. This
     * produces hash corresponding to the one signed with the
     * https://eth.wiki/json-rpc/API#eth_sign[`eth_sign`]
     * JSON-RPC method as part of EIP-191.
     *
     * See {recover}.
     */
    function toEthSignedMessageHash(bytes memory s) internal pure returns (bytes32) {
        return keccak256(abi.encodePacked("\x19Ethereum Signed Message:\n", Strings.toString(s.length), s));
    }

    /**
     * @dev Returns an Ethereum Signed Typed Data, created from a
     * `domainSeparator` and a `structHash`. This produces hash corresponding
     * to the one signed with the
     * https://eips.ethereum.org/EIPS/eip-712[`eth_signTypedData`]
     * JSON-RPC method as part of EIP-712.
     *
     * See {recover}.
     */
    function toTypedDataHash(bytes32 domainSeparator, bytes32 structHash) internal pure returns (bytes32) {
        return keccak256(abi.encodePacked("\x19\x01", domainSeparator, structHash));
    }
}

File 3 of 22 : SafeMath.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (utils/math/SafeMath.sol)

pragma solidity ^0.8.0;

// CAUTION
// This version of SafeMath should only be used with Solidity 0.8 or later,
// because it relies on the compiler's built in overflow checks.

/**
 * @dev Wrappers over Solidity's arithmetic operations.
 *
 * NOTE: `SafeMath` is generally not needed starting with Solidity 0.8, since the compiler
 * now has built in overflow checking.
 */
library SafeMath {
    /**
     * @dev Returns the addition of two unsigned integers, with an overflow flag.
     *
     * _Available since v3.4._
     */
    function tryAdd(uint256 a, uint256 b) internal pure returns (bool, uint256) {
        unchecked {
            uint256 c = a + b;
            if (c < a) return (false, 0);
            return (true, c);
        }
    }

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

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

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

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

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

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

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

    /**
     * @dev Returns the integer division of two unsigned integers, reverting on
     * division by zero. The result is rounded towards zero.
     *
     * Counterpart to Solidity's `/` operator.
     *
     * Requirements:
     *
     * - The divisor cannot be zero.
     */
    function div(uint256 a, uint256 b) internal pure returns (uint256) {
        return a / b;
    }

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

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

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

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

File 4 of 22 : IController.sol
// SPDX-License-Identifier: MIT
pragma solidity 0.8.9;

import "./zeppelin/Pausable.sol";

abstract contract IController is Pausable {
    event SetContractInfo(bytes32 id, address contractAddress, bytes20 gitCommitHash);

    function setContractInfo(
        bytes32 _id,
        address _contractAddress,
        bytes20 _gitCommitHash
    ) external virtual;

    function updateController(bytes32 _id, address _controller) external virtual;

    function getContract(bytes32 _id) public view virtual returns (address);
}

File 5 of 22 : IManager.sol
// SPDX-License-Identifier: MIT
pragma solidity 0.8.9;

interface IManager {
    event SetController(address controller);
    event ParameterUpdate(string param);

    function setController(address _controller) external;
}

File 6 of 22 : Manager.sol
// SPDX-License-Identifier: MIT
pragma solidity 0.8.9;

import "./IManager.sol";
import "./IController.sol";

contract Manager is IManager {
    // Controller that contract is registered with
    IController public controller;

    // Check if sender is controller
    modifier onlyController() {
        _onlyController();
        _;
    }

    // Check if sender is controller owner
    modifier onlyControllerOwner() {
        _onlyControllerOwner();
        _;
    }

    // Check if controller is not paused
    modifier whenSystemNotPaused() {
        _whenSystemNotPaused();
        _;
    }

    // Check if controller is paused
    modifier whenSystemPaused() {
        _whenSystemPaused();
        _;
    }

    constructor(address _controller) {
        controller = IController(_controller);
    }

    /**
     * @notice Set controller. Only callable by current controller
     * @param _controller Controller contract address
     */
    function setController(address _controller) external onlyController {
        controller = IController(_controller);

        emit SetController(_controller);
    }

    function _onlyController() private view {
        require(msg.sender == address(controller), "caller must be Controller");
    }

    function _onlyControllerOwner() private view {
        require(msg.sender == controller.owner(), "caller must be Controller owner");
    }

    function _whenSystemNotPaused() private view {
        require(!controller.paused(), "system is paused");
    }

    function _whenSystemPaused() private view {
        require(controller.paused(), "system is not paused");
    }
}

File 7 of 22 : ManagerProxyTarget.sol
// SPDX-License-Identifier: MIT
pragma solidity 0.8.9;

import "./Manager.sol";

/**
 * @title ManagerProxyTarget
 * @notice The base contract that target contracts used by a proxy contract should inherit from
 * @dev Both the target contract and the proxy contract (implemented as ManagerProxy) MUST inherit from ManagerProxyTarget in order to guarantee
 that both contracts have the same storage layout. Differing storage layouts in a proxy contract and target contract can
 potentially break the delegate proxy upgradeability mechanism
 */
abstract contract ManagerProxyTarget is Manager {
    // Used to look up target contract address in controller's registry
    bytes32 public targetContractId;
}

File 8 of 22 : IBondingManager.sol
// SPDX-License-Identifier: MIT
pragma solidity 0.8.9;

/**
 * @title Interface for BondingManager
 * TODO: switch to interface type
 */
interface IBondingManager {
    event TranscoderUpdate(address indexed transcoder, uint256 rewardCut, uint256 feeShare);
    event TranscoderActivated(address indexed transcoder, uint256 activationRound);
    event TranscoderDeactivated(address indexed transcoder, uint256 deactivationRound);
    event TranscoderSlashed(address indexed transcoder, address finder, uint256 penalty, uint256 finderReward);
    event Reward(address indexed transcoder, uint256 amount);
    event Bond(
        address indexed newDelegate,
        address indexed oldDelegate,
        address indexed delegator,
        uint256 additionalAmount,
        uint256 bondedAmount
    );
    event Unbond(
        address indexed delegate,
        address indexed delegator,
        uint256 unbondingLockId,
        uint256 amount,
        uint256 withdrawRound
    );
    event Rebond(address indexed delegate, address indexed delegator, uint256 unbondingLockId, uint256 amount);
    event TransferBond(
        address indexed oldDelegator,
        address indexed newDelegator,
        uint256 oldUnbondingLockId,
        uint256 newUnbondingLockId,
        uint256 amount
    );
    event WithdrawStake(address indexed delegator, uint256 unbondingLockId, uint256 amount, uint256 withdrawRound);
    event WithdrawFees(address indexed delegator, address recipient, uint256 amount);
    event EarningsClaimed(
        address indexed delegate,
        address indexed delegator,
        uint256 rewards,
        uint256 fees,
        uint256 startRound,
        uint256 endRound
    );

    // Deprecated events
    // These event signatures can be used to construct the appropriate topic hashes to filter for past logs corresponding
    // to these deprecated events.
    // event Bond(address indexed delegate, address indexed delegator);
    // event Unbond(address indexed delegate, address indexed delegator);
    // event WithdrawStake(address indexed delegator);
    // event TranscoderUpdate(address indexed transcoder, uint256 pendingRewardCut, uint256 pendingFeeShare, uint256 pendingPricePerSegment, bool registered);
    // event TranscoderEvicted(address indexed transcoder);
    // event TranscoderResigned(address indexed transcoder);

    // External functions
    function updateTranscoderWithFees(
        address _transcoder,
        uint256 _fees,
        uint256 _round
    ) external;

    function slashTranscoder(
        address _transcoder,
        address _finder,
        uint256 _slashAmount,
        uint256 _finderFee
    ) external;

    function setCurrentRoundTotalActiveStake() external;

    // Public functions
    function getTranscoderPoolSize() external view returns (uint256);

    function transcoderTotalStake(address _transcoder) external view returns (uint256);

    function isActiveTranscoder(address _transcoder) external view returns (bool);

    function getTotalBonded() external view returns (uint256);
}

File 9 of 22 : TicketBroker.sol
// SPDX-License-Identifier: MIT
pragma solidity 0.8.9;

import "./mixins/MixinContractRegistry.sol";
import "./mixins/MixinReserve.sol";
import "./mixins/MixinTicketBrokerCore.sol";
import "./mixins/MixinTicketProcessor.sol";
import "./mixins/MixinWrappers.sol";

contract TicketBroker is
    MixinContractRegistry,
    MixinReserve,
    MixinTicketBrokerCore,
    MixinTicketProcessor,
    MixinWrappers
{
    /**
     * @notice TicketBroker constructor. Only invokes constructor of base Manager contract with provided Controller address
     * @dev This constructor will not initialize any state variables besides `controller`. The following setter functions
     * should be used to initialize state variables post-deployment:
     * - setUnlockPeriod()
     * - setTicketValidityPeriod()
     * @param _controller Address of Controller that this contract will be registered with
     */
    constructor(address _controller)
        MixinContractRegistry(_controller)
        MixinReserve()
        MixinTicketBrokerCore()
        MixinTicketProcessor()
    {}

    /**
     * @notice Sets unlockPeriod value. Only callable by the Controller owner
     * @param _unlockPeriod Value for unlockPeriod
     */
    function setUnlockPeriod(uint256 _unlockPeriod) external onlyControllerOwner {
        unlockPeriod = _unlockPeriod;

        emit ParameterUpdate("unlockPeriod");
    }

    /**
     * @notice Sets ticketValidityPeriod value. Only callable by the Controller owner
     * @param _ticketValidityPeriod Value for ticketValidityPeriod
     */
    function setTicketValidityPeriod(uint256 _ticketValidityPeriod) external onlyControllerOwner {
        require(_ticketValidityPeriod > 0, "ticketValidityPeriod must be greater than 0");

        ticketValidityPeriod = _ticketValidityPeriod;

        emit ParameterUpdate("ticketValidityPeriod");
    }
}

File 10 of 22 : MixinContractRegistry.sol
// SPDX-License-Identifier: MIT
pragma solidity 0.8.9;

import "../../ManagerProxyTarget.sol";
import "./interfaces/MContractRegistry.sol";

abstract contract MixinContractRegistry is MContractRegistry, ManagerProxyTarget {
    /**
     * @dev Checks if the current round has been initialized
     */
    modifier currentRoundInitialized() override {
        require(roundsManager().currentRoundInitialized(), "current round is not initialized");
        _;
    }

    constructor(address _controller) Manager(_controller) {}

    /**
     * @dev Returns an instance of the IBondingManager interface
     */
    function bondingManager() internal view override returns (IBondingManager) {
        return IBondingManager(controller.getContract(keccak256("BondingManager")));
    }

    /**
     * @dev Returns an instance of the IMinter interface
     */
    function minter() internal view override returns (IMinter) {
        return IMinter(controller.getContract(keccak256("Minter")));
    }

    /**
     * @dev Returns an instance of the IRoundsManager interface
     */
    function roundsManager() internal view override returns (IRoundsManager) {
        return IRoundsManager(controller.getContract(keccak256("RoundsManager")));
    }
}

File 11 of 22 : MixinReserve.sol
// SPDX-License-Identifier: MIT
pragma solidity 0.8.9;

import "./interfaces/MReserve.sol";
import "./MixinContractRegistry.sol";
import "@openzeppelin/contracts/utils/math/SafeMath.sol";

abstract contract MixinReserve is MixinContractRegistry, MReserve {
    using SafeMath for uint256;

    struct Reserve {
        uint256 funds; // Amount of funds in the reserve
        mapping(uint256 => uint256) claimedForRound; // Mapping of round => total amount claimed
        mapping(uint256 => mapping(address => uint256)) claimedByAddress; // Mapping of round => claimant address => amount claimed
    }

    // Mapping of address => reserve
    mapping(address => Reserve) internal reserves;

    /**
     * @dev Returns info about a reserve
     * @param _reserveHolder Address of reserve holder
     * @return info Info about the reserve for `_reserveHolder`
     */
    function getReserveInfo(address _reserveHolder) public view override returns (ReserveInfo memory info) {
        info.fundsRemaining = remainingReserve(_reserveHolder);
        info.claimedInCurrentRound = reserves[_reserveHolder].claimedForRound[roundsManager().currentRound()];
    }

    /**
     * @dev Returns the amount of funds claimable by a claimant from a reserve in the current round
     * @param _reserveHolder Address of reserve holder
     * @param _claimant Address of claimant
     * @return Amount of funds claimable by `_claimant` from the reserve for `_reserveHolder` in the current round
     */
    function claimableReserve(address _reserveHolder, address _claimant) public view returns (uint256) {
        Reserve storage reserve = reserves[_reserveHolder];

        uint256 currentRound = roundsManager().currentRound();

        if (!bondingManager().isActiveTranscoder(_claimant)) {
            return 0;
        }

        uint256 poolSize = bondingManager().getTranscoderPoolSize();
        if (poolSize == 0) {
            return 0;
        }

        // Total claimable funds = remaining funds + amount claimed for the round
        uint256 totalClaimable = reserve.funds.add(reserve.claimedForRound[currentRound]);
        return totalClaimable.div(poolSize).sub(reserve.claimedByAddress[currentRound][_claimant]);
    }

    /**
     * @dev Returns the amount of funds claimed by a claimant from a reserve in the current round
     * @param _reserveHolder Address of reserve holder
     * @param _claimant Address of claimant
     * @return Amount of funds claimed by `_claimant` from the reserve for `_reserveHolder` in the current round
     */
    function claimedReserve(address _reserveHolder, address _claimant) public view override returns (uint256) {
        Reserve storage reserve = reserves[_reserveHolder];
        uint256 currentRound = roundsManager().currentRound();
        return reserve.claimedByAddress[currentRound][_claimant];
    }

    /**
     * @dev Adds funds to a reserve
     * @param _reserveHolder Address of reserve holder
     * @param _amount Amount of funds to add to reserve
     */
    function addReserve(address _reserveHolder, uint256 _amount) internal override {
        reserves[_reserveHolder].funds = reserves[_reserveHolder].funds.add(_amount);

        emit ReserveFunded(_reserveHolder, _amount);
    }

    /**
     * @dev Clears contract storage used for a reserve
     * @param _reserveHolder Address of reserve holder
     */
    function clearReserve(address _reserveHolder) internal override {
        // This delete operation will only clear reserve.funds and will not clear the storage for reserve.claimedForRound
        // reserve.claimedByAddress because these fields are mappings and the Solidity `delete` keyword will not modify mappings.
        // This *could* be a problem in the following scenario:
        //
        // 1) In round N, for address A, reserve.claimedForRound[N] > 0 and reserve.claimedByAddress[N][r_i] > 0 where r_i is
        // a member of the active set in round N
        // 2) This function is called by MixinTicketBrokerCore.withdraw() in round N
        // 3) Address A funds its reserve again
        //
        // After step 3, A has reserve.funds > 0, reserve.claimedForRound[N] > 0 and reserve.claimedByAddress[N][r_i] > 0
        // despite having funded a fresh reserve after previously withdrawing all of its funds in the same round.
        // We prevent this scenario by disallowing reserve claims starting at an address' withdraw round in
        // MixinTicketBrokerCore.redeemWinningTicket()
        delete reserves[_reserveHolder];
    }

    /**
     * @dev Claims funds from a reserve
     * @param _reserveHolder Address of reserve holder
     * @param _claimant Address of claimant
     * @param _amount Amount of funds to claim from the reserve
     * @return Amount of funds (<= `_amount`) claimed by `_claimant` from the reserve for `_reserveHolder`
     */
    function claimFromReserve(
        address _reserveHolder,
        address _claimant,
        uint256 _amount
    ) internal override returns (uint256) {
        uint256 claimableFunds = claimableReserve(_reserveHolder, _claimant);
        // If the given amount > claimableFunds then claim claimableFunds
        // If the given amount <= claimableFunds then claim the given amount
        uint256 claimAmount = _amount > claimableFunds ? claimableFunds : _amount;

        if (claimAmount > 0) {
            uint256 currentRound = roundsManager().currentRound();
            Reserve storage reserve = reserves[_reserveHolder];
            // Increase total amount claimed for the round
            reserve.claimedForRound[currentRound] = reserve.claimedForRound[currentRound].add(claimAmount);
            // Increase amount claimed by claimant for the round
            reserve.claimedByAddress[currentRound][_claimant] = reserve.claimedByAddress[currentRound][_claimant].add(
                claimAmount
            );
            // Decrease remaining reserve
            reserve.funds = reserve.funds.sub(claimAmount);

            emit ReserveClaimed(_reserveHolder, _claimant, claimAmount);
        }

        return claimAmount;
    }

    /**
     * @dev Returns the amount of funds remaining in a reserve
     * @param _reserveHolder Address of reserve holder
     * @return Amount of funds remaining in the reserve for `_reserveHolder`
     */
    function remainingReserve(address _reserveHolder) internal view override returns (uint256) {
        return reserves[_reserveHolder].funds;
    }
}

File 12 of 22 : MixinTicketBrokerCore.sol
// SPDX-License-Identifier: MIT
pragma solidity 0.8.9;

import "./interfaces/MReserve.sol";
import "./interfaces/MTicketProcessor.sol";
import "./interfaces/MTicketBrokerCore.sol";
import "./MixinContractRegistry.sol";
import "@openzeppelin/contracts/utils/cryptography/ECDSA.sol";
import "@openzeppelin/contracts/utils/math/SafeMath.sol";

abstract contract MixinTicketBrokerCore is MixinContractRegistry, MReserve, MTicketProcessor, MTicketBrokerCore {
    using SafeMath for uint256;

    struct Sender {
        uint256 deposit; // Amount of funds deposited
        uint256 withdrawRound; // Round that sender can withdraw deposit & reserve
    }

    // Mapping of address => Sender
    mapping(address => Sender) internal senders;

    // Number of rounds before a sender can withdraw after requesting an unlock
    uint256 public unlockPeriod;

    // Mapping of ticket hashes => boolean indicating if ticket was redeemed
    mapping(bytes32 => bool) public usedTickets;

    // Checks if msg.value is equal to the given deposit and reserve amounts
    modifier checkDepositReserveETHValueSplit(uint256 _depositAmount, uint256 _reserveAmount) {
        require(
            msg.value == _depositAmount.add(_reserveAmount),
            "msg.value does not equal sum of deposit amount and reserve amount"
        );

        _;
    }

    // Process deposit funding
    modifier processDeposit(address _sender, uint256 _amount) {
        Sender storage sender = senders[_sender];
        sender.deposit = sender.deposit.add(_amount);
        if (_isUnlockInProgress(sender)) {
            _cancelUnlock(sender, _sender);
        }

        _;

        emit DepositFunded(_sender, _amount);
    }

    // Process reserve funding
    modifier processReserve(address _sender, uint256 _amount) {
        Sender storage sender = senders[_sender];
        addReserve(_sender, _amount);
        if (_isUnlockInProgress(sender)) {
            _cancelUnlock(sender, _sender);
        }

        _;
    }

    /**
     * @notice Adds ETH to the caller's deposit
     */
    function fundDeposit() external payable whenSystemNotPaused processDeposit(msg.sender, msg.value) {
        processFunding(msg.value);
    }

    /**
     * @notice Adds ETH to the caller's reserve
     */
    function fundReserve() external payable whenSystemNotPaused processReserve(msg.sender, msg.value) {
        processFunding(msg.value);
    }

    /**
     * @notice Adds ETH to the caller's deposit and reserve
     * @param _depositAmount Amount of ETH to add to the caller's deposit
     * @param _reserveAmount Amount of ETH to add to the caller's reserve
     */
    function fundDepositAndReserve(uint256 _depositAmount, uint256 _reserveAmount) external payable {
        fundDepositAndReserveFor(msg.sender, _depositAmount, _reserveAmount);
    }

    /**
     * @notice Adds ETH to the address' deposit and reserve
     * @param _depositAmount Amount of ETH to add to the address' deposit
     * @param _reserveAmount Amount of ETH to add to the address' reserve
     */
    function fundDepositAndReserveFor(
        address _addr,
        uint256 _depositAmount,
        uint256 _reserveAmount
    )
        public
        payable
        whenSystemNotPaused
        checkDepositReserveETHValueSplit(_depositAmount, _reserveAmount)
        processDeposit(_addr, _depositAmount)
        processReserve(_addr, _reserveAmount)
    {
        processFunding(msg.value);
    }

    /**
     * @notice Redeems a winning ticket that has been signed by a sender and reveals the
     recipient recipientRand that corresponds to the recipientRandHash included in the ticket
     * @param _ticket Winning ticket to be redeemed in order to claim payment
     * @param _sig Sender's signature over the hash of `_ticket`
     * @param _recipientRand The preimage for the recipientRandHash included in `_ticket`
     */
    function redeemWinningTicket(
        Ticket memory _ticket,
        bytes memory _sig,
        uint256 _recipientRand
    ) public whenSystemNotPaused currentRoundInitialized {
        bytes32 ticketHash = getTicketHash(_ticket);

        // Require a valid winning ticket for redemption
        requireValidWinningTicket(_ticket, ticketHash, _sig, _recipientRand);

        Sender storage sender = senders[_ticket.sender];

        // Require sender to be locked
        require(isLocked(sender), "sender is unlocked");
        // Require either a non-zero deposit or non-zero reserve for the sender
        require(sender.deposit > 0 || remainingReserve(_ticket.sender) > 0, "sender deposit and reserve are zero");

        // Mark ticket as used to prevent replay attacks involving redeeming
        // the same winning ticket multiple times
        usedTickets[ticketHash] = true;

        uint256 amountToTransfer;

        if (_ticket.faceValue > sender.deposit) {
            // If ticket face value > sender's deposit then claim from
            // the sender's reserve

            amountToTransfer = sender.deposit.add(
                claimFromReserve(_ticket.sender, _ticket.recipient, _ticket.faceValue.sub(sender.deposit))
            );

            sender.deposit = 0;
        } else {
            // If ticket face value <= sender's deposit then only deduct
            // from sender's deposit

            amountToTransfer = _ticket.faceValue;
            sender.deposit = sender.deposit.sub(_ticket.faceValue);
        }

        if (amountToTransfer > 0) {
            winningTicketTransfer(_ticket.recipient, amountToTransfer, _ticket.auxData);

            emit WinningTicketTransfer(_ticket.sender, _ticket.recipient, amountToTransfer);
        }

        emit WinningTicketRedeemed(
            _ticket.sender,
            _ticket.recipient,
            _ticket.faceValue,
            _ticket.winProb,
            _ticket.senderNonce,
            _recipientRand,
            _ticket.auxData
        );
    }

    /**
     * @notice Initiates the unlock period for the caller
     */
    function unlock() public whenSystemNotPaused {
        Sender storage sender = senders[msg.sender];

        require(sender.deposit > 0 || remainingReserve(msg.sender) > 0, "sender deposit and reserve are zero");
        require(!_isUnlockInProgress(sender), "unlock already initiated");

        uint256 currentRound = roundsManager().currentRound();
        sender.withdrawRound = currentRound.add(unlockPeriod);

        emit Unlock(msg.sender, currentRound, sender.withdrawRound);
    }

    /**
     * @notice Cancels the unlock period for the caller
     */
    function cancelUnlock() public whenSystemNotPaused {
        Sender storage sender = senders[msg.sender];

        _cancelUnlock(sender, msg.sender);
    }

    /**
     * @notice Withdraws all ETH from the caller's deposit and reserve
     */
    function withdraw() public whenSystemNotPaused {
        Sender storage sender = senders[msg.sender];

        uint256 deposit = sender.deposit;
        uint256 reserve = remainingReserve(msg.sender);

        require(deposit > 0 || reserve > 0, "sender deposit and reserve are zero");
        require(_isUnlockInProgress(sender), "no unlock request in progress");
        require(!isLocked(sender), "account is locked");

        sender.deposit = 0;
        clearReserve(msg.sender);

        withdrawTransfer(payable(msg.sender), deposit.add(reserve));

        emit Withdrawal(msg.sender, deposit, reserve);
    }

    /**
     * @notice Returns whether a sender is currently in the unlock period
     * @param _sender Address of sender
     * @return Boolean indicating whether `_sender` has an unlock in progress
     */
    function isUnlockInProgress(address _sender) public view returns (bool) {
        Sender memory sender = senders[_sender];
        return _isUnlockInProgress(sender);
    }

    /**
     * @notice Returns info about a sender
     * @param _sender Address of sender
     * @return sender Info about the sender for `_sender`
     * @return reserve Info about the reserve for `_sender`
     */
    function getSenderInfo(address _sender) public view returns (Sender memory sender, ReserveInfo memory reserve) {
        sender = senders[_sender];
        reserve = getReserveInfo(_sender);
    }

    /**
     * @dev Returns the hash of a ticket
     * @param _ticket Ticket to be hashed
     * @return keccak256 hash of `_ticket`
     */
    function getTicketHash(Ticket memory _ticket) public pure returns (bytes32) {
        return
            keccak256(
                abi.encodePacked(
                    _ticket.recipient,
                    _ticket.sender,
                    _ticket.faceValue,
                    _ticket.winProb,
                    _ticket.senderNonce,
                    _ticket.recipientRandHash,
                    _ticket.auxData
                )
            );
    }

    /**
     * @dev Helper to cancel an unlock
     * @param _sender Sender that is cancelling an unlock
     * @param _senderAddress Address of sender
     */
    function _cancelUnlock(Sender storage _sender, address _senderAddress) internal {
        require(_isUnlockInProgress(_sender), "no unlock request in progress");

        _sender.withdrawRound = 0;

        emit UnlockCancelled(_senderAddress);
    }

    /**
     * @dev Validates a winning ticket, succeeds or reverts
     * @param _ticket Winning ticket to be validated
     * @param _ticketHash Hash of `_ticket`
     * @param _sig Sender's signature over `_ticketHash`
     * @param _recipientRand The preimage for the recipientRandHash included in `_ticket`
     */
    function requireValidWinningTicket(
        Ticket memory _ticket,
        bytes32 _ticketHash,
        bytes memory _sig,
        uint256 _recipientRand
    ) internal view {
        require(_ticket.recipient != address(0), "ticket recipient is null address");
        require(_ticket.sender != address(0), "ticket sender is null address");

        requireValidTicketAuxData(_ticket.auxData);

        require(
            keccak256(abi.encodePacked(_recipientRand)) == _ticket.recipientRandHash,
            "recipientRand does not match recipientRandHash"
        );

        require(!usedTickets[_ticketHash], "ticket is used");

        require(isValidTicketSig(_ticket.sender, _sig, _ticketHash), "invalid signature over ticket hash");

        require(isWinningTicket(_sig, _recipientRand, _ticket.winProb), "ticket did not win");
    }

    /**
     * @dev Returns whether a sender is locked
     * @param _sender Sender to check for locked status
     * @return Boolean indicating whether sender is currently locked
     */
    function isLocked(Sender memory _sender) internal view returns (bool) {
        return _sender.withdrawRound == 0 || roundsManager().currentRound() < _sender.withdrawRound;
    }

    /**
     * @dev Returns whether a signature over a ticket hash is valid for a sender
     * @param _sender Address of sender
     * @param _sig Signature over `_ticketHash`
     * @param _ticketHash Hash of the ticket
     * @return Boolean indicating whether `_sig` is valid signature over `_ticketHash` for `_sender`
     */
    function isValidTicketSig(
        address _sender,
        bytes memory _sig,
        bytes32 _ticketHash
    ) internal pure returns (bool) {
        require(_sig.length == 65, "INVALID_SIGNATURE_LENGTH");
        address signer = ECDSA.recover(ECDSA.toEthSignedMessageHash(_ticketHash), _sig);
        return signer != address(0) && _sender == signer;
    }

    /**
     * @dev Returns whether a ticket won
     * @param _sig Sender's signature over the ticket
     * @param _recipientRand The preimage for the recipientRandHash included in the ticket
     * @param _winProb The winning probability of the ticket
     * @return Boolean indicating whether the ticket won
     */
    function isWinningTicket(
        bytes memory _sig,
        uint256 _recipientRand,
        uint256 _winProb
    ) internal pure returns (bool) {
        return uint256(keccak256(abi.encodePacked(_sig, _recipientRand))) < _winProb;
    }

    /**
     * @dev Helper to check if a sender is currently in the unlock period
     * @param _sender Sender to check for an unlock
     * @return Boolean indicating whether the sender is currently in the unlock period
     */
    function _isUnlockInProgress(Sender memory _sender) internal pure returns (bool) {
        return _sender.withdrawRound > 0;
    }
}

File 13 of 22 : MixinTicketProcessor.sol
// SPDX-License-Identifier: MIT
pragma solidity 0.8.9;

import "./interfaces/MTicketProcessor.sol";
import "./MixinContractRegistry.sol";
import "@openzeppelin/contracts/utils/math/SafeMath.sol";

abstract contract MixinTicketProcessor is MixinContractRegistry, MTicketProcessor {
    using SafeMath for uint256;

    // Number of rounds that a ticket is valid for starting from
    // its creationRound
    uint256 public ticketValidityPeriod;

    /**
     * @dev Process sent funds.
     * @param _amount Amount of funds sent
     */
    function processFunding(uint256 _amount) internal override {
        // Send funds to Minter
        minter().depositETH{ value: _amount }();
    }

    /**
     * @dev Transfer withdrawal funds for a ticket sender
     * @param _amount Amount of withdrawal funds
     */
    function withdrawTransfer(address payable _sender, uint256 _amount) internal override {
        // Ask Minter to send withdrawal funds to the ticket sender
        minter().trustedWithdrawETH(_sender, _amount);
    }

    /**
     * @dev Transfer funds for a recipient's winning ticket
     * @param _recipient Address of recipient
     * @param _amount Amount of funds for the winning ticket
     * @param _auxData Auxilary data for the winning ticket
     */
    function winningTicketTransfer(
        address _recipient,
        uint256 _amount,
        bytes memory _auxData
    ) internal override {
        (uint256 creationRound, ) = getCreationRoundAndBlockHash(_auxData);

        // Ask BondingManager to update fee pool for recipient with
        // winning ticket funds
        bondingManager().updateTranscoderWithFees(_recipient, _amount, creationRound);
    }

    /**
     * @dev Validates a ticket's auxilary data (succeeds or reverts)
     * @param _auxData Auxilary data inclueded in a ticket
     */
    function requireValidTicketAuxData(bytes memory _auxData) internal view override {
        (uint256 creationRound, bytes32 creationRoundBlockHash) = getCreationRoundAndBlockHash(_auxData);
        bytes32 blockHash = roundsManager().blockHashForRound(creationRound);

        require(blockHash != bytes32(0), "ticket creationRound does not have a block hash");
        require(creationRoundBlockHash == blockHash, "ticket creationRoundBlockHash invalid for creationRound");

        uint256 currRound = roundsManager().currentRound();

        require(creationRound.add(ticketValidityPeriod) > currRound, "ticket is expired");
    }

    /**
     * @dev Returns a ticket's creationRound and creationRoundBlockHash parsed from ticket auxilary data
     * @param _auxData Auxilary data for a ticket
     * @return creationRound and creationRoundBlockHash parsed from `_auxData`
     */
    function getCreationRoundAndBlockHash(bytes memory _auxData)
        internal
        pure
        returns (uint256 creationRound, bytes32 creationRoundBlockHash)
    {
        require(_auxData.length == 64, "invalid length for ticket auxData: must be 64 bytes");

        // _auxData format:
        // Bytes [0:31] = creationRound
        // Bytes [32:63] = creationRoundBlockHash
        assembly {
            creationRound := mload(add(_auxData, 32))
            creationRoundBlockHash := mload(add(_auxData, 64))
        }
    }
}

File 14 of 22 : MixinWrappers.sol
// SPDX-License-Identifier: MIT
pragma solidity 0.8.9;

import "./interfaces/MTicketBrokerCore.sol";
import "./MixinContractRegistry.sol";

abstract contract MixinWrappers is MixinContractRegistry, MTicketBrokerCore {
    /**
     * @notice Redeems multiple winning tickets. The function will redeem all of the provided tickets and handle any failures gracefully without reverting the entire function
     * @param _tickets Array of winning tickets to be redeemed in order to claim payment
     * @param _sigs Array of sender signatures over the hash of tickets (`_sigs[i]` corresponds to `_tickets[i]`)
     * @param _recipientRands Array of preimages for the recipientRandHash included in each ticket (`_recipientRands[i]` corresponds to `_tickets[i]`)
     */
    function batchRedeemWinningTickets(
        Ticket[] memory _tickets,
        bytes[] memory _sigs,
        uint256[] memory _recipientRands
    ) public whenSystemNotPaused currentRoundInitialized {
        for (uint256 i = 0; i < _tickets.length; i++) {
            redeemWinningTicketNoRevert(_tickets[i], _sigs[i], _recipientRands[i]);
        }
    }

    /**
     * @dev Redeems a winning ticket that has been signed by a sender and reveals the
     recipient recipientRand that corresponds to the recipientRandHash included in the ticket
     This function wraps `redeemWinningTicket()` and returns false if the underlying call reverts
     * @param _ticket Winning ticket to be redeemed in order to claim payment
     * @param _sig Sender's signature over the hash of `_ticket`
     * @param _recipientRand The preimage for the recipientRandHash included in `_ticket`
     * @return success Boolean indicating whether the underlying `redeemWinningTicket()` call succeeded
     */
    function redeemWinningTicketNoRevert(
        Ticket memory _ticket,
        bytes memory _sig,
        uint256 _recipientRand
    ) internal returns (bool success) {
        // ABI encode calldata for `redeemWinningTicket()`
        // A tuple type is used to represent the Ticket struct in the function signature
        bytes memory redeemWinningTicketCalldata = abi.encodeWithSignature(
            "redeemWinningTicket((address,address,uint256,uint256,uint256,bytes32,bytes),bytes,uint256)",
            _ticket,
            _sig,
            _recipientRand
        );

        // Call `redeemWinningTicket()`
        // solium-disable-next-line
        (success, ) = address(this).call(redeemWinningTicketCalldata);
    }
}

File 15 of 22 : MContractRegistry.sol
// SPDX-License-Identifier: MIT
pragma solidity 0.8.9;

import "../../../bonding/IBondingManager.sol";
import "../../../token/IMinter.sol";
import "../../../rounds/IRoundsManager.sol";

abstract contract MContractRegistry {
    /**
     * @notice Checks if the current round has been initialized
     * @dev Executes the 'currentRoundInitialized' modifier in 'MixinContractRegistry'
     */
    modifier currentRoundInitialized() virtual {
        _;
    }

    /**
     * @dev Returns an instance of the IBondingManager interface
     */
    function bondingManager() internal view virtual returns (IBondingManager);

    /**
     * @dev Returns an instance of the IMinter interface
     */
    function minter() internal view virtual returns (IMinter);

    /**
     * @dev Returns an instance of the IRoundsManager interface
     */
    function roundsManager() internal view virtual returns (IRoundsManager);
}

File 16 of 22 : MReserve.sol
// SPDX-License-Identifier: MIT
pragma solidity 0.8.9;

abstract contract MReserve {
    struct ReserveInfo {
        uint256 fundsRemaining; // Funds remaining in reserve
        uint256 claimedInCurrentRound; // Funds claimed from reserve in current round
    }

    // Emitted when funds are added to a reserve
    event ReserveFunded(address indexed reserveHolder, uint256 amount);
    // Emitted when funds are claimed from a reserve
    event ReserveClaimed(address indexed reserveHolder, address claimant, uint256 amount);

    /**
     * @notice Returns info about a reserve
     * @param _reserveHolder Address of reserve holder
     * @return info Info about the reserve for `_reserveHolder`
     */
    function getReserveInfo(address _reserveHolder) public view virtual returns (ReserveInfo memory info);

    /**
     * @notice Returns the amount of funds claimed by a claimant from a reserve
     * @param _reserveHolder Address of reserve holder
     * @param _claimant Address of claimant
     * @return Amount of funds claimed by `_claimant` from the reserve for `_reserveHolder`
     */
    function claimedReserve(address _reserveHolder, address _claimant) public view virtual returns (uint256);

    /**
     * @dev Adds funds to a reserve
     * @param _reserveHolder Address of reserve holder
     * @param _amount Amount of funds to add to reserve
     */
    function addReserve(address _reserveHolder, uint256 _amount) internal virtual;

    /**
     * @dev Clears contract storage used for a reserve
     * @param _reserveHolder Address of reserve holder
     */
    function clearReserve(address _reserveHolder) internal virtual;

    /**
     * @dev Claims funds from a reserve
     * @param _reserveHolder Address of reserve holder
     * @param _claimant Address of claimant
     * @param _amount Amount of funds to claim from the reserve
     * @return Amount of funds (<= `_amount`) claimed by `_claimant` from the reserve for `_reserveHolder`
     */
    function claimFromReserve(
        address _reserveHolder,
        address _claimant,
        uint256 _amount
    ) internal virtual returns (uint256);

    /**
     * @dev Returns the amount of funds remaining in a reserve
     * @param _reserveHolder Address of reserve holder
     * @return Amount of funds remaining in the reserve for `_reserveHolder`
     */
    function remainingReserve(address _reserveHolder) internal view virtual returns (uint256);
}

File 17 of 22 : MTicketBrokerCore.sol
// SPDX-License-Identifier: MIT
pragma solidity 0.8.9;

abstract contract MTicketBrokerCore {
    struct Ticket {
        address recipient; // Address of ticket recipient
        address sender; // Address of ticket sender
        uint256 faceValue; // Face value of ticket paid to recipient if ticket wins
        uint256 winProb; // Probability ticket will win represented as winProb / (2^256 - 1)
        uint256 senderNonce; // Sender's monotonically increasing counter for each ticket
        bytes32 recipientRandHash; // keccak256 hash commitment to recipient's random value
        bytes auxData; // Auxilary data included in ticket used for additional validation
    }

    // Emitted when funds are added to a sender's deposit
    event DepositFunded(address indexed sender, uint256 amount);
    // Emitted when a winning ticket is redeemed
    event WinningTicketRedeemed(
        address indexed sender,
        address indexed recipient,
        uint256 faceValue,
        uint256 winProb,
        uint256 senderNonce,
        uint256 recipientRand,
        bytes auxData
    );
    // Emitted when a funds transfer for a winning ticket redemption is executed
    event WinningTicketTransfer(address indexed sender, address indexed recipient, uint256 amount);
    // Emitted when a sender requests an unlock
    event Unlock(address indexed sender, uint256 startRound, uint256 endRound);
    // Emitted when a sender cancels an unlock
    event UnlockCancelled(address indexed sender);
    // Emitted when a sender withdraws its deposit & reserve
    event Withdrawal(address indexed sender, uint256 deposit, uint256 reserve);
}

File 18 of 22 : MTicketProcessor.sol
// SPDX-License-Identifier: MIT
pragma solidity 0.8.9;

abstract contract MTicketProcessor {
    /**
     * @dev Process sent funds.
     * @param _amount Amount of funds sent
     */
    function processFunding(uint256 _amount) internal virtual;

    /**
     * @dev Transfer withdrawal funds for a ticket sender
     * @param _amount Amount of withdrawal funds
     */
    function withdrawTransfer(address payable _sender, uint256 _amount) internal virtual;

    /**
     * @dev Transfer funds for a recipient's winning ticket
     * @param _recipient Address of recipient
     * @param _amount Amount of funds for the winning ticket
     * @param _auxData Auxilary data for the winning ticket
     */
    function winningTicketTransfer(
        address _recipient,
        uint256 _amount,
        bytes memory _auxData
    ) internal virtual;

    /**
     * @dev Validates a ticket's auxilary data (succeeds or reverts)
     * @param _auxData Auxilary data inclueded in a ticket
     */
    function requireValidTicketAuxData(bytes memory _auxData) internal view virtual;
}

File 19 of 22 : IRoundsManager.sol
// SPDX-License-Identifier: MIT
pragma solidity 0.8.9;

/**
 * @title RoundsManager interface
 */
interface IRoundsManager {
    // Events
    event NewRound(uint256 indexed round, bytes32 blockHash);

    // Deprecated events
    // These event signatures can be used to construct the appropriate topic hashes to filter for past logs corresponding
    // to these deprecated events.
    // event NewRound(uint256 round)

    // External functions
    function initializeRound() external;

    function lipUpgradeRound(uint256 _lip) external view returns (uint256);

    // Public functions
    function blockNum() external view returns (uint256);

    function blockHash(uint256 _block) external view returns (bytes32);

    function blockHashForRound(uint256 _round) external view returns (bytes32);

    function currentRound() external view returns (uint256);

    function currentRoundStartBlock() external view returns (uint256);

    function currentRoundInitialized() external view returns (bool);

    function currentRoundLocked() external view returns (bool);
}

File 20 of 22 : IMinter.sol
// SPDX-License-Identifier: MIT
pragma solidity 0.8.9;

import "../IController.sol";

/**
 * @title Minter interface
 */
interface IMinter {
    // Events
    event SetCurrentRewardTokens(uint256 currentMintableTokens, uint256 currentInflation);

    // External functions
    function createReward(uint256 _fracNum, uint256 _fracDenom) external returns (uint256);

    function trustedTransferTokens(address _to, uint256 _amount) external;

    function trustedBurnTokens(uint256 _amount) external;

    function trustedWithdrawETH(address payable _to, uint256 _amount) external;

    function depositETH() external payable returns (bool);

    function setCurrentRewardTokens() external;

    function currentMintableTokens() external view returns (uint256);

    function currentMintedTokens() external view returns (uint256);

    // Public functions
    function getController() external view returns (IController);
}

File 21 of 22 : Ownable.sol
// SPDX-License-Identifier: MIT
pragma solidity 0.8.9;

/**
 * @title Ownable
 * @dev The Ownable contract has an owner address, and provides basic authorization control
 * functions, this simplifies the implementation of "user permissions".
 */
contract Ownable {
    address public owner;

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

    /**
     * @dev The Ownable constructor sets the original `owner` of the contract to the sender
     * account.
     */
    constructor() {
        owner = msg.sender;
    }

    /**
     * @dev Throws if called by any account other than the owner.
     */
    modifier onlyOwner() {
        require(msg.sender == owner);
        _;
    }

    /**
     * @dev Allows the current owner to transfer control of the contract to a newOwner.
     * @param newOwner The address to transfer ownership to.
     */
    function transferOwnership(address newOwner) public onlyOwner {
        require(newOwner != address(0));
        emit OwnershipTransferred(owner, newOwner);
        owner = newOwner;
    }
}

File 22 of 22 : Pausable.sol
// SPDX-License-Identifier: MIT
pragma solidity 0.8.9;

import "./Ownable.sol";

/**
 * @title Pausable
 * @dev Base contract which allows children to implement an emergency stop mechanism.
 */
contract Pausable is Ownable {
    event Pause();
    event Unpause();

    bool public paused;

    /**
     * @dev Modifier to make a function callable only when the contract is not paused.
     */
    modifier whenNotPaused() {
        require(!paused);
        _;
    }

    /**
     * @dev Modifier to make a function callable only when the contract is paused.
     */
    modifier whenPaused() {
        require(paused);
        _;
    }

    /**
     * @dev called by the owner to pause, triggers stopped state
     */
    function pause() public onlyOwner whenNotPaused {
        paused = true;
        emit Pause();
    }

    /**
     * @dev called by the owner to unpause, returns to normal state
     */
    function unpause() public onlyOwner whenPaused {
        paused = false;
        emit Unpause();
    }
}

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

Contract ABI

[{"inputs":[{"internalType":"address","name":"_controller","type":"address"}],"stateMutability":"nonpayable","type":"constructor"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"sender","type":"address"},{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"}],"name":"DepositFunded","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"string","name":"param","type":"string"}],"name":"ParameterUpdate","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"reserveHolder","type":"address"},{"indexed":false,"internalType":"address","name":"claimant","type":"address"},{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"}],"name":"ReserveClaimed","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"reserveHolder","type":"address"},{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"}],"name":"ReserveFunded","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"controller","type":"address"}],"name":"SetController","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"sender","type":"address"},{"indexed":false,"internalType":"uint256","name":"startRound","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"endRound","type":"uint256"}],"name":"Unlock","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"sender","type":"address"}],"name":"UnlockCancelled","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"sender","type":"address"},{"indexed":true,"internalType":"address","name":"recipient","type":"address"},{"indexed":false,"internalType":"uint256","name":"faceValue","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"winProb","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"senderNonce","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"recipientRand","type":"uint256"},{"indexed":false,"internalType":"bytes","name":"auxData","type":"bytes"}],"name":"WinningTicketRedeemed","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"sender","type":"address"},{"indexed":true,"internalType":"address","name":"recipient","type":"address"},{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"}],"name":"WinningTicketTransfer","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"sender","type":"address"},{"indexed":false,"internalType":"uint256","name":"deposit","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"reserve","type":"uint256"}],"name":"Withdrawal","type":"event"},{"inputs":[{"components":[{"internalType":"address","name":"recipient","type":"address"},{"internalType":"address","name":"sender","type":"address"},{"internalType":"uint256","name":"faceValue","type":"uint256"},{"internalType":"uint256","name":"winProb","type":"uint256"},{"internalType":"uint256","name":"senderNonce","type":"uint256"},{"internalType":"bytes32","name":"recipientRandHash","type":"bytes32"},{"internalType":"bytes","name":"auxData","type":"bytes"}],"internalType":"struct MTicketBrokerCore.Ticket[]","name":"_tickets","type":"tuple[]"},{"internalType":"bytes[]","name":"_sigs","type":"bytes[]"},{"internalType":"uint256[]","name":"_recipientRands","type":"uint256[]"}],"name":"batchRedeemWinningTickets","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"cancelUnlock","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_reserveHolder","type":"address"},{"internalType":"address","name":"_claimant","type":"address"}],"name":"claimableReserve","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_reserveHolder","type":"address"},{"internalType":"address","name":"_claimant","type":"address"}],"name":"claimedReserve","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"controller","outputs":[{"internalType":"contract IController","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"fundDeposit","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_depositAmount","type":"uint256"},{"internalType":"uint256","name":"_reserveAmount","type":"uint256"}],"name":"fundDepositAndReserve","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[{"internalType":"address","name":"_addr","type":"address"},{"internalType":"uint256","name":"_depositAmount","type":"uint256"},{"internalType":"uint256","name":"_reserveAmount","type":"uint256"}],"name":"fundDepositAndReserveFor","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[],"name":"fundReserve","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[{"internalType":"address","name":"_reserveHolder","type":"address"}],"name":"getReserveInfo","outputs":[{"components":[{"internalType":"uint256","name":"fundsRemaining","type":"uint256"},{"internalType":"uint256","name":"claimedInCurrentRound","type":"uint256"}],"internalType":"struct MReserve.ReserveInfo","name":"info","type":"tuple"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_sender","type":"address"}],"name":"getSenderInfo","outputs":[{"components":[{"internalType":"uint256","name":"deposit","type":"uint256"},{"internalType":"uint256","name":"withdrawRound","type":"uint256"}],"internalType":"struct MixinTicketBrokerCore.Sender","name":"sender","type":"tuple"},{"components":[{"internalType":"uint256","name":"fundsRemaining","type":"uint256"},{"internalType":"uint256","name":"claimedInCurrentRound","type":"uint256"}],"internalType":"struct MReserve.ReserveInfo","name":"reserve","type":"tuple"}],"stateMutability":"view","type":"function"},{"inputs":[{"components":[{"internalType":"address","name":"recipient","type":"address"},{"internalType":"address","name":"sender","type":"address"},{"internalType":"uint256","name":"faceValue","type":"uint256"},{"internalType":"uint256","name":"winProb","type":"uint256"},{"internalType":"uint256","name":"senderNonce","type":"uint256"},{"internalType":"bytes32","name":"recipientRandHash","type":"bytes32"},{"internalType":"bytes","name":"auxData","type":"bytes"}],"internalType":"struct MTicketBrokerCore.Ticket","name":"_ticket","type":"tuple"}],"name":"getTicketHash","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"pure","type":"function"},{"inputs":[{"internalType":"address","name":"_sender","type":"address"}],"name":"isUnlockInProgress","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"components":[{"internalType":"address","name":"recipient","type":"address"},{"internalType":"address","name":"sender","type":"address"},{"internalType":"uint256","name":"faceValue","type":"uint256"},{"internalType":"uint256","name":"winProb","type":"uint256"},{"internalType":"uint256","name":"senderNonce","type":"uint256"},{"internalType":"bytes32","name":"recipientRandHash","type":"bytes32"},{"internalType":"bytes","name":"auxData","type":"bytes"}],"internalType":"struct MTicketBrokerCore.Ticket","name":"_ticket","type":"tuple"},{"internalType":"bytes","name":"_sig","type":"bytes"},{"internalType":"uint256","name":"_recipientRand","type":"uint256"}],"name":"redeemWinningTicket","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_controller","type":"address"}],"name":"setController","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_ticketValidityPeriod","type":"uint256"}],"name":"setTicketValidityPeriod","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_unlockPeriod","type":"uint256"}],"name":"setUnlockPeriod","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"targetContractId","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"ticketValidityPeriod","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"unlock","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"unlockPeriod","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"name":"usedTickets","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"withdraw","outputs":[],"stateMutability":"nonpayable","type":"function"}]

60806040523480156200001157600080fd5b5060405162002fb038038062002fb083398101604081905262000034916200005a565b600080546001600160a01b0319166001600160a01b03929092169190911790556200008c565b6000602082840312156200006d57600080fd5b81516001600160a01b03811681146200008557600080fd5b9392505050565b612f14806200009c6000396000f3fe6080604052600436106101405760003560e01c806381779f38116100b6578063c2c4c2c81161006f578063c2c4c2c814610329578063c92978081461033e578063d01b808e1461035e578063e1a589da1461037e578063ec8b3cb6146103ac578063f77c4791146103cc57600080fd5b806381779f381461028b578063856a2cf8146102ab57806392eefe9b146102c1578063989f789c146102e1578063a69df4b5146102f4578063b03fa8641461030957600080fd5b8063511f407311610108578063511f4073146101f557806351720b411461020857806359a515ba1461021e5780635b6333eb1461024e5780636caa736b1461027b5780636f9c3c8f1461028357600080fd5b8063121cdcc21461014557806320d3a0b41461017a5780633ccfd60b1461019e5780633d0ddf84146101b55780634ac826da146101d5575b600080fd5b34801561015157600080fd5b506101656101603660046126c0565b610404565b60405190151581526020015b60405180910390f35b34801561018657600080fd5b5061019060045481565b604051908152602001610171565b3480156101aa57600080fd5b506101b3610440565b005b3480156101c157600080fd5b506101b36101d03660046126dd565b6105c6565b3480156101e157600080fd5b506101906101f03660046126f6565b61062d565b6101b361020336600461272f565b6106ef565b34801561021457600080fd5b5061019060015481565b34801561022a57600080fd5b506101656102393660046126dd565b60056020526000908152604090205460ff1681565b34801561025a57600080fd5b5061026e6102693660046126c0565b6106fe565b6040516101719190612751565b6101b36107cc565b6101b3610862565b34801561029757600080fd5b506101906102a63660046126f6565b6108bd565b3480156102b757600080fd5b5061019060065481565b3480156102cd57600080fd5b506101b36102dc3660046126c0565b610ad2565b6101b36102ef366004612768565b610b28565b34801561030057600080fd5b506101b3610cb7565b34801561031557600080fd5b5061019061032436600461290f565b610e4b565b34801561033557600080fd5b506101b3610e9d565b34801561034a57600080fd5b506101b36103593660046126dd565b610ec3565b34801561036a57600080fd5b506101b3610379366004612a5b565b610f8b565b34801561038a57600080fd5b5061039e6103993660046126c0565b6110d2565b604051610171929190612b53565b3480156103b857600080fd5b506101b36103c7366004612b79565b611133565b3480156103d857600080fd5b506000546103ec906001600160a01b031681565b6040516001600160a01b039091168152602001610171565b6001600160a01b0381166000908152600360209081526040808320815180830190925280548252600101549181018290529015155b9392505050565b610448611445565b33600090815260036020908152604080832080546002909352922054811515806104725750600081115b6104975760405162461bcd60e51b815260040161048e90612be6565b60405180910390fd5b6040805180820190915283548152600184015460209091018190526104fe5760405162461bcd60e51b815260206004820152601d60248201527f6e6f20756e6c6f636b207265717565737420696e2070726f6772657373000000604482015260640161048e565b60408051808201909152835481526001840154602082015261051f9061150b565b156105605760405162461bcd60e51b81526020600482015260116024820152701858d8dbdd5b9d081a5cc81b1bd8dad959607a1b604482015260640161048e565b60008084553381526002602052604081205561058533610580848461159f565b6115ab565b604080518381526020810183905233917fdf273cb619d95419a9cd0ec88123a0538c85064229baa6363788f743fff90deb91015b60405180910390a2505050565b6105ce61161b565b60048190556040517f9f5033568d78ae30f29f01e944f97b2216493bd19d1b46d429673acff3dcd67490610622906020808252600c908201526b1d5b9b1bd8dad4195c9a5bd960a21b604082015260600190565b60405180910390a150565b6001600160a01b03821660009081526002602052604081208161064e6116ff565b6001600160a01b0316638a19c8bc6040518163ffffffff1660e01b815260040160206040518083038186803b15801561068657600080fd5b505afa15801561069a573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906106be9190612c29565b60009081526002909201602090815260408084206001600160a01b0387168552909152909120549150505b92915050565b6106fa338383610b28565b5050565b604080518082018252600080825260208083018290526001600160a01b0385168083526002808352948320805485529083529390529091600101906107416116ff565b6001600160a01b0316638a19c8bc6040518163ffffffff1660e01b815260040160206040518083038186803b15801561077957600080fd5b505afa15801561078d573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906107b19190612c29565b81526020808201929092526040016000205490820152919050565b6107d4611445565b33600081815260036020526040902080543491906107f2908361159f565b80825560408051808201909152908152600182015460209091018190521561081e5761081e81846117a1565b61082734611846565b826001600160a01b03167f5159e237d952190e68d5215430f305831be7c9c8776d1377c76679ae4773413f836040516105b991815260200190565b61086a611445565b336000818152600360205260409020349061088583836118c1565b604080518082019091528154815260018201546020909101819052156108af576108af81846117a1565b6108b834611846565b505050565b6001600160a01b0382166000908152600260205260408120816108de6116ff565b6001600160a01b0316638a19c8bc6040518163ffffffff1660e01b815260040160206040518083038186803b15801561091657600080fd5b505afa15801561092a573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061094e9190612c29565b9050610958611933565b60405163022008dd60e21b81526001600160a01b038681166004830152919091169063088023749060240160206040518083038186803b15801561099b57600080fd5b505afa1580156109af573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906109d39190612c42565b6109e2576000925050506106e9565b60006109ec611933565b6001600160a01b0316632a4e0d556040518163ffffffff1660e01b815260040160206040518083038186803b158015610a2457600080fd5b505afa158015610a38573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610a5c9190612c29565b905080610a6f57600093505050506106e9565b60008281526001840160205260408120548454610a8b9161159f565b600084815260028601602090815260408083206001600160a01b038b168452909152902054909150610ac790610ac18385611984565b90611990565b979650505050505050565b610ada61199c565b600080546001600160a01b0319166001600160a01b0383169081179091556040519081527f4ff638452bbf33c012645d18ae6f05515ff5f2d1dfb0cece8cbf018c60903f7090602001610622565b610b30611445565b8181610b3c828261159f565b3414610bba5760405162461bcd60e51b815260206004820152604160248201527f6d73672e76616c756520646f6573206e6f7420657175616c2073756d206f662060448201527f6465706f73697420616d6f756e7420616e64207265736572766520616d6f756e6064820152601d60fa1b608482015260a40161048e565b6001600160a01b0385166000908152600360205260409020805486918691610be2908361159f565b808255604080518082019091529081526001820154602090910181905215610c0e57610c0e81846117a1565b6001600160a01b038816600090815260036020526040902088908790610c3483836118c1565b60408051808201909152815481526001820154602090910181905215610c5e57610c5e81846117a1565b610c6734611846565b505050826001600160a01b03167f5159e237d952190e68d5215430f305831be7c9c8776d1377c76679ae4773413f83604051610ca591815260200190565b60405180910390a25050505050505050565b610cbf611445565b3360009081526003602052604090208054151580610cea575033600090815260026020526040812054115b610d065760405162461bcd60e51b815260040161048e90612be6565b60408051808201909152815481526001820154602090910181905215610d6e5760405162461bcd60e51b815260206004820152601860248201527f756e6c6f636b20616c726561647920696e697469617465640000000000000000604482015260640161048e565b6000610d786116ff565b6001600160a01b0316638a19c8bc6040518163ffffffff1660e01b815260040160206040518083038186803b158015610db057600080fd5b505afa158015610dc4573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610de89190612c29565b9050610dff6004548261159f90919063ffffffff16565b6001830181905560405133917ff7870c5b224cbc19873599e46ccfc7103934650509b1af0c3ce90138377c200491610e3f91858252602082015260400190565b60405180910390a25050565b80516020808301516040808501516060860151608087015160a088015160c08901519451600098610e80989097969101612c90565b604051602081830303815290604052805190602001209050919050565b610ea5611445565b33600081815260036020526040902090610ec09082906117a1565b50565b610ecb61161b565b60008111610f2f5760405162461bcd60e51b815260206004820152602b60248201527f7469636b657456616c6964697479506572696f64206d7573742062652067726560448201526a061746572207468616e20360ac1b606482015260840161048e565b60068190556040517f9f5033568d78ae30f29f01e944f97b2216493bd19d1b46d429673acff3dcd67490610622906020808252601490820152731d1a58dad95d15985b1a591a5d1e54195c9a5bd960621b604082015260600190565b610f93611445565b610f9b6116ff565b6001600160a01b031663219bc76c6040518163ffffffff1660e01b815260040160206040518083038186803b158015610fd357600080fd5b505afa158015610fe7573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061100b9190612c42565b6110575760405162461bcd60e51b815260206004820181905260248201527f63757272656e7420726f756e64206973206e6f7420696e697469616c697a6564604482015260640161048e565b60005b83518110156110cc576110b984828151811061107857611078612cf2565b602002602001015184838151811061109257611092612cf2565b60200260200101518484815181106110ac576110ac612cf2565b60200260200101516119f6565b50806110c481612d1e565b91505061105a565b50505050565b60408051808201825260008082526020918201819052825180840184528181528083018290526001600160a01b03851682526003835290839020835180850190945280548452600101549183019190915261112c836106fe565b9050915091565b61113b611445565b6111436116ff565b6001600160a01b031663219bc76c6040518163ffffffff1660e01b815260040160206040518083038186803b15801561117b57600080fd5b505afa15801561118f573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906111b39190612c42565b6111ff5760405162461bcd60e51b815260206004820181905260248201527f63757272656e7420726f756e64206973206e6f7420696e697469616c697a6564604482015260640161048e565b600061120a84610e4b565b905061121884828585611a97565b6020808501516001600160a01b03166000908152600382526040908190208151808301909252805482526001810154928201929092526112579061150b565b6112985760405162461bcd60e51b81526020600482015260126024820152711cd95b99195c881a5cc81d5b9b1bd8dad95960721b604482015260640161048e565b80541515806112c9575060006112c786602001516001600160a01b031660009081526002602052604090205490565b115b6112e55760405162461bcd60e51b815260040161048e90612be6565b600082815260056020526040808220805460ff19166001179055825490870151111561134e5761134361133b8760200151886000015161133686600001548b6040015161199090919063ffffffff16565b611ce6565b83549061159f565b600083559050611363565b50604085015181546113609082611990565b82555b80156113d25761137c8660000151828860c00151611e7e565b85600001516001600160a01b031686602001516001600160a01b03167f8b87351a208c06e3ceee59d80725fd77a23b4129e1b51ca231fc89b40712649c836040516113c991815260200190565b60405180910390a35b85600001516001600160a01b031686602001516001600160a01b03167fc389eb51ed006dbf2528507f010efdf5225ea596e1e1741d74f550dab1925ee7886040015189606001518a60800151898c60c00151604051611435959493929190612d65565b60405180910390a3505050505050565b60008054906101000a90046001600160a01b03166001600160a01b0316635c975abb6040518163ffffffff1660e01b815260040160206040518083038186803b15801561149157600080fd5b505afa1580156114a5573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906114c99190612c42565b156115095760405162461bcd60e51b815260206004820152601060248201526f1cde5cdd195b481a5cc81c185d5cd95960821b604482015260640161048e565b565b60008160200151600014806106e9575081602001516115286116ff565b6001600160a01b0316638a19c8bc6040518163ffffffff1660e01b815260040160206040518083038186803b15801561156057600080fd5b505afa158015611574573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906115989190612c29565b1092915050565b60006104398284612d90565b6115b3611f05565b6040516320283da960e01b81526001600160a01b0384811660048301526024820184905291909116906320283da990604401600060405180830381600087803b1580156115ff57600080fd5b505af1158015611613573d6000803e3d6000fd5b505050505050565b60008054906101000a90046001600160a01b03166001600160a01b0316638da5cb5b6040518163ffffffff1660e01b815260040160206040518083038186803b15801561166757600080fd5b505afa15801561167b573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061169f9190612da8565b6001600160a01b0316336001600160a01b0316146115095760405162461bcd60e51b815260206004820152601f60248201527f63616c6c6572206d75737420626520436f6e74726f6c6c6572206f776e657200604482015260640161048e565b60008054604051631c2d8fb360e31b81527fe8438ea868df48e3fc21f2f087b993c9b1837dc0f6135064161ce7d7a1701fe860048201526001600160a01b039091169063e16c7d98906024015b60206040518083038186803b15801561176457600080fd5b505afa158015611778573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061179c9190612da8565b905090565b6040805180820190915282548152600183015460209091018190526118085760405162461bcd60e51b815260206004820152601d60248201527f6e6f20756e6c6f636b207265717565737420696e2070726f6772657373000000604482015260640161048e565b6000600183018190556040516001600160a01b038316917ffa044b7b93a40365dc68049797c2eb06918523d694e5d56e406cac3eb35578e591a25050565b61184e611f05565b6001600160a01b031663f6326fb3826040518263ffffffff1660e01b81526004016020604051808303818588803b15801561188857600080fd5b505af115801561189c573d6000803e3d6000fd5b50505050506040513d601f19601f820116820180604052508101906106fa9190612c42565b6001600160a01b0382166000908152600260205260409020546118e4908261159f565b6001600160a01b038316600081815260026020526040908190209290925590517fb52b99b9e83551fcbd069b559cc3e823e2a1a3bad8ece46561ea77524394c85090610e3f9084815260200190565b60008054604051631c2d8fb360e31b81527f2517d59a36a86548e38734e8ab416f42afff4bca78706a66ad65750dae7f9e3760048201526001600160a01b039091169063e16c7d989060240161174c565b60006104398284612dc5565b60006104398284612de7565b6000546001600160a01b031633146115095760405162461bcd60e51b815260206004820152601960248201527f63616c6c6572206d75737420626520436f6e74726f6c6c657200000000000000604482015260640161048e565b600080848484604051602401611a0e93929190612dfe565b60408051601f198184030181529181526020820180516001600160e01b03166376459e5b60e11b179052519091503090611a49908390612e8a565b6000604051808303816000865af19150503d8060008114611a86576040519150601f19603f3d011682016040523d82523d6000602084013e611a8b565b606091505b50909695505050505050565b83516001600160a01b0316611aee5760405162461bcd60e51b815260206004820181905260248201527f7469636b657420726563697069656e74206973206e756c6c2061646472657373604482015260640161048e565b60208401516001600160a01b0316611b485760405162461bcd60e51b815260206004820152601d60248201527f7469636b65742073656e646572206973206e756c6c2061646472657373000000604482015260640161048e565b611b558460c00151611f56565b60a08401516040805160208101849052016040516020818303038152906040528051906020012014611be05760405162461bcd60e51b815260206004820152602e60248201527f726563697069656e7452616e6420646f6573206e6f74206d617463682072656360448201526d0d2e0d2cadce8a4c2dcc890c2e6d60931b606482015260840161048e565b60008381526005602052604090205460ff1615611c305760405162461bcd60e51b815260206004820152600e60248201526d1d1a58dad95d081a5cc81d5cd95960921b604482015260640161048e565b611c3f846020015183856121a3565b611c965760405162461bcd60e51b815260206004820152602260248201527f696e76616c6964207369676e6174757265206f766572207469636b65742068616044820152610e6d60f31b606482015260840161048e565b611ca58282866060015161223d565b6110cc5760405162461bcd60e51b81526020600482015260126024820152713a34b1b5b2ba103234b2103737ba103bb4b760711b604482015260640161048e565b600080611cf385856108bd565b90506000818411611d045783611d06565b815b90508015611e75576000611d186116ff565b6001600160a01b0316638a19c8bc6040518163ffffffff1660e01b815260040160206040518083038186803b158015611d5057600080fd5b505afa158015611d64573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611d889190612c29565b6001600160a01b0388166000908152600260209081526040808320848452600181019092529091205491925090611dbf908461159f565b60008381526001830160209081526040808320939093556002840181528282206001600160a01b038b16835290522054611df9908461159f565b600083815260028301602090815260408083206001600160a01b038c1684529091529020558054611e2a9084611990565b8155604080516001600160a01b038981168252602082018690528a16917f5c2b394723f408a40a60335e24b71829642e35f350cebe2036a96a66e895ea98910160405180910390a250505b95945050505050565b6000611e8982612274565b509050611e94611933565b604051630ebad44b60e21b81526001600160a01b03868116600483015260248201869052604482018490529190911690633aeb512c90606401600060405180830381600087803b158015611ee757600080fd5b505af1158015611efb573d6000803e3d6000fd5b5050505050505050565b60008054604051631c2d8fb360e31b81527f6e58ad548d72b425ea94c15f453bf26caddb061d82b2551db7fdd3cefe0e994060048201526001600160a01b039091169063e16c7d989060240161174c565b600080611f6283612274565b915091506000611f706116ff565b6001600160a01b0316633aa4add4846040518263ffffffff1660e01b8152600401611f9d91815260200190565b60206040518083038186803b158015611fb557600080fd5b505afa158015611fc9573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611fed9190612c29565b9050806120545760405162461bcd60e51b815260206004820152602f60248201527f7469636b6574206372656174696f6e526f756e6420646f6573206e6f7420686160448201526e0ecca40c240c4d8dec6d640d0c2e6d608b1b606482015260840161048e565b8082146120c95760405162461bcd60e51b815260206004820152603760248201527f7469636b6574206372656174696f6e526f756e64426c6f636b4861736820696e60448201527f76616c696420666f72206372656174696f6e526f756e64000000000000000000606482015260840161048e565b60006120d36116ff565b6001600160a01b0316638a19c8bc6040518163ffffffff1660e01b815260040160206040518083038186803b15801561210b57600080fd5b505afa15801561211f573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906121439190612c29565b90508061215b6006548661159f90919063ffffffff16565b1161219c5760405162461bcd60e51b81526020600482015260116024820152701d1a58dad95d081a5cc8195e1c1a5c9959607a1b604482015260640161048e565b5050505050565b600082516041146121f65760405162461bcd60e51b815260206004820152601860248201527f494e56414c49445f5349474e41545552455f4c454e4754480000000000000000604482015260640161048e565b600061220a612204846122f5565b85612330565b90506001600160a01b03811615801590611e755750806001600160a01b0316856001600160a01b03161495945050505050565b6000818484604051602001612253929190612ea6565b60408051601f19818403018152919052805160209091012010949350505050565b60008082516040146122e45760405162461bcd60e51b815260206004820152603360248201527f696e76616c6964206c656e67746820666f72207469636b657420617578446174604482015272613a206d75737420626520363420627974657360681b606482015260840161048e565b505060208101516040909101519091565b6040517f19457468657265756d205369676e6564204d6573736167653a0a3332000000006020820152603c8101829052600090605c01610e80565b600080600061233f8585612354565b9150915061234c816123c4565b509392505050565b60008082516041141561238b5760208301516040840151606085015160001a61237f8782858561257f565b945094505050506123bd565b8251604014156123b557602083015160408401516123aa86838361266c565b9350935050506123bd565b506000905060025b9250929050565b60008160048111156123d8576123d8612ec8565b14156123e15750565b60018160048111156123f5576123f5612ec8565b14156124435760405162461bcd60e51b815260206004820152601860248201527f45434453413a20696e76616c6964207369676e61747572650000000000000000604482015260640161048e565b600281600481111561245757612457612ec8565b14156124a55760405162461bcd60e51b815260206004820152601f60248201527f45434453413a20696e76616c6964207369676e6174757265206c656e67746800604482015260640161048e565b60038160048111156124b9576124b9612ec8565b14156125125760405162461bcd60e51b815260206004820152602260248201527f45434453413a20696e76616c6964207369676e6174757265202773272076616c604482015261756560f01b606482015260840161048e565b600481600481111561252657612526612ec8565b1415610ec05760405162461bcd60e51b815260206004820152602260248201527f45434453413a20696e76616c6964207369676e6174757265202776272076616c604482015261756560f01b606482015260840161048e565b6000807f7fffffffffffffffffffffffffffffff5d576e7357a4501ddfe92f46681b20a08311156125b65750600090506003612663565b8460ff16601b141580156125ce57508460ff16601c14155b156125df5750600090506004612663565b6040805160008082526020820180845289905260ff881692820192909252606081018690526080810185905260019060a0016020604051602081039080840390855afa158015612633573d6000803e3d6000fd5b5050604051601f1901519150506001600160a01b03811661265c57600060019250925050612663565b9150600090505b94509492505050565b6000806001600160ff1b03831660ff84901c601b0161268d8782888561257f565b935093505050935093915050565b6001600160a01b0381168114610ec057600080fd5b80356126bb8161269b565b919050565b6000602082840312156126d257600080fd5b81356104398161269b565b6000602082840312156126ef57600080fd5b5035919050565b6000806040838503121561270957600080fd5b82356127148161269b565b915060208301356127248161269b565b809150509250929050565b6000806040838503121561274257600080fd5b50508035926020909101359150565b8151815260208083015190820152604081016106e9565b60008060006060848603121561277d57600080fd5b83356127888161269b565b95602085013595506040909401359392505050565b634e487b7160e01b600052604160045260246000fd5b60405160e0810167ffffffffffffffff811182821017156127d6576127d661279d565b60405290565b604051601f8201601f1916810167ffffffffffffffff811182821017156128055761280561279d565b604052919050565b600082601f83011261281e57600080fd5b813567ffffffffffffffff8111156128385761283861279d565b61284b601f8201601f19166020016127dc565b81815284602083860101111561286057600080fd5b816020850160208301376000918101602001919091529392505050565b600060e0828403121561288f57600080fd5b6128976127b3565b90506128a2826126b0565b81526128b0602083016126b0565b602082015260408201356040820152606082013560608201526080820135608082015260a082013560a082015260c082013567ffffffffffffffff8111156128f757600080fd5b6129038482850161280d565b60c08301525092915050565b60006020828403121561292157600080fd5b813567ffffffffffffffff81111561293857600080fd5b6129448482850161287d565b949350505050565b600067ffffffffffffffff8211156129665761296661279d565b5060051b60200190565b600082601f83011261298157600080fd5b813560206129966129918361294c565b6127dc565b82815260059290921b840181019181810190868411156129b557600080fd5b8286015b848110156129f557803567ffffffffffffffff8111156129d95760008081fd5b6129e78986838b010161280d565b8452509183019183016129b9565b509695505050505050565b600082601f830112612a1157600080fd5b81356020612a216129918361294c565b82815260059290921b84018101918181019086841115612a4057600080fd5b8286015b848110156129f55780358352918301918301612a44565b600080600060608486031215612a7057600080fd5b833567ffffffffffffffff80821115612a8857600080fd5b818601915086601f830112612a9c57600080fd5b81356020612aac6129918361294c565b82815260059290921b8401810191818101908a841115612acb57600080fd5b8286015b84811015612b0357803586811115612ae75760008081fd5b612af58d86838b010161287d565b845250918301918301612acf565b5097505087013592505080821115612b1a57600080fd5b612b2687838801612970565b93506040860135915080821115612b3c57600080fd5b50612b4986828701612a00565b9150509250925092565b825181526020808401518183015282516040830152820151606082015260808101610439565b600080600060608486031215612b8e57600080fd5b833567ffffffffffffffff80821115612ba657600080fd5b612bb28783880161287d565b94506020860135915080821115612bc857600080fd5b50612bd58682870161280d565b925050604084013590509250925092565b60208082526023908201527f73656e646572206465706f73697420616e64207265736572766520617265207a60408201526265726f60e81b606082015260800190565b600060208284031215612c3b57600080fd5b5051919050565b600060208284031215612c5457600080fd5b8151801515811461043957600080fd5b60005b83811015612c7f578181015183820152602001612c67565b838111156110cc5750506000910152565b60006bffffffffffffffffffffffff19808a60601b168352808960601b166014840152508660288301528560488301528460688301528360888301528251612cdf8160a8850160208701612c64565b9190910160a80198975050505050505050565b634e487b7160e01b600052603260045260246000fd5b634e487b7160e01b600052601160045260246000fd5b6000600019821415612d3257612d32612d08565b5060010190565b60008151808452612d51816020860160208601612c64565b601f01601f19169290920160200192915050565b85815284602082015283604082015282606082015260a060808201526000610ac760a0830184612d39565b60008219821115612da357612da3612d08565b500190565b600060208284031215612dba57600080fd5b81516104398161269b565b600082612de257634e487b7160e01b600052601260045260246000fd5b500490565b600082821015612df957612df9612d08565b500390565b60608152600060018060a01b0380865116606084015280602087015116608084015250604085015160a0830152606085015160c0830152608085015160e083015260a085015161010083015260c085015160e0610120840152612e65610140840182612d39565b90508281036020840152612e798186612d39565b915050826040830152949350505050565b60008251612e9c818460208701612c64565b9190910192915050565b60008351612eb8818460208801612c64565b9190910191825250602001919050565b634e487b7160e01b600052602160045260246000fdfea26469706673582212208c3e7caca484083884d0cfaede3b1bd63bef066a92632853811fd1321dbe68cd64736f6c63430008090033000000000000000000000000d8e8328501e9645d16cf49539efc04f734606ee4

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

000000000000000000000000d8e8328501e9645d16cf49539efc04f734606ee4

-----Decoded View---------------
Arg [0] : _controller (address): 0xd8e8328501e9645d16cf49539efc04f734606ee4

-----Encoded View---------------
1 Constructor Arguments found :
Arg [0] : 000000000000000000000000d8e8328501e9645d16cf49539efc04f734606ee4


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