ETH Price: $2,342.29 (+2.21%)

Contract

0x8F9C9f888A4268Ab0E2DDa03A291769479bAc285
 
Transaction Hash
Block
From
To
Set Approval For...127730292024-12-16 13:31:13413 days ago1734355873IN
0x8F9C9f88...479bAc285
0 ETH0.000002760.00163114
Set Approval For...126903182024-12-14 15:34:11415 days ago1734190451IN
0x8F9C9f88...479bAc285
0 ETH0.000003370.00039565
Set Approval For...126902692024-12-14 15:32:33415 days ago1734190353IN
0x8F9C9f88...479bAc285
0 ETH0.000002880.00039904
Transfer107118802024-10-29 20:26:15461 days ago1730233575IN
0x8F9C9f88...479bAc285
0.000002 ETH0.000000170.00322561
Transfer107005852024-10-29 14:09:45461 days ago1730210985IN
0x8F9C9f88...479bAc285
0.000001 ETH0.000000490.0076
Set Approval For...106849282024-10-29 5:27:51461 days ago1730179671IN
0x8F9C9f88...479bAc285
0 ETH0.000000250.00492426
Set Approval For...106849262024-10-29 5:27:47461 days ago1730179667IN
0x8F9C9f88...479bAc285
0 ETH0.000000250.0049326
Set Approval For...106849232024-10-29 5:27:41461 days ago1730179661IN
0x8F9C9f88...479bAc285
0 ETH0.000000260.00494863
Set Approval For...101833182024-10-17 14:47:31473 days ago1729176451IN
0x8F9C9f88...479bAc285
0 ETH0.000000190.00532668
Set Approval For...101833152024-10-17 14:47:25473 days ago1729176445IN
0x8F9C9f88...479bAc285
0 ETH0.000000180.00534387
Set Approval For...101708242024-10-17 7:51:03473 days ago1729151463IN
0x8F9C9f88...479bAc285
0 ETH0.000000230.00327255
Set Approval For...101708202024-10-17 7:50:55473 days ago1729151455IN
0x8F9C9f88...479bAc285
0 ETH0.000000240.00328152
Set Approval For...101708132024-10-17 7:50:41473 days ago1729151441IN
0x8F9C9f88...479bAc285
0 ETH0.000000240.00355395
Set Approval For...101707832024-10-17 7:49:41473 days ago1729151381IN
0x8F9C9f88...479bAc285
0 ETH0.000000230.00330901
Set Approval For...101707792024-10-17 7:49:33473 days ago1729151373IN
0x8F9C9f88...479bAc285
0 ETH0.000000240.00332791
Set Approval For...101707752024-10-17 7:49:25473 days ago1729151365IN
0x8F9C9f88...479bAc285
0 ETH0.000000230.00320739
Set Approval For...101707292024-10-17 7:47:53473 days ago1729151273IN
0x8F9C9f88...479bAc285
0 ETH0.000000250.00342191
Set Approval For...101707252024-10-17 7:47:45473 days ago1729151265IN
0x8F9C9f88...479bAc285
0 ETH0.000000240.00339644
Set Approval For...101707222024-10-17 7:47:39473 days ago1729151259IN
0x8F9C9f88...479bAc285
0 ETH0.000000250.00340692
Set Approval For...101706932024-10-17 7:46:41473 days ago1729151201IN
0x8F9C9f88...479bAc285
0 ETH0.000000260.0034258
Set Approval For...101706912024-10-17 7:46:37473 days ago1729151197IN
0x8F9C9f88...479bAc285
0 ETH0.000000250.00343223
Set Approval For...101706882024-10-17 7:46:31473 days ago1729151191IN
0x8F9C9f88...479bAc285
0 ETH0.000000250.00344269
Set Approval For...101706582024-10-17 7:45:31473 days ago1729151131IN
0x8F9C9f88...479bAc285
0 ETH0.000000260.00346722
Set Approval For...101706552024-10-17 7:45:25473 days ago1729151125IN
0x8F9C9f88...479bAc285
0 ETH0.000000260.00347649
Set Approval For...101706522024-10-17 7:45:19473 days ago1729151119IN
0x8F9C9f88...479bAc285
0 ETH0.000000260.00348923
View all transactions

View more zero value Internal Transactions in Advanced View mode

Advanced mode:

Cross-Chain Transactions
Loading...
Loading

Contract Source Code Verified (Exact Match)

Contract Name:
BlastConditionalTokens

Compiler Version
v0.8.24+commit.e11b9ed9

Optimization Enabled:
Yes with 200 runs

Other Settings:
paris EvmVersion
// SPDX-License-Identifier: MIT
pragma solidity 0.8.24;

import {BlastERC20RebasingYield} from "../Blast/BlastERC20RebasingYield.sol";
import {ConditionalTokens} from "./ConditionalTokens.sol";

contract BlastConditionalTokens is ConditionalTokens, BlastERC20RebasingYield {
    constructor(
        address addressFinder_,
        address owner_,
        string memory uri_
    ) ConditionalTokens(uri_) BlastERC20RebasingYield(addressFinder_) {
        _grantRole(DEFAULT_ADMIN_ROLE, owner_);
    }

    function claimYield(address wethReceiver, address usdbReceiver) external onlyRole(DEFAULT_ADMIN_ROLE) {
        _claimERC20RebasingYield(wethReceiver, usdbReceiver);
    }
}

// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v5.0.0) (access/AccessControl.sol)

pragma solidity ^0.8.20;

import {IAccessControl} from "./IAccessControl.sol";
import {Context} from "../utils/Context.sol";
import {ERC165} from "../utils/introspection/ERC165.sol";

/**
 * @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:
 *
 * ```solidity
 * 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}:
 *
 * ```solidity
 * 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. We recommend using {AccessControlDefaultAdminRules}
 * to enforce additional security measures for this role.
 */
abstract contract AccessControl is Context, IAccessControl, ERC165 {
    struct RoleData {
        mapping(address account => bool) hasRole;
        bytes32 adminRole;
    }

    mapping(bytes32 role => RoleData) private _roles;

    bytes32 public constant DEFAULT_ADMIN_ROLE = 0x00;

    /**
     * @dev Modifier that checks that an account has a specific role. Reverts
     * with an {AccessControlUnauthorizedAccount} error including the required role.
     */
    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 returns (bool) {
        return _roles[role].hasRole[account];
    }

    /**
     * @dev Reverts with an {AccessControlUnauthorizedAccount} error if `_msgSender()`
     * is missing `role`. Overriding this function changes the behavior of the {onlyRole} modifier.
     */
    function _checkRole(bytes32 role) internal view virtual {
        _checkRole(role, _msgSender());
    }

    /**
     * @dev Reverts with an {AccessControlUnauthorizedAccount} error if `account`
     * is missing `role`.
     */
    function _checkRole(bytes32 role, address account) internal view virtual {
        if (!hasRole(role, account)) {
            revert AccessControlUnauthorizedAccount(account, role);
        }
    }

    /**
     * @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 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 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 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 `callerConfirmation`.
     *
     * May emit a {RoleRevoked} event.
     */
    function renounceRole(bytes32 role, address callerConfirmation) public virtual {
        if (callerConfirmation != _msgSender()) {
            revert AccessControlBadConfirmation();
        }

        _revokeRole(role, callerConfirmation);
    }

    /**
     * @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 Attempts to grant `role` to `account` and returns a boolean indicating if `role` was granted.
     *
     * Internal function without access restriction.
     *
     * May emit a {RoleGranted} event.
     */
    function _grantRole(bytes32 role, address account) internal virtual returns (bool) {
        if (!hasRole(role, account)) {
            _roles[role].hasRole[account] = true;
            emit RoleGranted(role, account, _msgSender());
            return true;
        } else {
            return false;
        }
    }

    /**
     * @dev Attempts to revoke `role` to `account` and returns a boolean indicating if `role` was revoked.
     *
     * Internal function without access restriction.
     *
     * May emit a {RoleRevoked} event.
     */
    function _revokeRole(bytes32 role, address account) internal virtual returns (bool) {
        if (hasRole(role, account)) {
            _roles[role].hasRole[account] = false;
            emit RoleRevoked(role, account, _msgSender());
            return true;
        } else {
            return false;
        }
    }
}

// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v5.0.0) (access/IAccessControl.sol)

pragma solidity ^0.8.20;

/**
 * @dev External interface of AccessControl declared to support ERC165 detection.
 */
interface IAccessControl {
    /**
     * @dev The `account` is missing a role.
     */
    error AccessControlUnauthorizedAccount(address account, bytes32 neededRole);

    /**
     * @dev The caller of a function is not the expected one.
     *
     * NOTE: Don't confuse with {AccessControlUnauthorizedAccount}.
     */
    error AccessControlBadConfirmation();

    /**
     * @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.
     */
    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 `callerConfirmation`.
     */
    function renounceRole(bytes32 role, address callerConfirmation) external;
}

// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v5.0.0) (interfaces/draft-IERC6093.sol)
pragma solidity ^0.8.20;

/**
 * @dev Standard ERC20 Errors
 * Interface of the https://eips.ethereum.org/EIPS/eip-6093[ERC-6093] custom errors for ERC20 tokens.
 */
interface IERC20Errors {
    /**
     * @dev Indicates an error related to the current `balance` of a `sender`. Used in transfers.
     * @param sender Address whose tokens are being transferred.
     * @param balance Current balance for the interacting account.
     * @param needed Minimum amount required to perform a transfer.
     */
    error ERC20InsufficientBalance(address sender, uint256 balance, uint256 needed);

    /**
     * @dev Indicates a failure with the token `sender`. Used in transfers.
     * @param sender Address whose tokens are being transferred.
     */
    error ERC20InvalidSender(address sender);

    /**
     * @dev Indicates a failure with the token `receiver`. Used in transfers.
     * @param receiver Address to which tokens are being transferred.
     */
    error ERC20InvalidReceiver(address receiver);

    /**
     * @dev Indicates a failure with the `spender`’s `allowance`. Used in transfers.
     * @param spender Address that may be allowed to operate on tokens without being their owner.
     * @param allowance Amount of tokens a `spender` is allowed to operate with.
     * @param needed Minimum amount required to perform a transfer.
     */
    error ERC20InsufficientAllowance(address spender, uint256 allowance, uint256 needed);

    /**
     * @dev Indicates a failure with the `approver` of a token to be approved. Used in approvals.
     * @param approver Address initiating an approval operation.
     */
    error ERC20InvalidApprover(address approver);

    /**
     * @dev Indicates a failure with the `spender` to be approved. Used in approvals.
     * @param spender Address that may be allowed to operate on tokens without being their owner.
     */
    error ERC20InvalidSpender(address spender);
}

/**
 * @dev Standard ERC721 Errors
 * Interface of the https://eips.ethereum.org/EIPS/eip-6093[ERC-6093] custom errors for ERC721 tokens.
 */
interface IERC721Errors {
    /**
     * @dev Indicates that an address can't be an owner. For example, `address(0)` is a forbidden owner in EIP-20.
     * Used in balance queries.
     * @param owner Address of the current owner of a token.
     */
    error ERC721InvalidOwner(address owner);

    /**
     * @dev Indicates a `tokenId` whose `owner` is the zero address.
     * @param tokenId Identifier number of a token.
     */
    error ERC721NonexistentToken(uint256 tokenId);

    /**
     * @dev Indicates an error related to the ownership over a particular token. Used in transfers.
     * @param sender Address whose tokens are being transferred.
     * @param tokenId Identifier number of a token.
     * @param owner Address of the current owner of a token.
     */
    error ERC721IncorrectOwner(address sender, uint256 tokenId, address owner);

    /**
     * @dev Indicates a failure with the token `sender`. Used in transfers.
     * @param sender Address whose tokens are being transferred.
     */
    error ERC721InvalidSender(address sender);

    /**
     * @dev Indicates a failure with the token `receiver`. Used in transfers.
     * @param receiver Address to which tokens are being transferred.
     */
    error ERC721InvalidReceiver(address receiver);

    /**
     * @dev Indicates a failure with the `operator`’s approval. Used in transfers.
     * @param operator Address that may be allowed to operate on tokens without being their owner.
     * @param tokenId Identifier number of a token.
     */
    error ERC721InsufficientApproval(address operator, uint256 tokenId);

    /**
     * @dev Indicates a failure with the `approver` of a token to be approved. Used in approvals.
     * @param approver Address initiating an approval operation.
     */
    error ERC721InvalidApprover(address approver);

    /**
     * @dev Indicates a failure with the `operator` to be approved. Used in approvals.
     * @param operator Address that may be allowed to operate on tokens without being their owner.
     */
    error ERC721InvalidOperator(address operator);
}

/**
 * @dev Standard ERC1155 Errors
 * Interface of the https://eips.ethereum.org/EIPS/eip-6093[ERC-6093] custom errors for ERC1155 tokens.
 */
interface IERC1155Errors {
    /**
     * @dev Indicates an error related to the current `balance` of a `sender`. Used in transfers.
     * @param sender Address whose tokens are being transferred.
     * @param balance Current balance for the interacting account.
     * @param needed Minimum amount required to perform a transfer.
     * @param tokenId Identifier number of a token.
     */
    error ERC1155InsufficientBalance(address sender, uint256 balance, uint256 needed, uint256 tokenId);

    /**
     * @dev Indicates a failure with the token `sender`. Used in transfers.
     * @param sender Address whose tokens are being transferred.
     */
    error ERC1155InvalidSender(address sender);

    /**
     * @dev Indicates a failure with the token `receiver`. Used in transfers.
     * @param receiver Address to which tokens are being transferred.
     */
    error ERC1155InvalidReceiver(address receiver);

    /**
     * @dev Indicates a failure with the `operator`’s approval. Used in transfers.
     * @param operator Address that may be allowed to operate on tokens without being their owner.
     * @param owner Address of the current owner of a token.
     */
    error ERC1155MissingApprovalForAll(address operator, address owner);

    /**
     * @dev Indicates a failure with the `approver` of a token to be approved. Used in approvals.
     * @param approver Address initiating an approval operation.
     */
    error ERC1155InvalidApprover(address approver);

    /**
     * @dev Indicates a failure with the `operator` to be approved. Used in approvals.
     * @param operator Address that may be allowed to operate on tokens without being their owner.
     */
    error ERC1155InvalidOperator(address operator);

    /**
     * @dev Indicates an array length mismatch between ids and values in a safeBatchTransferFrom operation.
     * Used in batch transfers.
     * @param idsLength Length of the array of token identifiers
     * @param valuesLength Length of the array of token amounts
     */
    error ERC1155InvalidArrayLength(uint256 idsLength, uint256 valuesLength);
}

// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v5.0.0) (token/ERC1155/ERC1155.sol)

pragma solidity ^0.8.20;

import {IERC1155} from "./IERC1155.sol";
import {IERC1155Receiver} from "./IERC1155Receiver.sol";
import {IERC1155MetadataURI} from "./extensions/IERC1155MetadataURI.sol";
import {Context} from "../../utils/Context.sol";
import {IERC165, ERC165} from "../../utils/introspection/ERC165.sol";
import {Arrays} from "../../utils/Arrays.sol";
import {IERC1155Errors} from "../../interfaces/draft-IERC6093.sol";

/**
 * @dev Implementation of the basic standard multi-token.
 * See https://eips.ethereum.org/EIPS/eip-1155
 * Originally based on code by Enjin: https://github.com/enjin/erc-1155
 */
abstract contract ERC1155 is Context, ERC165, IERC1155, IERC1155MetadataURI, IERC1155Errors {
    using Arrays for uint256[];
    using Arrays for address[];

    mapping(uint256 id => mapping(address account => uint256)) private _balances;

    mapping(address account => mapping(address operator => bool)) private _operatorApprovals;

    // Used as the URI for all token types by relying on ID substitution, e.g. https://token-cdn-domain/{id}.json
    string private _uri;

    /**
     * @dev See {_setURI}.
     */
    constructor(string memory uri_) {
        _setURI(uri_);
    }

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

    /**
     * @dev See {IERC1155MetadataURI-uri}.
     *
     * This implementation returns the same URI for *all* token types. It relies
     * on the token type ID substitution mechanism
     * https://eips.ethereum.org/EIPS/eip-1155#metadata[defined in the EIP].
     *
     * Clients calling this function must replace the `\{id\}` substring with the
     * actual token type ID.
     */
    function uri(uint256 /* id */) public view virtual returns (string memory) {
        return _uri;
    }

    /**
     * @dev See {IERC1155-balanceOf}.
     */
    function balanceOf(address account, uint256 id) public view virtual returns (uint256) {
        return _balances[id][account];
    }

    /**
     * @dev See {IERC1155-balanceOfBatch}.
     *
     * Requirements:
     *
     * - `accounts` and `ids` must have the same length.
     */
    function balanceOfBatch(
        address[] memory accounts,
        uint256[] memory ids
    ) public view virtual returns (uint256[] memory) {
        if (accounts.length != ids.length) {
            revert ERC1155InvalidArrayLength(ids.length, accounts.length);
        }

        uint256[] memory batchBalances = new uint256[](accounts.length);

        for (uint256 i = 0; i < accounts.length; ++i) {
            batchBalances[i] = balanceOf(accounts.unsafeMemoryAccess(i), ids.unsafeMemoryAccess(i));
        }

        return batchBalances;
    }

    /**
     * @dev See {IERC1155-setApprovalForAll}.
     */
    function setApprovalForAll(address operator, bool approved) public virtual {
        _setApprovalForAll(_msgSender(), operator, approved);
    }

    /**
     * @dev See {IERC1155-isApprovedForAll}.
     */
    function isApprovedForAll(address account, address operator) public view virtual returns (bool) {
        return _operatorApprovals[account][operator];
    }

    /**
     * @dev See {IERC1155-safeTransferFrom}.
     */
    function safeTransferFrom(address from, address to, uint256 id, uint256 value, bytes memory data) public virtual {
        address sender = _msgSender();
        if (from != sender && !isApprovedForAll(from, sender)) {
            revert ERC1155MissingApprovalForAll(sender, from);
        }
        _safeTransferFrom(from, to, id, value, data);
    }

    /**
     * @dev See {IERC1155-safeBatchTransferFrom}.
     */
    function safeBatchTransferFrom(
        address from,
        address to,
        uint256[] memory ids,
        uint256[] memory values,
        bytes memory data
    ) public virtual {
        address sender = _msgSender();
        if (from != sender && !isApprovedForAll(from, sender)) {
            revert ERC1155MissingApprovalForAll(sender, from);
        }
        _safeBatchTransferFrom(from, to, ids, values, data);
    }

    /**
     * @dev Transfers a `value` amount of tokens of type `id` from `from` to `to`. Will mint (or burn) if `from`
     * (or `to`) is the zero address.
     *
     * Emits a {TransferSingle} event if the arrays contain one element, and {TransferBatch} otherwise.
     *
     * Requirements:
     *
     * - If `to` refers to a smart contract, it must implement either {IERC1155Receiver-onERC1155Received}
     *   or {IERC1155Receiver-onERC1155BatchReceived} and return the acceptance magic value.
     * - `ids` and `values` must have the same length.
     *
     * NOTE: The ERC-1155 acceptance check is not performed in this function. See {_updateWithAcceptanceCheck} instead.
     */
    function _update(address from, address to, uint256[] memory ids, uint256[] memory values) internal virtual {
        if (ids.length != values.length) {
            revert ERC1155InvalidArrayLength(ids.length, values.length);
        }

        address operator = _msgSender();

        for (uint256 i = 0; i < ids.length; ++i) {
            uint256 id = ids.unsafeMemoryAccess(i);
            uint256 value = values.unsafeMemoryAccess(i);

            if (from != address(0)) {
                uint256 fromBalance = _balances[id][from];
                if (fromBalance < value) {
                    revert ERC1155InsufficientBalance(from, fromBalance, value, id);
                }
                unchecked {
                    // Overflow not possible: value <= fromBalance
                    _balances[id][from] = fromBalance - value;
                }
            }

            if (to != address(0)) {
                _balances[id][to] += value;
            }
        }

        if (ids.length == 1) {
            uint256 id = ids.unsafeMemoryAccess(0);
            uint256 value = values.unsafeMemoryAccess(0);
            emit TransferSingle(operator, from, to, id, value);
        } else {
            emit TransferBatch(operator, from, to, ids, values);
        }
    }

    /**
     * @dev Version of {_update} that performs the token acceptance check by calling
     * {IERC1155Receiver-onERC1155Received} or {IERC1155Receiver-onERC1155BatchReceived} on the receiver address if it
     * contains code (eg. is a smart contract at the moment of execution).
     *
     * IMPORTANT: Overriding this function is discouraged because it poses a reentrancy risk from the receiver. So any
     * update to the contract state after this function would break the check-effect-interaction pattern. Consider
     * overriding {_update} instead.
     */
    function _updateWithAcceptanceCheck(
        address from,
        address to,
        uint256[] memory ids,
        uint256[] memory values,
        bytes memory data
    ) internal virtual {
        _update(from, to, ids, values);
        if (to != address(0)) {
            address operator = _msgSender();
            if (ids.length == 1) {
                uint256 id = ids.unsafeMemoryAccess(0);
                uint256 value = values.unsafeMemoryAccess(0);
                _doSafeTransferAcceptanceCheck(operator, from, to, id, value, data);
            } else {
                _doSafeBatchTransferAcceptanceCheck(operator, from, to, ids, values, data);
            }
        }
    }

    /**
     * @dev Transfers a `value` tokens of token type `id` from `from` to `to`.
     *
     * Emits a {TransferSingle} event.
     *
     * Requirements:
     *
     * - `to` cannot be the zero address.
     * - `from` must have a balance of tokens of type `id` of at least `value` amount.
     * - If `to` refers to a smart contract, it must implement {IERC1155Receiver-onERC1155Received} and return the
     * acceptance magic value.
     */
    function _safeTransferFrom(address from, address to, uint256 id, uint256 value, bytes memory data) internal {
        if (to == address(0)) {
            revert ERC1155InvalidReceiver(address(0));
        }
        if (from == address(0)) {
            revert ERC1155InvalidSender(address(0));
        }
        (uint256[] memory ids, uint256[] memory values) = _asSingletonArrays(id, value);
        _updateWithAcceptanceCheck(from, to, ids, values, data);
    }

    /**
     * @dev xref:ROOT:erc1155.adoc#batch-operations[Batched] version of {_safeTransferFrom}.
     *
     * Emits a {TransferBatch} event.
     *
     * Requirements:
     *
     * - If `to` refers to a smart contract, it must implement {IERC1155Receiver-onERC1155BatchReceived} and return the
     * acceptance magic value.
     * - `ids` and `values` must have the same length.
     */
    function _safeBatchTransferFrom(
        address from,
        address to,
        uint256[] memory ids,
        uint256[] memory values,
        bytes memory data
    ) internal {
        if (to == address(0)) {
            revert ERC1155InvalidReceiver(address(0));
        }
        if (from == address(0)) {
            revert ERC1155InvalidSender(address(0));
        }
        _updateWithAcceptanceCheck(from, to, ids, values, data);
    }

    /**
     * @dev Sets a new URI for all token types, by relying on the token type ID
     * substitution mechanism
     * https://eips.ethereum.org/EIPS/eip-1155#metadata[defined in the EIP].
     *
     * By this mechanism, any occurrence of the `\{id\}` substring in either the
     * URI or any of the values in the JSON file at said URI will be replaced by
     * clients with the token type ID.
     *
     * For example, the `https://token-cdn-domain/\{id\}.json` URI would be
     * interpreted by clients as
     * `https://token-cdn-domain/000000000000000000000000000000000000000000000000000000000004cce0.json`
     * for token type ID 0x4cce0.
     *
     * See {uri}.
     *
     * Because these URIs cannot be meaningfully represented by the {URI} event,
     * this function emits no events.
     */
    function _setURI(string memory newuri) internal virtual {
        _uri = newuri;
    }

    /**
     * @dev Creates a `value` amount of tokens of type `id`, and assigns them to `to`.
     *
     * Emits a {TransferSingle} event.
     *
     * Requirements:
     *
     * - `to` cannot be the zero address.
     * - If `to` refers to a smart contract, it must implement {IERC1155Receiver-onERC1155Received} and return the
     * acceptance magic value.
     */
    function _mint(address to, uint256 id, uint256 value, bytes memory data) internal {
        if (to == address(0)) {
            revert ERC1155InvalidReceiver(address(0));
        }
        (uint256[] memory ids, uint256[] memory values) = _asSingletonArrays(id, value);
        _updateWithAcceptanceCheck(address(0), to, ids, values, data);
    }

    /**
     * @dev xref:ROOT:erc1155.adoc#batch-operations[Batched] version of {_mint}.
     *
     * Emits a {TransferBatch} event.
     *
     * Requirements:
     *
     * - `ids` and `values` must have the same length.
     * - `to` cannot be the zero address.
     * - If `to` refers to a smart contract, it must implement {IERC1155Receiver-onERC1155BatchReceived} and return the
     * acceptance magic value.
     */
    function _mintBatch(address to, uint256[] memory ids, uint256[] memory values, bytes memory data) internal {
        if (to == address(0)) {
            revert ERC1155InvalidReceiver(address(0));
        }
        _updateWithAcceptanceCheck(address(0), to, ids, values, data);
    }

    /**
     * @dev Destroys a `value` amount of tokens of type `id` from `from`
     *
     * Emits a {TransferSingle} event.
     *
     * Requirements:
     *
     * - `from` cannot be the zero address.
     * - `from` must have at least `value` amount of tokens of type `id`.
     */
    function _burn(address from, uint256 id, uint256 value) internal {
        if (from == address(0)) {
            revert ERC1155InvalidSender(address(0));
        }
        (uint256[] memory ids, uint256[] memory values) = _asSingletonArrays(id, value);
        _updateWithAcceptanceCheck(from, address(0), ids, values, "");
    }

    /**
     * @dev xref:ROOT:erc1155.adoc#batch-operations[Batched] version of {_burn}.
     *
     * Emits a {TransferBatch} event.
     *
     * Requirements:
     *
     * - `from` cannot be the zero address.
     * - `from` must have at least `value` amount of tokens of type `id`.
     * - `ids` and `values` must have the same length.
     */
    function _burnBatch(address from, uint256[] memory ids, uint256[] memory values) internal {
        if (from == address(0)) {
            revert ERC1155InvalidSender(address(0));
        }
        _updateWithAcceptanceCheck(from, address(0), ids, values, "");
    }

    /**
     * @dev Approve `operator` to operate on all of `owner` tokens
     *
     * Emits an {ApprovalForAll} event.
     *
     * Requirements:
     *
     * - `operator` cannot be the zero address.
     */
    function _setApprovalForAll(address owner, address operator, bool approved) internal virtual {
        if (operator == address(0)) {
            revert ERC1155InvalidOperator(address(0));
        }
        _operatorApprovals[owner][operator] = approved;
        emit ApprovalForAll(owner, operator, approved);
    }

    /**
     * @dev Performs an acceptance check by calling {IERC1155-onERC1155Received} on the `to` address
     * if it contains code at the moment of execution.
     */
    function _doSafeTransferAcceptanceCheck(
        address operator,
        address from,
        address to,
        uint256 id,
        uint256 value,
        bytes memory data
    ) private {
        if (to.code.length > 0) {
            try IERC1155Receiver(to).onERC1155Received(operator, from, id, value, data) returns (bytes4 response) {
                if (response != IERC1155Receiver.onERC1155Received.selector) {
                    // Tokens rejected
                    revert ERC1155InvalidReceiver(to);
                }
            } catch (bytes memory reason) {
                if (reason.length == 0) {
                    // non-ERC1155Receiver implementer
                    revert ERC1155InvalidReceiver(to);
                } else {
                    /// @solidity memory-safe-assembly
                    assembly {
                        revert(add(32, reason), mload(reason))
                    }
                }
            }
        }
    }

    /**
     * @dev Performs a batch acceptance check by calling {IERC1155-onERC1155BatchReceived} on the `to` address
     * if it contains code at the moment of execution.
     */
    function _doSafeBatchTransferAcceptanceCheck(
        address operator,
        address from,
        address to,
        uint256[] memory ids,
        uint256[] memory values,
        bytes memory data
    ) private {
        if (to.code.length > 0) {
            try IERC1155Receiver(to).onERC1155BatchReceived(operator, from, ids, values, data) returns (
                bytes4 response
            ) {
                if (response != IERC1155Receiver.onERC1155BatchReceived.selector) {
                    // Tokens rejected
                    revert ERC1155InvalidReceiver(to);
                }
            } catch (bytes memory reason) {
                if (reason.length == 0) {
                    // non-ERC1155Receiver implementer
                    revert ERC1155InvalidReceiver(to);
                } else {
                    /// @solidity memory-safe-assembly
                    assembly {
                        revert(add(32, reason), mload(reason))
                    }
                }
            }
        }
    }

    /**
     * @dev Creates an array in memory with only one value for each of the elements provided.
     */
    function _asSingletonArrays(
        uint256 element1,
        uint256 element2
    ) private pure returns (uint256[] memory array1, uint256[] memory array2) {
        /// @solidity memory-safe-assembly
        assembly {
            // Load the free memory pointer
            array1 := mload(0x40)
            // Set array length to 1
            mstore(array1, 1)
            // Store the single element at the next word after the length (where content starts)
            mstore(add(array1, 0x20), element1)

            // Repeat for next array locating it right after the first array
            array2 := add(array1, 0x40)
            mstore(array2, 1)
            mstore(add(array2, 0x20), element2)

            // Update the free memory pointer by pointing after the second array
            mstore(0x40, add(array2, 0x40))
        }
    }
}

// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v5.0.0) (token/ERC1155/extensions/IERC1155MetadataURI.sol)

pragma solidity ^0.8.20;

import {IERC1155} from "../IERC1155.sol";

/**
 * @dev Interface of the optional ERC1155MetadataExtension interface, as defined
 * in the https://eips.ethereum.org/EIPS/eip-1155#metadata-extensions[EIP].
 */
interface IERC1155MetadataURI is IERC1155 {
    /**
     * @dev Returns the URI for token type `id`.
     *
     * If the `\{id\}` substring is present in the URI, it must be replaced by
     * clients with the actual token type ID.
     */
    function uri(uint256 id) external view returns (string memory);
}

// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v5.0.1) (token/ERC1155/IERC1155.sol)

pragma solidity ^0.8.20;

import {IERC165} from "../../utils/introspection/IERC165.sol";

/**
 * @dev Required interface of an ERC1155 compliant contract, as defined in the
 * https://eips.ethereum.org/EIPS/eip-1155[EIP].
 */
interface IERC1155 is IERC165 {
    /**
     * @dev Emitted when `value` amount of tokens of type `id` are transferred from `from` to `to` by `operator`.
     */
    event TransferSingle(address indexed operator, address indexed from, address indexed to, uint256 id, uint256 value);

    /**
     * @dev Equivalent to multiple {TransferSingle} events, where `operator`, `from` and `to` are the same for all
     * transfers.
     */
    event TransferBatch(
        address indexed operator,
        address indexed from,
        address indexed to,
        uint256[] ids,
        uint256[] values
    );

    /**
     * @dev Emitted when `account` grants or revokes permission to `operator` to transfer their tokens, according to
     * `approved`.
     */
    event ApprovalForAll(address indexed account, address indexed operator, bool approved);

    /**
     * @dev Emitted when the URI for token type `id` changes to `value`, if it is a non-programmatic URI.
     *
     * If an {URI} event was emitted for `id`, the standard
     * https://eips.ethereum.org/EIPS/eip-1155#metadata-extensions[guarantees] that `value` will equal the value
     * returned by {IERC1155MetadataURI-uri}.
     */
    event URI(string value, uint256 indexed id);

    /**
     * @dev Returns the value of tokens of token type `id` owned by `account`.
     *
     * Requirements:
     *
     * - `account` cannot be the zero address.
     */
    function balanceOf(address account, uint256 id) external view returns (uint256);

    /**
     * @dev xref:ROOT:erc1155.adoc#batch-operations[Batched] version of {balanceOf}.
     *
     * Requirements:
     *
     * - `accounts` and `ids` must have the same length.
     */
    function balanceOfBatch(
        address[] calldata accounts,
        uint256[] calldata ids
    ) external view returns (uint256[] memory);

    /**
     * @dev Grants or revokes permission to `operator` to transfer the caller's tokens, according to `approved`,
     *
     * Emits an {ApprovalForAll} event.
     *
     * Requirements:
     *
     * - `operator` cannot be the caller.
     */
    function setApprovalForAll(address operator, bool approved) external;

    /**
     * @dev Returns true if `operator` is approved to transfer ``account``'s tokens.
     *
     * See {setApprovalForAll}.
     */
    function isApprovedForAll(address account, address operator) external view returns (bool);

    /**
     * @dev Transfers a `value` amount of tokens of type `id` from `from` to `to`.
     *
     * WARNING: This function can potentially allow a reentrancy attack when transferring tokens
     * to an untrusted contract, when invoking {onERC1155Received} on the receiver.
     * Ensure to follow the checks-effects-interactions pattern and consider employing
     * reentrancy guards when interacting with untrusted contracts.
     *
     * Emits a {TransferSingle} event.
     *
     * Requirements:
     *
     * - `to` cannot be the zero address.
     * - If the caller is not `from`, it must have been approved to spend ``from``'s tokens via {setApprovalForAll}.
     * - `from` must have a balance of tokens of type `id` of at least `value` amount.
     * - If `to` refers to a smart contract, it must implement {IERC1155Receiver-onERC1155Received} and return the
     * acceptance magic value.
     */
    function safeTransferFrom(address from, address to, uint256 id, uint256 value, bytes calldata data) external;

    /**
     * @dev xref:ROOT:erc1155.adoc#batch-operations[Batched] version of {safeTransferFrom}.
     *
     * WARNING: This function can potentially allow a reentrancy attack when transferring tokens
     * to an untrusted contract, when invoking {onERC1155BatchReceived} on the receiver.
     * Ensure to follow the checks-effects-interactions pattern and consider employing
     * reentrancy guards when interacting with untrusted contracts.
     *
     * Emits either a {TransferSingle} or a {TransferBatch} event, depending on the length of the array arguments.
     *
     * Requirements:
     *
     * - `ids` and `values` must have the same length.
     * - If `to` refers to a smart contract, it must implement {IERC1155Receiver-onERC1155BatchReceived} and return the
     * acceptance magic value.
     */
    function safeBatchTransferFrom(
        address from,
        address to,
        uint256[] calldata ids,
        uint256[] calldata values,
        bytes calldata data
    ) external;
}

// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v5.0.0) (token/ERC1155/IERC1155Receiver.sol)

pragma solidity ^0.8.20;

import {IERC165} from "../../utils/introspection/IERC165.sol";

/**
 * @dev Interface that must be implemented by smart contracts in order to receive
 * ERC-1155 token transfers.
 */
interface IERC1155Receiver is IERC165 {
    /**
     * @dev Handles the receipt of a single ERC1155 token type. This function is
     * called at the end of a `safeTransferFrom` after the balance has been updated.
     *
     * NOTE: To accept the transfer, this must return
     * `bytes4(keccak256("onERC1155Received(address,address,uint256,uint256,bytes)"))`
     * (i.e. 0xf23a6e61, or its own function selector).
     *
     * @param operator The address which initiated the transfer (i.e. msg.sender)
     * @param from The address which previously owned the token
     * @param id The ID of the token being transferred
     * @param value The amount of tokens being transferred
     * @param data Additional data with no specified format
     * @return `bytes4(keccak256("onERC1155Received(address,address,uint256,uint256,bytes)"))` if transfer is allowed
     */
    function onERC1155Received(
        address operator,
        address from,
        uint256 id,
        uint256 value,
        bytes calldata data
    ) external returns (bytes4);

    /**
     * @dev Handles the receipt of a multiple ERC1155 token types. This function
     * is called at the end of a `safeBatchTransferFrom` after the balances have
     * been updated.
     *
     * NOTE: To accept the transfer(s), this must return
     * `bytes4(keccak256("onERC1155BatchReceived(address,address,uint256[],uint256[],bytes)"))`
     * (i.e. 0xbc197c81, or its own function selector).
     *
     * @param operator The address which initiated the batch transfer (i.e. msg.sender)
     * @param from The address which previously owned the token
     * @param ids An array containing ids of each token being transferred (order and length must match values array)
     * @param values An array containing amounts of each token being transferred (order and length must match ids array)
     * @param data Additional data with no specified format
     * @return `bytes4(keccak256("onERC1155BatchReceived(address,address,uint256[],uint256[],bytes)"))` if transfer is allowed
     */
    function onERC1155BatchReceived(
        address operator,
        address from,
        uint256[] calldata ids,
        uint256[] calldata values,
        bytes calldata data
    ) external returns (bytes4);
}

// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v5.0.0) (token/ERC20/IERC20.sol)

pragma solidity ^0.8.20;

/**
 * @dev Interface of the ERC20 standard as defined in the EIP.
 */
interface IERC20 {
    /**
     * @dev Emitted when `value` tokens are moved from one account (`from`) to
     * another (`to`).
     *
     * Note that `value` may be zero.
     */
    event Transfer(address indexed from, address indexed to, uint256 value);

    /**
     * @dev Emitted when the allowance of a `spender` for an `owner` is set by
     * a call to {approve}. `value` is the new allowance.
     */
    event Approval(address indexed owner, address indexed spender, uint256 value);

    /**
     * @dev Returns the value of tokens in existence.
     */
    function totalSupply() external view returns (uint256);

    /**
     * @dev Returns the value of tokens owned by `account`.
     */
    function balanceOf(address account) external view returns (uint256);

    /**
     * @dev Moves a `value` amount of tokens from the caller's account to `to`.
     *
     * Returns a boolean value indicating whether the operation succeeded.
     *
     * Emits a {Transfer} event.
     */
    function transfer(address to, uint256 value) external returns (bool);

    /**
     * @dev Returns the remaining number of tokens that `spender` will be
     * allowed to spend on behalf of `owner` through {transferFrom}. This is
     * zero by default.
     *
     * This value changes when {approve} or {transferFrom} are called.
     */
    function allowance(address owner, address spender) external view returns (uint256);

    /**
     * @dev Sets a `value` amount of tokens as the allowance of `spender` over the
     * caller's tokens.
     *
     * Returns a boolean value indicating whether the operation succeeded.
     *
     * IMPORTANT: Beware that changing an allowance with this method brings the risk
     * that someone may use both the old and the new allowance by unfortunate
     * transaction ordering. One possible solution to mitigate this race
     * condition is to first reduce the spender's allowance to 0 and set the
     * desired value afterwards:
     * https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729
     *
     * Emits an {Approval} event.
     */
    function approve(address spender, uint256 value) external returns (bool);

    /**
     * @dev Moves a `value` amount of tokens from `from` to `to` using the
     * allowance mechanism. `value` is then deducted from the caller's
     * allowance.
     *
     * Returns a boolean value indicating whether the operation succeeded.
     *
     * Emits a {Transfer} event.
     */
    function transferFrom(address from, address to, uint256 value) external returns (bool);
}

// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v5.0.0) (utils/Arrays.sol)

pragma solidity ^0.8.20;

import {StorageSlot} from "./StorageSlot.sol";
import {Math} from "./math/Math.sol";

/**
 * @dev Collection of functions related to array types.
 */
library Arrays {
    using StorageSlot for bytes32;

    /**
     * @dev Searches a sorted `array` and returns the first index that contains
     * a value greater or equal to `element`. If no such index exists (i.e. all
     * values in the array are strictly less than `element`), the array length is
     * returned. Time complexity O(log n).
     *
     * `array` is expected to be sorted in ascending order, and to contain no
     * repeated elements.
     */
    function findUpperBound(uint256[] storage array, uint256 element) internal view returns (uint256) {
        uint256 low = 0;
        uint256 high = array.length;

        if (high == 0) {
            return 0;
        }

        while (low < high) {
            uint256 mid = Math.average(low, high);

            // Note that mid will always be strictly less than high (i.e. it will be a valid array index)
            // because Math.average rounds towards zero (it does integer division with truncation).
            if (unsafeAccess(array, mid).value > element) {
                high = mid;
            } else {
                low = mid + 1;
            }
        }

        // At this point `low` is the exclusive upper bound. We will return the inclusive upper bound.
        if (low > 0 && unsafeAccess(array, low - 1).value == element) {
            return low - 1;
        } else {
            return low;
        }
    }

    /**
     * @dev Access an array in an "unsafe" way. Skips solidity "index-out-of-range" check.
     *
     * WARNING: Only use if you are certain `pos` is lower than the array length.
     */
    function unsafeAccess(address[] storage arr, uint256 pos) internal pure returns (StorageSlot.AddressSlot storage) {
        bytes32 slot;
        // We use assembly to calculate the storage slot of the element at index `pos` of the dynamic array `arr`
        // following https://docs.soliditylang.org/en/v0.8.20/internals/layout_in_storage.html#mappings-and-dynamic-arrays.

        /// @solidity memory-safe-assembly
        assembly {
            mstore(0, arr.slot)
            slot := add(keccak256(0, 0x20), pos)
        }
        return slot.getAddressSlot();
    }

    /**
     * @dev Access an array in an "unsafe" way. Skips solidity "index-out-of-range" check.
     *
     * WARNING: Only use if you are certain `pos` is lower than the array length.
     */
    function unsafeAccess(bytes32[] storage arr, uint256 pos) internal pure returns (StorageSlot.Bytes32Slot storage) {
        bytes32 slot;
        // We use assembly to calculate the storage slot of the element at index `pos` of the dynamic array `arr`
        // following https://docs.soliditylang.org/en/v0.8.20/internals/layout_in_storage.html#mappings-and-dynamic-arrays.

        /// @solidity memory-safe-assembly
        assembly {
            mstore(0, arr.slot)
            slot := add(keccak256(0, 0x20), pos)
        }
        return slot.getBytes32Slot();
    }

    /**
     * @dev Access an array in an "unsafe" way. Skips solidity "index-out-of-range" check.
     *
     * WARNING: Only use if you are certain `pos` is lower than the array length.
     */
    function unsafeAccess(uint256[] storage arr, uint256 pos) internal pure returns (StorageSlot.Uint256Slot storage) {
        bytes32 slot;
        // We use assembly to calculate the storage slot of the element at index `pos` of the dynamic array `arr`
        // following https://docs.soliditylang.org/en/v0.8.20/internals/layout_in_storage.html#mappings-and-dynamic-arrays.

        /// @solidity memory-safe-assembly
        assembly {
            mstore(0, arr.slot)
            slot := add(keccak256(0, 0x20), pos)
        }
        return slot.getUint256Slot();
    }

    /**
     * @dev Access an array in an "unsafe" way. Skips solidity "index-out-of-range" check.
     *
     * WARNING: Only use if you are certain `pos` is lower than the array length.
     */
    function unsafeMemoryAccess(uint256[] memory arr, uint256 pos) internal pure returns (uint256 res) {
        assembly {
            res := mload(add(add(arr, 0x20), mul(pos, 0x20)))
        }
    }

    /**
     * @dev Access an array in an "unsafe" way. Skips solidity "index-out-of-range" check.
     *
     * WARNING: Only use if you are certain `pos` is lower than the array length.
     */
    function unsafeMemoryAccess(address[] memory arr, uint256 pos) internal pure returns (address res) {
        assembly {
            res := mload(add(add(arr, 0x20), mul(pos, 0x20)))
        }
    }
}

// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v5.0.1) (utils/Context.sol)

pragma solidity ^0.8.20;

/**
 * @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;
    }

    function _contextSuffixLength() internal view virtual returns (uint256) {
        return 0;
    }
}

// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v5.0.0) (utils/introspection/ERC165.sol)

pragma solidity ^0.8.20;

import {IERC165} from "./IERC165.sol";

/**
 * @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);
 * }
 * ```
 */
abstract contract ERC165 is IERC165 {
    /**
     * @dev See {IERC165-supportsInterface}.
     */
    function supportsInterface(bytes4 interfaceId) public view virtual returns (bool) {
        return interfaceId == type(IERC165).interfaceId;
    }
}

// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v5.0.0) (utils/introspection/IERC165.sol)

pragma solidity ^0.8.20;

/**
 * @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);
}

// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v5.0.0) (utils/math/Math.sol)

pragma solidity ^0.8.20;

/**
 * @dev Standard math utilities missing in the Solidity language.
 */
library Math {
    /**
     * @dev Muldiv operation overflow.
     */
    error MathOverflowedMulDiv();

    enum Rounding {
        Floor, // Toward negative infinity
        Ceil, // Toward positive infinity
        Trunc, // Toward zero
        Expand // Away from zero
    }

    /**
     * @dev Returns the addition of two unsigned integers, with an overflow flag.
     */
    function tryAdd(uint256 a, uint256 b) internal pure returns (bool, uint256) {
        unchecked {
            uint256 c = a + b;
            if (c < a) return (false, 0);
            return (true, c);
        }
    }

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

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

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

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

    /**
     * @dev Returns the 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 towards infinity instead
     * of rounding towards zero.
     */
    function ceilDiv(uint256 a, uint256 b) internal pure returns (uint256) {
        if (b == 0) {
            // Guarantee the same behavior as in a regular Solidity division.
            return a / b;
        }

        // (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 = x * y; // Least significant 256 bits of the product
            uint256 prod1; // Most significant 256 bits of the product
            assembly {
                let mm := mulmod(x, y, not(0))
                prod1 := sub(sub(mm, prod0), lt(mm, prod0))
            }

            // Handle non-overflow cases, 256 by 256 division.
            if (prod1 == 0) {
                // Solidity will revert if denominator == 0, unlike the div opcode on its own.
                // The surrounding unchecked block does not change this fact.
                // See https://docs.soliditylang.org/en/latest/control-structures.html#checked-or-unchecked-arithmetic.
                return prod0 / denominator;
            }

            // Make sure the result is less than 2^256. Also prevents denominator == 0.
            if (denominator <= prod1) {
                revert MathOverflowedMulDiv();
            }

            ///////////////////////////////////////////////
            // 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.

            uint256 twos = denominator & (0 - denominator);
            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 (unsignedRoundsUp(rounding) && 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
     * towards zero.
     *
     * 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 + (unsignedRoundsUp(rounding) && result * result < a ? 1 : 0);
        }
    }

    /**
     * @dev Return the log in base 2 of a positive value rounded towards zero.
     * 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 + (unsignedRoundsUp(rounding) && 1 << result < value ? 1 : 0);
        }
    }

    /**
     * @dev Return the log in base 10 of a positive value rounded towards zero.
     * 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 + (unsignedRoundsUp(rounding) && 10 ** result < value ? 1 : 0);
        }
    }

    /**
     * @dev Return the log in base 256 of a positive value rounded towards zero.
     * 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 256, 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 + (unsignedRoundsUp(rounding) && 1 << (result << 3) < value ? 1 : 0);
        }
    }

    /**
     * @dev Returns whether a provided rounding mode is considered rounding up for unsigned integers.
     */
    function unsignedRoundsUp(Rounding rounding) internal pure returns (bool) {
        return uint8(rounding) % 2 == 1;
    }
}

// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v5.0.0) (utils/StorageSlot.sol)
// This file was procedurally generated from scripts/generate/templates/StorageSlot.js.

pragma solidity ^0.8.20;

/**
 * @dev Library for reading and writing primitive types to specific storage slots.
 *
 * Storage slots are often used to avoid storage conflict when dealing with upgradeable contracts.
 * This library helps with reading and writing to such slots without the need for inline assembly.
 *
 * The functions in this library return Slot structs that contain a `value` member that can be used to read or write.
 *
 * Example usage to set ERC1967 implementation slot:
 * ```solidity
 * contract ERC1967 {
 *     bytes32 internal constant _IMPLEMENTATION_SLOT = 0x360894a13ba1a3210667c828492db98dca3e2076cc3735a920a3ca505d382bbc;
 *
 *     function _getImplementation() internal view returns (address) {
 *         return StorageSlot.getAddressSlot(_IMPLEMENTATION_SLOT).value;
 *     }
 *
 *     function _setImplementation(address newImplementation) internal {
 *         require(newImplementation.code.length > 0);
 *         StorageSlot.getAddressSlot(_IMPLEMENTATION_SLOT).value = newImplementation;
 *     }
 * }
 * ```
 */
library StorageSlot {
    struct AddressSlot {
        address value;
    }

    struct BooleanSlot {
        bool value;
    }

    struct Bytes32Slot {
        bytes32 value;
    }

    struct Uint256Slot {
        uint256 value;
    }

    struct StringSlot {
        string value;
    }

    struct BytesSlot {
        bytes value;
    }

    /**
     * @dev Returns an `AddressSlot` with member `value` located at `slot`.
     */
    function getAddressSlot(bytes32 slot) internal pure returns (AddressSlot storage r) {
        /// @solidity memory-safe-assembly
        assembly {
            r.slot := slot
        }
    }

    /**
     * @dev Returns an `BooleanSlot` with member `value` located at `slot`.
     */
    function getBooleanSlot(bytes32 slot) internal pure returns (BooleanSlot storage r) {
        /// @solidity memory-safe-assembly
        assembly {
            r.slot := slot
        }
    }

    /**
     * @dev Returns an `Bytes32Slot` with member `value` located at `slot`.
     */
    function getBytes32Slot(bytes32 slot) internal pure returns (Bytes32Slot storage r) {
        /// @solidity memory-safe-assembly
        assembly {
            r.slot := slot
        }
    }

    /**
     * @dev Returns an `Uint256Slot` with member `value` located at `slot`.
     */
    function getUint256Slot(bytes32 slot) internal pure returns (Uint256Slot storage r) {
        /// @solidity memory-safe-assembly
        assembly {
            r.slot := slot
        }
    }

    /**
     * @dev Returns an `StringSlot` with member `value` located at `slot`.
     */
    function getStringSlot(bytes32 slot) internal pure returns (StringSlot storage r) {
        /// @solidity memory-safe-assembly
        assembly {
            r.slot := slot
        }
    }

    /**
     * @dev Returns an `StringSlot` representation of the string storage pointer `store`.
     */
    function getStringSlot(string storage store) internal pure returns (StringSlot storage r) {
        /// @solidity memory-safe-assembly
        assembly {
            r.slot := store.slot
        }
    }

    /**
     * @dev Returns an `BytesSlot` with member `value` located at `slot`.
     */
    function getBytesSlot(bytes32 slot) internal pure returns (BytesSlot storage r) {
        /// @solidity memory-safe-assembly
        assembly {
            r.slot := slot
        }
    }

    /**
     * @dev Returns an `BytesSlot` representation of the bytes storage pointer `store`.
     */
    function getBytesSlot(bytes storage store) internal pure returns (BytesSlot storage r) {
        /// @solidity memory-safe-assembly
        assembly {
            r.slot := store.slot
        }
    }
}

// SPDX-License-Identifier: MIT

pragma solidity 0.8.24;

import {BlastNativeYield} from "./BlastNativeYield.sol";
import {IERC20Rebasing, YieldMode} from "./interfaces/IERC20Rebasing.sol";
import {IAddressFinder} from "./interfaces/IAddressFinder.sol";

/**
 * @title BlastERC20RebasingYield
 * @notice This contract is a base contract for inheriting functions to claim Blast WETH or USDB yield
 */
contract BlastERC20RebasingYield is BlastNativeYield {
    address public immutable WETH;
    address public immutable USDB;

    /**
     * @param addressFinder Blast address finder
     */
    constructor(address addressFinder) BlastNativeYield(addressFinder) {
        WETH = IAddressFinder(addressFinder).getImplementationAddress("WETH");
        USDB = IAddressFinder(addressFinder).getImplementationAddress("USDB");

        IERC20Rebasing(WETH).configure(YieldMode.CLAIMABLE);
        IERC20Rebasing(USDB).configure(YieldMode.CLAIMABLE);
    }

    /**
     * @notice Claim Blast yield. Guarding of the function is dependent on the inherited contract.
     *         Inheriting does not allow claiming by default.
     *         A public or external function is required in the child contract to access the _claim function.
     * @param wethReceiver The receiver of WETH.
     * @param usdbReceiver The receiver of USDB.
     */
    function _claimERC20RebasingYield(address wethReceiver, address usdbReceiver) internal {
        uint256 claimableWETH = IERC20Rebasing(WETH).getClaimableAmount(address(this));
        if (claimableWETH != 0) {
            IERC20Rebasing(WETH).claim(wethReceiver, claimableWETH);
        }

        uint256 claimableUSDB = IERC20Rebasing(USDB).getClaimableAmount(address(this));
        if (claimableUSDB != 0) {
            IERC20Rebasing(USDB).claim(usdbReceiver, claimableUSDB);
        }
    }
}

File 17 of 24 : BlastNativeYield.sol
// SPDX-License-Identifier: MIT

pragma solidity 0.8.24;

import {IBlast, YieldMode, GasMode} from "./interfaces/IBlast.sol";
import {IAddressFinder} from "./interfaces/IAddressFinder.sol";
import {BlastPoints} from "./BlastPoints.sol";

/**
 * @title BlastNativeYield
 * @notice This contract is a base contract for inheriting functions to claim native yield and for those that wish to receive Blast points
 */
contract BlastNativeYield is BlastPoints {
    /**
     * @param addressFinder Blast address finder
     */
    constructor(address addressFinder) BlastPoints(addressFinder) {
        address blast = IAddressFinder(addressFinder).getImplementationAddress("Blast");
        address governor = IAddressFinder(addressFinder).getImplementationAddress("Governor");
        IBlast(blast).configure(YieldMode.CLAIMABLE, GasMode.CLAIMABLE, governor);
    }
}

File 18 of 24 : BlastPoints.sol
// SPDX-License-Identifier: MIT

pragma solidity 0.8.24;

import {IBlastPoints} from "./interfaces/IBlastPoints.sol";
import {IAddressFinder} from "./interfaces/IAddressFinder.sol";

/**
 * @title BlastPoints
 * @notice This contract is a base for future contracts that wish to be recipients of Blast points to inherit from
 */
contract BlastPoints {
    /**
     * @param addressFinder Blast address finder
     */
    constructor(address addressFinder) {
        address blastPoints = IAddressFinder(addressFinder).getImplementationAddress("BlastPoints");
        address blastPointsOperator = IAddressFinder(addressFinder).getImplementationAddress("BlastPointsOperator");
        IBlastPoints(blastPoints).configurePointsOperator(blastPointsOperator);
    }
}

// SPDX-License-Identifier: MIT
pragma solidity 0.8.24;

/**
 * @title Provides addresses of the live contracts implementing certain interfaces.
 * @dev Examples are the Oracle or Store interfaces.
 * @notice This is a straight fork of UMA's Finder contract and we are using it for non-contracts as well.
 */
interface IAddressFinder {
    /**
     * @notice Updates the address of the contract that implements `interfaceName`.
     * @param interfaceName bytes32 encoding of the interface name that is either changed or registered.
     * @param implementationAddress address of the deployed contract that implements the interface.
     */
    function changeImplementationAddress(bytes32 interfaceName, address implementationAddress) external;

    /**
     * @notice Gets the address of the contract that implements the given `interfaceName`.
     * @param interfaceName queried interface.
     * @return implementationAddress address of the deployed contract that implements the interface.
     */
    function getImplementationAddress(bytes32 interfaceName) external view returns (address);
}

// SPDX-License-Identifier: MIT
pragma solidity 0.8.24;

enum YieldMode {
    AUTOMATIC,
    VOID,
    CLAIMABLE
}

enum GasMode {
    VOID,
    CLAIMABLE
}

interface IBlast {
    // configure
    function configureContract(address contractAddress, YieldMode _yield, GasMode gasMode, address governor) external;

    function configure(YieldMode _yield, GasMode gasMode, address governor) external;

    // base configuration options
    function configureClaimableYield() external;

    function configureClaimableYieldOnBehalf(address contractAddress) external;

    function configureAutomaticYield() external;

    function configureAutomaticYieldOnBehalf(address contractAddress) external;

    function configureVoidYield() external;

    function configureVoidYieldOnBehalf(address contractAddress) external;

    function configureClaimableGas() external;

    function configureClaimableGasOnBehalf(address contractAddress) external;

    function configureVoidGas() external;

    function configureVoidGasOnBehalf(address contractAddress) external;

    function configureGovernor(address _governor) external;

    function configureGovernorOnBehalf(address _newGovernor, address contractAddress) external;

    // claim yield
    function claimYield(address contractAddress, address recipientOfYield, uint256 amount) external returns (uint256);

    function claimAllYield(address contractAddress, address recipientOfYield) external returns (uint256);

    // claim gas
    function claimAllGas(address contractAddress, address recipientOfGas) external returns (uint256);

    function claimGasAtMinClaimRate(
        address contractAddress,
        address recipientOfGas,
        uint256 minClaimRateBips
    ) external returns (uint256);

    function claimMaxGas(address contractAddress, address recipientOfGas) external returns (uint256);

    function claimGas(
        address contractAddress,
        address recipientOfGas,
        uint256 gasToClaim,
        uint256 gasSecondsToConsume
    ) external returns (uint256);

    // read functions
    function readClaimableYield(address contractAddress) external view returns (uint256);

    function readYieldConfiguration(address contractAddress) external view returns (uint8);

    function readGasParams(
        address contractAddress
    ) external view returns (uint256 etherSeconds, uint256 etherBalance, uint256 lastUpdated, GasMode);
}

// SPDX-License-Identifier: MIT
pragma solidity 0.8.24;

interface IBlastPoints {
    function configurePointsOperator(address operator) external;
}

// SPDX-License-Identifier: MIT
pragma solidity 0.8.24;

enum YieldMode {
    AUTOMATIC,
    VOID,
    CLAIMABLE
}

interface IERC20Rebasing {
    // changes the yield mode of the caller and update the balance
    // to reflect the configuration
    function configure(YieldMode) external returns (uint256);

    // "claimable" yield mode accounts can call this this claim their yield
    // to another address
    function claim(address recipient, uint256 amount) external returns (uint256);

    // read the claimable amount for an account
    function getClaimableAmount(address account) external view returns (uint256);
}

// SPDX-License-Identifier: MIT
pragma solidity 0.8.24;

import {IERC20} from "@openzeppelin/contracts/token/ERC20/IERC20.sol";
import {ERC1155} from "@openzeppelin/contracts/token/ERC1155/ERC1155.sol";
import {AccessControl} from "@openzeppelin/contracts/access/AccessControl.sol";
import {CTHelpers} from "./CTHelpers.sol";

contract ConditionalTokens is ERC1155, AccessControl {
    bytes32 public constant SPLIT_POSITION_ROLE = keccak256("SPLIT_POSITION_ROLE");

    /**
     * @notice Enable or disable access control. This is primarily used for splitPosition.
     *         It is enabled by default, but if something breaks, it can be disabled as it
     *         is the default behavior of the original implementation.
     */
    bool public accessControlEnabled = true;

    /// @dev Emitted when the accessControlEnabled flag is toggled.
    event AccessControlEnabled(bool enabled);

    /// @dev Emitted upon the successful preparation of a condition.
    /// @param conditionId The condition's ID. This ID may be derived from the other three parameters via ``keccak256(abi.encodePacked(oracle, questionId, outcomeSlotCount))``.
    /// @param oracle The account assigned to report the result for the prepared condition.
    /// @param questionId An identifier for the question to be answered by the oracle.
    /// @param outcomeSlotCount The number of outcome slots which should be used for this condition. Must not exceed 256.
    event ConditionPreparation(
        bytes32 indexed conditionId,
        address indexed oracle,
        bytes32 indexed questionId,
        uint outcomeSlotCount
    );

    event ConditionResolution(
        bytes32 indexed conditionId,
        address indexed oracle,
        bytes32 indexed questionId,
        uint outcomeSlotCount,
        uint[] payoutNumerators
    );

    /// @dev Emitted when a position is successfully split.
    event PositionSplit(
        address indexed stakeholder,
        IERC20 collateralToken,
        bytes32 indexed parentCollectionId,
        bytes32 indexed conditionId,
        uint[] partition,
        uint amount
    );
    /// @dev Emitted when positions are successfully merged.
    event PositionsMerge(
        address indexed stakeholder,
        IERC20 collateralToken,
        bytes32 indexed parentCollectionId,
        bytes32 indexed conditionId,
        uint[] partition,
        uint amount
    );
    event PayoutRedemption(
        address indexed redeemer,
        IERC20 indexed collateralToken,
        bytes32 indexed parentCollectionId,
        bytes32 conditionId,
        uint[] indexSets,
        uint payout
    );

    /// Mapping key is an condition ID. Value represents numerators of the payout vector associated with the condition. This array is initialized with a length equal to the outcome slot count. E.g. Condition with 3 outcomes [A, B, C] and two of those correct [0.5, 0.5, 0]. In Ethereum there are no decimal values, so here, 0.5 is represented by fractions like 1/2 == 0.5. That's why we need numerator and denominator values. Payout numerators are also used as a check of initialization. If the numerators array is empty (has length zero), the condition was not created/prepared. See getOutcomeSlotCount.
    mapping(bytes32 => uint[]) public payoutNumerators;
    /// Denominator is also used for checking if the condition has been resolved. If the denominator is non-zero, then the condition has been resolved.
    mapping(bytes32 => uint) public payoutDenominator;

    constructor(string memory uri_) ERC1155(uri_) {}

    /**
     * @notice Enable or disable access control. Only callable by the default admin role.
     * @param enabled True to enable access control, false to disable it.
     */
    function setAccessControlEnabled(bool enabled) external onlyRole(DEFAULT_ADMIN_ROLE) {
        accessControlEnabled = enabled;
        emit AccessControlEnabled(enabled);
    }

    /// @dev This function prepares a condition by initializing a payout vector associated with the condition.
    ///
    ///      The original implementation allows the caller to specify the oracle,
    ///      but this implementation enforces the oracle to be the message sender as
    ///      it is called by the UMA adapter and this can prevent a malicious actor from
    ///      griefing attacks by frontrunning the call.
    ///
    /// @param questionId An identifier for the question to be answered by the oracle.
    /// @param outcomeSlotCount The number of outcome slots which should be used for this condition. Must not exceed 256.
    function prepareCondition(bytes32 questionId, uint outcomeSlotCount) external {
        // Limit of 256 because we use a partition array that is a number of 256 bits.
        require(outcomeSlotCount <= 256, "too many outcome slots");
        require(outcomeSlotCount > 1, "there should be more than one outcome slot");
        bytes32 conditionId = CTHelpers.getConditionId(msg.sender, questionId, outcomeSlotCount);
        require(payoutNumerators[conditionId].length == 0, "condition already prepared");
        payoutNumerators[conditionId] = new uint[](outcomeSlotCount);
        emit ConditionPreparation(conditionId, msg.sender, questionId, outcomeSlotCount);
    }

    /// @dev Called by the oracle for reporting results of conditions. Will set the payout vector for the condition with the ID ``keccak256(abi.encodePacked(oracle, questionId, outcomeSlotCount))``, where oracle is the message sender, questionId is one of the parameters of this function, and outcomeSlotCount is the length of the payouts parameter, which contains the payoutNumerators for each outcome slot of the condition.
    /// @param questionId The question ID the oracle is answering for
    /// @param payouts The oracle's answer
    function reportPayouts(bytes32 questionId, uint[] calldata payouts) external {
        uint outcomeSlotCount = payouts.length;
        require(outcomeSlotCount > 1, "there should be more than one outcome slot");
        // IMPORTANT, the oracle is enforced to be the sender because it's part of the hash.
        bytes32 conditionId = CTHelpers.getConditionId(msg.sender, questionId, outcomeSlotCount);
        require(payoutNumerators[conditionId].length == outcomeSlotCount, "condition not prepared or found");
        require(payoutDenominator[conditionId] == 0, "payout denominator already set");

        uint den = 0;
        for (uint i = 0; i < outcomeSlotCount; i++) {
            uint num = payouts[i];
            den = den + num;

            require(payoutNumerators[conditionId][i] == 0, "payout numerator already set");
            payoutNumerators[conditionId][i] = num;
        }
        require(den > 0, "payout is all zeroes");
        payoutDenominator[conditionId] = den;
        emit ConditionResolution(conditionId, msg.sender, questionId, outcomeSlotCount, payoutNumerators[conditionId]);
    }

    /// @dev This function splits a position. If splitting from the collateral, this contract will attempt to transfer `amount` collateral from the message sender to itself. Otherwise, this contract will burn `amount` stake held by the message sender in the position being split worth of EIP 1155 tokens. Regardless, if successful, `amount` stake will be minted in the split target positions. If any of the transfers, mints, or burns fail, the transaction will revert. The transaction will also revert if the given partition is trivial, invalid, or refers to more slots than the condition is prepared with.
    /// @param collateralToken The address of the positions' backing collateral token.
    /// @param parentCollectionId The ID of the outcome collections common to the position being split and the split target positions. May be null, in which only the collateral is shared.
    /// @param conditionId The ID of the condition to split on.
    /// @param partition An array of disjoint index sets representing a nontrivial partition of the outcome slots of the given condition. E.g. A|B and C but not A|B and B|C (is not disjoint). Each element's a number which, together with the condition, represents the outcome collection. E.g. 0b110 is A|B, 0b010 is B, etc.
    /// @param amount The amount of collateral or stake to split.
    function splitPosition(
        IERC20 collateralToken,
        bytes32 parentCollectionId,
        bytes32 conditionId,
        uint[] calldata partition,
        uint amount
    ) external {
        if (accessControlEnabled) {
            _checkRole(SPLIT_POSITION_ROLE);
        }

        require(partition.length > 1, "got empty or singleton partition");
        uint outcomeSlotCount = payoutNumerators[conditionId].length;
        require(outcomeSlotCount > 0, "condition not prepared yet");

        // For a condition with 4 outcomes fullIndexSet's 0b1111; for 5 it's 0b11111...
        uint fullIndexSet = (1 << outcomeSlotCount) - 1;
        // freeIndexSet starts as the full collection
        uint freeIndexSet = fullIndexSet;
        // This loop checks that all condition sets are disjoint (the same outcome is not part of more than 1 set)
        uint[] memory positionIds = new uint[](partition.length);
        uint[] memory amounts = new uint[](partition.length);
        for (uint i = 0; i < partition.length; i++) {
            uint indexSet = partition[i];
            require(indexSet > 0 && indexSet < fullIndexSet, "got invalid index set");
            require((indexSet & freeIndexSet) == indexSet, "partition not disjoint");
            freeIndexSet ^= indexSet;
            positionIds[i] = CTHelpers.getPositionId(
                collateralToken,
                CTHelpers.getCollectionId(parentCollectionId, conditionId, indexSet)
            );
            amounts[i] = amount;
        }

        if (freeIndexSet == 0) {
            // Partitioning the full set of outcomes for the condition in this branch
            if (parentCollectionId == bytes32(0)) {
                require(
                    collateralToken.transferFrom(msg.sender, address(this), amount),
                    "could not receive collateral tokens"
                );
            } else {
                _burn(msg.sender, CTHelpers.getPositionId(collateralToken, parentCollectionId), amount);
            }
        } else {
            // Partitioning a subset of outcomes for the condition in this branch.
            // For example, for a condition with three outcomes A, B, and C, this branch
            // allows the splitting of a position $:(A|C) to positions $:(A) and $:(C).
            _burn(
                msg.sender,
                CTHelpers.getPositionId(
                    collateralToken,
                    CTHelpers.getCollectionId(parentCollectionId, conditionId, fullIndexSet ^ freeIndexSet)
                ),
                amount
            );
        }

        _mintBatch(
            msg.sender,
            // position ID is the ERC 1155 token ID
            positionIds,
            amounts,
            ""
        );
        emit PositionSplit(msg.sender, collateralToken, parentCollectionId, conditionId, partition, amount);
    }

    function mergePositions(
        IERC20 collateralToken,
        bytes32 parentCollectionId,
        bytes32 conditionId,
        uint[] calldata partition,
        uint amount
    ) external {
        require(partition.length > 1, "got empty or singleton partition");
        uint outcomeSlotCount = payoutNumerators[conditionId].length;
        require(outcomeSlotCount > 0, "condition not prepared yet");

        uint fullIndexSet = (1 << outcomeSlotCount) - 1;
        uint freeIndexSet = fullIndexSet;
        uint[] memory positionIds = new uint[](partition.length);
        uint[] memory amounts = new uint[](partition.length);
        for (uint i = 0; i < partition.length; i++) {
            uint indexSet = partition[i];
            require(indexSet > 0 && indexSet < fullIndexSet, "got invalid index set");
            require((indexSet & freeIndexSet) == indexSet, "partition not disjoint");
            freeIndexSet ^= indexSet;
            positionIds[i] = CTHelpers.getPositionId(
                collateralToken,
                CTHelpers.getCollectionId(parentCollectionId, conditionId, indexSet)
            );
            amounts[i] = amount;
        }
        _burnBatch(msg.sender, positionIds, amounts);

        if (freeIndexSet == 0) {
            if (parentCollectionId == bytes32(0)) {
                require(collateralToken.transfer(msg.sender, amount), "could not send collateral tokens");
            } else {
                _mint(msg.sender, CTHelpers.getPositionId(collateralToken, parentCollectionId), amount, "");
            }
        } else {
            _mint(
                msg.sender,
                CTHelpers.getPositionId(
                    collateralToken,
                    CTHelpers.getCollectionId(parentCollectionId, conditionId, fullIndexSet ^ freeIndexSet)
                ),
                amount,
                ""
            );
        }

        emit PositionsMerge(msg.sender, collateralToken, parentCollectionId, conditionId, partition, amount);
    }

    function redeemPositions(
        IERC20 collateralToken,
        bytes32 parentCollectionId,
        bytes32 conditionId,
        uint[] calldata indexSets
    ) external {
        uint den = payoutDenominator[conditionId];
        require(den > 0, "result for condition not received yet");
        uint outcomeSlotCount = payoutNumerators[conditionId].length;
        require(outcomeSlotCount > 0, "condition not prepared yet");

        uint totalPayout = 0;

        uint fullIndexSet = (1 << outcomeSlotCount) - 1;
        for (uint i = 0; i < indexSets.length; i++) {
            uint indexSet = indexSets[i];
            require(indexSet > 0 && indexSet < fullIndexSet, "got invalid index set");
            uint positionId = CTHelpers.getPositionId(
                collateralToken,
                CTHelpers.getCollectionId(parentCollectionId, conditionId, indexSet)
            );

            uint payoutNumerator = 0;
            for (uint j = 0; j < outcomeSlotCount; j++) {
                if (indexSet & (1 << j) != 0) {
                    payoutNumerator = payoutNumerator + payoutNumerators[conditionId][j];
                }
            }

            uint payoutStake = balanceOf(msg.sender, positionId);
            if (payoutStake > 0) {
                totalPayout += (payoutStake * payoutNumerator) / den;
                _burn(msg.sender, positionId, payoutStake);
            }
        }

        if (totalPayout > 0) {
            if (parentCollectionId == bytes32(0)) {
                require(
                    collateralToken.transfer(msg.sender, totalPayout),
                    "could not transfer payout to message sender"
                );
            } else {
                _mint(msg.sender, CTHelpers.getPositionId(collateralToken, parentCollectionId), totalPayout, "");
            }
        }
        emit PayoutRedemption(msg.sender, collateralToken, parentCollectionId, conditionId, indexSets, totalPayout);
    }

    /// @dev Gets the outcome slot count of a condition.
    /// @param conditionId ID of the condition.
    /// @return Number of outcome slots associated with a condition, or zero if condition has not been prepared yet.
    function getOutcomeSlotCount(bytes32 conditionId) external view returns (uint) {
        return payoutNumerators[conditionId].length;
    }

    /// @dev Constructs a condition ID from an oracle, a question ID, and the outcome slot count for the question.
    /// @param oracle The account assigned to report the result for the prepared condition.
    /// @param questionId An identifier for the question to be answered by the oracle.
    /// @param outcomeSlotCount The number of outcome slots which should be used for this condition. Must not exceed 256.
    function getConditionId(address oracle, bytes32 questionId, uint outcomeSlotCount) external pure returns (bytes32) {
        return CTHelpers.getConditionId(oracle, questionId, outcomeSlotCount);
    }

    /// @dev Constructs an outcome collection ID from a parent collection and an outcome collection.
    /// @param parentCollectionId Collection ID of the parent outcome collection, or bytes32(0) if there's no parent.
    /// @param conditionId Condition ID of the outcome collection to combine with the parent outcome collection.
    /// @param indexSet Index set of the outcome collection to combine with the parent outcome collection.
    function getCollectionId(
        bytes32 parentCollectionId,
        bytes32 conditionId,
        uint indexSet
    ) external view returns (bytes32) {
        return CTHelpers.getCollectionId(parentCollectionId, conditionId, indexSet);
    }

    /// @dev Constructs a position ID from a collateral token and an outcome collection. These IDs are used as the ERC-1155 ID for this contract.
    /// @param collateralToken Collateral token which backs the position.
    /// @param collectionId ID of the outcome collection associated with this position.
    function getPositionId(IERC20 collateralToken, bytes32 collectionId) external pure returns (uint) {
        return CTHelpers.getPositionId(collateralToken, collectionId);
    }

    /*///////////////////////////////////////////////////////////////////
                            OVERRIDES
    //////////////////////////////////////////////////////////////////*/

    function supportsInterface(bytes4 interfaceId) public view override(ERC1155, AccessControl) returns (bool) {
        return
            interfaceId == type(ERC1155).interfaceId ||
            interfaceId == type(AccessControl).interfaceId ||
            super.supportsInterface(interfaceId);
    }
}

