Sepolia Testnet

Contract

0xDf5bD98bA74444613FbBc4edcb515Ee75De76925

Overview

ETH Balance

0 ETH

Multichain Info

N/A
Transaction Hash
Method
Block
From
To
Value
Set Collateral P...59187792024-05-17 3:35:487 days ago1715916948IN
0xDf5bD98b...75De76925
0 ETH0.02284621187.23486479
Set Default NFT ...59187772024-05-17 3:35:247 days ago1715916924IN
0xDf5bD98b...75De76925
0 ETH0.02432477186.83052367
Set Time Discoun...58536852024-05-07 7:09:4817 days ago1715065788IN
0xDf5bD98b...75De76925
0 ETH0.0034817555.30986468
Set Time Discoun...58536832024-05-07 7:09:2417 days ago1715065764IN
0xDf5bD98b...75De76925
0 ETH0.0049009859.10351055
Set Time Discoun...58278632024-05-03 11:10:3621 days ago1714734636IN
0xDf5bD98b...75De76925
0 ETH0.0133318858.89655984
Set Time Discoun...58278572024-05-03 11:09:2421 days ago1714734564IN
0xDf5bD98b...75De76925
0 ETH0.0045232154.55578209
Set Time Discoun...58278532024-05-03 11:08:3621 days ago1714734516IN
0xDf5bD98b...75De76925
0 ETH0.0047578457.38564747
Set Default NFT ...57248232024-04-18 13:02:2436 days ago1713445344IN
0xDf5bD98b...75De76925
0 ETH0.000384522.95258819
Set Default NFT ...57247822024-04-18 12:53:3636 days ago1713444816IN
0xDf5bD98b...75De76925
0 ETH0.000397433.0505834
Set Default NFT ...57247782024-04-18 12:52:4836 days ago1713444768IN
0xDf5bD98b...75De76925
0 ETH0.00056413.17082522
Set Default NFT ...57247722024-04-18 12:51:3636 days ago1713444696IN
0xDf5bD98b...75De76925
0 ETH0.000448913.04716723
Set Default NFT ...57247662024-04-18 12:50:2436 days ago1713444624IN
0xDf5bD98b...75De76925
0 ETH0.000578563.25230723
Set Default NFT ...57247622024-04-18 12:49:3636 days ago1713444576IN
0xDf5bD98b...75De76925
0 ETH0.000507383.44437529
Set Collateral P...57240662024-04-18 10:28:2436 days ago1713436104IN
0xDf5bD98b...75De76925
0 ETH0.000157735.11588044
Set Collateral P...57240642024-04-18 10:28:0036 days ago1713436080IN
0xDf5bD98b...75De76925
0 ETH0.000149754.85684462
Set Collateral P...57240632024-04-18 10:27:4836 days ago1713436068IN
0xDf5bD98b...75De76925
0 ETH0.000151984.93124051
Set Collateral P...57240602024-04-18 10:27:1236 days ago1713436032IN
0xDf5bD98b...75De76925
0 ETH0.000158455.13897654
Set Collateral P...57240572024-04-18 10:26:3636 days ago1713435996IN
0xDf5bD98b...75De76925
0 ETH0.000165385.36398124
Set Collateral P...57240492024-04-18 10:25:0036 days ago1713435900IN
0xDf5bD98b...75De76925
0 ETH0.00098165.13369226
Set Collateral P...57240472024-04-18 10:24:3636 days ago1713435876IN
0xDf5bD98b...75De76925
0 ETH0.000167745.44053704
Set Collateral P...57240372024-04-18 10:22:3636 days ago1713435756IN
0xDf5bD98b...75De76925
0 ETH0.001346225.53158335
Set Collateral P...57240352024-04-18 10:22:1236 days ago1713435732IN
0xDf5bD98b...75De76925
0 ETH0.001702335.44663191
Set Default NFT ...57240182024-04-18 10:18:4836 days ago1713435528IN
0xDf5bD98b...75De76925
0 ETH0.000179795.96401197
Set Default NFT ...57240112024-04-18 10:17:2436 days ago1713435444IN
0xDf5bD98b...75De76925
0 ETH0.001866415.81704802
Set Default NFT ...57240032024-04-18 10:15:4836 days ago1713435348IN
0xDf5bD98b...75De76925
0 ETH0.00118096.63691471
View all transactions

Advanced mode:
Parent Transaction Hash Block From To Value
View All Internal Transactions
Loading...
Loading

Contract Source Code Verified (Exact Match)

Contract Name:
DefaultPriceModel

Compiler Version
v0.8.21+commit.d9974bed

Optimization Enabled:
Yes with 200 runs

Other Settings:
istanbul EvmVersion, MIT license

Contract Source Code (Solidity Standard Json-Input format)

File 1 of 9 : DefaultPriceModel.sol
// SPDX-License-Identifier: MIT
// ENVELOP(NIFTSY) NFT(wNFT) Kiosk Default Price Model;

pragma solidity 0.8.21;

import "IDisplayPriceModel.sol";
import "IEnvelopNFTKiosk.sol";
import "IWNFT.sol";

