Contract Address Details

0xd5242992fC9cdAcde09a2B9F40B0Ec6a9a19F72e

Contract Name
Bridge
Creator
0xfe74a7–1e6aa3 at 0xe843c5–d0dbfa
Balance
9,550 CHZ ( )
Tokens
Fetching tokens...
Transactions
22,619 Transactions
Transfers
3 Transfers
Gas Used
1,479,491,232
Last Balance Update
18881269
Contract name:
Bridge




Optimization enabled
false
Compiler version
v0.8.17+commit.8df45f5f




EVM Version
default




Verified at
2023-03-24T14:32:21.063743Z

Constructor Arguments

0x000000000000000000000000000000000000000000000000000000000000000100000000000000000000000000000000000000000000000000000000000000c000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000056bc75e2d63100000000000000000000000000000000000000000000000000000000000000000019000000000000000000000000000000000000000000000000000000000000001c000000000000000000000000000000000000000000000000000000000000000070000000000000000000000004b045692540e6b7afde44cdad60136d170efc623000000000000000000000000b0adf650abdc7d2d5ac7366888ab492e9df8589a00000000000000000000000052f30aefb50b5d271d93a10730088733bdbe31e00000000000000000000000001cb83a71d81dace297975e377777c94a32d9d5dd000000000000000000000000ae68f408160c40d508834734ac5bed773a36e9d20000000000000000000000003665dfcdaf8310684c24592b017d986a993320e6000000000000000000000000252b5ca6c838ae47508c1ea72dd73b58c607af0f00000000000000000000000000000000000000000000000000000000000000010000000000000000000000000000000000000000000000000000000000000000

Arg [0] (uint8) : 1
Arg [1] (address[]) : [0x4b045692540e6b7afde44cdad60136d170efc623, 0xb0adf650abdc7d2d5ac7366888ab492e9df8589a, 0x52f30aefb50b5d271d93a10730088733bdbe31e0, 0x1cb83a71d81dace297975e377777c94a32d9d5dd, 0xae68f408160c40d508834734ac5bed773a36e9d2, 0x3665dfcdaf8310684c24592b017d986a993320e6, 0x252b5ca6c838ae47508c1ea72dd73b58c607af0f]
Arg [2] (uint256) : 0
Arg [3] (uint256) : 100000000000000000000
Arg [4] (uint256) : 400
Arg [5] (uint8[]) : [0]

              

Contract source code

// File: @openzeppelin/contracts/access/IAccessControl.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (access/IAccessControl.sol)

pragma solidity ^0.8.0;

/**
 * @dev External interface of AccessControl declared to support ERC165 detection.
 */
interface IAccessControl {
    /**
     * @dev Emitted when `newAdminRole` is set as ``role``'s admin role, replacing `previousAdminRole`
     *
     * `DEFAULT_ADMIN_ROLE` is the starting admin for all roles, despite
     * {RoleAdminChanged} not being emitted signaling this.
     *
     * _Available since v3.1._
     */
    event RoleAdminChanged(bytes32 indexed role, bytes32 indexed previousAdminRole, bytes32 indexed newAdminRole);

    /**
     * @dev Emitted when `account` is granted `role`.
     *
     * `sender` is the account that originated the contract call, an admin role
     * bearer except when using {AccessControl-_setupRole}.
     */
    event RoleGranted(bytes32 indexed role, address indexed account, address indexed sender);

    /**
     * @dev Emitted when `account` is revoked `role`.
     *
     * `sender` is the account that originated the contract call:
     *   - if using `revokeRole`, it is the admin role bearer
     *   - if using `renounceRole`, it is the role bearer (i.e. `account`)
     */
    event RoleRevoked(bytes32 indexed role, address indexed account, address indexed sender);

    /**
     * @dev Returns `true` if `account` has been granted `role`.
     */
    function hasRole(bytes32 role, address account) external view returns (bool);

    /**
     * @dev Returns the admin role that controls `role`. See {grantRole} and
     * {revokeRole}.
     *
     * To change a role's admin, use {AccessControl-_setRoleAdmin}.
     */
    function getRoleAdmin(bytes32 role) external view returns (bytes32);

    /**
     * @dev Grants `role` to `account`.
     *
     * If `account` had not been already granted `role`, emits a {RoleGranted}
     * event.
     *
     * Requirements:
     *
     * - the caller must have ``role``'s admin role.
     */
    function grantRole(bytes32 role, address account) external;

    /**
     * @dev Revokes `role` from `account`.
     *
     * If `account` had been granted `role`, emits a {RoleRevoked} event.
     *
     * Requirements:
     *
     * - the caller must have ``role``'s admin role.
     */
    function revokeRole(bytes32 role, address account) external;

    /**
     * @dev Revokes `role` from the calling account.
     *
     * Roles are often managed via {grantRole} and {revokeRole}: this function's
     * purpose is to provide a mechanism for accounts to lose their privileges
     * if they are compromised (such as when a trusted device is misplaced).
     *
     * If the calling account had been granted `role`, emits a {RoleRevoked}
     * event.
     *
     * Requirements:
     *
     * - the caller must be `account`.
     */
    function renounceRole(bytes32 role, address account) external;
}

// File: @openzeppelin/contracts/utils/Context.sol

// OpenZeppelin Contracts v4.4.1 (utils/Context.sol)

pragma solidity ^0.8.0;

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

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

// File: @openzeppelin/contracts/utils/math/Math.sol

// OpenZeppelin Contracts (last updated v4.8.0) (utils/math/Math.sol)

pragma solidity ^0.8.0;

/**
 * @dev Standard math utilities missing in the Solidity language.
 */
library Math {
    enum Rounding {
        Down, // Toward negative infinity
        Up, // Toward infinity
        Zero // Toward zero
    }

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

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

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

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

    /**
     * @notice Calculates floor(x * y / denominator) with full precision. Throws if result overflows a uint256 or denominator == 0
     * @dev Original credit to Remco Bloemen under MIT license (https://xn--2-umb.com/21/muldiv)
     * with further edits by Uniswap Labs also under MIT license.
     */
    function mulDiv(
        uint256 x,
        uint256 y,
        uint256 denominator
    ) internal pure returns (uint256 result) {
        unchecked {
            // 512-bit multiply [prod1 prod0] = x * y. Compute the product mod 2^256 and mod 2^256 - 1, then use
            // use the Chinese Remainder Theorem to reconstruct the 512 bit result. The result is stored in two 256
            // variables such that product = prod1 * 2^256 + prod0.
            uint256 prod0; // Least significant 256 bits of the product
            uint256 prod1; // Most significant 256 bits of the product
            assembly {
                let mm := mulmod(x, y, not(0))
                prod0 := mul(x, y)
                prod1 := sub(sub(mm, prod0), lt(mm, prod0))
            }

            // Handle non-overflow cases, 256 by 256 division.
            if (prod1 == 0) {
                return prod0 / denominator;
            }

            // Make sure the result is less than 2^256. Also prevents denominator == 0.
            require(denominator > prod1);

            ///////////////////////////////////////////////
            // 512 by 256 division.
            ///////////////////////////////////////////////

            // Make division exact by subtracting the remainder from [prod1 prod0].
            uint256 remainder;
            assembly {
                // Compute remainder using mulmod.
                remainder := mulmod(x, y, denominator)

                // Subtract 256 bit number from 512 bit number.
                prod1 := sub(prod1, gt(remainder, prod0))
                prod0 := sub(prod0, remainder)
            }

            // Factor powers of two out of denominator and compute largest power of two divisor of denominator. Always >= 1.
            // See https://cs.stackexchange.com/q/138556/92363.

            // Does not overflow because the denominator cannot be zero at this stage in the function.
            uint256 twos = denominator & (~denominator + 1);
            assembly {
                // Divide denominator by twos.
                denominator := div(denominator, twos)

                // Divide [prod1 prod0] by twos.
                prod0 := div(prod0, twos)

                // Flip twos such that it is 2^256 / twos. If twos is zero, then it becomes one.
                twos := add(div(sub(0, twos), twos), 1)
            }

            // Shift in bits from prod1 into prod0.
            prod0 |= prod1 * twos;

            // Invert denominator mod 2^256. Now that denominator is an odd number, it has an inverse modulo 2^256 such
            // that denominator * inv = 1 mod 2^256. Compute the inverse by starting with a seed that is correct for
            // four bits. That is, denominator * inv = 1 mod 2^4.
            uint256 inverse = (3 * denominator) ^ 2;

            // Use the Newton-Raphson iteration to improve the precision. Thanks to Hensel's lifting lemma, this also works
            // in modular arithmetic, doubling the correct bits in each step.
            inverse *= 2 - denominator * inverse; // inverse mod 2^8
            inverse *= 2 - denominator * inverse; // inverse mod 2^16
            inverse *= 2 - denominator * inverse; // inverse mod 2^32
            inverse *= 2 - denominator * inverse; // inverse mod 2^64
            inverse *= 2 - denominator * inverse; // inverse mod 2^128
            inverse *= 2 - denominator * inverse; // inverse mod 2^256

            // Because the division is now exact we can divide by multiplying with the modular inverse of denominator.
            // This will give us the correct result modulo 2^256. Since the preconditions guarantee that the outcome is
            // less than 2^256, this is the final result. We don't need to compute the high bits of the result and prod1
            // is no longer required.
            result = prod0 * inverse;
            return result;
        }
    }

    /**
     * @notice Calculates x * y / denominator with full precision, following the selected rounding direction.
     */
    function mulDiv(
        uint256 x,
        uint256 y,
        uint256 denominator,
        Rounding rounding
    ) internal pure returns (uint256) {
        uint256 result = mulDiv(x, y, denominator);
        if (rounding == Rounding.Up && mulmod(x, y, denominator) > 0) {
            result += 1;
        }
        return result;
    }

    /**
     * @dev Returns the square root of a number. If the number is not a perfect square, the value is rounded down.
     *
     * Inspired by Henry S. Warren, Jr.'s "Hacker's Delight" (Chapter 11).
     */
    function sqrt(uint256 a) internal pure returns (uint256) {
        if (a == 0) {
            return 0;
        }

        // For our first guess, we get the biggest power of 2 which is smaller than the square root of the target.
        //
        // We know that the "msb" (most significant bit) of our target number `a` is a power of 2 such that we have
        // `msb(a) <= a < 2*msb(a)`. This value can be written `msb(a)=2**k` with `k=log2(a)`.
        //
        // This can be rewritten `2**log2(a) <= a < 2**(log2(a) + 1)`
        // → `sqrt(2**k) <= sqrt(a) < sqrt(2**(k+1))`
        // → `2**(k/2) <= sqrt(a) < 2**((k+1)/2) <= 2**(k/2 + 1)`
        //
        // Consequently, `2**(log2(a) / 2)` is a good first approximation of `sqrt(a)` with at least 1 correct bit.
        uint256 result = 1 << (log2(a) >> 1);

        // At this point `result` is an estimation with one bit of precision. We know the true value is a uint128,
        // since it is the square root of a uint256. Newton's method converges quadratically (precision doubles at
        // every iteration). We thus need at most 7 iteration to turn our partial result with one bit of precision
        // into the expected uint128 result.
        unchecked {
            result = (result + a / result) >> 1;
            result = (result + a / result) >> 1;
            result = (result + a / result) >> 1;
            result = (result + a / result) >> 1;
            result = (result + a / result) >> 1;
            result = (result + a / result) >> 1;
            result = (result + a / result) >> 1;
            return min(result, a / result);
        }
    }

    /**
     * @notice Calculates sqrt(a), following the selected rounding direction.
     */
    function sqrt(uint256 a, Rounding rounding) internal pure returns (uint256) {
        unchecked {
            uint256 result = sqrt(a);
            return result + (rounding == Rounding.Up && result * result < a ? 1 : 0);
        }
    }

    /**
     * @dev Return the log in base 2, rounded down, of a positive value.
     * Returns 0 if given 0.
     */
    function log2(uint256 value) internal pure returns (uint256) {
        uint256 result = 0;
        unchecked {
            if (value >> 128 > 0) {
                value >>= 128;
                result += 128;
            }
            if (value >> 64 > 0) {
                value >>= 64;
                result += 64;
            }
            if (value >> 32 > 0) {
                value >>= 32;
                result += 32;
            }
            if (value >> 16 > 0) {
                value >>= 16;
                result += 16;
            }
            if (value >> 8 > 0) {
                value >>= 8;
                result += 8;
            }
            if (value >> 4 > 0) {
                value >>= 4;
                result += 4;
            }
            if (value >> 2 > 0) {
                value >>= 2;
                result += 2;
            }
            if (value >> 1 > 0) {
                result += 1;
            }
        }
        return result;
    }

    /**
     * @dev Return the log in base 2, following the selected rounding direction, of a positive value.
     * Returns 0 if given 0.
     */
    function log2(uint256 value, Rounding rounding) internal pure returns (uint256) {
        unchecked {
            uint256 result = log2(value);
            return result + (rounding == Rounding.Up && 1 << result < value ? 1 : 0);
        }
    }

    /**
     * @dev Return the log in base 10, rounded down, of a positive value.
     * Returns 0 if given 0.
     */
    function log10(uint256 value) internal pure returns (uint256) {
        uint256 result = 0;
        unchecked {
            if (value >= 10**64) {
                value /= 10**64;
                result += 64;
            }
            if (value >= 10**32) {
                value /= 10**32;
                result += 32;
            }
            if (value >= 10**16) {
                value /= 10**16;
                result += 16;
            }
            if (value >= 10**8) {
                value /= 10**8;
                result += 8;
            }
            if (value >= 10**4) {
                value /= 10**4;
                result += 4;
            }
            if (value >= 10**2) {
                value /= 10**2;
                result += 2;
            }
            if (value >= 10**1) {
                result += 1;
            }
        }
        return result;
    }

    /**
     * @dev Return the log in base 10, following the selected rounding direction, of a positive value.
     * Returns 0 if given 0.
     */
    function log10(uint256 value, Rounding rounding) internal pure returns (uint256) {
        unchecked {
            uint256 result = log10(value);
            return result + (rounding == Rounding.Up && 10**result < value ? 1 : 0);
        }
    }

    /**
     * @dev Return the log in base 256, rounded down, of a positive value.
     * Returns 0 if given 0.
     *
     * Adding one to the result gives the number of pairs of hex symbols needed to represent `value` as a hex string.
     */
    function log256(uint256 value) internal pure returns (uint256) {
        uint256 result = 0;
        unchecked {
            if (value >> 128 > 0) {
                value >>= 128;
                result += 16;
            }
            if (value >> 64 > 0) {
                value >>= 64;
                result += 8;
            }
            if (value >> 32 > 0) {
                value >>= 32;
                result += 4;
            }
            if (value >> 16 > 0) {
                value >>= 16;
                result += 2;
            }
            if (value >> 8 > 0) {
                result += 1;
            }
        }
        return result;
    }

    /**
     * @dev Return the log in base 10, following the selected rounding direction, of a positive value.
     * Returns 0 if given 0.
     */
    function log256(uint256 value, Rounding rounding) internal pure returns (uint256) {
        unchecked {
            uint256 result = log256(value);
            return result + (rounding == Rounding.Up && 1 << (result * 8) < value ? 1 : 0);
        }
    }
}

