ETH Price: $3,100.27 (-0.36%)
Gas: 2 Gwei

Contract

0x8Ca2495c0f81d2F1C56a7E6c02181ae3a30475A7
 

Overview

ETH Balance

0 ETH

Eth Value

$0.00

Multichain Info

No addresses found
Transaction Hash
Method
Block
From
To
Value
Transfer Ownersh...175839272023-06-29 9:00:35377 days ago1688029235IN
0x8Ca2495c...3a30475A7
0 ETH0.0005119317.95118202
Set Storage Regi...173779192023-05-31 9:18:59406 days ago1685524739IN
0x8Ca2495c...3a30475A7
0 ETH0.0014684230.88299164
0x60806040173779102023-05-31 9:17:11406 days ago1685524631IN
 Create: Swap
0 ETH0.0935117131.28447889

View more zero value Internal Transactions in Advanced View mode

Advanced mode:
Loading...
Loading

Contract Source Code Verified (Exact Match)

Contract Name:
Swap

Compiler Version
v0.8.9+commit.e5eed63a

Optimization Enabled:
Yes with 20000 runs

Other Settings:
default evmVersion
File 1 of 10 : Swap.sol
// SPDX-License-Identifier: UNLICENSED
pragma solidity 0.8.9;

import { Ownable } from "@openzeppelin/contracts/access/Ownable.sol";
import { ISwap } from "./Interfaces/ISwap.sol";
import { IVault } from "./Interfaces/IVault.sol";
import { IStorageRegistry } from "./Interfaces/IStorageRegistry.sol";
import { ISigningUtils } from "./Interfaces/lib/ISigningUtils.sol";
import { ValidationUtils } from "./lib/ValidationUtils.sol";
import "../utils/DataTypes.sol";

/// @title NF3 Swap
/// @author NF3 Exchange
/// @notice This contract inherits from ISwap interface.
/// @dev Functions in this contract are not public callable. They can only be called through the public facing contract(NF3Proxy).
/// @dev This contract has the functions related to all types of swaps.

contract Swap is ISwap, Ownable {
    /// -----------------------------------------------------------------------
    /// Library Usage
    /// -----------------------------------------------------------------------

    using ValidationUtils for *;

    /// -----------------------------------------------------------------------
    /// Storage variables
    /// -----------------------------------------------------------------------

    /// @notice Storage registry contract address
    address public storageRegistryAddress;

    /// -----------------------------------------------------------------------
    /// Modifiers
    /// -----------------------------------------------------------------------

    modifier onlyMarket() {
        _onlyMarket();
        _;
    }

    /// -----------------------------------------------------------------------
    /// Cancel Actions
    /// -----------------------------------------------------------------------

    /// @notice Inherit from ISwap
    function cancelListing(
        Listing calldata _listing,
        bytes memory _signature,
        address _user
    ) external override onlyMarket {
        address _storageRegistryAddress = storageRegistryAddress;

        // Verify signature.
        ISigningUtils(_signingUtilsAddress(_storageRegistryAddress))
            .verifyListingSignature(_listing, _signature);

        // Should be called by the listing owner.
        _listing.owner.itemOwnerOnly(_user);

        _checkNonce(_listing.owner, _listing.nonce, _storageRegistryAddress);

        _setNonce(_listing.owner, _listing.nonce, _storageRegistryAddress);

        emit ListingCancelled(_listing);
    }

    /// @notice Inherit from ISwap
    function cancelSwapOffer(
        SwapOffer calldata _offer,
        bytes memory _signature,
        address _user
    ) external override onlyMarket {
        address _storageRegistryAddress = storageRegistryAddress;

        // Verify signature.
        ISigningUtils(_signingUtilsAddress(_storageRegistryAddress))
            .verifySwapOfferSignature(_offer, _signature);

        // Should be called by the offer owner.
        _offer.owner.itemOwnerOnly(_user);

        _checkNonce(_offer.owner, _offer.nonce, _storageRegistryAddress);

        _setNonce(_offer.owner, _offer.nonce, _storageRegistryAddress);

        emit SwapOfferCancelled(_offer);
    }

    /// @notice Inherit from ISwap
    function cancelCollectionSwapOffer(
        CollectionSwapOffer calldata _offer,
        bytes memory _signature,
        address _user
    ) external override onlyMarket {
        address _storageRegistryAddress = storageRegistryAddress;

        // Verify signature.
        ISigningUtils(_signingUtilsAddress(_storageRegistryAddress))
            .verifyCollectionSwapOfferSignature(_offer, _signature);

        // Should be called by the offer owner.
        _offer.owner.itemOwnerOnly(_user);

        _checkNonce(_offer.owner, _offer.nonce, _storageRegistryAddress);

        _setNonce(_offer.owner, _offer.nonce, _storageRegistryAddress);

        emit CollectionSwapOfferCancelled(_offer);
    }

    /// -----------------------------------------------------------------------
    /// Swap Actions
    /// -----------------------------------------------------------------------

    /// @notice Inherit from ISwap
    function directSwap(
        Listing calldata _listing,
        bytes memory _signature,
        uint256 _swapId,
        address _user,
        SwapParams memory swapParams,
        uint256 _value,
        Royalty calldata _royalty,
        Fees calldata sellerFees,
        Fees calldata buyerFees
    ) external override onlyMarket {
        address _storageRegistryAddress = storageRegistryAddress;

        {
            // Verify signature, nonce and expiration.
            ISigningUtils(_signingUtilsAddress(_storageRegistryAddress))
                .verifyListingSignature(_listing, _signature);

            _checkNonce(
                _listing.owner,
                _listing.nonce,
                _storageRegistryAddress
            );

            checkExpiration(_listing.timePeriod);

            // check if called by eligible contract
            address intendedFor = _listing.tradeIntendedFor;
            if (!(intendedFor == address(0) || intendedFor == _user)) {
                revert SwapError(
                    SwapErrorCodes.INTENDED_FOR_PEER_TO_PEER_TRADE
                );
            }

            // Seller should not buy his own listing.
            _listing.owner.notItemOwner(_user);
        }

        // Verify swap option with swapId exist.
        SwapAssets memory swapAssets = swapExists(
            _listing.directSwaps,
            _swapId
        );

        // Verfy incoming assets to be the same.
        Assets memory offeredAssets = swapAssets.verifySwapAssets(
            swapParams.tokens,
            swapParams.tokenIds,
            swapParams.proofs,
            _value
        );
        // to prevent stack too deep
        Listing calldata listing = _listing;

        {
            address vaultAddress = _vaultAddress(_storageRegistryAddress);

            // Exchange the assets.
            IVault(vaultAddress).transferAssets(
                listing.listingAssets,
                listing.owner,
                _user,
                _royalty,
                false
            );

            IVault(vaultAddress).transferAssets(
                offeredAssets,
                _user,
                listing.owner,
                listing.royalty,
                true
            );

            // transfer fees
            IVault(vaultAddress).transferFees(
                sellerFees,
                listing.owner,
                buyerFees,
                _user
            );
        }

        // Update the nonce.
        _setNonce(listing.owner, listing.nonce, _storageRegistryAddress);

        emit DirectSwapped(listing, offeredAssets, _swapId, _user);
    }

    /// @notice Inherit from ISwap
    function acceptUnlistedDirectSwapOffer(
        SwapOffer calldata _offer,
        bytes memory _signature,
        Assets calldata _consideration,
        bytes32[] calldata _proof,
        address _user,
        uint256 _value,
        Royalty calldata _royalty,
        Fees calldata sellerFees,
        Fees calldata buyerFees
    ) external override onlyMarket {
        address _storageRegistryAddress = storageRegistryAddress;

        {
            // Verify signature, nonce and expiration.
            ISigningUtils(_signingUtilsAddress(_storageRegistryAddress))
                .verifySwapOfferSignature(_offer, _signature);

            _checkNonce(_offer.owner, _offer.nonce, _storageRegistryAddress);

            checkExpiration(_offer.timePeriod);

            // Seller should not accept his own offer.
            _offer.owner.notItemOwner(_user);

            // Verify incomming assets to be present in the merkle root.
            _offer.considerationRoot.verifyAssetProof(_consideration, _proof);

            // Check if enough eth amount is sent.
            _consideration.checkEthAmount(_value);
        }

        // to prevent stack too deep
        SwapOffer calldata offer = _offer;

        {
            address vaultAddress = _vaultAddress(_storageRegistryAddress);

            // Exchange the assets.
            IVault(vaultAddress).transferAssets(
                offer.offeringItems,
                offer.owner,
                _user,
                _royalty,
                false
            );

            IVault(vaultAddress).transferAssets(
                _consideration,
                _user,
                offer.owner,
                offer.royalty,
                true
            );

            // transfer fees
            IVault(vaultAddress).transferFees(
                sellerFees,
                _user,
                buyerFees,
                offer.owner
            );
        }

        // Update the nonce.
        _setNonce(offer.owner, offer.nonce, _storageRegistryAddress);

        emit UnlistedSwapOfferAccepted(offer, _consideration, _user);
    }

    /// @notice Inherit from ISwap
    function acceptListedDirectSwapOffer(
        Listing calldata _listing,
        bytes memory _listingSignature,
        SwapOffer calldata _offer,
        bytes memory _offerSignature,
        bytes32[] calldata _proof,
        address _user,
        Fees calldata sellerFees,
        Fees calldata buyerFees
    ) external override onlyMarket {
        address _storageRegistryAddress = storageRegistryAddress;

        {
            address __signingUtilsAddress = _signingUtilsAddress(
                _storageRegistryAddress
            );

            // Verify listing signature, nonce and expiration.
            ISigningUtils(__signingUtilsAddress).verifyListingSignature(
                _listing,
                _listingSignature
            );

            _checkNonce(
                _listing.owner,
                _listing.nonce,
                _storageRegistryAddress
            );

            checkExpiration(_listing.timePeriod);

            // Verify offer signature, nonce and expiration.
            ISigningUtils(__signingUtilsAddress).verifySwapOfferSignature(
                _offer,
                _offerSignature
            );

            _checkNonce(_offer.owner, _offer.nonce, _storageRegistryAddress);

            checkExpiration(_offer.timePeriod);

            // Should be called by listing owner.
            _listing.owner.itemOwnerOnly(_user);

            // Should not be called by the offer owner.
            _offer.owner.notItemOwner(_user);

            // Verify lisitng assets to be present in the offer's merkle root.
            _offer.considerationRoot.verifyAssetProof(
                _listing.listingAssets,
                _proof
            );
        }
        {
            address vaultAddress = _vaultAddress(_storageRegistryAddress);
            // Exchange the assets.
            IVault(vaultAddress).transferAssets(
                _listing.listingAssets,
                _listing.owner,
                _offer.owner,
                _offer.royalty,
                false
            );
            IVault(vaultAddress).transferAssets(
                _offer.offeringItems,
                _offer.owner,
                _listing.owner,
                _listing.royalty,
                false
            );

            // transfer fees
            IVault(vaultAddress).transferFees(
                sellerFees,
                _listing.owner,
                buyerFees,
                _offer.owner
            );
        }

        // Update the nonce.
        _setNonce(_listing.owner, _listing.nonce, _storageRegistryAddress);
        _setNonce(_offer.owner, _offer.nonce, _storageRegistryAddress);

        emit ListedSwapOfferAccepted(_listing, _offer, _user);
    }

    /// @notice Inherit from ISwap
    function acceptCollectionSwapOffer(
        CollectionSwapOffer calldata _offer,
        bytes memory _signature,
        SwapParams memory swapParams,
        address _user,
        uint256 _value,
        Royalty calldata _royalty,
        Fees calldata sellerFees,
        Fees calldata buyerFees
    ) external override onlyMarket {
        address _storageRegistryAddress = storageRegistryAddress;
        {
            // Verify signature, nonce and expiration.
            ISigningUtils(_signingUtilsAddress(_storageRegistryAddress))
                .verifyCollectionSwapOfferSignature(_offer, _signature);

            _checkNonce(_offer.owner, _offer.nonce, _storageRegistryAddress);

            checkExpiration(_offer.timePeriod);

            // Seller must not be offer owner.
            _offer.owner.notItemOwner(_user);
        }

        // Verify incomming assets to be the same as consideration items.
        Assets memory offeredAssets = _offer
            .considerationItems
            .verifySwapAssets(
                swapParams.tokens,
                swapParams.tokenIds,
                swapParams.proofs,
                _value
            );

        {
            address vaultAddress = _vaultAddress(_storageRegistryAddress);

            // Exchange the assets.
            IVault(vaultAddress).transferAssets(
                _offer.offeringItems,
                _offer.owner,
                _user,
                _royalty,
                false
            );
            IVault(vaultAddress).transferAssets(
                offeredAssets,
                _user,
                _offer.owner,
                _offer.royalty,
                true
            );

            // transfer fees
            IVault(vaultAddress).transferFees(
                sellerFees,
                _user,
                buyerFees,
                _offer.owner
            );
        }

        // Update the nonce.
        _setNonce(_offer.owner, _offer.nonce, _storageRegistryAddress);
        emit CollectionSwapOfferAccepted(_offer, offeredAssets, _user);
    }

    /// -----------------------------------------------------------------------
    /// Owner actions
    /// -----------------------------------------------------------------------

    /// @notice Inherit from ISwap
    function setStorageRegistry(address _storageRegistryAddress)
        external
        override
        onlyOwner
    {
        if (_storageRegistryAddress == address(0)) {
            revert SwapError(SwapErrorCodes.INVALID_ADDRESS);
        }

        emit StorageRegistrySet(
            _storageRegistryAddress,
            storageRegistryAddress
        );

        storageRegistryAddress = _storageRegistryAddress;
    }

    /// -----------------------------------------------------------------------
    /// Internal functions
    /// -----------------------------------------------------------------------

    /// @dev Check if the give nonce is valid or not
    /// @param _user address of the user
    /// @param _nonce actual nonce to check
    /// @param _storageRegistryAddress memoized storage registry address
    function _checkNonce(
        address _user,
        uint256 _nonce,
        address _storageRegistryAddress
    ) internal view {
        IStorageRegistry(_storageRegistryAddress).checkNonce(_user, _nonce);
    }

    /// @dev Set the given nonce as used
    /// @param _user address of the user
    /// @param _nonce actual nonce to set
    /// @param _storageRegistryAddress memoized storage registry address
    function _setNonce(
        address _user,
        uint256 _nonce,
        address _storageRegistryAddress
    ) internal {
        IStorageRegistry(_storageRegistryAddress).setNonce(_user, _nonce);
    }

    /// @dev Check if the swap option with given swap id exist or not.
    /// @param _swaps All the swap options
    /// @param _swapId Swap id to be checked
    /// @return swap Swap assets at given index
    function swapExists(SwapAssets[] calldata _swaps, uint256 _swapId)
        internal
        pure
        returns (SwapAssets calldata)
    {
        if (_swaps.length <= _swapId) {
            revert SwapError(SwapErrorCodes.OPTION_DOES_NOT_EXIST);
        }
        return _swaps[_swapId];
    }

    /// @dev Check if the item has expired.
    /// @param _timePeriod Expiration time
    function checkExpiration(uint256 _timePeriod) internal view {
        if (_timePeriod < block.timestamp) {
            revert SwapError(SwapErrorCodes.ITEM_EXPIRED);
        }
    }

    /// @dev internal function to check if the caller is market or not
    function _onlyMarket() internal view {
        address marketAddress = IStorageRegistry(storageRegistryAddress)
            .marketAddress();
        if (msg.sender != marketAddress) {
            revert SwapError(SwapErrorCodes.NOT_MARKET);
        }
    }

    /// @dev internal function to get vault address from storage registry contract
    /// @param _storageRegistryAddress  memoized storage registry address
    function _vaultAddress(address _storageRegistryAddress)
        internal
        view
        returns (address)
    {
        return IStorageRegistry(_storageRegistryAddress).vaultAddress();
    }

    /// @dev internal function to get signing utils library address from storage registry
    /// @param _storageRegistryAddress memoized storage registry address
    function _signingUtilsAddress(address _storageRegistryAddress)
        internal
        view
        returns (address)
    {
        return IStorageRegistry(_storageRegistryAddress).signingUtilsAddress();
    }
}