/// @title Default price model implementation
/// @author Envelop Team
/// @notice This model operate sellings of erc20 collateral inside wNFTS V1
/// @dev ..
contract DefaultPriceModel is IDisplayPriceModel {

    struct DiscountUntil {
        uint256 untilDate;
        KTypes.Discount discount;
    }

    // mapping from displayNameHash to ERC20 collateral prices
    mapping (bytes32 => mapping(address => KTypes.DenominatedPrice[])) 
        public erc20CollateralPricesForDisplays;

    // mapping from displayNameHash to default price for all NFT at the display
    mapping (bytes32 => KTypes.Price[]) public defaultNFTPriceForDisplay;
    
    // mapping from displayNameHash to time discounts
    mapping (bytes32 => DiscountUntil[]) public timeDiscounts;

    // mapping from displayNameHash to PROMO hash to PROMO discount
    mapping (bytes32 => mapping (bytes32 => DiscountUntil)) public promoDiscounts;

    // mapping from displayNameHash to referrer hash to PROMO discount
    mapping (bytes32 => mapping (bytes32 => DiscountUntil)) public referrerDiscounts;


    IEnvelopNFTKiosk public kiosk;

    event CollateralPriceChanged(
        bytes32 indexed display,
        address indexed erc20Collateral
    );

    constructor (address _kiosk){
        kiosk = IEnvelopNFTKiosk(_kiosk);
    }

    /**
     * @dev Throws if called by any account other than the display owner.
     */
    modifier onlyDisplayOwner(bytes32 _displayNameHash) {
        require(
            kiosk.getDisplayOwner(_displayNameHash) == msg.sender, 
            "Only for Display Owner"
        );
        _;
    }

    function makeActionInModel(
        ETypes.AssetItem calldata _assetItem,
        address _buyer
    ) external {}

    function setCollateralPriceForDisplay(
        bytes32 _displayNameHash,
        address _erc20,
        KTypes.DenominatedPrice[] calldata _prices
    ) 
        external virtual
        onlyDisplayOwner(_displayNameHash) 

    {
        KTypes.DenominatedPrice[] storage prices = erc20CollateralPricesForDisplays[_displayNameHash][_erc20];
        for (uint256 i = 0; i < _prices.length; ++ i) {
            prices.push(_prices[i]);
            emit CollateralPriceChanged(_displayNameHash, _erc20);    
        }
    }

    function editCollateralPriceRecordForDisplay(
        bytes32 _displayNameHash,
        address _erc20,
        uint256 _priceIndex,
        KTypes.DenominatedPrice calldata _price
    )
        external virtual
        onlyDisplayOwner(_displayNameHash)
    {
        erc20CollateralPricesForDisplays[_displayNameHash][_erc20][_priceIndex] = _price;
        emit CollateralPriceChanged(_displayNameHash, _erc20);
    }


    function deleteCollateralPriceRecordForDisplayByIndex(
        bytes32 _displayNameHash,
        address _erc20,
        uint256 _priceIndex
    )
        external virtual
        onlyDisplayOwner(_displayNameHash)
    {
        KTypes.DenominatedPrice[] storage prices 
            = erc20CollateralPricesForDisplays[_displayNameHash][_erc20];
        if (_priceIndex != prices.length - 1) {
            prices[_priceIndex] = prices[prices.length - 1]; 
        }
        prices.pop();
        emit CollateralPriceChanged(_displayNameHash, _erc20);
    }

    function setDefaultNFTPriceForDisplay(
        bytes32 _displayNameHash,
        KTypes.Price[] calldata _prices
    ) 
       external virtual
       onlyDisplayOwner(_displayNameHash)
    {
        KTypes.Price[] storage prices = defaultNFTPriceForDisplay[_displayNameHash];
        for (uint256 i = 0; i < _prices.length; ++ i) {
            prices.push(_prices[i]);
            emit DefaultPriceChanged(
                _displayNameHash,
                _prices[i].payWith,
                _prices[i].amount
            );    
        }
    }

    function editDefaultNFTPriceRecordForDisplay(
        bytes32 _displayNameHash,
        uint256 _priceIndex,
        KTypes.Price calldata _price
    )
        external virtual
        onlyDisplayOwner(_displayNameHash)
    {
        defaultNFTPriceForDisplay[_displayNameHash][_priceIndex] = _price;
        emit DefaultPriceChanged(
            _displayNameHash,
            _price.payWith,
            _price.amount
        );
    }


    function deleteDefaultNFTPriceRecordForDisplayByIndex(
        bytes32 _displayNameHash,
        uint256 _priceIndex
    )
        external virtual
        onlyDisplayOwner(_displayNameHash)
    {
        KTypes.Price[] storage _savedPrices = defaultNFTPriceForDisplay[_displayNameHash];
        if (_priceIndex != _savedPrices.length - 1) {
            _savedPrices[_priceIndex] = _savedPrices[_savedPrices.length - 1]; 
        }
        
        emit DefaultPriceChanged(
            _displayNameHash,
            _savedPrices[_priceIndex].payWith,
            0
        );
        _savedPrices.pop();
    }

    function setTimeDiscountsForDisplay(
        bytes32 _displayNameHash,
        DiscountUntil[] calldata _discounts
    ) 
       external virtual
       onlyDisplayOwner(_displayNameHash)
    {
        DiscountUntil[] storage discounts = timeDiscounts[_displayNameHash];
        for (uint256 i = 0; i < _discounts.length; ++ i) {
            discounts.push(_discounts[i]);
            emit DiscountChanged(
            _displayNameHash,
            uint8(KTypes.DiscountType.TIME),
            bytes32(_discounts[i].untilDate),
            _discounts[i].discount.dsctPercent
        );    
        }
    }

    function editTimeDiscountsForDisplay(
        bytes32 _displayNameHash,
        uint256 _discountIndex,
        DiscountUntil calldata _discount
    )
        external virtual
        onlyDisplayOwner(_displayNameHash)
    {
        timeDiscounts[_displayNameHash][_discountIndex] = _discount;
        emit DiscountChanged(
            _displayNameHash,
            uint8(KTypes.DiscountType.TIME),
            bytes32(_discount.untilDate),
            _discount.discount.dsctPercent
        );
    }

    function setPromoDiscountForDisplay(
        bytes32 _displayNameHash,
        bytes32 _promoHash,
        DiscountUntil calldata _discount
    ) 
        external virtual
        onlyDisplayOwner(_displayNameHash) 

    {
        promoDiscounts[_displayNameHash][_promoHash] = _discount;
        emit DiscountChanged(
            _displayNameHash,
            uint8(KTypes.DiscountType.PROMO),
            _promoHash,
            _discount.discount.dsctPercent
        );
    }

    function setRefereerDiscountForDisplay(
        bytes32 _displayNameHash,
        address _referrer,
        DiscountUntil calldata _discount
    ) 
        external virtual
        onlyDisplayOwner(_displayNameHash) 

    {
        referrerDiscounts[_displayNameHash][keccak256(abi.encode(_referrer))] = _discount; 
        emit DiscountChanged(
            _displayNameHash,
            uint8(KTypes.DiscountType.REFERRAL),
            keccak256(abi.encode(_referrer)),
            _discount.discount.dsctPercent
        );
    }
    /////////////////////////

    function getItemPrices(
        ETypes.AssetItem memory _assetItem
    ) external view virtual returns (KTypes.Price[] memory)
    {
        // 1. Try get collateral
        IWNFT wnftContract = IWNFT(_assetItem.asset.contractAddress);
        try wnftContract.wnftInfo(_assetItem.tokenId) returns (ETypes.WNFT memory wnft){
            KTypes.Place memory pl = _getVirtualPlace(_assetItem);
            // Only first collateral asset is tradable in this pricemodel
            KTypes.DenominatedPrice[] memory denPrices = _getCollateralUnitPrice(
                pl.display,
                wnft.collateral[0].asset.contractAddress
            );
            KTypes.Price[] memory prices = new KTypes.Price[](denPrices.length);
            for (uint256 i = 0; i < denPrices.length; ++ i ){
                // Calc wNFT price
                prices[i].payWith = denPrices[i].payWith;
                prices[i].amount = denPrices[i].amount 
                    * wnft.collateral[0].amount / denPrices[i].denominator;
            }
            return prices; 
        } catch {
            return getDefaultDisplayPrices(_assetItem);
        }
    }

    function getDefaultDisplayPrices(
        ETypes.AssetItem memory _assetItem
    ) public view virtual returns (KTypes.Price[] memory _prices)
    {
        // get display of given item
        KTypes.Place memory pl = _getVirtualPlace(_assetItem);
        _prices = defaultNFTPriceForDisplay[pl.display];
    }

    function getDefaultDisplayPricesForDisplay(
        bytes32 _displayNameHash
    ) public view virtual returns (KTypes.Price[] memory _prices)
    {
        _prices = defaultNFTPriceForDisplay[_displayNameHash];
    }

    function getDisplayTimeDiscounts(
        bytes32 _displayNameHash
    ) public view virtual returns (DiscountUntil[] memory)

    {
        return timeDiscounts[_displayNameHash];
    } 

    function getItemDiscounts(
        ETypes.AssetItem memory _assetItem,
        address _buyer,
        address _referrer,
        bytes32 _promoHash
    ) public view virtual returns (KTypes.Discount[] memory)
    {
        KTypes.Place memory pl = _getVirtualPlace(_assetItem);
        // 1.First check time discounts for this display
        DiscountUntil[] storage tdArray = timeDiscounts[pl.display];
        KTypes.Discount memory td;
        for (uint256 i = 0; i < tdArray.length; ++ i){
            if (tdArray[i].untilDate > block.timestamp){
                td = tdArray[i].discount;
                break;
            }
        }

        // This Price Model support 3 slots for discounts
        KTypes.Discount[] memory discounts = new KTypes.Discount[](3);
        for (uint256 i = 0; i < discounts.length; ++ i){
            // add time discount to result
            discounts[0] = td;
            // add promo discount to result
            if (promoDiscounts[pl.display][_promoHash].untilDate > block.timestamp) {
                discounts[1] = KTypes.Discount(
                    promoDiscounts[pl.display][_promoHash].discount.dsctType,
                    promoDiscounts[pl.display][_promoHash].discount.dsctPercent
                );
            }

            // add ref discount
            if (referrerDiscounts[pl.display][keccak256(abi.encode(_referrer))].untilDate > block.timestamp) {
                discounts[2] = KTypes.Discount(
                    referrerDiscounts[pl.display][keccak256(abi.encode(_referrer))].discount.dsctType,
                    referrerDiscounts[pl.display][keccak256(abi.encode(_referrer))].discount.dsctPercent
                );
            }

        }
        return discounts;
    }

    function getBatchPrices(
        ETypes.AssetItem[] memory _assetItemArray
    ) external view virtual returns (KTypes.Price[] memory)
    {

    }
    
    function getBatchDiscounts(
        ETypes.AssetItem[] memory _assetItemArray,
        address _buyer,
        address _referrer,
        bytes32 _promoHash
    ) external view virtual returns (KTypes.Discount[] memory)
    {

    }

    function getCollateralUnitPrice(
        bytes32 _displayNameHash, 
        address _erc20
    ) external view returns(KTypes.DenominatedPrice[] memory){
        return _getCollateralUnitPrice(_displayNameHash,_erc20);
    }
    ///////////////////////////////////////////////////////////////////
    function _getCollateralUnitPrice(
        bytes32 _displayNameHash, 
        address _erc20
    ) internal view returns(KTypes.DenominatedPrice[] memory){
        return erc20CollateralPricesForDisplays[_displayNameHash][_erc20];
    }

    function _getVirtualPlace(ETypes.AssetItem memory _assetItem) 
        internal view returns(KTypes.Place memory place) 
    {
        place = kiosk.getAssetItemPlace(_assetItem);
        if (place.display == bytes32(0)) {
               place.display = kiosk.DEFAULT_DISPLAY();
        }
    }
}

File 3 of 9 : IDisplayPriceModel.sol
// SPDX-License-Identifier: MIT

pragma solidity 0.8.21;

//import "IERC721Enumerable.sol";
import "LibEnvelopTypes.sol";
import "KTypes.sol";

interface IDisplayPriceModel  {
    
    event DiscountChanged(
        bytes32 indexed display,
        uint8 indexed DiscountType,
        bytes32 DiscountParam,
        uint16 DiscountPercent
    );

    event DefaultPriceChanged(
        bytes32 indexed display,
        address indexed payWithContract,
        uint256 indexed priceAmount
    );

    function makeActionInModel(
        ETypes.AssetItem calldata _assetItem,
        address _buyer
    ) external;

    function getItemPrices(
        ETypes.AssetItem memory _assetItem
    ) external view returns (KTypes.Price[] memory);

    function getDefaultDisplayPrices(
        ETypes.AssetItem memory _assetItem
    ) external view returns (KTypes.Price[] memory);
    
    function getItemDiscounts(
        ETypes.AssetItem memory _assetItem,
        address _buyer,
        address _referrer,
        bytes32 _promoHash
    ) external view returns (KTypes.Discount[] memory);

    function getBatchPrices(
        ETypes.AssetItem[] memory _assetItemArray
    ) external view returns (KTypes.Price[] memory);
    
    function getBatchDiscounts(
        ETypes.AssetItem[] memory _assetItemArray,
        address _buyer,
        address _referrer,
        bytes32 _promoHash
    ) external view returns (KTypes.Discount[] memory);
}

File 4 of 9 : IERC721Enumerable.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.5.0) (token/ERC721/extensions/IERC721Enumerable.sol)

pragma solidity ^0.8.0;

import "IERC721.sol";

/**
 * @title ERC-721 Non-Fungible Token Standard, optional enumeration extension
 * @dev See https://eips.ethereum.org/EIPS/eip-721
 */
interface IERC721Enumerable is IERC721 {
    /**
     * @dev Returns the total amount of tokens stored by the contract.
     */
    function totalSupply() external view returns (uint256);

    /**
     * @dev Returns a token ID owned by `owner` at a given `index` of its token list.
     * Use along with {balanceOf} to enumerate all of ``owner``'s tokens.
     */
    function tokenOfOwnerByIndex(address owner, uint256 index) external view returns (uint256);

    /**
     * @dev Returns a token ID at a given `index` of all the tokens stored by the contract.
     * Use along with {totalSupply} to enumerate all tokens.
     */
    function tokenByIndex(uint256 index) external view returns (uint256);
}

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

pragma solidity ^0.8.0;

import "IERC165.sol";

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

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

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

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

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

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

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

    /**
     * @dev Transfers `tokenId` token from `from` to `to`.
     *
     * WARNING: Note that the caller is responsible to confirm that the recipient is capable of receiving ERC721
     * or else they may be permanently lost. Usage of {safeTransferFrom} prevents loss, though the caller must
     * understand this adds an external call which potentially creates a reentrancy vulnerability.
     *
     * Requirements:
     *
     * - `from` cannot be the zero address.
     * - `to` cannot be the zero address.
     * - `tokenId` token must be owned by `from`.
     * - If the caller is not `from`, it must be approved to move this token by either {approve} or {setApprovalForAll}.
     *
     * Emits a {Transfer} event.
     */
    function transferFrom(address from, address to, uint256 tokenId) external;

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

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

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

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

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

pragma solidity ^0.8.0;

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

File 7 of 9 : LibEnvelopTypes.sol
// SPDX-License-Identifier: MIT
// ENVELOP(NIFTSY) protocol V1 for NFT. 
pragma solidity 0.8.21;