// SPDX-License-Identifier: MIT
pragma solidity 0.8.24;

import {IERC20} from "@openzeppelin/contracts/token/ERC20/IERC20.sol";

library CTHelpers {
    /// @dev Constructs a condition ID from an oracle, a question ID, and the outcome slot count for the question.
    /// @param oracle The account assigned to report the result for the prepared condition.
    /// @param questionId An identifier for the question to be answered by the oracle.
    /// @param outcomeSlotCount The number of outcome slots which should be used for this condition. Must not exceed 256.
    function getConditionId(address oracle, bytes32 questionId, uint outcomeSlotCount) internal pure returns (bytes32) {
        return keccak256(abi.encodePacked(oracle, questionId, outcomeSlotCount));
    }

    uint constant P = 21888242871839275222246405745257275088696311157297823662689037894645226208583;
    uint constant B = 3;

    function sqrt(uint x) private pure returns (uint y) {
        uint p = P;
        // solium-disable-next-line security/no-inline-assembly
        assembly {
            // add chain generated via https://crypto.stackexchange.com/q/27179/71252
            // and transformed to the following program:

            // x=1; y=x+x; z=y+y; z=z+z; y=y+z; x=x+y; y=y+x; z=y+y; t=z+z; t=z+t; t=t+t;
            // t=t+t; z=z+t; x=x+z; z=x+x; z=z+z; y=y+z; z=y+y; z=z+z; z=z+z; z=y+z; x=x+z;
            // z=x+x; z=z+z; z=z+z; z=x+z; y=y+z; x=x+y; z=x+x; z=z+z; y=y+z; z=y+y; t=z+z;
            // t=t+t; t=t+t; z=z+t; x=x+z; y=y+x; z=y+y; z=z+z; z=z+z; x=x+z; z=x+x; z=z+z;
            // z=x+z; z=z+z; z=z+z; z=x+z; y=y+z; z=y+y; t=z+z; t=t+t; t=z+t; t=y+t; t=t+t;
            // t=t+t; t=t+t; t=t+t; z=z+t; x=x+z; z=x+x; z=x+z; y=y+z; z=y+y; z=y+z; z=z+z;
            // t=z+z; t=z+t; w=t+t; w=w+w; w=w+w; w=w+w; w=w+w; t=t+w; z=z+t; x=x+z; y=y+x;
            // z=y+y; x=x+z; y=y+x; x=x+y; y=y+x; x=x+y; z=x+x; z=x+z; z=z+z; y=y+z; z=y+y;
            // z=z+z; x=x+z; y=y+x; z=y+y; z=y+z; x=x+z; y=y+x; x=x+y; y=y+x; z=y+y; z=z+z;
            // z=y+z; x=x+z; z=x+x; z=x+z; y=y+z; x=x+y; y=y+x; x=x+y; y=y+x; z=y+y; z=y+z;
            // z=z+z; x=x+z; y=y+x; z=y+y; z=y+z; z=z+z; x=x+z; z=x+x; t=z+z; t=t+t; t=z+t;
            // t=x+t; t=t+t; t=t+t; t=t+t; t=t+t; z=z+t; y=y+z; x=x+y; y=y+x; x=x+y; z=x+x;
            // z=x+z; z=z+z; z=z+z; z=z+z; z=x+z; y=y+z; z=y+y; z=y+z; z=z+z; x=x+z; z=x+x;
            // z=x+z; y=y+z; x=x+y; z=x+x; z=z+z; y=y+z; x=x+y; z=x+x; y=y+z; x=x+y; y=y+x;
            // z=y+y; z=y+z; x=x+z; y=y+x; z=y+y; z=y+z; z=z+z; z=z+z; x=x+z; z=x+x; z=z+z;
            // z=z+z; z=x+z; y=y+z; x=x+y; z=x+x; t=x+z; t=t+t; t=t+t; z=z+t; y=y+z; z=y+y;
            // x=x+z; y=y+x; x=x+y; y=y+x; x=x+y; y=y+x; z=y+y; t=y+z; z=y+t; z=z+z; z=z+z;
            // z=t+z; x=x+z; y=y+x; x=x+y; y=y+x; x=x+y; z=x+x; z=x+z; y=y+z; x=x+y; x=x+x;
            // x=x+x; x=x+x; x=x+x; x=x+x; x=x+x; x=x+x; x=x+x; x=x+x; x=x+x; x=x+x; x=x+x;
            // x=x+x; x=x+x; x=x+x; x=x+x; x=x+x; x=x+x; x=x+x; x=x+x; x=x+x; x=x+x; x=x+x;
            // x=x+x; x=x+x; x=x+x; x=x+x; x=x+x; x=x+x; x=x+x; x=x+x; x=x+x; x=x+x; x=x+x;
            // x=x+x; x=x+x; x=x+x; x=x+x; x=x+x; x=x+x; x=x+x; x=x+x; x=x+x; x=x+x; x=x+x;
            // x=x+x; x=x+x; x=x+x; x=x+x; x=x+x; x=x+x; x=x+x; x=x+x; x=x+x; x=x+x; x=x+x;
            // x=x+x; x=x+x; x=x+x; x=x+x; x=x+x; x=x+x; x=x+x; x=x+x; x=x+x; x=x+x; x=x+x;
            // x=x+x; x=x+x; x=x+x; x=x+x; x=x+x; x=x+x; x=x+x; x=x+x; x=x+x; x=x+x; x=x+x;
            // x=x+x; x=x+x; x=x+x; x=x+x; x=x+x; x=x+x; x=x+x; x=x+x; x=x+x; x=x+x; x=x+x;
            // x=x+x; x=x+x; x=x+x; x=x+x; x=x+x; x=x+x; x=x+x; x=x+x; x=x+x; x=x+x; x=x+x;
            // x=x+x; x=x+x; x=x+x; x=x+x; x=x+x; x=x+x; x=x+x; x=x+x; x=x+x; x=x+x; x=x+x;
            // x=x+x; x=x+x; x=x+x; x=x+x; x=x+x; x=x+x; x=x+x; x=x+x; x=x+x; x=x+x; x=x+x;
            // x=x+x; x=x+x; x=x+x; x=x+x; res=y+x
            // res == (P + 1) // 4

            y := mulmod(x, x, p)
            {
                let z := mulmod(y, y, p)
                z := mulmod(z, z, p)
                y := mulmod(y, z, p)
                x := mulmod(x, y, p)
                y := mulmod(y, x, p)
                z := mulmod(y, y, p)
                {
                    let t := mulmod(z, z, p)
                    t := mulmod(z, t, p)
                    t := mulmod(t, t, p)
                    t := mulmod(t, t, p)
                    z := mulmod(z, t, p)
                    x := mulmod(x, z, p)
                    z := mulmod(x, x, p)
                    z := mulmod(z, z, p)
                    y := mulmod(y, z, p)
                    z := mulmod(y, y, p)
                    z := mulmod(z, z, p)
                    z := mulmod(z, z, p)
                    z := mulmod(y, z, p)
                    x := mulmod(x, z, p)
                    z := mulmod(x, x, p)
                    z := mulmod(z, z, p)
                    z := mulmod(z, z, p)
                    z := mulmod(x, z, p)
                    y := mulmod(y, z, p)
                    x := mulmod(x, y, p)
                    z := mulmod(x, x, p)
                    z := mulmod(z, z, p)
                    y := mulmod(y, z, p)
                    z := mulmod(y, y, p)
                    t := mulmod(z, z, p)
                    t := mulmod(t, t, p)
                    t := mulmod(t, t, p)
                    z := mulmod(z, t, p)
                    x := mulmod(x, z, p)
                    y := mulmod(y, x, p)
                    z := mulmod(y, y, p)
                    z := mulmod(z, z, p)
                    z := mulmod(z, z, p)
                    x := mulmod(x, z, p)
                    z := mulmod(x, x, p)
                    z := mulmod(z, z, p)
                    z := mulmod(x, z, p)
                    z := mulmod(z, z, p)
                    z := mulmod(z, z, p)
                    z := mulmod(x, z, p)
                    y := mulmod(y, z, p)
                    z := mulmod(y, y, p)
                    t := mulmod(z, z, p)
                    t := mulmod(t, t, p)
                    t := mulmod(z, t, p)
                    t := mulmod(y, t, p)
                    t := mulmod(t, t, p)
                    t := mulmod(t, t, p)
                    t := mulmod(t, t, p)
                    t := mulmod(t, t, p)
                    z := mulmod(z, t, p)
                    x := mulmod(x, z, p)
                    z := mulmod(x, x, p)
                    z := mulmod(x, z, p)
                    y := mulmod(y, z, p)
                    z := mulmod(y, y, p)
                    z := mulmod(y, z, p)
                    z := mulmod(z, z, p)
                    t := mulmod(z, z, p)
                    t := mulmod(z, t, p)
                    {
                        let w := mulmod(t, t, p)
                        w := mulmod(w, w, p)
                        w := mulmod(w, w, p)
                        w := mulmod(w, w, p)
                        w := mulmod(w, w, p)
                        t := mulmod(t, w, p)
                    }
                    z := mulmod(z, t, p)
                    x := mulmod(x, z, p)
                    y := mulmod(y, x, p)
                    z := mulmod(y, y, p)
                    x := mulmod(x, z, p)
                    y := mulmod(y, x, p)
                    x := mulmod(x, y, p)
                    y := mulmod(y, x, p)
                    x := mulmod(x, y, p)
                    z := mulmod(x, x, p)
                    z := mulmod(x, z, p)
                    z := mulmod(z, z, p)
                    y := mulmod(y, z, p)
                    z := mulmod(y, y, p)
                    z := mulmod(z, z, p)
                    x := mulmod(x, z, p)
                    y := mulmod(y, x, p)
                    z := mulmod(y, y, p)
                    z := mulmod(y, z, p)
                    x := mulmod(x, z, p)
                    y := mulmod(y, x, p)
                    x := mulmod(x, y, p)
                    y := mulmod(y, x, p)
                    z := mulmod(y, y, p)
                    z := mulmod(z, z, p)
                    z := mulmod(y, z, p)
                    x := mulmod(x, z, p)
                    z := mulmod(x, x, p)
                    z := mulmod(x, z, p)
                    y := mulmod(y, z, p)
                    x := mulmod(x, y, p)
                    y := mulmod(y, x, p)
                    x := mulmod(x, y, p)
                    y := mulmod(y, x, p)
                    z := mulmod(y, y, p)
                    z := mulmod(y, z, p)
                    z := mulmod(z, z, p)
                    x := mulmod(x, z, p)
                    y := mulmod(y, x, p)
                    z := mulmod(y, y, p)
                    z := mulmod(y, z, p)
                    z := mulmod(z, z, p)
                    x := mulmod(x, z, p)
                    z := mulmod(x, x, p)
                    t := mulmod(z, z, p)
                    t := mulmod(t, t, p)
                    t := mulmod(z, t, p)
                    t := mulmod(x, t, p)
                    t := mulmod(t, t, p)
                    t := mulmod(t, t, p)
                    t := mulmod(t, t, p)
                    t := mulmod(t, t, p)
                    z := mulmod(z, t, p)
                    y := mulmod(y, z, p)
                    x := mulmod(x, y, p)
                    y := mulmod(y, x, p)
                    x := mulmod(x, y, p)
                    z := mulmod(x, x, p)
                    z := mulmod(x, z, p)
                    z := mulmod(z, z, p)
                    z := mulmod(z, z, p)
                    z := mulmod(z, z, p)
                    z := mulmod(x, z, p)
                    y := mulmod(y, z, p)
                    z := mulmod(y, y, p)
                    z := mulmod(y, z, p)
                    z := mulmod(z, z, p)
                    x := mulmod(x, z, p)
                    z := mulmod(x, x, p)
                    z := mulmod(x, z, p)
                    y := mulmod(y, z, p)
                    x := mulmod(x, y, p)
                    z := mulmod(x, x, p)
                    z := mulmod(z, z, p)
                    y := mulmod(y, z, p)
                    x := mulmod(x, y, p)
                    z := mulmod(x, x, p)
                    y := mulmod(y, z, p)
                    x := mulmod(x, y, p)
                    y := mulmod(y, x, p)
                    z := mulmod(y, y, p)
                    z := mulmod(y, z, p)
                    x := mulmod(x, z, p)
                    y := mulmod(y, x, p)
                    z := mulmod(y, y, p)
                    z := mulmod(y, z, p)
                    z := mulmod(z, z, p)
                    z := mulmod(z, z, p)
                    x := mulmod(x, z, p)
                    z := mulmod(x, x, p)
                    z := mulmod(z, z, p)
                    z := mulmod(z, z, p)
                    z := mulmod(x, z, p)
                    y := mulmod(y, z, p)
                    x := mulmod(x, y, p)
                    z := mulmod(x, x, p)
                    t := mulmod(x, z, p)
                    t := mulmod(t, t, p)
                    t := mulmod(t, t, p)
                    z := mulmod(z, t, p)
                    y := mulmod(y, z, p)
                    z := mulmod(y, y, p)
                    x := mulmod(x, z, p)
                    y := mulmod(y, x, p)
                    x := mulmod(x, y, p)
                    y := mulmod(y, x, p)
                    x := mulmod(x, y, p)
                    y := mulmod(y, x, p)
                    z := mulmod(y, y, p)
                    t := mulmod(y, z, p)
                    z := mulmod(y, t, p)
                    z := mulmod(z, z, p)
                    z := mulmod(z, z, p)
                    z := mulmod(t, z, p)
                }
                x := mulmod(x, z, p)
                y := mulmod(y, x, p)
                x := mulmod(x, y, p)
                y := mulmod(y, x, p)
                x := mulmod(x, y, p)
                z := mulmod(x, x, p)
                z := mulmod(x, z, p)
                y := mulmod(y, z, p)
            }
            x := mulmod(x, y, p)
            x := mulmod(x, x, p)
            x := mulmod(x, x, p)
            x := mulmod(x, x, p)
            x := mulmod(x, x, p)
            x := mulmod(x, x, p)
            x := mulmod(x, x, p)
            x := mulmod(x, x, p)
            x := mulmod(x, x, p)
            x := mulmod(x, x, p)
            x := mulmod(x, x, p)
            x := mulmod(x, x, p)
            x := mulmod(x, x, p)
            x := mulmod(x, x, p)
            x := mulmod(x, x, p)
            x := mulmod(x, x, p)
            x := mulmod(x, x, p)
            x := mulmod(x, x, p)
            x := mulmod(x, x, p)
            x := mulmod(x, x, p)
            x := mulmod(x, x, p)
            x := mulmod(x, x, p)
            x := mulmod(x, x, p)
            x := mulmod(x, x, p)
            x := mulmod(x, x, p)
            x := mulmod(x, x, p)
            x := mulmod(x, x, p)
            x := mulmod(x, x, p)
            x := mulmod(x, x, p)
            x := mulmod(x, x, p)
            x := mulmod(x, x, p)
            x := mulmod(x, x, p)
            x := mulmod(x, x, p)
            x := mulmod(x, x, p)
            x := mulmod(x, x, p)
            x := mulmod(x, x, p)
            x := mulmod(x, x, p)
            x := mulmod(x, x, p)
            x := mulmod(x, x, p)
            x := mulmod(x, x, p)
            x := mulmod(x, x, p)
            x := mulmod(x, x, p)
            x := mulmod(x, x, p)
            x := mulmod(x, x, p)
            x := mulmod(x, x, p)
            x := mulmod(x, x, p)
            x := mulmod(x, x, p)
            x := mulmod(x, x, p)
            x := mulmod(x, x, p)
            x := mulmod(x, x, p)
            x := mulmod(x, x, p)
            x := mulmod(x, x, p)
            x := mulmod(x, x, p)
            x := mulmod(x, x, p)
            x := mulmod(x, x, p)
            x := mulmod(x, x, p)
            x := mulmod(x, x, p)
            x := mulmod(x, x, p)
            x := mulmod(x, x, p)
            x := mulmod(x, x, p)
            x := mulmod(x, x, p)
            x := mulmod(x, x, p)
            x := mulmod(x, x, p)
            x := mulmod(x, x, p)
            x := mulmod(x, x, p)
            x := mulmod(x, x, p)
            x := mulmod(x, x, p)
            x := mulmod(x, x, p)
            x := mulmod(x, x, p)
            x := mulmod(x, x, p)
            x := mulmod(x, x, p)
            x := mulmod(x, x, p)
            x := mulmod(x, x, p)
            x := mulmod(x, x, p)
            x := mulmod(x, x, p)
            x := mulmod(x, x, p)
            x := mulmod(x, x, p)
            x := mulmod(x, x, p)
            x := mulmod(x, x, p)
            x := mulmod(x, x, p)
            x := mulmod(x, x, p)
            x := mulmod(x, x, p)
            x := mulmod(x, x, p)
            x := mulmod(x, x, p)
            x := mulmod(x, x, p)
            x := mulmod(x, x, p)
            x := mulmod(x, x, p)
            x := mulmod(x, x, p)
            x := mulmod(x, x, p)
            x := mulmod(x, x, p)
            x := mulmod(x, x, p)
            x := mulmod(x, x, p)
            x := mulmod(x, x, p)
            x := mulmod(x, x, p)
            x := mulmod(x, x, p)
            x := mulmod(x, x, p)
            x := mulmod(x, x, p)
            x := mulmod(x, x, p)
            x := mulmod(x, x, p)
            x := mulmod(x, x, p)
            x := mulmod(x, x, p)
            x := mulmod(x, x, p)
            x := mulmod(x, x, p)
            x := mulmod(x, x, p)
            x := mulmod(x, x, p)
            x := mulmod(x, x, p)
            x := mulmod(x, x, p)
            x := mulmod(x, x, p)
            x := mulmod(x, x, p)
            x := mulmod(x, x, p)
            x := mulmod(x, x, p)
            x := mulmod(x, x, p)
            x := mulmod(x, x, p)
            x := mulmod(x, x, p)
            x := mulmod(x, x, p)
            x := mulmod(x, x, p)
            x := mulmod(x, x, p)
            x := mulmod(x, x, p)
            x := mulmod(x, x, p)
            x := mulmod(x, x, p)
            x := mulmod(x, x, p)
            x := mulmod(x, x, p)
            x := mulmod(x, x, p)
            x := mulmod(x, x, p)
            x := mulmod(x, x, p)
            x := mulmod(x, x, p)
            x := mulmod(x, x, p)
            y := mulmod(y, x, p)
        }
    }

    /// @dev Constructs an outcome collection ID from a parent collection and an outcome collection.
    /// @param parentCollectionId Collection ID of the parent outcome collection, or bytes32(0) if there's no parent.
    /// @param conditionId Condition ID of the outcome collection to combine with the parent outcome collection.
    /// @param indexSet Index set of the outcome collection to combine with the parent outcome collection.
    function getCollectionId(
        bytes32 parentCollectionId,
        bytes32 conditionId,
        uint indexSet
    ) internal view returns (bytes32) {
        uint x1 = uint(keccak256(abi.encodePacked(conditionId, indexSet)));
        bool odd = x1 >> 255 != 0;
        uint y1;
        uint yy;
        do {
            x1 = addmod(x1, 1, P);
            yy = addmod(mulmod(x1, mulmod(x1, x1, P), P), B, P);
            y1 = sqrt(yy);
        } while (mulmod(y1, y1, P) != yy);
        if ((odd && y1 % 2 == 0) || (!odd && y1 % 2 == 1)) y1 = P - y1;

        uint x2 = uint(parentCollectionId);
        if (x2 != 0) {
            odd = x2 >> 254 != 0;
            x2 = (x2 << 2) >> 2;
            yy = addmod(mulmod(x2, mulmod(x2, x2, P), P), B, P);
            uint y2 = sqrt(yy);
            if ((odd && y2 % 2 == 0) || (!odd && y2 % 2 == 1)) y2 = P - y2;
            require(mulmod(y2, y2, P) == yy, "invalid parent collection ID");

            (bool success, bytes memory ret) = address(6).staticcall(abi.encode(x1, y1, x2, y2));
            require(success, "ecadd failed");
            (x1, y1) = abi.decode(ret, (uint, uint));
        }

        if (y1 % 2 == 1) x1 ^= 1 << 254;

        return bytes32(x1);
    }

    /// @dev Constructs a position ID from a collateral token and an outcome collection. These IDs are used as the ERC-1155 ID for this contract.
    /// @param collateralToken Collateral token which backs the position.
    /// @param collectionId ID of the outcome collection associated with this position.
    function getPositionId(IERC20 collateralToken, bytes32 collectionId) internal pure returns (uint) {
        return uint(keccak256(abi.encodePacked(collateralToken, collectionId)));
    }
}