File 2 of 10 : Ownable.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.7.0) (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 Throws if called by any account other than the owner.
     */
    modifier onlyOwner() {
        _checkOwner();
        _;
    }

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

    /**
     * @dev Throws if the sender is not the owner.
     */
    function _checkOwner() internal view virtual {
        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 3 of 10 : ISwap.sol
// SPDX-License-Identifier: UNLICENSED
pragma solidity 0.8.9;

import "../../utils/DataTypes.sol";

/// @title NF3 Swap Interface
/// @author NF3 Exchange
/// @dev This interface defines all the functions related to swap features of the platform.

interface ISwap {
    /// -----------------------------------------------------------------------
    /// Errors
    /// -----------------------------------------------------------------------

    enum SwapErrorCodes {
        NOT_MARKET,
        INTENDED_FOR_PEER_TO_PEER_TRADE,
        INVALID_ADDRESS,
        OPTION_DOES_NOT_EXIST,
        ITEM_EXPIRED
    }

    error SwapError(SwapErrorCodes code);

    /// -----------------------------------------------------------------------
    /// Events
    /// -----------------------------------------------------------------------

    /// @dev Emits when listing has cancelled.
    /// @param listing Listing assets, details and seller's info
    event ListingCancelled(Listing listing);

    /// @dev Emits when swap offer has cancelled.
    /// @param offer Offer information
    event SwapOfferCancelled(SwapOffer offer);

    /// @dev Emits when collection offer has cancelled.
    /// @param offer Offer information
    event CollectionSwapOfferCancelled(CollectionSwapOffer offer);

    /// @dev Emits when direct swap has happened.
    /// @param listing Listing assets, details and seller's info
    /// @param offeredAssets Assets offered by the buyer
    /// @param swapId Swap id
    /// @param user Address of the buyer
    event DirectSwapped(
        Listing listing,
        Assets offeredAssets,
        uint256 swapId,
        address indexed user
    );

    /// @dev Emits when swap offer has been accepted by the user.
    /// @param offer Swap offer assets and details
    /// @param considerationItems Assets given by the user
    /// @param user Address of the user who accepted the offer
    event UnlistedSwapOfferAccepted(
        SwapOffer offer,
        Assets considerationItems,
        address indexed user
    );

    /// @dev Emits when swap offer has been accepted by a listing owner.
    /// @param listing Listing assets info
    /// @param offer Swap offer info
    /// @param user Listing owner
    event ListedSwapOfferAccepted(
        Listing listing,
        SwapOffer offer,
        address indexed user
    );

    /// @dev Emits when collection swap offer has accepted by the seller.
    /// @param offer Collection offer assets and details
    /// @param considerationItems Assets given by the seller
    /// @param user Address of the buyer
    event CollectionSwapOfferAccepted(
        CollectionSwapOffer offer,
        Assets considerationItems,
        address indexed user
    );

    /// @dev Emits when new storage registry address has set.
    /// @param oldStorageRegistry Previous market contract address
    /// @param newStorageRegistry New market contract address
    event StorageRegistrySet(
        address oldStorageRegistry,
        address newStorageRegistry
    );

    /// -----------------------------------------------------------------------
    /// Cancel Actions
    /// -----------------------------------------------------------------------

    /// @dev Cancel listing.
    /// @param listing Listing parameters
    /// @param signature Signature of the listing parameters
    /// @param user Listing owner
    function cancelListing(
        Listing calldata listing,
        bytes memory signature,
        address user
    ) external;

    /// @dev Cancel Swap offer.
    /// @param offer Collection offer patameter
    /// @param signature Signature of the offer patameters
    /// @param user Collection offer owner
    function cancelSwapOffer(
        SwapOffer calldata offer,
        bytes memory signature,
        address user
    ) external;

    /// @dev Cancel collection level offer.
    /// @param offer Collection offer patameter
    /// @param signature Signature of the offer patameters
    /// @param user Collection offer owner
    function cancelCollectionSwapOffer(
        CollectionSwapOffer calldata offer,
        bytes memory signature,
        address user
    ) external;

    /// -----------------------------------------------------------------------
    /// Swap Actions
    /// -----------------------------------------------------------------------

    /// @dev Direct swap of bundle of NFTs + FTs with other bundles.
    /// @param listing Listing assets and details
    /// @param signature Signature as a proof of listing
    /// @param swapId Index of swap option being used
    /// @param value Eth value sent in the function call
    /// @param royalty Buyer's royalty info
    function directSwap(
        Listing calldata listing,
        bytes memory signature,
        uint256 swapId,
        address user,
        SwapParams memory swapParams,
        uint256 value,
        Royalty calldata royalty,
        Fees calldata sellerFees,
        Fees calldata buyerFees
    ) external;

    /// @dev Accpet unlisted direct swap offer.
    /// @dev User should see the swap offer and accpet that offer.
    /// @param offer Multi offer assets and details
    /// @param signature Signature as a proof of offer
    /// @param consideration Consideration assets been provided by the user
    /// @param proof Merkle proof that the considerationItems is valid
    /// @param user Address of the user who accepted this offer
    /// @param royalty Seller's royalty info
    function acceptUnlistedDirectSwapOffer(
        SwapOffer calldata offer,
        bytes memory signature,
        Assets calldata consideration,
        bytes32[] calldata proof,
        address user,
        uint256 value,
        Royalty calldata royalty,
        Fees calldata sellerFees,
        Fees calldata buyerFees
    ) external;

    /// @dev Accept listed direct swap offer.
    /// @dev Only listing owner should accept that offer.
    /// @param listing Listing assets and parameters
    /// @param listingSignature Signature as a proof of listing
    /// @param offer Offering assets and parameters
    /// @param offerSignature Signature as a proof of offer
    /// @param proof Mekrle proof that the listed assets are valid
    /// @param user Listing owner
    function acceptListedDirectSwapOffer(
        Listing calldata listing,
        bytes memory listingSignature,
        SwapOffer calldata offer,
        bytes memory offerSignature,
        bytes32[] calldata proof,
        address user,
        Fees calldata sellerFees,
        Fees calldata buyerFees
    ) external;

    /// @dev Accept collection offer.
    /// @dev Anyone who holds the consideration assets can accpet this offer.
    /// @param offer Collection offer assets and details
    /// @param signature Signature as a proof of offer
    /// @param user Seller address
    /// @param value Eth value send in the function call
    /// @param royalty Seller's royalty info
    function acceptCollectionSwapOffer(
        CollectionSwapOffer memory offer,
        bytes memory signature,
        SwapParams memory swapParams,
        address user,
        uint256 value,
        Royalty calldata royalty,
        Fees calldata sellerFees,
        Fees calldata buyerFees
    ) external;

    /// -----------------------------------------------------------------------
    /// Owner actions
    /// -----------------------------------------------------------------------

    /// @dev Set Storage registry contract address.
    /// @param _storageRegistryAddress storage registry contract address
    function setStorageRegistry(address _storageRegistryAddress) external;
}

File 4 of 10 : IVault.sol
// SPDX-License-Identifier: UNLICENSED
pragma solidity 0.8.9;

import "../../utils/DataTypes.sol";

/// @title NF3 Vault Interface
/// @author NF3 Exchange
/// @dev This interface defines all the functions related to assets transfer and assets escrow.

interface IVault {
    /// -----------------------------------------------------------------------
    /// Errors
    /// -----------------------------------------------------------------------

    enum VaultErrorCodes {
        CALLER_NOT_APPROVED,
        FAILED_TO_SEND_ETH,
        ETH_NOT_ALLOWED,
        INVALID_ASSET_TYPE,
        COULD_NOT_RECEIVE_KITTY,
        COULD_NOT_SEND_KITTY,
        INVALID_PUNK,
        COULD_NOT_RECEIVE_PUNK,
        COULD_NOT_SEND_PUNK,
        INVALID_ADDRESS,
        COULD_NOT_TRANSFER_SELLER_FEES,
        COULD_NOT_TRANSFER_BUYER_FEES
    }

    error VaultError(VaultErrorCodes code);

    /// -----------------------------------------------------------------------
    /// Events
    /// -----------------------------------------------------------------------

    /// @dev Emits when the assets have transferred.
    /// @param assets Assets
    /// @param from Sender address
    /// @param to Receiver address
    event AssetsTransferred(Assets assets, address from, address to);

    /// @dev Emits when the assets have been received by the vault.
    /// @param assets Assets
    /// @param from Sender address
    event AssetsReceived(Assets assets, address from);

    /// @dev Emits when the assets have been sent by the vault.
    /// @param assets Assets
    /// @param to Receiver address
    event AssetsSent(Assets assets, address to);

    /// @dev Emits when new storage registry address has set.
    /// @param oldStorageRegistryAddress Previous storage registry contract address
    /// @param newStorageRegistryAddress New storage registry contract address
    event StorageRegistrySet(
        address oldStorageRegistryAddress,
        address newStorageRegistryAddress
    );

    /// @dev Emits when fee is paid in a trade or reservation
    /// @param sellerFee Fee paid from seller's end
    /// @param seller address of the seller
    /// @param buyerFee Fee paid from buyer's end
    /// @param buyer address of the buyer
    event FeesPaid(
        Fees sellerFee,
        address seller,
        Fees buyerFee,
        address buyer
    );

    /// -----------------------------------------------------------------------
    /// Transfer actions
    /// -----------------------------------------------------------------------

    /// @dev Transfer the assets "assets" from "from" to "to".
    /// @param assets Assets to be transfered
    /// @param from Sender address
    /// @param to Receiver address
    /// @param royalty Royalty info
    /// @param allowEth Bool variable if can send ETH or not
    function transferAssets(
        Assets calldata assets,
        address from,
        address to,
        Royalty calldata royalty,
        bool allowEth
    ) external;

    /// @dev Receive assets "assets" from "from" address to the vault
    /// @param assets Assets to be transfered
    /// @param from Sender address
    function receiveAssets(
        Assets calldata assets,
        address from,
        bool allowEth
    ) external;

    /// @dev Send assets "assets" from the vault to "_to" address
    /// @param assets Assets to be transfered
    /// @param to Receiver address
    /// @param royalty Royalty info
    function sendAssets(
        Assets calldata assets,
        address to,
        Royalty calldata royalty,
        bool allowEth
    ) external;

    /// @dev Transfer fees from seller and buyer to the mentioned addresses
    /// @param sellerFees Fees to be taken from the seller
    /// @param buyerFees Fees to be taken from the buyer
    /// @param seller Seller's address
    /// @param buyer Buyer's address
    function transferFees(
        Fees calldata sellerFees,
        address seller,
        Fees calldata buyerFees,
        address buyer
    ) external;

    /// -----------------------------------------------------------------------
    /// Owner actions
    /// -----------------------------------------------------------------------

    /// @dev Set Storage registry contract address
    /// @param _storageRegistryAddress storage registry contract address
    function setStorageRegistry(address _storageRegistryAddress) external;

    /// @dev Set upper limit for fee that can be deducted
    /// @param tokens Addresses of payment tokens for fees
    /// @param caps Upper limit for payment tokens respectively
    function setFeeCap(address[] memory tokens, uint256[] memory caps) external;
}

File 5 of 10 : IStorageRegistry.sol
// SPDX-License-Identifier: UNLICENSED
pragma solidity 0.8.9;

/// @title NF3 Storage Registry Interface
/// @author NF3 Exchange
/// @dev This interface defines all the functions related to storage for the protocol.

interface IStorageRegistry {
    /// -----------------------------------------------------------------------
    /// Errors
    /// -----------------------------------------------------------------------
    enum StorageRegistryErrorCodes {
        INVALID_NONCE,
        CALLER_NOT_APPROVED,
        INVALID_ADDRESS
    }

    error StorageRegistryError(StorageRegistryErrorCodes code);

    /// -----------------------------------------------------------------------
    /// Events
    /// -----------------------------------------------------------------------

    /// @dev Emits when status has changed.
    /// @param owner user whose nonce is updated
    /// @param nonce value of updated nonce
    event NonceSet(address owner, uint256 nonce);

    /// @dev Emits when new market address has set.
    /// @param oldMarketAddress Previous market contract address
    /// @param newMarketAddress New market contract address
    event MarketSet(address oldMarketAddress, address newMarketAddress);

    /// @dev Emits when new reserve address has set.
    /// @param oldVaultAddress Previous vault contract address
    /// @param newVaultAddress New vault contract address
    event VaultSet(address oldVaultAddress, address newVaultAddress);

    /// @dev Emits when new reserve address has set.
    /// @param oldReserveAddress Previous reserve contract address
    /// @param newReserveAddress New reserve contract address
    event ReserveSet(address oldReserveAddress, address newReserveAddress);

    /// @dev Emits when new whitelist contract address has set
    /// @param oldWhitelistAddress Previous whitelist contract address
    /// @param newWhitelistAddress New whitelist contract address
    event WhitelistSet(
        address oldWhitelistAddress,
        address newWhitelistAddress
    );

    /// @dev Emits when new swap address has set.
    /// @param oldSwapAddress Previous swap contract address
    /// @param newSwapAddress New swap contract address
    event SwapSet(address oldSwapAddress, address newSwapAddress);

    /// @dev Emits when new loan contract address has set
    /// @param oldLoanAddress Previous loan contract address
    /// @param newLoanAddress New whitelist contract address
    event LoanSet(address oldLoanAddress, address newLoanAddress);

    /// @dev Emits when airdrop claim implementation address is set
    /// @param oldAirdropClaimImplementation Previous air drop claim implementation address
    /// @param newAirdropClaimImplementation New air drop claim implementation address
    event AirdropClaimImplementationSet(
        address oldAirdropClaimImplementation,
        address newAirdropClaimImplementation
    );

    /// @dev Emits when signing utils library address is set
    /// @param oldSigningUtilsAddress Previous air drop claim implementation address
    /// @param newSigningUtilsAddress New air drop claim implementation address
    event SigningUtilSet(
        address oldSigningUtilsAddress,
        address newSigningUtilsAddress
    );

    /// @dev Emits when new position token address has set.
    /// @param oldPositionTokenAddress Previous position token contract address
    /// @param newPositionTokenAddress New position token contract address
    event PositionTokenSet(
        address oldPositionTokenAddress,
        address newPositionTokenAddress
    );

    /// -----------------------------------------------------------------------
    /// Nonce actions
    /// -----------------------------------------------------------------------

    /// @dev Get the value of nonce without reverting.
    /// @param owner Owner address
    /// @param _nonce Nonce value
    function getNonce(address owner, uint256 _nonce)
        external
        view
        returns (bool);

    /// @dev Check if the nonce is in correct status.
    /// @param owner Owner address
    /// @param _nonce Nonce value
    function checkNonce(address owner, uint256 _nonce) external view;

    /// @dev Set the nonce value of a user. Can only be called by reserve contract.
    /// @param owner Address of the user
    /// @param _nonce Nonce value of the user
    function setNonce(address owner, uint256 _nonce) external;

    /// -----------------------------------------------------------------------
    /// Owner actions
    /// -----------------------------------------------------------------------

    /// @dev Set Market contract address.
    /// @param _marketAddress Market contract address
    function setMarket(address _marketAddress) external;

    /// @dev Set Vault contract address.
    /// @param _vaultAddress Vault contract address
    function setVault(address _vaultAddress) external;

    /// @dev Set Reserve contract address.
    /// @param _reserveAddress Reserve contract address
    function setReserve(address _reserveAddress) external;

    /// @dev Set Whitelist contract address.
    /// @param _whitelistAddress contract address
    function setWhitelist(address _whitelistAddress) external;

    /// @dev Set Swap contract address.
    /// @param _swapAddress Swap contract address
    function setSwap(address _swapAddress) external;

    /// @dev Set Loan contract address
    /// @param _loanAddress Whitelist contract address
    function setLoan(address _loanAddress) external;

    /// @dev Set Signing Utils library address
    /// @param _signingUtilsAddress signing utils contract address
    function setSigningUtil(address _signingUtilsAddress) external;

    /// @dev Set air drop claim contract implementation address
    /// @param _airdropClaimImplementation Airdrop claim contract address
    function setAirdropClaimImplementation(address _airdropClaimImplementation)
        external;

    /// @dev Set position token contract address
    /// @param _positionTokenAddress position token contract address
    function setPositionToken(address _positionTokenAddress) external;

    /// @dev Whitelist airdrop contract that can be called for the user
    /// @param _contract address of the airdrop contract
    /// @param _allow bool value for the whitelist
    function setAirdropWhitelist(address _contract, bool _allow) external;

    /// @notice Set claim contract address for position token
    /// @param _tokenId Token id for which the claim contract is deployed
    /// @param _claimContract address of the claim contract
    function setClaimContractAddresses(uint256 _tokenId, address _claimContract)
        external;

    /// -----------------------------------------------------------------------
    /// Public Getter Functions
    /// -----------------------------------------------------------------------

    /// @dev Get whitelist contract address
    function whitelistAddress() external view returns (address);

    /// @dev Get vault contract address
    function vaultAddress() external view returns (address);

    /// @dev Get swap contract address
    function swapAddress() external view returns (address);

    /// @dev Get reserve contract address
    function reserveAddress() external view returns (address);

    /// @dev Get market contract address
    function marketAddress() external view returns (address);

    /// @dev Get loan contract address
    function loanAddress() external view returns (address);

    /// @dev Get airdropClaim contract address
    function airdropClaimImplementation() external view returns (address);

    /// @dev Get signing utils contract address
    function signingUtilsAddress() external view returns (address);

    /// @dev Get position token contract address
    function positionTokenAddress() external view returns (address);

    /// @dev Get claim contract address
    function claimContractAddresses(uint256 _tokenId)
        external
        view
        returns (address);

    /// @dev Get whitelist of an airdrop contract
    function airdropWhitelist(address _contract) external view returns (bool);
}

File 6 of 10 : ISigningUtils.sol
// SPDX-License-Identifier: UNLICENSED
pragma solidity 0.8.9;

import "../../../utils/DataTypes.sol";
import "../../../utils/LoanDataTypes.sol";

interface ISigningUtils {
    /// -----------------------------------------------------------------------
    /// Errors
    /// -----------------------------------------------------------------------

    enum SigningUtilsErrorCodes {
        INVALID_LISTING_SIGNATURE,
        INVALID_SWAP_OFFER_SIGNATURE,
        INVALID_COLLECTION_SWAP_OFFER_SIGNATURE,
        INVALID_RESERVE_OFFER_SIGNATURE,
        INVALID_COLLECTION_RESERVE_OFFER_SIGNATURE,
        INVALID_LOAN_OFFER_SIGNATURE,
        INVALID_COLLECTION_LOAN_OFFER_SIGNATURE,
        INVALID_UPDATE_LOAN_OFFER_SIGNATURE
    }

    error SigningUtilsError(SigningUtilsErrorCodes code);

    /// -----------------------------------------------------------------------
    /// Signature Verification Actions
    /// -----------------------------------------------------------------------

    /// @dev Check the signature if the listing info is valid or not.
    /// @param _listing Listing info
    /// @param signature Listing signature
    function verifyListingSignature(
        Listing calldata _listing,
        bytes calldata signature
    ) external view;

    /// @dev Check the signature if the swap offer is valid or not.
    /// @param offer Offer info
    /// @param signature Offer signature
    function verifySwapOfferSignature(
        SwapOffer calldata offer,
        bytes calldata signature
    ) external view;

    /// @dev Check the signature if the collection offer is valid or not.
    /// @param offer Offer info
    /// @param signature Offer signature
    function verifyCollectionSwapOfferSignature(
        CollectionSwapOffer calldata offer,
        bytes calldata signature
    ) external view;

    /// @dev Check the signature if the reserve offer is valid or not.
    /// @param offer Reserve offer info
    /// @param signature Reserve offer signature
    function verifyReserveOfferSignature(
        ReserveOffer calldata offer,
        bytes calldata signature
    ) external view;

    /// @dev Check the signature if the collection reserve offer is valid or not.
    /// @param offer Reserve offer info
    /// @param signature Reserve offer signature
    function verifyCollectionReserveOfferSignature(
        CollectionReserveOffer calldata offer,
        bytes calldata signature
    ) external view;

    /// @dev Check the signature if the loan offer is valid or not.
    /// @param offer Loan offer info
    /// @param signature Loan offer signature
    function verifyLoanOfferSignature(
        LoanOffer calldata offer,
        bytes memory signature
    ) external view;

    /// @dev Check the signature if the collection loan offer is valid or not.
    /// @param offer Collection loan offer info
    /// @param signature Collection loan offer signature
    function verifyCollectionLoanOfferSignature(
        CollectionLoanOffer calldata offer,
        bytes memory signature
    ) external view;

    /// @dev Check the signature if the update loan offer is valid or not.
    /// @param offer Update loan offer info
    /// @param signature Update loan offer signature
    function verifyUpdateLoanSignature(
        LoanUpdateOffer calldata offer,
        bytes memory signature
    ) external view;
}

File 7 of 10 : ValidationUtils.sol
// SPDX-License-Identifier: UNLICENSED
pragma solidity 0.8.9;

import "../../utils/DataTypes.sol";
import "../../utils/LoanDataTypes.sol";

/// @title NF3 Validation Utils
/// @author NF3 Exchange
/// @dev  Helper library for Protocol. This contract manages validation checks
///       commonly required throughout the protocol

library ValidationUtils {
    /// -----------------------------------------------------------------------
    /// Errors
    /// -----------------------------------------------------------------------

    enum ValidationUtilsErrorCodes {
        INVALID_ITEMS,
        ONLY_OWNER,
        OWNER_NOT_ALLOWED
    }

    error ValidationUtilsError(ValidationUtilsErrorCodes code);

    /// -----------------------------------------------------------------------
    /// Asset Validation Actions
    /// -----------------------------------------------------------------------

    /// @dev Verify assets1 and assets2 if they are the same.
    /// @param _assets1 First assets
    /// @param _assets2 Second assets
    function verifyAssets(Assets calldata _assets1, Assets calldata _assets2)
        internal
        pure
    {
        if (
            _assets1.paymentTokens.length != _assets2.paymentTokens.length ||
            _assets1.tokens.length != _assets2.tokens.length
        ) revert ValidationUtilsError(ValidationUtilsErrorCodes.INVALID_ITEMS);

        unchecked {
            uint256 i;
            for (i = 0; i < _assets1.paymentTokens.length; i++) {
                if (
                    _assets1.paymentTokens[i] != _assets2.paymentTokens[i] ||
                    _assets1.amounts[i] != _assets2.amounts[i]
                )
                    revert ValidationUtilsError(
                        ValidationUtilsErrorCodes.INVALID_ITEMS
                    );
            }

            for (i = 0; i < _assets1.tokens.length; i++) {
                if (
                    _assets1.tokens[i] != _assets2.tokens[i] ||
                    _assets1.tokenIds[i] != _assets2.tokenIds[i]
                )
                    revert ValidationUtilsError(
                        ValidationUtilsErrorCodes.INVALID_ITEMS
                    );
            }
        }
    }

    /// @dev Verify swap assets to be satisfied as the consideration items by the seller.
    /// @param _swapAssets Swap assets
    /// @param _tokens NFT addresses
    /// @param _tokenIds NFT token ids
    /// @param _value Eth value
    /// @return assets Verified swap assets
    function verifySwapAssets(
        SwapAssets memory _swapAssets,
        address[] memory _tokens,
        uint256[] memory _tokenIds,
        bytes32[][] memory _proofs,
        uint256 _value
    ) internal pure returns (Assets memory) {
        // check Eth amounts
        checkEthAmount(
            Assets({
                tokens: new address[](0),
                tokenIds: new uint256[](0),
                paymentTokens: _swapAssets.paymentTokens,
                amounts: _swapAssets.amounts
            }),
            _value
        );

        uint256 i;
        unchecked {
            // check compatible NFTs
            for (i = 0; i < _swapAssets.tokens.length; i++) {
                if (
                    _swapAssets.tokens[i] != _tokens[i] ||
                    (!verifyMerkleProof(
                        _swapAssets.roots[i],
                        _proofs[i],
                        keccak256(abi.encodePacked(_tokenIds[i]))
                    ) && _swapAssets.roots[i] != bytes32(0))
                ) {
                    revert ValidationUtilsError(
                        ValidationUtilsErrorCodes.INVALID_ITEMS
                    );
                }
            }
        }

        return
            Assets(
                _tokens,
                _tokenIds,
                _swapAssets.paymentTokens,
                _swapAssets.amounts
            );
    }

    /// @dev Verify if the passed asset is present in the merkle root passed.
    /// @param _root Merkle root to check in
    /// @param _consideration Consideration assets
    /// @param _proof Merkle proof
    function verifyAssetProof(
        bytes32 _root,
        Assets calldata _consideration,
        bytes32[] calldata _proof
    ) internal pure {
        bytes32 _leaf = hashAssets(_consideration, bytes32(0));

        if (!verifyMerkleProof(_root, _proof, _leaf)) {
            revert ValidationUtilsError(
                ValidationUtilsErrorCodes.INVALID_ITEMS
            );
        }
    }

    /// @dev Check if the ETH amount is valid.
    /// @param _assets Assets
    /// @param _value ETH amount
    function checkEthAmount(Assets memory _assets, uint256 _value)
        internal
        pure
    {
        uint256 ethAmount;

        for (uint256 i = 0; i < _assets.paymentTokens.length; ) {
            if (_assets.paymentTokens[i] == address(0))
                ethAmount += _assets.amounts[i];
            unchecked {
                ++i;
            }
        }
        if (ethAmount > _value) {
            revert ValidationUtilsError(
                ValidationUtilsErrorCodes.INVALID_ITEMS
            );
        }
    }

    /// @dev Verify that the given leaf exist in the passed root and has the correct proof.
    /// @param _root Merkle root of the given criterial
    /// @param _proof Merkle proof of the given leaf and root
    /// @param _leaf Hash of the token id to be searched in the root
    /// @return bool Validation of the leaf, root and proof
    function verifyMerkleProof(
        bytes32 _root,
        bytes32[] memory _proof,
        bytes32 _leaf
    ) internal pure returns (bool) {
        bytes32 computedHash = _leaf;

        unchecked {
            for (uint256 i = 0; i < _proof.length; i++) {
                computedHash = getHash(computedHash, _proof[i]);
            }
        }

        return computedHash == _root;
    }

    /// -----------------------------------------------------------------------
    /// Owner Validation Actions
    /// -----------------------------------------------------------------------

    /// @dev Check if the function is called by the item owner.
    /// @param _owner Owner address
    /// @param _caller Caller address
    function itemOwnerOnly(address _owner, address _caller) internal pure {
        if (_owner != _caller) {
            revert ValidationUtilsError(ValidationUtilsErrorCodes.ONLY_OWNER);
        }
    }

    /// @dev Check if the function is not called by the item owner.
    /// @param _owner Owner address
    /// @param _caller Caller address
    function notItemOwner(address _owner, address _caller) internal pure {
        if (_owner == _caller) {
            revert ValidationUtilsError(
                ValidationUtilsErrorCodes.OWNER_NOT_ALLOWED
            );
        }
    }

    /// -----------------------------------------------------------------------
    /// Getter Actions
    /// -----------------------------------------------------------------------

    /// @dev Get the hash of data saved in position token.
    /// @param _listingAssets Listing assets
    /// @param _reserveInfo Reserve ino
    /// @param _listingOwner Listing owner
    /// @return hash Hash of the passed data
    function getPositionTokenDataHash(
        Assets calldata _listingAssets,
        ReserveInfo calldata _reserveInfo,
        address _listingOwner
    ) internal pure returns (bytes32 hash) {
        hash = hashAssets(_listingAssets, hash);

        hash = keccak256(
            abi.encodePacked(getReserveHash(_reserveInfo), _listingOwner, hash)
        );
    }

    /// -----------------------------------------------------------------------
    /// Internal functions
    /// -----------------------------------------------------------------------

    /// @dev Get the hash of the given pair of hashes.
    /// @param _a First hash
    /// @param _b Second hash
    function getHash(bytes32 _a, bytes32 _b) internal pure returns (bytes32) {
        return _a < _b ? _hash(_a, _b) : _hash(_b, _a);
    }

    /// @dev Hash two bytes32 variables efficiently using assembly
    /// @param a First bytes variable
    /// @param b Second bytes variable
    function _hash(bytes32 a, bytes32 b) internal pure returns (bytes32 value) {
        assembly {
            mstore(0x00, a)
            mstore(0x20, b)
            value := keccak256(0x00, 0x40)
        }
    }

    /// @dev Add the hash of type assets to signature.
    /// @param _assets Assets to be added in hash
    /// @param _sig Hash to which assets need to be added
    /// @return hash Hash result
    function hashAssets(Assets calldata _assets, bytes32 _sig)
        internal
        pure
        returns (bytes32)
    {
        _sig = _addTokensArray(_assets.tokens, _assets.tokenIds, _sig);
        _sig = _addTokensArray(_assets.paymentTokens, _assets.amounts, _sig);

        return _sig;
    }

    /// @dev Add the hash of NFT information to signature.
    /// @param _tokens Array of nft address to be hashed
    /// @param _value Array of NFT tokenIds or amount of FT to be hashed
    /// @param _sig Hash to which assets need to be added
    /// @return hash Hash result
    function _addTokensArray(
        address[] memory _tokens,
        uint256[] memory _value,
        bytes32 _sig
    ) internal pure returns (bytes32) {
        assembly {
            let len := mload(_tokens)
            if eq(eq(len, mload(_value)), 0) {
                revert(0, 0)
            }

            let fmp := mload(0x40)

            let tokenPtr := add(_tokens, 0x20)
            let idPtr := add(_value, 0x20)

            for {
                let tokenIdx := tokenPtr
            } lt(tokenIdx, add(tokenPtr, mul(len, 0x20))) {
                tokenIdx := add(tokenIdx, 0x20)
                idPtr := add(idPtr, 0x20)
            } {
                mstore(fmp, mload(tokenIdx))
                mstore(add(fmp, 0x20), mload(idPtr))
                mstore(add(fmp, 0x40), _sig)

                _sig := keccak256(add(fmp, 0xc), 0x54)
            }
        }
        return _sig;
    }

    /// @dev Get the hash of reserve info.
    /// @param _reserve Reserve info
    /// @return hash Hash of the reserve info
    function getReserveHash(ReserveInfo calldata _reserve)
        internal
        pure
        returns (bytes32)
    {
        bytes32 signature;

        signature = hashAssets(_reserve.deposit, signature);

        signature = hashAssets(_reserve.remaining, signature);

        signature = keccak256(abi.encodePacked(_reserve.duration, signature));

        return signature;
    }
}

File 8 of 10 : DataTypes.sol
// SPDX-License-Identifier: UNLICENSED
pragma solidity 0.8.9;

/// @dev Royalties for collection creators and platform fee for platform manager.
///      to[0] is platform owner address.
/// @param to Creators and platform manager address array
/// @param percentage Royalty percentage based on the listed FT
struct Royalty {
    address[] to;
    uint256[] percentage;
}

/// @dev Common Assets type, packing bundle of NFTs and FTs.
/// @param tokens NFT asset address
/// @param tokenIds NFT token id
/// @param paymentTokens FT asset address
/// @param amounts FT token amount
struct Assets {
    address[] tokens;
    uint256[] tokenIds;
    address[] paymentTokens;
    uint256[] amounts;
}

/// @dev Common SwapAssets type, packing Bundle of NFTs and FTs. Notice tokenIds are represented by merkle roots
///      Each collection address ie. tokens[i] will have a merkle root corrosponding it's valid tokenIds.
///      This is used to select particular tokenId in corrospoding collection. If roots[i]
///      has the value of bytes32(0), this means the entire collection is considered valid.
/// @param tokens NFT asset address
/// @param roots Merkle roots of the criterias. NOTE: bytes32(0) represents the entire collection
/// @param paymentTokens FT asset address
/// @param amounts FT token amount
struct SwapAssets {
    address[] tokens;
    bytes32[] roots;
    address[] paymentTokens;
    uint256[] amounts;
}

/// @dev Common Reserve type, packing data related to reserve listing and reserve offer.
/// @param deposit Assets considered as initial deposit
/// @param remaining Assets considered as due amount
/// @param duration Duration of reserve now swap later
struct ReserveInfo {
    Assets deposit;
    Assets remaining;
    uint256 duration;
}

/// @dev All the reservation details that are stored in the position token
/// @param reservedAssets Assets that were reserved as a part of the reservation
/// @param reservedAssestsRoyalty Royalty offered by the assets owner
/// @param reserveInfo Deposit, remainig and time duriation details of the reservation
/// @param assetOwner Original owner of the reserved assets
struct Reservation {
    Assets reservedAssets;
    Royalty reservedAssetsRoyalty;
    ReserveInfo reserveInfo;
    address assetOwner;
}

/// @dev Listing type, packing the assets being listed, listing parameters, listing owner
///      and users's nonce.
/// @param listingAssets All the assets listed
/// @param directSwaps List of options for direct swap
/// @param reserves List of options for reserve now swap later
/// @param royalty Listing royalty and platform fee info
/// @param timePeriod Time period of listing
/// @param owner Owner's address
/// @param nonce User's nonce
struct Listing {
    Assets listingAssets;
    SwapAssets[] directSwaps;
    ReserveInfo[] reserves;
    Royalty royalty;
    address tradeIntendedFor;
    uint256 timePeriod;
    address owner;
    uint256 nonce;
}

/// @dev Listing type of special NF3 banner listing
/// @param token address of collection
/// @param tokenId token id being listed
/// @param editions number of tokenIds being distributed
/// @param gateCollectionsRoot merkle root for eligible collections
/// @param timePeriod timePeriod of listing
/// @param owner owner of listing
struct NF3GatedListing {
    address token;
    uint256 tokenId;
    uint256 editions;
    bytes32 gatedCollectionsRoot;
    uint256 timePeriod;
    address owner;
}

/// @dev Swap Offer type info.
/// @param offeringItems Assets being offered
/// @param royalty Swap offer royalty info
/// @param considerationRoot Assets to which this offer is made
/// @param timePeriod Time period of offer
/// @param owner Offer owner
/// @param nonce Offer nonce
struct SwapOffer {
    Assets offeringItems;
    Royalty royalty;
    bytes32 considerationRoot;
    uint256 timePeriod;
    address owner;
    uint256 nonce;
}

/// @dev Reserve now swap later type offer info.
/// @param reserveDetails Reservation scheme begin offered
/// @param considerationRoot Assets to which this offer is made
/// @param royalty Reserve offer royalty info
/// @param timePeriod Time period of offer
/// @param owner Offer owner
/// @param nonce Offer nonce
struct ReserveOffer {
    ReserveInfo reserveDetails;
    bytes32 considerationRoot;
    Royalty royalty;
    uint256 timePeriod;
    address owner;
    uint256 nonce;
}

/// @dev Collection offer type info.
/// @param offeringItems Assets being offered
/// @param considerationItems Assets to which this offer is made
/// @param royalty Collection offer royalty info
/// @param timePeriod Time period of offer
/// @param owner Offer owner
/// @param nonce Offer nonce
struct CollectionSwapOffer {
    Assets offeringItems;
    SwapAssets considerationItems;
    Royalty royalty;
    uint256 timePeriod;
    address owner;
    uint256 nonce;
}

/// @dev Collection Reserve type offer info.
/// @param reserveDetails Reservation scheme begin offered
/// @param considerationItems Assets to which this offer is made
/// @param royalty Reserve offer royalty info
/// @param timePeriod Time period of offer
/// @param owner Offer owner
/// @param nonce Offer nonce
struct CollectionReserveOffer {
    ReserveInfo reserveDetails;
    SwapAssets considerationItems;
    Royalty royalty;
    uint256 timePeriod;
    address owner;
    uint256 nonce;
}

/// @dev Swap Params type to be used as one of the input params
/// @param tokens Tokens provided in the parameters
/// @param tokenIds Token Ids provided in the parameters
/// @param proofs Merkle proofs provided in the parameters
struct SwapParams {
    address[] tokens;
    uint256[] tokenIds;
    bytes32[][] proofs;
}

/// @dev Fees struct to be used to signify fees to be paid by a party
/// @param token Address of erc20 tokens to be used for payment
/// @param amount amount of tokens to be paid respectively
/// @param to address to which the fee is paid
struct Fees {
    address token;
    uint256 amount;
    address to;
}

enum Status {
    AVAILABLE,
    EXHAUSTED
}

enum AssetType {
    INVALID,
    ETH,
    ERC_20,
    ERC_721,
    ERC_1155,
    KITTIES,
    PUNK
}

File 9 of 10 : 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 10 of 10 : LoanDataTypes.sol
// SPDX-License-Identifier: UNLICENSED
pragma solidity 0.8.9;

/// @dev Common loan offer struct to be used both the borrower and lender
///      to propose new offers,
/// @param nftCollateralContract Address of the NFT contract
/// @param nftCollateralId NFT collateral token id
/// @param owner Offer owner address
/// @param nonce Nonce of owner
/// @param loanPaymentToken Address of the loan payment token
/// @param loanPrincipalAmount Principal amount of the loan
/// @param maximumRepaymentAmount Maximum amount to be repayed
/// @param loanDuration Duration of the loan
/// @param loanInterestRate Interest rate of the loan
/// @param adminFees Admin fees in basis points
/// @param isLoanProrated Flag for interest rate type of loan
/// @param isBorrowerTerms Bool value to represent if borrower's terms were accepted.
///        - if this value is true, this mean msg.sender must be the lender.
///        - if this value is false, this means lender's terms were accepted and msg.sender
///          must be the borrower.
struct LoanOffer {
    address nftCollateralContract;
    uint256 nftCollateralId;
    address owner;
    uint256 nonce;
    address loanPaymentToken;
    uint256 loanPrincipalAmount;
    uint256 maximumRepaymentAmount;
    uint256 loanDuration;
    uint256 loanInterestRate;
    uint256 adminFees;
    bool isLoanProrated;
    bool isBorrowerTerms;
}

/// @dev Collection loan offer struct to be used to making collection
///      specific offers and trait level offers.
/// @param nftCollateralContract Address of the NFT contract
/// @param nftCollateralIdRoot Merkle root of the tokenIds for collateral
/// @param owner Offer owner address
/// @param nonce Nonce of owner
/// @param loanPaymentToken Address of the loan payment token
/// @param loanPrincipalAmount Principal amount of the loan
/// @param maximumRepaymentAmount Maximum amount to be repayed
/// @param loanDuration Duration of the loan
/// @param loanInterestRate Interest rate of the loan
/// @param adminFees Admin fees in basis points
/// @param isLoanProrated Flag for interest rate type of loan
struct CollectionLoanOffer {
    address nftCollateralContract;
    bytes32 nftCollateralIdRoot;
    address owner;
    uint256 nonce;
    address loanPaymentToken;
    uint256 loanPrincipalAmount;
    uint256 maximumRepaymentAmount;
    uint256 loanDuration;
    uint256 loanInterestRate;
    uint256 adminFees;
    bool isLoanProrated;
}

/// @dev Update loan offer struct to propose new terms for an ongoing loan.
/// @param loanId Id of the loan, same as promissory tokenId
/// @param maximumRepaymentAmount Maximum amount to be repayed
/// @param loanDuration Duration of the loan
/// @param loanInterestRate Interest rate of the loan
/// @param owner Offer owner address
/// @param nonce Nonce of owner
/// @param isLoanProrated Flag for interest rate type of loan
/// @param isBorrowerTerms Bool value to represent if borrower's terms were accepted.
///        - if this value is true, this mean msg.sender must be the lender.
///        - if this value is false, this means lender's terms were accepted and msg.sender
///          must be the borrower.
struct LoanUpdateOffer {
    uint256 loanId;
    uint256 maximumRepaymentAmount;
    uint256 loanDuration;
    uint256 loanInterestRate;
    address owner;
    uint256 nonce;
    bool isLoanProrated;
    bool isBorrowerTerms;
}

/// @dev Main loan struct that stores the details of an ongoing loan.
///      This struct is used to create hashes and store them in promissory tokens.
/// @param loanId Id of the loan, same as promissory tokenId
/// @param nftCollateralContract Address of the NFT contract
/// @param nftCollateralId TokenId of the NFT collateral
/// @param loanPaymentToken Address of the ERC20 token involved
/// @param loanPrincipalAmount Principal amount of the loan
/// @param maximumRepaymentAmount Maximum amount to be repayed
/// @param loanStartTime Timestamp of when the loan started
/// @param loanDuration Duration of the loan
/// @param loanInterestRate Interest Rate of the loan
/// @param isLoanProrated Flag for interest rate type of loan
struct Loan {
    uint256 loanId;
    address nftCollateralContract;
    uint256 nftCollateralId;
    address loanPaymentToken;
    uint256 loanPrincipalAmount;
    uint256 maximumRepaymentAmount;
    uint256 loanStartTime;
    uint256 loanDuration;
    uint256 loanInterestRate;
    uint256 adminFees;
    bool isLoanProrated;
}

Settings
{
  "optimizer": {
    "enabled": true,
    "runs": 20000
  },
  "outputSelection": {
    "*": {
      "*": [
        "evm.bytecode",
        "evm.deployedBytecode",
        "devdoc",
        "userdoc",
        "metadata",
        "abi"
      ]
    }
  },
  "metadata": {
    "useLiteralContent": true
  },
  "libraries": {}
}

Contract Security Audit

Contract ABI

[{"inputs":[{"internalType":"enum ISwap.SwapErrorCodes","name":"code","type":"uint8"}],"name":"SwapError","type":"error"},{"inputs":[{"internalType":"enum ValidationUtils.ValidationUtilsErrorCodes","name":"code","type":"uint8"}],"name":"ValidationUtilsError","type":"error"},{"anonymous":false,"inputs":[{"components":[{"components":[{"internalType":"address[]","name":"tokens","type":"address[]"},{"internalType":"uint256[]","name":"tokenIds","type":"uint256[]"},{"internalType":"address[]","name":"paymentTokens","type":"address[]"},{"internalType":"uint256[]","name":"amounts","type":"uint256[]"}],"internalType":"struct Assets","name":"offeringItems","type":"tuple"},{"components":[{"internalType":"address[]","name":"tokens","type":"address[]"},{"internalType":"bytes32[]","name":"roots","type":"bytes32[]"},{"internalType":"address[]","name":"paymentTokens","type":"address[]"},{"internalType":"uint256[]","name":"amounts","type":"uint256[]"}],"internalType":"struct SwapAssets","name":"considerationItems","type":"tuple"},{"components":[{"internalType":"address[]","name":"to","type":"address[]"},{"internalType":"uint256[]","name":"percentage","type":"uint256[]"}],"internalType":"struct Royalty","name":"royalty","type":"tuple"},{"internalType":"uint256","name":"timePeriod","type":"uint256"},{"internalType":"address","name":"owner","type":"address"},{"internalType":"uint256","name":"nonce","type":"uint256"}],"indexed":false,"internalType":"struct CollectionSwapOffer","name":"offer","type":"tuple"},{"components":[{"internalType":"address[]","name":"tokens","type":"address[]"},{"internalType":"uint256[]","name":"tokenIds","type":"uint256[]"},{"internalType":"address[]","name":"paymentTokens","type":"address[]"},{"internalType":"uint256[]","name":"amounts","type":"uint256[]"}],"indexed":false,"internalType":"struct Assets","name":"considerationItems","type":"tuple"},{"indexed":true,"internalType":"address","name":"user","type":"address"}],"name":"CollectionSwapOfferAccepted","type":"event"},{"anonymous":false,"inputs":[{"components":[{"components":[{"internalType":"address[]","name":"tokens","type":"address[]"},{"internalType":"uint256[]","name":"tokenIds","type":"uint256[]"},{"internalType":"address[]","name":"paymentTokens","type":"address[]"},{"internalType":"uint256[]","name":"amounts","type":"uint256[]"}],"internalType":"struct Assets","name":"offeringItems","type":"tuple"},{"components":[{"internalType":"address[]","name":"tokens","type":"address[]"},{"internalType":"bytes32[]","name":"roots","type":"bytes32[]"},{"internalType":"address[]","name":"paymentTokens","type":"address[]"},{"internalType":"uint256[]","name":"amounts","type":"uint256[]"}],"internalType":"struct SwapAssets","name":"considerationItems","type":"tuple"},{"components":[{"internalType":"address[]","name":"to","type":"address[]"},{"internalType":"uint256[]","name":"percentage","type":"uint256[]"}],"internalType":"struct Royalty","name":"royalty","type":"tuple"},{"internalType":"uint256","name":"timePeriod","type":"uint256"},{"internalType":"address","name":"owner","type":"address"},{"internalType":"uint256","name":"nonce","type":"uint256"}],"indexed":false,"internalType":"struct CollectionSwapOffer","name":"offer","type":"tuple"}],"name":"CollectionSwapOfferCancelled","type":"event"},{"anonymous":false,"inputs":[{"components":[{"components":[{"internalType":"address[]","name":"tokens","type":"address[]"},{"internalType":"uint256[]","name":"tokenIds","type":"uint256[]"},{"internalType":"address[]","name":"paymentTokens","type":"address[]"},{"internalType":"uint256[]","name":"amounts","type":"uint256[]"}],"internalType":"struct Assets","name":"listingAssets","type":"tuple"},{"components":[{"internalType":"address[]","name":"tokens","type":"address[]"},{"internalType":"bytes32[]","name":"roots","type":"bytes32[]"},{"internalType":"address[]","name":"paymentTokens","type":"address[]"},{"internalType":"uint256[]","name":"amounts","type":"uint256[]"}],"internalType":"struct SwapAssets[]","name":"directSwaps","type":"tuple[]"},{"components":[{"components":[{"internalType":"address[]","name":"tokens","type":"address[]"},{"internalType":"uint256[]","name":"tokenIds","type":"uint256[]"},{"internalType":"address[]","name":"paymentTokens","type":"address[]"},{"internalType":"uint256[]","name":"amounts","type":"uint256[]"}],"internalType":"struct Assets","name":"deposit","type":"tuple"},{"components":[{"internalType":"address[]","name":"tokens","type":"address[]"},{"internalType":"uint256[]","name":"tokenIds","type":"uint256[]"},{"internalType":"address[]","name":"paymentTokens","type":"address[]"},{"internalType":"uint256[]","name":"amounts","type":"uint256[]"}],"internalType":"struct Assets","name":"remaining","type":"tuple"},{"internalType":"uint256","name":"duration","type":"uint256"}],"internalType":"struct ReserveInfo[]","name":"reserves","type":"tuple[]"},{"components":[{"internalType":"address[]","name":"to","type":"address[]"},{"internalType":"uint256[]","name":"percentage","type":"uint256[]"}],"internalType":"struct Royalty","name":"royalty","type":"tuple"},{"internalType":"address","name":"tradeIntendedFor","type":"address"},{"internalType":"uint256","name":"timePeriod","type":"uint256"},{"internalType":"address","name":"owner","type":"address"},{"internalType":"uint256","name":"nonce","type":"uint256"}],"indexed":false,"internalType":"struct Listing","name":"listing","type":"tuple"},{"components":[{"internalType":"address[]","name":"tokens","type":"address[]"},{"internalType":"uint256[]","name":"tokenIds","type":"uint256[]"},{"internalType":"address[]","name":"paymentTokens","type":"address[]"},{"internalType":"uint256[]","name":"amounts","type":"uint256[]"}],"indexed":false,"internalType":"struct Assets","name":"offeredAssets","type":"tuple"},{"indexed":false,"internalType":"uint256","name":"swapId","type":"uint256"},{"indexed":true,"internalType":"address","name":"user","type":"address"}],"name":"DirectSwapped","type":"event"},{"anonymous":false,"inputs":[{"components":[{"components":[{"internalType":"address[]","name":"tokens","type":"address[]"},{"internalType":"uint256[]","name":"tokenIds","type":"uint256[]"},{"internalType":"address[]","name":"paymentTokens","type":"address[]"},{"internalType":"uint256[]","name":"amounts","type":"uint256[]"}],"internalType":"struct Assets","name":"listingAssets","type":"tuple"},{"components":[{"internalType":"address[]","name":"tokens","type":"address[]"},{"internalType":"bytes32[]","name":"roots","type":"bytes32[]"},{"internalType":"address[]","name":"paymentTokens","type":"address[]"},{"internalType":"uint256[]","name":"amounts","type":"uint256[]"}],"internalType":"struct SwapAssets[]","name":"directSwaps","type":"tuple[]"},{"components":[{"components":[{"internalType":"address[]","name":"tokens","type":"address[]"},{"internalType":"uint256[]","name":"tokenIds","type":"uint256[]"},{"internalType":"address[]","name":"paymentTokens","type":"address[]"},{"internalType":"uint256[]","name":"amounts","type":"uint256[]"}],"internalType":"struct Assets","name":"deposit","type":"tuple"},{"components":[{"internalType":"address[]","name":"tokens","type":"address[]"},{"internalType":"uint256[]","name":"tokenIds","type":"uint256[]"},{"internalType":"address[]","name":"paymentTokens","type":"address[]"},{"internalType":"uint256[]","name":"amounts","type":"uint256[]"}],"internalType":"struct Assets","name":"remaining","type":"tuple"},{"internalType":"uint256","name":"duration","type":"uint256"}],"internalType":"struct ReserveInfo[]","name":"reserves","type":"tuple[]"},{"components":[{"internalType":"address[]","name":"to","type":"address[]"},{"internalType":"uint256[]","name":"percentage","type":"uint256[]"}],"internalType":"struct Royalty","name":"royalty","type":"tuple"},{"internalType":"address","name":"tradeIntendedFor","type":"address"},{"internalType":"uint256","name":"timePeriod","type":"uint256"},{"internalType":"address","name":"owner","type":"address"},{"internalType":"uint256","name":"nonce","type":"uint256"}],"indexed":false,"internalType":"struct Listing","name":"listing","type":"tuple"},{"components":[{"components":[{"internalType":"address[]","name":"tokens","type":"address[]"},{"internalType":"uint256[]","name":"tokenIds","type":"uint256[]"},{"internalType":"address[]","name":"paymentTokens","type":"address[]"},{"internalType":"uint256[]","name":"amounts","type":"uint256[]"}],"internalType":"struct Assets","name":"offeringItems","type":"tuple"},{"components":[{"internalType":"address[]","name":"to","type":"address[]"},{"internalType":"uint256[]","name":"percentage","type":"uint256[]"}],"internalType":"struct Royalty","name":"royalty","type":"tuple"},{"internalType":"bytes32","name":"considerationRoot","type":"bytes32"},{"internalType":"uint256","name":"timePeriod","type":"uint256"},{"internalType":"address","name":"owner","type":"address"},{"internalType":"uint256","name":"nonce","type":"uint256"}],"indexed":false,"internalType":"struct SwapOffer","name":"offer","type":"tuple"},{"indexed":true,"internalType":"address","name":"user","type":"address"}],"name":"ListedSwapOfferAccepted","type":"event"},{"anonymous":false,"inputs":[{"components":[{"components":[{"internalType":"address[]","name":"tokens","type":"address[]"},{"internalType":"uint256[]","name":"tokenIds","type":"uint256[]"},{"internalType":"address[]","name":"paymentTokens","type":"address[]"},{"internalType":"uint256[]","name":"amounts","type":"uint256[]"}],"internalType":"struct Assets","name":"listingAssets","type":"tuple"},{"components":[{"internalType":"address[]","name":"tokens","type":"address[]"},{"internalType":"bytes32[]","name":"roots","type":"bytes32[]"},{"internalType":"address[]","name":"paymentTokens","type":"address[]"},{"internalType":"uint256[]","name":"amounts","type":"uint256[]"}],"internalType":"struct SwapAssets[]","name":"directSwaps","type":"tuple[]"},{"components":[{"components":[{"internalType":"address[]","name":"tokens","type":"address[]"},{"internalType":"uint256[]","name":"tokenIds","type":"uint256[]"},{"internalType":"address[]","name":"paymentTokens","type":"address[]"},{"internalType":"uint256[]","name":"amounts","type":"uint256[]"}],"internalType":"struct Assets","name":"deposit","type":"tuple"},{"components":[{"internalType":"address[]","name":"tokens","type":"address[]"},{"internalType":"uint256[]","name":"tokenIds","type":"uint256[]"},{"internalType":"address[]","name":"paymentTokens","type":"address[]"},{"internalType":"uint256[]","name":"amounts","type":"uint256[]"}],"internalType":"struct Assets","name":"remaining","type":"tuple"},{"internalType":"uint256","name":"duration","type":"uint256"}],"internalType":"struct ReserveInfo[]","name":"reserves","type":"tuple[]"},{"components":[{"internalType":"address[]","name":"to","type":"address[]"},{"internalType":"uint256[]","name":"percentage","type":"uint256[]"}],"internalType":"struct Royalty","name":"royalty","type":"tuple"},{"internalType":"address","name":"tradeIntendedFor","type":"address"},{"internalType":"uint256","name":"timePeriod","type":"uint256"},{"internalType":"address","name":"owner","type":"address"},{"internalType":"uint256","name":"nonce","type":"uint256"}],"indexed":false,"internalType":"struct Listing","name":"listing","type":"tuple"}],"name":"ListingCancelled","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":"address","name":"oldStorageRegistry","type":"address"},{"indexed":false,"internalType":"address","name":"newStorageRegistry","type":"address"}],"name":"StorageRegistrySet","type":"event"},{"anonymous":false,"inputs":[{"components":[{"components":[{"internalType":"address[]","name":"tokens","type":"address[]"},{"internalType":"uint256[]","name":"tokenIds","type":"uint256[]"},{"internalType":"address[]","name":"paymentTokens","type":"address[]"},{"internalType":"uint256[]","name":"amounts","type":"uint256[]"}],"internalType":"struct Assets","name":"offeringItems","type":"tuple"},{"components":[{"internalType":"address[]","name":"to","type":"address[]"},{"internalType":"uint256[]","name":"percentage","type":"uint256[]"}],"internalType":"struct Royalty","name":"royalty","type":"tuple"},{"internalType":"bytes32","name":"considerationRoot","type":"bytes32"},{"internalType":"uint256","name":"timePeriod","type":"uint256"},{"internalType":"address","name":"owner","type":"address"},{"internalType":"uint256","name":"nonce","type":"uint256"}],"indexed":false,"internalType":"struct SwapOffer","name":"offer","type":"tuple"}],"name":"SwapOfferCancelled","type":"event"},{"anonymous":false,"inputs":[{"components":[{"components":[{"internalType":"address[]","name":"tokens","type":"address[]"},{"internalType":"uint256[]","name":"tokenIds","type":"uint256[]"},{"internalType":"address[]","name":"paymentTokens","type":"address[]"},{"internalType":"uint256[]","name":"amounts","type":"uint256[]"}],"internalType":"struct Assets","name":"offeringItems","type":"tuple"},{"components":[{"internalType":"address[]","name":"to","type":"address[]"},{"internalType":"uint256[]","name":"percentage","type":"uint256[]"}],"internalType":"struct Royalty","name":"royalty","type":"tuple"},{"internalType":"bytes32","name":"considerationRoot","type":"bytes32"},{"internalType":"uint256","name":"timePeriod","type":"uint256"},{"internalType":"address","name":"owner","type":"address"},{"internalType":"uint256","name":"nonce","type":"uint256"}],"indexed":false,"internalType":"struct SwapOffer","name":"offer","type":"tuple"},{"components":[{"internalType":"address[]","name":"tokens","type":"address[]"},{"internalType":"uint256[]","name":"tokenIds","type":"uint256[]"},{"internalType":"address[]","name":"paymentTokens","type":"address[]"},{"internalType":"uint256[]","name":"amounts","type":"uint256[]"}],"indexed":false,"internalType":"struct Assets","name":"considerationItems","type":"tuple"},{"indexed":true,"internalType":"address","name":"user","type":"address"}],"name":"UnlistedSwapOfferAccepted","type":"event"},{"inputs":[{"components":[{"components":[{"internalType":"address[]","name":"tokens","type":"address[]"},{"internalType":"uint256[]","name":"tokenIds","type":"uint256[]"},{"internalType":"address[]","name":"paymentTokens","type":"address[]"},{"internalType":"uint256[]","name":"amounts","type":"uint256[]"}],"internalType":"struct Assets","name":"offeringItems","type":"tuple"},{"components":[{"internalType":"address[]","name":"tokens","type":"address[]"},{"internalType":"bytes32[]","name":"roots","type":"bytes32[]"},{"internalType":"address[]","name":"paymentTokens","type":"address[]"},{"internalType":"uint256[]","name":"amounts","type":"uint256[]"}],"internalType":"struct SwapAssets","name":"considerationItems","type":"tuple"},{"components":[{"internalType":"address[]","name":"to","type":"address[]"},{"internalType":"uint256[]","name":"percentage","type":"uint256[]"}],"internalType":"struct Royalty","name":"royalty","type":"tuple"},{"internalType":"uint256","name":"timePeriod","type":"uint256"},{"internalType":"address","name":"owner","type":"address"},{"internalType":"uint256","name":"nonce","type":"uint256"}],"internalType":"struct CollectionSwapOffer","name":"_offer","type":"tuple"},{"internalType":"bytes","name":"_signature","type":"bytes"},{"components":[{"internalType":"address[]","name":"tokens","type":"address[]"},{"internalType":"uint256[]","name":"tokenIds","type":"uint256[]"},{"internalType":"bytes32[][]","name":"proofs","type":"bytes32[][]"}],"internalType":"struct SwapParams","name":"swapParams","type":"tuple"},{"internalType":"address","name":"_user","type":"address"},{"internalType":"uint256","name":"_value","type":"uint256"},{"components":[{"internalType":"address[]","name":"to","type":"address[]"},{"internalType":"uint256[]","name":"percentage","type":"uint256[]"}],"internalType":"struct Royalty","name":"_royalty","type":"tuple"},{"components":[{"internalType":"address","name":"token","type":"address"},{"internalType":"uint256","name":"amount","type":"uint256"},{"internalType":"address","name":"to","type":"address"}],"internalType":"struct Fees","name":"sellerFees","type":"tuple"},{"components":[{"internalType":"address","name":"token","type":"address"},{"internalType":"uint256","name":"amount","type":"uint256"},{"internalType":"address","name":"to","type":"address"}],"internalType":"struct Fees","name":"buyerFees","type":"tuple"}],"name":"acceptCollectionSwapOffer","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"components":[{"components":[{"internalType":"address[]","name":"tokens","type":"address[]"},{"internalType":"uint256[]","name":"tokenIds","type":"uint256[]"},{"internalType":"address[]","name":"paymentTokens","type":"address[]"},{"internalType":"uint256[]","name":"amounts","type":"uint256[]"}],"internalType":"struct Assets","name":"listingAssets","type":"tuple"},{"components":[{"internalType":"address[]","name":"tokens","type":"address[]"},{"internalType":"bytes32[]","name":"roots","type":"bytes32[]"},{"internalType":"address[]","name":"paymentTokens","type":"address[]"},{"internalType":"uint256[]","name":"amounts","type":"uint256[]"}],"internalType":"struct SwapAssets[]","name":"directSwaps","type":"tuple[]"},{"components":[{"components":[{"internalType":"address[]","name":"tokens","type":"address[]"},{"internalType":"uint256[]","name":"tokenIds","type":"uint256[]"},{"internalType":"address[]","name":"paymentTokens","type":"address[]"},{"internalType":"uint256[]","name":"amounts","type":"uint256[]"}],"internalType":"struct Assets","name":"deposit","type":"tuple"},{"components":[{"internalType":"address[]","name":"tokens","type":"address[]"},{"internalType":"uint256[]","name":"tokenIds","type":"uint256[]"},{"internalType":"address[]","name":"paymentTokens","type":"address[]"},{"internalType":"uint256[]","name":"amounts","type":"uint256[]"}],"internalType":"struct Assets","name":"remaining","type":"tuple"},{"internalType":"uint256","name":"duration","type":"uint256"}],"internalType":"struct ReserveInfo[]","name":"reserves","type":"tuple[]"},{"components":[{"internalType":"address[]","name":"to","type":"address[]"},{"internalType":"uint256[]","name":"percentage","type":"uint256[]"}],"internalType":"struct Royalty","name":"royalty","type":"tuple"},{"internalType":"address","name":"tradeIntendedFor","type":"address"},{"internalType":"uint256","name":"timePeriod","type":"uint256"},{"internalType":"address","name":"owner","type":"address"},{"internalType":"uint256","name":"nonce","type":"uint256"}],"internalType":"struct Listing","name":"_listing","type":"tuple"},{"internalType":"bytes","name":"_listingSignature","type":"bytes"},{"components":[{"components":[{"internalType":"address[]","name":"tokens","type":"address[]"},{"internalType":"uint256[]","name":"tokenIds","type":"uint256[]"},{"internalType":"address[]","name":"paymentTokens","type":"address[]"},{"internalType":"uint256[]","name":"amounts","type":"uint256[]"}],"internalType":"struct Assets","name":"offeringItems","type":"tuple"},{"components":[{"internalType":"address[]","name":"to","type":"address[]"},{"internalType":"uint256[]","name":"percentage","type":"uint256[]"}],"internalType":"struct Royalty","name":"royalty","type":"tuple"},{"internalType":"bytes32","name":"considerationRoot","type":"bytes32"},{"internalType":"uint256","name":"timePeriod","type":"uint256"},{"internalType":"address","name":"owner","type":"address"},{"internalType":"uint256","name":"nonce","type":"uint256"}],"internalType":"struct SwapOffer","name":"_offer","type":"tuple"},{"internalType":"bytes","name":"_offerSignature","type":"bytes"},{"internalType":"bytes32[]","name":"_proof","type":"bytes32[]"},{"internalType":"address","name":"_user","type":"address"},{"components":[{"internalType":"address","name":"token","type":"address"},{"internalType":"uint256","name":"amount","type":"uint256"},{"internalType":"address","name":"to","type":"address"}],"internalType":"struct Fees","name":"sellerFees","type":"tuple"},{"components":[{"internalType":"address","name":"token","type":"address"},{"internalType":"uint256","name":"amount","type":"uint256"},{"internalType":"address","name":"to","type":"address"}],"internalType":"struct Fees","name":"buyerFees","type":"tuple"}],"name":"acceptListedDirectSwapOffer","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"components":[{"components":[{"internalType":"address[]","name":"tokens","type":"address[]"},{"internalType":"uint256[]","name":"tokenIds","type":"uint256[]"},{"internalType":"address[]","name":"paymentTokens","type":"address[]"},{"internalType":"uint256[]","name":"amounts","type":"uint256[]"}],"internalType":"struct Assets","name":"offeringItems","type":"tuple"},{"components":[{"internalType":"address[]","name":"to","type":"address[]"},{"internalType":"uint256[]","name":"percentage","type":"uint256[]"}],"internalType":"struct Royalty","name":"royalty","type":"tuple"},{"internalType":"bytes32","name":"considerationRoot","type":"bytes32"},{"internalType":"uint256","name":"timePeriod","type":"uint256"},{"internalType":"address","name":"owner","type":"address"},{"internalType":"uint256","name":"nonce","type":"uint256"}],"internalType":"struct SwapOffer","name":"_offer","type":"tuple"},{"internalType":"bytes","name":"_signature","type":"bytes"},{"components":[{"internalType":"address[]","name":"tokens","type":"address[]"},{"internalType":"uint256[]","name":"tokenIds","type":"uint256[]"},{"internalType":"address[]","name":"paymentTokens","type":"address[]"},{"internalType":"uint256[]","name":"amounts","type":"uint256[]"}],"internalType":"struct Assets","name":"_consideration","type":"tuple"},{"internalType":"bytes32[]","name":"_proof","type":"bytes32[]"},{"internalType":"address","name":"_user","type":"address"},{"internalType":"uint256","name":"_value","type":"uint256"},{"components":[{"internalType":"address[]","name":"to","type":"address[]"},{"internalType":"uint256[]","name":"percentage","type":"uint256[]"}],"internalType":"struct Royalty","name":"_royalty","type":"tuple"},{"components":[{"internalType":"address","name":"token","type":"address"},{"internalType":"uint256","name":"amount","type":"uint256"},{"internalType":"address","name":"to","type":"address"}],"internalType":"struct Fees","name":"sellerFees","type":"tuple"},{"components":[{"internalType":"address","name":"token","type":"address"},{"internalType":"uint256","name":"amount","type":"uint256"},{"internalType":"address","name":"to","type":"address"}],"internalType":"struct Fees","name":"buyerFees","type":"tuple"}],"name":"acceptUnlistedDirectSwapOffer","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"components":[{"components":[{"internalType":"address[]","name":"tokens","type":"address[]"},{"internalType":"uint256[]","name":"tokenIds","type":"uint256[]"},{"internalType":"address[]","name":"paymentTokens","type":"address[]"},{"internalType":"uint256[]","name":"amounts","type":"uint256[]"}],"internalType":"struct Assets","name":"offeringItems","type":"tuple"},{"components":[{"internalType":"address[]","name":"tokens","type":"address[]"},{"internalType":"bytes32[]","name":"roots","type":"bytes32[]"},{"internalType":"address[]","name":"paymentTokens","type":"address[]"},{"internalType":"uint256[]","name":"amounts","type":"uint256[]"}],"internalType":"struct SwapAssets","name":"considerationItems","type":"tuple"},{"components":[{"internalType":"address[]","name":"to","type":"address[]"},{"internalType":"uint256[]","name":"percentage","type":"uint256[]"}],"internalType":"struct Royalty","name":"royalty","type":"tuple"},{"internalType":"uint256","name":"timePeriod","type":"uint256"},{"internalType":"address","name":"owner","type":"address"},{"internalType":"uint256","name":"nonce","type":"uint256"}],"internalType":"struct CollectionSwapOffer","name":"_offer","type":"tuple"},{"internalType":"bytes","name":"_signature","type":"bytes"},{"internalType":"address","name":"_user","type":"address"}],"name":"cancelCollectionSwapOffer","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"components":[{"components":[{"internalType":"address[]","name":"tokens","type":"address[]"},{"internalType":"uint256[]","name":"tokenIds","type":"uint256[]"},{"internalType":"address[]","name":"paymentTokens","type":"address[]"},{"internalType":"uint256[]","name":"amounts","type":"uint256[]"}],"internalType":"struct Assets","name":"listingAssets","type":"tuple"},{"components":[{"internalType":"address[]","name":"tokens","type":"address[]"},{"internalType":"bytes32[]","name":"roots","type":"bytes32[]"},{"internalType":"address[]","name":"paymentTokens","type":"address[]"},{"internalType":"uint256[]","name":"amounts","type":"uint256[]"}],"internalType":"struct SwapAssets[]","name":"directSwaps","type":"tuple[]"},{"components":[{"components":[{"internalType":"address[]","name":"tokens","type":"address[]"},{"internalType":"uint256[]","name":"tokenIds","type":"uint256[]"},{"internalType":"address[]","name":"paymentTokens","type":"address[]"},{"internalType":"uint256[]","name":"amounts","type":"uint256[]"}],"internalType":"struct Assets","name":"deposit","type":"tuple"},{"components":[{"internalType":"address[]","name":"tokens","type":"address[]"},{"internalType":"uint256[]","name":"tokenIds","type":"uint256[]"},{"internalType":"address[]","name":"paymentTokens","type":"address[]"},{"internalType":"uint256[]","name":"amounts","type":"uint256[]"}],"internalType":"struct Assets","name":"remaining","type":"tuple"},{"internalType":"uint256","name":"duration","type":"uint256"}],"internalType":"struct ReserveInfo[]","name":"reserves","type":"tuple[]"},{"components":[{"internalType":"address[]","name":"to","type":"address[]"},{"internalType":"uint256[]","name":"percentage","type":"uint256[]"}],"internalType":"struct Royalty","name":"royalty","type":"tuple"},{"internalType":"address","name":"tradeIntendedFor","type":"address"},{"internalType":"uint256","name":"timePeriod","type":"uint256"},{"internalType":"address","name":"owner","type":"address"},{"internalType":"uint256","name":"nonce","type":"uint256"}],"internalType":"struct Listing","name":"_listing","type":"tuple"},{"internalType":"bytes","name":"_signature","type":"bytes"},{"internalType":"address","name":"_user","type":"address"}],"name":"cancelListing","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"components":[{"components":[{"internalType":"address[]","name":"tokens","type":"address[]"},{"internalType":"uint256[]","name":"tokenIds","type":"uint256[]"},{"internalType":"address[]","name":"paymentTokens","type":"address[]"},{"internalType":"uint256[]","name":"amounts","type":"uint256[]"}],"internalType":"struct Assets","name":"offeringItems","type":"tuple"},{"components":[{"internalType":"address[]","name":"to","type":"address[]"},{"internalType":"uint256[]","name":"percentage","type":"uint256[]"}],"internalType":"struct Royalty","name":"royalty","type":"tuple"},{"internalType":"bytes32","name":"considerationRoot","type":"bytes32"},{"internalType":"uint256","name":"timePeriod","type":"uint256"},{"internalType":"address","name":"owner","type":"address"},{"internalType":"uint256","name":"nonce","type":"uint256"}],"internalType":"struct SwapOffer","name":"_offer","type":"tuple"},{"internalType":"bytes","name":"_signature","type":"bytes"},{"internalType":"address","name":"_user","type":"address"}],"name":"cancelSwapOffer","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"components":[{"components":[{"internalType":"address[]","name":"tokens","type":"address[]"},{"internalType":"uint256[]","name":"tokenIds","type":"uint256[]"},{"internalType":"address[]","name":"paymentTokens","type":"address[]"},{"internalType":"uint256[]","name":"amounts","type":"uint256[]"}],"internalType":"struct Assets","name":"listingAssets","type":"tuple"},{"components":[{"internalType":"address[]","name":"tokens","type":"address[]"},{"internalType":"bytes32[]","name":"roots","type":"bytes32[]"},{"internalType":"address[]","name":"paymentTokens","type":"address[]"},{"internalType":"uint256[]","name":"amounts","type":"uint256[]"}],"internalType":"struct SwapAssets[]","name":"directSwaps","type":"tuple[]"},{"components":[{"components":[{"internalType":"address[]","name":"tokens","type":"address[]"},{"internalType":"uint256[]","name":"tokenIds","type":"uint256[]"},{"internalType":"address[]","name":"paymentTokens","type":"address[]"},{"internalType":"uint256[]","name":"amounts","type":"uint256[]"}],"internalType":"struct Assets","name":"deposit","type":"tuple"},{"components":[{"internalType":"address[]","name":"tokens","type":"address[]"},{"internalType":"uint256[]","name":"tokenIds","type":"uint256[]"},{"internalType":"address[]","name":"paymentTokens","type":"address[]"},{"internalType":"uint256[]","name":"amounts","type":"uint256[]"}],"internalType":"struct Assets","name":"remaining","type":"tuple"},{"internalType":"uint256","name":"duration","type":"uint256"}],"internalType":"struct ReserveInfo[]","name":"reserves","type":"tuple[]"},{"components":[{"internalType":"address[]","name":"to","type":"address[]"},{"internalType":"uint256[]","name":"percentage","type":"uint256[]"}],"internalType":"struct Royalty","name":"royalty","type":"tuple"},{"internalType":"address","name":"tradeIntendedFor","type":"address"},{"internalType":"uint256","name":"timePeriod","type":"uint256"},{"internalType":"address","name":"owner","type":"address"},{"internalType":"uint256","name":"nonce","type":"uint256"}],"internalType":"struct Listing","name":"_listing","type":"tuple"},{"internalType":"bytes","name":"_signature","type":"bytes"},{"internalType":"uint256","name":"_swapId","type":"uint256"},{"internalType":"address","name":"_user","type":"address"},{"components":[{"internalType":"address[]","name":"tokens","type":"address[]"},{"internalType":"uint256[]","name":"tokenIds","type":"uint256[]"},{"internalType":"bytes32[][]","name":"proofs","type":"bytes32[][]"}],"internalType":"struct SwapParams","name":"swapParams","type":"tuple"},{"internalType":"uint256","name":"_value","type":"uint256"},{"components":[{"internalType":"address[]","name":"to","type":"address[]"},{"internalType":"uint256[]","name":"percentage","type":"uint256[]"}],"internalType":"struct Royalty","name":"_royalty","type":"tuple"},{"components":[{"internalType":"address","name":"token","type":"address"},{"internalType":"uint256","name":"amount","type":"uint256"},{"internalType":"address","name":"to","type":"address"}],"internalType":"struct Fees","name":"sellerFees","type":"tuple"},{"components":[{"internalType":"address","name":"token","type":"address"},{"internalType":"uint256","name":"amount","type":"uint256"},{"internalType":"address","name":"to","type":"address"}],"internalType":"struct Fees","name":"buyerFees","type":"tuple"}],"name":"directSwap","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"owner","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"renounceOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_storageRegistryAddress","type":"address"}],"name":"setStorageRegistry","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"storageRegistryAddress","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"newOwner","type":"address"}],"name":"transferOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"}]