// File: @openzeppelin/contracts/utils/Strings.sol

// OpenZeppelin Contracts (last updated v4.8.0) (utils/Strings.sol)

pragma solidity ^0.8.0;

/**
 * @dev String operations.
 */
library Strings {
    bytes16 private constant _SYMBOLS = "0123456789abcdef";
    uint8 private constant _ADDRESS_LENGTH = 20;

    /**
     * @dev Converts a `uint256` to its ASCII `string` decimal representation.
     */
    function toString(uint256 value) internal pure returns (string memory) {
        unchecked {
            uint256 length = Math.log10(value) + 1;
            string memory buffer = new string(length);
            uint256 ptr;
            /// @solidity memory-safe-assembly
            assembly {
                ptr := add(buffer, add(32, length))
            }
            while (true) {
                ptr--;
                /// @solidity memory-safe-assembly
                assembly {
                    mstore8(ptr, byte(mod(value, 10), _SYMBOLS))
                }
                value /= 10;
                if (value == 0) break;
            }
            return buffer;
        }
    }

    /**
     * @dev Converts a `uint256` to its ASCII `string` hexadecimal representation.
     */
    function toHexString(uint256 value) internal pure returns (string memory) {
        unchecked {
            return toHexString(value, Math.log256(value) + 1);
        }
    }

    /**
     * @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] = _SYMBOLS[value & 0xf];
            value >>= 4;
        }
        require(value == 0, "Strings: hex length insufficient");
        return string(buffer);
    }

    /**
     * @dev Converts an `address` with fixed length of 20 bytes to its not checksummed ASCII `string` hexadecimal representation.
     */
    function toHexString(address addr) internal pure returns (string memory) {
        return toHexString(uint256(uint160(addr)), _ADDRESS_LENGTH);
    }
}

// File: @openzeppelin/contracts/utils/introspection/IERC165.sol

// OpenZeppelin Contracts v4.4.1 (utils/introspection/IERC165.sol)

pragma solidity ^0.8.0;

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

// File: @openzeppelin/contracts/utils/introspection/ERC165.sol

// OpenZeppelin Contracts v4.4.1 (utils/introspection/ERC165.sol)

pragma solidity ^0.8.0;

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

// File: @openzeppelin/contracts/access/AccessControl.sol

// OpenZeppelin Contracts (last updated v4.8.0) (access/AccessControl.sol)

pragma solidity ^0.8.0;




/**
 * @dev Contract module that allows children to implement role-based access
 * control mechanisms. This is a lightweight version that doesn't allow enumerating role
 * members except through off-chain means by accessing the contract event logs. Some
 * applications may benefit from on-chain enumerability, for those cases see
 * {AccessControlEnumerable}.
 *
 * Roles are referred to by their `bytes32` identifier. These should be exposed
 * in the external API and be unique. The best way to achieve this is by
 * using `public constant` hash digests:
 *
 * ```
 * bytes32 public constant MY_ROLE = keccak256("MY_ROLE");
 * ```
 *
 * Roles can be used to represent a set of permissions. To restrict access to a
 * function call, use {hasRole}:
 *
 * ```
 * function foo() public {
 *     require(hasRole(MY_ROLE, msg.sender));
 *     ...
 * }
 * ```
 *
 * Roles can be granted and revoked dynamically via the {grantRole} and
 * {revokeRole} functions. Each role has an associated admin role, and only
 * accounts that have a role's admin role can call {grantRole} and {revokeRole}.
 *
 * By default, the admin role for all roles is `DEFAULT_ADMIN_ROLE`, which means
 * that only accounts with this role will be able to grant or revoke other
 * roles. More complex role relationships can be created by using
 * {_setRoleAdmin}.
 *
 * WARNING: The `DEFAULT_ADMIN_ROLE` is also its own admin: it has permission to
 * grant and revoke this role. Extra precautions should be taken to secure
 * accounts that have been granted it.
 */
abstract contract AccessControl is Context, IAccessControl, ERC165 {
    struct RoleData {
        mapping(address => bool) members;
        bytes32 adminRole;
    }

    mapping(bytes32 => RoleData) private _roles;

    bytes32 public constant DEFAULT_ADMIN_ROLE = 0x00;

    /**
     * @dev Modifier that checks that an account has a specific role. Reverts
     * with a standardized message including the required role.
     *
     * The format of the revert reason is given by the following regular expression:
     *
     *  /^AccessControl: account (0x[0-9a-f]{40}) is missing role (0x[0-9a-f]{64})$/
     *
     * _Available since v4.1._
     */
    modifier onlyRole(bytes32 role) {
        _checkRole(role);
        _;
    }

    /**
     * @dev See {IERC165-supportsInterface}.
     */
    function supportsInterface(bytes4 interfaceId) public view virtual override returns (bool) {
        return interfaceId == type(IAccessControl).interfaceId || super.supportsInterface(interfaceId);
    }

    /**
     * @dev Returns `true` if `account` has been granted `role`.
     */
    function hasRole(bytes32 role, address account) public view virtual override returns (bool) {
        return _roles[role].members[account];
    }

    /**
     * @dev Revert with a standard message if `_msgSender()` is missing `role`.
     * Overriding this function changes the behavior of the {onlyRole} modifier.
     *
     * Format of the revert message is described in {_checkRole}.
     *
     * _Available since v4.6._
     */
    function _checkRole(bytes32 role) internal view virtual {
        _checkRole(role, _msgSender());
    }

    /**
     * @dev Revert with a standard message if `account` is missing `role`.
     *
     * The format of the revert reason is given by the following regular expression:
     *
     *  /^AccessControl: account (0x[0-9a-f]{40}) is missing role (0x[0-9a-f]{64})$/
     */
    function _checkRole(bytes32 role, address account) internal view virtual {
        if (!hasRole(role, account)) {
            revert(
                string(
                    abi.encodePacked(
                        "AccessControl: account ",
                        Strings.toHexString(account),
                        " is missing role ",
                        Strings.toHexString(uint256(role), 32)
                    )
                )
            );
        }
    }

    /**
     * @dev Returns the admin role that controls `role`. See {grantRole} and
     * {revokeRole}.
     *
     * To change a role's admin, use {_setRoleAdmin}.
     */
    function getRoleAdmin(bytes32 role) public view virtual override returns (bytes32) {
        return _roles[role].adminRole;
    }

    /**
     * @dev Grants `role` to `account`.
     *
     * If `account` had not been already granted `role`, emits a {RoleGranted}
     * event.
     *
     * Requirements:
     *
     * - the caller must have ``role``'s admin role.
     *
     * May emit a {RoleGranted} event.
     */
    function grantRole(bytes32 role, address account) public virtual override onlyRole(getRoleAdmin(role)) {
        _grantRole(role, account);
    }

    /**
     * @dev Revokes `role` from `account`.
     *
     * If `account` had been granted `role`, emits a {RoleRevoked} event.
     *
     * Requirements:
     *
     * - the caller must have ``role``'s admin role.
     *
     * May emit a {RoleRevoked} event.
     */
    function revokeRole(bytes32 role, address account) public virtual override onlyRole(getRoleAdmin(role)) {
        _revokeRole(role, account);
    }

    /**
     * @dev Revokes `role` from the calling account.
     *
     * Roles are often managed via {grantRole} and {revokeRole}: this function's
     * purpose is to provide a mechanism for accounts to lose their privileges
     * if they are compromised (such as when a trusted device is misplaced).
     *
     * If the calling account had been revoked `role`, emits a {RoleRevoked}
     * event.
     *
     * Requirements:
     *
     * - the caller must be `account`.
     *
     * May emit a {RoleRevoked} event.
     */
    function renounceRole(bytes32 role, address account) public virtual override {
        require(account == _msgSender(), "AccessControl: can only renounce roles for self");

        _revokeRole(role, account);
    }

    /**
     * @dev Grants `role` to `account`.
     *
     * If `account` had not been already granted `role`, emits a {RoleGranted}
     * event. Note that unlike {grantRole}, this function doesn't perform any
     * checks on the calling account.
     *
     * May emit a {RoleGranted} event.
     *
     * [WARNING]
     * ====
     * This function should only be called from the constructor when setting
     * up the initial roles for the system.
     *
     * Using this function in any other way is effectively circumventing the admin
     * system imposed by {AccessControl}.
     * ====
     *
     * NOTE: This function is deprecated in favor of {_grantRole}.
     */
    function _setupRole(bytes32 role, address account) internal virtual {
        _grantRole(role, account);
    }

    /**
     * @dev Sets `adminRole` as ``role``'s admin role.
     *
     * Emits a {RoleAdminChanged} event.
     */
    function _setRoleAdmin(bytes32 role, bytes32 adminRole) internal virtual {
        bytes32 previousAdminRole = getRoleAdmin(role);
        _roles[role].adminRole = adminRole;
        emit RoleAdminChanged(role, previousAdminRole, adminRole);
    }

    /**
     * @dev Grants `role` to `account`.
     *
     * Internal function without access restriction.
     *
     * May emit a {RoleGranted} event.
     */
    function _grantRole(bytes32 role, address account) internal virtual {
        if (!hasRole(role, account)) {
            _roles[role].members[account] = true;
            emit RoleGranted(role, account, _msgSender());
        }
    }

    /**
     * @dev Revokes `role` from `account`.
     *
     * Internal function without access restriction.
     *
     * May emit a {RoleRevoked} event.
     */
    function _revokeRole(bytes32 role, address account) internal virtual {
        if (hasRole(role, account)) {
            _roles[role].members[account] = false;
            emit RoleRevoked(role, account, _msgSender());
        }
    }
}

// File: @openzeppelin/contracts/security/ReentrancyGuard.sol

// OpenZeppelin Contracts (last updated v4.8.0) (security/ReentrancyGuard.sol)

pragma solidity ^0.8.0;

/**
 * @dev Contract module that helps prevent reentrant calls to a function.
 *
 * Inheriting from `ReentrancyGuard` will make the {nonReentrant} modifier
 * available, which can be applied to functions to make sure there are no nested
 * (reentrant) calls to them.
 *
 * Note that because there is a single `nonReentrant` guard, functions marked as
 * `nonReentrant` may not call one another. This can be worked around by making
 * those functions `private`, and then adding `external` `nonReentrant` entry
 * points to them.
 *
 * TIP: If you would like to learn more about reentrancy and alternative ways
 * to protect against it, check out our blog post
 * https://blog.openzeppelin.com/reentrancy-after-istanbul/[Reentrancy After Istanbul].
 */
abstract contract ReentrancyGuard {
    // Booleans are more expensive than uint256 or any type that takes up a full
    // word because each write operation emits an extra SLOAD to first read the
    // slot's contents, replace the bits taken up by the boolean, and then write
    // back. This is the compiler's defense against contract upgrades and
    // pointer aliasing, and it cannot be disabled.

    // The values being non-zero value makes deployment a bit more expensive,
    // but in exchange the refund on every call to nonReentrant will be lower in
    // amount. Since refunds are capped to a percentage of the total
    // transaction's gas, it is best to keep them low in cases like this one, to
    // increase the likelihood of the full refund coming into effect.
    uint256 private constant _NOT_ENTERED = 1;
    uint256 private constant _ENTERED = 2;

    uint256 private _status;

    constructor() {
        _status = _NOT_ENTERED;
    }

    /**
     * @dev Prevents a contract from calling itself, directly or indirectly.
     * Calling a `nonReentrant` function from another `nonReentrant`
     * function is not supported. It is possible to prevent this from happening
     * by making the `nonReentrant` function external, and making it call a
     * `private` function that does the actual work.
     */
    modifier nonReentrant() {
        _nonReentrantBefore();
        _;
        _nonReentrantAfter();
    }

    function _nonReentrantBefore() private {
        // On the first call to nonReentrant, _status will be _NOT_ENTERED
        require(_status != _ENTERED, "ReentrancyGuard: reentrant call");

        // Any calls to nonReentrant after this point will fail
        _status = _ENTERED;
    }

    function _nonReentrantAfter() private {
        // By storing the original value once again, a refund is triggered (see
        // https://eips.ethereum.org/EIPS/eip-2200)
        _status = _NOT_ENTERED;
    }
}