Settings
{
  "viaIR": true,
  "optimizer": {
    "enabled": true,
    "runs": 200
  },
  "evmVersion": "paris",
  "outputSelection": {
    "*": {
      "*": [
        "evm.bytecode",
        "evm.deployedBytecode",
        "devdoc",
        "userdoc",
        "metadata",
        "abi"
      ]
    }
  }
}

Contract Security Audit

Contract ABI

API
[{"inputs":[{"internalType":"address","name":"addressFinder_","type":"address"},{"internalType":"address","name":"owner_","type":"address"},{"internalType":"string","name":"uri_","type":"string"}],"stateMutability":"nonpayable","type":"constructor"},{"inputs":[],"name":"AccessControlBadConfirmation","type":"error"},{"inputs":[{"internalType":"address","name":"account","type":"address"},{"internalType":"bytes32","name":"neededRole","type":"bytes32"}],"name":"AccessControlUnauthorizedAccount","type":"error"},{"inputs":[{"internalType":"address","name":"sender","type":"address"},{"internalType":"uint256","name":"balance","type":"uint256"},{"internalType":"uint256","name":"needed","type":"uint256"},{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"ERC1155InsufficientBalance","type":"error"},{"inputs":[{"internalType":"address","name":"approver","type":"address"}],"name":"ERC1155InvalidApprover","type":"error"},{"inputs":[{"internalType":"uint256","name":"idsLength","type":"uint256"},{"internalType":"uint256","name":"valuesLength","type":"uint256"}],"name":"ERC1155InvalidArrayLength","type":"error"},{"inputs":[{"internalType":"address","name":"operator","type":"address"}],"name":"ERC1155InvalidOperator","type":"error"},{"inputs":[{"internalType":"address","name":"receiver","type":"address"}],"name":"ERC1155InvalidReceiver","type":"error"},{"inputs":[{"internalType":"address","name":"sender","type":"address"}],"name":"ERC1155InvalidSender","type":"error"},{"inputs":[{"internalType":"address","name":"operator","type":"address"},{"internalType":"address","name":"owner","type":"address"}],"name":"ERC1155MissingApprovalForAll","type":"error"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"bool","name":"enabled","type":"bool"}],"name":"AccessControlEnabled","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"account","type":"address"},{"indexed":true,"internalType":"address","name":"operator","type":"address"},{"indexed":false,"internalType":"bool","name":"approved","type":"bool"}],"name":"ApprovalForAll","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"bytes32","name":"conditionId","type":"bytes32"},{"indexed":true,"internalType":"address","name":"oracle","type":"address"},{"indexed":true,"internalType":"bytes32","name":"questionId","type":"bytes32"},{"indexed":false,"internalType":"uint256","name":"outcomeSlotCount","type":"uint256"}],"name":"ConditionPreparation","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"bytes32","name":"conditionId","type":"bytes32"},{"indexed":true,"internalType":"address","name":"oracle","type":"address"},{"indexed":true,"internalType":"bytes32","name":"questionId","type":"bytes32"},{"indexed":false,"internalType":"uint256","name":"outcomeSlotCount","type":"uint256"},{"indexed":false,"internalType":"uint256[]","name":"payoutNumerators","type":"uint256[]"}],"name":"ConditionResolution","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"redeemer","type":"address"},{"indexed":true,"internalType":"contract IERC20","name":"collateralToken","type":"address"},{"indexed":true,"internalType":"bytes32","name":"parentCollectionId","type":"bytes32"},{"indexed":false,"internalType":"bytes32","name":"conditionId","type":"bytes32"},{"indexed":false,"internalType":"uint256[]","name":"indexSets","type":"uint256[]"},{"indexed":false,"internalType":"uint256","name":"payout","type":"uint256"}],"name":"PayoutRedemption","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"stakeholder","type":"address"},{"indexed":false,"internalType":"contract IERC20","name":"collateralToken","type":"address"},{"indexed":true,"internalType":"bytes32","name":"parentCollectionId","type":"bytes32"},{"indexed":true,"internalType":"bytes32","name":"conditionId","type":"bytes32"},{"indexed":false,"internalType":"uint256[]","name":"partition","type":"uint256[]"},{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"}],"name":"PositionSplit","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"stakeholder","type":"address"},{"indexed":false,"internalType":"contract IERC20","name":"collateralToken","type":"address"},{"indexed":true,"internalType":"bytes32","name":"parentCollectionId","type":"bytes32"},{"indexed":true,"internalType":"bytes32","name":"conditionId","type":"bytes32"},{"indexed":false,"internalType":"uint256[]","name":"partition","type":"uint256[]"},{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"}],"name":"PositionsMerge","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"bytes32","name":"role","type":"bytes32"},{"indexed":true,"internalType":"bytes32","name":"previousAdminRole","type":"bytes32"},{"indexed":true,"internalType":"bytes32","name":"newAdminRole","type":"bytes32"}],"name":"RoleAdminChanged","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"bytes32","name":"role","type":"bytes32"},{"indexed":true,"internalType":"address","name":"account","type":"address"},{"indexed":true,"internalType":"address","name":"sender","type":"address"}],"name":"RoleGranted","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"bytes32","name":"role","type":"bytes32"},{"indexed":true,"internalType":"address","name":"account","type":"address"},{"indexed":true,"internalType":"address","name":"sender","type":"address"}],"name":"RoleRevoked","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"operator","type":"address"},{"indexed":true,"internalType":"address","name":"from","type":"address"},{"indexed":true,"internalType":"address","name":"to","type":"address"},{"indexed":false,"internalType":"uint256[]","name":"ids","type":"uint256[]"},{"indexed":false,"internalType":"uint256[]","name":"values","type":"uint256[]"}],"name":"TransferBatch","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"operator","type":"address"},{"indexed":true,"internalType":"address","name":"from","type":"address"},{"indexed":true,"internalType":"address","name":"to","type":"address"},{"indexed":false,"internalType":"uint256","name":"id","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"value","type":"uint256"}],"name":"TransferSingle","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"string","name":"value","type":"string"},{"indexed":true,"internalType":"uint256","name":"id","type":"uint256"}],"name":"URI","type":"event"},{"inputs":[],"name":"DEFAULT_ADMIN_ROLE","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"SPLIT_POSITION_ROLE","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"USDB","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"WETH","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"accessControlEnabled","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"account","type":"address"},{"internalType":"uint256","name":"id","type":"uint256"}],"name":"balanceOf","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address[]","name":"accounts","type":"address[]"},{"internalType":"uint256[]","name":"ids","type":"uint256[]"}],"name":"balanceOfBatch","outputs":[{"internalType":"uint256[]","name":"","type":"uint256[]"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"wethReceiver","type":"address"},{"internalType":"address","name":"usdbReceiver","type":"address"}],"name":"claimYield","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes32","name":"parentCollectionId","type":"bytes32"},{"internalType":"bytes32","name":"conditionId","type":"bytes32"},{"internalType":"uint256","name":"indexSet","type":"uint256"}],"name":"getCollectionId","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"oracle","type":"address"},{"internalType":"bytes32","name":"questionId","type":"bytes32"},{"internalType":"uint256","name":"outcomeSlotCount","type":"uint256"}],"name":"getConditionId","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"pure","type":"function"},{"inputs":[{"internalType":"bytes32","name":"conditionId","type":"bytes32"}],"name":"getOutcomeSlotCount","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"contract IERC20","name":"collateralToken","type":"address"},{"internalType":"bytes32","name":"collectionId","type":"bytes32"}],"name":"getPositionId","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"pure","type":"function"},{"inputs":[{"internalType":"bytes32","name":"role","type":"bytes32"}],"name":"getRoleAdmin","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes32","name":"role","type":"bytes32"},{"internalType":"address","name":"account","type":"address"}],"name":"grantRole","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes32","name":"role","type":"bytes32"},{"internalType":"address","name":"account","type":"address"}],"name":"hasRole","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"account","type":"address"},{"internalType":"address","name":"operator","type":"address"}],"name":"isApprovedForAll","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"contract IERC20","name":"collateralToken","type":"address"},{"internalType":"bytes32","name":"parentCollectionId","type":"bytes32"},{"internalType":"bytes32","name":"conditionId","type":"bytes32"},{"internalType":"uint256[]","name":"partition","type":"uint256[]"},{"internalType":"uint256","name":"amount","type":"uint256"}],"name":"mergePositions","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"name":"payoutDenominator","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes32","name":"","type":"bytes32"},{"internalType":"uint256","name":"","type":"uint256"}],"name":"payoutNumerators","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes32","name":"questionId","type":"bytes32"},{"internalType":"uint256","name":"outcomeSlotCount","type":"uint256"}],"name":"prepareCondition","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"contract IERC20","name":"collateralToken","type":"address"},{"internalType":"bytes32","name":"parentCollectionId","type":"bytes32"},{"internalType":"bytes32","name":"conditionId","type":"bytes32"},{"internalType":"uint256[]","name":"indexSets","type":"uint256[]"}],"name":"redeemPositions","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes32","name":"role","type":"bytes32"},{"internalType":"address","name":"callerConfirmation","type":"address"}],"name":"renounceRole","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes32","name":"questionId","type":"bytes32"},{"internalType":"uint256[]","name":"payouts","type":"uint256[]"}],"name":"reportPayouts","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes32","name":"role","type":"bytes32"},{"internalType":"address","name":"account","type":"address"}],"name":"revokeRole","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"from","type":"address"},{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256[]","name":"ids","type":"uint256[]"},{"internalType":"uint256[]","name":"values","type":"uint256[]"},{"internalType":"bytes","name":"data","type":"bytes"}],"name":"safeBatchTransferFrom","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"from","type":"address"},{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256","name":"id","type":"uint256"},{"internalType":"uint256","name":"value","type":"uint256"},{"internalType":"bytes","name":"data","type":"bytes"}],"name":"safeTransferFrom","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bool","name":"enabled","type":"bool"}],"name":"setAccessControlEnabled","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"operator","type":"address"},{"internalType":"bool","name":"approved","type":"bool"}],"name":"setApprovalForAll","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"contract IERC20","name":"collateralToken","type":"address"},{"internalType":"bytes32","name":"parentCollectionId","type":"bytes32"},{"internalType":"bytes32","name":"conditionId","type":"bytes32"},{"internalType":"uint256[]","name":"partition","type":"uint256[]"},{"internalType":"uint256","name":"amount","type":"uint256"}],"name":"splitPosition","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes4","name":"interfaceId","type":"bytes4"}],"name":"supportsInterface","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"","type":"uint256"}],"name":"uri","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"}]