60806040523480156200001157600080fd5b506200001d3362000023565b62000073565b600080546001600160a01b038381166001600160a01b0319831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b6134c880620000836000396000f3fe608060405234801561001057600080fd5b50600436106100d45760003560e01c80638da5cb5b11610081578063f2fde38b1161005b578063f2fde38b146101bc578063f92b11ab146101cf578063fa0b7dc8146101e257600080fd5b80638da5cb5b14610178578063cdbf9ba314610196578063d25c940e146101a957600080fd5b80634ad1f254116100b25780634ad1f254146101145780636e9e790c1461015d578063715018a61461017057600080fd5b8063101a9c69146100d9578063117e5db7146100ee578063307f3a2b14610101575b600080fd5b6100ec6100e73660046123f6565b6101f5565b005b6100ec6100fc3660046124eb565b6105fc565b6100ec61010f366004612575565b61073c565b6001546101349073ffffffffffffffffffffffffffffffffffffffff1681565b60405173ffffffffffffffffffffffffffffffffffffffff909116815260200160405180910390f35b6100ec61016b3660046126ad565b610a7c565b6100ec610ed2565b60005473ffffffffffffffffffffffffffffffffffffffff16610134565b6100ec6101a43660046127bd565b610ee6565b6100ec6101b73660046128d6565b611209565b6100ec6101ca36600461290f565b61131f565b6100ec6101dd3660046128d6565b6113d6565b6100ec6101f036600461290f565b6114d6565b6101fd6115c9565b60015473ffffffffffffffffffffffffffffffffffffffff1661021f816116c0565b73ffffffffffffffffffffffffffffffffffffffff16630ab253438b8b6040518363ffffffff1660e01b8152600401610259929190612dfb565b60006040518083038186803b15801561027157600080fd5b505afa158015610285573d6000803e3d6000fd5b506102a9925061029e91505060e08c0160c08d0161290f565b8b60e0013583611746565b6102b68a60a001356117d1565b60006102c860a08c0160808d0161290f565b905073ffffffffffffffffffffffffffffffffffffffff8116158061031857508773ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff16145b61035a5760016040517fb75267270000000000000000000000000000000000000000000000000000000081526004016103519190612e58565b60405180910390fd5b61038a8861036e60e08e0160c08f0161290f565b73ffffffffffffffffffffffffffffffffffffffff169061180e565b5060006103a361039d60208d018d612e72565b8b61187b565b6103ac90612eda565b8751602089015160408a01519293506000926103cc92859290918b6118e4565b90508b60006103da85611af3565b905073ffffffffffffffffffffffffffffffffffffffff811663af9bb76f6104028480612f91565b61041260e0860160c0870161290f565b8e8c60006040518663ffffffff1660e01b8152600401610436959493929190612fcf565b600060405180830381600087803b15801561045057600080fd5b505af1158015610464573d6000803e3d6000fd5b50505073ffffffffffffffffffffffffffffffffffffffff8216905063af9bb76f848d61049760e0870160c0880161290f565b6104a4606088018861302d565b60016040518663ffffffff1660e01b81526004016104c6959493929190613139565b600060405180830381600087803b1580156104e057600080fd5b505af11580156104f4573d6000803e3d6000fd5b50505073ffffffffffffffffffffffffffffffffffffffff82169050639d133c0f8861052660e0860160c0870161290f565b898f6040518563ffffffff1660e01b81526004016105479493929190613199565b600060405180830381600087803b15801561056157600080fd5b505af1158015610575573d6000803e3d6000fd5b505050505061059b8160c0016020810190610590919061290f565b8260e0013586611b3b565b8973ffffffffffffffffffffffffffffffffffffffff167f3f9640238502f8504ff0206cd86ad2d403277abc84d1731223208e0972b52f6a82848e6040516105e5939291906131e4565b60405180910390a250505050505050505050505050565b6106046115c9565b60015473ffffffffffffffffffffffffffffffffffffffff16610626816116c0565b73ffffffffffffffffffffffffffffffffffffffff16630ab2534385856040518363ffffffff1660e01b8152600401610660929190612dfb565b60006040518083038186803b15801561067857600080fd5b505afa15801561068c573d6000803e3d6000fd5b505050506106c3828560c00160208101906106a7919061290f565b73ffffffffffffffffffffffffffffffffffffffff1690611bbf565b6106e16106d660e0860160c0870161290f565b8560e0013583611746565b6106ff6106f460e0860160c0870161290f565b8560e0013583611b3b565b7f9b415ec38307548cbbe86c6adf2afdd4ff85a40b033b75d2bc18e60d379122308460405161072e919061321a565b60405180910390a150505050565b6107446115c9565b60015473ffffffffffffffffffffffffffffffffffffffff16610766816116c0565b73ffffffffffffffffffffffffffffffffffffffff166376a4e0818a8a6040518363ffffffff1660e01b81526004016107a09291906132d5565b60006040518083038186803b1580156107b857600080fd5b505afa1580156107cc573d6000803e3d6000fd5b506107f092506107e591505060a08b0160808c0161290f565b8a60a0013583611746565b6107fd89606001356117d1565b6108118661036e60a08c0160808d0161290f565b6000610848886000015189602001518a60400151898e80602001906108369190612f91565b61083f90612eda565b939291906118e4565b9050600061085583611af3565b905073ffffffffffffffffffffffffffffffffffffffff811663af9bb76f61087d8d80612f91565b8d6080016020810190610890919061290f565b8b8a60006040518663ffffffff1660e01b81526004016108b4959493929190612fcf565b600060405180830381600087803b1580156108ce57600080fd5b505af11580156108e2573d6000803e3d6000fd5b505050508073ffffffffffffffffffffffffffffffffffffffff1663af9bb76f838a8e6080016020810190610917919061290f565b8f8060400190610927919061302d565b60016040518663ffffffff1660e01b8152600401610949959493929190613139565b600060405180830381600087803b15801561096357600080fd5b505af1158015610977573d6000803e3d6000fd5b505050508073ffffffffffffffffffffffffffffffffffffffff16639d133c0f868a878f60800160208101906109ad919061290f565b6040518563ffffffff1660e01b81526004016109cc9493929190613199565b600060405180830381600087803b1580156109e657600080fd5b505af11580156109fa573d6000803e3d6000fd5b5050505050610a208a6080016020810190610a15919061290f565b8b60a0013584611b3b565b8673ffffffffffffffffffffffffffffffffffffffff167f5a37390d9ff1b75e238fdbd4c291d51c0b1eb2f61f2432f7ed046f9e1d195e618b83604051610a689291906132e8565b60405180910390a250505050505050505050565b610a846115c9565b60015473ffffffffffffffffffffffffffffffffffffffff166000610aa8826116c0565b6040517f0ab2534300000000000000000000000000000000000000000000000000000000815290915073ffffffffffffffffffffffffffffffffffffffff821690630ab2534390610aff908e908e90600401612dfb565b60006040518083038186803b158015610b1757600080fd5b505afa158015610b2b573d6000803e3d6000fd5b50610b4f9250610b4491505060e08d0160c08e0161290f565b8c60e0013584611746565b610b5c8b60a001356117d1565b6040517f583b8ace00000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff82169063583b8ace90610bb0908c908c90600401613370565b60006040518083038186803b158015610bc857600080fd5b505afa158015610bdc573d6000803e3d6000fd5b50610c009250610bf591505060a08b0160808c0161290f565b8a60a0013584611746565b610c0d89606001356117d1565b610c21856106a760e08e0160c08f0161290f565b610c358561036e60a08c0160808d0161290f565b610c4f610c428c80612f91565b60408b0135908989611c27565b506000610c5b82611af3565b905073ffffffffffffffffffffffffffffffffffffffff811663af9bb76f610c838d80612f91565b8d60c0016020810190610c96919061290f565b610ca660a08e0160808f0161290f565b610cb360208f018f61302d565b60006040518663ffffffff1660e01b8152600401610cd5959493929190612fcf565b600060405180830381600087803b158015610cef57600080fd5b505af1158015610d03573d6000803e3d6000fd5b50505073ffffffffffffffffffffffffffffffffffffffff8216905063af9bb76f610d2e8b80612f91565b610d3e60a08d0160808e0161290f565b8e60c0016020810190610d51919061290f565b8f8060600190610d61919061302d565b60006040518663ffffffff1660e01b8152600401610d83959493929190612fcf565b600060405180830381600087803b158015610d9d57600080fd5b505af1158015610db1573d6000803e3d6000fd5b505050508073ffffffffffffffffffffffffffffffffffffffff16639d133c0f858d60c0016020810190610de5919061290f565b868d6080016020810190610df9919061290f565b6040518563ffffffff1660e01b8152600401610e189493929190613199565b600060405180830381600087803b158015610e3257600080fd5b505af1158015610e46573d6000803e3d6000fd5b5050505050610e6c8a60c0016020810190610e61919061290f565b8b60e0013583611b3b565b610e8a610e7f60a08a0160808b0161290f565b8960a0013583611b3b565b8373ffffffffffffffffffffffffffffffffffffffff167fd05b9b5a188aebbec78648c1d36f7305832a375cde597db490c813281d8ad2c48b8a604051610a68929190613383565b610eda611cb4565b610ee46000611d35565b565b610eee6115c9565b60015473ffffffffffffffffffffffffffffffffffffffff16610f10816116c0565b73ffffffffffffffffffffffffffffffffffffffff1663583b8ace8c8c6040518363ffffffff1660e01b8152600401610f4a929190613370565b60006040518083038186803b158015610f6257600080fd5b505afa158015610f76573d6000803e3d6000fd5b50610f9a9250610f8f91505060a08d0160808e0161290f565b8c60a0013583611746565b610fa78b606001356117d1565b610fbb8661036e60a08e0160808f0161290f565b610fcb60408c01358a8a8a611c27565b610fde85610fd88b612eda565b90611daa565b8a6000610fea83611af3565b905073ffffffffffffffffffffffffffffffffffffffff811663af9bb76f6110128480612f91565b61102260a086016080870161290f565b8b8a60006040518663ffffffff1660e01b8152600401611046959493929190612fcf565b600060405180830381600087803b15801561106057600080fd5b505af1158015611074573d6000803e3d6000fd5b50505073ffffffffffffffffffffffffffffffffffffffff8216905063af9bb76f8c8a6110a760a087016080880161290f565b6110b4602088018861302d565b60016040518663ffffffff1660e01b81526004016110d6959493929190612fcf565b600060405180830381600087803b1580156110f057600080fd5b505af1158015611104573d6000803e3d6000fd5b50505073ffffffffffffffffffffffffffffffffffffffff82169050639d133c0f868a8761113860a088016080890161290f565b6040518563ffffffff1660e01b81526004016111579493929190613199565b600060405180830381600087803b15801561117157600080fd5b505af1158015611185573d6000803e3d6000fd5b50505050506111ab8160800160208101906111a0919061290f565b8260a0013584611b3b565b8673ffffffffffffffffffffffffffffffffffffffff167f20c37751be8d81c8a096a6748c22b4a0baf75620b4d32ce47b59657f6e4332b0828c6040516111f39291906133a8565b60405180910390a2505050505050505050505050565b6112116115c9565b60015473ffffffffffffffffffffffffffffffffffffffff16611233816116c0565b73ffffffffffffffffffffffffffffffffffffffff1663583b8ace85856040518363ffffffff1660e01b815260040161126d929190613370565b60006040518083038186803b15801561128557600080fd5b505afa158015611299573d6000803e3d6000fd5b505050506112b4828560800160208101906106a7919061290f565b6112d26112c760a086016080870161290f565b8560a0013583611746565b6112f06112e560a086016080870161290f565b8560a0013583611b3b565b7f46535ee748de804c8a71df0223237ddffce4c52a72d79d83d4450ef4731799398460405161072e91906133cd565b611327611cb4565b73ffffffffffffffffffffffffffffffffffffffff81166113ca576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201527f64647265737300000000000000000000000000000000000000000000000000006064820152608401610351565b6113d381611d35565b50565b6113de6115c9565b60015473ffffffffffffffffffffffffffffffffffffffff16611400816116c0565b73ffffffffffffffffffffffffffffffffffffffff166376a4e08185856040518363ffffffff1660e01b815260040161143a9291906132d5565b60006040518083038186803b15801561145257600080fd5b505afa158015611466573d6000803e3d6000fd5b50505050611481828560800160208101906106a7919061290f565b6114946112c760a086016080870161290f565b6114a76112e560a086016080870161290f565b7f62780071fcb49164d6377c8d9d74ae1aa7f519344e50fa89a2544f8cd5006dfd8460405161072e91906133e0565b6114de611cb4565b73ffffffffffffffffffffffffffffffffffffffff811661152e5760026040517fb75267270000000000000000000000000000000000000000000000000000000081526004016103519190612e58565b6001546040805173ffffffffffffffffffffffffffffffffffffffff808516825290921660208301527f56ec4b34248fc262df988624e9fdb24ff3514bb4c960cc05596ed05d23b64453910160405180910390a1600180547fffffffffffffffffffffffff00000000000000000000000000000000000000001673ffffffffffffffffffffffffffffffffffffffff92909216919091179055565b600154604080517f95623641000000000000000000000000000000000000000000000000000000008152905160009273ffffffffffffffffffffffffffffffffffffffff16916395623641916004808301926020929190829003018186803b15801561163457600080fd5b505afa158015611648573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061166c91906133f3565b90503373ffffffffffffffffffffffffffffffffffffffff8216146113d35760006040517fb75267270000000000000000000000000000000000000000000000000000000081526004016103519190612e58565b60008173ffffffffffffffffffffffffffffffffffffffff1663eca16ca96040518163ffffffff1660e01b815260040160206040518083038186803b15801561170857600080fd5b505afa15801561171c573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061174091906133f3565b92915050565b6040517fae73462900000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff84811660048301526024820184905282169063ae7346299060440160006040518083038186803b1580156117b457600080fd5b505afa1580156117c8573d6000803e3d6000fd5b50505050505050565b428110156113d35760046040517fb75267270000000000000000000000000000000000000000000000000000000081526004016103519190612e58565b8073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614156118775760026040517f71d246460000000000000000000000000000000000000000000000000000000081526004016103519190613410565b5050565b368183116118b85760036040517fb75267270000000000000000000000000000000000000000000000000000000081526004016103519190612e58565b8383838181106118ca576118ca613424565b90506020028101906118dc9190612f91565b949350505050565b61190f6040518060800160405280606081526020016060815260200160608152602001606081525090565b6040805160006080820181815260a083018452825282518181526020818101909452611954938301915081526040808a0151602083015260608a015191015283611daa565b60005b865151811015611abe5785818151811061197357611973613424565b602002602001015173ffffffffffffffffffffffffffffffffffffffff16876000015182815181106119a7576119a7613424565b602002602001015173ffffffffffffffffffffffffffffffffffffffff16141580611a7c5750611a4f876020015182815181106119e6576119e6613424565b6020026020010151858381518110611a0057611a00613424565b6020026020010151878481518110611a1a57611a1a613424565b6020026020010151604051602001611a3491815260200190565b60405160208183030381529060405280519060200120611e84565b158015611a7c57506000801b87602001518281518110611a7157611a71613424565b602002602001015114155b15611ab65760006040517f71d246460000000000000000000000000000000000000000000000000000000081526004016103519190613410565b600101611957565b604051806080016040528087815260200186815260200188604001518152602001886060015181525091505095945050505050565b60008173ffffffffffffffffffffffffffffffffffffffff1663430bf08a6040518163ffffffff1660e01b815260040160206040518083038186803b15801561170857600080fd5b6040517f1d79f32500000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff848116600483015260248201849052821690631d79f32590604401600060405180830381600087803b158015611bab57600080fd5b505af11580156117c8573d6000803e3d6000fd5b8073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff16146118775760016040517f71d246460000000000000000000000000000000000000000000000000000000081526004016103519190613410565b6000611c338482611eca565b9050611c7485848480806020026020016040519081016040528093929190818152602001838360200280828437600092019190915250869250611e84915050565b611cad5760006040517f71d246460000000000000000000000000000000000000000000000000000000081526004016103519190613410565b5050505050565b60005473ffffffffffffffffffffffffffffffffffffffff163314610ee4576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e65726044820152606401610351565b6000805473ffffffffffffffffffffffffffffffffffffffff8381167fffffffffffffffffffffffff0000000000000000000000000000000000000000831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b6000805b836040015151811015611e4157600073ffffffffffffffffffffffffffffffffffffffff1684604001518281518110611de957611de9613424565b602002602001015173ffffffffffffffffffffffffffffffffffffffff161415611e395783606001518181518110611e2357611e23613424565b602002602001015182611e369190613453565b91505b600101611dae565b5081811115611e7f5760006040517f71d246460000000000000000000000000000000000000000000000000000000081526004016103519190613410565b505050565b600081815b8451811015611ebf57611eb582868381518110611ea857611ea8613424565b6020026020010151611fa9565b9150600101611e89565b509093149392505050565b6000611f51611ed98480612e72565b80806020026020016040519081016040528093929190818152602001838360200280828437600092019190915250611f18925050506020860186612e72565b80806020026020016040519081016040528093929190818152602001838360200280828437600092019190915250879250611fd5915050565b9150611fa2611f636040850185612e72565b80806020026020016040519081016040528093929190818152602001838360200280828437600092019190915250611f18925050506060860186612e72565b9392505050565b6000818310611fc5576000828152602084905260409020611fa2565b5060009182526020526040902090565b82518251600091908114611fe857600080fd5b6040516020860160208601815b60208502830181101561202d5780518452815160208501528660408501526054600c8501209650602081019050602082019150611ff5565b5094979650505050505050565b6000610100828403121561204d57600080fd5b50919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b6040516060810167ffffffffffffffff811182821017156120a5576120a5612053565b60405290565b6040516080810167ffffffffffffffff811182821017156120a5576120a5612053565b604051601f82017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe016810167ffffffffffffffff8111828210171561211557612115612053565b604052919050565b600082601f83011261212e57600080fd5b813567ffffffffffffffff81111561214857612148612053565b61217960207fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0601f840116016120ce565b81815284602083860101111561218e57600080fd5b816020850160208301376000918101602001919091529392505050565b73ffffffffffffffffffffffffffffffffffffffff811681146113d357600080fd5b80356121d8816121ab565b919050565b600067ffffffffffffffff8211156121f7576121f7612053565b5060051b60200190565b600082601f83011261221257600080fd5b81356020612227612222836121dd565b6120ce565b82815260059290921b8401810191818101908684111561224657600080fd5b8286015b8481101561226a57803561225d816121ab565b835291830191830161224a565b509695505050505050565b600082601f83011261228657600080fd5b81356020612296612222836121dd565b82815260059290921b840181019181810190868411156122b557600080fd5b8286015b8481101561226a57803583529183019183016122b9565b6000606082840312156122e257600080fd5b6122ea612082565b9050813567ffffffffffffffff8082111561230457600080fd5b61231085838601612201565b835260209150818401358181111561232757600080fd5b61233386828701612275565b838501525060408401358181111561234a57600080fd5b8401601f8101861361235b57600080fd5b8035612369612222826121dd565b81815260059190911b8201840190848101908883111561238857600080fd5b8584015b838110156123c0578035868111156123a45760008081fd5b6123b28b8983890101612275565b84525091860191860161238c565b50604087015250939695505050505050565b60006040828403121561204d57600080fd5b60006060828403121561204d57600080fd5b60008060008060008060008060006101a08a8c03121561241557600080fd5b893567ffffffffffffffff8082111561242d57600080fd5b6124398d838e0161203a565b9a5060208c013591508082111561244f57600080fd5b61245b8d838e0161211d565b995060408c0135985061247060608d016121cd565b975060808c013591508082111561248657600080fd5b6124928d838e016122d0565b965060a08c0135955060c08c01359150808211156124af57600080fd5b506124bc8c828d016123d2565b9350506124cc8b60e08c016123e4565b91506124dc8b6101408c016123e4565b90509295985092959850929598565b60008060006060848603121561250057600080fd5b833567ffffffffffffffff8082111561251857600080fd5b6125248783880161203a565b9450602086013591508082111561253a57600080fd5b506125478682870161211d565b9250506040840135612558816121ab565b809150509250925092565b600060c0828403121561204d57600080fd5b600080600080600080600080610180898b03121561259257600080fd5b883567ffffffffffffffff808211156125aa57600080fd5b6125b68c838d01612563565b995060208b01359150808211156125cc57600080fd5b6125d88c838d0161211d565b985060408b01359150808211156125ee57600080fd5b6125fa8c838d016122d0565b975061260860608c016121cd565b965060808b0135955060a08b013591508082111561262557600080fd5b506126328b828c016123d2565b9350506126428a60c08b016123e4565b91506126528a6101208b016123e4565b90509295985092959890939650565b60008083601f84011261267357600080fd5b50813567ffffffffffffffff81111561268b57600080fd5b6020830191508360208260051b85010111156126a657600080fd5b9250929050565b60008060008060008060008060006101808a8c0312156126cc57600080fd5b893567ffffffffffffffff808211156126e457600080fd5b6126f08d838e0161203a565b9a5060208c013591508082111561270657600080fd5b6127128d838e0161211d565b995060408c013591508082111561272857600080fd5b6127348d838e01612563565b985060608c013591508082111561274a57600080fd5b6127568d838e0161211d565b975060808c013591508082111561276c57600080fd5b506127798c828d01612661565b909650945061278c905060a08b016121cd565b925061279b8b60c08c016123e4565b91506124dc8b6101208c016123e4565b60006080828403121561204d57600080fd5b6000806000806000806000806000806101a08b8d0312156127dd57600080fd5b8a3567ffffffffffffffff808211156127f557600080fd5b6128018e838f01612563565b9b5060208d013591508082111561281757600080fd5b6128238e838f0161211d565b9a5060408d013591508082111561283957600080fd5b6128458e838f016127ab565b995060608d013591508082111561285b57600080fd5b6128678e838f01612661565b909950975087915061287b60808e016121cd565b965060a08d0135955060c08d013591508082111561289857600080fd5b506128a58d828e016123d2565b9350506128b58c60e08d016123e4565b91506128c58c6101408d016123e4565b90509295989b9194979a5092959850565b6000806000606084860312156128eb57600080fd5b833567ffffffffffffffff8082111561290357600080fd5b61252487838801612563565b60006020828403121561292157600080fd5b8135611fa2816121ab565b600082357fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff8183360301811261296057600080fd5b90910192915050565b60008083357fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe184360301811261299e57600080fd5b830160208101925035905067ffffffffffffffff8111156129be57600080fd5b8060051b36038313156126a657600080fd5b8183526000602080850194508260005b85811015612a1b5781356129f3816121ab565b73ffffffffffffffffffffffffffffffffffffffff16875295820195908201906001016129e0565b509495945050505050565b81835260007f07ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff831115612a5857600080fd5b8260051b8083602087013760009401602001938452509192915050565b6000612a818283612969565b60808552612a936080860182846129d0565b915050612aa36020840184612969565b8583036020870152612ab6838284612a26565b92505050612ac76040840184612969565b8583036040870152612ada8382846129d0565b92505050612aeb6060840184612969565b8583036060870152612afe838284612a26565b9695505050505050565b81835260006020808501808196508560051b810191508460005b87811015612b54578284038952612b4284612b3d848a61292c565b612a75565b98850198935090840190600101612b22565b5091979650505050505050565b81835260006020808501808196508560051b81019150846000805b88811015612c18578385038a5282357fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffa1893603018112612bba578283fd5b88016060612bc8828061292c565b818852612bd782890182612a75565b915050612be68883018361292c565b87820389890152612bf78282612a75565b60409384013598909301979097525099860199945091850191600101612b7c565b509298975050505050505050565b600082357fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc183360301811261296057600080fd5b6000612c668283612969565b60408552612c786040860182846129d0565b915050612c886020840184612969565b8583036020870152612afe838284612a26565b6000610100612caa838461292c565b818552612cb982860182612a75565b915050612cc96020840184612969565b8583036020870152612cdc838284612b08565b92505050612ced6040840184612969565b8583036040870152612d00838284612b61565b92505050612d116060840184612c26565b8482036060860152612d238282612c5a565b915050612d32608084016121cd565b73ffffffffffffffffffffffffffffffffffffffff16608085015260a08381013590850152612d6360c084016121cd565b73ffffffffffffffffffffffffffffffffffffffff1660c085015260e09283013592909301919091525090565b6000815180845260005b81811015612db657602081850181015186830182015201612d9a565b81811115612dc8576000602083870101525b50601f017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0169290920160200192915050565b604081526000612e0e6040830185612c9b565b8281036020840152612e208185612d90565b95945050505050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052602160045260246000fd5b6020810160058310612e6c57612e6c612e29565b91905290565b60008083357fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe1843603018112612ea757600080fd5b83018035915067ffffffffffffffff821115612ec257600080fd5b6020019150600581901b36038213156126a657600080fd5b600060808236031215612eec57600080fd5b612ef46120ab565b823567ffffffffffffffff80821115612f0c57600080fd5b612f1836838701612201565b83526020850135915080821115612f2e57600080fd5b612f3a36838701612275565b60208401526040850135915080821115612f5357600080fd5b612f5f36838701612201565b60408401526060850135915080821115612f7857600080fd5b50612f8536828601612275565b60608301525092915050565b600082357fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff81833603018112612fc557600080fd5b9190910192915050565b60a081526000612fe260a0830188612a75565b73ffffffffffffffffffffffffffffffffffffffff87811660208501528616604084015282810360608401526130188186612c5a565b91505082151560808301529695505050505050565b600082357fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc1833603018112612fc557600080fd5b600081518084526020808501945080840160005b83811015612a1b57815173ffffffffffffffffffffffffffffffffffffffff1687529582019590820190600101613075565b600081518084526020808501945080840160005b83811015612a1b578151875295820195908201906001016130bb565b60008151608084526130ec6080850182613061565b90506020830151848203602086015261310582826130a7565b9150506040830151848203604086015261311f8282613061565b91505060608301518482036060860152612e2082826130a7565b60a081526000612fe260a08301886130d7565b8035613157816121ab565b73ffffffffffffffffffffffffffffffffffffffff8082168452602083013560208501526040830135915061318b826121ab565b808216604085015250505050565b61010081016131a8828761314c565b73ffffffffffffffffffffffffffffffffffffffff80861660608401526131d2608084018661314c565b80841660e08401525095945050505050565b6060815260006131f76060830186612c9b565b828103602084015261320981866130d7565b915050826040830152949350505050565b602081526000611fa26020830184612c9b565b6000613239828361292c565b60c0845261324a60c0850182612a75565b9050613259602084018461292c565b848203602086015261326b8282612a75565b91505061327b6040840184612c26565b848203604086015261328d8282612c5a565b9150506060830135606085015260808301356132a8816121ab565b73ffffffffffffffffffffffffffffffffffffffff16608085015260a09283013592909301919091525090565b604081526000612e0e604083018561322d565b6040815260006132fb604083018561322d565b8281036020840152612e2081856130d7565b6000613319828361292c565b60c0845261332a60c0850182612a75565b90506133396020840184612c26565b848203602086015261334b8282612c5a565b915050604083013560408501526060830135606085015260808301356132a8816121ab565b604081526000612e0e604083018561330d565b6040815260006133966040830185612c9b565b8281036020840152612e20818561330d565b6040815260006133bb604083018561330d565b8281036020840152612e208185612a75565b602081526000611fa2602083018461330d565b602081526000611fa2602083018461322d565b60006020828403121561340557600080fd5b8151611fa2816121ab565b6020810160038310612e6c57612e6c612e29565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b6000821982111561348d577f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b50019056fea2646970667358221220f5484028841da0e8232b1ecc64718aa30adc8106ae13f7e27e0eed28dd44873764736f6c63430008090033