// File: @openzeppelin/contracts/security/Pausable.sol

// OpenZeppelin Contracts (last updated v4.7.0) (security/Pausable.sol)

pragma solidity ^0.8.0;

/**
 * @dev Contract module which allows children to implement an emergency stop
 * mechanism that can be triggered by an authorized account.
 *
 * This module is used through inheritance. It will make available the
 * modifiers `whenNotPaused` and `whenPaused`, which can be applied to
 * the functions of your contract. Note that they will not be pausable by
 * simply including this module, only once the modifiers are put in place.
 */
abstract contract Pausable is Context {
    /**
     * @dev Emitted when the pause is triggered by `account`.
     */
    event Paused(address account);

    /**
     * @dev Emitted when the pause is lifted by `account`.
     */
    event Unpaused(address account);

    bool private _paused;

    /**
     * @dev Initializes the contract in unpaused state.
     */
    constructor() {
        _paused = false;
    }

    /**
     * @dev Modifier to make a function callable only when the contract is not paused.
     *
     * Requirements:
     *
     * - The contract must not be paused.
     */
    modifier whenNotPaused() {
        _requireNotPaused();
        _;
    }

    /**
     * @dev Modifier to make a function callable only when the contract is paused.
     *
     * Requirements:
     *
     * - The contract must be paused.
     */
    modifier whenPaused() {
        _requirePaused();
        _;
    }

    /**
     * @dev Returns true if the contract is paused, and false otherwise.
     */
    function paused() public view virtual returns (bool) {
        return _paused;
    }

    /**
     * @dev Throws if the contract is paused.
     */
    function _requireNotPaused() internal view virtual {
        require(!paused(), "Pausable: paused");
    }

    /**
     * @dev Throws if the contract is not paused.
     */
    function _requirePaused() internal view virtual {
        require(paused(), "Pausable: not paused");
    }

    /**
     * @dev Triggers stopped state.
     *
     * Requirements:
     *
     * - The contract must not be paused.
     */
    function _pause() internal virtual whenNotPaused {
        _paused = true;
        emit Paused(_msgSender());
    }

    /**
     * @dev Returns to normal state.
     *
     * Requirements:
     *
     * - The contract must be paused.
     */
    function _unpause() internal virtual whenPaused {
        _paused = false;
        emit Unpaused(_msgSender());
    }
}

// File: contracts/interfaces/IDepositExecute.sol

pragma solidity 0.8.17;

/**
    @title Interface for handler contracts that support deposits and deposit executions.
    @author ChainSafe Systems.
 */
interface IDepositExecute {
    /**
        @notice It is intended that deposit are made using the Bridge contract.
        @param resourceID ID of the resource that is being bridged.
        @param destinationChainID Chain ID deposit is expected to be bridged to.
        @param depositNonce This value is generated as an ID by the Bridge contract.
        @param depositer Address of account making the deposit in the Bridge contract.
        @param data Consists of additional data needed for a specific deposit.
     */
    function deposit(bytes32 resourceID, uint8 destinationChainID, uint64 depositNonce, address depositer, bytes calldata data) external payable;

    /**
        @notice It is intended that proposals are executed by the Bridge contract.
        @param resourceID ID of the resource that is being bridged.
        @param data Consists of additional data needed for a specific deposit execution.
     */
    function executeProposal(bytes32 resourceID, bytes calldata data) external;
}

// File: contracts/interfaces/IBridge.sol

pragma solidity 0.8.17;

/**
    @title Interface for Bridge contract.
    @author ChainSafe Systems.
 */
interface IBridge {
    /**
        @notice Exposing getter for {_chainID} instead of forcing the use of call.
        @return uint8 The {_chainID} that is currently set for the Bridge contract.
     */
    function _chainID() external returns (uint8);

    /**
        @notice Exposing getter for {_fee} instead of forcing the use of call.
        @return uint256 The {_fee} that is currently set for the Bridge contract.
     */
    function _fee() external returns (uint256);
}

// File: contracts/interfaces/IERCHandler.sol

pragma solidity 0.8.17;

/**
    @title Interface to be used with handlers that support ERC20s and ERC721s.
    @author ChainSafe Systems.
 */
interface IERCHandler {
    /**
        @notice Correlates {resourceID} with {contractAddress}.
        @param resourceID ResourceID to be used when making deposits.
        @param contractAddress Address of contract to be called when a deposit is made and a deposited is executed.
     */
    function setResource(bytes32 resourceID, address contractAddress) external;
    /**
        @notice Marks {contractAddress} as mintable/burnable.
        @param contractAddress Address of contract to be used when making or executing deposits.
     */
    function setBurnable(address contractAddress) external;
    /**
        @notice Used to manually release funds {native tokens} from Native safes.
        @param recipient Address to release tokens to.
        @param amount The amount of native token to release.
     */
    function withdraw(address recipient, uint256 amount) external;
    /**
        @notice Used to manually release funds {erc20 tokens, nft} from ERC safes.
        @param tokenAddress Address of token contract to release
        @param recipient Address to release tokens to.
        @param amountOrTokenID Either the amount of ERC20 tokens or the ERC721 token ID to release.
     */
    function withdrawToken(address tokenAddress, address recipient, uint256 amountOrTokenID) external;
}

// File: contracts/interfaces/IGenericHandler.sol

pragma solidity 0.8.17;

/**
    @title Interface for handler that handles generic deposits and deposit executions.
    @author ChainSafe Systems.
 */
interface IGenericHandler {
    /**
        @notice Correlates {resourceID} with {contractAddress}, {depositFunctionSig}, and {executeFunctionSig}.
        @param resourceID ResourceID to be used when making deposits.
        @param contractAddress Address of contract to be called when a deposit is made and a deposited is executed.
        @param depositFunctionSig Function signature of method to be called in {contractAddress} when a deposit is made.
        @param executeFunctionSig Function signature of method to be called in {contractAddress} when a deposit is executed.
     */
    function setResource(bytes32 resourceID, address contractAddress, bytes4 depositFunctionSig, bytes4 executeFunctionSig) external;
}

// File: contracts/Bridge.sol

pragma solidity 0.8.17;







/**
    @title Facilitates deposits, creation and votiing of deposit proposals, and deposit executions.
    @author ChainSafe Systems.
 */