60c060409080825234620003a457600062005069803803809162000024828662000731565b8439820160608382031262000703576200003e8362000755565b916020926200004f84860162000755565b8686015190956001600160401b03919082821162000430570190601f85818401121562000430578251828111620006ef57601f19938a5197620000998a8786860116018a62000731565b8289528983830101116200047e5786918991835b828110620006d7575050880101528551918211620006c3576002958654936001948581811c91168015620006b8575b8a821014620006a45790818486959493116200064d575b5089928411600114620005ec57508692620005e0575b5050600019600383901b1c191690821b1784555b6004805460ff19168217815587516302abf57960e61b8082526a426c617374506f696e747360a81b8284015291936024936001600160a01b03939184169289818781875afa90811562000541578891620005a3575b508b51908382527f426c617374506f696e74734f70657261746f7200000000000000000000000000888301528a828881885afa918215620004f6579086918a9362000561575b501690813b15620004b05785878a928f84905195869485936336b91f2b60e01b8552168d8401525af1801562000541576200054b575b508a5182815264109b185cdd60da1b8782015289818781875afa9081156200054157889162000500575b508b51908382526723b7bb32b93737b960c11b888301528a828881885afa918215620004f6579086918a93620004b4575b501690813b15620004b0576064888a8f94898e95839751988997889663c8992e6160e01b88528701528d8601521660448401525af180156200048a5790879162000494575b50508951818152630ae8aa8960e31b8682015288818681865afa9081156200048a5790899291889162000446575b50608052848b51809481938252632aa9a22160e11b898301525afa9081156200043c578591620003fb575b5060a05280608051169088518781858189631a33757d60e01b978883528c8b8401525af18015620003f1579186918996959493620003bc575b5060a051168a51978895869485528401525af1908115620003b157506200037d575b836200034e846200076a565b505161486c9081620007fd82396080518181816114d1015261167c015260a051818181610b9101526115240152f35b813d8311620003a9575b62000393818362000731565b81010312620003a457388062000342565b600080fd5b503d62000387565b8551903d90823e3d90fd5b90958092503d8311620003e9575b620003d6818362000731565b81010312620003a4578487943862000320565b503d620003ca565b8a513d88823e3d90fd5b90508681813d831162000434575b62000415818362000731565b810103126200043057620004299062000755565b38620002e7565b8480fd5b503d62000409565b89513d87823e3d90fd5b8381939492503d831162000482575b62000461818362000731565b810103126200047e579062000477899262000755565b38620002bc565b8680fd5b503d62000455565b8b513d89823e3d90fd5b6200049f9062000707565b620004ac5785386200028e565b8580fd5b8880fd5b8c809294508193503d8311620004ee575b620004d1818362000731565b81010312620004b057620004e6869162000755565b913862000249565b503d620004c5565b8d513d8b823e3d90fd5b90508981813d831162000539575b6200051a818362000731565b8101031262000535576200052e9062000755565b3862000218565b8780fd5b503d6200050e565b8c513d8a823e3d90fd5b620005599097919762000707565b9538620001ee565b8c809294508193503d83116200059b575b6200057e818362000731565b81010312620004b05762000593869162000755565b9138620001b8565b503d62000572565b90508981813d8311620005d8575b620005bd818362000731565b810103126200053557620005d19062000755565b3862000172565b503d620005b1565b01519050388062000109565b88885289882086959093929116885b8b8282106200063657505084116200061c575b505050811b0184556200011d565b015160001960f88460031b161c191690553880806200060e565b8385015186558897909501949384019301620005fb565b90919293508888528988208480870160051c8201928c88106200069a575b9187968992969594930160051c01915b8281106200068b575050620000f3565b8a81558796508891016200067b565b925081926200066b565b634e487b7160e01b88526022600452602488fd5b90607f1690620000dc565b634e487b7160e01b85526041600452602485fd5b8181018401518b82018501528994508b9301620000ad565b634e487b7160e01b86526041600452602486fd5b5080fd5b6001600160401b0381116200071b57604052565b634e487b7160e01b600052604160045260246000fd5b601f909101601f19168101906001600160401b038211908210176200071b57604052565b51906001600160a01b0382168203620003a457565b6001600160a01b031660008181527f3617319a054d772f909f7c479a2cebe5066e836a939412e32403c99029b92eff602052604081205490919060ff16620007f85781805260036020526040822081835260205260408220600160ff1982541617905533917f2f8788117e7eff1d82e926ec794901d17c78024a50270940304540a733656f0d8180a4600190565b509056fe6080604052600436101561001257600080fd5b60003560e01c8062fdd58e1461020657806301b7037c1461020157806301ffc9a7146101fc5780630504c814146101f75780630dc0669b146101f25780630e89341c146101ed578063248a9ca3146101e85780632eb2c2d6146101e35780632f2ff15d146101de57806331a0edec146101d957806336568abe146101d457806339dd7530146101cf578063495f17f9146101ca5780634e1273f4146101c557806365d363d5146101c057806372ce4275146101bb57806384c4798b146101b6578063852c6ae2146101b1578063856296f7146101ac57806391d14854146101a75780639e7212ad146101a2578063a217fddf1461019d578063a22cb46514610198578063a53da0a014610193578063ad5c46481461018e578063c49298ac14610189578063d42dc0c214610184578063d547741f1461017f578063dd34de671461017a578063e985e9c5146101755763f242432a1461017057600080fd5b6118fc565b6118be565b611892565b611850565b611824565b6116ab565b611666565b611493565b6113ba565b61139e565b6111c2565b61116c565b611148565b611119565b6110de565b610e96565b610e2b565b610d6f565b610c3e565b610c0b565b610bc0565b610b7b565b610b39565b610a0c565b6108ad565b6107a8565b6106f2565b6106a1565b6105a7565b6102a2565b610221565b6001600160a01b0381160361021c57565b600080fd5b3461021c57604036600319011261021c5760206102696004356102438161020b565b6024356000526000835260406000209060018060a01b0316600052602052604060002090565b54604051908152f35b9181601f8401121561021c578235916001600160401b03831161021c576020808501948460051b01011161021c57565b3461021c57608036600319011261021c576004356102bf8161020b565b602435906044356064356001600160401b03811161021c576102e5903690600401610272565b6102fc839492946000526006602052604060002090565b5491610309831515611a21565b61031d846000526005602052604060002090565b549261032a841515611a7b565b60009360019161033c6001831b611add565b91865b88878b8d82851061048b57918b84918b82610396575b6103917f2682012a4a4f1973119f1c9b90745d1bd91fa2bab387344f044cb3586864d18d9360405193849360018060a01b031697339785611c5e565b0390a4005b856104445760405163a9059cbb60e01b8152336004820152602481018490529260208460448160006001600160a01b0387165af190811561043f57610408610391927f2682012a4a4f1973119f1c9b90745d1bd91fa2bab387344f044cb3586864d18d96600091610410575b50611bda565b935050610355565b610432915060203d602011610438575b61042a8183610912565b810190611bb9565b8a610402565b503d610420565b611bce565b6103917f2682012a4a4f1973119f1c9b90745d1bd91fa2bab387344f044cb3586864d18d936104866104768985612463565b8261047f611ba6565b91336124fc565b610408565b61049c856104bd946104b794611b0d565b359384918215158061058c575b6104b290611b1d565b61223b565b88612463565b9060009087825b868110610542575050506104fd336104e6846000526000602052604060002090565b9060018060a01b0316600052602052604060002090565b54908161050f575b505050840161033f565b906105338894939b61052d8861052861053a9686611b6e565b611b97565b90611b61565b9a336124aa565b903880610505565b8d82821b8416610556575b500188906104c4565b9361052d61057b8361057661058595986000526005602052604060002090565b610684565b90549060031b1c90565b928d61054d565b508983106104a9565b6001600160e01b031981160361021c57565b3461021c57602036600319011261021c576105fc6004356105c781610595565b63ffffffff60e01b1663d6c0879d60e01b811490811561065d575b8115610600575b5060405190151581529081906020820190565b0390f35b637965db0b60e01b81149150811561061a575b50386105e9565b636cdb3d1360e11b81149150811561064c575b811561063b575b5038610613565b6301ffc9a760e01b14905038610634565b6303a24d0760e21b8114915061062d565b63da8def7360e01b811491506105e2565b634e487b7160e01b600052603260045260246000fd5b805482101561069c5760005260206000200190600090565b61066e565b3461021c57604036600319011261021c5760243560043560005260056020526040600020805482101561021c576020916106da91610684565b90546040519160031b1c8152f35b8015150361021c57565b3461021c57602036600319011261021c577f4b8a13d19620daaabc8ebae3856b7da47275aa410c470fb90a7ac85622d092766020600435610732816106e8565b61073a612540565b151560ff196004541660ff821617600455604051908152a1005b919082519283825260005b848110610780575050826000602080949584010152601f8019910116010190565b60208183018101518483018201520161075f565b9060206107a5928181520190610754565b90565b3461021c5760208060031936011261021c57604051906000906002546001918160011c92600183169283156108a3575b60208510841461088f5784875260208701939081156108705750600114610816575b6105fc8661080a81880382610912565b60405191829182610794565b6002600090815294509192917f405787fa12a823e0f2b7631cc41b3ba8828b3321ca811111fa75cd3aa3bb5ace5b83861061085f575050509101905061080a826105fc386107fa565b805485870152948201948101610844565b60ff1916845250505090151560051b01905061080a826105fc386107fa565b634e487b7160e01b86526022600452602486fd5b93607f16936107d8565b3461021c57602036600319011261021c5760043560005260036020526020600160406000200154604051908152f35b634e487b7160e01b600052604160045260246000fd5b602081019081106001600160401b0382111761090d57604052565b6108dc565b90601f801991011681019081106001600160401b0382111761090d57604052565b6001600160401b03811161090d5760051b60200190565b9080601f8301121561021c57602090823561096481610933565b936109726040519586610912565b81855260208086019260051b82010192831161021c57602001905b82821061099b575050505090565b8135815290830190830161098d565b6001600160401b03811161090d57601f01601f191660200190565b81601f8201121561021c578035906109dc826109aa565b926109ea6040519485610912565b8284526020838301011161021c57816000926020809301838601378301015290565b3461021c5760a036600319011261021c5760048035610a2a8161020b565b602435610a368161020b565b6001600160401b039060443582811161021c57610a56903690860161094a565b9060643583811161021c57610a6e903690870161094a565b9260843590811161021c57610a8690369087016109c5565b936001600160a01b03808216903382141580610b15575b610ae857831615610ad05715610ab957610ab79550614300565b005b604051626a0d4560e21b8152600081880152602490fd5b604051632bfa23e760e11b8152600081890152602490fd5b6040805163711bec9160e11b815233818b019081526001600160a01b038616602082015290918291010390fd5b50600082815260016020908152604080832033845290915290205460ff1615610a9d565b3461021c57604036600319011261021c57610ab7602435600435610b5c8261020b565b806000526003602052610b76600160406000200154612614565b612635565b3461021c57600036600319011261021c576040517f00000000000000000000000000000000000000000000000000000000000000006001600160a01b03168152602090f35b3461021c57604036600319011261021c57602435610bdd8161020b565b336001600160a01b03821603610bf957610ab7906004356126cf565b60405163334bd91960e11b8152600490fd5b3461021c57604036600319011261021c576020610c36600435610c2d8161020b565b60243590612463565b604051908152f35b3461021c57604036600319011261021c576004356024356101008111610cec57610c6a60018211611c81565b610c75818333612761565b610c93610c8c826000526005602052604060002090565b5415611ce0565b610cb8610c9f83611d2c565b610cb3836000526005602052604060002090565b611d5e565b60405191825233917fab3760c3bd2bb38b5bcf54dc79802ed67338b4cf29f3054ded67ed24661e4177908060208101610391565b60405162461bcd60e51b8152602060048201526016602482015275746f6f206d616e79206f7574636f6d6520736c6f747360501b6044820152606490fd5b90815180825260208080930193019160005b828110610d4a575050505090565b835185529381019392810192600101610d3c565b9060206107a5928181520190610d2a565b3461021c57604036600319011261021c576004356001600160401b0380821161021c573660238301121561021c578160040135610dab81610933565b92610db96040519485610912565b8184526020916024602086019160051b8301019136831161021c57602401905b828210610e12578560243586811161021c576105fc91610e00610e0692369060040161094a565b90611e04565b60405191829182610d5e565b8380918335610e208161020b565b815201910190610dd9565b3461021c57600036600319011261021c57602060ff600454166040519015158152f35b9060a060031983011261021c57600435610e678161020b565b916024359160443591606435906001600160401b03821161021c57610e8e91600401610272565b909160843590565b3461021c57610ea436610e4e565b91610eb460049694965460ff1690565b6110d1575b600192610ec860018411611ea1565b610ef36001610ee1896000526005602052604060002090565b54610eed811515611a7b565b1b611add565b90868883610f0087611d2c565b94610f0a88611d2c565b9860005b89898183106110645750505050811560001461102057505050610fde576040516323b872dd60e01b8152336004820152306024820152604481018290529160208360648160006001600160a01b038c165af190811561043f577f2e6bb91f8cbcda0c93623c54d0403a43514fabc40084ec96b6d5379a7478629896610fa2610fb19361039196600091610fbf575b50611f31565b610faa611ba6565b91336127ad565b604051938493339785611f89565b610fd8915060203d6020116104385761042a8183610912565b38610f9c565b610fb1610391927f2e6bb91f8cbcda0c93623c54d0403a43514fabc40084ec96b6d5379a747862989661101b846110158c8c612463565b336124aa565b610fa2565b8461101561105e610fb19661039199967f2e6bb91f8cbcda0c93623c54d0403a43514fabc40084ec96b6d5379a747862989d9661101b96189161223b565b8c612463565b9483959661107c8461105e946110a59697989a611b0d565b358092811515806110c8575b61109190611b1d565b61109e8282811614611eec565b189861223b565b6110af8289611df0565b52856110bb828c611df0565b5201918a93918c93610f0e565b50898210611088565b6110d9612598565b610eb9565b3461021c57600036600319011261021c5760206040517fa4824335b213805ba654706c40821730e55db9c8454c9bad67628ce870600cf28152f35b3461021c57606036600319011261021c576020610c3660043561113b8161020b565b6044359060243590612761565b3461021c57606036600319011261021c576020610c3660443560243560043561223b565b3461021c57604036600319011261021c57602060ff6111b66024356111908161020b565b6004356000526003845260406000209060018060a01b0316600052602052604060002090565b54166040519015158152f35b3461021c576111d036610e4e565b9160019593956111e260018411611ea1565b6111fb6001610ee1896000526005602052604060002090565b90819061120785611d2c565b8861121187611d2c565b9260005b8c8989818410611337575050505050509061123091336127c8565b816112ff575050846112c85760405163a9059cbb60e01b8152336004820152602481018490529260208460448160006001600160a01b038a165af190811561043f57610fb1610391927f6f13ca62553fcc2bcd2372180a43949c1e4cebba603901ede2f4e14f36b282ca966000916112a9575b50611faf565b6112c2915060203d6020116104385761042a8183610912565b386112a3565b6103917f6f13ca62553fcc2bcd2372180a43949c1e4cebba603901ede2f4e14f36b282ca936112fa6104768888612463565b610fb1565b936112fa6104766104b7610391947f6f13ca62553fcc2bcd2372180a43949c1e4cebba603901ede2f4e14f36b282ca98188b8b61223b565b986113759261134c8561105e9488999d611b0d565b35809281151580611395575b61136190611b1d565b61136e8282811614611eec565b189a61223b565b61137f8286611df0565b528961138b8287611df0565b5201908a91611215565b508b8210611358565b3461021c57600036600319011261021c57602060405160008152f35b3461021c57604036600319011261021c576004356113d78161020b565b6024356113e3816106e8565b6001600160a01b038216918215611456573360009081526001602090815260408083206001600160a01b039094168352929052209015159060ff1981541660ff83161790556040519081527f17307eab39ab6107e8899845ad3d59bd9653f200f220920489ca2b5937696c3160203392a3005b60405162ced3e160e81b815260006004820152602490fd5b604090600319011261021c576004356114868161020b565b906024356107a58161020b565b3461021c576114a13661146e565b906114aa612540565b60405163e12f3a6160e01b808252306004830152602093909290916001600160a01b0391907f000000000000000000000000000000000000000000000000000000000000000083168682602481845afa90811561043f578792600092611647575b50816115e5575b505060405194855250503060048401527f000000000000000000000000000000000000000000000000000000000000000016918381602481865afa90811561043f576000916115c8575b508061156457005b604051635569f64b60e11b81526001600160a01b039290921660048301526024820152908290829060449082906000905af1801561043f576115a257005b81610ab792903d106115c1575b6115b98183610912565b8101906127eb565b503d6115af565b6115df9150843d86116115c1576115b98183610912565b3861155c565b604051635569f64b60e11b81526001600160a01b039490941660048501526024840191909152829060449082906000905af1801561043f5761162a575b848180611512565b61164090853d87116115c1576115b98183610912565b5038611622565b61165f919250833d85116115c1576115b98183610912565b903861150b565b3461021c57600036600319011261021c576040517f00000000000000000000000000000000000000000000000000000000000000006001600160a01b03168152602090f35b3461021c57604036600319011261021c576004356024356001600160401b03811161021c576116de903690600401610272565b906001906116ee60018411611c81565b6116f9838533612761565b9161171984611712856000526005602052604060002090565b5414611ffa565b611737611730846000526006602052604060002090565b5415612046565b60009160005b8581106117ad575050506117528115156120de565b611766826000526006602052604060002090565b557fb44d84d3289691f71497564b85d4233648d9dbae8cbdbb4329f301c3a018589461039161179f836000526005602052604060002090565b604051918291339683612121565b8061181e6117c86117c086948a87611b0d565b358097611b61565b956117ed6117e761057b856105768c6000526005602052604060002090565b15612092565b611805836105768a6000526005602052604060002090565b90919082549060031b91821b91600019901b1916179055565b0161173d565b3461021c57602036600319011261021c5760043560005260056020526020604060002054604051908152f35b3461021c57604036600319011261021c57610ab76024356004356118738261020b565b80600052600360205261188d600160406000200154612614565b6126cf565b3461021c57602036600319011261021c5760043560005260066020526020604060002054604051908152f35b3461021c57602060ff6111b66118d33661146e565b6001600160a01b0391821660009081526001865260408082209290931681526020919091522090565b3461021c5760a036600319011261021c576004356119198161020b565b6024356119258161020b565b6084356001600160401b03811161021c576119449036906004016109c5565b906001600160a01b038381169033821415806119fd575b6119d6578216156119bd57156119a557610ab79261199d6064356044359160405192600184526020840152604083019160018352606084015260808301604052565b929091614300565b604051626a0d4560e21b815260006004820152602490fd5b604051632bfa23e760e11b815260006004820152602490fd5b60405163711bec9160e11b81523360048201526001600160a01b0386166024820152604490fd5b50600082815260016020908152604080832033845290915290205460ff161561195b565b15611a2857565b60405162461bcd60e51b815260206004820152602560248201527f726573756c7420666f7220636f6e646974696f6e206e6f74207265636569766560448201526419081e595d60da1b6064820152608490fd5b15611a8257565b60405162461bcd60e51b815260206004820152601a60248201527f636f6e646974696f6e206e6f74207072657061726564207965740000000000006044820152606490fd5b634e487b7160e01b600052601160045260246000fd5b600019810191908211611aec57565b611ac7565b90600080516020614817833981519152918203918211611aec57565b919081101561069c5760051b0190565b15611b2457565b60405162461bcd60e51b815260206004820152601560248201527419dbdd081a5b9d985b1a59081a5b99195e081cd95d605a1b6044820152606490fd5b91908201809211611aec57565b81810292918115918404141715611aec57565b634e487b7160e01b600052601260045260246000fd5b8115611ba1570490565b611b81565b60405190611bb3826108f2565b60008252565b9081602091031261021c57516107a5816106e8565b6040513d6000823e3d90fd5b15611be157565b60405162461bcd60e51b815260206004820152602b60248201527f636f756c64206e6f74207472616e73666572207061796f757420746f206d657360448201526a39b0b3b29039b2b73232b960a91b6064820152608490fd5b81835290916001600160fb1b03831161021c5760209260051b809284830137010190565b94939291604092611c7c928752606060208801526060870191611c3a565b930152565b15611c8857565b60405162461bcd60e51b815260206004820152602a60248201527f74686572652073686f756c64206265206d6f7265207468616e206f6e65206f756044820152691d18dbdb59481cdb1bdd60b21b6064820152608490fd5b15611ce757565b60405162461bcd60e51b815260206004820152601a60248201527f636f6e646974696f6e20616c72656164792070726570617265640000000000006044820152606490fd5b90611d3682610933565b611d436040519182610912565b8281528092611d54601f1991610933565b0190602036910137565b8151916001600160401b03831161090d5768010000000000000000831161090d578154838355808410611dc5575b50611da1602080920192600052602060002090565b9060005b848110611db3575050505050565b83518382015592810192600101611da5565b60008360005284602060002092830192015b828110611de5575050611d8c565b818155600101611dd7565b805182101561069c5760209160051b010190565b91909180518351808203611e7f575050611e1e8151611d2c565b9060009060005b8151811015611e775780611e6560019260051b85602080808489010151938c010151825252604086209060018060a01b0316600052602052604060002090565b54611e708287611df0565b5201611e25565b509193505050565b604051635b05999160e01b815260048101919091526024810191909152604490fd5b15611ea857565b606460405162461bcd60e51b815260206004820152602060248201527f676f7420656d707479206f722073696e676c65746f6e20706172746974696f6e6044820152fd5b15611ef357565b60405162461bcd60e51b81526020600482015260166024820152751c185c9d1a5d1a5bdb881b9bdd08191a5cda9bda5b9d60521b6044820152606490fd5b15611f3857565b60405162461bcd60e51b815260206004820152602360248201527f636f756c64206e6f74207265636569766520636f6c6c61746572616c20746f6b604482015262656e7360e81b6064820152608490fd5b94939291604092611c7c9260018060a01b03168752606060208801526060870191611c3a565b15611fb657565b606460405162461bcd60e51b815260206004820152602060248201527f636f756c64206e6f742073656e6420636f6c6c61746572616c20746f6b656e736044820152fd5b1561200157565b60405162461bcd60e51b815260206004820152601f60248201527f636f6e646974696f6e206e6f74207072657061726564206f7220666f756e64006044820152606490fd5b1561204d57565b60405162461bcd60e51b815260206004820152601e60248201527f7061796f75742064656e6f6d696e61746f7220616c72656164792073657400006044820152606490fd5b1561209957565b60405162461bcd60e51b815260206004820152601c60248201527f7061796f7574206e756d657261746f7220616c726561647920736574000000006044820152606490fd5b156120e557565b60405162461bcd60e51b81526020600482015260146024820152737061796f757420697320616c6c207a65726f657360601b6044820152606490fd5b9060408201908252606060209260406020820152845480935201926000526020600020916000905b828210612157575050505090565b835485529384019360019384019390910190612149565b1561217557565b60405162461bcd60e51b815260206004820152601c60248201527f696e76616c696420706172656e7420636f6c6c656374696f6e204944000000006044820152606490fd5b3d156121e5573d906121cb826109aa565b916121d96040519384610912565b82523d6000602084013e565b606090565b156121f157565b60405162461bcd60e51b815260206004820152600c60248201526b1958d859190819985a5b195960a21b6044820152606490fd5b919082604091031261021c576020825192015190565b6040805160208101938452808201949094528352601f19939092909190612263606082610912565b5190209260ff84901c1592600091841583808060015b156122c1575b505050600093611ba15760019660008051602061481783398151915297889108958497600381808a80098a0908886122b6826127fa565b969996929899612279565b611ba157600080516020614817833981519152828009146122e357808561227f565b94969581612457575b811561243d575b5061242d575b81612318575b50505060018091161461230f5790565b600160fe1b1890565b6001600160fe1b0382169460fe9290921c15801594919391929091611ba1576001956123c66123ec956000956123ba8a9988976000805160206148178339815191529182600381808b80098b090890612370826127fa565b9281612422575b8115612409575b506123f6575b81928261239293091461216e565b6040519586936020850198899094939260609260808301968352602083015260408201520152565b03908101835282610912565b519060065afa6123dd6123d76121ba565b916121ea565b60208082518301019101612225565b92909291386122ff565b61240261239292611af1565b9150612384565b905080612417575b3861237e565b508c80831614612411565b838f16159150612377565b9261243790611af1565b926122f9565b90508061244b575b386122f3565b50600180851614612445565b600186161591506122ec565b906040519060208201926bffffffffffffffffffffffff199060601b168352603482015260348152606081018181106001600160401b0382111761090d5760405251902090565b906001600160a01b038216156119a5576124fa926124e560405192600184526020840152604083019160018352606084015260808301604052565b9160006040516124f4816108f2565b52614035565b565b919291906001600160a01b038216156119bd576124fa9361253a60405192600184526020840152604083019160018352606084015260808301604052565b9161419c565b3360009081527f3617319a054d772f909f7c479a2cebe5066e836a939412e32403c99029b92eff602052604090205460ff161561257957565b60405163e2517d3f60e01b815233600482015260006024820152604490fd5b3360009081527fda46efd754845a1d253c8da23948be7f3b2e2da4129e0cac568740bef09f3dfe602052604090207fa4824335b213805ba654706c40821730e55db9c8454c9bad67628ce870600cf29060ff905b5416156125f65750565b6044906040519063e2517d3f60e01b82523360048301526024820152fd5b6000818152600360209081526040808320338452909152902060ff906125ec565b600090808252600360205260ff61266184604085209060018060a01b0316600052602052604060002090565b54166126c9578082526003602090815260408084206001600160a01b038616600090815292529020805460ff1916600117905533926001600160a01b0316917f2f8788117e7eff1d82e926ec794901d17c78024a50270940304540a733656f0d9080a4600190565b50905090565b600090808252600360205260ff6126fb84604085209060018060a01b0316600052602052604060002090565b5416156126c9578082526003602090815260408084206001600160a01b038616600090815292529020805460ff1916905533926001600160a01b0316917ff6391f5c32d9c69d2a47ea670b442974b53935d1edc7fd64eb21e047a839171b9080a4600190565b916040519160208301936bffffffffffffffffffffffff199060601b1684526034830152605482015260548152608081018181106001600160401b0382111761090d5760405251902090565b9291906001600160a01b038416156119bd576124fa9361419c565b91906001600160a01b038316156119a5576124fa9260006040516124f4816108f2565b9081602091031261021c575190565b600080516020614817833981519152818009600080516020614817833981519152818009806000805160206148178339815191529109600080516020614817833981519152910990816000805160206148178339815191529109908160008051602061481783398151915291099060008051602061481783398151915282800960008051602061481783398151915281800960008051602061481783398151915290820980600080516020614817833981519152910980600080516020614817833981519152910960008051602061481783398151915291096000805160206148178339815191529109906000805160206148178339815191528280098060008051602061481783398151915291096000805160206148178339815191529109906000805160206148178339815191528280098060008051602061481783398151915291098060008051602061481783398151915291096000805160206148178339815191529083096000805160206148178339815191529109906000805160206148178339815191528280098060008051602061481783398151915291098060008051602061481783398151915291096000805160206148178339815191529083096000805160206148178339815191529109908160008051602061481783398151915291099060008051602061481783398151915282800980600080516020614817833981519152910960008051602061481783398151915291099060008051602061481783398151915282800960008051602061481783398151915281800980600080516020614817833981519152910980600080516020614817833981519152910960008051602061481783398151915291096000805160206148178339815191529109908160008051602061481783398151915291099060008051602061481783398151915282800980600080516020614817833981519152910980600080516020614817833981519152910960008051602061481783398151915291099060008051602061481783398151915282800980600080516020614817833981519152910960008051602061481783398151915290830980600080516020614817833981519152910980600080516020614817833981519152910960008051602061481783398151915290830960008051602061481783398151915291099060008051602061481783398151915282800960008051602061481783398151915281800980600080516020614817833981519152910960008051602061481783398151915290820960008051602061481783398151915290840980600080516020614817833981519152910980600080516020614817833981519152910980600080516020614817833981519152910980600080516020614817833981519152910960008051602061481783398151915291096000805160206148178339815191529109906000805160206148178339815191528280096000805160206148178339815191529083096000805160206148178339815191529109906000805160206148178339815191528280096000805160206148178339815191529083098060008051602061481783398151915291096000805160206148178339815191528180096000805160206148178339815191529082096000805160206148178339815191528180098060008051602061481783398151915291098060008051602061481783398151915291098060008051602061481783398151915291098060008051602061481783398151915291096000805160206148178339815191529109600080516020614817833981519152910960008051602061481783398151915291099081600080516020614817833981519152910990600080516020614817833981519152828009600080516020614817833981519152910990816000805160206148178339815191529109908160008051602061481783398151915291099081600080516020614817833981519152910990816000805160206148178339815191529109906000805160206148178339815191528280096000805160206148178339815191529083098060008051602061481783398151915291096000805160206148178339815191529109906000805160206148178339815191528280098060008051602061481783398151915291096000805160206148178339815191529109908160008051602061481783398151915291099060008051602061481783398151915282800960008051602061481783398151915290830960008051602061481783398151915291099081600080516020614817833981519152910990816000805160206148178339815191529109600080516020614817833981519152818309600080516020614817833981519152828409906000805160206148178339815191529109806000805160206148178339815191529109600080516020614817833981519152828409906000805160206148178339815191529109600080516020614817833981519152908209916000805160206148178339815191528380096000805160206148178339815191529084099160008051602061481783398151915291099060008051602061481783398151915291099081600080516020614817833981519152910990816000805160206148178339815191529109908160008051602061481783398151915291099081600080516020614817833981519152910990600080516020614817833981519152828009600080516020614817833981519152908309806000805160206148178339815191529109600080516020614817833981519152910990816000805160206148178339815191529109906000805160206148178339815191528280096000805160206148178339815191529083098060008051602061481783398151915291096000805160206148178339815191529109906000805160206148178339815191528280096000805160206148178339815191528180098060008051602061481783398151915291096000805160206148178339815191529082096000805160206148178339815191529084098060008051602061481783398151915291098060008051602061481783398151915291098060008051602061481783398151915291098060008051602061481783398151915291096000805160206148178339815191529109600080516020614817833981519152910990816000805160206148178339815191529109908160008051602061481783398151915291099081600080516020614817833981519152910990600080516020614817833981519152828009600080516020614817833981519152908309806000805160206148178339815191529109806000805160206148178339815191529109806000805160206148178339815191529109600080516020614817833981519152908309600080516020614817833981519152910990600080516020614817833981519152828009600080516020614817833981519152908309806000805160206148178339815191529109600080516020614817833981519152910990600080516020614817833981519152828009600080516020614817833981519152908309600080516020614817833981519152910990816000805160206148178339815191529109906000805160206148178339815191528280098060008051602061481783398151915291096000805160206148178339815191529109908160008051602061481783398151915291099060008051602061481783398151915282800960008051602061481783398151915291099081600080516020614817833981519152910990816000805160206148178339815191529109906000805160206148178339815191528280096000805160206148178339815191529083096000805160206148178339815191529109908160008051602061481783398151915291099060008051602061481783398151915282800960008051602061481783398151915290830980600080516020614817833981519152910980600080516020614817833981519152910960008051602061481783398151915291099060008051602061481783398151915282800980600080516020614817833981519152910980600080516020614817833981519152910960008051602061481783398151915290830960008051602061481783398151915291099081600080516020614817833981519152910990600080516020614817833981519152828009600080516020614817833981519152818409806000805160206148178339815191529109806000805160206148178339815191529109600080516020614817833981519152910960008051602061481783398151915291099060008051602061481783398151915282800960008051602061481783398151915291099081600080516020614817833981519152910990816000805160206148178339815191529109908160008051602061481783398151915291099081600080516020614817833981519152910990816000805160206148178339815191529109906000805160206148178339815191528280096000805160206148178339815191529083096000805160206148178339815191528184098060008051602061481783398151915291098060008051602061481783398151915291096000805160206148178339815191529109600080516020614817833981519152910990816000805160206148178339815191529109908160008051602061481783398151915291096000805160206148178339815191528183096000805160206148178339815191529082096000805160206148178339815191528284096000805160206148178339815191529083099060008051602061481783398151915291096000805160206148178339815191528284096000805160206148178339815191529083099060008051602061481783398151915291096000805160206148178339815191528284099060008051602061481783398151915291096000805160206148178339815191528284096000805160206148178339815191529083099060008051602061481783398151915291098060008051602061481783398151915291098060008051602061481783398151915291098060008051602061481783398151915291098060008051602061481783398151915291098060008051602061481783398151915291098060008051602061481783398151915291098060008051602061481783398151915291098060008051602061481783398151915291098060008051602061481783398151915291098060008051602061481783398151915291098060008051602061481783398151915291098060008051602061481783398151915291098060008051602061481783398151915291098060008051602061481783398151915291098060008051602061481783398151915291098060008051602061481783398151915291098060008051602061481783398151915291098060008051602061481783398151915291098060008051602061481783398151915291098060008051602061481783398151915291098060008051602061481783398151915291098060008051602061481783398151915291098060008051602061481783398151915291098060008051602061481783398151915291098060008051602061481783398151915291098060008051602061481783398151915291098060008051602061481783398151915291098060008051602061481783398151915291098060008051602061481783398151915291098060008051602061481783398151915291098060008051602061481783398151915291098060008051602061481783398151915291098060008051602061481783398151915291098060008051602061481783398151915291098060008051602061481783398151915291098060008051602061481783398151915291098060008051602061481783398151915291098060008051602061481783398151915291098060008051602061481783398151915291098060008051602061481783398151915291098060008051602061481783398151915291098060008051602061481783398151915291098060008051602061481783398151915291098060008051602061481783398151915291098060008051602061481783398151915291098060008051602061481783398151915291098060008051602061481783398151915291098060008051602061481783398151915291098060008051602061481783398151915291098060008051602061481783398151915291098060008051602061481783398151915291098060008051602061481783398151915291098060008051602061481783398151915291098060008051602061481783398151915291098060008051602061481783398151915291098060008051602061481783398151915291098060008051602061481783398151915291098060008051602061481783398151915291098060008051602061481783398151915291098060008051602061481783398151915291098060008051602061481783398151915291098060008051602061481783398151915291098060008051602061481783398151915291098060008051602061481783398151915291098060008051602061481783398151915291098060008051602061481783398151915291098060008051602061481783398151915291098060008051602061481783398151915291098060008051602061481783398151915291098060008051602061481783398151915291098060008051602061481783398151915291098060008051602061481783398151915291098060008051602061481783398151915291098060008051602061481783398151915291098060008051602061481783398151915291098060008051602061481783398151915291098060008051602061481783398151915291098060008051602061481783398151915291098060008051602061481783398151915291098060008051602061481783398151915291098060008051602061481783398151915291098060008051602061481783398151915291098060008051602061481783398151915291098060008051602061481783398151915291098060008051602061481783398151915291098060008051602061481783398151915291098060008051602061481783398151915291098060008051602061481783398151915291098060008051602061481783398151915291098060008051602061481783398151915291098060008051602061481783398151915291098060008051602061481783398151915291098060008051602061481783398151915291098060008051602061481783398151915291098060008051602061481783398151915291098060008051602061481783398151915291098060008051602061481783398151915291098060008051602061481783398151915291098060008051602061481783398151915291098060008051602061481783398151915291098060008051602061481783398151915291098060008051602061481783398151915291098060008051602061481783398151915291098060008051602061481783398151915291098060008051602061481783398151915291098060008051602061481783398151915291098060008051602061481783398151915291098060008051602061481783398151915291098060008051602061481783398151915291098060008051602061481783398151915291098060008051602061481783398151915291098060008051602061481783398151915291098060008051602061481783398151915291098060008051602061481783398151915291098060008051602061481783398151915291098060008051602061481783398151915291098060008051602061481783398151915291098060008051602061481783398151915291098060008051602061481783398151915291098060008051602061481783398151915291098060008051602061481783398151915291098060008051602061481783398151915291098060008051602061481783398151915291098060008051602061481783398151915291098060008051602061481783398151915291098060008051602061481783398151915291099160008051602061481783398151915282820960008051602061481783398151915290830960008051602061481783398151915283830960008051602061481783398151915290840990600080516020614817833981519152910960008051602061481783398151915283830960008051602061481783398151915290840990600080516020614817833981519152910991600080516020614817833981519152910990600080516020614817833981519152910990600080516020614817833981519152910990565b9291908051825190818103611e7f57505060005b81518110156140fc57600581901b82810160209081015191850101516001600160a01b03871661407e575b5050600101614049565b614096876104e6846000526000602052604060002090565b548181106140c557876104e660019594936140bd9303936000526000602052604060002090565b559038614074565b6040516303dee4c560e01b81526001600160a01b038916600482015260248101919091526044810182905260648101839052608490fd5b509060009293916001815114841461415d576020908101519181015160408051938452918301526001600160a01b039092169133917fc3d58168c5ae7397731d063d5bbf3d657854427343f4c083240f7aacaa2d0f6291819081015b0390a4565b6040516001600160a01b039093169233927f4a39dc06d4c0dbc64b70af90fd698a233a518aa5d07e595d983b8c0526c8f7fb92829161415891836144f9565b908051835190818103611e7f57505060005b815181101561421557600581901b82810160209081015191860101516001929185906001600160a01b0382166141e8575b505050016141ae565b61420b916104e6614203926000526000602052604060002090565b918254611b61565b90553884816141df565b508051919392916001036142b7576020818101518382015160408051928352928201526001600160a01b0386169160009133917fc3d58168c5ae7397731d063d5bbf3d657854427343f4c083240f7aacaa2d0f6291a45b6001600160a01b038416614281575b50505050565b80516001036142a8579060208061429f9593015191015191336147aa565b3880808061427b565b6142b293336145b0565b61429f565b6040516001600160a01b0385169060009033907f4a39dc06d4c0dbc64b70af90fd698a233a518aa5d07e595d983b8c0526c8f7fb90806142f88888836144f9565b0390a461426c565b949190918151845190818103611e7f57505060005b825181101561440357600581901b83810160209081015191870101516001600160a01b03929186908a851661437d575b6001948216614358575b50505001614315565b614373916104e6614203926000526000602052604060002090565b905538858161434f565b919293905061439a8a6104e6846000526000602052604060002090565b548381106143cc57918791846001969594036143c48d6104e6856000526000602052604060002090565b559450614345565b6040516303dee4c560e01b81526001600160a01b038c16600482015260248101919091526044810184905260648101839052608490fd5b5094919392909360018551146000146144ae576020858101518382015160408051928352928201526001600160a01b03838116929086169133917fc3d58168c5ae7397731d063d5bbf3d657854427343f4c083240f7aacaa2d0f6291a45b6001600160a01b038116614477575b5050505050565b845160010361449d5760208061449396015192015192336147df565b3880808080614470565b6144a9949192336146ab565b614493565b6040516001600160a01b03828116919085169033907f4a39dc06d4c0dbc64b70af90fd698a233a518aa5d07e595d983b8c0526c8f7fb90806144f1888c836144f9565b0390a4614461565b90916145106107a593604084526040840190610d2a565b916020818403910152610d2a565b9081602091031261021c57516107a581610595565b926145626107a595936145709360018060a01b031686526000602087015260a0604087015260a0860190610d2a565b908482036060860152610d2a565b916080818403910152610754565b93906107a59593614562916145709460018060a01b03809216885216602087015260a0604087015260a0860190610d2a565b9293919093843b6145c2575050505050565b6020916145e5604051948593849363bc197c8160e01b9889865260048601614533565b038160006001600160a01b0388165af16000918161467a575b5061463d578261460c6121ba565b805191908261463657604051632bfa23e760e11b81526001600160a01b0383166004820152602490fd5b9050602001fd5b6001600160e01b0319160361465757503880808080614470565b604051632bfa23e760e11b81526001600160a01b03919091166004820152602490fd5b61469d91925060203d6020116146a4575b6146958183610912565b81019061451e565b90386145fe565b503d61468b565b939290949194853b6146c0575b505050505050565b6146e3602093604051958694859463bc197c8160e01b998a87526004870161457e565b038160006001600160a01b0388165af160009181614725575b5061470a578261460c6121ba565b6001600160e01b0319160361465757503880808080806146b8565b61473f91925060203d6020116146a4576146958183610912565b90386146fc565b909260a0926107a59594600180861b0316835260006020840152604083015260608201528160808201520190610754565b91926107a595949160a094600180871b038092168552166020840152604083015260608201528160808201520190610754565b9293919093843b6147bc575050505050565b6020916145e5604051948593849363f23a6e6160e01b9889865260048601614746565b939290949194853b6147f357505050505050565b6146e3602093604051958694859463f23a6e6160e01b998a87526004870161477756fe30644e72e131a029b85045b68181585d97816a916871ca8d3c208c16d87cfd47a2646970667358221220f1425c4b750ac89eba2fa92961bdc43ca315fae6f10aa4bb6006a93e31d61c5364736f6c63430008180033000000000000000000000000c31bb90ee75706911faf6b831699026e5eb6f24a00000000000000000000000024fad705b80d84a5e5cfebd772a16dedc7b48fc20000000000000000000000000000000000000000000000000000000000000060000000000000000000000000000000000000000000000000000000000000002a68747470733a2f2f6170692e707265646963742e66756e2f76312f6d61726b65742d6f7574636f6d652f00000000000000000000000000000000000000000000

