Contract 0x2F33676a7028662F60b5E316bfE2BcF03bdE74A9 8

Txn Hash Method
Block
From
To
Value [Txn Fee]
0x99e0bb921f2302ea200c10c897fa080f99cbd21f8cfb1b931aff1ca4c0feb2200x60806040182124312022-08-04 17:14:1013 days 13 hrs ago0xb68d649f181bde8a8fee367535a606cc3c09fccd IN  Create: ERC721ShareInstantStream0 AVAX0.‍066738825
[ Download CSV Export 
Parent Txn Hash Block From To Value
Loading

Contract Source Code Verified (Exact Match)

Contract Name:
ERC721ShareInstantStream

Compiler Version
v0.8.9+commit.e5eed63a

Optimization Enabled:
Yes with 6 runs

Other Settings:
default evmVersion, GNU AGPLv3 license

Contract Source Code (Solidity Standard Json-Input format)

File 1 of 17 : Ownable.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (access/Ownable.sol)

pragma solidity ^0.8.0;

import "../utils/Context.sol";

/**
 * @dev Contract module which provides a basic access control mechanism, where
 * there is an account (an owner) that can be granted exclusive access to
 * specific functions.
 *
 * By default, the owner account will be the one that deploys the contract. This
 * can later be changed with {transferOwnership}.
 *
 * This module is used through inheritance. It will make available the modifier
 * `onlyOwner`, which can be applied to your functions to restrict their use to
 * the owner.
 */
abstract contract Ownable is Context {
    address private _owner;

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

    /**
     * @dev Initializes the contract setting the deployer as the initial owner.
     */
    constructor() {
        _transferOwnership(_msgSender());
    }

    /**
     * @dev Returns the address of the current owner.
     */
    function owner() public view virtual returns (address) {
        return _owner;
    }

    /**
     * @dev Throws if called by any account other than the owner.
     */
    modifier onlyOwner() {
        require(owner() == _msgSender(), "Ownable: caller is not the owner");
        _;
    }

    /**
     * @dev Leaves the contract without owner. It will not be possible to call
     * `onlyOwner` functions anymore. Can only be called by the current owner.
     *
     * NOTE: Renouncing ownership will leave the contract without an owner,
     * thereby removing any functionality that is only available to the owner.
     */
    function renounceOwnership() public virtual onlyOwner {
        _transferOwnership(address(0));
    }

    /**
     * @dev Transfers ownership of the contract to a new account (`newOwner`).
     * Can only be called by the current owner.
     */
    function transferOwnership(address newOwner) public virtual onlyOwner {
        require(newOwner != address(0), "Ownable: new owner is the zero address");
        _transferOwnership(newOwner);
    }

    /**
     * @dev Transfers ownership of the contract to a new account (`newOwner`).
     * Internal function without access restriction.
     */
    function _transferOwnership(address newOwner) internal virtual {
        address oldOwner = _owner;
        _owner = newOwner;
        emit OwnershipTransferred(oldOwner, newOwner);
    }
}

File 2 of 17 : Initializable.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.6.0) (proxy/utils/Initializable.sol)

pragma solidity ^0.8.2;

import "../../utils/Address.sol";

/**
 * @dev This is a base contract to aid in writing upgradeable contracts, or any kind of contract that will be deployed
 * behind a proxy. Since proxied contracts do not make use of a constructor, it's common to move constructor logic to an
 * external initializer function, usually called `initialize`. It then becomes necessary to protect this initializer
 * function so it can only be called once. The {initializer} modifier provided by this contract will have this effect.
 *
 * The initialization functions use a version number. Once a version number is used, it is consumed and cannot be
 * reused. This mechanism prevents re-execution of each "step" but allows the creation of new initialization steps in
 * case an upgrade adds a module that needs to be initialized.
 *
 * For example:
 *
 * [.hljs-theme-light.nopadding]
 * ```
 * contract MyToken is ERC20Upgradeable {
 *     function initialize() initializer public {
 *         __ERC20_init("MyToken", "MTK");
 *     }
 * }
 * contract MyTokenV2 is MyToken, ERC20PermitUpgradeable {
 *     function initializeV2() reinitializer(2) public {
 *         __ERC20Permit_init("MyToken");
 *     }
 * }
 * ```
 *
 * TIP: To avoid leaving the proxy in an uninitialized state, the initializer function should be called as early as
 * possible by providing the encoded function call as the `_data` argument to {ERC1967Proxy-constructor}.
 *
 * CAUTION: When used with inheritance, manual care must be taken to not invoke a parent initializer twice, or to ensure
 * that all initializers are idempotent. This is not verified automatically as constructors are by Solidity.
 *
 * [CAUTION]
 * ====
 * Avoid leaving a contract uninitialized.
 *
 * An uninitialized contract can be taken over by an attacker. This applies to both a proxy and its implementation
 * contract, which may impact the proxy. To prevent the implementation contract from being used, you should invoke
 * the {_disableInitializers} function in the constructor to automatically lock it when it is deployed:
 *
 * [.hljs-theme-light.nopadding]
 * ```
 * /// @custom:oz-upgrades-unsafe-allow constructor
 * constructor() {
 *     _disableInitializers();
 * }
 * ```
 * ====
 */
abstract contract Initializable {
    /**
     * @dev Indicates that the contract has been initialized.
     * @custom:oz-retyped-from bool
     */
    uint8 private _initialized;

    /**
     * @dev Indicates that the contract is in the process of being initialized.
     */
    bool private _initializing;

    /**
     * @dev Triggered when the contract has been initialized or reinitialized.
     */
    event Initialized(uint8 version);

    /**
     * @dev A modifier that defines a protected initializer function that can be invoked at most once. In its scope,
     * `onlyInitializing` functions can be used to initialize parent contracts. Equivalent to `reinitializer(1)`.
     */
    modifier initializer() {
        bool isTopLevelCall = _setInitializedVersion(1);
        if (isTopLevelCall) {
            _initializing = true;
        }
        _;
        if (isTopLevelCall) {
            _initializing = false;
            emit Initialized(1);
        }
    }

    /**
     * @dev A modifier that defines a protected reinitializer function that can be invoked at most once, and only if the
     * contract hasn't been initialized to a greater version before. In its scope, `onlyInitializing` functions can be
     * used to initialize parent contracts.
     *
     * `initializer` is equivalent to `reinitializer(1)`, so a reinitializer may be used after the original
     * initialization step. This is essential to configure modules that are added through upgrades and that require
     * initialization.
     *
     * Note that versions can jump in increments greater than 1; this implies that if multiple reinitializers coexist in
     * a contract, executing them in the right order is up to the developer or operator.
     */
    modifier reinitializer(uint8 version) {
        bool isTopLevelCall = _setInitializedVersion(version);
        if (isTopLevelCall) {
            _initializing = true;
        }
        _;
        if (isTopLevelCall) {
            _initializing = false;
            emit Initialized(version);
        }
    }

    /**
     * @dev Modifier to protect an initialization function so that it can only be invoked by functions with the
     * {initializer} and {reinitializer} modifiers, directly or indirectly.
     */
    modifier onlyInitializing() {
        require(_initializing, "Initializable: contract is not initializing");
        _;
    }

    /**
     * @dev Locks the contract, preventing any future reinitialization. This cannot be part of an initializer call.
     * Calling this in the constructor of a contract will prevent that contract from being initialized or reinitialized
     * to any version. It is recommended to use this to lock implementation contracts that are designed to be called
     * through proxies.
     */
    function _disableInitializers() internal virtual {
        _setInitializedVersion(type(uint8).max);
    }

    function _setInitializedVersion(uint8 version) private returns (bool) {
        // If the contract is initializing we ignore whether _initialized is set in order to support multiple
        // inheritance patterns, but we only do this in the context of a constructor, and for the lowest level
        // of initializers, because in other contexts the contract may have been reentered.
        if (_initializing) {
            require(
                version == 1 && !Address.isContract(address(this)),
                "Initializable: contract is already initialized"
            );
            return false;
        } else {
            require(_initialized < version, "Initializable: contract is already initialized");
            _initialized = version;
            return true;
        }
    }
}

File 3 of 17 : ReentrancyGuard.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (security/ReentrancyGuard.sol)

pragma solidity ^0.8.0;

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

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

    uint256 private _status;

    constructor() {
        _status = _NOT_ENTERED;
    }

    /**
     * @dev Prevents a contract from calling itself, directly or indirectly.
     * Calling a `nonReentrant` function from another `nonReentrant`
     * function is not supported. It is possible to prevent this from happening
     * by making the `nonReentrant` function external, and making it call a
     * `private` function that does the actual work.
     */
    modifier nonReentrant() {
        // On the first call to nonReentrant, _notEntered will be true
        require(_status != _ENTERED, "ReentrancyGuard: reentrant call");

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

        _;

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

File 4 of 17 : IERC20.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.6.0) (token/ERC20/IERC20.sol)

pragma solidity ^0.8.0;

/**
 * @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 amount of tokens in existence.
     */
    function totalSupply() external view returns (uint256);

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

    /**
     * @dev Moves `amount` 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 amount) 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 `amount` 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 amount) external returns (bool);

    /**
     * @dev Moves `amount` tokens from `from` to `to` using the
     * allowance mechanism. `amount` 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 amount
    ) external returns (bool);
}

File 5 of 17 : IERC721.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.6.0) (token/ERC721/IERC721.sol)

pragma solidity ^0.8.0;

import "../../utils/introspection/IERC165.sol";

/**
 * @dev Required interface of an ERC721 compliant contract.
 */
interface IERC721 is IERC165 {
    /**
     * @dev Emitted when `tokenId` token is transferred from `from` to `to`.
     */
    event Transfer(address indexed from, address indexed to, uint256 indexed tokenId);

    /**
     * @dev Emitted when `owner` enables `approved` to manage the `tokenId` token.
     */
    event Approval(address indexed owner, address indexed approved, uint256 indexed tokenId);

    /**
     * @dev Emitted when `owner` enables or disables (`approved`) `operator` to manage all of its assets.
     */
    event ApprovalForAll(address indexed owner, address indexed operator, bool approved);

    /**
     * @dev Returns the number of tokens in ``owner``'s account.
     */
    function balanceOf(address owner) external view returns (uint256 balance);

    /**
     * @dev Returns the owner of the `tokenId` token.
     *
     * Requirements:
     *
     * - `tokenId` must exist.
     */
    function ownerOf(uint256 tokenId) external view returns (address owner);