contract Bridge is Pausable, AccessControl, ReentrancyGuard {
    uint8   public _chainID;
    uint256 public _totalRelayers;
    uint256 public _totalProposals;
    uint256 public _fee;
    uint256 public _maxFee;
    uint256 public _expiry;

    enum Vote {No, Yes}

    enum ProposalStatus {Inactive, Active, Passed, Executed, Cancelled}

    struct Proposal {
        bytes32 _resourceID;
        bytes32 _dataHash;
        address[] _yesVotes;
        address[] _noVotes;
        ProposalStatus _status;
        uint256 _proposedBlock;
    }

    // destinationChainID => number of deposits
    mapping(uint8 => uint64) public _depositCounts;
    // resourceID => handler address
    mapping(bytes32 => address) public _resourceIDToHandlerAddress;
    // depositNonce => destinationChainID => bytes
    mapping(uint64 => mapping(uint8 => bytes)) public _depositRecords;
    // destinationChainID + depositNonce => dataHash => Proposal
    mapping(uint72 => mapping(bytes32 => Proposal)) public _proposals;
    // destinationChainID + depositNonce => dataHash => relayerAddress => bool
    mapping(uint72 => mapping(bytes32 => mapping(address => bool))) public _hasVotedOnProposal;
    // chainID => bool
    mapping(uint8 => bool) public _chainIDWhitelist;

    event RelayerThresholdChanged(uint indexed newThreshold);
    event RelayerAdded(address indexed relayer);
    event RelayerRemoved(address indexed relayer);
    event ChainIDWhitelisted(uint8 indexed chainID);
    event ChainIDUnwhitelisted(uint8 indexed chainID);
    event Deposit(
        uint8   indexed destinationChainID,
        bytes32 indexed resourceID,
        uint64  indexed depositNonce
    );
    event ProposalEvent(
        uint8           indexed originChainID,
        uint64          indexed depositNonce,
        ProposalStatus  indexed status,
        bytes32 resourceID,
        bytes32 dataHash
    );

    event ProposalVote(
        uint8   indexed originChainID,
        uint64  indexed depositNonce,
        ProposalStatus indexed status,
        bytes32 resourceID
    );

    bytes32 public constant RELAYER_ROLE = keccak256("RELAYER_ROLE");

    modifier onlyAdmin() {
        _onlyAdmin();
        _;
    }

    modifier onlyAdminOrRelayer() {
        _onlyAdminOrRelayer();
        _;
    }

    modifier onlyRelayers() {
        _onlyRelayers();
        _;
    }

    function _onlyAdminOrRelayer() private {
        require(hasRole(DEFAULT_ADMIN_ROLE, msg.sender) || hasRole(RELAYER_ROLE, msg.sender),
            "sender is not relayer or admin");
    }

    function _onlyAdmin() private {
        require(hasRole(DEFAULT_ADMIN_ROLE, msg.sender), "sender doesn't have admin role");
    }

    function _onlyRelayers() private {
        require(hasRole(RELAYER_ROLE, msg.sender), "sender doesn't have relayer role");
    }

    /**
        @notice Initializes Bridge, creates and grants {msg.sender} the admin role,
        creates and grants {initialRelayers} the relayer role.
        @param chainID ID of chain the Bridge contract exists on.
        @param initialRelayers Addresses that should be initially granted the relayer role.
        @param fee Amount in wei to pay to deposit.
        @param maxFee Max. value for fee.
        @param expiry Number of blocks max before a deposit proposal is considered expired
        @param initialChainIDWhitelist List of Chain Ids that user can bridge their funds to
     */
    constructor (uint8 chainID, address[] memory initialRelayers, uint256 fee, uint256 maxFee, uint256 expiry, uint8[] memory initialChainIDWhitelist) {
        require(fee <= maxFee, "Fee exceeds max fee");
        _chainID = chainID;
        _fee = fee;
        _maxFee = maxFee;
        _expiry = expiry;

        _setupRole(DEFAULT_ADMIN_ROLE, msg.sender);
        _setRoleAdmin(RELAYER_ROLE, DEFAULT_ADMIN_ROLE);

        for (uint i; i < initialRelayers.length; i++) {
            grantRole(RELAYER_ROLE, initialRelayers[i]);
            _totalRelayers++;
        }

        for (uint8 i; i < initialChainIDWhitelist.length; i++) {
            require(initialChainIDWhitelist[i] != chainID, "Initial whitelisted chainID cannot be Id of chain the Bridge exists on");
            _chainIDWhitelist[initialChainIDWhitelist[i]] = true;
            emit ChainIDWhitelisted(initialChainIDWhitelist[i]);
        }
    }

    /**
        @notice Returns true if {relayer} has the relayer role.
        @param relayer Address to check.
     */
    function isRelayer(address relayer) external view returns (bool) {
        return hasRole(RELAYER_ROLE, relayer);
    }

    /**
        @notice Removes admin role from {msg.sender} and grants it to {newAdmin}.
        @notice Only callable by an address that currently has the admin role.
        @param newAdmin Address that admin role will be granted to.
     */
    function renounceAdmin(address newAdmin) external onlyAdmin {
        grantRole(DEFAULT_ADMIN_ROLE, newAdmin);
        renounceRole(DEFAULT_ADMIN_ROLE, msg.sender);
    }

    /**
        @notice Pauses deposits, proposal creation and voting, and deposit executions.
        @notice Only callable by an address that currently has the admin role.
     */
    function adminPauseTransfers() external onlyAdmin {
        _pause();
    }

    /**
        @notice Unpauses deposits, proposal creation and voting, and deposit executions.
        @notice Only callable by an address that currently has the admin role.
     */
    function adminUnpauseTransfers() external onlyAdmin {
        _unpause();
    }

    /**
        @notice Adds a new chainID to the whitelist
        @notice Only callable by an address that currently has the admin role.
        @param chainID New chain ID to add to whitelist
        @notice Emits {ChainIDWhitelisted} event.
     */
    function adminWhitelistChainID(uint8 chainID) external onlyAdmin {
        require(_chainID != chainID, "chainID cannot be ID of chain the Bridge exists on");
        require(!_chainIDWhitelist[chainID], "Chain ID already whitelisted");
        _chainIDWhitelist[chainID] = true;
        emit ChainIDWhitelisted(chainID);
    }

    /**
        @notice Removes existing chainID from the whitelist
        @notice Only callable by an address that currently has the admin role.
        @param chainID Chain ID to remove from whitelist
        @notice Emits {ChainIDUnwhitelisted} event.
     */
    function adminUnwhitelistChainID(uint8 chainID) external onlyAdmin {
        require(_chainIDWhitelist[chainID], "Chain ID not whitelisted");
        _chainIDWhitelist[chainID] = false;
        emit ChainIDUnwhitelisted(chainID);
    }

    /**
        @notice Returns true if {chainID} is whitelisted
        @param chainID chain ID to check.
     */
    function isChainIDWhitelisted(uint8 chainID) external view returns (bool) {
        return _chainIDWhitelist[chainID];
    }

    /**
        @notice Grants {relayerAddress} the relayer role and increases {_totalRelayer} count.
        @notice Only callable by an address that currently has the admin role.
        @param relayerAddress Address of relayer to be added.
        @notice Emits {RelayerAdded} event.
     */
    function adminAddRelayer(address relayerAddress) external onlyAdmin {
        require(!hasRole(RELAYER_ROLE, relayerAddress), "addr already has relayer role!");
        grantRole(RELAYER_ROLE, relayerAddress);
        emit RelayerAdded(relayerAddress);
        _totalRelayers++;
    }

    /**
        @notice Removes relayer role for {relayerAddress} and decreases {_totalRelayer} count.
        @notice Only callable by an address that currently has the admin role.
        @param relayerAddress Address of relayer to be removed.
        @notice Emits {RelayerRemoved} event.
     */
    function adminRemoveRelayer(address relayerAddress) external onlyAdmin {
        require(hasRole(RELAYER_ROLE, relayerAddress), "addr doesn't have relayer role!");
        revokeRole(RELAYER_ROLE, relayerAddress);
        emit RelayerRemoved(relayerAddress);
        _totalRelayers--;
    }

    /**
        @notice Sets a new resource for handler contracts that use the IERCHandler interface,
        and maps the {handlerAddress} to {resourceID} in {_resourceIDToHandlerAddress}.
        @notice Only callable by an address that currently has the admin role.
        @param handlerAddress Address of handler resource will be set for.
        @param resourceID ResourceID to be used when making deposits.
        @param tokenAddress Address of contract to be called when a deposit is made and a deposited is executed.
     */
    function adminSetResource(address handlerAddress, bytes32 resourceID, address tokenAddress) external onlyAdmin {
        _resourceIDToHandlerAddress[resourceID] = handlerAddress;
        IERCHandler handler = IERCHandler(handlerAddress);
        handler.setResource(resourceID, tokenAddress);
    }

    /**
        @notice Sets a new resource for handler contracts that use the IGenericHandler interface,
        and maps the {handlerAddress} to {resourceID} in {_resourceIDToHandlerAddress}.
        @notice Only callable by an address that currently has the admin role.
        @param handlerAddress Address of handler resource will be set for.
        @param resourceID ResourceID to be used when making deposits.
        @param contractAddress Address of contract to be called when a deposit is made and a deposited is executed.
     */
    function adminSetGenericResource(
        address handlerAddress,
        bytes32 resourceID,
        address contractAddress,
        bytes4 depositFunctionSig,
        bytes4 executeFunctionSig
    ) external onlyAdmin {
        _resourceIDToHandlerAddress[resourceID] = handlerAddress;
        IGenericHandler handler = IGenericHandler(handlerAddress);
        handler.setResource(resourceID, contractAddress, depositFunctionSig, executeFunctionSig);
    }

    /**
        @notice Sets a resource as burnable for handler contracts that use the IERCHandler interface.
        @notice Only callable by an address that currently has the admin role.
        @param handlerAddress Address of handler resource will be set for.
        @param tokenAddress Address of contract to be called when a deposit is made and a deposited is executed.
     */
    function adminSetBurnable(address handlerAddress, address tokenAddress) external onlyAdmin {
        IERCHandler handler = IERCHandler(handlerAddress);
        handler.setBurnable(tokenAddress);
    }

    /**
        @notice Returns a proposal.
        @param originChainID Chain ID deposit originated from.
        @param depositNonce ID of proposal generated by proposal's origin Bridge contract.
        @param dataHash Hash of data to be provided when deposit proposal is executed.
        @return Proposal which consists of:
        - _dataHash Hash of data to be provided when deposit proposal is executed.
        - _yesVotes Number of votes in favor of proposal.
        - _noVotes Number of votes against proposal.
        - _status Current status of proposal.
     */
    function getProposal(uint8 originChainID, uint64 depositNonce, bytes32 dataHash) external view returns (Proposal memory) {
        uint72 nonceAndID = (uint72(depositNonce) << 8) | uint72(originChainID);
        return _proposals[nonceAndID][dataHash];
    }

    /**
        @notice Changes deposit fee.
        @notice Only callable by admin.
        @param newFee Value {_fee} will be updated to.
     */
    function adminChangeFee(uint newFee) external onlyAdmin {
        require(_fee != newFee, "Current fee is equal to new fee");
        require(newFee <= _maxFee, "New fee exceeds max fee");
        _fee = newFee;
    }

    /**
        @notice Used to manually withdraw funds(native token) from ERC safes.
        @param handlerAddress Address of handler to withdraw from.
        @param recipient Address to withdraw tokens to.
        @param amount The amount of native token to release.
     */
    function adminWithdraw(
        address handlerAddress,
        address recipient,
        uint256 amount
    ) external onlyAdmin nonReentrant {
        IERCHandler handler = IERCHandler(handlerAddress);
        handler.withdraw(recipient, amount);
    }

    /**
        @notice Used to manually withdraw funds(ERC20 & ERC721) from ERC safes.
        @param handlerAddress Address of handler to withdraw from.
        @param tokenAddress Address of token to withdraw.
        @param recipient Address to withdraw tokens to.
        @param amountOrTokenID Either the amount of ERC20 tokens or the ERC721 token ID to withdraw.
     */
    function adminWithdrawToken(
        address handlerAddress,
        address tokenAddress,
        address recipient,
        uint256 amountOrTokenID
    ) external onlyAdmin nonReentrant {
        IERCHandler handler = IERCHandler(handlerAddress);
        handler.withdrawToken(tokenAddress, recipient, amountOrTokenID);
    }

    /**
        @notice Initiates a transfer using a specified handler contract.
        @notice Only callable when Bridge is not paused.
        @param destinationChainID ID of chain deposit will be bridged to.
        @param resourceID ResourceID used to find address of handler to be used for deposit.
        @param data Additional data to be passed to specified handler.
        @notice Emits {Deposit} event.
     */
    function deposit(uint8 destinationChainID, bytes32 resourceID, bytes calldata data) external payable whenNotPaused {
        require(destinationChainID != _chainID, "DestinationChainID cannot be the same as current Bridge chainID");
        require(_chainIDWhitelist[destinationChainID], "DestinationChainID not whitelisted");
        require(msg.value >= _fee, "Value too small to pay Fee");

        address handler = _resourceIDToHandlerAddress[resourceID];
        require(handler != address(0), "ResourceID not mapped to handler");

        uint64 depositNonce = ++_depositCounts[destinationChainID];
        _depositRecords[depositNonce][destinationChainID] = data;

        IDepositExecute depositHandler = IDepositExecute(handler);

        depositHandler.deposit{value: msg.value - _fee}(resourceID, destinationChainID, depositNonce, msg.sender, data);

        emit Deposit(destinationChainID, resourceID, depositNonce);
    }

    /**
        @notice When called, {msg.sender} will be marked as voting in favor of proposal.
        @notice Only callable by relayers when Bridge is not paused.
        @param chainID ID of chain deposit originated from.
        @param depositNonce ID of deposited generated by origin Bridge contract.
        @param dataHash Hash of data provided when deposit was made.
        @notice Proposal must not have already been passed or executed.
        @notice {msg.sender} must not have already voted on proposal.
        @notice Emits {ProposalEvent} event with status indicating the proposal status.
        @notice Emits {ProposalVote} event.
     */
    function voteProposal(uint8 chainID, uint64 depositNonce, bytes32 resourceID, bytes32 dataHash) external onlyRelayers whenNotPaused {

        uint72 nonceAndID = (uint72(depositNonce) << 8) | uint72(chainID);
        Proposal storage proposal = _proposals[nonceAndID][dataHash];

        require(_resourceIDToHandlerAddress[resourceID] != address(0), "no handler for resourceID");
        require(uint(proposal._status) <= 1, "proposal already passed/executed/cancelled");
        require(!_hasVotedOnProposal[nonceAndID][dataHash][msg.sender], "relayer already voted");

        if (uint(proposal._status) == 0) {
            ++_totalProposals;
            _proposals[nonceAndID][dataHash] = Proposal({
                _resourceID : resourceID,
                _dataHash : dataHash,
                _yesVotes : new address[](1),
                _noVotes : new address[](0),
                _status : ProposalStatus.Active,
                _proposedBlock : block.number
                });

            proposal._yesVotes[0] = msg.sender;
            emit ProposalEvent(chainID, depositNonce, ProposalStatus.Active, resourceID, dataHash);
        } else {
            if ((block.number - proposal._proposedBlock) > _expiry) {
                // if the number of blocks that has passed since this proposal was
                // submitted exceeds the expiry threshold set, cancel the proposal
                proposal._status = ProposalStatus.Cancelled;
                emit ProposalEvent(chainID, depositNonce, ProposalStatus.Cancelled, resourceID, dataHash);
            } else {
                require(dataHash == proposal._dataHash, "datahash mismatch");
                proposal._yesVotes.push(msg.sender);


            }

        }
        if (proposal._status != ProposalStatus.Cancelled) {
            _hasVotedOnProposal[nonceAndID][dataHash][msg.sender] = true;
            emit ProposalVote(chainID, depositNonce, proposal._status, resourceID);

            // If _totalRelayers is 1, then auto finalize
            // or if quorum() has been reached
            if (_totalRelayers == 1 || proposal._yesVotes.length >= quorum()) {
                proposal._status = ProposalStatus.Passed;

                emit ProposalEvent(chainID, depositNonce, ProposalStatus.Passed, resourceID, dataHash);
            }
        }

    }

    /**
        @notice Executes a deposit proposal that is considered passed using a specified handler contract.
        @notice Only callable by relayers when Bridge is not paused.
        @param chainID ID of chain deposit originated from.
        @param depositNonce ID of deposited generated by origin Bridge contract.
        @param dataHash Hash of data originally provided when deposit was made.
        @notice Proposal must be past expiry threshold.
        @notice Emits {ProposalEvent} event with status {Cancelled}.
     */
    function cancelProposal(uint8 chainID, uint64 depositNonce, bytes32 dataHash) external onlyAdminOrRelayer {
        uint72 nonceAndID = (uint72(depositNonce) << 8) | uint72(chainID);
        Proposal storage proposal = _proposals[nonceAndID][dataHash];

        require(proposal._status != ProposalStatus.Cancelled, "Proposal already cancelled");
        require((block.number - proposal._proposedBlock) > _expiry, "Proposal not at expiry threshold");

        proposal._status = ProposalStatus.Cancelled;
        emit ProposalEvent(chainID, depositNonce, ProposalStatus.Cancelled, proposal._resourceID, proposal._dataHash);

    }

    /**
        @notice Executes a deposit proposal that is considered passed using a specified handler contract.
        @notice Only callable by relayers when Bridge is not paused.
        @param chainID ID of chain deposit originated from.
        @param resourceID ResourceID to be used when making deposits.
        @param depositNonce ID of deposited generated by origin Bridge contract.
        @param data Data originally provided when deposit was made.
        @notice Proposal must have Passed status.
        @notice Hash of {data} must equal proposal's {dataHash}.
        @notice Emits {ProposalEvent} event with status {Executed}.
     */
    function executeProposal(uint8 chainID, uint64 depositNonce, bytes calldata data, bytes32 resourceID) external onlyRelayers whenNotPaused {
        address handler = _resourceIDToHandlerAddress[resourceID];
        uint72 nonceAndID = (uint72(depositNonce) << 8) | uint72(chainID);
        bytes32 dataHash = keccak256(abi.encodePacked(handler, data));
        Proposal storage proposal = _proposals[nonceAndID][dataHash];

        require(proposal._status != ProposalStatus.Inactive, "proposal is not active");
        require(proposal._status == ProposalStatus.Passed, "proposal already transferred");
        require(dataHash == proposal._dataHash, "data doesn't match datahash");

        proposal._status = ProposalStatus.Executed;

        IDepositExecute depositHandler = IDepositExecute(_resourceIDToHandlerAddress[proposal._resourceID]);
        depositHandler.executeProposal(proposal._resourceID, data);

        emit ProposalEvent(chainID, depositNonce, proposal._status, proposal._resourceID, proposal._dataHash);
    }

    /**
        @notice Transfers eth in the contract to the specified addresses. The parameters addrs and amounts are mapped 1-1.
        This means that the address at index 0 for addrs will receive the amount (in WEI) from amounts at index 0.
        @param addrs Array of addresses to transfer {amounts} to.
        @param amounts Array of amonuts to transfer to {addrs}.
     */
    function transferFunds(address payable[] calldata addrs, uint[] calldata amounts) external onlyAdmin {
        for (uint i = 0; i < addrs.length; i++) {
            addrs[i].call{value: amounts[i]}("");
        }
    }

    /**
        @notice Returns quorum necessary to pass a proposal
     */
    function quorum() public view returns (uint256) {
        return _totalRelayers * 2 / 3;
    }

    /**
        @notice Used for "locking" native tokens.
     */
    receive() external payable onlyAdmin { }

}
        

Contract ABI