Deployed Bytecode

0x608060405234801561001057600080fd5b50600436106100d45760003560e01c80638da5cb5b11610081578063f2fde38b1161005b578063f2fde38b146101bc578063f92b11ab146101cf578063fa0b7dc8146101e257600080fd5b80638da5cb5b14610178578063cdbf9ba314610196578063d25c940e146101a957600080fd5b80634ad1f254116100b25780634ad1f254146101145780636e9e790c1461015d578063715018a61461017057600080fd5b8063101a9c69146100d9578063117e5db7146100ee578063307f3a2b14610101575b600080fd5b6100ec6100e73660046123f6565b6101f5565b005b6100ec6100fc3660046124eb565b6105fc565b6100ec61010f366004612575565b61073c565b6001546101349073ffffffffffffffffffffffffffffffffffffffff1681565b60405173ffffffffffffffffffffffffffffffffffffffff909116815260200160405180910390f35b6100ec61016b3660046126ad565b610a7c565b6100ec610ed2565b60005473ffffffffffffffffffffffffffffffffffffffff16610134565b6100ec6101a43660046127bd565b610ee6565b6100ec6101b73660046128d6565b611209565b6100ec6101ca36600461290f565b61131f565b6100ec6101dd3660046128d6565b6113d6565b6100ec6101f036600461290f565b6114d6565b6101fd6115c9565b60015473ffffffffffffffffffffffffffffffffffffffff1661021f816116c0565b73ffffffffffffffffffffffffffffffffffffffff16630ab253438b8b6040518363ffffffff1660e01b8152600401610259929190612dfb565b60006040518083038186803b15801561027157600080fd5b505afa158015610285573d6000803e3d6000fd5b506102a9925061029e91505060e08c0160c08d0161290f565b8b60e0013583611746565b6102b68a60a001356117d1565b60006102c860a08c0160808d0161290f565b905073ffffffffffffffffffffffffffffffffffffffff8116158061031857508773ffffffffffffffffffffffffffffffffffffffff168173ffffffffffffffffffffffffffffffffffffffff16145b61035a5760016040517fb75267270000000000000000000000000000000000000000000000000000000081526004016103519190612e58565b60405180910390fd5b61038a8861036e60e08e0160c08f0161290f565b73ffffffffffffffffffffffffffffffffffffffff169061180e565b5060006103a361039d60208d018d612e72565b8b61187b565b6103ac90612eda565b8751602089015160408a01519293506000926103cc92859290918b6118e4565b90508b60006103da85611af3565b905073ffffffffffffffffffffffffffffffffffffffff811663af9bb76f6104028480612f91565b61041260e0860160c0870161290f565b8e8c60006040518663ffffffff1660e01b8152600401610436959493929190612fcf565b600060405180830381600087803b15801561045057600080fd5b505af1158015610464573d6000803e3d6000fd5b50505073ffffffffffffffffffffffffffffffffffffffff8216905063af9bb76f848d61049760e0870160c0880161290f565b6104a4606088018861302d565b60016040518663ffffffff1660e01b81526004016104c6959493929190613139565b600060405180830381600087803b1580156104e057600080fd5b505af11580156104f4573d6000803e3d6000fd5b50505073ffffffffffffffffffffffffffffffffffffffff82169050639d133c0f8861052660e0860160c0870161290f565b898f6040518563ffffffff1660e01b81526004016105479493929190613199565b600060405180830381600087803b15801561056157600080fd5b505af1158015610575573d6000803e3d6000fd5b505050505061059b8160c0016020810190610590919061290f565b8260e0013586611b3b565b8973ffffffffffffffffffffffffffffffffffffffff167f3f9640238502f8504ff0206cd86ad2d403277abc84d1731223208e0972b52f6a82848e6040516105e5939291906131e4565b60405180910390a250505050505050505050505050565b6106046115c9565b60015473ffffffffffffffffffffffffffffffffffffffff16610626816116c0565b73ffffffffffffffffffffffffffffffffffffffff16630ab2534385856040518363ffffffff1660e01b8152600401610660929190612dfb565b60006040518083038186803b15801561067857600080fd5b505afa15801561068c573d6000803e3d6000fd5b505050506106c3828560c00160208101906106a7919061290f565b73ffffffffffffffffffffffffffffffffffffffff1690611bbf565b6106e16106d660e0860160c0870161290f565b8560e0013583611746565b6106ff6106f460e0860160c0870161290f565b8560e0013583611b3b565b7f9b415ec38307548cbbe86c6adf2afdd4ff85a40b033b75d2bc18e60d379122308460405161072e919061321a565b60405180910390a150505050565b6107446115c9565b60015473ffffffffffffffffffffffffffffffffffffffff16610766816116c0565b73ffffffffffffffffffffffffffffffffffffffff166376a4e0818a8a6040518363ffffffff1660e01b81526004016107a09291906132d5565b60006040518083038186803b1580156107b857600080fd5b505afa1580156107cc573d6000803e3d6000fd5b506107f092506107e591505060a08b0160808c0161290f565b8a60a0013583611746565b6107fd89606001356117d1565b6108118661036e60a08c0160808d0161290f565b6000610848886000015189602001518a60400151898e80602001906108369190612f91565b61083f90612eda565b939291906118e4565b9050600061085583611af3565b905073ffffffffffffffffffffffffffffffffffffffff811663af9bb76f61087d8d80612f91565b8d6080016020810190610890919061290f565b8b8a60006040518663ffffffff1660e01b81526004016108b4959493929190612fcf565b600060405180830381600087803b1580156108ce57600080fd5b505af11580156108e2573d6000803e3d6000fd5b505050508073ffffffffffffffffffffffffffffffffffffffff1663af9bb76f838a8e6080016020810190610917919061290f565b8f8060400190610927919061302d565b60016040518663ffffffff1660e01b8152600401610949959493929190613139565b600060405180830381600087803b15801561096357600080fd5b505af1158015610977573d6000803e3d6000fd5b505050508073ffffffffffffffffffffffffffffffffffffffff16639d133c0f868a878f60800160208101906109ad919061290f565b6040518563ffffffff1660e01b81526004016109cc9493929190613199565b600060405180830381600087803b1580156109e657600080fd5b505af11580156109fa573d6000803e3d6000fd5b5050505050610a208a6080016020810190610a15919061290f565b8b60a0013584611b3b565b8673ffffffffffffffffffffffffffffffffffffffff167f5a37390d9ff1b75e238fdbd4c291d51c0b1eb2f61f2432f7ed046f9e1d195e618b83604051610a689291906132e8565b60405180910390a250505050505050505050565b610a846115c9565b60015473ffffffffffffffffffffffffffffffffffffffff166000610aa8826116c0565b6040517f0ab2534300000000000000000000000000000000000000000000000000000000815290915073ffffffffffffffffffffffffffffffffffffffff821690630ab2534390610aff908e908e90600401612dfb565b60006040518083038186803b158015610b1757600080fd5b505afa158015610b2b573d6000803e3d6000fd5b50610b4f9250610b4491505060e08d0160c08e0161290f565b8c60e0013584611746565b610b5c8b60a001356117d1565b6040517f583b8ace00000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff82169063583b8ace90610bb0908c908c90600401613370565b60006040518083038186803b158015610bc857600080fd5b505afa158015610bdc573d6000803e3d6000fd5b50610c009250610bf591505060a08b0160808c0161290f565b8a60a0013584611746565b610c0d89606001356117d1565b610c21856106a760e08e0160c08f0161290f565b610c358561036e60a08c0160808d0161290f565b610c4f610c428c80612f91565b60408b0135908989611c27565b506000610c5b82611af3565b905073ffffffffffffffffffffffffffffffffffffffff811663af9bb76f610c838d80612f91565b8d60c0016020810190610c96919061290f565b610ca660a08e0160808f0161290f565b610cb360208f018f61302d565b60006040518663ffffffff1660e01b8152600401610cd5959493929190612fcf565b600060405180830381600087803b158015610cef57600080fd5b505af1158015610d03573d6000803e3d6000fd5b50505073ffffffffffffffffffffffffffffffffffffffff8216905063af9bb76f610d2e8b80612f91565b610d3e60a08d0160808e0161290f565b8e60c0016020810190610d51919061290f565b8f8060600190610d61919061302d565b60006040518663ffffffff1660e01b8152600401610d83959493929190612fcf565b600060405180830381600087803b158015610d9d57600080fd5b505af1158015610db1573d6000803e3d6000fd5b505050508073ffffffffffffffffffffffffffffffffffffffff16639d133c0f858d60c0016020810190610de5919061290f565b868d6080016020810190610df9919061290f565b6040518563ffffffff1660e01b8152600401610e189493929190613199565b600060405180830381600087803b158015610e3257600080fd5b505af1158015610e46573d6000803e3d6000fd5b5050505050610e6c8a60c0016020810190610e61919061290f565b8b60e0013583611b3b565b610e8a610e7f60a08a0160808b0161290f565b8960a0013583611b3b565b8373ffffffffffffffffffffffffffffffffffffffff167fd05b9b5a188aebbec78648c1d36f7305832a375cde597db490c813281d8ad2c48b8a604051610a68929190613383565b610eda611cb4565b610ee46000611d35565b565b610eee6115c9565b60015473ffffffffffffffffffffffffffffffffffffffff16610f10816116c0565b73ffffffffffffffffffffffffffffffffffffffff1663583b8ace8c8c6040518363ffffffff1660e01b8152600401610f4a929190613370565b60006040518083038186803b158015610f6257600080fd5b505afa158015610f76573d6000803e3d6000fd5b50610f9a9250610f8f91505060a08d0160808e0161290f565b8c60a0013583611746565b610fa78b606001356117d1565b610fbb8661036e60a08e0160808f0161290f565b610fcb60408c01358a8a8a611c27565b610fde85610fd88b612eda565b90611daa565b8a6000610fea83611af3565b905073ffffffffffffffffffffffffffffffffffffffff811663af9bb76f6110128480612f91565b61102260a086016080870161290f565b8b8a60006040518663ffffffff1660e01b8152600401611046959493929190612fcf565b600060405180830381600087803b15801561106057600080fd5b505af1158015611074573d6000803e3d6000fd5b50505073ffffffffffffffffffffffffffffffffffffffff8216905063af9bb76f8c8a6110a760a087016080880161290f565b6110b4602088018861302d565b60016040518663ffffffff1660e01b81526004016110d6959493929190612fcf565b600060405180830381600087803b1580156110f057600080fd5b505af1158015611104573d6000803e3d6000fd5b50505073ffffffffffffffffffffffffffffffffffffffff82169050639d133c0f868a8761113860a088016080890161290f565b6040518563ffffffff1660e01b81526004016111579493929190613199565b600060405180830381600087803b15801561117157600080fd5b505af1158015611185573d6000803e3d6000fd5b50505050506111ab8160800160208101906111a0919061290f565b8260a0013584611b3b565b8673ffffffffffffffffffffffffffffffffffffffff167f20c37751be8d81c8a096a6748c22b4a0baf75620b4d32ce47b59657f6e4332b0828c6040516111f39291906133a8565b60405180910390a2505050505050505050505050565b6112116115c9565b60015473ffffffffffffffffffffffffffffffffffffffff16611233816116c0565b73ffffffffffffffffffffffffffffffffffffffff1663583b8ace85856040518363ffffffff1660e01b815260040161126d929190613370565b60006040518083038186803b15801561128557600080fd5b505afa158015611299573d6000803e3d6000fd5b505050506112b4828560800160208101906106a7919061290f565b6112d26112c760a086016080870161290f565b8560a0013583611746565b6112f06112e560a086016080870161290f565b8560a0013583611b3b565b7f46535ee748de804c8a71df0223237ddffce4c52a72d79d83d4450ef4731799398460405161072e91906133cd565b611327611cb4565b73ffffffffffffffffffffffffffffffffffffffff81166113ca576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201527f64647265737300000000000000000000000000000000000000000000000000006064820152608401610351565b6113d381611d35565b50565b6113de6115c9565b60015473ffffffffffffffffffffffffffffffffffffffff16611400816116c0565b73ffffffffffffffffffffffffffffffffffffffff166376a4e08185856040518363ffffffff1660e01b815260040161143a9291906132d5565b60006040518083038186803b15801561145257600080fd5b505afa158015611466573d6000803e3d6000fd5b50505050611481828560800160208101906106a7919061290f565b6114946112c760a086016080870161290f565b6114a76112e560a086016080870161290f565b7f62780071fcb49164d6377c8d9d74ae1aa7f519344e50fa89a2544f8cd5006dfd8460405161072e91906133e0565b6114de611cb4565b73ffffffffffffffffffffffffffffffffffffffff811661152e5760026040517fb75267270000000000000000000000000000000000000000000000000000000081526004016103519190612e58565b6001546040805173ffffffffffffffffffffffffffffffffffffffff808516825290921660208301527f56ec4b34248fc262df988624e9fdb24ff3514bb4c960cc05596ed05d23b64453910160405180910390a1600180547fffffffffffffffffffffffff00000000000000000000000000000000000000001673ffffffffffffffffffffffffffffffffffffffff92909216919091179055565b600154604080517f95623641000000000000000000000000000000000000000000000000000000008152905160009273ffffffffffffffffffffffffffffffffffffffff16916395623641916004808301926020929190829003018186803b15801561163457600080fd5b505afa158015611648573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061166c91906133f3565b90503373ffffffffffffffffffffffffffffffffffffffff8216146113d35760006040517fb75267270000000000000000000000000000000000000000000000000000000081526004016103519190612e58565b60008173ffffffffffffffffffffffffffffffffffffffff1663eca16ca96040518163ffffffff1660e01b815260040160206040518083038186803b15801561170857600080fd5b505afa15801561171c573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061174091906133f3565b92915050565b6040517fae73462900000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff84811660048301526024820184905282169063ae7346299060440160006040518083038186803b1580156117b457600080fd5b505afa1580156117c8573d6000803e3d6000fd5b50505050505050565b428110156113d35760046040517fb75267270000000000000000000000000000000000000000000000000000000081526004016103519190612e58565b8073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff1614156118775760026040517f71d246460000000000000000000000000000000000000000000000000000000081526004016103519190613410565b5050565b368183116118b85760036040517fb75267270000000000000000000000000000000000000000000000000000000081526004016103519190612e58565b8383838181106118ca576118ca613424565b90506020028101906118dc9190612f91565b949350505050565b61190f6040518060800160405280606081526020016060815260200160608152602001606081525090565b6040805160006080820181815260a083018452825282518181526020818101909452611954938301915081526040808a0151602083015260608a015191015283611daa565b60005b865151811015611abe5785818151811061197357611973613424565b602002602001015173ffffffffffffffffffffffffffffffffffffffff16876000015182815181106119a7576119a7613424565b602002602001015173ffffffffffffffffffffffffffffffffffffffff16141580611a7c5750611a4f876020015182815181106119e6576119e6613424565b6020026020010151858381518110611a0057611a00613424565b6020026020010151878481518110611a1a57611a1a613424565b6020026020010151604051602001611a3491815260200190565b60405160208183030381529060405280519060200120611e84565b158015611a7c57506000801b87602001518281518110611a7157611a71613424565b602002602001015114155b15611ab65760006040517f71d246460000000000000000000000000000000000000000000000000000000081526004016103519190613410565b600101611957565b604051806080016040528087815260200186815260200188604001518152602001886060015181525091505095945050505050565b60008173ffffffffffffffffffffffffffffffffffffffff1663430bf08a6040518163ffffffff1660e01b815260040160206040518083038186803b15801561170857600080fd5b6040517f1d79f32500000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff848116600483015260248201849052821690631d79f32590604401600060405180830381600087803b158015611bab57600080fd5b505af11580156117c8573d6000803e3d6000fd5b8073ffffffffffffffffffffffffffffffffffffffff168273ffffffffffffffffffffffffffffffffffffffff16146118775760016040517f71d246460000000000000000000000000000000000000000000000000000000081526004016103519190613410565b6000611c338482611eca565b9050611c7485848480806020026020016040519081016040528093929190818152602001838360200280828437600092019190915250869250611e84915050565b611cad5760006040517f71d246460000000000000000000000000000000000000000000000000000000081526004016103519190613410565b5050505050565b60005473ffffffffffffffffffffffffffffffffffffffff163314610ee4576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e65726044820152606401610351565b6000805473ffffffffffffffffffffffffffffffffffffffff8381167fffffffffffffffffffffffff0000000000000000000000000000000000000000831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b6000805b836040015151811015611e4157600073ffffffffffffffffffffffffffffffffffffffff1684604001518281518110611de957611de9613424565b602002602001015173ffffffffffffffffffffffffffffffffffffffff161415611e395783606001518181518110611e2357611e23613424565b602002602001015182611e369190613453565b91505b600101611dae565b5081811115611e7f5760006040517f71d246460000000000000000000000000000000000000000000000000000000081526004016103519190613410565b505050565b600081815b8451811015611ebf57611eb582868381518110611ea857611ea8613424565b6020026020010151611fa9565b9150600101611e89565b509093149392505050565b6000611f51611ed98480612e72565b80806020026020016040519081016040528093929190818152602001838360200280828437600092019190915250611f18925050506020860186612e72565b80806020026020016040519081016040528093929190818152602001838360200280828437600092019190915250879250611fd5915050565b9150611fa2611f636040850185612e72565b80806020026020016040519081016040528093929190818152602001838360200280828437600092019190915250611f18925050506060860186612e72565b9392505050565b6000818310611fc5576000828152602084905260409020611fa2565b5060009182526020526040902090565b82518251600091908114611fe857600080fd5b6040516020860160208601815b60208502830181101561202d5780518452815160208501528660408501526054600c8501209650602081019050602082019150611ff5565b5094979650505050505050565b6000610100828403121561204d57600080fd5b50919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b6040516060810167ffffffffffffffff811182821017156120a5576120a5612053565b60405290565b6040516080810167ffffffffffffffff811182821017156120a5576120a5612053565b604051601f82017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe016810167ffffffffffffffff8111828210171561211557612115612053565b604052919050565b600082601f83011261212e57600080fd5b813567ffffffffffffffff81111561214857612148612053565b61217960207fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0601f840116016120ce565b81815284602083860101111561218e57600080fd5b816020850160208301376000918101602001919091529392505050565b73ffffffffffffffffffffffffffffffffffffffff811681146113d357600080fd5b80356121d8816121ab565b919050565b600067ffffffffffffffff8211156121f7576121f7612053565b5060051b60200190565b600082601f83011261221257600080fd5b81356020612227612222836121dd565b6120ce565b82815260059290921b8401810191818101908684111561224657600080fd5b8286015b8481101561226a57803561225d816121ab565b835291830191830161224a565b509695505050505050565b600082601f83011261228657600080fd5b81356020612296612222836121dd565b82815260059290921b840181019181810190868411156122b557600080fd5b8286015b8481101561226a57803583529183019183016122b9565b6000606082840312156122e257600080fd5b6122ea612082565b9050813567ffffffffffffffff8082111561230457600080fd5b61231085838601612201565b835260209150818401358181111561232757600080fd5b61233386828701612275565b838501525060408401358181111561234a57600080fd5b8401601f8101861361235b57600080fd5b8035612369612222826121dd565b81815260059190911b8201840190848101908883111561238857600080fd5b8584015b838110156123c0578035868111156123a45760008081fd5b6123b28b8983890101612275565b84525091860191860161238c565b50604087015250939695505050505050565b60006040828403121561204d57600080fd5b60006060828403121561204d57600080fd5b60008060008060008060008060006101a08a8c03121561241557600080fd5b893567ffffffffffffffff8082111561242d57600080fd5b6124398d838e0161203a565b9a5060208c013591508082111561244f57600080fd5b61245b8d838e0161211d565b995060408c0135985061247060608d016121cd565b975060808c013591508082111561248657600080fd5b6124928d838e016122d0565b965060a08c0135955060c08c01359150808211156124af57600080fd5b506124bc8c828d016123d2565b9350506124cc8b60e08c016123e4565b91506124dc8b6101408c016123e4565b90509295985092959850929598565b60008060006060848603121561250057600080fd5b833567ffffffffffffffff8082111561251857600080fd5b6125248783880161203a565b9450602086013591508082111561253a57600080fd5b506125478682870161211d565b9250506040840135612558816121ab565b809150509250925092565b600060c0828403121561204d57600080fd5b600080600080600080600080610180898b03121561259257600080fd5b883567ffffffffffffffff808211156125aa57600080fd5b6125b68c838d01612563565b995060208b01359150808211156125cc57600080fd5b6125d88c838d0161211d565b985060408b01359150808211156125ee57600080fd5b6125fa8c838d016122d0565b975061260860608c016121cd565b965060808b0135955060a08b013591508082111561262557600080fd5b506126328b828c016123d2565b9350506126428a60c08b016123e4565b91506126528a6101208b016123e4565b90509295985092959890939650565b60008083601f84011261267357600080fd5b50813567ffffffffffffffff81111561268b57600080fd5b6020830191508360208260051b85010111156126a657600080fd5b9250929050565b60008060008060008060008060006101808a8c0312156126cc57600080fd5b893567ffffffffffffffff808211156126e457600080fd5b6126f08d838e0161203a565b9a5060208c013591508082111561270657600080fd5b6127128d838e0161211d565b995060408c013591508082111561272857600080fd5b6127348d838e01612563565b985060608c013591508082111561274a57600080fd5b6127568d838e0161211d565b975060808c013591508082111561276c57600080fd5b506127798c828d01612661565b909650945061278c905060a08b016121cd565b925061279b8b60c08c016123e4565b91506124dc8b6101208c016123e4565b60006080828403121561204d57600080fd5b6000806000806000806000806000806101a08b8d0312156127dd57600080fd5b8a3567ffffffffffffffff808211156127f557600080fd5b6128018e838f01612563565b9b5060208d013591508082111561281757600080fd5b6128238e838f0161211d565b9a5060408d013591508082111561283957600080fd5b6128458e838f016127ab565b995060608d013591508082111561285b57600080fd5b6128678e838f01612661565b909950975087915061287b60808e016121cd565b965060a08d0135955060c08d013591508082111561289857600080fd5b506128a58d828e016123d2565b9350506128b58c60e08d016123e4565b91506128c58c6101408d016123e4565b90509295989b9194979a5092959850565b6000806000606084860312156128eb57600080fd5b833567ffffffffffffffff8082111561290357600080fd5b61252487838801612563565b60006020828403121561292157600080fd5b8135611fa2816121ab565b600082357fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff8183360301811261296057600080fd5b90910192915050565b60008083357fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe184360301811261299e57600080fd5b830160208101925035905067ffffffffffffffff8111156129be57600080fd5b8060051b36038313156126a657600080fd5b8183526000602080850194508260005b85811015612a1b5781356129f3816121ab565b73ffffffffffffffffffffffffffffffffffffffff16875295820195908201906001016129e0565b509495945050505050565b81835260007f07ffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff831115612a5857600080fd5b8260051b8083602087013760009401602001938452509192915050565b6000612a818283612969565b60808552612a936080860182846129d0565b915050612aa36020840184612969565b8583036020870152612ab6838284612a26565b92505050612ac76040840184612969565b8583036040870152612ada8382846129d0565b92505050612aeb6060840184612969565b8583036060870152612afe838284612a26565b9695505050505050565b81835260006020808501808196508560051b810191508460005b87811015612b54578284038952612b4284612b3d848a61292c565b612a75565b98850198935090840190600101612b22565b5091979650505050505050565b81835260006020808501808196508560051b81019150846000805b88811015612c18578385038a5282357fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffa1893603018112612bba578283fd5b88016060612bc8828061292c565b818852612bd782890182612a75565b915050612be68883018361292c565b87820389890152612bf78282612a75565b60409384013598909301979097525099860199945091850191600101612b7c565b509298975050505050505050565b600082357fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc183360301811261296057600080fd5b6000612c668283612969565b60408552612c786040860182846129d0565b915050612c886020840184612969565b8583036020870152612afe838284612a26565b6000610100612caa838461292c565b818552612cb982860182612a75565b915050612cc96020840184612969565b8583036020870152612cdc838284612b08565b92505050612ced6040840184612969565b8583036040870152612d00838284612b61565b92505050612d116060840184612c26565b8482036060860152612d238282612c5a565b915050612d32608084016121cd565b73ffffffffffffffffffffffffffffffffffffffff16608085015260a08381013590850152612d6360c084016121cd565b73ffffffffffffffffffffffffffffffffffffffff1660c085015260e09283013592909301919091525090565b6000815180845260005b81811015612db657602081850181015186830182015201612d9a565b81811115612dc8576000602083870101525b50601f017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0169290920160200192915050565b604081526000612e0e6040830185612c9b565b8281036020840152612e208185612d90565b95945050505050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052602160045260246000fd5b6020810160058310612e6c57612e6c612e29565b91905290565b60008083357fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe1843603018112612ea757600080fd5b83018035915067ffffffffffffffff821115612ec257600080fd5b6020019150600581901b36038213156126a657600080fd5b600060808236031215612eec57600080fd5b612ef46120ab565b823567ffffffffffffffff80821115612f0c57600080fd5b612f1836838701612201565b83526020850135915080821115612f2e57600080fd5b612f3a36838701612275565b60208401526040850135915080821115612f5357600080fd5b612f5f36838701612201565b60408401526060850135915080821115612f7857600080fd5b50612f8536828601612275565b60608301525092915050565b600082357fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff81833603018112612fc557600080fd5b9190910192915050565b60a081526000612fe260a0830188612a75565b73ffffffffffffffffffffffffffffffffffffffff87811660208501528616604084015282810360608401526130188186612c5a565b91505082151560808301529695505050505050565b600082357fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffc1833603018112612fc557600080fd5b600081518084526020808501945080840160005b83811015612a1b57815173ffffffffffffffffffffffffffffffffffffffff1687529582019590820190600101613075565b600081518084526020808501945080840160005b83811015612a1b578151875295820195908201906001016130bb565b60008151608084526130ec6080850182613061565b90506020830151848203602086015261310582826130a7565b9150506040830151848203604086015261311f8282613061565b91505060608301518482036060860152612e2082826130a7565b60a081526000612fe260a08301886130d7565b8035613157816121ab565b73ffffffffffffffffffffffffffffffffffffffff8082168452602083013560208501526040830135915061318b826121ab565b808216604085015250505050565b61010081016131a8828761314c565b73ffffffffffffffffffffffffffffffffffffffff80861660608401526131d2608084018661314c565b80841660e08401525095945050505050565b6060815260006131f76060830186612c9b565b828103602084015261320981866130d7565b915050826040830152949350505050565b602081526000611fa26020830184612c9b565b6000613239828361292c565b60c0845261324a60c0850182612a75565b9050613259602084018461292c565b848203602086015261326b8282612a75565b91505061327b6040840184612c26565b848203604086015261328d8282612c5a565b9150506060830135606085015260808301356132a8816121ab565b73ffffffffffffffffffffffffffffffffffffffff16608085015260a09283013592909301919091525090565b604081526000612e0e604083018561322d565b6040815260006132fb604083018561322d565b8281036020840152612e2081856130d7565b6000613319828361292c565b60c0845261332a60c0850182612a75565b90506133396020840184612c26565b848203602086015261334b8282612c5a565b915050604083013560408501526060830135606085015260808301356132a8816121ab565b604081526000612e0e604083018561330d565b6040815260006133966040830185612c9b565b8281036020840152612e20818561330d565b6040815260006133bb604083018561330d565b8281036020840152612e208185612a75565b602081526000611fa2602083018461330d565b602081526000611fa2602083018461322d565b60006020828403121561340557600080fd5b8151611fa2816121ab565b6020810160038310612e6c57612e6c612e29565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b6000821982111561348d577f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b50019056fea2646970667358221220f5484028841da0e8232b1ecc64718aa30adc8106ae13f7e27e0eed28dd44873764736f6c63430008090033

Block Transaction Difficulty Gas Used Reward
View All Blocks Produced

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

Validator Index Block Amount
View All Withdrawals

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

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