Deployed Bytecode

0x6080604052600436101561001257600080fd5b60003560e01c8062fdd58e1461020657806301b7037c1461020157806301ffc9a7146101fc5780630504c814146101f75780630dc0669b146101f25780630e89341c146101ed578063248a9ca3146101e85780632eb2c2d6146101e35780632f2ff15d146101de57806331a0edec146101d957806336568abe146101d457806339dd7530146101cf578063495f17f9146101ca5780634e1273f4146101c557806365d363d5146101c057806372ce4275146101bb57806384c4798b146101b6578063852c6ae2146101b1578063856296f7146101ac57806391d14854146101a75780639e7212ad146101a2578063a217fddf1461019d578063a22cb46514610198578063a53da0a014610193578063ad5c46481461018e578063c49298ac14610189578063d42dc0c214610184578063d547741f1461017f578063dd34de671461017a578063e985e9c5146101755763f242432a1461017057600080fd5b6118fc565b6118be565b611892565b611850565b611824565b6116ab565b611666565b611493565b6113ba565b61139e565b6111c2565b61116c565b611148565b611119565b6110de565b610e96565b610e2b565b610d6f565b610c3e565b610c0b565b610bc0565b610b7b565b610b39565b610a0c565b6108ad565b6107a8565b6106f2565b6106a1565b6105a7565b6102a2565b610221565b6001600160a01b0381160361021c57565b600080fd5b3461021c57604036600319011261021c5760206102696004356102438161020b565b6024356000526000835260406000209060018060a01b0316600052602052604060002090565b54604051908152f35b9181601f8401121561021c578235916001600160401b03831161021c576020808501948460051b01011161021c57565b3461021c57608036600319011261021c576004356102bf8161020b565b602435906044356064356001600160401b03811161021c576102e5903690600401610272565b6102fc839492946000526006602052604060002090565b5491610309831515611a21565b61031d846000526005602052604060002090565b549261032a841515611a7b565b60009360019161033c6001831b611add565b91865b88878b8d82851061048b57918b84918b82610396575b6103917f2682012a4a4f1973119f1c9b90745d1bd91fa2bab387344f044cb3586864d18d9360405193849360018060a01b031697339785611c5e565b0390a4005b856104445760405163a9059cbb60e01b8152336004820152602481018490529260208460448160006001600160a01b0387165af190811561043f57610408610391927f2682012a4a4f1973119f1c9b90745d1bd91fa2bab387344f044cb3586864d18d96600091610410575b50611bda565b935050610355565b610432915060203d602011610438575b61042a8183610912565b810190611bb9565b8a610402565b503d610420565b611bce565b6103917f2682012a4a4f1973119f1c9b90745d1bd91fa2bab387344f044cb3586864d18d936104866104768985612463565b8261047f611ba6565b91336124fc565b610408565b61049c856104bd946104b794611b0d565b359384918215158061058c575b6104b290611b1d565b61223b565b88612463565b9060009087825b868110610542575050506104fd336104e6846000526000602052604060002090565b9060018060a01b0316600052602052604060002090565b54908161050f575b505050840161033f565b906105338894939b61052d8861052861053a9686611b6e565b611b97565b90611b61565b9a336124aa565b903880610505565b8d82821b8416610556575b500188906104c4565b9361052d61057b8361057661058595986000526005602052604060002090565b610684565b90549060031b1c90565b928d61054d565b508983106104a9565b6001600160e01b031981160361021c57565b3461021c57602036600319011261021c576105fc6004356105c781610595565b63ffffffff60e01b1663d6c0879d60e01b811490811561065d575b8115610600575b5060405190151581529081906020820190565b0390f35b637965db0b60e01b81149150811561061a575b50386105e9565b636cdb3d1360e11b81149150811561064c575b811561063b575b5038610613565b6301ffc9a760e01b14905038610634565b6303a24d0760e21b8114915061062d565b63da8def7360e01b811491506105e2565b634e487b7160e01b600052603260045260246000fd5b805482101561069c5760005260206000200190600090565b61066e565b3461021c57604036600319011261021c5760243560043560005260056020526040600020805482101561021c576020916106da91610684565b90546040519160031b1c8152f35b8015150361021c57565b3461021c57602036600319011261021c577f4b8a13d19620daaabc8ebae3856b7da47275aa410c470fb90a7ac85622d092766020600435610732816106e8565b61073a612540565b151560ff196004541660ff821617600455604051908152a1005b919082519283825260005b848110610780575050826000602080949584010152601f8019910116010190565b60208183018101518483018201520161075f565b9060206107a5928181520190610754565b90565b3461021c5760208060031936011261021c57604051906000906002546001918160011c92600183169283156108a3575b60208510841461088f5784875260208701939081156108705750600114610816575b6105fc8661080a81880382610912565b60405191829182610794565b6002600090815294509192917f405787fa12a823e0f2b7631cc41b3ba8828b3321ca811111fa75cd3aa3bb5ace5b83861061085f575050509101905061080a826105fc386107fa565b805485870152948201948101610844565b60ff1916845250505090151560051b01905061080a826105fc386107fa565b634e487b7160e01b86526022600452602486fd5b93607f16936107d8565b3461021c57602036600319011261021c5760043560005260036020526020600160406000200154604051908152f35b634e487b7160e01b600052604160045260246000fd5b602081019081106001600160401b0382111761090d57604052565b6108dc565b90601f801991011681019081106001600160401b0382111761090d57604052565b6001600160401b03811161090d5760051b60200190565b9080601f8301121561021c57602090823561096481610933565b936109726040519586610912565b81855260208086019260051b82010192831161021c57602001905b82821061099b575050505090565b8135815290830190830161098d565b6001600160401b03811161090d57601f01601f191660200190565b81601f8201121561021c578035906109dc826109aa565b926109ea6040519485610912565b8284526020838301011161021c57816000926020809301838601378301015290565b3461021c5760a036600319011261021c5760048035610a2a8161020b565b602435610a368161020b565b6001600160401b039060443582811161021c57610a56903690860161094a565b9060643583811161021c57610a6e903690870161094a565b9260843590811161021c57610a8690369087016109c5565b936001600160a01b03808216903382141580610b15575b610ae857831615610ad05715610ab957610ab79550614300565b005b604051626a0d4560e21b8152600081880152602490fd5b604051632bfa23e760e11b8152600081890152602490fd5b6040805163711bec9160e11b815233818b019081526001600160a01b038616602082015290918291010390fd5b50600082815260016020908152604080832033845290915290205460ff1615610a9d565b3461021c57604036600319011261021c57610ab7602435600435610b5c8261020b565b806000526003602052610b76600160406000200154612614565b612635565b3461021c57600036600319011261021c576040517f00000000000000000000000043000000000000000000000000000000000000036001600160a01b03168152602090f35b3461021c57604036600319011261021c57602435610bdd8161020b565b336001600160a01b03821603610bf957610ab7906004356126cf565b60405163334bd91960e11b8152600490fd5b3461021c57604036600319011261021c576020610c36600435610c2d8161020b565b60243590612463565b604051908152f35b3461021c57604036600319011261021c576004356024356101008111610cec57610c6a60018211611c81565b610c75818333612761565b610c93610c8c826000526005602052604060002090565b5415611ce0565b610cb8610c9f83611d2c565b610cb3836000526005602052604060002090565b611d5e565b60405191825233917fab3760c3bd2bb38b5bcf54dc79802ed67338b4cf29f3054ded67ed24661e4177908060208101610391565b60405162461bcd60e51b8152602060048201526016602482015275746f6f206d616e79206f7574636f6d6520736c6f747360501b6044820152606490fd5b90815180825260208080930193019160005b828110610d4a575050505090565b835185529381019392810192600101610d3c565b9060206107a5928181520190610d2a565b3461021c57604036600319011261021c576004356001600160401b0380821161021c573660238301121561021c578160040135610dab81610933565b92610db96040519485610912565b8184526020916024602086019160051b8301019136831161021c57602401905b828210610e12578560243586811161021c576105fc91610e00610e0692369060040161094a565b90611e04565b60405191829182610d5e565b8380918335610e208161020b565b815201910190610dd9565b3461021c57600036600319011261021c57602060ff600454166040519015158152f35b9060a060031983011261021c57600435610e678161020b565b916024359160443591606435906001600160401b03821161021c57610e8e91600401610272565b909160843590565b3461021c57610ea436610e4e565b91610eb460049694965460ff1690565b6110d1575b600192610ec860018411611ea1565b610ef36001610ee1896000526005602052604060002090565b54610eed811515611a7b565b1b611add565b90868883610f0087611d2c565b94610f0a88611d2c565b9860005b89898183106110645750505050811560001461102057505050610fde576040516323b872dd60e01b8152336004820152306024820152604481018290529160208360648160006001600160a01b038c165af190811561043f577f2e6bb91f8cbcda0c93623c54d0403a43514fabc40084ec96b6d5379a7478629896610fa2610fb19361039196600091610fbf575b50611f31565b610faa611ba6565b91336127ad565b604051938493339785611f89565b610fd8915060203d6020116104385761042a8183610912565b38610f9c565b610fb1610391927f2e6bb91f8cbcda0c93623c54d0403a43514fabc40084ec96b6d5379a747862989661101b846110158c8c612463565b336124aa565b610fa2565b8461101561105e610fb19661039199967f2e6bb91f8cbcda0c93623c54d0403a43514fabc40084ec96b6d5379a747862989d9661101b96189161223b565b8c612463565b9483959661107c8461105e946110a59697989a611b0d565b358092811515806110c8575b61109190611b1d565b61109e8282811614611eec565b189861223b565b6110af8289611df0565b52856110bb828c611df0565b5201918a93918c93610f0e565b50898210611088565b6110d9612598565b610eb9565b3461021c57600036600319011261021c5760206040517fa4824335b213805ba654706c40821730e55db9c8454c9bad67628ce870600cf28152f35b3461021c57606036600319011261021c576020610c3660043561113b8161020b565b6044359060243590612761565b3461021c57606036600319011261021c576020610c3660443560243560043561223b565b3461021c57604036600319011261021c57602060ff6111b66024356111908161020b565b6004356000526003845260406000209060018060a01b0316600052602052604060002090565b54166040519015158152f35b3461021c576111d036610e4e565b9160019593956111e260018411611ea1565b6111fb6001610ee1896000526005602052604060002090565b90819061120785611d2c565b8861121187611d2c565b9260005b8c8989818410611337575050505050509061123091336127c8565b816112ff575050846112c85760405163a9059cbb60e01b8152336004820152602481018490529260208460448160006001600160a01b038a165af190811561043f57610fb1610391927f6f13ca62553fcc2bcd2372180a43949c1e4cebba603901ede2f4e14f36b282ca966000916112a9575b50611faf565b6112c2915060203d6020116104385761042a8183610912565b386112a3565b6103917f6f13ca62553fcc2bcd2372180a43949c1e4cebba603901ede2f4e14f36b282ca936112fa6104768888612463565b610fb1565b936112fa6104766104b7610391947f6f13ca62553fcc2bcd2372180a43949c1e4cebba603901ede2f4e14f36b282ca98188b8b61223b565b986113759261134c8561105e9488999d611b0d565b35809281151580611395575b61136190611b1d565b61136e8282811614611eec565b189a61223b565b61137f8286611df0565b528961138b8287611df0565b5201908a91611215565b508b8210611358565b3461021c57600036600319011261021c57602060405160008152f35b3461021c57604036600319011261021c576004356113d78161020b565b6024356113e3816106e8565b6001600160a01b038216918215611456573360009081526001602090815260408083206001600160a01b039094168352929052209015159060ff1981541660ff83161790556040519081527f17307eab39ab6107e8899845ad3d59bd9653f200f220920489ca2b5937696c3160203392a3005b60405162ced3e160e81b815260006004820152602490fd5b604090600319011261021c576004356114868161020b565b906024356107a58161020b565b3461021c576114a13661146e565b906114aa612540565b60405163e12f3a6160e01b808252306004830152602093909290916001600160a01b0391907f000000000000000000000000430000000000000000000000000000000000000483168682602481845afa90811561043f578792600092611647575b50816115e5575b505060405194855250503060048401527f000000000000000000000000430000000000000000000000000000000000000316918381602481865afa90811561043f576000916115c8575b508061156457005b604051635569f64b60e11b81526001600160a01b039290921660048301526024820152908290829060449082906000905af1801561043f576115a257005b81610ab792903d106115c1575b6115b98183610912565b8101906127eb565b503d6115af565b6115df9150843d86116115c1576115b98183610912565b3861155c565b604051635569f64b60e11b81526001600160a01b039490941660048501526024840191909152829060449082906000905af1801561043f5761162a575b848180611512565b61164090853d87116115c1576115b98183610912565b5038611622565b61165f919250833d85116115c1576115b98183610912565b903861150b565b3461021c57600036600319011261021c576040517f00000000000000000000000043000000000000000000000000000000000000046001600160a01b03168152602090f35b3461021c57604036600319011261021c576004356024356001600160401b03811161021c576116de903690600401610272565b906001906116ee60018411611c81565b6116f9838533612761565b9161171984611712856000526005602052604060002090565b5414611ffa565b611737611730846000526006602052604060002090565b5415612046565b60009160005b8581106117ad575050506117528115156120de565b611766826000526006602052604060002090565b557fb44d84d3289691f71497564b85d4233648d9dbae8cbdbb4329f301c3a018589461039161179f836000526005602052604060002090565b604051918291339683612121565b8061181e6117c86117c086948a87611b0d565b358097611b61565b956117ed6117e761057b856105768c6000526005602052604060002090565b15612092565b611805836105768a6000526005602052604060002090565b90919082549060031b91821b91600019901b1916179055565b0161173d565b3461021c57602036600319011261021c5760043560005260056020526020604060002054604051908152f35b3461021c57604036600319011261021c57610ab76024356004356118738261020b565b80600052600360205261188d600160406000200154612614565b6126cf565b3461021c57602036600319011261021c5760043560005260066020526020604060002054604051908152f35b3461021c57602060ff6111b66118d33661146e565b6001600160a01b0391821660009081526001865260408082209290931681526020919091522090565b3461021c5760a036600319011261021c576004356119198161020b565b6024356119258161020b565b6084356001600160401b03811161021c576119449036906004016109c5565b906001600160a01b038381169033821415806119fd575b6119d6578216156119bd57156119a557610ab79261199d6064356044359160405192600184526020840152604083019160018352606084015260808301604052565b929091614300565b604051626a0d4560e21b815260006004820152602490fd5b604051632bfa23e760e11b815260006004820152602490fd5b60405163711bec9160e11b81523360048201526001600160a01b0386166024820152604490fd5b50600082815260016020908152604080832033845290915290205460ff161561195b565b15611a2857565b60405162461bcd60e51b815260206004820152602560248201527f726573756c7420666f7220636f6e646974696f6e206e6f74207265636569766560448201526419081e595d60da1b6064820152608490fd5b15611a8257565b60405162461bcd60e51b815260206004820152601a60248201527f636f6e646974696f6e206e6f74207072657061726564207965740000000000006044820152606490fd5b634e487b7160e01b600052601160045260246000fd5b600019810191908211611aec57565b611ac7565b90600080516020614817833981519152918203918211611aec57565b919081101561069c5760051b0190565b15611b2457565b60405162461bcd60e51b815260206004820152601560248201527419dbdd081a5b9d985b1a59081a5b99195e081cd95d605a1b6044820152606490fd5b91908201809211611aec57565b81810292918115918404141715611aec57565b634e487b7160e01b600052601260045260246000fd5b8115611ba1570490565b611b81565b60405190611bb3826108f2565b60008252565b9081602091031261021c57516107a5816106e8565b6040513d6000823e3d90fd5b15611be157565b60405162461bcd60e51b815260206004820152602b60248201527f636f756c64206e6f74207472616e73666572207061796f757420746f206d657360448201526a39b0b3b29039b2b73232b960a91b6064820152608490fd5b81835290916001600160fb1b03831161021c5760209260051b809284830137010190565b94939291604092611c7c928752606060208801526060870191611c3a565b930152565b15611c8857565b60405162461bcd60e51b815260206004820152602a60248201527f74686572652073686f756c64206265206d6f7265207468616e206f6e65206f756044820152691d18dbdb59481cdb1bdd60b21b6064820152608490fd5b15611ce757565b60405162461bcd60e51b815260206004820152601a60248201527f636f6e646974696f6e20616c72656164792070726570617265640000000000006044820152606490fd5b90611d3682610933565b611d436040519182610912565b8281528092611d54601f1991610933565b0190602036910137565b8151916001600160401b03831161090d5768010000000000000000831161090d578154838355808410611dc5575b50611da1602080920192600052602060002090565b9060005b848110611db3575050505050565b83518382015592810192600101611da5565b60008360005284602060002092830192015b828110611de5575050611d8c565b818155600101611dd7565b805182101561069c5760209160051b010190565b91909180518351808203611e7f575050611e1e8151611d2c565b9060009060005b8151811015611e775780611e6560019260051b85602080808489010151938c010151825252604086209060018060a01b0316600052602052604060002090565b54611e708287611df0565b5201611e25565b509193505050565b604051635b05999160e01b815260048101919091526024810191909152604490fd5b15611ea857565b606460405162461bcd60e51b815260206004820152602060248201527f676f7420656d707479206f722073696e676c65746f6e20706172746974696f6e6044820152fd5b15611ef357565b60405162461bcd60e51b81526020600482015260166024820152751c185c9d1a5d1a5bdb881b9bdd08191a5cda9bda5b9d60521b6044820152606490fd5b15611f3857565b60405162461bcd60e51b815260206004820152602360248201527f636f756c64206e6f74207265636569766520636f6c6c61746572616c20746f6b604482015262656e7360e81b6064820152608490fd5b94939291604092611c7c9260018060a01b03168752606060208801526060870191611c3a565b15611fb657565b606460405162461bcd60e51b815260206004820152602060248201527f636f756c64206e6f742073656e6420636f6c6c61746572616c20746f6b656e736044820152fd5b1561200157565b60405162461bcd60e51b815260206004820152601f60248201527f636f6e646974696f6e206e6f74207072657061726564206f7220666f756e64006044820152606490fd5b1561204d57565b60405162461bcd60e51b815260206004820152601e60248201527f7061796f75742064656e6f6d696e61746f7220616c72656164792073657400006044820152606490fd5b1561209957565b60405162461bcd60e51b815260206004820152601c60248201527f7061796f7574206e756d657261746f7220616c726561647920736574000000006044820152606490fd5b156120e557565b60405162461bcd60e51b81526020600482015260146024820152737061796f757420697320616c6c207a65726f657360601b6044820152606490fd5b9060408201908252606060209260406020820152845480935201926000526020600020916000905b828210612157575050505090565b835485529384019360019384019390910190612149565b1561217557565b60405162461bcd60e51b815260206004820152601c60248201527f696e76616c696420706172656e7420636f6c6c656374696f6e204944000000006044820152606490fd5b3d156121e5573d906121cb826109aa565b916121d96040519384610912565b82523d6000602084013e565b606090565b156121f157565b60405162461bcd60e51b815260206004820152600c60248201526b1958d859190819985a5b195960a21b6044820152606490fd5b919082604091031261021c576020825192015190565b6040805160208101938452808201949094528352601f19939092909190612263606082610912565b5190209260ff84901c1592600091841583808060015b156122c1575b505050600093611ba15760019660008051602061481783398151915297889108958497600381808a80098a0908886122b6826127fa565b969996929899612279565b611ba157600080516020614817833981519152828009146122e357808561227f565b94969581612457575b811561243d575b5061242d575b81612318575b50505060018091161461230f5790565b600160fe1b1890565b6001600160fe1b0382169460fe9290921c15801594919391929091611ba1576001956123c66123ec956000956123ba8a9988976000805160206148178339815191529182600381808b80098b090890612370826127fa565b9281612422575b8115612409575b506123f6575b81928261239293091461216e565b6040519586936020850198899094939260609260808301968352602083015260408201520152565b03908101835282610912565b519060065afa6123dd6123d76121ba565b916121ea565b60208082518301019101612225565b92909291386122ff565b61240261239292611af1565b9150612384565b905080612417575b3861237e565b508c80831614612411565b838f16159150612377565b9261243790611af1565b926122f9565b90508061244b575b386122f3565b50600180851614612445565b600186161591506122ec565b906040519060208201926bffffffffffffffffffffffff199060601b168352603482015260348152606081018181106001600160401b0382111761090d5760405251902090565b906001600160a01b038216156119a5576124fa926124e560405192600184526020840152604083019160018352606084015260808301604052565b9160006040516124f4816108f2565b52614035565b565b919291906001600160a01b038216156119bd576124fa9361253a60405192600184526020840152604083019160018352606084015260808301604052565b9161419c565b3360009081527f3617319a054d772f909f7c479a2cebe5066e836a939412e32403c99029b92eff602052604090205460ff161561257957565b60405163e2517d3f60e01b815233600482015260006024820152604490fd5b3360009081527fda46efd754845a1d253c8da23948be7f3b2e2da4129e0cac568740bef09f3dfe602052604090207fa4824335b213805ba654706c40821730e55db9c8454c9bad67628ce870600cf29060ff905b5416156125f65750565b6044906040519063e2517d3f60e01b82523360048301526024820152fd5b6000818152600360209081526040808320338452909152902060ff906125ec565b600090808252600360205260ff61266184604085209060018060a01b0316600052602052604060002090565b54166126c9578082526003602090815260408084206001600160a01b038616600090815292529020805460ff1916600117905533926001600160a01b0316917f2f8788117e7eff1d82e926ec794901d17c78024a50270940304540a733656f0d9080a4600190565b50905090565b600090808252600360205260ff6126fb84604085209060018060a01b0316600052602052604060002090565b5416156126c9578082526003602090815260408084206001600160a01b038616600090815292529020805460ff1916905533926001600160a01b0316917ff6391f5c32d9c69d2a47ea670b442974b53935d1edc7fd64eb21e047a839171b9080a4600190565b916040519160208301936bffffffffffffffffffffffff199060601b1684526034830152605482015260548152608081018181106001600160401b0382111761090d5760405251902090565b9291906001600160a01b038416156119bd576124fa9361419c565b91906001600160a01b038316156119a5576124fa9260006040516124f4816108f2565b9081602091031261021c575190565b600080516020614817833981519152818009600080516020614817833981519152818009806000805160206148178339815191529109600080516020614817833981519152910990816000805160206148178339815191529109908160008051602061481783398151915291099060008051602061481783398151915282800960008051602061481783398151915281800960008051602061481783398151915290820980600080516020614817833981519152910980600080516020614817833981519152910960008051602061481783398151915291096000805160206148178339815191529109906000805160206148178339815191528280098060008051602061481783398151915291096000805160206148178339815191529109906000805160206148178339815191528280098060008051602061481783398151915291098060008051602061481783398151915291096000805160206148178339815191529083096000805160206148178339815191529109906000805160206148178339815191528280098060008051602061481783398151915291098060008051602061481783398151915291096000805160206148178339815191529083096000805160206148178339815191529109908160008051602061481783398151915291099060008051602061481783398151915282800980600080516020614817833981519152910960008051602061481783398151915291099060008051602061481783398151915282800960008051602061481783398151915281800980600080516020614817833981519152910980600080516020614817833981519152910960008051602061481783398151915291096000805160206148178339815191529109908160008051602061481783398151915291099060008051602061481783398151915282800980600080516020614817833981519152910980600080516020614817833981519152910960008051602061481783398151915291099060008051602061481783398151915282800980600080516020614817833981519152910960008051602061481783398151915290830980600080516020614817833981519152910980600080516020614817833981519152910960008051602061481783398151915290830960008051602061481783398151915291099060008051602061481783398151915282800960008051602061481783398151915281800980600080516020614817833981519152910960008051602061481783398151915290820960008051602061481783398151915290840980600080516020614817833981519152910980600080516020614817833981519152910980600080516020614817833981519152910980600080516020614817833981519152910960008051602061481783398151915291096000805160206148178339815191529109906000805160206148178339815191528280096000805160206148178339815191529083096000805160206148178339815191529109906000805160206148178339815191528280096000805160206148178339815191529083098060008051602061481783398151915291096000805160206148178339815191528180096000805160206148178339815191529082096000805160206148178339815191528180098060008051602061481783398151915291098060008051602061481783398151915291098060008051602061481783398151915291098060008051602061481783398151915291096000805160206148178339815191529109600080516020614817833981519152910960008051602061481783398151915291099081600080516020614817833981519152910990600080516020614817833981519152828009600080516020614817833981519152910990816000805160206148178339815191529109908160008051602061481783398151915291099081600080516020614817833981519152910990816000805160206148178339815191529109906000805160206148178339815191528280096000805160206148178339815191529083098060008051602061481783398151915291096000805160206148178339815191529109906000805160206148178339815191528280098060008051602061481783398151915291096000805160206148178339815191529109908160008051602061481783398151915291099060008051602061481783398151915282800960008051602061481783398151915290830960008051602061481783398151915291099081600080516020614817833981519152910990816000805160206148178339815191529109600080516020614817833981519152818309600080516020614817833981519152828409906000805160206148178339815191529109806000805160206148178339815191529109600080516020614817833981519152828409906000805160206148178339815191529109600080516020614817833981519152908209916000805160206148178339815191528380096000805160206148178339815191529084099160008051602061481783398151915291099060008051602061481783398151915291099081600080516020614817833981519152910990816000805160206148178339815191529109908160008051602061481783398151915291099081600080516020614817833981519152910990600080516020614817833981519152828009600080516020614817833981519152908309806000805160206148178339815191529109600080516020614817833981519152910990816000805160206148178339815191529109906000805160206148178339815191528280096000805160206148178339815191529083098060008051602061481783398151915291096000805160206148178339815191529109906000805160206148178339815191528280096000805160206148178339815191528180098060008051602061481783398151915291096000805160206148178339815191529082096000805160206148178339815191529084098060008051602061481783398151915291098060008051602061481783398151915291098060008051602061481783398151915291098060008051602061481783398151915291096000805160206148178339815191529109600080516020614817833981519152910990816000805160206148178339815191529109908160008051602061481783398151915291099081600080516020614817833981519152910990600080516020614817833981519152828009600080516020614817833981519152908309806000805160206148178339815191529109806000805160206148178339815191529109806000805160206148178339815191529109600080516020614817833981519152908309600080516020614817833981519152910990600080516020614817833981519152828009600080516020614817833981519152908309806000805160206148178339815191529109600080516020614817833981519152910990600080516020614817833981519152828009600080516020614817833981519152908309600080516020614817833981519152910990816000805160206148178339815191529109906000805160206148178339815191528280098060008051602061481783398151915291096000805160206148178339815191529109908160008051602061481783398151915291099060008051602061481783398151915282800960008051602061481783398151915291099081600080516020614817833981519152910990816000805160206148178339815191529109906000805160206148178339815191528280096000805160206148178339815191529083096000805160206148178339815191529109908160008051602061481783398151915291099060008051602061481783398151915282800960008051602061481783398151915290830980600080516020614817833981519152910980600080516020614817833981519152910960008051602061481783398151915291099060008051602061481783398151915282800980600080516020614817833981519152910980600080516020614817833981519152910960008051602061481783398151915290830960008051602061481783398151915291099081600080516020614817833981519152910990600080516020614817833981519152828009600080516020614817833981519152818409806000805160206148178339815191529109806000805160206148178339815191529109600080516020614817833981519152910960008051602061481783398151915291099060008051602061481783398151915282800960008051602061481783398151915291099081600080516020614817833981519152910990816000805160206148178339815191529109908160008051602061481783398151915291099081600080516020614817833981519152910990816000805160206148178339815191529109906000805160206148178339815191528280096000805160206148178339815191529083096000805160206148178339815191528184098060008051602061481783398151915291098060008051602061481783398151915291096000805160206148178339815191529109600080516020614817833981519152910990816000805160206148178339815191529109908160008051602061481783398151915291096000805160206148178339815191528183096000805160206148178339815191529082096000805160206148178339815191528284096000805160206148178339815191529083099060008051602061481783398151915291096000805160206148178339815191528284096000805160206148178339815191529083099060008051602061481783398151915291096000805160206148178339815191528284099060008051602061481783398151915291096000805160206148178339815191528284096000805160206148178339815191529083099060008051602061481783398151915291098060008051602061481783398151915291098060008051602061481783398151915291098060008051602061481783398151915291098060008051602061481783398151915291098060008051602061481783398151915291098060008051602061481783398151915291098060008051602061481783398151915291098060008051602061481783398151915291098060008051602061481783398151915291098060008051602061481783398151915291098060008051602061481783398151915291098060008051602061481783398151915291098060008051602061481783398151915291098060008051602061481783398151915291098060008051602061481783398151915291098060008051602061481783398151915291098060008051602061481783398151915291098060008051602061481783398151915291098060008051602061481783398151915291098060008051602061481783398151915291098060008051602061481783398151915291098060008051602061481783398151915291098060008051602061481783398151915291098060008051602061481783398151915291098060008051602061481783398151915291098060008051602061481783398151915291098060008051602061481783398151915291098060008051602061481783398151915291098060008051602061481783398151915291098060008051602061481783398151915291098060008051602061481783398151915291098060008051602061481783398151915291098060008051602061481783398151915291098060008051602061481783398151915291098060008051602061481783398151915291098060008051602061481783398151915291098060008051602061481783398151915291098060008051602061481783398151915291098060008051602061481783398151915291098060008051602061481783398151915291098060008051602061481783398151915291098060008051602061481783398151915291098060008051602061481783398151915291098060008051602061481783398151915291098060008051602061481783398151915291098060008051602061481783398151915291098060008051602061481783398151915291098060008051602061481783398151915291098060008051602061481783398151915291098060008051602061481783398151915291098060008051602061481783398151915291098060008051602061481783398151915291098060008051602061481783398151915291098060008051602061481783398151915291098060008051602061481783398151915291098060008051602061481783398151915291098060008051602061481783398151915291098060008051602061481783398151915291098060008051602061481783398151915291098060008051602061481783398151915291098060008051602061481783398151915291098060008051602061481783398151915291098060008051602061481783398151915291098060008051602061481783398151915291098060008051602061481783398151915291098060008051602061481783398151915291098060008051602061481783398151915291098060008051602061481783398151915291098060008051602061481783398151915291098060008051602061481783398151915291098060008051602061481783398151915291098060008051602061481783398151915291098060008051602061481783398151915291098060008051602061481783398151915291098060008051602061481783398151915291098060008051602061481783398151915291098060008051602061481783398151915291098060008051602061481783398151915291098060008051602061481783398151915291098060008051602061481783398151915291098060008051602061481783398151915291098060008051602061481783398151915291098060008051602061481783398151915291098060008051602061481783398151915291098060008051602061481783398151915291098060008051602061481783398151915291098060008051602061481783398151915291098060008051602061481783398151915291098060008051602061481783398151915291098060008051602061481783398151915291098060008051602061481783398151915291098060008051602061481783398151915291098060008051602061481783398151915291098060008051602061481783398151915291098060008051602061481783398151915291098060008051602061481783398151915291098060008051602061481783398151915291098060008051602061481783398151915291098060008051602061481783398151915291098060008051602061481783398151915291098060008051602061481783398151915291098060008051602061481783398151915291098060008051602061481783398151915291098060008051602061481783398151915291098060008051602061481783398151915291098060008051602061481783398151915291098060008051602061481783398151915291098060008051602061481783398151915291098060008051602061481783398151915291098060008051602061481783398151915291098060008051602061481783398151915291098060008051602061481783398151915291098060008051602061481783398151915291098060008051602061481783398151915291098060008051602061481783398151915291098060008051602061481783398151915291098060008051602061481783398151915291098060008051602061481783398151915291098060008051602061481783398151915291098060008051602061481783398151915291098060008051602061481783398151915291098060008051602061481783398151915291098060008051602061481783398151915291098060008051602061481783398151915291098060008051602061481783398151915291098060008051602061481783398151915291099160008051602061481783398151915282820960008051602061481783398151915290830960008051602061481783398151915283830960008051602061481783398151915290840990600080516020614817833981519152910960008051602061481783398151915283830960008051602061481783398151915290840990600080516020614817833981519152910991600080516020614817833981519152910990600080516020614817833981519152910990600080516020614817833981519152910990565b9291908051825190818103611e7f57505060005b81518110156140fc57600581901b82810160209081015191850101516001600160a01b03871661407e575b5050600101614049565b614096876104e6846000526000602052604060002090565b548181106140c557876104e660019594936140bd9303936000526000602052604060002090565b559038614074565b6040516303dee4c560e01b81526001600160a01b038916600482015260248101919091526044810182905260648101839052608490fd5b509060009293916001815114841461415d576020908101519181015160408051938452918301526001600160a01b039092169133917fc3d58168c5ae7397731d063d5bbf3d657854427343f4c083240f7aacaa2d0f6291819081015b0390a4565b6040516001600160a01b039093169233927f4a39dc06d4c0dbc64b70af90fd698a233a518aa5d07e595d983b8c0526c8f7fb92829161415891836144f9565b908051835190818103611e7f57505060005b815181101561421557600581901b82810160209081015191860101516001929185906001600160a01b0382166141e8575b505050016141ae565b61420b916104e6614203926000526000602052604060002090565b918254611b61565b90553884816141df565b508051919392916001036142b7576020818101518382015160408051928352928201526001600160a01b0386169160009133917fc3d58168c5ae7397731d063d5bbf3d657854427343f4c083240f7aacaa2d0f6291a45b6001600160a01b038416614281575b50505050565b80516001036142a8579060208061429f9593015191015191336147aa565b3880808061427b565b6142b293336145b0565b61429f565b6040516001600160a01b0385169060009033907f4a39dc06d4c0dbc64b70af90fd698a233a518aa5d07e595d983b8c0526c8f7fb90806142f88888836144f9565b0390a461426c565b949190918151845190818103611e7f57505060005b825181101561440357600581901b83810160209081015191870101516001600160a01b03929186908a851661437d575b6001948216614358575b50505001614315565b614373916104e6614203926000526000602052604060002090565b905538858161434f565b919293905061439a8a6104e6846000526000602052604060002090565b548381106143cc57918791846001969594036143c48d6104e6856000526000602052604060002090565b559450614345565b6040516303dee4c560e01b81526001600160a01b038c16600482015260248101919091526044810184905260648101839052608490fd5b5094919392909360018551146000146144ae576020858101518382015160408051928352928201526001600160a01b03838116929086169133917fc3d58168c5ae7397731d063d5bbf3d657854427343f4c083240f7aacaa2d0f6291a45b6001600160a01b038116614477575b5050505050565b845160010361449d5760208061449396015192015192336147df565b3880808080614470565b6144a9949192336146ab565b614493565b6040516001600160a01b03828116919085169033907f4a39dc06d4c0dbc64b70af90fd698a233a518aa5d07e595d983b8c0526c8f7fb90806144f1888c836144f9565b0390a4614461565b90916145106107a593604084526040840190610d2a565b916020818403910152610d2a565b9081602091031261021c57516107a581610595565b926145626107a595936145709360018060a01b031686526000602087015260a0604087015260a0860190610d2a565b908482036060860152610d2a565b916080818403910152610754565b93906107a59593614562916145709460018060a01b03809216885216602087015260a0604087015260a0860190610d2a565b9293919093843b6145c2575050505050565b6020916145e5604051948593849363bc197c8160e01b9889865260048601614533565b038160006001600160a01b0388165af16000918161467a575b5061463d578261460c6121ba565b805191908261463657604051632bfa23e760e11b81526001600160a01b0383166004820152602490fd5b9050602001fd5b6001600160e01b0319160361465757503880808080614470565b604051632bfa23e760e11b81526001600160a01b03919091166004820152602490fd5b61469d91925060203d6020116146a4575b6146958183610912565b81019061451e565b90386145fe565b503d61468b565b939290949194853b6146c0575b505050505050565b6146e3602093604051958694859463bc197c8160e01b998a87526004870161457e565b038160006001600160a01b0388165af160009181614725575b5061470a578261460c6121ba565b6001600160e01b0319160361465757503880808080806146b8565b61473f91925060203d6020116146a4576146958183610912565b90386146fc565b909260a0926107a59594600180861b0316835260006020840152604083015260608201528160808201520190610754565b91926107a595949160a094600180871b038092168552166020840152604083015260608201528160808201520190610754565b9293919093843b6147bc575050505050565b6020916145e5604051948593849363f23a6e6160e01b9889865260048601614746565b939290949194853b6147f357505050505050565b6146e3602093604051958694859463f23a6e6160e01b998a87526004870161477756fe30644e72e131a029b85045b68181585d97816a916871ca8d3c208c16d87cfd47a2646970667358221220f1425c4b750ac89eba2fa92961bdc43ca315fae6f10aa4bb6006a93e31d61c5364736f6c63430008180033

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