    /**
     * @dev Safely transfers `tokenId` token from `from` to `to`.
     *
     * Requirements:
     *
     * - `from` cannot be the zero address.
     * - `to` cannot be the zero address.
     * - `tokenId` token must exist and be owned by `from`.
     * - If the caller is not `from`, it must be approved to move this token by either {approve} or {setApprovalForAll}.
     * - If `to` refers to a smart contract, it must implement {IERC721Receiver-onERC721Received}, which is called upon a safe transfer.
     *
     * Emits a {Transfer} event.
     */
    function safeTransferFrom(
        address from,
        address to,
        uint256 tokenId,
        bytes calldata data
    ) external;

    /**
     * @dev Safely transfers `tokenId` token from `from` to `to`, checking first that contract recipients
     * are aware of the ERC721 protocol to prevent tokens from being forever locked.
     *
     * Requirements:
     *
     * - `from` cannot be the zero address.
     * - `to` cannot be the zero address.
     * - `tokenId` token must exist and be owned by `from`.
     * - If the caller is not `from`, it must be have been allowed to move this token by either {approve} or {setApprovalForAll}.
     * - If `to` refers to a smart contract, it must implement {IERC721Receiver-onERC721Received}, which is called upon a safe transfer.
     *
     * Emits a {Transfer} event.
     */
    function safeTransferFrom(
        address from,
        address to,
        uint256 tokenId
    ) external;

    /**
     * @dev Transfers `tokenId` token from `from` to `to`.
     *
     * WARNING: Usage of this method is discouraged, use {safeTransferFrom} whenever possible.
     *
     * Requirements:
     *
     * - `from` cannot be the zero address.
     * - `to` cannot be the zero address.
     * - `tokenId` token must be owned by `from`.
     * - If the caller is not `from`, it must be approved to move this token by either {approve} or {setApprovalForAll}.
     *
     * Emits a {Transfer} event.
     */
    function transferFrom(
        address from,
        address to,
        uint256 tokenId
    ) external;

    /**
     * @dev Gives permission to `to` to transfer `tokenId` token to another account.
     * The approval is cleared when the token is transferred.
     *
     * Only a single account can be approved at a time, so approving the zero address clears previous approvals.
     *
     * Requirements:
     *
     * - The caller must own the token or be an approved operator.
     * - `tokenId` must exist.
     *
     * Emits an {Approval} event.
     */
    function approve(address to, uint256 tokenId) external;

    /**
     * @dev Approve or remove `operator` as an operator for the caller.
     * Operators can call {transferFrom} or {safeTransferFrom} for any token owned by the caller.
     *
     * Requirements:
     *
     * - The `operator` cannot be the caller.
     *
     * Emits an {ApprovalForAll} event.
     */
    function setApprovalForAll(address operator, bool _approved) external;

    /**
     * @dev Returns the account approved for `tokenId` token.
     *
     * Requirements:
     *
     * - `tokenId` must exist.
     */
    function getApproved(uint256 tokenId) external view returns (address operator);

    /**
     * @dev Returns if the `operator` is allowed to manage all of the assets of `owner`.
     *
     * See {setApprovalForAll}
     */
    function isApprovedForAll(address owner, address operator) external view returns (bool);
}

File 6 of 17 : Address.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.5.0) (utils/Address.sol)

pragma solidity ^0.8.1;

/**
 * @dev Collection of functions related to the address type
 */
library Address {
    /**
     * @dev Returns true if `account` is a contract.
     *
     * [IMPORTANT]
     * ====
     * It is unsafe to assume that an address for which this function returns
     * false is an externally-owned account (EOA) and not a contract.
     *
     * Among others, `isContract` will return false for the following
     * types of addresses:
     *
     *  - an externally-owned account
     *  - a contract in construction
     *  - an address where a contract will be created
     *  - an address where a contract lived, but was destroyed
     * ====
     *
     * [IMPORTANT]
     * ====
     * You shouldn't rely on `isContract` to protect against flash loan attacks!
     *
     * Preventing calls from contracts is highly discouraged. It breaks composability, breaks support for smart wallets
     * like Gnosis Safe, and does not provide security since it can be circumvented by calling from a contract
     * constructor.
     * ====
     */
    function isContract(address account) internal view returns (bool) {
        // This method relies on extcodesize/address.code.length, which returns 0
        // for contracts in construction, since the code is only stored at the end
        // of the constructor execution.

        return account.code.length > 0;
    }

    /**
     * @dev Replacement for Solidity's `transfer`: sends `amount` wei to
     * `recipient`, forwarding all available gas and reverting on errors.
     *
     * https://eips.ethereum.org/EIPS/eip-1884[EIP1884] increases the gas cost
     * of certain opcodes, possibly making contracts go over the 2300 gas limit
     * imposed by `transfer`, making them unable to receive funds via
     * `transfer`. {sendValue} removes this limitation.
     *
     * https://diligence.consensys.net/posts/2019/09/stop-using-soliditys-transfer-now/[Learn more].
     *
     * IMPORTANT: because control is transferred to `recipient`, care must be
     * taken to not create reentrancy vulnerabilities. Consider using
     * {ReentrancyGuard} or the
     * https://solidity.readthedocs.io/en/v0.5.11/security-considerations.html#use-the-checks-effects-interactions-pattern[checks-effects-interactions pattern].
     */
    function sendValue(address payable recipient, uint256 amount) internal {
        require(address(this).balance >= amount, "Address: insufficient balance");

        (bool success, ) = recipient.call{value: amount}("");
        require(success, "Address: unable to send value, recipient may have reverted");
    }

    /**
     * @dev Performs a Solidity function call using a low level `call`. A
     * plain `call` is an unsafe replacement for a function call: use this
     * function instead.
     *
     * If `target` reverts with a revert reason, it is bubbled up by this
     * function (like regular Solidity function calls).
     *
     * Returns the raw returned data. To convert to the expected return value,
     * use https://solidity.readthedocs.io/en/latest/units-and-global-variables.html?highlight=abi.decode#abi-encoding-and-decoding-functions[`abi.decode`].
     *
     * Requirements:
     *
     * - `target` must be a contract.
     * - calling `target` with `data` must not revert.
     *
     * _Available since v3.1._
     */
    function functionCall(address target, bytes memory data) internal returns (bytes memory) {
        return functionCall(target, data, "Address: low-level call failed");
    }

    /**
     * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], but with
     * `errorMessage` as a fallback revert reason when `target` reverts.
     *
     * _Available since v3.1._
     */
    function functionCall(
        address target,
        bytes memory data,
        string memory errorMessage
    ) internal returns (bytes memory) {
        return functionCallWithValue(target, data, 0, errorMessage);
    }

    /**
     * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],
     * but also transferring `value` wei to `target`.
     *
     * Requirements:
     *
     * - the calling contract must have an ETH balance of at least `value`.
     * - the called Solidity function must be `payable`.
     *
     * _Available since v3.1._
     */
    function functionCallWithValue(
        address target,
        bytes memory data,
        uint256 value
    ) internal returns (bytes memory) {
        return functionCallWithValue(target, data, value, "Address: low-level call with value failed");
    }

    /**
     * @dev Same as {xref-Address-functionCallWithValue-address-bytes-uint256-}[`functionCallWithValue`], but
     * with `errorMessage` as a fallback revert reason when `target` reverts.
     *
     * _Available since v3.1._
     */
    function functionCallWithValue(
        address target,
        bytes memory data,
        uint256 value,
        string memory errorMessage
    ) internal returns (bytes memory) {
        require(address(this).balance >= value, "Address: insufficient balance for call");
        require(isContract(target), "Address: call to non-contract");

        (bool success, bytes memory returndata) = target.call{value: value}(data);
        return verifyCallResult(success, returndata, errorMessage);
    }

    /**
     * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],
     * but performing a static call.
     *
     * _Available since v3.3._
     */
    function functionStaticCall(address target, bytes memory data) internal view returns (bytes memory) {
        return functionStaticCall(target, data, "Address: low-level static call failed");
    }

    /**
     * @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`],
     * but performing a static call.
     *
     * _Available since v3.3._
     */
    function functionStaticCall(
        address target,
        bytes memory data,
        string memory errorMessage
    ) internal view returns (bytes memory) {
        require(isContract(target), "Address: static call to non-contract");

        (bool success, bytes memory returndata) = target.staticcall(data);
        return verifyCallResult(success, returndata, errorMessage);
    }

    /**
     * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],
     * but performing a delegate call.
     *
     * _Available since v3.4._
     */
    function functionDelegateCall(address target, bytes memory data) internal returns (bytes memory) {
        return functionDelegateCall(target, data, "Address: low-level delegate call failed");
    }

    /**
     * @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`],
     * but performing a delegate call.
     *
     * _Available since v3.4._
     */
    function functionDelegateCall(
        address target,
        bytes memory data,
        string memory errorMessage
    ) internal returns (bytes memory) {
        require(isContract(target), "Address: delegate call to non-contract");

        (bool success, bytes memory returndata) = target.delegatecall(data);
        return verifyCallResult(success, returndata, errorMessage);
    }

    /**
     * @dev Tool to verifies that a low level call was successful, and revert if it wasn't, either by bubbling the
     * revert reason using the provided one.
     *
     * _Available since v4.3._
     */
    function verifyCallResult(
        bool success,
        bytes memory returndata,
        string memory errorMessage
    ) internal pure returns (bytes memory) {
        if (success) {
            return returndata;
        } else {
            // Look for revert reason and bubble it up if present
            if (returndata.length > 0) {
                // The easiest way to bubble the revert reason is using memory via assembly

                assembly {
                    let returndata_size := mload(returndata)
                    revert(add(32, returndata), returndata_size)
                }
            } else {
                revert(errorMessage);
            }
        }
    }
}

File 7 of 17 : Context.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (utils/Context.sol)

pragma solidity ^0.8.0;

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

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

File 8 of 17 : Counters.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (utils/Counters.sol)

pragma solidity ^0.8.0;

/**
 * @title Counters
 * @author Matt Condon (@shrugs)
 * @dev Provides counters that can only be incremented, decremented or reset. This can be used e.g. to track the number
 * of elements in a mapping, issuing ERC721 ids, or counting request ids.
 *
 * Include with `using Counters for Counters.Counter;`
 */
library Counters {
    struct Counter {
        // This variable should never be directly accessed by users of the library: interactions must be restricted to
        // the library's function. As of Solidity v0.5.2, this cannot be enforced, though there is a proposal to add
        // this feature: see https://github.com/ethereum/solidity/issues/4637
        uint256 _value; // default: 0
    }

    function current(Counter storage counter) internal view returns (uint256) {
        return counter._value;
    }

    function increment(Counter storage counter) internal {
        unchecked {
            counter._value += 1;
        }
    }

    function decrement(Counter storage counter) internal {
        uint256 value = counter._value;
        require(value > 0, "Counter: decrement overflow");
        unchecked {
            counter._value = value - 1;
        }
    }

    function reset(Counter storage counter) internal {
        counter._value = 0;
    }
}