[{"type":"constructor","inputs":[{"type":"uint8","name":"chainID","internalType":"uint8"},{"type":"address[]","name":"initialRelayers","internalType":"address[]"},{"type":"uint256","name":"fee","internalType":"uint256"},{"type":"uint256","name":"maxFee","internalType":"uint256"},{"type":"uint256","name":"expiry","internalType":"uint256"},{"type":"uint8[]","name":"initialChainIDWhitelist","internalType":"uint8[]"}]},{"type":"function","stateMutability":"view","outputs":[{"type":"bytes32","name":"","internalType":"bytes32"}],"name":"DEFAULT_ADMIN_ROLE","inputs":[]},{"type":"function","stateMutability":"view","outputs":[{"type":"bytes32","name":"","internalType":"bytes32"}],"name":"RELAYER_ROLE","inputs":[]},{"type":"function","stateMutability":"view","outputs":[{"type":"uint8","name":"","internalType":"uint8"}],"name":"_chainID","inputs":[]},{"type":"function","stateMutability":"view","outputs":[{"type":"bool","name":"","internalType":"bool"}],"name":"_chainIDWhitelist","inputs":[{"type":"uint8","name":"","internalType":"uint8"}]},{"type":"function","stateMutability":"view","outputs":[{"type":"uint64","name":"","internalType":"uint64"}],"name":"_depositCounts","inputs":[{"type":"uint8","name":"","internalType":"uint8"}]},{"type":"function","stateMutability":"view","outputs":[{"type":"bytes","name":"","internalType":"bytes"}],"name":"_depositRecords","inputs":[{"type":"uint64","name":"","internalType":"uint64"},{"type":"uint8","name":"","internalType":"uint8"}]},{"type":"function","stateMutability":"view","outputs":[{"type":"uint256","name":"","internalType":"uint256"}],"name":"_expiry","inputs":[]},{"type":"function","stateMutability":"view","outputs":[{"type":"uint256","name":"","internalType":"uint256"}],"name":"_fee","inputs":[]},{"type":"function","stateMutability":"view","outputs":[{"type":"bool","name":"","internalType":"bool"}],"name":"_hasVotedOnProposal","inputs":[{"type":"uint72","name":"","internalType":"uint72"},{"type":"bytes32","name":"","internalType":"bytes32"},{"type":"address","name":"","internalType":"address"}]},{"type":"function","stateMutability":"view","outputs":[{"type":"uint256","name":"","internalType":"uint256"}],"name":"_maxFee","inputs":[]},{"type":"function","stateMutability":"view","outputs":[{"type":"bytes32","name":"_resourceID","internalType":"bytes32"},{"type":"bytes32","name":"_dataHash","internalType":"bytes32"},{"type":"uint8","name":"_status","internalType":"enum Bridge.ProposalStatus"},{"type":"uint256","name":"_proposedBlock","internalType":"uint256"}],"name":"_proposals","inputs":[{"type":"uint72","name":"","internalType":"uint72"},{"type":"bytes32","name":"","internalType":"bytes32"}]},{"type":"function","stateMutability":"view","outputs":[{"type":"address","name":"","internalType":"address"}],"name":"_resourceIDToHandlerAddress","inputs":[{"type":"bytes32","name":"","internalType":"bytes32"}]},{"type":"function","stateMutability":"view","outputs":[{"type":"uint256","name":"","internalType":"uint256"}],"name":"_totalProposals","inputs":[]},{"type":"function","stateMutability":"view","outputs":[{"type":"uint256","name":"","internalType":"uint256"}],"name":"_totalRelayers","inputs":[]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"adminAddRelayer","inputs":[{"type":"address","name":"relayerAddress","internalType":"address"}]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"adminChangeFee","inputs":[{"type":"uint256","name":"newFee","internalType":"uint256"}]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"adminPauseTransfers","inputs":[]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"adminRemoveRelayer","inputs":[{"type":"address","name":"relayerAddress","internalType":"address"}]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"adminSetBurnable","inputs":[{"type":"address","name":"handlerAddress","internalType":"address"},{"type":"address","name":"tokenAddress","internalType":"address"}]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"adminSetGenericResource","inputs":[{"type":"address","name":"handlerAddress","internalType":"address"},{"type":"bytes32","name":"resourceID","internalType":"bytes32"},{"type":"address","name":"contractAddress","internalType":"address"},{"type":"bytes4","name":"depositFunctionSig","internalType":"bytes4"},{"type":"bytes4","name":"executeFunctionSig","internalType":"bytes4"}]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"adminSetResource","inputs":[{"type":"address","name":"handlerAddress","internalType":"address"},{"type":"bytes32","name":"resourceID","internalType":"bytes32"},{"type":"address","name":"tokenAddress","internalType":"address"}]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"adminUnpauseTransfers","inputs":[]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"adminUnwhitelistChainID","inputs":[{"type":"uint8","name":"chainID","internalType":"uint8"}]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"adminWhitelistChainID","inputs":[{"type":"uint8","name":"chainID","internalType":"uint8"}]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"adminWithdraw","inputs":[{"type":"address","name":"handlerAddress","internalType":"address"},{"type":"address","name":"recipient","internalType":"address"},{"type":"uint256","name":"amount","internalType":"uint256"}]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"adminWithdrawToken","inputs":[{"type":"address","name":"handlerAddress","internalType":"address"},{"type":"address","name":"tokenAddress","internalType":"address"},{"type":"address","name":"recipient","internalType":"address"},{"type":"uint256","name":"amountOrTokenID","internalType":"uint256"}]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"cancelProposal","inputs":[{"type":"uint8","name":"chainID","internalType":"uint8"},{"type":"uint64","name":"depositNonce","internalType":"uint64"},{"type":"bytes32","name":"dataHash","internalType":"bytes32"}]},{"type":"function","stateMutability":"payable","outputs":[],"name":"deposit","inputs":[{"type":"uint8","name":"destinationChainID","internalType":"uint8"},{"type":"bytes32","name":"resourceID","internalType":"bytes32"},{"type":"bytes","name":"data","internalType":"bytes"}]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"executeProposal","inputs":[{"type":"uint8","name":"chainID","internalType":"uint8"},{"type":"uint64","name":"depositNonce","internalType":"uint64"},{"type":"bytes","name":"data","internalType":"bytes"},{"type":"bytes32","name":"resourceID","internalType":"bytes32"}]},{"type":"function","stateMutability":"view","outputs":[{"type":"tuple","name":"","internalType":"struct Bridge.Proposal","components":[{"type":"bytes32"},{"type":"bytes32"},{"type":"address[]"},{"type":"address[]"},{"type":"uint8"},{"type":"uint256"}]}],"name":"getProposal","inputs":[{"type":"uint8","name":"originChainID","internalType":"uint8"},{"type":"uint64","name":"depositNonce","internalType":"uint64"},{"type":"bytes32","name":"dataHash","internalType":"bytes32"}]},{"type":"function","stateMutability":"view","outputs":[{"type":"bytes32","name":"","internalType":"bytes32"}],"name":"getRoleAdmin","inputs":[{"type":"bytes32","name":"role","internalType":"bytes32"}]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"grantRole","inputs":[{"type":"bytes32","name":"role","internalType":"bytes32"},{"type":"address","name":"account","internalType":"address"}]},{"type":"function","stateMutability":"view","outputs":[{"type":"bool","name":"","internalType":"bool"}],"name":"hasRole","inputs":[{"type":"bytes32","name":"role","internalType":"bytes32"},{"type":"address","name":"account","internalType":"address"}]},{"type":"function","stateMutability":"view","outputs":[{"type":"bool","name":"","internalType":"bool"}],"name":"isChainIDWhitelisted","inputs":[{"type":"uint8","name":"chainID","internalType":"uint8"}]},{"type":"function","stateMutability":"view","outputs":[{"type":"bool","name":"","internalType":"bool"}],"name":"isRelayer","inputs":[{"type":"address","name":"relayer","internalType":"address"}]},{"type":"function","stateMutability":"view","outputs":[{"type":"bool","name":"","internalType":"bool"}],"name":"paused","inputs":[]},{"type":"function","stateMutability":"view","outputs":[{"type":"uint256","name":"","internalType":"uint256"}],"name":"quorum","inputs":[]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"renounceAdmin","inputs":[{"type":"address","name":"newAdmin","internalType":"address"}]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"renounceRole","inputs":[{"type":"bytes32","name":"role","internalType":"bytes32"},{"type":"address","name":"account","internalType":"address"}]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"revokeRole","inputs":[{"type":"bytes32","name":"role","internalType":"bytes32"},{"type":"address","name":"account","internalType":"address"}]},{"type":"function","stateMutability":"view","outputs":[{"type":"bool","name":"","internalType":"bool"}],"name":"supportsInterface","inputs":[{"type":"bytes4","name":"interfaceId","internalType":"bytes4"}]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"transferFunds","inputs":[{"type":"address[]","name":"addrs","internalType":"address payable[]"},{"type":"uint256[]","name":"amounts","internalType":"uint256[]"}]},{"type":"function","stateMutability":"nonpayable","outputs":[],"name":"voteProposal","inputs":[{"type":"uint8","name":"chainID","internalType":"uint8"},{"type":"uint64","name":"depositNonce","internalType":"uint64"},{"type":"bytes32","name":"resourceID","internalType":"bytes32"},{"type":"bytes32","name":"dataHash","internalType":"bytes32"}]},{"type":"event","name":"ChainIDUnwhitelisted","inputs":[{"type":"uint8","name":"chainID","indexed":true}],"anonymous":false},{"type":"event","name":"ChainIDWhitelisted","inputs":[{"type":"uint8","name":"chainID","indexed":true}],"anonymous":false},{"type":"event","name":"Deposit","inputs":[{"type":"uint8","name":"destinationChainID","indexed":true},{"type":"bytes32","name":"resourceID","indexed":true},{"type":"uint64","name":"depositNonce","indexed":true}],"anonymous":false},{"type":"event","name":"Paused","inputs":[{"type":"address","name":"account","indexed":false}],"anonymous":false},{"type":"event","name":"ProposalEvent","inputs":[{"type":"uint8","name":"originChainID","indexed":true},{"type":"uint64","name":"depositNonce","indexed":true},{"type":"uint8","name":"status","indexed":true},{"type":"bytes32","name":"resourceID","indexed":false},{"type":"bytes32","name":"dataHash","indexed":false}],"anonymous":false},{"type":"event","name":"ProposalVote","inputs":[{"type":"uint8","name":"originChainID","indexed":true},{"type":"uint64","name":"depositNonce","indexed":true},{"type":"uint8","name":"status","indexed":true},{"type":"bytes32","name":"resourceID","indexed":false}],"anonymous":false},{"type":"event","name":"RelayerAdded","inputs":[{"type":"address","name":"relayer","indexed":true}],"anonymous":false},{"type":"event","name":"RelayerRemoved","inputs":[{"type":"address","name":"relayer","indexed":true}],"anonymous":false},{"type":"event","name":"RelayerThresholdChanged","inputs":[{"type":"uint256","name":"newThreshold","indexed":true}],"anonymous":false},{"type":"event","name":"RoleAdminChanged","inputs":[{"type":"bytes32","name":"role","indexed":true},{"type":"bytes32","name":"previousAdminRole","indexed":true},{"type":"bytes32","name":"newAdminRole","indexed":true}],"anonymous":false},{"type":"event","name":"RoleGranted","inputs":[{"type":"bytes32","name":"role","indexed":true},{"type":"address","name":"account","indexed":true},{"type":"address","name":"sender","indexed":true}],"anonymous":false},{"type":"event","name":"RoleRevoked","inputs":[{"type":"bytes32","name":"role","indexed":true},{"type":"address","name":"account","indexed":true},{"type":"address","name":"sender","indexed":true}],"anonymous":false},{"type":"event","name":"Unpaused","inputs":[{"type":"address","name":"account","indexed":false}],"anonymous":false},{"type":"receive"}]
            

Deployed ByteCode