000000000000000000000000c31bb90ee75706911faf6b831699026e5eb6f24a00000000000000000000000024fad705b80d84a5e5cfebd772a16dedc7b48fc20000000000000000000000000000000000000000000000000000000000000060000000000000000000000000000000000000000000000000000000000000002a68747470733a2f2f6170692e707265646963742e66756e2f76312f6d61726b65742d6f7574636f6d652f00000000000000000000000000000000000000000000

-----Decoded View---------------
Arg [0] : addressFinder_ (address): 0xc31BB90Ee75706911faf6b831699026e5eB6f24a
Arg [1] : owner_ (address): 0x24fAd705B80D84A5E5cFEbd772A16DeDc7b48FC2
Arg [2] : uri_ (string): https://api.predict.fun/v1/market-outcome/

-----Encoded View---------------
6 Constructor Arguments found :
Arg [0] : 000000000000000000000000c31bb90ee75706911faf6b831699026e5eb6f24a
Arg [1] : 00000000000000000000000024fad705b80d84a5e5cfebd772a16dedc7b48fc2
Arg [2] : 0000000000000000000000000000000000000000000000000000000000000060
Arg [3] : 000000000000000000000000000000000000000000000000000000000000002a
Arg [4] : 68747470733a2f2f6170692e707265646963742e66756e2f76312f6d61726b65
Arg [5] : 742d6f7574636f6d652f00000000000000000000000000000000000000000000


Block Transaction Difficulty Gas Used Reward
View All Blocks Produced

Block Uncle Number Difficulty Gas Used Reward
View All Uncles
Loading...
Loading
Loading...
Loading
Loading...
Loading

Validator Index Block Amount
View All Withdrawals

Transaction Hash Block Value Eth2 PubKey Valid
View All Deposits
Loading...
Loading
[ Download: CSV Export  ]

A contract address hosts a smart contract, which is a set of code stored on the blockchain that runs when predetermined conditions are met. Learn more about addresses in our Knowledge Base.