File 9 of 17 : ERC165.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (utils/introspection/ERC165.sol)

pragma solidity ^0.8.0;

import "./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);
 * }
 * ```
 *
 * Alternatively, {ERC165Storage} provides an easier to use but more expensive implementation.
 */
abstract contract ERC165 is IERC165 {
    /**
     * @dev See {IERC165-supportsInterface}.
     */
    function supportsInterface(bytes4 interfaceId) public view virtual override returns (bool) {
        return interfaceId == type(IERC165).interfaceId;
    }
}

File 10 of 17 : ERC165Storage.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (utils/introspection/ERC165Storage.sol)

pragma solidity ^0.8.0;

import "./ERC165.sol";

/**
 * @dev Storage based implementation of the {IERC165} interface.
 *
 * Contracts may inherit from this and call {_registerInterface} to declare
 * their support of an interface.
 */
abstract contract ERC165Storage is ERC165 {
    /**
     * @dev Mapping of interface ids to whether or not it's supported.
     */
    mapping(bytes4 => bool) private _supportedInterfaces;

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

    /**
     * @dev Registers the contract as an implementer of the interface defined by
     * `interfaceId`. Support of the actual ERC165 interface is automatic and
     * registering its interface id is not required.
     *
     * See {IERC165-supportsInterface}.
     *
     * Requirements:
     *
     * - `interfaceId` cannot be the ERC165 invalid interface (`0xffffffff`).
     */
    function _registerInterface(bytes4 interfaceId) internal virtual {
        require(interfaceId != 0xffffffff, "ERC165: invalid interface id");
        _supportedInterfaces[interfaceId] = true;
    }
}

File 11 of 17 : IERC165.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (utils/introspection/IERC165.sol)

pragma solidity ^0.8.0;

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

File 12 of 17 : WithdrawExtension.sol
// SPDX-License-Identifier: AGPL-3.0

pragma solidity 0.8.9;

import "@openzeppelin/contracts/proxy/utils/Initializable.sol";
import "@openzeppelin/contracts/access/Ownable.sol";
import "@openzeppelin/contracts/utils/introspection/ERC165Storage.sol";

import "@openzeppelin/contracts/utils/Address.sol";
import "@openzeppelin/contracts/utils/Counters.sol";
import "@openzeppelin/contracts/security/ReentrancyGuard.sol";
import "@openzeppelin/contracts/token/ERC20/IERC20.sol";
import "@openzeppelin/contracts/token/ERC721/IERC721.sol";

enum WithdrawMode {
    OWNER,
    RECIPIENT,
    ANYONE,
    NOBODY
}

interface IWithdrawExtension {
    function setWithdrawRecipient(address _withdrawRecipient) external;

    function lockWithdrawRecipient() external;

    function revokeWithdrawPower() external;

    function setWithdrawMode(WithdrawMode _withdrawMode) external;

    function lockWithdrawMode() external;

    function withdraw(
        address[] calldata claimTokens,
        uint256[] calldata amounts
    ) external;
}

abstract contract WithdrawExtension is
    IWithdrawExtension,
    Initializable,
    Ownable,
    ERC165Storage
{
    using Address for address;
    using Address for address payable;

    event WithdrawPowerRevoked();
    event Withdrawn(address[] claimTokens, uint256[] amounts);

    address public withdrawRecipient;
    bool public withdrawRecipientLocked;

    bool public withdrawPowerRevoked;

    WithdrawMode public withdrawMode;
    bool public withdrawModeLocked;

    /* INTERNAL */

    function __WithdrawExtension_init(
        address _withdrawRecipient,
        WithdrawMode _withdrawMode
    ) internal onlyInitializing {
        __WithdrawExtension_init_unchained(_withdrawRecipient, _withdrawMode);
    }

    function __WithdrawExtension_init_unchained(
        address _withdrawRecipient,
        WithdrawMode _withdrawMode
    ) internal onlyInitializing {
        _registerInterface(type(IWithdrawExtension).interfaceId);

        withdrawRecipient = _withdrawRecipient;
        withdrawMode = _withdrawMode;
    }

    /* ADMIN */

    function setWithdrawRecipient(address _withdrawRecipient)
        external
        onlyOwner
    {
        require(!withdrawRecipientLocked, "LOCKED");
        withdrawRecipient = _withdrawRecipient;
    }

    function lockWithdrawRecipient() external onlyOwner {
        require(!withdrawRecipientLocked, "LOCKED");
        withdrawRecipientLocked = true;
    }

    function setWithdrawMode(WithdrawMode _withdrawMode) external onlyOwner {
        require(!withdrawModeLocked, "LOCKED");
        withdrawMode = _withdrawMode;
    }

    function lockWithdrawMode() external onlyOwner {
        require(!withdrawModeLocked, "OCKED");
        withdrawModeLocked = true;
    }

    /* PUBLIC */

    function withdraw(
        address[] calldata claimTokens,
        uint256[] calldata amounts
    ) external {
        /**
         * We are using msg.sender for smaller attack surface when evaluating
         * the sender of the function call. If in future we want to handle "withdraw"
         * functionality via meta transactions, we should consider using `_msgSender`
         */
        _assertWithdrawAccess(msg.sender);

        require(withdrawRecipient != address(0), "WITHDRAW/NO_RECIPIENT");
        require(!withdrawPowerRevoked, "WITHDRAW/EMERGENCY_POWER_REVOKED");

        for (uint256 i = 0; i < claimTokens.length; i++) {
            if (claimTokens[i] == address(0)) {
                payable(withdrawRecipient).sendValue(amounts[i]);
            } else {
                IERC20(claimTokens[i]).transfer(withdrawRecipient, amounts[i]);
            }
        }

        emit Withdrawn(claimTokens, amounts);
    }

    function revokeWithdrawPower() external onlyOwner {
        withdrawPowerRevoked = true;
        emit WithdrawPowerRevoked();
    }

    /* INTERNAL */

    function _assertWithdrawAccess(address account) internal view {
        if (withdrawMode == WithdrawMode.NOBODY) {
            revert("WITHDRAW/LOCKED");
        } else if (withdrawMode == WithdrawMode.ANYONE) {
            return;
        } else if (withdrawMode == WithdrawMode.RECIPIENT) {
            require(withdrawRecipient == account, "WITHDRAW/ONLY_RECIPIENT");
        } else if (withdrawMode == WithdrawMode.OWNER) {
            require(owner() == account, "WITHDRAW/ONLY_OWNER");
        }
    }
}

File 13 of 17 : ERC721MultiTokenStream.sol
// SPDX-License-Identifier: AGPL-3.0

pragma solidity 0.8.9;

import "@openzeppelin/contracts/proxy/utils/Initializable.sol";
import "@openzeppelin/contracts/access/Ownable.sol";
import "@openzeppelin/contracts/utils/introspection/ERC165Storage.sol";

import "@openzeppelin/contracts/utils/Address.sol";
import "@openzeppelin/contracts/utils/Counters.sol";
import "@openzeppelin/contracts/security/ReentrancyGuard.sol";
import "@openzeppelin/contracts/token/ERC20/IERC20.sol";
import "@openzeppelin/contracts/token/ERC721/IERC721.sol";

interface IERC721MultiTokenStream {
    // Claim native currency for a single ticket token
    function claim(uint256 ticketTokenId) external;

    // Claim an erc20 claim token for a single ticket token
    function claim(uint256 ticketTokenId, address claimToken) external;

    // Claim native currency for multiple ticket tokens (only if all owned by sender)
    function claim(uint256[] calldata ticketTokenIds) external;

    // Claim native or erc20 tokens for multiple ticket tokens (only if all owned by `owner`)
    function claim(
        uint256[] calldata ticketTokenIds,
        address claimToken,
        address owner
    ) external;

    // Total native currency ever supplied to this stream
    function streamTotalSupply() external view returns (uint256);

    // Total erc20 token ever supplied to this stream by claim token address
    function streamTotalSupply(address claimToken)
        external
        view
        returns (uint256);

    // Total native currency ever claimed from this stream
    function streamTotalClaimed() external view returns (uint256);

    // Total erc20 token ever claimed from this stream by claim token address
    function streamTotalClaimed(address claimToken)
        external
        view
        returns (uint256);

    // Total native currency ever claimed for a single ticket token
    function streamTotalClaimed(uint256 ticketTokenId)
        external
        view
        returns (uint256);

    // Total native currency ever claimed for multiple token IDs
    function streamTotalClaimed(uint256[] calldata ticketTokenIds)
        external
        view
        returns (uint256);

    // Total erc20 token ever claimed for multiple token IDs
    function streamTotalClaimed(
        uint256[] calldata ticketTokenIds,
        address claimToken
    ) external view returns (uint256);

    // Calculate currently claimable amount for a specific ticket token ID and a specific claim token address
    // Pass 0x0000000000000000000000000000000000000000 as claim token to represent native currency
    function streamClaimableAmount(uint256 ticketTokenId, address claimToken)
        external
        view
        returns (uint256 claimableAmount);
}

abstract contract ERC721MultiTokenStream is
    IERC721MultiTokenStream,
    Initializable,
    Ownable,
    ERC165Storage,
    ReentrancyGuard
{
    using Address for address;
    using Address for address payable;

    struct Entitlement {
        uint256 totalClaimed;
        uint256 lastClaimedAt;
    }

    // Config
    address public ticketToken;

    // Locks changing the config until this timestamp is reached
    uint64 public lockedUntilTimestamp;

    // Map of ticket token ID -> claim token address -> entitlement
    mapping(uint256 => mapping(address => Entitlement)) public entitlements;

    // Map of claim token address -> Total amount claimed by all holders
    mapping(address => uint256) internal _streamTotalClaimed;

    /* EVENTS */

    event Claim(
        address operator,
        address beneficiary,
        uint256 ticketTokenId,
        address claimToken,
        uint256 releasedAmount
    );

    event ClaimMany(
        address operator,
        address beneficiary,
        uint256[] ticketTokenIds,
        address claimToken,
        uint256 releasedAmount
    );

    function __ERC721MultiTokenStream_init(
        address _ticketToken,
        uint64 _lockedUntilTimestamp
    ) internal onlyInitializing {
        __ERC721MultiTokenStream_init_unchained(
            _ticketToken,
            _lockedUntilTimestamp
        );
    }

    function __ERC721MultiTokenStream_init_unchained(
        address _ticketToken,
        uint64 _lockedUntilTimestamp
    ) internal onlyInitializing {
        ticketToken = _ticketToken;
        lockedUntilTimestamp = _lockedUntilTimestamp;

        _registerInterface(type(IERC721MultiTokenStream).interfaceId);
    }

    /* ADMIN */

    function lockUntil(uint64 newValue) public onlyOwner {
        require(newValue > lockedUntilTimestamp, "CANNOT_REWIND");
        lockedUntilTimestamp = newValue;
    }

    /* PUBLIC */

    receive() external payable {
        require(msg.value > 0);
    }

    function claim(uint256 ticketTokenId) public {
        claim(ticketTokenId, address(0));
    }

    function claim(uint256 ticketTokenId, address claimToken)
        public
        nonReentrant
    {
        /* CHECKS */
        address beneficiary = _msgSender();
        _beforeClaim(ticketTokenId, claimToken, beneficiary);

        uint256 claimable = streamClaimableAmount(ticketTokenId, claimToken);
        require(claimable > 0, "NOTHING_TO_CLAIM");

        /* EFFECTS */

        entitlements[ticketTokenId][claimToken].totalClaimed += claimable;
        entitlements[ticketTokenId][claimToken].lastClaimedAt = block.timestamp;

        _streamTotalClaimed[claimToken] += claimable;

        /* INTERACTIONS */

        if (claimToken == address(0)) {
            payable(address(beneficiary)).sendValue(claimable);
        } else {
            IERC20(claimToken).transfer(beneficiary, claimable);
        }

        /* LOGS */

        emit Claim(
            _msgSender(),
            beneficiary,
            ticketTokenId,
            claimToken,
            claimable
        );
    }

    function claim(uint256[] calldata ticketTokenIds) public {
        claim(ticketTokenIds, address(0), _msgSender());
    }

    function claim(
        uint256[] calldata ticketTokenIds,
        address claimToken,
        address beneficiary
    ) public nonReentrant {
        uint256 totalClaimable;

        for (uint256 i = 0; i < ticketTokenIds.length; i++) {
            _beforeClaim(ticketTokenIds[i], claimToken, beneficiary);

            /* EFFECTS */
            uint256 claimable = streamClaimableAmount(
                ticketTokenIds[i],
                claimToken
            );

            if (claimable > 0) {
                entitlements[ticketTokenIds[i]][claimToken]
                    .totalClaimed += claimable;
                entitlements[ticketTokenIds[i]][claimToken]
                    .lastClaimedAt = block.timestamp;

                totalClaimable += claimable;
            }
        }

        _streamTotalClaimed[claimToken] += totalClaimable;

        /* INTERACTIONS */

        if (claimToken == address(0)) {
            payable(address(beneficiary)).sendValue(totalClaimable);
        } else {
            IERC20(claimToken).transfer(beneficiary, totalClaimable);
        }

        /* LOGS */

        emit ClaimMany(
            _msgSender(),
            beneficiary,
            ticketTokenIds,
            claimToken,
            totalClaimable
        );
    }

    /* READ ONLY */

    function streamTotalSupply() public view returns (uint256) {
        return streamTotalSupply(address(0));
    }

    function streamTotalSupply(address claimToken)
        public
        view
        returns (uint256)
    {
        if (claimToken == address(0)) {
            return _streamTotalClaimed[claimToken] + address(this).balance;
        }

        return
            _streamTotalClaimed[claimToken] +
            IERC20(claimToken).balanceOf(address(this));
    }

    function streamTotalClaimed() public view returns (uint256) {
        return _streamTotalClaimed[address(0)];
    }

    function streamTotalClaimed(address claimToken)
        public
        view
        returns (uint256)
    {
        return _streamTotalClaimed[claimToken];
    }

    function streamTotalClaimed(uint256 ticketTokenId)
        public
        view
        returns (uint256)
    {
        return entitlements[ticketTokenId][address(0)].totalClaimed;
    }

    function streamTotalClaimed(uint256 ticketTokenId, address claimToken)
        public
        view
        returns (uint256)
    {
        return entitlements[ticketTokenId][claimToken].totalClaimed;
    }

    function streamTotalClaimed(uint256[] calldata ticketTokenIds)
        public
        view
        returns (uint256)
    {
        return streamTotalClaimed(ticketTokenIds, address(0));
    }

    function streamTotalClaimed(
        uint256[] calldata ticketTokenIds,
        address claimToken
    ) public view returns (uint256) {
        uint256 claimed = 0;

        for (uint256 i = 0; i < ticketTokenIds.length; i++) {
            claimed += entitlements[ticketTokenIds[i]][claimToken].totalClaimed;
        }

        return claimed;
    }

    function streamClaimableAmount(
        uint256[] calldata ticketTokenIds,
        address claimToken
    ) public view returns (uint256) {
        uint256 claimable = 0;

        for (uint256 i = 0; i < ticketTokenIds.length; i++) {
            claimable += streamClaimableAmount(ticketTokenIds[i], claimToken);
        }

        return claimable;
    }

    function streamClaimableAmount(uint256 ticketTokenId)
        public
        view
        returns (uint256)
    {
        return streamClaimableAmount(ticketTokenId, address(0));
    }

    function streamClaimableAmount(uint256 ticketTokenId, address claimToken)
        public
        view
        virtual
        returns (uint256)
    {
        uint256 totalReleased = _totalTokenReleasedAmount(
            _totalStreamReleasedAmount(
                streamTotalSupply(claimToken),
                ticketTokenId,
                claimToken
            ),
            ticketTokenId,
            claimToken
        );

        return
            totalReleased -
            entitlements[ticketTokenId][claimToken].totalClaimed;
    }

    function _totalStreamReleasedAmount(
        uint256 streamTotalSupply_,
        uint256 ticketTokenId_,
        address claimToken_
    ) internal view virtual returns (uint256);

    function _totalTokenReleasedAmount(
        uint256 totalReleasedAmount_,
        uint256 ticketTokenId_,
        address claimToken_
    ) internal view virtual returns (uint256);

    /* INTERNAL */

    function _beforeClaim(
        uint256 ticketTokenId_,
        address claimToken_,
        address beneficiary_
    ) internal virtual {
        require(
            IERC721(ticketToken).ownerOf(ticketTokenId_) == beneficiary_,
            "NOT_NFT_OWNER"
        );
    }
}

File 14 of 17 : ERC721InstantReleaseExtension.sol
// SPDX-License-Identifier: AGPL-3.0

pragma solidity 0.8.9;

import "@openzeppelin/contracts/proxy/utils/Initializable.sol";
import "@openzeppelin/contracts/access/Ownable.sol";
import "@openzeppelin/contracts/utils/introspection/ERC165Storage.sol";

import "@openzeppelin/contracts/utils/Address.sol";
import "@openzeppelin/contracts/utils/Counters.sol";
import "@openzeppelin/contracts/security/ReentrancyGuard.sol";
import "@openzeppelin/contracts/token/ERC20/IERC20.sol";
import "@openzeppelin/contracts/token/ERC721/IERC721.sol";

import "../base/ERC721MultiTokenStream.sol";

interface IERC721InstantReleaseExtension {
    function hasERC721InstantReleaseExtension() external view returns (bool);
}

abstract contract ERC721InstantReleaseExtension is
    IERC721InstantReleaseExtension,
    Initializable,
    Ownable,
    ERC165Storage,
    ERC721MultiTokenStream
{
    /* INIT */

    function __ERC721InstantReleaseExtension_init() internal onlyInitializing {
        __ERC721InstantReleaseExtension_init_unchained();
    }

    function __ERC721InstantReleaseExtension_init_unchained()
        internal
        onlyInitializing
    {
        _registerInterface(type(IERC721InstantReleaseExtension).interfaceId);
    }

    /* PUBLIC */

    function hasERC721InstantReleaseExtension() external pure returns (bool) {
        return true;
    }

    /* INTERNAL */

    function _totalStreamReleasedAmount(
        uint256 streamTotalSupply_,
        uint256 ticketTokenId_,
        address claimToken_
    ) internal pure override returns (uint256) {
        ticketTokenId_;
        claimToken_;

        return streamTotalSupply_;
    }
}

File 15 of 17 : ERC721LockableClaimExtension.sol
// SPDX-License-Identifier: AGPL-3.0

pragma solidity 0.8.9;

import "@openzeppelin/contracts/proxy/utils/Initializable.sol";
import "@openzeppelin/contracts/access/Ownable.sol";
import "@openzeppelin/contracts/utils/introspection/ERC165Storage.sol";

import "@openzeppelin/contracts/utils/Address.sol";
import "@openzeppelin/contracts/utils/Counters.sol";
import "@openzeppelin/contracts/security/ReentrancyGuard.sol";
import "@openzeppelin/contracts/token/ERC20/IERC20.sol";
import "@openzeppelin/contracts/token/ERC721/IERC721.sol";

import "../base/ERC721MultiTokenStream.sol";

interface IERC721LockableClaimExtension {
    function hasERC721LockableClaimExtension() external view returns (bool);

    function setClaimLockedUntil(uint64 newValue) external;
}

abstract contract ERC721LockableClaimExtension is
    IERC721LockableClaimExtension,
    Initializable,
    Ownable,
    ERC165Storage,
    ERC721MultiTokenStream
{
    // Claiming is only possible after this time (unix timestamp)
    uint64 public claimLockedUntil;

    /* INTERNAL */

    function __ERC721LockableClaimExtension_init(uint64 _claimLockedUntil)
        internal
        onlyInitializing
    {
        __ERC721LockableClaimExtension_init_unchained(_claimLockedUntil);
    }

    function __ERC721LockableClaimExtension_init_unchained(
        uint64 _claimLockedUntil
    ) internal onlyInitializing {
        claimLockedUntil = _claimLockedUntil;

        _registerInterface(type(IERC721LockableClaimExtension).interfaceId);
    }

    /* ADMIN */

    function setClaimLockedUntil(uint64 newValue) public onlyOwner {
        require(lockedUntilTimestamp < block.timestamp, "CONFIG_LOCKED");
        claimLockedUntil = newValue;
    }

    /* PUBLIC */

    function hasERC721LockableClaimExtension() external pure returns (bool) {
        return true;
    }

    /* INTERNAL */

    function _beforeClaim(
        uint256 ticketTokenId_,
        address claimToken_,
        address beneficiary_
    ) internal virtual override {
        ticketTokenId_;
        claimToken_;
        beneficiary_;

        require(claimLockedUntil < block.timestamp, "CLAIM_LOCKED");
    }
}

File 16 of 17 : ERC721ShareSplitExtension.sol
// SPDX-License-Identifier: AGPL-3.0

pragma solidity 0.8.9;

import "@openzeppelin/contracts/proxy/utils/Initializable.sol";
import "@openzeppelin/contracts/access/Ownable.sol";
import "@openzeppelin/contracts/utils/introspection/ERC165Storage.sol";

import "@openzeppelin/contracts/utils/Address.sol";
import "@openzeppelin/contracts/utils/Counters.sol";
import "@openzeppelin/contracts/security/ReentrancyGuard.sol";
import "@openzeppelin/contracts/token/ERC20/IERC20.sol";
import "@openzeppelin/contracts/token/ERC721/IERC721.sol";

import "../base/ERC721MultiTokenStream.sol";

interface IERC721ShareSplitExtension {
    function hasERC721ShareSplitExtension() external view returns (bool);

    function setSharesForTokens(
        uint256[] memory _tokenIds,
        uint256[] memory _shares
    ) external;

    function getSharesByTokens(uint256[] calldata _tokenIds)
        external
        view
        returns (uint256[] memory);
}

abstract contract ERC721ShareSplitExtension is
    IERC721ShareSplitExtension,
    Initializable,
    Ownable,
    ERC165Storage,
    ERC721MultiTokenStream
{
    event SharesUpdated(uint256 tokenId, uint256 prevShares, uint256 newShares);

    // Sum of all the share units ever configured
    uint256 public totalShares;

    // Map of ticket token ID -> share of the stream
    mapping(uint256 => uint256) public shares;

    /* INTERNAL */

    function __ERC721ShareSplitExtension_init(
        uint256[] memory _tokenIds,
        uint256[] memory _shares
    ) internal onlyInitializing {
        __ERC721ShareSplitExtension_init_unchained(_tokenIds, _shares);
    }

    function __ERC721ShareSplitExtension_init_unchained(
        uint256[] memory _tokenIds,
        uint256[] memory _shares
    ) internal onlyInitializing {
        require(_shares.length == _tokenIds.length, "ARGS_MISMATCH");
        _updateShares(_tokenIds, _shares);

        _registerInterface(type(IERC721ShareSplitExtension).interfaceId);
    }

    function setSharesForTokens(
        uint256[] memory _tokenIds,
        uint256[] memory _shares
    ) public onlyOwner {
        require(_shares.length == _tokenIds.length, "ARGS_MISMATCH");
        require(lockedUntilTimestamp < block.timestamp, "CONFIG_LOCKED");

        _updateShares(_tokenIds, _shares);
    }

    /* PUBLIC */

    function hasERC721ShareSplitExtension() external pure returns (bool) {
        return true;
    }

    function getSharesByTokens(uint256[] calldata _tokenIds)
        public
        view
        returns (uint256[] memory)
    {
        uint256[] memory _shares = new uint256[](_tokenIds.length);

        for (uint256 i = 0; i < _shares.length; i++) {
            _shares[i] = shares[_tokenIds[i]];
        }

        return _shares;
    }

    function _totalTokenReleasedAmount(
        uint256 totalReleasedAmount_,
        uint256 ticketTokenId_,
        address claimToken_
    ) internal view override returns (uint256) {
        claimToken_;

        return (totalReleasedAmount_ * shares[ticketTokenId_]) / totalShares;
    }

    /* INTERNAL */

    function _updateShares(uint256[] memory _tokenIds, uint256[] memory _shares)
        private
    {
        for (uint256 i = 0; i < _shares.length; i++) {
            _updateShares(_tokenIds[i], _shares[i]);
        }
    }

    function _updateShares(uint256 tokenId, uint256 newShares) private {
        uint256 prevShares = shares[tokenId];

        shares[tokenId] = newShares;
        totalShares = totalShares + newShares - prevShares;

        require(totalShares >= 0, "NEGATIVE_SHARES");

        emit SharesUpdated(tokenId, prevShares, newShares);
    }
}

File 17 of 17 : ERC721ShareInstantStream.sol
// SPDX-License-Identifier: AGPL-3.0

pragma solidity 0.8.9;

import "@openzeppelin/contracts/proxy/utils/Initializable.sol";
import "@openzeppelin/contracts/access/Ownable.sol";

import "@openzeppelin/contracts/utils/Address.sol";
import "@openzeppelin/contracts/utils/Counters.sol";
import "@openzeppelin/contracts/security/ReentrancyGuard.sol";
import "@openzeppelin/contracts/token/ERC20/IERC20.sol";
import "@openzeppelin/contracts/token/ERC721/IERC721.sol";

import "../../../common/WithdrawExtension.sol";
import "../extensions/ERC721InstantReleaseExtension.sol";
import "../extensions/ERC721ShareSplitExtension.sol";
import "../extensions/ERC721LockableClaimExtension.sol";

contract ERC721ShareInstantStream is
    Initializable,
    Ownable,
    ERC721InstantReleaseExtension,
    ERC721ShareSplitExtension,
    ERC721LockableClaimExtension,
    WithdrawExtension
{
    string public constant name = "ERC721 Share Instant Stream";

    string public constant version = "0.1";

    struct Config {
        // Base
        address ticketToken;
        uint64 lockedUntilTimestamp;
        // Share split extension
        uint256[] tokenIds;
        uint256[] shares;
        // Lockable claim extension
        uint64 claimLockedUntil;
    }

    /* INTERNAL */

    constructor(Config memory config) {
        initialize(config, msg.sender);
    }

    function initialize(Config memory config, address deployer)
        public
        initializer
    {
        _transferOwnership(deployer);

        __WithdrawExtension_init(deployer, WithdrawMode.OWNER);
        __ERC721MultiTokenStream_init(
            config.ticketToken,
            config.lockedUntilTimestamp
        );
        __ERC721InstantReleaseExtension_init();
        __ERC721ShareSplitExtension_init(config.tokenIds, config.shares);
        __ERC721LockableClaimExtension_init(config.claimLockedUntil);
    }

    function _beforeClaim(
        uint256 ticketTokenId_,
        address claimToken_,
        address beneficiary_
    ) internal override(ERC721MultiTokenStream, ERC721LockableClaimExtension) {
        ERC721MultiTokenStream._beforeClaim(
            ticketTokenId_,
            claimToken_,
            beneficiary_
        );
        ERC721LockableClaimExtension._beforeClaim(
            ticketTokenId_,
            claimToken_,
            beneficiary_
        );
    }
}

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

Contract ABI

[{"inputs":[{"components":[{"internalType":"address","name":"ticketToken","type":"address"},{"internalType":"uint64","name":"lockedUntilTimestamp","type":"uint64"},{"internalType":"uint256[]","name":"tokenIds","type":"uint256[]"},{"internalType":"uint256[]","name":"shares","type":"uint256[]"},{"internalType":"uint64","name":"claimLockedUntil","type":"uint64"}],"internalType":"struct ERC721ShareInstantStream.Config","name":"config","type":"tuple"}],"stateMutability":"nonpayable","type":"constructor"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"operator","type":"address"},{"indexed":false,"internalType":"address","name":"beneficiary","type":"address"},{"indexed":false,"internalType":"uint256","name":"ticketTokenId","type":"uint256"},{"indexed":false,"internalType":"address","name":"claimToken","type":"address"},{"indexed":false,"internalType":"uint256","name":"releasedAmount","type":"uint256"}],"name":"Claim","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"operator","type":"address"},{"indexed":false,"internalType":"address","name":"beneficiary","type":"address"},{"indexed":false,"internalType":"uint256[]","name":"ticketTokenIds","type":"uint256[]"},{"indexed":false,"internalType":"address","name":"claimToken","type":"address"},{"indexed":false,"internalType":"uint256","name":"releasedAmount","type":"uint256"}],"name":"ClaimMany","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint8","name":"version","type":"uint8"}],"name":"Initialized","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"previousOwner","type":"address"},{"indexed":true,"internalType":"address","name":"newOwner","type":"address"}],"name":"OwnershipTransferred","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"uint256","name":"tokenId","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"prevShares","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"newShares","type":"uint256"}],"name":"SharesUpdated","type":"event"},{"anonymous":false,"inputs":[],"name":"WithdrawPowerRevoked","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address[]","name":"claimTokens","type":"address[]"},{"indexed":false,"internalType":"uint256[]","name":"amounts","type":"uint256[]"}],"name":"Withdrawn","type":"event"},{"inputs":[{"internalType":"uint256","name":"ticketTokenId","type":"uint256"}],"name":"claim","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256[]","name":"ticketTokenIds","type":"uint256[]"}],"name":"claim","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"ticketTokenId","type":"uint256"},{"internalType":"address","name":"claimToken","type":"address"}],"name":"claim","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256[]","name":"ticketTokenIds","type":"uint256[]"},{"internalType":"address","name":"claimToken","type":"address"},{"internalType":"address","name":"beneficiary","type":"address"}],"name":"claim","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"claimLockedUntil","outputs":[{"internalType":"uint64","name":"","type":"uint64"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"","type":"uint256"},{"internalType":"address","name":"","type":"address"}],"name":"entitlements","outputs":[{"internalType":"uint256","name":"totalClaimed","type":"uint256"},{"internalType":"uint256","name":"lastClaimedAt","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256[]","name":"_tokenIds","type":"uint256[]"}],"name":"getSharesByTokens","outputs":[{"internalType":"uint256[]","name":"","type":"uint256[]"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"hasERC721InstantReleaseExtension","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"pure","type":"function"},{"inputs":[],"name":"hasERC721LockableClaimExtension","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"pure","type":"function"},{"inputs":[],"name":"hasERC721ShareSplitExtension","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"pure","type":"function"},{"inputs":[{"components":[{"internalType":"address","name":"ticketToken","type":"address"},{"internalType":"uint64","name":"lockedUntilTimestamp","type":"uint64"},{"internalType":"uint256[]","name":"tokenIds","type":"uint256[]"},{"internalType":"uint256[]","name":"shares","type":"uint256[]"},{"internalType":"uint64","name":"claimLockedUntil","type":"uint64"}],"internalType":"struct ERC721ShareInstantStream.Config","name":"config","type":"tuple"},{"internalType":"address","name":"deployer","type":"address"}],"name":"initialize","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint64","name":"newValue","type":"uint64"}],"name":"lockUntil","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"lockWithdrawMode","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"lockWithdrawRecipient","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"lockedUntilTimestamp","outputs":[{"internalType":"uint64","name":"","type":"uint64"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"name","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"owner","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"renounceOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"revokeWithdrawPower","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint64","name":"newValue","type":"uint64"}],"name":"setClaimLockedUntil","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256[]","name":"_tokenIds","type":"uint256[]"},{"internalType":"uint256[]","name":"_shares","type":"uint256[]"}],"name":"setSharesForTokens","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"enum WithdrawMode","name":"_withdrawMode","type":"uint8"}],"name":"setWithdrawMode","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_withdrawRecipient","type":"address"}],"name":"setWithdrawRecipient","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"","type":"uint256"}],"name":"shares","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256[]","name":"ticketTokenIds","type":"uint256[]"},{"internalType":"address","name":"claimToken","type":"address"}],"name":"streamClaimableAmount","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"ticketTokenId","type":"uint256"}],"name":"streamClaimableAmount","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"ticketTokenId","type":"uint256"},{"internalType":"address","name":"claimToken","type":"address"}],"name":"streamClaimableAmount","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256[]","name":"ticketTokenIds","type":"uint256[]"},{"internalType":"address","name":"claimToken","type":"address"}],"name":"streamTotalClaimed","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"streamTotalClaimed","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256[]","name":"ticketTokenIds","type":"uint256[]"}],"name":"streamTotalClaimed","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"ticketTokenId","type":"uint256"},{"internalType":"address","name":"claimToken","type":"address"}],"name":"streamTotalClaimed","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"claimToken","type":"address"}],"name":"streamTotalClaimed","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"ticketTokenId","type":"uint256"}],"name":"streamTotalClaimed","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"streamTotalSupply","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"claimToken","type":"address"}],"name":"streamTotalSupply","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes4","name":"interfaceId","type":"bytes4"}],"name":"supportsInterface","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"ticketToken","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"totalShares","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"newOwner","type":"address"}],"name":"transferOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"version","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address[]","name":"claimTokens","type":"address[]"},{"internalType":"uint256[]","name":"amounts","type":"uint256[]"}],"name":"withdraw","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"withdrawMode","outputs":[{"internalType":"enum WithdrawMode","name":"","type":"uint8"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"withdrawModeLocked","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"withdrawPowerRevoked","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"withdrawRecipient","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"withdrawRecipientLocked","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"stateMutability":"payable","type":"receive"}]

60806040523480156200001157600080fd5b5060405162003537380380620035378339810160408190526200003491620007e5565b6200003f3362000057565b6001600255620000508133620000b2565b50620009f4565b600080546001600160a01b038381166201000081810262010000600160b01b0319851617855560405193049190911692909183917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e091a35050565b6000620000c0600162000185565b90508015620000d9576000805461ff0019166101001790555b620000e48262000057565b620000f182600062000237565b8251602084015162000104919062000271565b6200010e620002a7565b6200012883604001518460600151620002dd60201b60201c565b6080830151620001389062000313565b801562000180576000805461ff0019169055604051600181527f7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb3847402498906020015b60405180910390a15b505050565b60008054610100900460ff1615620001ee578160ff166001148015620001be5750620001bc306200034b60201b620018bd1760201c565b155b620001e65760405162461bcd60e51b8152600401620001dd90620008c6565b60405180910390fd5b506000919050565b60005460ff808416911610620002185760405162461bcd60e51b8152600401620001dd90620008c6565b506000805460ff191660ff92909216919091179055600190565b919050565b600054610100900460ff16620002615760405162461bcd60e51b8152600401620001dd9062000914565b6200026d82826200035a565b5050565b600054610100900460ff166200029b5760405162461bcd60e51b8152600401620001dd9062000914565b6200026d828262000401565b600054610100900460ff16620002d15760405162461bcd60e51b8152600401620001dd9062000914565b620002db6200046b565b565b600054610100900460ff16620003075760405162461bcd60e51b8152600401620001dd9062000914565b6200026d8282620004a7565b600054610100900460ff166200033d5760405162461bcd60e51b8152600401620001dd9062000914565b620003488162000532565b50565b6001600160a01b03163b151590565b600054610100900460ff16620003845760405162461bcd60e51b8152600401620001dd9062000914565b6200039663ac2ba33360e01b62000584565b60088054600160401b600160e01b03198116680100000000000000006001600160a01b038616029081178355839291600160401b62ff000160e01b03191660ff60f01b1990911617600160f01b836003811115620003f857620003f86200095f565b02179055505050565b600054610100900460ff166200042b5760405162461bcd60e51b8152600401620001dd9062000914565b600380546001600160401b038316600160a01b026001600160e01b03199091166001600160a01b038516171790556200026d631ba050e960e21b62000584565b600054610100900460ff16620004955760405162461bcd60e51b8152600401620001dd9062000914565b620002db631259990960e01b62000584565b600054610100900460ff16620004d15760405162461bcd60e51b8152600401620001dd9062000914565b8151815114620005145760405162461bcd60e51b815260206004820152600d60248201526c082a48ea6be9a92a69a82a8869609b1b6044820152606401620001dd565b62000520828262000608565b6200026d6333c7a33f60e11b62000584565b600054610100900460ff166200055c5760405162461bcd60e51b8152600401620001dd9062000914565b600880546001600160401b0319166001600160401b038316179055620003486317b2ef4360e31b5b6001600160e01b03198082161415620005e05760405162461bcd60e51b815260206004820152601c60248201527f4552433136353a20696e76616c696420696e74657266616365206964000000006044820152606401620001dd565b6001600160e01b0319166000908152600160208190526040909120805460ff19169091179055565b60005b815181101562000180576200065f8382815181106200062e576200062e62000975565b60200260200101518383815181106200064b576200064b62000975565b60200260200101516200067460201b60201c565b806200066b81620009a1565b9150506200060b565b600082815260076020526040902080549082905560065481906200069a908490620009bf565b620006a69190620009da565b60065560408051848152602081018390529081018390527ff81b1f9d8b5d36a5a67d13006a8b091a9b63e2a38b331d315d99c6daefd2ddcc9060600162000177565b634e487b7160e01b600052604160045260246000fd5b60405160a081016001600160401b0381118282101715620007235762000723620006e8565b60405290565b80516001600160401b03811681146200023257600080fd5b600082601f8301126200075357600080fd5b815160206001600160401b0380831115620007725762000772620006e8565b8260051b604051601f19603f830116810181811084821117156200079a576200079a620006e8565b604052938452858101830193838101925087851115620007b957600080fd5b83870191505b84821015620007da57815183529183019190830190620007bf565b979650505050505050565b600060208284031215620007f857600080fd5b81516001600160401b03808211156200081057600080fd5b9083019060a082860312156200082557600080fd5b6200082f620006fe565b82516001600160a01b03811681146200084757600080fd5b8152620008576020840162000729565b60208201526040830151828111156200086f57600080fd5b6200087d8782860162000741565b6040830152506060830151828111156200089657600080fd5b620008a48782860162000741565b606083015250620008b86080840162000729565b608082015295945050505050565b6020808252602e908201527f496e697469616c697a61626c653a20636f6e747261637420697320616c72656160408201526d191e481a5b9a5d1a585b1a5e995960921b606082015260800190565b6020808252602b908201527f496e697469616c697a61626c653a20636f6e7472616374206973206e6f74206960408201526a6e697469616c697a696e6760a81b606082015260800190565b634e487b7160e01b600052602160045260246000fd5b634e487b7160e01b600052603260045260246000fd5b634e487b7160e01b600052601160045260246000fd5b6000600019821415620009b857620009b86200098b565b5060010190565b60008219821115620009d557620009d56200098b565b500190565b600082821015620009ef57620009ef6200098b565b500390565b612b338062000a046000396000f3fe6080604052600436106102115760003560e01c8063016b27981461022a5780630191c0af1461024a57806301ffc9a71461027d57806306fdde03146102ad578063125999091461030157806314427a96146103155780631c725fdc1461034d57806325289bad1461036d5780632890d033146103945780632c0e1313146103a95780632c233067146103c95780632d00b587146103e9578063379607f5146104175780633a98ef39146104375780633b3f12e21461044d5780633d2dded51461046d57806340f37948146104aa57806349561cb9146104d757806354fd4d50146104f857806357a858fc1461052757806357dc48c8146105545780636057e0ec146105a85780636ba4c138146105c9578063715018a6146105e9578063790c0c73146105fe578063837fe1401461061e57806389c6b815146106335780638da5cb5b146106535780638fc852b1146106755780639199690b14610301578063968d9b2c14610695578063a1cf6493146106b5578063a8b46d8714610301578063af121f54146106f8578063c088184914610719578063c0bb38ff1461074f578063c723955a1461076f578063d5ed4d5a14610784578063da82b227146107a4578063dcbe353f146107b9578063ddd5e1b2146107e0578063de6d6d9614610800578063f2fde38b14610820578063f389b6e414610840578063f4415ad614610860578063f66e38c21461089857600080fd5b36610225576000341161022357600080fd5b005b600080fd5b34801561023657600080fd5b506102236102453660046122e5565b6108b8565b34801561025657600080fd5b5061026a610265366004612407565b610975565b6040519081526020015b60405180910390f35b34801561028957600080fd5b5061029d61029836600461245d565b6109cb565b6040519015158152602001610274565b3480156102b957600080fd5b506102f46040518060400160405280601b81526020017a45524337323120536861726520496e7374616e742053747265616d60281b81525081565b6040516102749190612487565b34801561030d57600080fd5b50600161029d565b34801561032157600080fd5b50600854610335906001600160401b031681565b6040516001600160401b039091168152602001610274565b34801561035957600080fd5b506102236103683660046124dc565b610a0b565b34801561037957600080fd5b5060035461033590600160a01b90046001600160401b031681565b3480156103a057600080fd5b5061026a610ac4565b3480156103b557600080fd5b506102236103c43660046124dc565b610ad5565b3480156103d557600080fd5b506102236103e43660046124f7565b610b58565b3480156103f557600080fd5b5060085461040a90600160f01b900460ff1681565b604051610274919061252e565b34801561042357600080fd5b50610223610432366004612556565b610bde565b34801561044357600080fd5b5061026a60065481565b34801561045957600080fd5b5061026a610468366004612407565b610bec565b34801561047957600080fd5b506000805260056020527f05b8ccbb9d4d8fb16ea74ce3c29a41f1b461fbdaff4714a0d9a8eb05499746bc5461026a565b3480156104b657600080fd5b506104ca6104c536600461256f565b610c6a565b60405161027491906125b0565b3480156104e357600080fd5b5060085461029d90600160f81b900460ff1681565b34801561050457600080fd5b506102f460405180604001604052806003815260200162302e3160e81b81525081565b34801561053357600080fd5b5061026a610542366004612556565b60076020526000908152604090205481565b34801561056057600080fd5b5061059361056f3660046125f4565b60046020908152600092835260408084209091529082529020805460019091015482565b60408051928352602083019190915201610274565b3480156105b457600080fd5b5060085461029d90600160e01b900460ff1681565b3480156105d557600080fd5b506102236105e436600461256f565b610d21565b3480156105f557600080fd5b50610223610d32565b34801561060a57600080fd5b5061026a610619366004612624565b610d6d565b34801561062a57600080fd5b50610223610e40565b34801561063f57600080fd5b5061026a61064e36600461256f565b610eae565b34801561065f57600080fd5b50610668610ec3565b6040516102749190612641565b34801561068157600080fd5b50610223610690366004612655565b610ed8565b3480156106a157600080fd5b5061026a6106b0366004612556565b610f64565b3480156106c157600080fd5b5061026a6106d03660046125f4565b60009182526004602090815260408084206001600160a01b0393909316845291905290205490565b34801561070457600080fd5b5060085461029d90600160e81b900460ff1681565b34801561072557600080fd5b5061026a610734366004612624565b6001600160a01b031660009081526005602052604090205490565b34801561075b57600080fd5b5061022361076a366004612624565b610f71565b34801561077b57600080fd5b50610223610ff6565b34801561079057600080fd5b50600354610668906001600160a01b031681565b3480156107b057600080fd5b5061022361107e565b3480156107c557600080fd5b5060085461066890600160401b90046001600160a01b031681565b3480156107ec57600080fd5b506102236107fb3660046125f4565b6110eb565b34801561080c57600080fd5b5061022361081b3660046126b8565b6112f4565b34801561082c57600080fd5b5061022361083b366004612624565b611557565b34801561084c57600080fd5b5061022361085b366004612723565b6115f4565b34801561086c57600080fd5b5061026a61087b366004612556565b600090815260046020908152604080832083805290915290205490565b3480156108a457600080fd5b5061026a6108b33660046125f4565b611869565b60006108c460016118cc565b905080156108dc576000805461ff0019166101001790555b6108e582611960565b6108f08260006119bb565b610902836000015184602001516119ec565b61090a611a1d565b61091c83604001518460600151611a4c565b6109298360800151611a7d565b8015610970576000805461ff0019169055604051600181527f7f26b83ff96e1f2b6a682f133852f6798a09c465da95921460cefb3847402498906020015b60405180910390a15b505050565b600080805b848110156109c2576109a48686838181106109975761099761278a565b9050602002013585611869565b6109ae90836127b6565b9150806109ba816127ce565b91505061097a565b50949350505050565b60006301ffc9a760e01b6001600160e01b031983161480610a0557506001600160e01b0319821660009081526001602052604090205460ff165b92915050565b33610a14610ec3565b6001600160a01b031614610a435760405162461bcd60e51b8152600401610a3a906127e9565b60405180910390fd5b6003546001600160401b03600160a01b909104811690821611610a985760405162461bcd60e51b815260206004820152600d60248201526c10d0539393d517d49155d25391609a1b6044820152606401610a3a565b600380546001600160401b03909216600160a01b02600160a01b600160e01b0319909216919091179055565b6000610ad06000610d6d565b905090565b33610ade610ec3565b6001600160a01b031614610b045760405162461bcd60e51b8152600401610a3a906127e9565b60035442600160a01b9091046001600160401b031610610b365760405162461bcd60e51b8152600401610a3a9061281e565b600880546001600160401b0319166001600160401b0392909216919091179055565b33610b61610ec3565b6001600160a01b031614610b875760405162461bcd60e51b8152600401610a3a906127e9565b600854600160f81b900460ff1615610bb15760405162461bcd60e51b8152600401610a3a90612845565b6008805482919060ff60f01b1916600160f01b836003811115610bd657610bd6612518565b021790555050565b610be98160006110eb565b50565b600080805b848110156109c25760046000878784818110610c0f57610c0f61278a565b9050602002013581526020019081526020016000206000856001600160a01b03166001600160a01b031681526020019081526020016000206000015482610c5691906127b6565b915080610c62816127ce565b915050610bf1565b60606000826001600160401b03811115610c8657610c866121d6565b604051908082528060200260200182016040528015610caf578160200160208202803683370190505b50905060005b8151811015610d195760076000868684818110610cd457610cd461278a565b90506020020135815260200190815260200160002054828281518110610cfc57610cfc61278a565b602090810291909101015280610d11816127ce565b915050610cb5565b509392505050565b610d2e82826000336115f4565b5050565b33610d3b610ec3565b6001600160a01b031614610d615760405162461bcd60e51b8152600401610a3a906127e9565b610d6b6000611960565b565b60006001600160a01b038216610da1576001600160a01b038216600090815260056020526040902054610a059047906127b6565b6040516370a0823160e01b81526001600160a01b038316906370a0823190610dcd903090600401612641565b60206040518083038186803b158015610de557600080fd5b505afa158015610df9573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610e1d9190612865565b6001600160a01b038316600090815260056020526040902054610a0591906127b6565b33610e49610ec3565b6001600160a01b031614610e6f5760405162461bcd60e51b8152600401610a3a906127e9565b600854600160e01b900460ff1615610e995760405162461bcd60e51b8152600401610a3a90612845565b6008805460ff60e01b1916600160e01b179055565b6000610ebc83836000610bec565b9392505050565b6000546201000090046001600160a01b031690565b33610ee1610ec3565b6001600160a01b031614610f075760405162461bcd60e51b8152600401610a3a906127e9565b8151815114610f285760405162461bcd60e51b8152600401610a3a9061287e565b60035442600160a01b9091046001600160401b031610610f5a5760405162461bcd60e51b8152600401610a3a9061281e565b610d2e8282611aad565b6000610a05826000611869565b33610f7a610ec3565b6001600160a01b031614610fa05760405162461bcd60e51b8152600401610a3a906127e9565b600854600160e01b900460ff1615610fca5760405162461bcd60e51b8152600401610a3a90612845565b600880546001600160a01b03909216600160401b02600160401b600160e01b0319909216919091179055565b33610fff610ec3565b6001600160a01b0316146110255760405162461bcd60e51b8152600401610a3a906127e9565b600854600160f81b900460ff16156110675760405162461bcd60e51b815260206004820152600560248201526413d0d2d15160da1b6044820152606401610a3a565b600880546001600160f81b0316600160f81b179055565b33611087610ec3565b6001600160a01b0316146110ad5760405162461bcd60e51b8152600401610a3a906127e9565b6008805460ff60e81b1916600160e81b1790556040517fa24423a69b45c25c0479663125e48b482e71d85eae416f589545243bafaf3c9590600090a1565b60028054141561110d5760405162461bcd60e51b8152600401610a3a906128a5565b600280553361111d838383611b07565b60006111298484611869565b90506000811161116e5760405162461bcd60e51b815260206004820152601060248201526f4e4f5448494e475f544f5f434c41494d60801b6044820152606401610a3a565b60008481526004602090815260408083206001600160a01b0387168452909152812080548392906111a09084906127b6565b909155505060008481526004602090815260408083206001600160a01b03871684528252808320426001909101556005909152812080548392906111e59084906127b6565b90915550506001600160a01b0383166112105761120b6001600160a01b03831682611b1d565b611292565b60405163a9059cbb60e01b81526001600160a01b0384169063a9059cbb9061123e90859085906004016128dc565b602060405180830381600087803b15801561125857600080fd5b505af115801561126c573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061129091906128f5565b505b604080513381526001600160a01b038481166020830152818301879052851660608201526080810183905290517fa2d3c4c1fc934d6d2d8f9e862df90c01ae4eb0e920cd8957d242ba26b8dc40789181900360a00190a1505060016002555050565b6112fd33611c33565b600854600160401b90046001600160a01b03166113545760405162461bcd60e51b815260206004820152601560248201527415d2551211149055cbd393d7d49150d25412515395605a1b6044820152606401610a3a565b600854600160e81b900460ff16156113ae5760405162461bcd60e51b815260206004820181905260248201527f57495448445241572f454d455247454e43595f504f5745525f5245564f4b45446044820152606401610a3a565b60005b838110156115135760008585838181106113cd576113cd61278a565b90506020020160208101906113e29190612624565b6001600160a01b0316141561142e576114298383838181106114065761140661278a565b6008546001600160a01b03600160401b9091041692602090910201359050611b1d565b611501565b8484828181106114405761144061278a565b90506020020160208101906114559190612624565b6001600160a01b031663a9059cbb60088054906101000a90046001600160a01b03168585858181106114895761148961278a565b905060200201356040518363ffffffff1660e01b81526004016114ad9291906128dc565b602060405180830381600087803b1580156114c757600080fd5b505af11580156114db573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906114ff91906128f5565b505b8061150b816127ce565b9150506113b1565b507fd40c399a83caf67d15628b821aa7c7bd940e563c57a047e2bd3b8c602bcaf5a584848484604051611549949392919061294d565b60405180910390a150505050565b33611560610ec3565b6001600160a01b0316146115865760405162461bcd60e51b8152600401610a3a906127e9565b6001600160a01b0381166115eb5760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b6064820152608401610a3a565b610be981611960565b6002805414156116165760405162461bcd60e51b8152600401610a3a906128a5565b600280556000805b848110156117465761164986868381811061163b5761163b61278a565b905060200201358585611b07565b600061166d8787848181106116605761166061278a565b9050602002013586611869565b9050801561173357806004600089898681811061168c5761168c61278a565b9050602002013581526020019081526020016000206000876001600160a01b03166001600160a01b0316815260200190815260200160002060000160008282546116d691906127b6565b90915550429050600460008989868181106116f3576116f361278a565b6020908102929092013583525081810192909252604090810160009081206001600160a01b038a16825290925290206001015561173081846127b6565b92505b508061173e816127ce565b91505061161e565b506001600160a01b0383166000908152600560205260408120805483929061176f9084906127b6565b90915550506001600160a01b03831661179a576117956001600160a01b03831682611b1d565b61181c565b60405163a9059cbb60e01b81526001600160a01b0384169063a9059cbb906117c890859085906004016128dc565b602060405180830381600087803b1580156117e257600080fd5b505af11580156117f6573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061181a91906128f5565b505b7fd84a5c424a4f777bcf4f645712b8e5ebfc550f42bde444fa822fe98ee1b132b1338387878786604051611855969594939291906129b0565b60405180910390a150506001600255505050565b60008061188561187e61187b85610d6d565b90565b8585611dc4565b60008581526004602090815260408083206001600160a01b03881684529091529020549091506118b590826129ef565b949350505050565b6001600160a01b03163b151590565b60008054610100900460ff161561191a578160ff1660011480156118f657506118f4306118bd565b155b6119125760405162461bcd60e51b8152600401610a3a90612a06565b506000919050565b60005460ff8084169116106119415760405162461bcd60e51b8152600401610a3a90612a06565b506000805460ff191660ff92909216919091179055600190565b919050565b600080546001600160a01b038381166201000081810262010000600160b01b0319851617855560405193049190911692909183917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e091a35050565b600054610100900460ff166119e25760405162461bcd60e51b8152600401610a3a90612a54565b610d2e8282611ded565b600054610100900460ff16611a135760405162461bcd60e51b8152600401610a3a90612a54565b610d2e8282611e87565b600054610100900460ff16611a445760405162461bcd60e51b8152600401610a3a90612a54565b610d6b611eec565b600054610100900460ff16611a735760405162461bcd60e51b8152600401610a3a90612a54565b610d2e8282611f23565b600054610100900460ff16611aa45760405162461bcd60e51b8152600401610a3a90612a54565b610be981611f85565b60005b815181101561097057611af5838281518110611ace57611ace61278a565b6020026020010151838381518110611ae857611ae861278a565b6020026020010151611fd7565b80611aff816127ce565b915050611ab0565b611b12838383612046565b61097083838361210a565b80471015611b6d5760405162461bcd60e51b815260206004820152601d60248201527f416464726573733a20696e73756666696369656e742062616c616e63650000006044820152606401610a3a565b6000826001600160a01b03168260405160006040518083038185875af1925050503d8060008114611bba576040519150601f19603f3d011682016040523d82523d6000602084013e611bbf565b606091505b50509050806109705760405162461bcd60e51b815260206004820152603a60248201527f416464726573733a20756e61626c6520746f2073656e642076616c75652c20726044820152791958da5c1a595b9d081b585e481a185d99481c995d995c9d195960321b6064820152608401610a3a565b6003600854600160f01b900460ff166003811115611c5357611c53612518565b1415611c935760405162461bcd60e51b815260206004820152600f60248201526e15d2551211149055cbd313d0d2d151608a1b6044820152606401610a3a565b6002600854600160f01b900460ff166003811115611cb357611cb3612518565b1415611cbc5750565b6001600854600160f01b900460ff166003811115611cdc57611cdc612518565b1415611d40576008546001600160a01b03828116600160401b9092041614610be95760405162461bcd60e51b815260206004820152601760248201527615d2551211149055cbd3d3931657d49150d25412515395604a1b6044820152606401610a3a565b6000600854600160f01b900460ff166003811115611d6057611d60612518565b1415610be957806001600160a01b0316611d78610ec3565b6001600160a01b031614610be95760405162461bcd60e51b81526020600482015260136024820152722ba4aa24222920ab97a7a7262cafa7aba722a960691b6044820152606401610a3a565b600654600083815260076020526040812054909190611de39086612a9f565b6118b59190612abe565b600054610100900460ff16611e145760405162461bcd60e51b8152600401610a3a90612a54565b611e2463ac2ba33360e01b612155565b60088054600160401b600160e01b03198116600160401b6001600160a01b038616029081178355839291600160401b62ff000160e01b03191660ff60f01b1990911617600160f01b836003811115611e7e57611e7e612518565b02179055505050565b600054610100900460ff16611eae5760405162461bcd60e51b8152600401610a3a90612a54565b600380546001600160401b038316600160a01b026001600160e01b03199091166001600160a01b03851617179055610d2e631ba050e960e21b612155565b600054610100900460ff16611f135760405162461bcd60e51b8152600401610a3a90612a54565b610d6b631259990960e01b612155565b600054610100900460ff16611f4a5760405162461bcd60e51b8152600401610a3a90612a54565b8151815114611f6b5760405162461bcd60e51b8152600401610a3a9061287e565b611f758282611aad565b610d2e6333c7a33f60e11b612155565b600054610100900460ff16611fac5760405162461bcd60e51b8152600401610a3a90612a54565b600880546001600160401b0319166001600160401b038316179055610be96317b2ef4360e31b612155565b60008281526007602052604090208054908290556006548190611ffb9084906127b6565b61200591906129ef565b60065560408051848152602081018390529081018390527ff81b1f9d8b5d36a5a67d13006a8b091a9b63e2a38b331d315d99c6daefd2ddcc90606001610967565b6003546040516331a9108f60e11b8152600481018590526001600160a01b03838116921690636352211e9060240160206040518083038186803b15801561208c57600080fd5b505afa1580156120a0573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906120c49190612ae0565b6001600160a01b0316146109705760405162461bcd60e51b815260206004820152600d60248201526c2727aa2fa7232a2fa7aba722a960991b6044820152606401610a3a565b600854426001600160401b03909116106109705760405162461bcd60e51b815260206004820152600c60248201526b10d310525357d313d0d2d15160a21b6044820152606401610a3a565b6001600160e01b031980821614156121ae5760405162461bcd60e51b815260206004820152601c60248201527b115490cc4d8d4e881a5b9d985b1a59081a5b9d195c999858d9481a5960221b6044820152606401610a3a565b6001600160e01b0319166000908152600160208190526040909120805460ff19169091179055565b634e487b7160e01b600052604160045260246000fd5b60405160a081016001600160401b038111828210171561220e5761220e6121d6565b60405290565b6001600160a01b0381168114610be957600080fd5b803561195b81612214565b80356001600160401b038116811461195b57600080fd5b600082601f83011261225c57600080fd5b813560206001600160401b0380831115612278576122786121d6565b8260051b604051601f19603f8301168101818110848211171561229d5761229d6121d6565b6040529384528581018301938381019250878511156122bb57600080fd5b83870191505b848210156122da578135835291830191908301906122c1565b979650505050505050565b600080604083850312156122f857600080fd5b82356001600160401b038082111561230f57600080fd5b9084019060a0828703121561232357600080fd5b61232b6121ec565b823561233681612214565b815261234460208401612234565b602082015260408301358281111561235b57600080fd5b6123678882860161224b565b60408301525060608301358281111561237f57600080fd5b61238b8882860161224b565b60608301525061239d60808401612234565b608082015293506123b391505060208401612229565b90509250929050565b60008083601f8401126123ce57600080fd5b5081356001600160401b038111156123e557600080fd5b6020830191508360208260051b850101111561240057600080fd5b9250929050565b60008060006040848603121561241c57600080fd5b83356001600160401b0381111561243257600080fd5b61243e868287016123bc565b909450925050602084013561245281612214565b809150509250925092565b60006020828403121561246f57600080fd5b81356001600160e01b031981168114610ebc57600080fd5b600060208083528351808285015260005b818110156124b457858101830151858201604001528201612498565b818111156124c6576000604083870101525b50601f01601f1916929092016040019392505050565b6000602082840312156124ee57600080fd5b610ebc82612234565b60006020828403121561250957600080fd5b813560048110610ebc57600080fd5b634e487b7160e01b600052602160045260246000fd5b602081016004831061255057634e487b7160e01b600052602160045260246000fd5b91905290565b60006020828403121561256857600080fd5b5035919050565b6000806020838503121561258257600080fd5b82356001600160401b0381111561259857600080fd5b6125a4858286016123bc565b90969095509350505050565b6020808252825182820181905260009190848201906040850190845b818110156125e8578351835292840192918401916001016125cc565b50909695505050505050565b6000806040838503121561260757600080fd5b82359150602083013561261981612214565b809150509250929050565b60006020828403121561263657600080fd5b8135610ebc81612214565b6001600160a01b0391909116815260200190565b6000806040838503121561266857600080fd5b82356001600160401b038082111561267f57600080fd5b61268b8683870161224b565b935060208501359150808211156126a157600080fd5b506126ae8582860161224b565b9150509250929050565b600080600080604085870312156126ce57600080fd5b84356001600160401b03808211156126e557600080fd5b6126f1888389016123bc565b9096509450602087013591508082111561270a57600080fd5b50612717878288016123bc565b95989497509550505050565b6000806000806060858703121561273957600080fd5b84356001600160401b0381111561274f57600080fd5b61275b878288016123bc565b909550935050602085013561276f81612214565b9150604085013561277f81612214565b939692955090935050565b634e487b7160e01b600052603260045260246000fd5b634e487b7160e01b600052601160045260246000fd5b600082198211156127c9576127c96127a0565b500190565b60006000198214156127e2576127e26127a0565b5060010190565b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b6020808252600d908201526c10d3d3919251d7d313d0d2d151609a1b604082015260600190565b6020808252600690820152651313d0d2d15160d21b604082015260600190565b60006020828403121561287757600080fd5b5051919050565b6020808252600d908201526c082a48ea6be9a92a69a82a8869609b1b604082015260600190565b6020808252601f908201527f5265656e7472616e637947756172643a207265656e7472616e742063616c6c00604082015260600190565b6001600160a01b03929092168252602082015260400190565b60006020828403121561290757600080fd5b81518015158114610ebc57600080fd5b81835260006001600160fb1b0383111561293057600080fd5b8260051b8083602087013760009401602001938452509192915050565b6040808252810184905260008560608301825b8781101561299057823561297381612214565b6001600160a01b0316825260209283019290910190600101612960565b5083810360208501526129a4818688612917565b98975050505050505050565b600060018060a01b038089168352808816602084015260a060408401526129db60a084018789612917565b941660608301525060800152949350505050565b600082821015612a0157612a016127a0565b500390565b6020808252602e908201527f496e697469616c697a61626c653a20636f6e747261637420697320616c72656160408201526d191e481a5b9a5d1a585b1a5e995960921b606082015260800190565b6020808252602b908201527f496e697469616c697a61626c653a20636f6e7472616374206973206e6f74206960408201526a6e697469616c697a696e6760a81b606082015260800190565b6000816000190483118215151615612ab957612ab96127a0565b500290565b600082612adb57634e487b7160e01b600052601260045260246000fd5b500490565b600060208284031215612af257600080fd5b8151610ebc8161221456fea2646970667358221220bbc37d14db2385a067817be1670db1da3ae2f165a5899ecea462614fe5b255bb64736f6c6343000809003300000000000000000000000000000000000000000000000000000000000000200000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000a000000000000000000000000000000000000000000000000000000000000000c0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000

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

00000000000000000000000000000000000000000000000000000000000000200000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000a000000000000000000000000000000000000000000000000000000000000000c0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000

-----Decoded View---------------
Arg [0] : config (tuple): System.Collections.Generic.List`1[Nethereum.ABI.FunctionEncoding.ParameterOutput]

-----Encoded View---------------
8 Constructor Arguments found :
Arg [0] : 0000000000000000000000000000000000000000000000000000000000000020
Arg [1] : 0000000000000000000000000000000000000000000000000000000000000000
Arg [2] : 0000000000000000000000000000000000000000000000000000000000000000
Arg [3] : 00000000000000000000000000000000000000000000000000000000000000a0
Arg [4] : 00000000000000000000000000000000000000000000000000000000000000c0
Arg [5] : 0000000000000000000000000000000000000000000000000000000000000000
Arg [6] : 0000000000000000000000000000000000000000000000000000000000000000
Arg [7] : 0000000000000000000000000000000000000000000000000000000000000000


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