0x6080604052600436106102605760003560e01c80637febe63f11610144578063a9cf69fa116100b6578063cb10f2151161007a578063cb10f21514610947578063cdb0f73a14610970578063d4bafb1a14610999578063d547741f146109c4578063e8437ee7146109ed578063ffaac0eb14610a165761026f565b8063a9cf69fa1461084c578063ad5fe36614610889578063beab7131146108c6578063c5b37c22146108f1578063c5ec89701461091c5761026f565b806391c404ac1161010857806391c404ac1461073c57806391d1485414610765578063926d7d7f146107a25780639d5773e0146107cd5780639d82dd63146107f8578063a217fddf146108215761026f565b80637febe63f14610657578063802aabe81461069457806380ae1c28146106bf57806384db809f146106d65780638c0c2631146107135761026f565b806343ce8cf3116101dd5780634d3f2d98116101a15780634d3f2d9814610520578063505987191461055d578063541d55481461059d5780635c975abb146105da5780635e1fab0f1461060557806372fb2f6d1461062e5761026f565b806343ce8cf31461043f5780634454b20d146104685780634603ae3814610491578063487cfc50146104ba5780634b0b919d146104e35761026f565b80631ff013f1116102245780631ff013f11461034a578063248a9ca3146103735780632f2ff15d146103b057806336568abe146103d95780633ee7094a146104025761026f565b806301ffc9a71461027457806305e2ca17146102b15780631703a018146102cd57806317f03ce5146102f85780631f9119b0146103215761026f565b3661026f5761026d610a2d565b005b600080fd5b34801561028057600080fd5b5061029b6004803603810190610296919061336f565b610a7b565b6040516102a891906133b7565b60405180910390f35b6102cb60048036038101906102c691906134a6565b610af5565b005b3480156102d957600080fd5b506102e2610e23565b6040516102ef9190613533565b60405180910390f35b34801561030457600080fd5b5061031f600480360381019061031a919061358e565b610e45565b005b34801561032d57600080fd5b506103486004803603810190610343919061366b565b61100f565b005b34801561035657600080fd5b50610371600480360381019061036c91906136be565b61109f565b005b34801561037f57600080fd5b5061039a60048036038101906103959190613725565b6118b7565b6040516103a79190613761565b60405180910390f35b3480156103bc57600080fd5b506103d760048036038101906103d2919061377c565b6118d7565b005b3480156103e557600080fd5b5061040060048036038101906103fb919061377c565b6118f8565b005b34801561040e57600080fd5b50610429600480360381019061042491906137bc565b61197b565b604051610436919061388c565b60405180910390f35b34801561044b57600080fd5b50610466600480360381019061046191906138ae565b611a28565b005b34801561047457600080fd5b5061048f600480360381019061048a91906138db565b611afb565b005b34801561049d57600080fd5b506104b860048036038101906104b39190613a0f565b611e65565b005b3480156104c657600080fd5b506104e160048036038101906104dc91906138ae565b611f3e565b005b3480156104ef57600080fd5b5061050a600480360381019061050591906138ae565b612069565b6040516105179190613a9f565b60405180910390f35b34801561052c57600080fd5b50610547600480360381019061054291906138ae565b612090565b60405161055491906133b7565b60405180910390f35b34801561056957600080fd5b50610584600480360381019061057f9190613afb565b6120b0565b6040516105949493929190613bb2565b60405180910390f35b3480156105a957600080fd5b506105c460048036038101906105bf9190613bf7565b6120fa565b6040516105d191906133b7565b60405180910390f35b3480156105e657600080fd5b506105ef61212d565b6040516105fc91906133b7565b60405180910390f35b34801561061157600080fd5b5061062c60048036038101906106279190613bf7565b612143565b005b34801561063a57600080fd5b5061065560048036038101906106509190613c24565b612168565b005b34801561066357600080fd5b5061067e60048036038101906106799190613c8b565b6121fb565b60405161068b91906133b7565b60405180910390f35b3480156106a057600080fd5b506106a9612237565b6040516106b69190613533565b60405180910390f35b3480156106cb57600080fd5b506106d461223d565b005b3480156106e257600080fd5b506106fd60048036038101906106f89190613725565b61224f565b60405161070a9190613ced565b60405180910390f35b34801561071f57600080fd5b5061073a60048036038101906107359190613d08565b612282565b005b34801561074857600080fd5b50610763600480360381019061075e9190613d48565b6122ff565b005b34801561077157600080fd5b5061078c6004803603810190610787919061377c565b61239a565b60405161079991906133b7565b60405180910390f35b3480156107ae57600080fd5b506107b7612405565b6040516107c49190613761565b60405180910390f35b3480156107d957600080fd5b506107e2612429565b6040516107ef9190613533565b60405180910390f35b34801561080457600080fd5b5061081f600480360381019061081a9190613bf7565b61242f565b005b34801561082d57600080fd5b50610836612528565b6040516108439190613761565b60405180910390f35b34801561085857600080fd5b50610873600480360381019061086e919061358e565b61252f565b6040516108809190613ef0565b60405180910390f35b34801561089557600080fd5b506108b060048036038101906108ab91906138ae565b61271e565b6040516108bd91906133b7565b60405180910390f35b3480156108d257600080fd5b506108db61274e565b6040516108e89190613f21565b60405180910390f35b3480156108fd57600080fd5b50610906612761565b6040516109139190613533565b60405180910390f35b34801561092857600080fd5b50610931612767565b60405161093e9190613533565b60405180910390f35b34801561095357600080fd5b5061096e60048036038101906109699190613f3c565b61276d565b005b34801561097c57600080fd5b5061099760048036038101906109929190613bf7565b61283f565b005b3480156109a557600080fd5b506109ae612939565b6040516109bb9190613533565b60405180910390f35b3480156109d057600080fd5b506109eb60048036038101906109e6919061377c565b61293f565b005b3480156109f957600080fd5b50610a146004803603810190610a0f9190613f8f565b612960565b005b348015610a2257600080fd5b50610a2b612a38565b005b610a3a6000801b3361239a565b610a79576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610a7090614067565b60405180910390fd5b565b60007f7965db0b000000000000000000000000000000000000000000000000000000007bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916827bffffffffffffffffffffffffffffffffffffffffffffffffffffffff19161480610aee5750610aed82612cb3565b5b9050919050565b610afd612d1d565b600360009054906101000a900460ff1660ff168460ff1603610b54576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610b4b906140f9565b60405180910390fd5b600e60008560ff1660ff16815260200190815260200160002060009054906101000a900460ff16610bba576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610bb19061418b565b60405180910390fd5b600654341015610bff576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610bf6906141f7565b60405180910390fd5b6000600a600085815260200190815260200160002060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff169050600073ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff1603610ca6576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610c9d90614263565b60405180910390fd5b6000600960008760ff1660ff168152602001908152602001600020600081819054906101000a900467ffffffffffffffff16610ce1906142b2565b91906101000a81548167ffffffffffffffff021916908367ffffffffffffffff160217905590508383600b60008467ffffffffffffffff1667ffffffffffffffff16815260200190815260200160002060008960ff1660ff1681526020019081526020016000209182610d55929190614528565b5060008290508073ffffffffffffffffffffffffffffffffffffffff166338995da960065434610d8591906145f8565b888a86338b8b6040518863ffffffff1660e01b8152600401610dac96959493929190614668565b6000604051808303818588803b158015610dc557600080fd5b505af1158015610dd9573d6000803e3d6000fd5b50505050508167ffffffffffffffff16868860ff167fdbb69440df8433824a026ef190652f29929eb64b4d1d5d2a69be8afe3e6eaed860405160405180910390a450505050505050565b600060036002600454610e3691906146c4565b610e409190614735565b905090565b610e4d612d67565b60008360ff1660088467ffffffffffffffff1668ffffffffffffffffff16901b1790506000600c60008368ffffffffffffffffff1668ffffffffffffffffff16815260200190815260200160002060008481526020019081526020016000209050600480811115610ec157610ec0613b3b565b5b8160040160009054906101000a900460ff166004811115610ee557610ee4613b3b565b5b03610f25576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610f1c906147b2565b60405180910390fd5b600854816005015443610f3891906145f8565b11610f78576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610f6f9061481e565b60405180910390fd5b60048160040160006101000a81548160ff02191690836004811115610fa057610f9f613b3b565b5b0217905550600480811115610fb857610fb7613b3b565b5b8467ffffffffffffffff168660ff167f803c5a12f6bde629cea32e63d4b92d1b560816a6fb72e939d3c89e1cab6504178460000154856001015460405161100092919061483e565b60405180910390a45050505050565b611017610a2d565b61101f612de6565b60008390508073ffffffffffffffffffffffffffffffffffffffff1663f3fef3a384846040518363ffffffff1660e01b815260040161105f929190614867565b600060405180830381600087803b15801561107957600080fd5b505af115801561108d573d6000803e3d6000fd5b505050505061109a612e33565b505050565b6110a7612e3d565b6110af612d1d565b60008460ff1660088567ffffffffffffffff1668ffffffffffffffffff16901b1790506000600c60008368ffffffffffffffffff1668ffffffffffffffffff16815260200190815260200160002060008481526020019081526020016000209050600073ffffffffffffffffffffffffffffffffffffffff16600a600086815260200190815260200160002060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16036111b2576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016111a9906148dc565b60405180910390fd5b60018160040160009054906101000a900460ff1660048111156111d8576111d7613b3b565b5b1115611219576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016112109061496e565b60405180910390fd5b600d60008368ffffffffffffffffff1668ffffffffffffffffff168152602001908152602001600020600084815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16156112de576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016112d5906149da565b60405180910390fd5b60008160040160009054906101000a900460ff16600481111561130457611303613b3b565b5b0361157757600560008154611318906149fa565b919050819055506040518060c00160405280858152602001848152602001600167ffffffffffffffff811115611351576113506142ed565b5b60405190808252806020026020018201604052801561137f5781602001602082028036833780820191505090505b508152602001600067ffffffffffffffff8111156113a05761139f6142ed565b5b6040519080825280602002602001820160405280156113ce5781602001602082028036833780820191505090505b508152602001600160048111156113e8576113e7613b3b565b5b815260200143815250600c60008468ffffffffffffffffff1668ffffffffffffffffff16815260200190815260200160002060008581526020019081526020016000206000820151816000015560208201518160010155604082015181600201908051906020019061145b929190613218565b506060820151816003019080519060200190611478929190613218565b5060808201518160040160006101000a81548160ff021916908360048111156114a4576114a3613b3b565b5b021790555060a0820151816005015590505033816002016000815481106114ce576114cd614a42565b5b9060005260206000200160006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055506001600481111561152a57611529613b3b565b5b8567ffffffffffffffff168760ff167f803c5a12f6bde629cea32e63d4b92d1b560816a6fb72e939d3c89e1cab650417878760405161156a92919061483e565b60405180910390a46116ca565b60085481600501544361158a91906145f8565b111561161d5760048160040160006101000a81548160ff021916908360048111156115b8576115b7613b3b565b5b02179055506004808111156115d0576115cf613b3b565b5b8567ffffffffffffffff168760ff167f803c5a12f6bde629cea32e63d4b92d1b560816a6fb72e939d3c89e1cab650417878760405161161092919061483e565b60405180910390a46116c9565b80600101548314611663576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161165a90614abd565b60405180910390fd5b80600201339080600181540180825580915050600190039060005260206000200160009091909190916101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff1602179055505b5b6004808111156116dd576116dc613b3b565b5b8160040160009054906101000a900460ff16600481111561170157611700613b3b565b5b146118af576001600d60008468ffffffffffffffffff1668ffffffffffffffffff168152602001908152602001600020600085815260200190815260200160002060003373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff0219169083151502179055508060040160009054906101000a900460ff1660048111156117ba576117b9613b3b565b5b8567ffffffffffffffff168760ff167f25f8daaa4635a7729927ba3f5b3d59cc3320aca7c32c9db4e7ca7b9574343640876040516117f89190613761565b60405180910390a46001600454148061181f5750611814610e23565b816002018054905010155b156118ae5760028160040160006101000a81548160ff0219169083600481111561184c5761184b613b3b565b5b02179055506002600481111561186557611864613b3b565b5b8567ffffffffffffffff168760ff167f803c5a12f6bde629cea32e63d4b92d1b560816a6fb72e939d3c89e1cab65041787876040516118a592919061483e565b60405180910390a45b5b505050505050565b600060016000838152602001908152602001600020600101549050919050565b6118e0826118b7565b6118e981612ea8565b6118f38383612ebc565b505050565b611900612f9c565b73ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff161461196d576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161196490614b4f565b60405180910390fd5b6119778282612fa4565b5050565b600b6020528160005260406000206020528060005260406000206000915091505080546119a79061434b565b80601f01602080910402602001604051908101604052809291908181526020018280546119d39061434b565b8015611a205780601f106119f557610100808354040283529160200191611a20565b820191906000526020600020905b815481529060010190602001808311611a0357829003601f168201915b505050505081565b611a30610a2d565b600e60008260ff1660ff16815260200190815260200160002060009054906101000a900460ff16611a96576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611a8d90614bbb565b60405180910390fd5b6000600e60008360ff1660ff16815260200190815260200160002060006101000a81548160ff0219169083151502179055508060ff167f513a97c025a16a98172d0838c3f12ccf94eca378abbfc9d7e06b59cef3fde09a60405160405180910390a250565b611b03612e3d565b611b0b612d1d565b6000600a600083815260200190815260200160002060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff16905060008660ff1660088767ffffffffffffffff1668ffffffffffffffffff16901b1790506000828686604051602001611b7d93929190614c53565b6040516020818303038152906040528051906020012090506000600c60008468ffffffffffffffffff1668ffffffffffffffffff1681526020019081526020016000206000838152602001908152602001600020905060006004811115611be757611be6613b3b565b5b8160040160009054906101000a900460ff166004811115611c0b57611c0a613b3b565b5b03611c4b576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611c4290614cc9565b60405180910390fd5b60026004811115611c5f57611c5e613b3b565b5b8160040160009054906101000a900460ff166004811115611c8357611c82613b3b565b5b14611cc3576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611cba90614d35565b60405180910390fd5b80600101548214611d09576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611d0090614da1565b60405180910390fd5b60038160040160006101000a81548160ff02191690836004811115611d3157611d30613b3b565b5b02179055506000600a60008360000154815260200190815260200160002060009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1690508073ffffffffffffffffffffffffffffffffffffffff1663e248cff283600001548a8a6040518463ffffffff1660e01b8152600401611db393929190614dc1565b600060405180830381600087803b158015611dcd57600080fd5b505af1158015611de1573d6000803e3d6000fd5b505050508160040160009054906101000a900460ff166004811115611e0957611e08613b3b565b5b8967ffffffffffffffff168b60ff167f803c5a12f6bde629cea32e63d4b92d1b560816a6fb72e939d3c89e1cab65041785600001548660010154604051611e5192919061483e565b60405180910390a450505050505050505050565b611e6d610a2d565b60005b84849050811015611f3757848482818110611e8e57611e8d614a42565b5b9050602002016020810190611ea39190614e31565b73ffffffffffffffffffffffffffffffffffffffff16838383818110611ecc57611ecb614a42565b5b90506020020135604051611edf90614e84565b60006040518083038185875af1925050503d8060008114611f1c576040519150601f19603f3d011682016040523d82523d6000602084013e611f21565b606091505b5050508080611f2f906149fa565b915050611e70565b5050505050565b611f46610a2d565b8060ff16600360009054906101000a900460ff1660ff1603611f9d576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611f9490614f0b565b60405180910390fd5b600e60008260ff1660ff16815260200190815260200160002060009054906101000a900460ff1615612004576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401611ffb90614f77565b60405180910390fd5b6001600e60008360ff1660ff16815260200190815260200160002060006101000a81548160ff0219169083151502179055508060ff167f45e67eda68f832b759a49f73f27e54298d8957949984c2450bac94f8bef8de2e60405160405180910390a250565b60096020528060005260406000206000915054906101000a900467ffffffffffffffff1681565b600e6020528060005260406000206000915054906101000a900460ff1681565b600c602052816000526040600020602052806000526040600020600091509150508060000154908060010154908060040160009054906101000a900460ff16908060050154905084565b60006121267fe2b7fb3b832174769106daebcfd6d1970523240dda11281102db9363b83b0dc48361239a565b9050919050565b60008060009054906101000a900460ff16905090565b61214b610a2d565b6121586000801b826118d7565b6121656000801b336118f8565b50565b612170610a2d565b612178612de6565b60008490508073ffffffffffffffffffffffffffffffffffffffff166301e336678585856040518463ffffffff1660e01b81526004016121ba93929190614f97565b600060405180830381600087803b1580156121d457600080fd5b505af11580156121e8573d6000803e3d6000fd5b50505050506121f5612e33565b50505050565b600d602052826000526040600020602052816000526040600020602052806000526040600020600092509250509054906101000a900460ff1681565b60045481565b612245610a2d565b61224d613086565b565b600a6020528060005260406000206000915054906101000a900473ffffffffffffffffffffffffffffffffffffffff1681565b61228a610a2d565b60008290508073ffffffffffffffffffffffffffffffffffffffff166307b7ed99836040518263ffffffff1660e01b81526004016122c89190613ced565b600060405180830381600087803b1580156122e257600080fd5b505af11580156122f6573d6000803e3d6000fd5b50505050505050565b612307610a2d565b806006540361234b576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016123429061501a565b60405180910390fd5b600754811115612390576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161238790615086565b60405180910390fd5b8060068190555050565b60006001600084815260200190815260200160002060000160008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060009054906101000a900460ff16905092915050565b7fe2b7fb3b832174769106daebcfd6d1970523240dda11281102db9363b83b0dc481565b60055481565b612437610a2d565b6124617fe2b7fb3b832174769106daebcfd6d1970523240dda11281102db9363b83b0dc48261239a565b6124a0576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401612497906150f2565b60405180910390fd5b6124ca7fe2b7fb3b832174769106daebcfd6d1970523240dda11281102db9363b83b0dc48261293f565b8073ffffffffffffffffffffffffffffffffffffffff167f10e1f7ce9fd7d1b90a66d13a2ab3cb8dd7f29f3f8d520b143b063ccfbab6906b60405160405180910390a26004600081548092919061252090615112565b919050555050565b6000801b81565b6125376132a2565b60008460ff1660088567ffffffffffffffff1668ffffffffffffffffff16901b179050600c60008268ffffffffffffffffff1668ffffffffffffffffff16815260200190815260200160002060008481526020019081526020016000206040518060c001604052908160008201548152602001600182015481526020016002820180548060200260200160405190810160405280929190818152602001828054801561263857602002820191906000526020600020905b8160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190600101908083116125ee575b50505050508152602001600382018054806020026020016040519081016040528092919081815260200182805480156126c657602002820191906000526020600020905b8160009054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff168152602001906001019080831161267c575b505050505081526020016004820160009054906101000a900460ff1660048111156126f4576126f3613b3b565b5b600481111561270657612705613b3b565b5b81526020016005820154815250509150509392505050565b6000600e60008360ff1660ff16815260200190815260200160002060009054906101000a900460ff169050919050565b600360009054906101000a900460ff1681565b60065481565b60085481565b612775610a2d565b82600a600084815260200190815260200160002060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555060008390508073ffffffffffffffffffffffffffffffffffffffff1663b8fa373684846040518363ffffffff1660e01b815260040161280792919061513b565b600060405180830381600087803b15801561282157600080fd5b505af1158015612835573d6000803e3d6000fd5b5050505050505050565b612847610a2d565b6128717fe2b7fb3b832174769106daebcfd6d1970523240dda11281102db9363b83b0dc48261239a565b156128b1576040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016128a8906151b0565b60405180910390fd5b6128db7fe2b7fb3b832174769106daebcfd6d1970523240dda11281102db9363b83b0dc4826118d7565b8073ffffffffffffffffffffffffffffffffffffffff167f03580ee9f53a62b7cb409a2cb56f9be87747dd15017afc5cef6eef321e4fb2c560405160405180910390a260046000815480929190612931906149fa565b919050555050565b60075481565b612948826118b7565b61295181612ea8565b61295b8383612fa4565b505050565b612968610a2d565b84600a600086815260200190815260200160002060006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555060008590508073ffffffffffffffffffffffffffffffffffffffff1663bba8185a868686866040518563ffffffff1660e01b81526004016129fe94939291906151df565b600060405180830381600087803b158015612a1857600080fd5b505af1158015612a2c573d6000803e3d6000fd5b50505050505050505050565b612a40610a2d565b612a486130e8565b565b6060612a708273ffffffffffffffffffffffffffffffffffffffff16601460ff16612a77565b9050919050565b606060006002836002612a8a91906146c4565b612a949190615224565b67ffffffffffffffff811115612aad57612aac6142ed565b5b6040519080825280601f01601f191660200182016040528015612adf5781602001600182028036833780820191505090505b5090507f300000000000000000000000000000000000000000000000000000000000000081600081518110612b1757612b16614a42565b5b60200101907effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916908160001a9053507f780000000000000000000000000000000000000000000000000000000000000081600181518110612b7b57612b7a614a42565b5b60200101907effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916908160001a90535060006001846002612bbb91906146c4565b612bc59190615224565b90505b6001811115612c65577f3031323334353637383961626364656600000000000000000000000000000000600f861660108110612c0757612c06614a42565b5b1a60f81b828281518110612c1e57612c1d614a42565b5b60200101907effffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916908160001a905350600485901c945080612c5e90615112565b9050612bc8565b5060008414612ca9576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401612ca0906152a4565b60405180910390fd5b8091505092915050565b60007f01ffc9a7000000000000000000000000000000000000000000000000000000007bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916827bffffffffffffffffffffffffffffffffffffffffffffffffffffffff1916149050919050565b612d2561212d565b15612d65576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401612d5c90615310565b60405180910390fd5b565b612d746000801b3361239a565b80612da55750612da47fe2b7fb3b832174769106daebcfd6d1970523240dda11281102db9363b83b0dc43361239a565b5b612de4576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401612ddb9061537c565b60405180910390fd5b565b6002805403612e2a576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401612e21906153e8565b60405180910390fd5b60028081905550565b6001600281905550565b612e677fe2b7fb3b832174769106daebcfd6d1970523240dda11281102db9363b83b0dc43361239a565b612ea6576040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401612e9d90615454565b60405180910390fd5b565b612eb981612eb4612f9c565b61314a565b50565b612ec6828261239a565b612f9857600180600084815260200190815260200160002060000160008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff021916908315150217905550612f3d612f9c565b73ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff16837f2f8788117e7eff1d82e926ec794901d17c78024a50270940304540a733656f0d60405160405180910390a45b5050565b600033905090565b612fae828261239a565b156130825760006001600084815260200190815260200160002060000160008373ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff16815260200190815260200160002060006101000a81548160ff021916908315150217905550613027612f9c565b73ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff16837ff6391f5c32d9c69d2a47ea670b442974b53935d1edc7fd64eb21e047a839171b60405160405180910390a45b5050565b61308e612d1d565b60016000806101000a81548160ff0219169083151502179055507f62e78cea01bee320cd4e420270b5ea74000d11b0c9f74754ebdbfc544b05a2586130d1612f9c565b6040516130de9190613ced565b60405180910390a1565b6130f06131cf565b60008060006101000a81548160ff0219169083151502179055507f5db9ee0a495bf2e6ff9c91a7834c1ba4fdd244a5e8aa4e537bd38aeae4b073aa613133612f9c565b6040516131409190613ced565b60405180910390a1565b613154828261239a565b6131cb5761316181612a4a565b61316f8360001c6020612a77565b604051602001613180929190615553565b6040516020818303038152906040526040517f08c379a00000000000000000000000000000000000000000000000000000000081526004016131c291906155c6565b60405180910390fd5b5050565b6131d761212d565b613216576040517f08c379a000000000000000000000000000000000000000000000000000000000815260040161320d90615634565b60405180910390fd5b565b828054828255906000526020600020908101928215613291579160200282015b828111156132905782518260006101000a81548173ffffffffffffffffffffffffffffffffffffffff021916908373ffffffffffffffffffffffffffffffffffffffff16021790555091602001919060010190613238565b5b50905061329e91906132f0565b5090565b6040518060c0016040528060008019168152602001600080191681526020016060815260200160608152602001600060048111156132e3576132e2613b3b565b5b8152602001600081525090565b5b808211156133095760008160009055506001016132f1565b5090565b600080fd5b600080fd5b60007fffffffff0000000000000000000000000000000000000000000000000000000082169050919050565b61334c81613317565b811461335757600080fd5b50565b60008135905061336981613343565b92915050565b6000602082840312156133855761338461330d565b5b60006133938482850161335a565b91505092915050565b60008115159050919050565b6133b18161339c565b82525050565b60006020820190506133cc60008301846133a8565b92915050565b600060ff82169050919050565b6133e8816133d2565b81146133f357600080fd5b50565b600081359050613405816133df565b92915050565b6000819050919050565b61341e8161340b565b811461342957600080fd5b50565b60008135905061343b81613415565b92915050565b600080fd5b600080fd5b600080fd5b60008083601f84011261346657613465613441565b5b8235905067ffffffffffffffff81111561348357613482613446565b5b60208301915083600182028301111561349f5761349e61344b565b5b9250929050565b600080600080606085870312156134c0576134bf61330d565b5b60006134ce878288016133f6565b94505060206134df8782880161342c565b935050604085013567ffffffffffffffff811115613500576134ff613312565b5b61350c87828801613450565b925092505092959194509250565b6000819050919050565b61352d8161351a565b82525050565b60006020820190506135486000830184613524565b92915050565b600067ffffffffffffffff82169050919050565b61356b8161354e565b811461357657600080fd5b50565b60008135905061358881613562565b92915050565b6000806000606084860312156135a7576135a661330d565b5b60006135b5868287016133f6565b93505060206135c686828701613579565b92505060406135d78682870161342c565b9150509250925092565b600073ffffffffffffffffffffffffffffffffffffffff82169050919050565b600061360c826135e1565b9050919050565b61361c81613601565b811461362757600080fd5b50565b60008135905061363981613613565b92915050565b6136488161351a565b811461365357600080fd5b50565b6000813590506136658161363f565b92915050565b6000806000606084860312156136845761368361330d565b5b60006136928682870161362a565b93505060206136a38682870161362a565b92505060406136b486828701613656565b9150509250925092565b600080600080608085870312156136d8576136d761330d565b5b60006136e6878288016133f6565b94505060206136f787828801613579565b93505060406137088782880161342c565b92505060606137198782880161342c565b91505092959194509250565b60006020828403121561373b5761373a61330d565b5b60006137498482850161342c565b91505092915050565b61375b8161340b565b82525050565b60006020820190506137766000830184613752565b92915050565b600080604083850312156137935761379261330d565b5b60006137a18582860161342c565b92505060206137b28582860161362a565b9150509250929050565b600080604083850312156137d3576137d261330d565b5b60006137e185828601613579565b92505060206137f2858286016133f6565b9150509250929050565b600081519050919050565b600082825260208201905092915050565b60005b8381101561383657808201518184015260208101905061381b565b60008484015250505050565b6000601f19601f8301169050919050565b600061385e826137fc565b6138688185613807565b9350613878818560208601613818565b61388181613842565b840191505092915050565b600060208201905081810360008301526138a68184613853565b905092915050565b6000602082840312156138c4576138c361330d565b5b60006138d2848285016133f6565b91505092915050565b6000806000806000608086880312156138f7576138f661330d565b5b6000613905888289016133f6565b955050602061391688828901613579565b945050604086013567ffffffffffffffff81111561393757613936613312565b5b61394388828901613450565b935093505060606139568882890161342c565b9150509295509295909350565b60008083601f84011261397957613978613441565b5b8235905067ffffffffffffffff81111561399657613995613446565b5b6020830191508360208202830111156139b2576139b161344b565b5b9250929050565b60008083601f8401126139cf576139ce613441565b5b8235905067ffffffffffffffff8111156139ec576139eb613446565b5b602083019150836020820283011115613a0857613a0761344b565b5b9250929050565b60008060008060408587031215613a2957613a2861330d565b5b600085013567ffffffffffffffff811115613a4757613a46613312565b5b613a5387828801613963565b9450945050602085013567ffffffffffffffff811115613a7657613a75613312565b5b613a82878288016139b9565b925092505092959194509250565b613a998161354e565b82525050565b6000602082019050613ab46000830184613a90565b92915050565b600068ffffffffffffffffff82169050919050565b613ad881613aba565b8114613ae357600080fd5b50565b600081359050613af581613acf565b92915050565b60008060408385031215613b1257613b1161330d565b5b6000613b2085828601613ae6565b9250506020613b318582860161342c565b9150509250929050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052602160045260246000fd5b60058110613b7b57613b7a613b3b565b5b50565b6000819050613b8c82613b6a565b919050565b6000613b9c82613b7e565b9050919050565b613bac81613b91565b82525050565b6000608082019050613bc76000830187613752565b613bd46020830186613752565b613be16040830185613ba3565b613bee6060830184613524565b95945050505050565b600060208284031215613c0d57613c0c61330d565b5b6000613c1b8482850161362a565b91505092915050565b60008060008060808587031215613c3e57613c3d61330d565b5b6000613c4c8782880161362a565b9450506020613c5d8782880161362a565b9350506040613c6e8782880161362a565b9250506060613c7f87828801613656565b91505092959194509250565b600080600060608486031215613ca457613ca361330d565b5b6000613cb286828701613ae6565b9350506020613cc38682870161342c565b9250506040613cd48682870161362a565b9150509250925092565b613ce781613601565b82525050565b6000602082019050613d026000830184613cde565b92915050565b60008060408385031215613d1f57613d1e61330d565b5b6000613d2d8582860161362a565b9250506020613d3e8582860161362a565b9150509250929050565b600060208284031215613d5e57613d5d61330d565b5b6000613d6c84828501613656565b91505092915050565b613d7e8161340b565b82525050565b600081519050919050565b600082825260208201905092915050565b6000819050602082019050919050565b613db981613601565b82525050565b6000613dcb8383613db0565b60208301905092915050565b6000602082019050919050565b6000613def82613d84565b613df98185613d8f565b9350613e0483613da0565b8060005b83811015613e35578151613e1c8882613dbf565b9750613e2783613dd7565b925050600181019050613e08565b5085935050505092915050565b613e4b81613b91565b82525050565b613e5a8161351a565b82525050565b600060c083016000830151613e786000860182613d75565b506020830151613e8b6020860182613d75565b5060408301518482036040860152613ea38282613de4565b91505060608301518482036060860152613ebd8282613de4565b9150506080830151613ed26080860182613e42565b5060a0830151613ee560a0860182613e51565b508091505092915050565b60006020820190508181036000830152613f0a8184613e60565b905092915050565b613f1b816133d2565b82525050565b6000602082019050613f366000830184613f12565b92915050565b600080600060608486031215613f5557613f5461330d565b5b6000613f638682870161362a565b9350506020613f748682870161342c565b9250506040613f858682870161362a565b9150509250925092565b600080600080600060a08688031215613fab57613faa61330d565b5b6000613fb98882890161362a565b9550506020613fca8882890161342c565b9450506040613fdb8882890161362a565b9350506060613fec8882890161335a565b9250506080613ffd8882890161335a565b9150509295509295909350565b600082825260208201905092915050565b7f73656e64657220646f65736e277420686176652061646d696e20726f6c650000600082015250565b6000614051601e8361400a565b915061405c8261401b565b602082019050919050565b6000602082019050818103600083015261408081614044565b9050919050565b7f44657374696e6174696f6e436861696e49442063616e6e6f742062652074686560008201527f2073616d652061732063757272656e742042726964676520636861696e494400602082015250565b60006140e3603f8361400a565b91506140ee82614087565b604082019050919050565b60006020820190508181036000830152614112816140d6565b9050919050565b7f44657374696e6174696f6e436861696e4944206e6f742077686974656c69737460008201527f6564000000000000000000000000000000000000000000000000000000000000602082015250565b600061417560228361400a565b915061418082614119565b604082019050919050565b600060208201905081810360008301526141a481614168565b9050919050565b7f56616c756520746f6f20736d616c6c20746f2070617920466565000000000000600082015250565b60006141e1601a8361400a565b91506141ec826141ab565b602082019050919050565b60006020820190508181036000830152614210816141d4565b9050919050565b7f5265736f757263654944206e6f74206d617070656420746f2068616e646c6572600082015250565b600061424d60208361400a565b915061425882614217565b602082019050919050565b6000602082019050818103600083015261427c81614240565b9050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b60006142bd8261354e565b915067ffffffffffffffff82036142d7576142d6614283565b5b600182019050919050565b600082905092915050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052602260045260246000fd5b6000600282049050600182168061436357607f821691505b6020821081036143765761437561431c565b5b50919050565b60008190508160005260206000209050919050565b60006020601f8301049050919050565b600082821b905092915050565b6000600883026143de7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff826143a1565b6143e886836143a1565b95508019841693508086168417925050509392505050565b6000819050919050565b600061442561442061441b8461351a565b614400565b61351a565b9050919050565b6000819050919050565b61443f8361440a565b61445361444b8261442c565b8484546143ae565b825550505050565b600090565b61446861445b565b614473818484614436565b505050565b5b818110156144975761448c600082614460565b600181019050614479565b5050565b601f8211156144dc576144ad8161437c565b6144b684614391565b810160208510156144c5578190505b6144d96144d185614391565b830182614478565b50505b505050565b600082821c905092915050565b60006144ff600019846008026144e1565b1980831691505092915050565b600061451883836144ee565b9150826002028217905092915050565b61453283836142e2565b67ffffffffffffffff81111561454b5761454a6142ed565b5b614555825461434b565b61456082828561449b565b6000601f83116001811461458f576000841561457d578287013590505b614587858261450c565b8655506145ef565b601f19841661459d8661437c565b60005b828110156145c5578489013582556001820191506020850194506020810190506145a0565b868310156145e257848901356145de601f8916826144ee565b8355505b6001600288020188555050505b50505050505050565b60006146038261351a565b915061460e8361351a565b925082820390508181111561462657614625614283565b5b92915050565b82818337600083830152505050565b60006146478385613807565b935061465483858461462c565b61465d83613842565b840190509392505050565b600060a08201905061467d6000830189613752565b61468a6020830188613f12565b6146976040830187613a90565b6146a46060830186613cde565b81810360808301526146b781848661463b565b9050979650505050505050565b60006146cf8261351a565b91506146da8361351a565b92508282026146e88161351a565b915082820484148315176146ff576146fe614283565b5b5092915050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b60006147408261351a565b915061474b8361351a565b92508261475b5761475a614706565b5b828204905092915050565b7f50726f706f73616c20616c72656164792063616e63656c6c6564000000000000600082015250565b600061479c601a8361400a565b91506147a782614766565b602082019050919050565b600060208201905081810360008301526147cb8161478f565b9050919050565b7f50726f706f73616c206e6f7420617420657870697279207468726573686f6c64600082015250565b600061480860208361400a565b9150614813826147d2565b602082019050919050565b60006020820190508181036000830152614837816147fb565b9050919050565b60006040820190506148536000830185613752565b6148606020830184613752565b9392505050565b600060408201905061487c6000830185613cde565b6148896020830184613524565b9392505050565b7f6e6f2068616e646c657220666f72207265736f75726365494400000000000000600082015250565b60006148c660198361400a565b91506148d182614890565b602082019050919050565b600060208201905081810360008301526148f5816148b9565b9050919050565b7f70726f706f73616c20616c7265616479207061737365642f657865637574656460008201527f2f63616e63656c6c656400000000000000000000000000000000000000000000602082015250565b6000614958602a8361400a565b9150614963826148fc565b604082019050919050565b600060208201905081810360008301526149878161494b565b9050919050565b7f72656c6179657220616c726561647920766f7465640000000000000000000000600082015250565b60006149c460158361400a565b91506149cf8261498e565b602082019050919050565b600060208201905081810360008301526149f3816149b7565b9050919050565b6000614a058261351a565b91507fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff8203614a3757614a36614283565b5b600182019050919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b7f6461746168617368206d69736d61746368000000000000000000000000000000600082015250565b6000614aa760118361400a565b9150614ab282614a71565b602082019050919050565b60006020820190508181036000830152614ad681614a9a565b9050919050565b7f416363657373436f6e74726f6c3a2063616e206f6e6c792072656e6f756e636560008201527f20726f6c657320666f722073656c660000000000000000000000000000000000602082015250565b6000614b39602f8361400a565b9150614b4482614add565b604082019050919050565b60006020820190508181036000830152614b6881614b2c565b9050919050565b7f436861696e204944206e6f742077686974656c69737465640000000000000000600082015250565b6000614ba560188361400a565b9150614bb082614b6f565b602082019050919050565b60006020820190508181036000830152614bd481614b98565b9050919050565b60008160601b9050919050565b6000614bf382614bdb565b9050919050565b6000614c0582614be8565b9050919050565b614c1d614c1882613601565b614bfa565b82525050565b600081905092915050565b6000614c3a8385614c23565b9350614c4783858461462c565b82840190509392505050565b6000614c5f8286614c0c565b601482019150614c70828486614c2e565b9150819050949350505050565b7f70726f706f73616c206973206e6f742061637469766500000000000000000000600082015250565b6000614cb360168361400a565b9150614cbe82614c7d565b602082019050919050565b60006020820190508181036000830152614ce281614ca6565b9050919050565b7f70726f706f73616c20616c7265616479207472616e7366657272656400000000600082015250565b6000614d1f601c8361400a565b9150614d2a82614ce9565b602082019050919050565b60006020820190508181036000830152614d4e81614d12565b9050919050565b7f6461746120646f65736e2774206d617463682064617461686173680000000000600082015250565b6000614d8b601b8361400a565b9150614d9682614d55565b602082019050919050565b60006020820190508181036000830152614dba81614d7e565b9050919050565b6000604082019050614dd66000830186613752565b8181036020830152614de981848661463b565b9050949350505050565b6000614dfe826135e1565b9050919050565b614e0e81614df3565b8114614e1957600080fd5b50565b600081359050614e2b81614e05565b92915050565b600060208284031215614e4757614e4661330d565b5b6000614e5584828501614e1c565b91505092915050565b50565b6000614e6e600083614c23565b9150614e7982614e5e565b600082019050919050565b6000614e8f82614e61565b9150819050919050565b7f636861696e49442063616e6e6f74206265204944206f6620636861696e20746860008201527f652042726964676520657869737473206f6e0000000000000000000000000000602082015250565b6000614ef560328361400a565b9150614f0082614e99565b604082019050919050565b60006020820190508181036000830152614f2481614ee8565b9050919050565b7f436861696e20494420616c72656164792077686974656c697374656400000000600082015250565b6000614f61601c8361400a565b9150614f6c82614f2b565b602082019050919050565b60006020820190508181036000830152614f9081614f54565b9050919050565b6000606082019050614fac6000830186613cde565b614fb96020830185613cde565b614fc66040830184613524565b949350505050565b7f43757272656e742066656520697320657175616c20746f206e65772066656500600082015250565b6000615004601f8361400a565b915061500f82614fce565b602082019050919050565b6000602082019050818103600083015261503381614ff7565b9050919050565b7f4e6577206665652065786365656473206d617820666565000000000000000000600082015250565b600061507060178361400a565b915061507b8261503a565b602082019050919050565b6000602082019050818103600083015261509f81615063565b9050919050565b7f6164647220646f65736e277420686176652072656c6179657220726f6c652100600082015250565b60006150dc601f8361400a565b91506150e7826150a6565b602082019050919050565b6000602082019050818103600083015261510b816150cf565b9050919050565b600061511d8261351a565b9150600082036151305761512f614283565b5b600182039050919050565b60006040820190506151506000830185613752565b61515d6020830184613cde565b9392505050565b7f6164647220616c7265616479206861732072656c6179657220726f6c65210000600082015250565b600061519a601e8361400a565b91506151a582615164565b602082019050919050565b600060208201905081810360008301526151c98161518d565b9050919050565b6151d981613317565b82525050565b60006080820190506151f46000830187613752565b6152016020830186613cde565b61520e60408301856151d0565b61521b60608301846151d0565b95945050505050565b600061522f8261351a565b915061523a8361351a565b925082820190508082111561525257615251614283565b5b92915050565b7f537472696e67733a20686578206c656e67746820696e73756666696369656e74600082015250565b600061528e60208361400a565b915061529982615258565b602082019050919050565b600060208201905081810360008301526152bd81615281565b9050919050565b7f5061757361626c653a2070617573656400000000000000000000000000000000600082015250565b60006152fa60108361400a565b9150615305826152c4565b602082019050919050565b60006020820190508181036000830152615329816152ed565b9050919050565b7f73656e646572206973206e6f742072656c61796572206f722061646d696e0000600082015250565b6000615366601e8361400a565b915061537182615330565b602082019050919050565b6000602082019050818103600083015261539581615359565b9050919050565b7f5265656e7472616e637947756172643a207265656e7472616e742063616c6c00600082015250565b60006153d2601f8361400a565b91506153dd8261539c565b602082019050919050565b60006020820190508181036000830152615401816153c5565b9050919050565b7f73656e64657220646f65736e277420686176652072656c6179657220726f6c65600082015250565b600061543e60208361400a565b915061544982615408565b602082019050919050565b6000602082019050818103600083015261546d81615431565b9050919050565b600081905092915050565b7f416363657373436f6e74726f6c3a206163636f756e7420000000000000000000600082015250565b60006154b5601783615474565b91506154c08261547f565b601782019050919050565b600081519050919050565b60006154e1826154cb565b6154eb8185615474565b93506154fb818560208601613818565b80840191505092915050565b7f206973206d697373696e6720726f6c6520000000000000000000000000000000600082015250565b600061553d601183615474565b915061554882615507565b601182019050919050565b600061555e826154a8565b915061556a82856154d6565b915061557582615530565b915061558182846154d6565b91508190509392505050565b6000615598826154cb565b6155a2818561400a565b93506155b2818560208601613818565b6155bb81613842565b840191505092915050565b600060208201905081810360008301526155e0818461558d565b905092915050565b7f5061757361626c653a206e6f7420706175736564000000000000000000000000600082015250565b600061561e60148361400a565b9150615629826155e8565b602082019050919050565b6000602082019050818103600083015261564d81615611565b905091905056fea26469706673582212209c21e2830bafe7ae152194c74c3559c0d16de465c726cfa4576cc1589383ca3e64736f6c63430008110033