/// @title Flibrary ETypes in Envelop PrtocolV1 
/// @author Envelop Team
/// @notice This contract implement main protocol's data types
library ETypes {

    enum AssetType {EMPTY, NATIVE, ERC20, ERC721, ERC1155, FUTURE1, FUTURE2, FUTURE3}
    
    struct Asset {
        AssetType assetType;
        address contractAddress;
    }

    struct AssetItem {
        Asset asset;
        uint256 tokenId;
        uint256 amount;
    }

    struct NFTItem {
        address contractAddress;
        uint256 tokenId;   
    }

    struct Fee {
        bytes1 feeType;
        uint256 param;
        address token; 
    }

    struct Lock {
        bytes1 lockType;
        uint256 param; 
    }

    struct Royalty {
        address beneficiary;
        uint16 percent;
    }

    struct WNFT {
        AssetItem inAsset;
        AssetItem[] collateral;
        address unWrapDestination;
        Fee[] fees;
        Lock[] locks;
        Royalty[] royalties;
        bytes2 rules;

    }

    struct INData {
        AssetItem inAsset;
        address unWrapDestination;
        Fee[] fees;
        Lock[] locks;
        Royalty[] royalties;
        AssetType outType;
        uint256 outBalance;      //0- for 721 and any amount for 1155
        bytes2 rules;

    }

    struct WhiteListItem {
        bool enabledForFee;
        bool enabledForCollateral;
        bool enabledRemoveFromCollateral;
        address transferFeeModel;
    }

    struct Rules {
        bytes2 onlythis;
        bytes2 disabled;
    }

}

File 8 of 9 : KTypes.sol
// SPDX-License-Identifier: MIT
// ENVELOP(NIFTSY) protocol V1 for NFT. 
import "LibEnvelopTypes.sol";

pragma solidity 0.8.21;
library KTypes {
	enum DiscountType {PROMO, REFERRAL, BATCH, TIME, WHITELIST, CUSTOM1, CUSTOM2, CUSTOM3}

    struct Price {
        address payWith;
        uint256 amount;
    }

    struct DenominatedPrice {
        address payWith;
        uint256 amount;
        uint256 denominator;
    }

    struct Discount {
        DiscountType dsctType;
        uint16 dsctPercent; // 100%-10000, 20%-2000, 3%-300
    }

    struct ItemForSale {
        address owner;
        ETypes.AssetItem nft;
        Price[] prices;
    }

    struct Display {
        address owner;
        address beneficiary; // who will receive assets from sale
        uint256 enableAfter;
        uint256 disableAfter;
        address priceModel;
        ItemForSale[] items;
    }

    struct Place {
        bytes32 display;
        uint256 index;
    }
}

File 9 of 9 : IEnvelopNFTKiosk.sol
// SPDX-License-Identifier: MIT

pragma solidity 0.8.21;
import "LibEnvelopTypes.sol";
import "KTypes.sol";

interface IEnvelopNFTKiosk  {

    function DEFAULT_DISPLAY() external view returns (bytes32);
    
    function buyAssetItem(
        ETypes.AssetItem calldata _assetItem,
        uint256 _priceIndex,
        address _buyer,
        address _referrer,
        string calldata _promo
    ) external payable;
    
    function getDisplayOwner(
        bytes32 _displayNameHash
    ) external view returns (address);
    
    function getAssetItemPlace(
        ETypes.AssetItem memory _assetItem
    ) external view returns (KTypes.Place memory);

    function isDisplayAdmin(
        bytes32 _displayNameHash, address _who
    ) external view returns(bool);
}

File 10 of 9 : IWNFT.sol
// SPDX-License-Identifier: MIT

pragma solidity 0.8.21;
import "LibEnvelopTypes.sol";

interface IWNFT  {
    function wnftInfo(uint256 tokenId) 
        external view returns (ETypes.WNFT memory);
}

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

Contract ABI

[{"inputs":[{"internalType":"address","name":"_kiosk","type":"address"}],"stateMutability":"nonpayable","type":"constructor"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"bytes32","name":"display","type":"bytes32"},{"indexed":true,"internalType":"address","name":"erc20Collateral","type":"address"}],"name":"CollateralPriceChanged","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"bytes32","name":"display","type":"bytes32"},{"indexed":true,"internalType":"address","name":"payWithContract","type":"address"},{"indexed":true,"internalType":"uint256","name":"priceAmount","type":"uint256"}],"name":"DefaultPriceChanged","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"bytes32","name":"display","type":"bytes32"},{"indexed":true,"internalType":"uint8","name":"DiscountType","type":"uint8"},{"indexed":false,"internalType":"bytes32","name":"DiscountParam","type":"bytes32"},{"indexed":false,"internalType":"uint16","name":"DiscountPercent","type":"uint16"}],"name":"DiscountChanged","type":"event"},{"inputs":[{"internalType":"bytes32","name":"","type":"bytes32"},{"internalType":"uint256","name":"","type":"uint256"}],"name":"defaultNFTPriceForDisplay","outputs":[{"internalType":"address","name":"payWith","type":"address"},{"internalType":"uint256","name":"amount","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes32","name":"_displayNameHash","type":"bytes32"},{"internalType":"address","name":"_erc20","type":"address"},{"internalType":"uint256","name":"_priceIndex","type":"uint256"}],"name":"deleteCollateralPriceRecordForDisplayByIndex","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes32","name":"_displayNameHash","type":"bytes32"},{"internalType":"uint256","name":"_priceIndex","type":"uint256"}],"name":"deleteDefaultNFTPriceRecordForDisplayByIndex","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes32","name":"_displayNameHash","type":"bytes32"},{"internalType":"address","name":"_erc20","type":"address"},{"internalType":"uint256","name":"_priceIndex","type":"uint256"},{"components":[{"internalType":"address","name":"payWith","type":"address"},{"internalType":"uint256","name":"amount","type":"uint256"},{"internalType":"uint256","name":"denominator","type":"uint256"}],"internalType":"struct KTypes.DenominatedPrice","name":"_price","type":"tuple"}],"name":"editCollateralPriceRecordForDisplay","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes32","name":"_displayNameHash","type":"bytes32"},{"internalType":"uint256","name":"_priceIndex","type":"uint256"},{"components":[{"internalType":"address","name":"payWith","type":"address"},{"internalType":"uint256","name":"amount","type":"uint256"}],"internalType":"struct KTypes.Price","name":"_price","type":"tuple"}],"name":"editDefaultNFTPriceRecordForDisplay","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes32","name":"_displayNameHash","type":"bytes32"},{"internalType":"uint256","name":"_discountIndex","type":"uint256"},{"components":[{"internalType":"uint256","name":"untilDate","type":"uint256"},{"components":[{"internalType":"enum KTypes.DiscountType","name":"dsctType","type":"uint8"},{"internalType":"uint16","name":"dsctPercent","type":"uint16"}],"internalType":"struct KTypes.Discount","name":"discount","type":"tuple"}],"internalType":"struct DefaultPriceModel.DiscountUntil","name":"_discount","type":"tuple"}],"name":"editTimeDiscountsForDisplay","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes32","name":"","type":"bytes32"},{"internalType":"address","name":"","type":"address"},{"internalType":"uint256","name":"","type":"uint256"}],"name":"erc20CollateralPricesForDisplays","outputs":[{"internalType":"address","name":"payWith","type":"address"},{"internalType":"uint256","name":"amount","type":"uint256"},{"internalType":"uint256","name":"denominator","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"components":[{"components":[{"internalType":"enum ETypes.AssetType","name":"assetType","type":"uint8"},{"internalType":"address","name":"contractAddress","type":"address"}],"internalType":"struct ETypes.Asset","name":"asset","type":"tuple"},{"internalType":"uint256","name":"tokenId","type":"uint256"},{"internalType":"uint256","name":"amount","type":"uint256"}],"internalType":"struct ETypes.AssetItem[]","name":"_assetItemArray","type":"tuple[]"},{"internalType":"address","name":"_buyer","type":"address"},{"internalType":"address","name":"_referrer","type":"address"},{"internalType":"bytes32","name":"_promoHash","type":"bytes32"}],"name":"getBatchDiscounts","outputs":[{"components":[{"internalType":"enum KTypes.DiscountType","name":"dsctType","type":"uint8"},{"internalType":"uint16","name":"dsctPercent","type":"uint16"}],"internalType":"struct KTypes.Discount[]","name":"","type":"tuple[]"}],"stateMutability":"view","type":"function"},{"inputs":[{"components":[{"components":[{"internalType":"enum ETypes.AssetType","name":"assetType","type":"uint8"},{"internalType":"address","name":"contractAddress","type":"address"}],"internalType":"struct ETypes.Asset","name":"asset","type":"tuple"},{"internalType":"uint256","name":"tokenId","type":"uint256"},{"internalType":"uint256","name":"amount","type":"uint256"}],"internalType":"struct ETypes.AssetItem[]","name":"_assetItemArray","type":"tuple[]"}],"name":"getBatchPrices","outputs":[{"components":[{"internalType":"address","name":"payWith","type":"address"},{"internalType":"uint256","name":"amount","type":"uint256"}],"internalType":"struct KTypes.Price[]","name":"","type":"tuple[]"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes32","name":"_displayNameHash","type":"bytes32"},{"internalType":"address","name":"_erc20","type":"address"}],"name":"getCollateralUnitPrice","outputs":[{"components":[{"internalType":"address","name":"payWith","type":"address"},{"internalType":"uint256","name":"amount","type":"uint256"},{"internalType":"uint256","name":"denominator","type":"uint256"}],"internalType":"struct KTypes.DenominatedPrice[]","name":"","type":"tuple[]"}],"stateMutability":"view","type":"function"},{"inputs":[{"components":[{"components":[{"internalType":"enum ETypes.AssetType","name":"assetType","type":"uint8"},{"internalType":"address","name":"contractAddress","type":"address"}],"internalType":"struct ETypes.Asset","name":"asset","type":"tuple"},{"internalType":"uint256","name":"tokenId","type":"uint256"},{"internalType":"uint256","name":"amount","type":"uint256"}],"internalType":"struct ETypes.AssetItem","name":"_assetItem","type":"tuple"}],"name":"getDefaultDisplayPrices","outputs":[{"components":[{"internalType":"address","name":"payWith","type":"address"},{"internalType":"uint256","name":"amount","type":"uint256"}],"internalType":"struct KTypes.Price[]","name":"_prices","type":"tuple[]"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes32","name":"_displayNameHash","type":"bytes32"}],"name":"getDefaultDisplayPricesForDisplay","outputs":[{"components":[{"internalType":"address","name":"payWith","type":"address"},{"internalType":"uint256","name":"amount","type":"uint256"}],"internalType":"struct KTypes.Price[]","name":"_prices","type":"tuple[]"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes32","name":"_displayNameHash","type":"bytes32"}],"name":"getDisplayTimeDiscounts","outputs":[{"components":[{"internalType":"uint256","name":"untilDate","type":"uint256"},{"components":[{"internalType":"enum KTypes.DiscountType","name":"dsctType","type":"uint8"},{"internalType":"uint16","name":"dsctPercent","type":"uint16"}],"internalType":"struct KTypes.Discount","name":"discount","type":"tuple"}],"internalType":"struct DefaultPriceModel.DiscountUntil[]","name":"","type":"tuple[]"}],"stateMutability":"view","type":"function"},{"inputs":[{"components":[{"components":[{"internalType":"enum ETypes.AssetType","name":"assetType","type":"uint8"},{"internalType":"address","name":"contractAddress","type":"address"}],"internalType":"struct ETypes.Asset","name":"asset","type":"tuple"},{"internalType":"uint256","name":"tokenId","type":"uint256"},{"internalType":"uint256","name":"amount","type":"uint256"}],"internalType":"struct ETypes.AssetItem","name":"_assetItem","type":"tuple"},{"internalType":"address","name":"_buyer","type":"address"},{"internalType":"address","name":"_referrer","type":"address"},{"internalType":"bytes32","name":"_promoHash","type":"bytes32"}],"name":"getItemDiscounts","outputs":[{"components":[{"internalType":"enum KTypes.DiscountType","name":"dsctType","type":"uint8"},{"internalType":"uint16","name":"dsctPercent","type":"uint16"}],"internalType":"struct KTypes.Discount[]","name":"","type":"tuple[]"}],"stateMutability":"view","type":"function"},{"inputs":[{"components":[{"components":[{"internalType":"enum ETypes.AssetType","name":"assetType","type":"uint8"},{"internalType":"address","name":"contractAddress","type":"address"}],"internalType":"struct ETypes.Asset","name":"asset","type":"tuple"},{"internalType":"uint256","name":"tokenId","type":"uint256"},{"internalType":"uint256","name":"amount","type":"uint256"}],"internalType":"struct ETypes.AssetItem","name":"_assetItem","type":"tuple"}],"name":"getItemPrices","outputs":[{"components":[{"internalType":"address","name":"payWith","type":"address"},{"internalType":"uint256","name":"amount","type":"uint256"}],"internalType":"struct KTypes.Price[]","name":"","type":"tuple[]"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"kiosk","outputs":[{"internalType":"contract IEnvelopNFTKiosk","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"components":[{"components":[{"internalType":"enum ETypes.AssetType","name":"assetType","type":"uint8"},{"internalType":"address","name":"contractAddress","type":"address"}],"internalType":"struct ETypes.Asset","name":"asset","type":"tuple"},{"internalType":"uint256","name":"tokenId","type":"uint256"},{"internalType":"uint256","name":"amount","type":"uint256"}],"internalType":"struct ETypes.AssetItem","name":"_assetItem","type":"tuple"},{"internalType":"address","name":"_buyer","type":"address"}],"name":"makeActionInModel","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes32","name":"","type":"bytes32"},{"internalType":"bytes32","name":"","type":"bytes32"}],"name":"promoDiscounts","outputs":[{"internalType":"uint256","name":"untilDate","type":"uint256"},{"components":[{"internalType":"enum KTypes.DiscountType","name":"dsctType","type":"uint8"},{"internalType":"uint16","name":"dsctPercent","type":"uint16"}],"internalType":"struct KTypes.Discount","name":"discount","type":"tuple"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes32","name":"","type":"bytes32"},{"internalType":"bytes32","name":"","type":"bytes32"}],"name":"referrerDiscounts","outputs":[{"internalType":"uint256","name":"untilDate","type":"uint256"},{"components":[{"internalType":"enum KTypes.DiscountType","name":"dsctType","type":"uint8"},{"internalType":"uint16","name":"dsctPercent","type":"uint16"}],"internalType":"struct KTypes.Discount","name":"discount","type":"tuple"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes32","name":"_displayNameHash","type":"bytes32"},{"internalType":"address","name":"_erc20","type":"address"},{"components":[{"internalType":"address","name":"payWith","type":"address"},{"internalType":"uint256","name":"amount","type":"uint256"},{"internalType":"uint256","name":"denominator","type":"uint256"}],"internalType":"struct KTypes.DenominatedPrice[]","name":"_prices","type":"tuple[]"}],"name":"setCollateralPriceForDisplay","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes32","name":"_displayNameHash","type":"bytes32"},{"components":[{"internalType":"address","name":"payWith","type":"address"},{"internalType":"uint256","name":"amount","type":"uint256"}],"internalType":"struct KTypes.Price[]","name":"_prices","type":"tuple[]"}],"name":"setDefaultNFTPriceForDisplay","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes32","name":"_displayNameHash","type":"bytes32"},{"internalType":"bytes32","name":"_promoHash","type":"bytes32"},{"components":[{"internalType":"uint256","name":"untilDate","type":"uint256"},{"components":[{"internalType":"enum KTypes.DiscountType","name":"dsctType","type":"uint8"},{"internalType":"uint16","name":"dsctPercent","type":"uint16"}],"internalType":"struct KTypes.Discount","name":"discount","type":"tuple"}],"internalType":"struct DefaultPriceModel.DiscountUntil","name":"_discount","type":"tuple"}],"name":"setPromoDiscountForDisplay","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes32","name":"_displayNameHash","type":"bytes32"},{"internalType":"address","name":"_referrer","type":"address"},{"components":[{"internalType":"uint256","name":"untilDate","type":"uint256"},{"components":[{"internalType":"enum KTypes.DiscountType","name":"dsctType","type":"uint8"},{"internalType":"uint16","name":"dsctPercent","type":"uint16"}],"internalType":"struct KTypes.Discount","name":"discount","type":"tuple"}],"internalType":"struct DefaultPriceModel.DiscountUntil","name":"_discount","type":"tuple"}],"name":"setRefereerDiscountForDisplay","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes32","name":"_displayNameHash","type":"bytes32"},{"components":[{"internalType":"uint256","name":"untilDate","type":"uint256"},{"components":[{"internalType":"enum KTypes.DiscountType","name":"dsctType","type":"uint8"},{"internalType":"uint16","name":"dsctPercent","type":"uint16"}],"internalType":"struct KTypes.Discount","name":"discount","type":"tuple"}],"internalType":"struct DefaultPriceModel.DiscountUntil[]","name":"_discounts","type":"tuple[]"}],"name":"setTimeDiscountsForDisplay","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes32","name":"","type":"bytes32"},{"internalType":"uint256","name":"","type":"uint256"}],"name":"timeDiscounts","outputs":[{"internalType":"uint256","name":"untilDate","type":"uint256"},{"components":[{"internalType":"enum KTypes.DiscountType","name":"dsctType","type":"uint8"},{"internalType":"uint16","name":"dsctPercent","type":"uint16"}],"internalType":"struct KTypes.Discount","name":"discount","type":"tuple"}],"stateMutability":"view","type":"function"}]

60806040523480156200001157600080fd5b5060405162002b7c38038062002b7c83398101604081905262000034916200005a565b600580546001600160a01b0319166001600160a01b03929092169190911790556200008c565b6000602082840312156200006d57600080fd5b81516001600160a01b03811681146200008557600080fd5b9392505050565b612ae0806200009c6000396000f3fe608060405234801561001057600080fd5b50600436106101735760003560e01c8063874081b7116100de578063b456994c11610097578063e36f198611610071578063e36f198614610372578063eeeb83d8146103a4578063f02280bc146103b7578063fcf5e47c146103c957600080fd5b8063b456994c1461032c578063bb14692f1461033f578063c185f8831461035f57600080fd5b8063874081b7146102a25780638a864593146102b55780639b33e82e146102c85780639fbf91b5146102db578063a002d5f4146102ee578063a63d41ef1461031957600080fd5b80636700ac2c116101305780636700ac2c14610214578063673d10bd146102345780636b107c2c146102485780636bc37eb91461025b5780636e074f771461026e578063804ae37a1461028f57600080fd5b806308c68aae146101785780631460e323146101a65780632434c6cb146101bb57806341684fbf146101ce57806352d93cd9146101e15780635ae6802614610201575b600080fd5b610190610186366004611e13565b6060949350505050565b60405161019d9190611ecc565b60405180910390f35b6101b96101b4366004611f19565b610401565b005b6101b96101c9366004611faf565b61058e565b6101b96101dc366004611fee565b6106e5565b6101f46101ef36600461201b565b6107e0565b60405161019d9190612037565b6101b961020f3660046120cd565b610871565b610227610222366004612118565b6109e6565b60405161019d9190612148565b6101f461024236600461219d565b50606090565b6101b96102563660046121d9565b6109fb565b6101b961026936600461221a565b610b1e565b61028161027c36600461221a565b610cea565b60405161019d92919061223c565b6101b961029d366004611fee565b610d57565b6101f46102b0366004612250565b610e39565b6101b96102c3366004612269565b610ec1565b6101b96102d63660046122a1565b61108c565b6102816102e936600461221a565b6111b1565b600554610301906001600160a01b031681565b6040516001600160a01b03909116815260200161019d565b6101b96103273660046122ea565b61120d565b61019061033a366004612345565b611360565b61035261034d366004612250565b6116b4565b60405161019d9190612395565b61028161036d36600461221a565b611774565b61038561038036600461221a565b6117b8565b604080516001600160a01b03909316835260208301919091520161019d565b6101f46103b236600461201b565b6117fe565b6101b96103c53660046123ee565b5050565b6103dc6103d7366004612269565b611a3a565b604080516001600160a01b03909416845260208401929092529082015260600161019d565b60055460405163b1d065f760e01b815260048101859052849133916001600160a01b039091169063b1d065f790602401602060405180830381865afa15801561044e573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610472919061242d565b6001600160a01b0316146104a15760405162461bcd60e51b81526004016104989061244a565b60405180910390fd5b6000848152600160205260408120905b8381101561058657818585838181106104cc576104cc61247a565b8354600181018555600094855260209094206040909102929092019260020290910190506104fa82826124b0565b505084848281811061050e5761050e61247a565b9050604002016020013585858381811061052a5761052a61247a565b61054092602060409092020190810191506124d4565b6001600160a01b0316877fc9287c87d9108dffc94744e56ad989771946c1c21955b7c417e408eb3192d8fe60405160405180910390a461057f81612507565b90506104b1565b505050505050565b60055460405163b1d065f760e01b815260048101859052849133916001600160a01b039091169063b1d065f790602401602060405180830381865afa1580156105db573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906105ff919061242d565b6001600160a01b0316146106255760405162461bcd60e51b81526004016104989061244a565b600084815260046020908152604080832081516001600160a01b03881681850152825180820385018152908301835280519084012084529091529020829061066d8282612530565b5050604080516001600160a01b03851660208201526001918691600080516020612a8b8339815191529101604051602081830303815290604052805190602001208560200160200160208101906106c4919061257f565b6040805192835261ffff90911660208301520160405180910390a350505050565b60055460405163b1d065f760e01b815260048101859052849133916001600160a01b039091169063b1d065f790602401602060405180830381865afa158015610732573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610756919061242d565b6001600160a01b03161461077c5760405162461bcd60e51b81526004016104989061244a565b600084815260026020526040902080548391908590811061079f5761079f61247a565b906000526020600020906002020181816107b99190612530565b506003905084600080516020612a8b83398151915284356106c4606087016040880161257f565b606060006107ed83611a94565b80516000908152600160209081526040808320805482518185028101850190935280835294955090939092909184015b82821015610865576000848152602090819020604080518082019091526002850290910180546001600160a01b0316825260019081015482840152908352909201910161081d565b50505050915050919050565b60055460405163b1d065f760e01b815260048101859052849133916001600160a01b039091169063b1d065f790602401602060405180830381865afa1580156108be573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906108e2919061242d565b6001600160a01b0316146109085760405162461bcd60e51b81526004016104989061244a565b6000848152600260205260408120905b8381101561058657818585838181106109335761093361247a565b8354600181018555600094855260209094206060909102929092019260020290910190506109618282612530565b506003905086600080516020612a8b8339815191528787858181106109885761098861247a565b606002919091013590508888868181106109a4576109a461247a565b6109bb92606091820201908101915060400161257f565b6040805192835261ffff90911660208301520160405180910390a36109df81612507565b9050610918565b60606109f28383611b9e565b90505b92915050565b60055460405163b1d065f760e01b815260048101859052849133916001600160a01b039091169063b1d065f790602401602060405180830381865afa158015610a48573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610a6c919061242d565b6001600160a01b031614610a925760405162461bcd60e51b81526004016104989061244a565b6000848152600160205260409020805483919085908110610ab557610ab561247a565b90600052602060002090600202018181610acf91906124b0565b505060208201803590610ae290846124d4565b6001600160a01b0316857fc9287c87d9108dffc94744e56ad989771946c1c21955b7c417e408eb3192d8fe60405160405180910390a450505050565b60055460405163b1d065f760e01b815260048101849052839133916001600160a01b039091169063b1d065f790602401602060405180830381865afa158015610b6b573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610b8f919061242d565b6001600160a01b031614610bb55760405162461bcd60e51b81526004016104989061244a565b600083815260016020819052604090912080549091610bd39161259c565b8314610c525780548190610be99060019061259c565b81548110610bf957610bf961247a565b9060005260206000209060020201818481548110610c1957610c1961247a565b60009182526020909120825460029092020180546001600160a01b0319166001600160a01b039092169190911781556001918201549101555b6000818481548110610c6657610c6661247a565b600091825260208220600290910201546040516001600160a01b039091169187917fc9287c87d9108dffc94744e56ad989771946c1c21955b7c417e408eb3192d8fe9190a480805480610cbb57610cbb6125af565b60008281526020812060026000199093019283020180546001600160a01b031916815560010155905550505050565b60036020908152600092835260408084209091529082529081902080548251808401909352600182018054919391829060ff166007811115610d2e57610d2e611e7c565b6007811115610d3f57610d3f611e7c565b81529054610100900461ffff16602090910152905082565b60055460405163b1d065f760e01b815260048101859052849133916001600160a01b039091169063b1d065f790602401602060405180830381865afa158015610da4573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610dc8919061242d565b6001600160a01b031614610dee5760405162461bcd60e51b81526004016104989061244a565b600084815260036020908152604080832086845290915290208290610e138282612530565b506000905084600080516020612a8b833981519152856106c4606087016040880161257f565b606060016000838152602001908152602001600020805480602002602001604051908101604052809291908181526020016000905b82821015610eb6576000848152602090819020604080518082019091526002850290910180546001600160a01b03168252600190810154828401529083529092019101610e6e565b505050509050919050565b60055460405163b1d065f760e01b815260048101859052849133916001600160a01b039091169063b1d065f790602401602060405180830381865afa158015610f0e573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610f32919061242d565b6001600160a01b031614610f585760405162461bcd60e51b81526004016104989061244a565b6000848152602081815260408083206001600160a01b038716845290915290208054610f869060019061259c565b831461100f5780548190610f9c9060019061259c565b81548110610fac57610fac61247a565b9060005260206000209060030201818481548110610fcc57610fcc61247a565b60009182526020909120825460039092020180546001600160a01b0319166001600160a01b03909216919091178155600180830154908201556002918201549101555b8080548061101f5761101f6125af565b60008281526020812060036000199093019283020180546001600160a01b03191681556001810182905560020181905591556040516001600160a01b0386169187917f3a188bdc141f7cc1f608c33ff343bd3caafb83f4e70dd7d8b04c038786c209499190a35050505050565b60055460405163b1d065f760e01b815260048101869052859133916001600160a01b039091169063b1d065f790602401602060405180830381865afa1580156110d9573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906110fd919061242d565b6001600160a01b0316146111235760405162461bcd60e51b81526004016104989061244a565b6000858152602081815260408083206001600160a01b038816845290915290208054839190859081106111585761115861247a565b9060005260206000209060030201818161117291906125c5565b50506040516001600160a01b0385169086907f3a188bdc141f7cc1f608c33ff343bd3caafb83f4e70dd7d8b04c038786c2094990600090a35050505050565b600260205281600052604060002081815481106111cd57600080fd5b600091825260209091206002909102018054604080518082019091526001830180549295509293509190829060ff166007811115610d2e57610d2e611e7c565b60055460405163b1d065f760e01b815260048101869052859133916001600160a01b039091169063b1d065f790602401602060405180830381865afa15801561125a573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061127e919061242d565b6001600160a01b0316146112a45760405162461bcd60e51b81526004016104989061244a565b6000858152602081815260408083206001600160a01b03881684529091528120905b8381101561135757818585838181106112e1576112e161247a565b83546001810185556000948552602090942060609091029290920192600302909101905061130f82826125c5565b50506040516001600160a01b0387169088907f3a188bdc141f7cc1f608c33ff343bd3caafb83f4e70dd7d8b04c038786c2094990600090a361135081612507565b90506112c6565b50505050505050565b6060600061136d86611a94565b8051600090815260026020526040902090915061139a604080518082019091526000808252602082015290565b60005b825481101561145e57428382815481106113b9576113b961247a565b906000526020600020906002020160000154111561144e578281815481106113e3576113e361247a565b90600052602060002090600202016001016040518060400160405290816000820160009054906101000a900460ff16600781111561142357611423611e7c565b600781111561143457611434611e7c565b81529054610100900461ffff16602090910152915061145e565b61145781612507565b905061139d565b5060408051600380825260808201909252600091816020015b604080518082019091526000808252602082015281526020019060019003908161147757905050905060005b81518110156116a75782826000815181106114c0576114c061247a565b602090810291909101810191909152855160009081526003825260408082208a8352909252205442101561157b5760408051808201825286516000908152600360209081528382208b835290529190912060010154819060ff16600781111561152b5761152b611e7c565b8152865160009081526003602090815260408083208c84528252909120600190810154610100900461ffff1691909201528351849190811061156f5761156f61247a565b60200260200101819052505b8451600090815260046020908152604080832081516001600160a01b038d1681850152825180820385018152908301835280519084012084529091529020544210156116975760408051808201825286516000908152600460209081528382206001600160a01b038d1660608086019190915285518086039091018152608085018652805190830120835290529190912060010154819060ff16600781111561162657611626611e7c565b81528651600090815260046020908152604080832081516001600160a01b038f168185015282518082038501815290830183528051908401208452825290912060010154610100900461ffff1691015282518390600290811061168b5761168b61247a565b60200260200101819052505b6116a081612507565b90506114a3565b5098975050505050505050565b606060026000838152602001908152602001600020805480602002602001604051908101604052809291908181526020016000905b82821015610eb657600084815260209081902060408051808201825260028602909201805483528151808301909252600181018054939491939185019291829060ff16600781111561173d5761173d611e7c565b600781111561174e5761174e611e7c565b81529054610100900461ffff1660209182015291529183525060019290920191016116e9565b60046020908152600092835260408084209091529082529081902080548251808401909352600182018054919391829060ff166007811115610d2e57610d2e611e7c565b600160205281600052604060002081815481106117d457600080fd5b6000918252602090912060029091020180546001909101546001600160a01b039091169250905082565b8051602090810151908201516040516310976e1960e11b8152606092916001600160a01b0383169163212edc329161183c9160040190815260200190565b600060405180830381865afa92505050801561187a57506040513d6000823e601f3d908101601f1916820160405261187791908101906128b6565b60015b61188e57611887836107e0565b9392505050565b600061189985611a94565b905060006118d1826000015184602001516000815181106118bc576118bc61247a565b60200260200101516000015160200151611b9e565b9050600081516001600160401b038111156118ee576118ee611c3c565b60405190808252806020026020018201604052801561193357816020015b604080518082019091526000808252602082015281526020019060019003908161190c5790505b50905060005b8251811015611a2f578281815181106119545761195461247a565b6020026020010151600001518282815181106119725761197261247a565b60209081029190910101516001600160a01b039091169052825183908290811061199e5761199e61247a565b60200260200101516040015185602001516000815181106119c1576119c161247a565b6020026020010151604001518483815181106119df576119df61247a565b6020026020010151602001516119f591906129c5565b6119ff91906129dc565b828281518110611a1157611a1161247a565b6020908102919091018101510152611a2881612507565b9050611939565b509695505050505050565b60006020528260005260406000206020528160005260406000208181548110611a6257600080fd5b60009182526020909120600390910201805460018201546002909201546001600160a01b039091169450909250905083565b60408051808201825260008082526020820152600554915163014cd93360e51b815290916001600160a01b03169063299b266090611ad69085906004016129fe565b6040805180830381865afa158015611af2573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611b169190612a3f565b8051909150611b9957600560009054906101000a90046001600160a01b03166001600160a01b0316632eeb42b36040518163ffffffff1660e01b8152600401602060405180830381865afa158015611b72573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611b969190612a71565b81525b919050565b6000828152602081815260408083206001600160a01b03851684528252808320805482518185028101850190935280835260609492939192909184015b82821015611c30576000848152602090819020604080516060810182526003860290920180546001600160a01b0316835260018082015484860152600290910154918301919091529083529092019101611bdb565b50505050905092915050565b634e487b7160e01b600052604160045260246000fd5b604051606081016001600160401b0381118282101715611c7457611c74611c3c565b60405290565b604080519081016001600160401b0381118282101715611c7457611c74611c3c565b60405160e081016001600160401b0381118282101715611c7457611c74611c3c565b604051601f8201601f191681016001600160401b0381118282101715611ce657611ce6611c3c565b604052919050565b60006001600160401b03821115611d0757611d07611c3c565b5060051b60200190565b60088110611d1e57600080fd5b50565b6001600160a01b0381168114611d1e57600080fd5b60008183036080811215611d4957600080fd5b611d51611c52565b91506040811215611d6157600080fd5b50611d6a611c7a565b8235611d7581611d11565b81526020830135611d8581611d21565b8060208301525080825250604082013560208201526060820135604082015292915050565b600082601f830112611dbb57600080fd5b81356020611dd0611dcb83611cee565b611cbe565b82815260079290921b84018101918181019086841115611def57600080fd5b8286015b84811015611a2f57611e058882611d36565b835291830191608001611df3565b60008060008060808587031215611e2957600080fd5b84356001600160401b03811115611e3f57600080fd5b611e4b87828801611daa565b9450506020850135611e5c81611d21565b92506040850135611e6c81611d21565b9396929550929360600135925050565b634e487b7160e01b600052602160045260246000fd5b60088110611d1e57634e487b7160e01b600052602160045260246000fd5b8051611ebb81611e92565b825260209081015161ffff16910152565b602080825282518282018190526000919060409081850190868401855b82811015611f0c57611efc848351611eb0565b9284019290850190600101611ee9565b5091979650505050505050565b600080600060408486031215611f2e57600080fd5b8335925060208401356001600160401b0380821115611f4c57600080fd5b818601915086601f830112611f6057600080fd5b813581811115611f6f57600080fd5b8760208260061b8501011115611f8457600080fd5b6020830194508093505050509250925092565b600060608284031215611fa957600080fd5b50919050565b600080600060a08486031215611fc457600080fd5b833592506020840135611fd681611d21565b9150611fe58560408601611f97565b90509250925092565b600080600060a0848603121561200357600080fd5b8335925060208401359150611fe58560408601611f97565b60006080828403121561202d57600080fd5b6109f28383611d36565b602080825282518282018190526000919060409081850190868401855b82811015611f0c57815180516001600160a01b03168552860151868501529284019290850190600101612054565b60008083601f84011261209457600080fd5b5081356001600160401b038111156120ab57600080fd5b6020830191508360206060830285010111156120c657600080fd5b9250929050565b6000806000604084860312156120e257600080fd5b8335925060208401356001600160401b038111156120ff57600080fd5b61210b86828701612082565b9497909650939450505050565b6000806040838503121561212b57600080fd5b82359150602083013561213d81611d21565b809150509250929050565b602080825282518282018190526000919060409081850190868401855b82811015611f0c57815180516001600160a01b0316855286810151878601528501518585015260609093019290850190600101612165565b6000602082840312156121af57600080fd5b81356001600160401b038111156121c557600080fd5b6121d184828501611daa565b949350505050565b600080600083850360808112156121ef57600080fd5b84359350602085013592506040603f198201121561220c57600080fd5b506040840190509250925092565b6000806040838503121561222d57600080fd5b50508035926020909101359150565b828152606081016118876020830184611eb0565b60006020828403121561226257600080fd5b5035919050565b60008060006060848603121561227e57600080fd5b83359250602084013561229081611d21565b929592945050506040919091013590565b60008060008060c085870312156122b757600080fd5b8435935060208501356122c981611d21565b9250604085013591506122df8660608701611f97565b905092959194509250565b6000806000806060858703121561230057600080fd5b84359350602085013561231281611d21565b925060408501356001600160401b0381111561232d57600080fd5b61233987828801612082565b95989497509550505050565b60008060008060e0858703121561235b57600080fd5b6123658686611d36565b9350608085013561237581611d21565b925060a085013561238581611d21565b9396929550929360c00135925050565b6020808252825182820181905260009190848201906040850190845b818110156123e2578351805184528501516123ce86850182611eb0565b5092840192606092909201916001016123b1565b50909695505050505050565b60008082840360a081121561240257600080fd5b608081121561241057600080fd5b50829150608083013561213d81611d21565b8051611b9981611d21565b60006020828403121561243f57600080fd5b815161188781611d21565b60208082526016908201527527b7363c903337b9102234b9b83630bc9027bbb732b960511b604082015260600190565b634e487b7160e01b600052603260045260246000fd5b80546001600160a01b0319166001600160a01b0392909216919091179055565b81356124bb81611d21565b6124c58183612490565b50602082013560018201555050565b6000602082840312156124e657600080fd5b813561188781611d21565b634e487b7160e01b600052601160045260246000fd5b600060018201612519576125196124f1565b5060010190565b61ffff81168114611d1e57600080fd5b8135815560018101602083013561254681611d11565b61254f81611e92565b8154604085013561255f81612520565b62ffff008160081b1660ff841662ffffff19841617178455505050505050565b60006020828403121561259157600080fd5b813561188781612520565b818103818111156109f5576109f56124f1565b634e487b7160e01b600052603160045260246000fd5b81356125d081611d21565b6125da8183612490565b5060208201356001820155604082013560028201555050565b6000818303608081121561260657600080fd5b61260e611c52565b9150604081121561261e57600080fd5b50612627611c7a565b825161263281611d11565b8152602083015161264281611d21565b8060208301525080825250604082015160208201526060820151604082015292915050565b600082601f83011261267857600080fd5b81516020612688611dcb83611cee565b82815260079290921b840181019181810190868411156126a757600080fd5b8286015b84811015611a2f576126bd88826125f3565b8352918301916080016126ab565b80516001600160f81b031981168114611b9957600080fd5b600082601f8301126126f457600080fd5b81516020612704611dcb83611cee565b8281526060928302850182019282820191908785111561272357600080fd5b8387015b8581101561277a5781818a03121561273f5760008081fd5b612747611c52565b612750826126cb565b8152858201518682015260408083015161276981611d21565b908201528452928401928101612727565b5090979650505050505050565b600082601f83011261279857600080fd5b815160206127a8611dcb83611cee565b82815260069290921b840181019181810190868411156127c757600080fd5b8286015b84811015611a2f57604081890312156127e45760008081fd5b6127ec611c7a565b6127f5826126cb565b815281850151858201528352918301916040016127cb565b600082601f83011261281e57600080fd5b8151602061282e611dcb83611cee565b82815260069290921b8401810191818101908684111561284d57600080fd5b8286015b84811015611a2f576040818903121561286a5760008081fd5b612872611c7a565b815161287d81611d21565b81528185015161288c81612520565b81860152835291830191604001612851565b80516001600160f01b031981168114611b9957600080fd5b6000602082840312156128c857600080fd5b81516001600160401b03808211156128df57600080fd5b9083019061014082860312156128f457600080fd5b6128fc611c9c565b61290686846125f3565b815260808301518281111561291a57600080fd5b61292687828601612667565b60208301525061293860a08401612422565b604082015260c08301518281111561294f57600080fd5b61295b878286016126e3565b60608301525060e08301518281111561297357600080fd5b61297f87828601612787565b6080830152506101008301518281111561299857600080fd5b6129a48782860161280d565b60a0830152506129b7610120840161289e565b60c082015295945050505050565b80820281158282048414176109f5576109f56124f1565b6000826129f957634e487b7160e01b600052601260045260246000fd5b500490565b81518051608083019190612a1181611e92565b83526020908101516001600160a01b0316818401528301516040808401919091529092015160609091015290565b600060408284031215612a5157600080fd5b612a59611c7a565b82518152602083015160208201528091505092915050565b600060208284031215612a8357600080fd5b505191905056feac8105a8870e67771145de5303c00bef4b671420232e5e776ebe7ba1f6078308a2646970667358221220c42be84edbbf65b937a9218059943c83f643240586335a2a2d52d7ae11b2bc2e64736f6c63430008150033000000000000000000000000714a99bea9f0ccb3c42bc4db944e09f67f889e7d

Deployed Bytecode

0x608060405234801561001057600080fd5b50600436106101735760003560e01c8063874081b7116100de578063b456994c11610097578063e36f198611610071578063e36f198614610372578063eeeb83d8146103a4578063f02280bc146103b7578063fcf5e47c146103c957600080fd5b8063b456994c1461032c578063bb14692f1461033f578063c185f8831461035f57600080fd5b8063874081b7146102a25780638a864593146102b55780639b33e82e146102c85780639fbf91b5146102db578063a002d5f4146102ee578063a63d41ef1461031957600080fd5b80636700ac2c116101305780636700ac2c14610214578063673d10bd146102345780636b107c2c146102485780636bc37eb91461025b5780636e074f771461026e578063804ae37a1461028f57600080fd5b806308c68aae146101785780631460e323146101a65780632434c6cb146101bb57806341684fbf146101ce57806352d93cd9146101e15780635ae6802614610201575b600080fd5b610190610186366004611e13565b6060949350505050565b60405161019d9190611ecc565b60405180910390f35b6101b96101b4366004611f19565b610401565b005b6101b96101c9366004611faf565b61058e565b6101b96101dc366004611fee565b6106e5565b6101f46101ef36600461201b565b6107e0565b60405161019d9190612037565b6101b961020f3660046120cd565b610871565b610227610222366004612118565b6109e6565b60405161019d9190612148565b6101f461024236600461219d565b50606090565b6101b96102563660046121d9565b6109fb565b6101b961026936600461221a565b610b1e565b61028161027c36600461221a565b610cea565b60405161019d92919061223c565b6101b961029d366004611fee565b610d57565b6101f46102b0366004612250565b610e39565b6101b96102c3366004612269565b610ec1565b6101b96102d63660046122a1565b61108c565b6102816102e936600461221a565b6111b1565b600554610301906001600160a01b031681565b6040516001600160a01b03909116815260200161019d565b6101b96103273660046122ea565b61120d565b61019061033a366004612345565b611360565b61035261034d366004612250565b6116b4565b60405161019d9190612395565b61028161036d36600461221a565b611774565b61038561038036600461221a565b6117b8565b604080516001600160a01b03909316835260208301919091520161019d565b6101f46103b236600461201b565b6117fe565b6101b96103c53660046123ee565b5050565b6103dc6103d7366004612269565b611a3a565b604080516001600160a01b03909416845260208401929092529082015260600161019d565b60055460405163b1d065f760e01b815260048101859052849133916001600160a01b039091169063b1d065f790602401602060405180830381865afa15801561044e573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610472919061242d565b6001600160a01b0316146104a15760405162461bcd60e51b81526004016104989061244a565b60405180910390fd5b6000848152600160205260408120905b8381101561058657818585838181106104cc576104cc61247a565b8354600181018555600094855260209094206040909102929092019260020290910190506104fa82826124b0565b505084848281811061050e5761050e61247a565b9050604002016020013585858381811061052a5761052a61247a565b61054092602060409092020190810191506124d4565b6001600160a01b0316877fc9287c87d9108dffc94744e56ad989771946c1c21955b7c417e408eb3192d8fe60405160405180910390a461057f81612507565b90506104b1565b505050505050565b60055460405163b1d065f760e01b815260048101859052849133916001600160a01b039091169063b1d065f790602401602060405180830381865afa1580156105db573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906105ff919061242d565b6001600160a01b0316146106255760405162461bcd60e51b81526004016104989061244a565b600084815260046020908152604080832081516001600160a01b03881681850152825180820385018152908301835280519084012084529091529020829061066d8282612530565b5050604080516001600160a01b03851660208201526001918691600080516020612a8b8339815191529101604051602081830303815290604052805190602001208560200160200160208101906106c4919061257f565b6040805192835261ffff90911660208301520160405180910390a350505050565b60055460405163b1d065f760e01b815260048101859052849133916001600160a01b039091169063b1d065f790602401602060405180830381865afa158015610732573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610756919061242d565b6001600160a01b03161461077c5760405162461bcd60e51b81526004016104989061244a565b600084815260026020526040902080548391908590811061079f5761079f61247a565b906000526020600020906002020181816107b99190612530565b506003905084600080516020612a8b83398151915284356106c4606087016040880161257f565b606060006107ed83611a94565b80516000908152600160209081526040808320805482518185028101850190935280835294955090939092909184015b82821015610865576000848152602090819020604080518082019091526002850290910180546001600160a01b0316825260019081015482840152908352909201910161081d565b50505050915050919050565b60055460405163b1d065f760e01b815260048101859052849133916001600160a01b039091169063b1d065f790602401602060405180830381865afa1580156108be573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906108e2919061242d565b6001600160a01b0316146109085760405162461bcd60e51b81526004016104989061244a565b6000848152600260205260408120905b8381101561058657818585838181106109335761093361247a565b8354600181018555600094855260209094206060909102929092019260020290910190506109618282612530565b506003905086600080516020612a8b8339815191528787858181106109885761098861247a565b606002919091013590508888868181106109a4576109a461247a565b6109bb92606091820201908101915060400161257f565b6040805192835261ffff90911660208301520160405180910390a36109df81612507565b9050610918565b60606109f28383611b9e565b90505b92915050565b60055460405163b1d065f760e01b815260048101859052849133916001600160a01b039091169063b1d065f790602401602060405180830381865afa158015610a48573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610a6c919061242d565b6001600160a01b031614610a925760405162461bcd60e51b81526004016104989061244a565b6000848152600160205260409020805483919085908110610ab557610ab561247a565b90600052602060002090600202018181610acf91906124b0565b505060208201803590610ae290846124d4565b6001600160a01b0316857fc9287c87d9108dffc94744e56ad989771946c1c21955b7c417e408eb3192d8fe60405160405180910390a450505050565b60055460405163b1d065f760e01b815260048101849052839133916001600160a01b039091169063b1d065f790602401602060405180830381865afa158015610b6b573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610b8f919061242d565b6001600160a01b031614610bb55760405162461bcd60e51b81526004016104989061244a565b600083815260016020819052604090912080549091610bd39161259c565b8314610c525780548190610be99060019061259c565b81548110610bf957610bf961247a565b9060005260206000209060020201818481548110610c1957610c1961247a565b60009182526020909120825460029092020180546001600160a01b0319166001600160a01b039092169190911781556001918201549101555b6000818481548110610c6657610c6661247a565b600091825260208220600290910201546040516001600160a01b039091169187917fc9287c87d9108dffc94744e56ad989771946c1c21955b7c417e408eb3192d8fe9190a480805480610cbb57610cbb6125af565b60008281526020812060026000199093019283020180546001600160a01b031916815560010155905550505050565b60036020908152600092835260408084209091529082529081902080548251808401909352600182018054919391829060ff166007811115610d2e57610d2e611e7c565b6007811115610d3f57610d3f611e7c565b81529054610100900461ffff16602090910152905082565b60055460405163b1d065f760e01b815260048101859052849133916001600160a01b039091169063b1d065f790602401602060405180830381865afa158015610da4573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610dc8919061242d565b6001600160a01b031614610dee5760405162461bcd60e51b81526004016104989061244a565b600084815260036020908152604080832086845290915290208290610e138282612530565b506000905084600080516020612a8b833981519152856106c4606087016040880161257f565b606060016000838152602001908152602001600020805480602002602001604051908101604052809291908181526020016000905b82821015610eb6576000848152602090819020604080518082019091526002850290910180546001600160a01b03168252600190810154828401529083529092019101610e6e565b505050509050919050565b60055460405163b1d065f760e01b815260048101859052849133916001600160a01b039091169063b1d065f790602401602060405180830381865afa158015610f0e573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610f32919061242d565b6001600160a01b031614610f585760405162461bcd60e51b81526004016104989061244a565b6000848152602081815260408083206001600160a01b038716845290915290208054610f869060019061259c565b831461100f5780548190610f9c9060019061259c565b81548110610fac57610fac61247a565b9060005260206000209060030201818481548110610fcc57610fcc61247a565b60009182526020909120825460039092020180546001600160a01b0319166001600160a01b03909216919091178155600180830154908201556002918201549101555b8080548061101f5761101f6125af565b60008281526020812060036000199093019283020180546001600160a01b03191681556001810182905560020181905591556040516001600160a01b0386169187917f3a188bdc141f7cc1f608c33ff343bd3caafb83f4e70dd7d8b04c038786c209499190a35050505050565b60055460405163b1d065f760e01b815260048101869052859133916001600160a01b039091169063b1d065f790602401602060405180830381865afa1580156110d9573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906110fd919061242d565b6001600160a01b0316146111235760405162461bcd60e51b81526004016104989061244a565b6000858152602081815260408083206001600160a01b038816845290915290208054839190859081106111585761115861247a565b9060005260206000209060030201818161117291906125c5565b50506040516001600160a01b0385169086907f3a188bdc141f7cc1f608c33ff343bd3caafb83f4e70dd7d8b04c038786c2094990600090a35050505050565b600260205281600052604060002081815481106111cd57600080fd5b600091825260209091206002909102018054604080518082019091526001830180549295509293509190829060ff166007811115610d2e57610d2e611e7c565b60055460405163b1d065f760e01b815260048101869052859133916001600160a01b039091169063b1d065f790602401602060405180830381865afa15801561125a573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061127e919061242d565b6001600160a01b0316146112a45760405162461bcd60e51b81526004016104989061244a565b6000858152602081815260408083206001600160a01b03881684529091528120905b8381101561135757818585838181106112e1576112e161247a565b83546001810185556000948552602090942060609091029290920192600302909101905061130f82826125c5565b50506040516001600160a01b0387169088907f3a188bdc141f7cc1f608c33ff343bd3caafb83f4e70dd7d8b04c038786c2094990600090a361135081612507565b90506112c6565b50505050505050565b6060600061136d86611a94565b8051600090815260026020526040902090915061139a604080518082019091526000808252602082015290565b60005b825481101561145e57428382815481106113b9576113b961247a565b906000526020600020906002020160000154111561144e578281815481106113e3576113e361247a565b90600052602060002090600202016001016040518060400160405290816000820160009054906101000a900460ff16600781111561142357611423611e7c565b600781111561143457611434611e7c565b81529054610100900461ffff16602090910152915061145e565b61145781612507565b905061139d565b5060408051600380825260808201909252600091816020015b604080518082019091526000808252602082015281526020019060019003908161147757905050905060005b81518110156116a75782826000815181106114c0576114c061247a565b602090810291909101810191909152855160009081526003825260408082208a8352909252205442101561157b5760408051808201825286516000908152600360209081528382208b835290529190912060010154819060ff16600781111561152b5761152b611e7c565b8152865160009081526003602090815260408083208c84528252909120600190810154610100900461ffff1691909201528351849190811061156f5761156f61247a565b60200260200101819052505b8451600090815260046020908152604080832081516001600160a01b038d1681850152825180820385018152908301835280519084012084529091529020544210156116975760408051808201825286516000908152600460209081528382206001600160a01b038d1660608086019190915285518086039091018152608085018652805190830120835290529190912060010154819060ff16600781111561162657611626611e7c565b81528651600090815260046020908152604080832081516001600160a01b038f168185015282518082038501815290830183528051908401208452825290912060010154610100900461ffff1691015282518390600290811061168b5761168b61247a565b60200260200101819052505b6116a081612507565b90506114a3565b5098975050505050505050565b606060026000838152602001908152602001600020805480602002602001604051908101604052809291908181526020016000905b82821015610eb657600084815260209081902060408051808201825260028602909201805483528151808301909252600181018054939491939185019291829060ff16600781111561173d5761173d611e7c565b600781111561174e5761174e611e7c565b81529054610100900461ffff1660209182015291529183525060019290920191016116e9565b60046020908152600092835260408084209091529082529081902080548251808401909352600182018054919391829060ff166007811115610d2e57610d2e611e7c565b600160205281600052604060002081815481106117d457600080fd5b6000918252602090912060029091020180546001909101546001600160a01b039091169250905082565b8051602090810151908201516040516310976e1960e11b8152606092916001600160a01b0383169163212edc329161183c9160040190815260200190565b600060405180830381865afa92505050801561187a57506040513d6000823e601f3d908101601f1916820160405261187791908101906128b6565b60015b61188e57611887836107e0565b9392505050565b600061189985611a94565b905060006118d1826000015184602001516000815181106118bc576118bc61247a565b60200260200101516000015160200151611b9e565b9050600081516001600160401b038111156118ee576118ee611c3c565b60405190808252806020026020018201604052801561193357816020015b604080518082019091526000808252602082015281526020019060019003908161190c5790505b50905060005b8251811015611a2f578281815181106119545761195461247a565b6020026020010151600001518282815181106119725761197261247a565b60209081029190910101516001600160a01b039091169052825183908290811061199e5761199e61247a565b60200260200101516040015185602001516000815181106119c1576119c161247a565b6020026020010151604001518483815181106119df576119df61247a565b6020026020010151602001516119f591906129c5565b6119ff91906129dc565b828281518110611a1157611a1161247a565b6020908102919091018101510152611a2881612507565b9050611939565b509695505050505050565b60006020528260005260406000206020528160005260406000208181548110611a6257600080fd5b60009182526020909120600390910201805460018201546002909201546001600160a01b039091169450909250905083565b60408051808201825260008082526020820152600554915163014cd93360e51b815290916001600160a01b03169063299b266090611ad69085906004016129fe565b6040805180830381865afa158015611af2573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611b169190612a3f565b8051909150611b9957600560009054906101000a90046001600160a01b03166001600160a01b0316632eeb42b36040518163ffffffff1660e01b8152600401602060405180830381865afa158015611b72573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611b969190612a71565b81525b919050565b6000828152602081815260408083206001600160a01b03851684528252808320805482518185028101850190935280835260609492939192909184015b82821015611c30576000848152602090819020604080516060810182526003860290920180546001600160a01b0316835260018082015484860152600290910154918301919091529083529092019101611bdb565b50505050905092915050565b634e487b7160e01b600052604160045260246000fd5b604051606081016001600160401b0381118282101715611c7457611c74611c3c565b60405290565b604080519081016001600160401b0381118282101715611c7457611c74611c3c565b60405160e081016001600160401b0381118282101715611c7457611c74611c3c565b604051601f8201601f191681016001600160401b0381118282101715611ce657611ce6611c3c565b604052919050565b60006001600160401b03821115611d0757611d07611c3c565b5060051b60200190565b60088110611d1e57600080fd5b50565b6001600160a01b0381168114611d1e57600080fd5b60008183036080811215611d4957600080fd5b611d51611c52565b91506040811215611d6157600080fd5b50611d6a611c7a565b8235611d7581611d11565b81526020830135611d8581611d21565b8060208301525080825250604082013560208201526060820135604082015292915050565b600082601f830112611dbb57600080fd5b81356020611dd0611dcb83611cee565b611cbe565b82815260079290921b84018101918181019086841115611def57600080fd5b8286015b84811015611a2f57611e058882611d36565b835291830191608001611df3565b60008060008060808587031215611e2957600080fd5b84356001600160401b03811115611e3f57600080fd5b611e4b87828801611daa565b9450506020850135611e5c81611d21565b92506040850135611e6c81611d21565b9396929550929360600135925050565b634e487b7160e01b600052602160045260246000fd5b60088110611d1e57634e487b7160e01b600052602160045260246000fd5b8051611ebb81611e92565b825260209081015161ffff16910152565b602080825282518282018190526000919060409081850190868401855b82811015611f0c57611efc848351611eb0565b9284019290850190600101611ee9565b5091979650505050505050565b600080600060408486031215611f2e57600080fd5b8335925060208401356001600160401b0380821115611f4c57600080fd5b818601915086601f830112611f6057600080fd5b813581811115611f6f57600080fd5b8760208260061b8501011115611f8457600080fd5b6020830194508093505050509250925092565b600060608284031215611fa957600080fd5b50919050565b600080600060a08486031215611fc457600080fd5b833592506020840135611fd681611d21565b9150611fe58560408601611f97565b90509250925092565b600080600060a0848603121561200357600080fd5b8335925060208401359150611fe58560408601611f97565b60006080828403121561202d57600080fd5b6109f28383611d36565b602080825282518282018190526000919060409081850190868401855b82811015611f0c57815180516001600160a01b03168552860151868501529284019290850190600101612054565b60008083601f84011261209457600080fd5b5081356001600160401b038111156120ab57600080fd5b6020830191508360206060830285010111156120c657600080fd5b9250929050565b6000806000604084860312156120e257600080fd5b8335925060208401356001600160401b038111156120ff57600080fd5b61210b86828701612082565b9497909650939450505050565b6000806040838503121561212b57600080fd5b82359150602083013561213d81611d21565b809150509250929050565b602080825282518282018190526000919060409081850190868401855b82811015611f0c57815180516001600160a01b0316855286810151878601528501518585015260609093019290850190600101612165565b6000602082840312156121af57600080fd5b81356001600160401b038111156121c557600080fd5b6121d184828501611daa565b949350505050565b600080600083850360808112156121ef57600080fd5b84359350602085013592506040603f198201121561220c57600080fd5b506040840190509250925092565b6000806040838503121561222d57600080fd5b50508035926020909101359150565b828152606081016118876020830184611eb0565b60006020828403121561226257600080fd5b5035919050565b60008060006060848603121561227e57600080fd5b83359250602084013561229081611d21565b929592945050506040919091013590565b60008060008060c085870312156122b757600080fd5b8435935060208501356122c981611d21565b9250604085013591506122df8660608701611f97565b905092959194509250565b6000806000806060858703121561230057600080fd5b84359350602085013561231281611d21565b925060408501356001600160401b0381111561232d57600080fd5b61233987828801612082565b95989497509550505050565b60008060008060e0858703121561235b57600080fd5b6123658686611d36565b9350608085013561237581611d21565b925060a085013561238581611d21565b9396929550929360c00135925050565b6020808252825182820181905260009190848201906040850190845b818110156123e2578351805184528501516123ce86850182611eb0565b5092840192606092909201916001016123b1565b50909695505050505050565b60008082840360a081121561240257600080fd5b608081121561241057600080fd5b50829150608083013561213d81611d21565b8051611b9981611d21565b60006020828403121561243f57600080fd5b815161188781611d21565b60208082526016908201527527b7363c903337b9102234b9b83630bc9027bbb732b960511b604082015260600190565b634e487b7160e01b600052603260045260246000fd5b80546001600160a01b0319166001600160a01b0392909216919091179055565b81356124bb81611d21565b6124c58183612490565b50602082013560018201555050565b6000602082840312156124e657600080fd5b813561188781611d21565b634e487b7160e01b600052601160045260246000fd5b600060018201612519576125196124f1565b5060010190565b61ffff81168114611d1e57600080fd5b8135815560018101602083013561254681611d11565b61254f81611e92565b8154604085013561255f81612520565b62ffff008160081b1660ff841662ffffff19841617178455505050505050565b60006020828403121561259157600080fd5b813561188781612520565b818103818111156109f5576109f56124f1565b634e487b7160e01b600052603160045260246000fd5b81356125d081611d21565b6125da8183612490565b5060208201356001820155604082013560028201555050565b6000818303608081121561260657600080fd5b61260e611c52565b9150604081121561261e57600080fd5b50612627611c7a565b825161263281611d11565b8152602083015161264281611d21565b8060208301525080825250604082015160208201526060820151604082015292915050565b600082601f83011261267857600080fd5b81516020612688611dcb83611cee565b82815260079290921b840181019181810190868411156126a757600080fd5b8286015b84811015611a2f576126bd88826125f3565b8352918301916080016126ab565b80516001600160f81b031981168114611b9957600080fd5b600082601f8301126126f457600080fd5b81516020612704611dcb83611cee565b8281526060928302850182019282820191908785111561272357600080fd5b8387015b8581101561277a5781818a03121561273f5760008081fd5b612747611c52565b612750826126cb565b8152858201518682015260408083015161276981611d21565b908201528452928401928101612727565b5090979650505050505050565b600082601f83011261279857600080fd5b815160206127a8611dcb83611cee565b82815260069290921b840181019181810190868411156127c757600080fd5b8286015b84811015611a2f57604081890312156127e45760008081fd5b6127ec611c7a565b6127f5826126cb565b815281850151858201528352918301916040016127cb565b600082601f83011261281e57600080fd5b8151602061282e611dcb83611cee565b82815260069290921b8401810191818101908684111561284d57600080fd5b8286015b84811015611a2f576040818903121561286a5760008081fd5b612872611c7a565b815161287d81611d21565b81528185015161288c81612520565b81860152835291830191604001612851565b80516001600160f01b031981168114611b9957600080fd5b6000602082840312156128c857600080fd5b81516001600160401b03808211156128df57600080fd5b9083019061014082860312156128f457600080fd5b6128fc611c9c565b61290686846125f3565b815260808301518281111561291a57600080fd5b61292687828601612667565b60208301525061293860a08401612422565b604082015260c08301518281111561294f57600080fd5b61295b878286016126e3565b60608301525060e08301518281111561297357600080fd5b61297f87828601612787565b6080830152506101008301518281111561299857600080fd5b6129a48782860161280d565b60a0830152506129b7610120840161289e565b60c082015295945050505050565b80820281158282048414176109f5576109f56124f1565b6000826129f957634e487b7160e01b600052601260045260246000fd5b500490565b81518051608083019190612a1181611e92565b83526020908101516001600160a01b0316818401528301516040808401919091529092015160609091015290565b600060408284031215612a5157600080fd5b612a59611c7a565b82518152602083015160208201528091505092915050565b600060208284031215612a8357600080fd5b505191905056feac8105a8870e67771145de5303c00bef4b671420232e5e776ebe7ba1f6078308a2646970667358221220c42be84edbbf65b937a9218059943c83f643240586335a2a2d52d7ae11b2bc2e64736f6c63430008150033

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

000000000000000000000000714a99bea9f0ccb3c42bc4db944e09f67f889e7d

-----Decoded View---------------
Arg [0] : _kiosk (address): 0x714a99BeA9F0CCb3c42bc4db944E09f67F889E7D

-----Encoded View---------------
1 Constructor Arguments found :
Arg [0] : 000000000000000000000000714a99bea9f0ccb3c42bc4db944e09f67f889e7d


Block Transaction Difficulty Gas Used Reward
View All Blocks Produced

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

Validator Index Block Amount
View All Withdrawals

Transaction Hash Block Value Eth2 PubKey Valid
View All Deposits
[ 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.