Contract 0x83C8F28c26bF6aaca652Df1DbBE0e1b56F8baBa2 10

 

Contract Overview

Gem: GemSwap 2
Balance:
0 Ether

EtherValue:
$0.00

Token:
 
Txn Hash
Method
Block
From
To
Value
0x8b0bde43d660b8a667cb9e3c9cff642e67cda6ea2442f57632049271aa7be6030x9a2b8115(pending)2022-12-07 18:02:112 hrs 20 mins ago0xa4a1ba5a0626db021d201583b2330136ff84ca78 IN Gem: GemSwap 20.0369 Ether(Pending)(Pending)
0x2595c5ee45bd08cc4549aa70bff38e5ca0f8f9492664b633c0bbf631e5a66e0f0x9a2b8115161351762022-12-07 20:20:472 mins agoENS Name zozotv.eth IN  Gem: GemSwap 20.12156578 Ether0.00904187 14.68968908
0x55c36b03fac03e337024fee8902f7644866286d993583b5e33469dab2e3230d30x9a2b8115161351152022-12-07 20:08:3514 mins ago0xe5452ec2b3e4f902524781f6b0f01740167da2b9 IN  Gem: GemSwap 20.0486 Ether0.01422574 17.68717425
0x9845c040cfaae0767d6e10f98cd874f98e93b31cf6c7e31dbb3fc4fa6a6d29fb0x9a2b8115161350702022-12-07 19:59:3523 mins ago0x7027beccaa66ea88b3b15372940c21c334292e8c IN  Gem: GemSwap 20.0528 Ether0.01290144 16.51837661
0xfccce100011c73d216f97e7eaa848158478bb1f8c51a77a00f70291707e4ec4f0x9a2b8115161350332022-12-07 19:51:5930 mins ago0x4162ffbe6860e911838bbe1d227d204eb68fee5e IN  Gem: GemSwap 20.03272046 Ether0.00922887 19.0409841
0x2ec0109ff1946380ab5d2836e7a25b854fc32d131884833048ca95c15ae730f10x9a2b8115161350122022-12-07 19:47:4735 mins ago0x12fc3113142226dd93482f4bb9abd865d33b33f8 IN  Gem: GemSwap 21.3646 Ether0.01060515 16.55612402
0x0278e66258085017bf1359588015d08f780fa16f6832e54cf66f749e6a4a58c40x9a2b8115161349292022-12-07 19:30:5951 mins agoENS Name liked.eth IN  Gem: GemSwap 20.16 Ether0.0191682 29.88140078
0x209d40db45efc79b9066673b5d18716db74e809d48ca4f26a1a3e72aa7f584d90x9a2b8115161349182022-12-07 19:28:4754 mins agoENS Name liked.eth IN  Gem: GemSwap 20.1177 Ether0.01752127 32.41685566
0x6c4a4bbde84bc001c581c2460d7838ffbc253b3a89e410a30a3c096b8105d7e10x9a2b8115161348962022-12-07 19:24:2358 mins agoENS Name lincolncannon.eth IN  Gem: GemSwap 20.02002 Ether0.0057935 16.42081205
0x001d83e0356898c7e311260394f4d9ace77662cf625bb3f6aae8377fc58326ce0x9a2b8115161348462022-12-07 19:14:231 hr 8 mins ago0xdb6de290e75928b092dcd0dfcfce17af20ce2f15 IN  Gem: GemSwap 21.42056303 Ether0.0063573 17.9604757
0x8d5362b36def365f7f4b4996877666946e886eac63c90bc729897c879edfae7d0x9a2b8115161348262022-12-07 19:10:231 hr 12 mins agoENS Name natcho.eth IN  Gem: GemSwap 21.55 Ether0.01113626 21.89892952
0x95401a0d26593ecd5e03321b5cd4024bc7e0c15ab768abb61f97732b6a68d67a0x9a2b8115161348222022-12-07 19:09:351 hr 13 mins agoENS Name whitegrape.eth IN  Gem: GemSwap 22.86136363 Ether0.0255023 22.6074627
0x65910c86a62e7ce0368acd8e54402b4b8f37ccac767a700f10afd1c7f81dbab40x9a2b8115161348062022-12-07 19:06:231 hr 16 mins agoENS Name one.0x5f-capital.eth IN  Gem: GemSwap 26.35899 Ether0.01454114 23.64610131
0xe110800d9db35570cc8397df0e3ab2b974875852a13b6b82666ee48377847fbd0x9a2b8115161347992022-12-07 19:04:591 hr 17 mins ago0x9363113e33e67cb2b50ac57ed52166bef07d853b IN  Gem: GemSwap 24.83 Ether0.01293476 25.58265229
0xd0cc004e9579976ebd93427bf869dd89f72bd932b0ce808ae12d2ba4904e17e30x9a2b8115161347062022-12-07 18:46:231 hr 36 mins ago0x8df54b642275032266191a75fe7b87291c9ba32b IN  Gem: GemSwap 20.12975254 Ether0.02768241 17.12539599
0x0d89573e83c27bde57fbc1fb9b276dd5d9c3c15fdf6fe77e4e88a38cab599efb0x9a2b8115161346562022-12-07 18:36:231 hr 46 mins ago0x8dba53939212e57833e0c7ea49162654841d0436 IN  Gem: GemSwap 22.25769 Ether0.01442918 20.21197402
0x45d812e00959104395692d68c2bf36b9136d4e108a151d20403ec420038be1f20x9a2b8115161346222022-12-07 18:29:351 hr 53 mins ago0xbf47fe944705aed612143c49315ae0d9161c7a97 IN  Gem: GemSwap 230.6789 Ether0.05000252 25.05231705
0x9af8813d346771ff6345ba7301d83e1e49d09b99fd8bfbd5abe57a7338bfa3ce0x9a2b8115161346012022-12-07 18:25:231 hr 57 mins ago0xbf47fe944705aed612143c49315ae0d9161c7a97 IN  Gem: GemSwap 26.48 Ether0.01779413 32.33232988
0x538c743b0f4a81b153eeb23ea82b8b1c9f20afc6647c834f05acb413dac4f23a0x9a2b8115161345972022-12-07 18:24:351 hr 58 mins ago0xbf47fe944705aed612143c49315ae0d9161c7a97 IN  Gem: GemSwap 24.9488 Ether0.0168024 33.95852797
0x3e7247e8c45f4c657e1a7eebacdabf4bca327714dc38753e7d530c305bd190a80x9a2b8115161345972022-12-07 18:24:351 hr 58 mins ago0x94cb0168c37622e78f9b559259f943db53e027ac IN  Gem: GemSwap 23 Ether0.0211858100
0x384d1630e66738c261dd631321aa7d95ff18dcda104a60d7c2982274c1a47c2a0x9a2b8115161345932022-12-07 18:23:471 hr 59 mins agoENS Name heisentoad.eth IN  Gem: GemSwap 24.64555555 Ether0.08565224 177
0x21377c4d61aaddca0ae01d5cfc02b87f3e61c73e0a22a6ecf2957ce3b35d1a2f0x9a2b8115161345902022-12-07 18:23:111 hr 59 mins ago0xf07fb6b2cf121b59737801cc98abcd84d9ea2269 IN  Gem: GemSwap 24.5 Ether0.01881258 41.56834359
0x0e139c565a50a31402e0efd582f0b99fbd7adb493dc0453d86c4e466dada29500x9a2b8115161345892022-12-07 18:22:591 hr 59 mins ago0xbf47fe944705aed612143c49315ae0d9161c7a97 IN  Gem: GemSwap 24.4594 Ether0.01707676 42.20517467
0xe6bfb1d1583d80853771e434eb9f5e18acd57344707ebdd6632023fcdf0d07be0x9a2b8115161345802022-12-07 18:21:112 hrs 1 min ago0x22f9a703778e0a026cbf564937327e9a61b301f5 IN  Gem: GemSwap 23 Ether0.0135019 37.92263936
0x3c31b71ec7917d7b22d80587e7a616b2d564f00cdd38ad41c70016addd5a6bbd0x9a2b8115161345742022-12-07 18:19:592 hrs 2 mins agoENS Name dimethyl.eth IN  Gem: GemSwap 21.375 Ether0.00459806 35.45209706
[ Download CSV Export 
Latest 25 internal transaction
Parent Txn Hash Block From To Value
0x2595c5ee45bd08cc4549aa70bff38e5ca0f8f9492664b633c0bbf631e5a66e0f161351762022-12-07 20:20:472 mins ago Gem: GemSwap 2ENS Name zozotv.eth0.00082561 Ether
0x2595c5ee45bd08cc4549aa70bff38e5ca0f8f9492664b633c0bbf631e5a66e0f161351762022-12-07 20:20:472 mins ago Gem: GemSwap 2 sudoswap: Pair Router0.03817836 Ether
0x2595c5ee45bd08cc4549aa70bff38e5ca0f8f9492664b633c0bbf631e5a66e0f161351762022-12-07 20:20:472 mins ago SushiSwap: Router Gem: GemSwap 20.00082561 Ether
0x2595c5ee45bd08cc4549aa70bff38e5ca0f8f9492664b633c0bbf631e5a66e0f161351762022-12-07 20:20:472 mins ago Gem: GemSwap 2 SushiSwap: Router0.08338741 Ether
0x55c36b03fac03e337024fee8902f7644866286d993583b5e33469dab2e3230d3161351152022-12-07 20:08:3514 mins ago Gem: GemSwap 2 LooksRare: Exchange0.01 Ether
0x55c36b03fac03e337024fee8902f7644866286d993583b5e33469dab2e3230d3161351152022-12-07 20:08:3514 mins ago Gem: GemSwap 2 Seaport 1.10.0386 Ether
0x9845c040cfaae0767d6e10f98cd874f98e93b31cf6c7e31dbb3fc4fa6a6d29fb161350702022-12-07 19:59:3523 mins ago Gem: GemSwap 20x7027beccaa66ea88b3b15372940c21c334292e8c0.0172 Ether
0x9845c040cfaae0767d6e10f98cd874f98e93b31cf6c7e31dbb3fc4fa6a6d29fb161350702022-12-07 19:59:3523 mins ago Gem: GemSwap 2 X2Y2: Exchange0.0098 Ether
0x9845c040cfaae0767d6e10f98cd874f98e93b31cf6c7e31dbb3fc4fa6a6d29fb161350702022-12-07 19:59:3523 mins ago Seaport 1.1 Gem: GemSwap 20.0172 Ether
0x9845c040cfaae0767d6e10f98cd874f98e93b31cf6c7e31dbb3fc4fa6a6d29fb161350702022-12-07 19:59:3523 mins ago Gem: GemSwap 2 Seaport 1.10.043 Ether
0xfccce100011c73d216f97e7eaa848158478bb1f8c51a77a00f70291707e4ec4f161350332022-12-07 19:51:5930 mins ago Gem: GemSwap 20x4162ffbe6860e911838bbe1d227d204eb68fee5e0.00032396 Ether
0xfccce100011c73d216f97e7eaa848158478bb1f8c51a77a00f70291707e4ec4f161350332022-12-07 19:51:5930 mins ago SushiSwap: Router Gem: GemSwap 20.00032396 Ether
0xfccce100011c73d216f97e7eaa848158478bb1f8c51a77a00f70291707e4ec4f161350332022-12-07 19:51:5930 mins ago Gem: GemSwap 2 SushiSwap: Router0.03272046 Ether
0x2ec0109ff1946380ab5d2836e7a25b854fc32d131884833048ca95c15ae730f1161350122022-12-07 19:47:4735 mins ago Gem: GemSwap 2 LooksRare: Exchange0.265 Ether
0x2ec0109ff1946380ab5d2836e7a25b854fc32d131884833048ca95c15ae730f1161350122022-12-07 19:47:4735 mins ago Gem: GemSwap 2 LooksRare: Exchange0.26 Ether
0x2ec0109ff1946380ab5d2836e7a25b854fc32d131884833048ca95c15ae730f1161350122022-12-07 19:47:4735 mins ago Gem: GemSwap 2 sudoswap: Pair Router0.8396 Ether
0x0278e66258085017bf1359588015d08f780fa16f6832e54cf66f749e6a4a58c4161349292022-12-07 19:30:5951 mins ago Gem: GemSwap 2 X2Y2: Exchange0.04 Ether
0x0278e66258085017bf1359588015d08f780fa16f6832e54cf66f749e6a4a58c4161349292022-12-07 19:30:5951 mins ago Gem: GemSwap 2 Seaport 1.10.12 Ether
0x209d40db45efc79b9066673b5d18716db74e809d48ca4f26a1a3e72aa7f584d9161349182022-12-07 19:28:4754 mins ago Gem: GemSwap 2 X2Y2: Exchange0.039 Ether
0x209d40db45efc79b9066673b5d18716db74e809d48ca4f26a1a3e72aa7f584d9161349182022-12-07 19:28:4754 mins ago Gem: GemSwap 2 Seaport 1.10.0787 Ether
0x6c4a4bbde84bc001c581c2460d7838ffbc253b3a89e410a30a3c096b8105d7e1161348962022-12-07 19:24:2358 mins ago Gem: GemSwap 2 LooksRare: Exchange0.01001 Ether
0x6c4a4bbde84bc001c581c2460d7838ffbc253b3a89e410a30a3c096b8105d7e1161348962022-12-07 19:24:2358 mins ago Gem: GemSwap 2 LooksRare: Exchange0.01001 Ether
0x001d83e0356898c7e311260394f4d9ace77662cf625bb3f6aae8377fc58326ce161348462022-12-07 19:14:231 hr 8 mins ago Gem: GemSwap 2 sudoswap: Pair Router0.65156303 Ether
0x001d83e0356898c7e311260394f4d9ace77662cf625bb3f6aae8377fc58326ce161348462022-12-07 19:14:231 hr 8 mins ago Gem: GemSwap 2 Seaport 1.10.769 Ether
0x8d5362b36def365f7f4b4996877666946e886eac63c90bc729897c879edfae7d161348262022-12-07 19:10:231 hr 12 mins ago Gem: GemSwap 2 LooksRare: Exchange0.8 Ether
[ Download CSV Export 
Loading
This contract may be a proxy contract. Click on More Options and select Is this a proxy? to confirm and enable the "Read as Proxy" & "Write as Proxy" tabs.

Contract Source Code Verified (Exact Match)

Contract Name:
GemSwap

Compiler Version
v0.8.11+commit.d7f03943

Optimization Enabled:
Yes with 20000 runs

Other Settings:
default evmVersion
File 1 of 12 : GemSwap.sol
// SPDX-License-Identifier: MIT

pragma solidity 0.8.11;


import "@openzeppelin/contracts/access/Ownable.sol";
import "./utils/ReentrancyGuard.sol";
import "./markets/MarketRegistry.sol";
import "./SpecialTransferHelper.sol";
import "../../interfaces/markets/tokens/IERC20.sol";
import "../../interfaces/markets/tokens/IERC721.sol";
import "../../interfaces/markets/tokens/IERC1155.sol";

contract GemSwap is SpecialTransferHelper, Ownable, ReentrancyGuard {

    struct OpenseaTrades {
        uint256 value;
        bytes tradeData;
    }

    struct ERC20Details {
        address[] tokenAddrs;
        uint256[] amounts;
    }

    struct ERC1155Details {
        address tokenAddr;
        uint256[] ids;
        uint256[] amounts;
    }

    struct ConverstionDetails {
        bytes conversionData;
    }

    struct AffiliateDetails {
        address affiliate;
        bool isActive;
    }

    struct SponsoredMarket {
        uint256 marketId;
        bool isActive;
    }

    address public constant GOV = 0x83d841bC0450D5Ac35DCAd8d05Db53EbA29978c2;
    address public guardian;
    address public converter;
    address public punkProxy;
    uint256 public baseFees;
    bool public openForTrades;
    bool public openForFreeTrades;
    MarketRegistry public marketRegistry;
    AffiliateDetails[] public affiliates;
    SponsoredMarket[] public sponsoredMarkets;

    modifier isOpenForTrades() {
        require(openForTrades, "trades not allowed");
        _;
    }

    modifier isOpenForFreeTrades() {
        require(openForFreeTrades, "free trades not allowed");
        _;
    }

    constructor(address _marketRegistry, address _converter, address _guardian) {
        marketRegistry = MarketRegistry(_marketRegistry);
        converter = _converter;
        guardian = _guardian;
        baseFees = 0;
        openForTrades = true;
        openForFreeTrades = true;
        affiliates.push(AffiliateDetails(GOV, true));
    }

    function setUp() external onlyOwner {
        // Create CryptoPunk Proxy
        IWrappedPunk(0xb7F7F6C52F2e2fdb1963Eab30438024864c313F6).registerProxy();
        punkProxy = IWrappedPunk(0xb7F7F6C52F2e2fdb1963Eab30438024864c313F6).proxyInfo(address(this));

        // approve wrapped mooncats rescue to Acclimated​MoonCats contract
        IERC721(0x7C40c393DC0f283F318791d746d894DdD3693572).setApprovalForAll(0xc3f733ca98E0daD0386979Eb96fb1722A1A05E69, true);
    }

    // @audit This function is used to approve specific tokens to specific market contracts with high volume.
    // This is done in very rare cases for the gas optimization purposes. 
    function setOneTimeApproval(IERC20 token, address operator, uint256 amount) external onlyOwner {
        token.approve(operator, amount);
    }

    function updateGuardian(address _guardian) external onlyOwner {
        guardian = _guardian;
    }

    function addAffiliate(address _affiliate) external onlyOwner {
        affiliates.push(AffiliateDetails(_affiliate, true));
    }

    function updateAffiliate(uint256 _affiliateIndex, address _affiliate, bool _IsActive) external onlyOwner {
        affiliates[_affiliateIndex] = AffiliateDetails(_affiliate, _IsActive);
    }

    function addSponsoredMarket(uint256 _marketId) external onlyOwner {
        sponsoredMarkets.push(SponsoredMarket(_marketId, true));
    }

    function updateSponsoredMarket(uint256 _marketIndex, uint256 _marketId, bool _isActive) external onlyOwner {
        sponsoredMarkets[_marketIndex] = SponsoredMarket(_marketId, _isActive);
    }

    function setBaseFees(uint256 _baseFees) external onlyOwner {
        baseFees = _baseFees;
    }

    function setOpenForTrades(bool _openForTrades) external onlyOwner {
        openForTrades = _openForTrades;
    }

    function setOpenForFreeTrades(bool _openForFreeTrades) external onlyOwner {
        openForFreeTrades = _openForFreeTrades;
    }

    // @audit we will setup a system that will monitor the contract for any leftover
    // assets. In case any asset is leftover, the system should be able to trigger this
    // function to close all the trades until the leftover assets are rescued.
    function closeAllTrades() external {
        require(_msgSender() == guardian);
        openForTrades = false;
        openForFreeTrades = false;
    }

    function setConverter(address _converter) external onlyOwner {
        converter = _converter;
    }

    function setMarketRegistry(MarketRegistry _marketRegistry) external onlyOwner {
        marketRegistry = _marketRegistry;
    }

    function _transferEth(address _to, uint256 _amount) internal {
        bool callStatus;
        assembly {
            // Transfer the ETH and store if it succeeded or not.
            callStatus := call(gas(), _to, _amount, 0, 0, 0, 0)
        }
        require(callStatus, "_transferEth: Eth transfer failed");
    }

    function _collectFee(uint256[2] memory feeDetails) internal {
        require(feeDetails[1] >= baseFees, "Insufficient fee");
        if (feeDetails[1] > 0) {
            AffiliateDetails memory affiliateDetails = affiliates[feeDetails[0]];
            affiliateDetails.isActive
                ? _transferEth(affiliateDetails.affiliate, feeDetails[1])
                : _transferEth(GOV, feeDetails[1]);
        }
    }

    function _checkCallResult(bool _success) internal pure {
        if (!_success) {
            // Copy revert reason from call
            assembly {
                returndatacopy(0, 0, returndatasize())
                revert(0, returndatasize())
            }
        }
    }

    function _transferFromHelper(
        ERC20Details memory erc20Details,
        SpecialTransferHelper.ERC721Details[] memory erc721Details,
        ERC1155Details[] memory erc1155Details
    ) internal {
        // transfer ERC20 tokens from the sender to this contract
        for (uint256 i = 0; i < erc20Details.tokenAddrs.length; i++) {
            erc20Details.tokenAddrs[i].call(abi.encodeWithSelector(0x23b872dd, msg.sender, address(this), erc20Details.amounts[i]));
        }

        // transfer ERC721 tokens from the sender to this contract
        for (uint256 i = 0; i < erc721Details.length; i++) {
            // accept CryptoPunks
            if (erc721Details[i].tokenAddr == 0xb47e3cd837dDF8e4c57F05d70Ab865de6e193BBB) {
                _acceptCryptoPunk(erc721Details[i]);
            }
            // accept Mooncat
            else if (erc721Details[i].tokenAddr == 0x60cd862c9C687A9dE49aecdC3A99b74A4fc54aB6) {
                _acceptMoonCat(erc721Details[i]);
            }
            // default
            else {
                for (uint256 j = 0; j < erc721Details[i].ids.length; j++) {
                    IERC721(erc721Details[i].tokenAddr).transferFrom(
                        _msgSender(),
                        address(this),
                        erc721Details[i].ids[j]
                    );
                }
            }
        }

        // transfer ERC1155 tokens from the sender to this contract
        for (uint256 i = 0; i < erc1155Details.length; i++) {
            IERC1155(erc1155Details[i].tokenAddr).safeBatchTransferFrom(
                _msgSender(),
                address(this),
                erc1155Details[i].ids,
                erc1155Details[i].amounts,
                ""
            );
        }
    }

    function _conversionHelper(
        ConverstionDetails[] memory _converstionDetails
    ) internal {
        for (uint256 i = 0; i < _converstionDetails.length; i++) {
            // convert to desired asset
            (bool success, ) = converter.delegatecall(_converstionDetails[i].conversionData);
            // check if the call passed successfully
            _checkCallResult(success);
        }
    }

    function _trade(
        MarketRegistry.TradeDetails[] memory _tradeDetails
    ) internal {
        for (uint256 i = 0; i < _tradeDetails.length; i++) {
            // get market details
            (address _proxy, bool _isLib, bool _isActive) = marketRegistry.markets(_tradeDetails[i].marketId);
            // market should be active
            require(_isActive, "_trade: InActive Market");
            // execute trade
            if (_proxy == 0x7Be8076f4EA4A4AD08075C2508e481d6C946D12b || _proxy == 0x7f268357A8c2552623316e2562D90e642bB538E5) {
                _proxy.call{value:_tradeDetails[i].value}(_tradeDetails[i].tradeData);
            } else {
                (bool success, ) = _isLib
                    ? _proxy.delegatecall(_tradeDetails[i].tradeData)
                    : _proxy.call{value:_tradeDetails[i].value}(_tradeDetails[i].tradeData);
                // check if the call passed successfully
                _checkCallResult(success);
            }
        }
    }

    // function _tradeSponsored(
    //     MarketRegistry.TradeDetails[] memory _tradeDetails,
    //     uint256 sponsoredMarketId
    // ) internal returns (bool isSponsored) {
    //     for (uint256 i = 0; i < _tradeDetails.length; i++) {
    //         // check if the trade is for the sponsored market
    //         if (_tradeDetails[i].marketId == sponsoredMarketId) {
    //             isSponsored = true;
    //         }
    //         // get market details
    //         (address _proxy, bool _isLib, bool _isActive) = marketRegistry.markets(_tradeDetails[i].marketId);
    //         // market should be active
    //         require(_isActive, "_trade: InActive Market");
    //         // execute trade
    //         if (_proxy == 0x7Be8076f4EA4A4AD08075C2508e481d6C946D12b) {
    //             _proxy.call{value:_tradeDetails[i].value}(_tradeDetails[i].tradeData);
    //         } else {
    //             (bool success, ) = _isLib
    //                 ? _proxy.delegatecall(_tradeDetails[i].tradeData)
    //                 : _proxy.call{value:_tradeDetails[i].value}(_tradeDetails[i].tradeData);
    //             // check if the call passed successfully
    //             _checkCallResult(success);
    //         }
    //     }
    // }

    function _returnDust(address[] memory _tokens) internal {
        // return remaining ETH (if any)
        assembly {
            if gt(selfbalance(), 0) {
                let callStatus := call(
                    gas(),
                    caller(),
                    selfbalance(),
                    0,
                    0,
                    0,
                    0
                )
            }
        }
        // return remaining tokens (if any)
        for (uint256 i = 0; i < _tokens.length; i++) {
            if (IERC20(_tokens[i]).balanceOf(address(this)) > 0) {
                _tokens[i].call(abi.encodeWithSelector(0xa9059cbb, msg.sender, IERC20(_tokens[i]).balanceOf(address(this))));
            }
        }
    }

    function batchBuyFromOpenSea(
        OpenseaTrades[] memory openseaTrades
    ) payable external nonReentrant {
        // execute trades
        for (uint256 i = 0; i < openseaTrades.length; i++) {
            // execute trade
            address(0x7Be8076f4EA4A4AD08075C2508e481d6C946D12b).call{value:openseaTrades[i].value}(openseaTrades[i].tradeData);
        }

        // return remaining ETH (if any)
        assembly {
            if gt(selfbalance(), 0) {
                let callStatus := call(
                    gas(),
                    caller(),
                    selfbalance(),
                    0,
                    0,
                    0,
                    0
                )
            }
        }
    }
    
    function batchBuyWithETH(
        MarketRegistry.TradeDetails[] memory tradeDetails
    ) payable external nonReentrant {
        // execute trades
        _trade(tradeDetails);

        // return remaining ETH (if any)
        assembly {
            if gt(selfbalance(), 0) {
                let callStatus := call(
                    gas(),
                    caller(),
                    selfbalance(),
                    0,
                    0,
                    0,
                    0
                )
            }
        }
    }

    function batchBuyWithERC20s(
        ERC20Details memory erc20Details,
        MarketRegistry.TradeDetails[] memory tradeDetails,
        ConverstionDetails[] memory converstionDetails,
        address[] memory dustTokens
    ) payable external nonReentrant {
        // transfer ERC20 tokens from the sender to this contract
        for (uint256 i = 0; i < erc20Details.tokenAddrs.length; i++) {
            erc20Details.tokenAddrs[i].call(abi.encodeWithSelector(0x23b872dd, msg.sender, address(this), erc20Details.amounts[i]));
        }

        // Convert any assets if needed
        _conversionHelper(converstionDetails);

        // execute trades
        _trade(tradeDetails);

        // return dust tokens (if any)
        _returnDust(dustTokens);
    }

    // swaps any combination of ERC-20/721/1155
    // User needs to approve assets before invoking swap
    // WARNING: DO NOT SEND TOKENS TO THIS FUNCTION DIRECTLY!!!
    function multiAssetSwap(
        ERC20Details memory erc20Details,
        SpecialTransferHelper.ERC721Details[] memory erc721Details,
        ERC1155Details[] memory erc1155Details,
        ConverstionDetails[] memory converstionDetails,
        MarketRegistry.TradeDetails[] memory tradeDetails,
        address[] memory dustTokens,
        uint256[2] memory feeDetails    // [affiliateIndex, ETH fee in Wei]
    ) payable external isOpenForTrades nonReentrant {
        // collect fees
        _collectFee(feeDetails);

        // transfer all tokens
        _transferFromHelper(
            erc20Details,
            erc721Details,
            erc1155Details
        );

        // Convert any assets if needed
        _conversionHelper(converstionDetails);

        // execute trades
        _trade(tradeDetails);

        // return dust tokens (if any)
        _returnDust(dustTokens);
    }

    // Utility function that is used for free swaps for sponsored markets
    // WARNING: DO NOT SEND TOKENS TO THIS FUNCTION DIRECTLY!!! 
    // function multiAssetSwapWithoutFee(
    //     ERC20Details memory erc20Details,
    //     SpecialTransferHelper.ERC721Details[] memory erc721Details,
    //     ERC1155Details[] memory erc1155Details,
    //     ConverstionDetails[] memory converstionDetails,
    //     MarketRegistry.TradeDetails[] memory tradeDetails,
    //     address[] memory dustTokens,
    //     uint256 sponsoredMarketIndex
    // ) payable external isOpenForFreeTrades nonReentrant {
    //     // fetch the marketId of the sponsored market
    //     SponsoredMarket memory sponsoredMarket = sponsoredMarkets[sponsoredMarketIndex];
    //     // check if the market is active
    //     require(sponsoredMarket.isActive, "multiAssetSwapWithoutFee: InActive sponsored market");
// 
    //     // transfer all tokens
    //     _transferFromHelper(
    //         erc20Details,
    //         erc721Details,
    //         erc1155Details
    //     );
// 
    //     // Convert any assets if needed
    //     _conversionHelper(converstionDetails);
// 
    //     // execute trades
    //     bool isSponsored = _tradeSponsored(tradeDetails, sponsoredMarket.marketId);
// 
    //     // check if the trades include the sponsored market
    //     require(isSponsored, "multiAssetSwapWithoutFee: trades do not include sponsored market");
// 
    //     // return dust tokens (if any)
    //     _returnDust(dustTokens);
    // }

    function onERC1155Received(
        address,
        address,
        uint256,
        uint256,
        bytes calldata
    ) public virtual returns (bytes4) {
        return this.onERC1155Received.selector;
    }

    function onERC1155BatchReceived(
        address,
        address,
        uint256[] calldata,
        uint256[] calldata,
        bytes calldata
    ) public virtual returns (bytes4) {
        return this.onERC1155BatchReceived.selector;
    }

    function onERC721Received(
        address,
        address,
        uint256,
        bytes calldata
    ) external virtual returns (bytes4) {
        return 0x150b7a02;
    }

    // Used by ERC721BasicToken.sol
    function onERC721Received(
        address,
        uint256,
        bytes calldata
    ) external virtual returns (bytes4) {
        return 0xf0b9e5ba;
    }

    function supportsInterface(bytes4 interfaceId)
        external
        virtual
        view
        returns (bool)
    {
        return interfaceId == this.supportsInterface.selector;
    }

    receive() external payable {}

    // Emergency function: In case any ETH get stuck in the contract unintentionally
    // Only owner can retrieve the asset balance to a recipient address
    function rescueETH(address recipient) onlyOwner external {
        _transferEth(recipient, address(this).balance);
    }

    // Emergency function: In case any ERC20 tokens get stuck in the contract unintentionally
    // Only owner can retrieve the asset balance to a recipient address
    function rescueERC20(address asset, address recipient) onlyOwner external { 
        asset.call(abi.encodeWithSelector(0xa9059cbb, recipient, IERC20(asset).balanceOf(address(this))));
    }

    // Emergency function: In case any ERC721 tokens get stuck in the contract unintentionally
    // Only owner can retrieve the asset balance to a recipient address
    function rescueERC721(address asset, uint256[] calldata ids, address recipient) onlyOwner external {
        for (uint256 i = 0; i < ids.length; i++) {
            IERC721(asset).transferFrom(address(this), recipient, ids[i]);
        }
    }

    // Emergency function: In case any ERC1155 tokens get stuck in the contract unintentionally
    // Only owner can retrieve the asset balance to a recipient address
    function rescueERC1155(address asset, uint256[] calldata ids, uint256[] calldata amounts, address recipient) onlyOwner external {
        for (uint256 i = 0; i < ids.length; i++) {
            IERC1155(asset).safeTransferFrom(address(this), recipient, ids[i], amounts[i], "");
        }
    }
}

File 2 of 12 : Ownable.sol
// SPDX-License-Identifier: MIT

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() {
        _setOwner(_msgSender());
    }

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

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

    /**
     * @dev Leaves the contract without owner. It will not be possible to call
     * `onlyOwner` functions anymore. Can only be called by the current owner.
     *
     * NOTE: Renouncing ownership will leave the contract without an owner,
     * thereby removing any functionality that is only available to the owner.
     */
    function renounceOwnership() public virtual onlyOwner {
        _setOwner(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");
        _setOwner(newOwner);
    }

    function _setOwner(address newOwner) private {
        address oldOwner = _owner;
        _owner = newOwner;
        emit OwnershipTransferred(oldOwner, newOwner);
    }
}

File 3 of 12 : ReentrancyGuard.sol
// SPDX-License-Identifier: MIT

pragma solidity 0.8.11;

/// @notice Gas optimized reentrancy protection for smart contracts.
/// @author Modified from OpenZeppelin (https://github.com/OpenZeppelin/openzeppelin-contracts/blob/master/contracts/security/ReentrancyGuard.sol)
abstract contract ReentrancyGuard {
    uint256 private reentrancyStatus = 1;

    modifier nonReentrant() {
        require(reentrancyStatus == 1, "REENTRANCY");

        reentrancyStatus = 2;

        _;

        reentrancyStatus = 1;
    }
}

File 4 of 12 : MarketRegistry.sol
// SPDX-License-Identifier: MIT

pragma solidity 0.8.11;


import "@openzeppelin/contracts/access/Ownable.sol";

contract MarketRegistry is Ownable {

    struct TradeDetails {
        uint256 marketId;
        uint256 value;
        bytes tradeData;
    }

    struct Market {
        address proxy;
        bool isLib;
        bool isActive;
    }

    Market[] public markets;

    constructor(address[] memory proxies, bool[] memory isLibs) {
        for (uint256 i = 0; i < proxies.length; i++) {
            markets.push(Market(proxies[i], isLibs[i], true));
        }
    }

    function addMarket(address proxy, bool isLib) external onlyOwner {
        markets.push(Market(proxy, isLib, true));
    }

    function setMarketStatus(uint256 marketId, bool newStatus) external onlyOwner {
        Market storage market = markets[marketId];
        market.isActive = newStatus;
    }

    function setMarketProxy(uint256 marketId, address newProxy, bool isLib) external onlyOwner {
        Market storage market = markets[marketId];
        market.proxy = newProxy;
        market.isLib = isLib;
    }
}

File 5 of 12 : SpecialTransferHelper.sol
// SPDX-License-Identifier: MIT

pragma solidity 0.8.11;

import "@openzeppelin/contracts/utils/Context.sol";
import "../../interfaces/punks/ICryptoPunks.sol";
import "../../interfaces/punks/IWrappedPunk.sol";
import "../../interfaces/mooncats/IMoonCatsRescue.sol";

contract SpecialTransferHelper is Context {

    struct ERC721Details {
        address tokenAddr;
        address[] to;
        uint256[] ids;
    }

    function _uintToBytes5(uint256 id)
        internal
        pure
        returns (bytes5 slicedDataBytes5)
    {
        bytes memory _bytes = new bytes(32);
        assembly {
            mstore(add(_bytes, 32), id)
        }

        bytes memory tempBytes;

        assembly {
            // Get a location of some free memory and store it in tempBytes as
            // Solidity does for memory variables.
            tempBytes := mload(0x40)

            // The first word of the slice result is potentially a partial
            // word read from the original array. To read it, we calculate
            // the length of that partial word and start copying that many
            // bytes into the array. The first word we copy will start with
            // data we don't care about, but the last `lengthmod` bytes will
            // land at the beginning of the contents of the new array. When
            // we're done copying, we overwrite the full first word with
            // the actual length of the slice.
            let lengthmod := and(5, 31)

            // The multiplication in the next line is necessary
            // because when slicing multiples of 32 bytes (lengthmod == 0)
            // the following copy loop was copying the origin's length
            // and then ending prematurely not copying everything it should.
            let mc := add(add(tempBytes, lengthmod), mul(0x20, iszero(lengthmod)))
            let end := add(mc, 5)

            for {
                // The multiplication in the next line has the same exact purpose
                // as the one above.
                let cc := add(add(add(_bytes, lengthmod), mul(0x20, iszero(lengthmod))), 27)
            } lt(mc, end) {
                mc := add(mc, 0x20)
                cc := add(cc, 0x20)
            } {
                mstore(mc, mload(cc))
            }

            mstore(tempBytes, 5)

            //update free-memory pointer
            //allocating the array padded to 32 bytes like the compiler does now
            mstore(0x40, and(add(mc, 31), not(31)))
        }

        assembly {
            slicedDataBytes5 := mload(add(tempBytes, 32))
        }
    }


    function _acceptMoonCat(ERC721Details memory erc721Details) internal {
        for (uint256 i = 0; i < erc721Details.ids.length; i++) {
            bytes5 catId = _uintToBytes5(erc721Details.ids[i]);
            address owner = IMoonCatsRescue(erc721Details.tokenAddr).catOwners(catId);
            require(owner == _msgSender(), "_acceptMoonCat: invalid mooncat owner");
            IMoonCatsRescue(erc721Details.tokenAddr).acceptAdoptionOffer(catId);
        }
    }

    function _transferMoonCat(ERC721Details memory erc721Details) internal {
        for (uint256 i = 0; i < erc721Details.ids.length; i++) {
            IMoonCatsRescue(erc721Details.tokenAddr).giveCat(_uintToBytes5(erc721Details.ids[i]), erc721Details.to[i]);
        }
    }

    function _acceptCryptoPunk(ERC721Details memory erc721Details) internal {
        for (uint256 i = 0; i < erc721Details.ids.length; i++) {    
            address owner = ICryptoPunks(erc721Details.tokenAddr).punkIndexToAddress(erc721Details.ids[i]);
            require(owner == _msgSender(), "_acceptCryptoPunk: invalid punk owner");
            ICryptoPunks(erc721Details.tokenAddr).buyPunk(erc721Details.ids[i]);
        }
    }

    function _transferCryptoPunk(ERC721Details memory erc721Details) internal {
        for (uint256 i = 0; i < erc721Details.ids.length; i++) {
            ICryptoPunks(erc721Details.tokenAddr).transferPunk(erc721Details.to[i], erc721Details.ids[i]);
        }
    }
}

File 6 of 12 : IERC20.sol
// SPDX-License-Identifier: MIT

pragma solidity 0.8.11;

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

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

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

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

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

File 7 of 12 : IERC721.sol
// SPDX-License-Identifier: MIT

pragma solidity 0.8.11;

interface IERC721 {
    /// @notice Transfer ownership of an NFT -- THE CALLER IS RESPONSIBLE
    ///  TO CONFIRM THAT `_to` IS CAPABLE OF RECEIVING NFTS OR ELSE
    ///  THEY MAY BE PERMANENTLY LOST
    /// @dev Throws unless `msg.sender` is the current owner, an authorized
    ///  operator, or the approved address for this NFT. Throws if `_from` is
    ///  not the current owner. Throws if `_to` is the zero address. Throws if
    ///  `_tokenId` is not a valid NFT.
    /// @param _from The current owner of the NFT
    /// @param _to The new owner
    /// @param _tokenId The NFT to transfer
    function transferFrom(address _from, address _to, uint256 _tokenId) external payable;

    function safeTransferFrom(address from, address to, uint256 tokenId, bytes memory _data) external;
    
    function setApprovalForAll(address operator, bool approved) external;

    function approve(address to, uint256 tokenId) external;
    
    function isApprovedForAll(address owner, address operator) external view returns (bool);

    function balanceOf(address _owner) external view returns (uint256);
}

File 8 of 12 : IERC1155.sol
// SPDX-License-Identifier: MIT

pragma solidity 0.8.11;
interface IERC1155 {
    function safeTransferFrom(
        address from,
        address to,
        uint256 id,
        uint256 amount,
        bytes memory data
    ) external;

    function safeBatchTransferFrom(
        address from,
        address to,
        uint256[] memory ids,
        uint256[] memory amounts,
        bytes memory data
    ) external;

    function balanceOf(address _owner, uint256 _id) external view returns (uint256);
}

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

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 12 : ICryptoPunks.sol
// SPDX-License-Identifier: MIT

pragma solidity 0.8.11;

interface ICryptoPunks {
    function punkIndexToAddress(uint index) external view returns(address owner);
    function offerPunkForSaleToAddress(uint punkIndex, uint minSalePriceInWei, address toAddress) external;
    function buyPunk(uint punkIndex) external payable;
    function transferPunk(address to, uint punkIndex) external;
}

File 11 of 12 : IWrappedPunk.sol
// SPDX-License-Identifier: MIT

pragma solidity 0.8.11;

interface IWrappedPunk {
    /**
     * @dev Mints a wrapped punk
     */
    function mint(uint256 punkIndex) external;

    /**
     * @dev Burns a specific wrapped punk
     */
    function burn(uint256 punkIndex) external;
    
    /**
     * @dev Registers proxy
     */
    function registerProxy() external;

    /**
     * @dev Gets proxy address
     */
    function proxyInfo(address user) external view returns (address);
}

File 12 of 12 : IMoonCatsRescue.sol
// SPDX-License-Identifier: MIT

pragma solidity 0.8.11;

interface IMoonCatsRescue {
    function acceptAdoptionOffer(bytes5 catId) payable external;
    function makeAdoptionOfferToAddress(bytes5 catId, uint price, address to) external;
    function giveCat(bytes5 catId, address to) external;
    function catOwners(bytes5 catId) external view returns(address);
    function rescueOrder(uint256 rescueIndex) external view returns(bytes5 catId);
}

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

Contract Security Audit

Contract ABI

[{"inputs":[{"internalType":"address","name":"_marketRegistry","type":"address"},{"internalType":"address","name":"_converter","type":"address"},{"internalType":"address","name":"_guardian","type":"address"}],"stateMutability":"nonpayable","type":"constructor"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"previousOwner","type":"address"},{"indexed":true,"internalType":"address","name":"newOwner","type":"address"}],"name":"OwnershipTransferred","type":"event"},{"inputs":[],"name":"GOV","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_affiliate","type":"address"}],"name":"addAffiliate","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_marketId","type":"uint256"}],"name":"addSponsoredMarket","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"","type":"uint256"}],"name":"affiliates","outputs":[{"internalType":"address","name":"affiliate","type":"address"},{"internalType":"bool","name":"isActive","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"baseFees","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"components":[{"internalType":"uint256","name":"value","type":"uint256"},{"internalType":"bytes","name":"tradeData","type":"bytes"}],"internalType":"struct GemSwap.OpenseaTrades[]","name":"openseaTrades","type":"tuple[]"}],"name":"batchBuyFromOpenSea","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[{"components":[{"internalType":"address[]","name":"tokenAddrs","type":"address[]"},{"internalType":"uint256[]","name":"amounts","type":"uint256[]"}],"internalType":"struct GemSwap.ERC20Details","name":"erc20Details","type":"tuple"},{"components":[{"internalType":"uint256","name":"marketId","type":"uint256"},{"internalType":"uint256","name":"value","type":"uint256"},{"internalType":"bytes","name":"tradeData","type":"bytes"}],"internalType":"struct MarketRegistry.TradeDetails[]","name":"tradeDetails","type":"tuple[]"},{"components":[{"internalType":"bytes","name":"conversionData","type":"bytes"}],"internalType":"struct GemSwap.ConverstionDetails[]","name":"converstionDetails","type":"tuple[]"},{"internalType":"address[]","name":"dustTokens","type":"address[]"}],"name":"batchBuyWithERC20s","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[{"components":[{"internalType":"uint256","name":"marketId","type":"uint256"},{"internalType":"uint256","name":"value","type":"uint256"},{"internalType":"bytes","name":"tradeData","type":"bytes"}],"internalType":"struct MarketRegistry.TradeDetails[]","name":"tradeDetails","type":"tuple[]"}],"name":"batchBuyWithETH","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[],"name":"closeAllTrades","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"converter","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"guardian","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"marketRegistry","outputs":[{"internalType":"contract MarketRegistry","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"components":[{"internalType":"address[]","name":"tokenAddrs","type":"address[]"},{"internalType":"uint256[]","name":"amounts","type":"uint256[]"}],"internalType":"struct GemSwap.ERC20Details","name":"erc20Details","type":"tuple"},{"components":[{"internalType":"address","name":"tokenAddr","type":"address"},{"internalType":"address[]","name":"to","type":"address[]"},{"internalType":"uint256[]","name":"ids","type":"uint256[]"}],"internalType":"struct SpecialTransferHelper.ERC721Details[]","name":"erc721Details","type":"tuple[]"},{"components":[{"internalType":"address","name":"tokenAddr","type":"address"},{"internalType":"uint256[]","name":"ids","type":"uint256[]"},{"internalType":"uint256[]","name":"amounts","type":"uint256[]"}],"internalType":"struct GemSwap.ERC1155Details[]","name":"erc1155Details","type":"tuple[]"},{"components":[{"internalType":"bytes","name":"conversionData","type":"bytes"}],"internalType":"struct GemSwap.ConverstionDetails[]","name":"converstionDetails","type":"tuple[]"},{"components":[{"internalType":"uint256","name":"marketId","type":"uint256"},{"internalType":"uint256","name":"value","type":"uint256"},{"internalType":"bytes","name":"tradeData","type":"bytes"}],"internalType":"struct MarketRegistry.TradeDetails[]","name":"tradeDetails","type":"tuple[]"},{"internalType":"address[]","name":"dustTokens","type":"address[]"},{"internalType":"uint256[2]","name":"feeDetails","type":"uint256[2]"}],"name":"multiAssetSwap","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"},{"internalType":"address","name":"","type":"address"},{"internalType":"uint256[]","name":"","type":"uint256[]"},{"internalType":"uint256[]","name":"","type":"uint256[]"},{"internalType":"bytes","name":"","type":"bytes"}],"name":"onERC1155BatchReceived","outputs":[{"internalType":"bytes4","name":"","type":"bytes4"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"},{"internalType":"address","name":"","type":"address"},{"internalType":"uint256","name":"","type":"uint256"},{"internalType":"uint256","name":"","type":"uint256"},{"internalType":"bytes","name":"","type":"bytes"}],"name":"onERC1155Received","outputs":[{"internalType":"bytes4","name":"","type":"bytes4"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"},{"internalType":"address","name":"","type":"address"},{"internalType":"uint256","name":"","type":"uint256"},{"internalType":"bytes","name":"","type":"bytes"}],"name":"onERC721Received","outputs":[{"internalType":"bytes4","name":"","type":"bytes4"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"},{"internalType":"uint256","name":"","type":"uint256"},{"internalType":"bytes","name":"","type":"bytes"}],"name":"onERC721Received","outputs":[{"internalType":"bytes4","name":"","type":"bytes4"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"openForFreeTrades","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"openForTrades","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"owner","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"punkProxy","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"renounceOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"asset","type":"address"},{"internalType":"uint256[]","name":"ids","type":"uint256[]"},{"internalType":"uint256[]","name":"amounts","type":"uint256[]"},{"internalType":"address","name":"recipient","type":"address"}],"name":"rescueERC1155","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"asset","type":"address"},{"internalType":"address","name":"recipient","type":"address"}],"name":"rescueERC20","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"asset","type":"address"},{"internalType":"uint256[]","name":"ids","type":"uint256[]"},{"internalType":"address","name":"recipient","type":"address"}],"name":"rescueERC721","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"recipient","type":"address"}],"name":"rescueETH","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_baseFees","type":"uint256"}],"name":"setBaseFees","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_converter","type":"address"}],"name":"setConverter","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"contract MarketRegistry","name":"_marketRegistry","type":"address"}],"name":"setMarketRegistry","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"contract IERC20","name":"token","type":"address"},{"internalType":"address","name":"operator","type":"address"},{"internalType":"uint256","name":"amount","type":"uint256"}],"name":"setOneTimeApproval","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bool","name":"_openForFreeTrades","type":"bool"}],"name":"setOpenForFreeTrades","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bool","name":"_openForTrades","type":"bool"}],"name":"setOpenForTrades","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"setUp","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"","type":"uint256"}],"name":"sponsoredMarkets","outputs":[{"internalType":"uint256","name":"marketId","type":"uint256"},{"internalType":"bool","name":"isActive","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes4","name":"interfaceId","type":"bytes4"}],"name":"supportsInterface","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"newOwner","type":"address"}],"name":"transferOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_affiliateIndex","type":"uint256"},{"internalType":"address","name":"_affiliate","type":"address"},{"internalType":"bool","name":"_IsActive","type":"bool"}],"name":"updateAffiliate","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_guardian","type":"address"}],"name":"updateGuardian","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"_marketIndex","type":"uint256"},{"internalType":"uint256","name":"_marketId","type":"uint256"},{"internalType":"bool","name":"_isActive","type":"bool"}],"name":"updateSponsoredMarket","outputs":[],"stateMutability":"nonpayable","type":"function"},{"stateMutability":"payable","type":"receive"}]

6080604052600180553480156200001557600080fd5b506040516200459a3803806200459a8339810160408190526200003891620001a4565b620000433362000137565b60068054600380546001600160a01b039586166001600160a01b0319918216179091556002805494861694909116939093179092556000600581905561ff001960ff1995851662010000029590951661ff01600160b01b031990931692909217600190811794909416610100179055604080518082019091527383d841bc0450d5ac35dcad8d05db53eba29978c2815260208101848152600780549586018155909252517fa66cc928b5edb82af9bd49922954155ab7b0942694bea4ce44661d9a8736c688909301805491511515600160a01b026001600160a81b03199092169390921692909217919091179055620001ee565b600080546001600160a01b038381166001600160a01b0319831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b80516001600160a01b03811681146200019f57600080fd5b919050565b600080600060608486031215620001ba57600080fd5b620001c58462000187565b9250620001d56020850162000187565b9150620001e56040850162000187565b90509250925092565b61439c80620001fe6000396000f3fe6080604052600436106102a45760003560e01c80638da5cb5b1161016e578063ccf3dc82116100cb578063ecb96fe61161007f578063f23a6e6111610064578063f23a6e6114610886578063f2fde38b146108cc578063fc525395146108ec57600080fd5b8063ecb96fe61461080f578063f0b9e5ba1461084257600080fd5b8063ddb382f9116100b0578063ddb382f914610796578063e4dd4b8a146107ba578063e6041f9a146107ef57600080fd5b8063ccf3dc8214610756578063d85797041461077657600080fd5b8063b7ce33a211610122578063bc197c8111610107578063bc197c81146106cc578063bd38837b14610714578063c5cadd7f1461074157600080fd5b8063b7ce33a21461068c578063b9277963146106ac57600080fd5b80639f2ba09b116101535780639f2ba09b14610632578063a1b6279714610652578063b19337a41461066c57600080fd5b80638da5cb5b146105f45780639a2b81151461061f57600080fd5b806326e2dca21161021c5780635eacc63a116101d0578063715018a6116101b5578063715018a61461059f57806381ea4ea6146105b457806383206e80146105d457600080fd5b80635eacc63a1461055f5780636335f25e1461057257600080fd5b8063452a932011610201578063452a9320146104f2578063565528d71461051f5780635d799f871461053f57600080fd5b806326e2dca2146104b25780633a5750b6146104d257600080fd5b806311f8541711610273578063180cb47f11610258578063180cb47f14610406578063186b100c146104535780631bd787481461046657600080fd5b806311f8541714610371578063150b7a021461039057600080fd5b806301ffc9a7146102b057806304824e701461032757806309ba153d146103495780630a9254e41461035c57600080fd5b366102ab57005b600080fd5b3480156102bc57600080fd5b506103126102cb3660046131e9565b7fffffffff00000000000000000000000000000000000000000000000000000000167f01ffc9a7000000000000000000000000000000000000000000000000000000001490565b60405190151581526020015b60405180910390f35b34801561033357600080fd5b50610347610342366004613254565b61090c565b005b61034761035736600461370f565b610985565b34801561036857600080fd5b50610347610b40565b34801561037d57600080fd5b5060065461031290610100900460ff1681565b34801561039c57600080fd5b506103d56103ab366004613805565b7f150b7a020000000000000000000000000000000000000000000000000000000095945050505050565b6040517fffffffff00000000000000000000000000000000000000000000000000000000909116815260200161031e565b34801561041257600080fd5b5061042e7383d841bc0450d5ac35dcad8d05db53eba29978c281565b60405173ffffffffffffffffffffffffffffffffffffffff909116815260200161031e565b610347610461366004613b0a565b610d88565b34801561047257600080fd5b50610486610481366004613c13565b610e6d565b6040805173ffffffffffffffffffffffffffffffffffffffff909316835290151560208301520161031e565b3480156104be57600080fd5b506103476104cd366004613c71565b610ec0565b3480156104de57600080fd5b506103476104ed366004613c13565b611010565b3480156104fe57600080fd5b5060025461042e9073ffffffffffffffffffffffffffffffffffffffff1681565b34801561052b57600080fd5b5061034761053a366004613ce7565b61111a565b34801561054b57600080fd5b5061034761055a366004613d29565b611238565b61034761056d366004613d62565b6113ea565b34801561057e57600080fd5b5060045461042e9073ffffffffffffffffffffffffffffffffffffffff1681565b3480156105ab57600080fd5b50610347611533565b3480156105c057600080fd5b506103476105cf366004613254565b6115a6565b3480156105e057600080fd5b506103476105ef366004613e6f565b6116b7565b34801561060057600080fd5b5060005473ffffffffffffffffffffffffffffffffffffffff1661042e565b61034761062d366004613e8c565b61174f565b34801561063e57600080fd5b5061034761064d366004613ec9565b6117c7565b34801561065e57600080fd5b506006546103129060ff1681565b34801561067857600080fd5b50610347610687366004613254565b6118c7565b34801561069857600080fd5b506103476106a7366004613f0a565b611975565b3480156106b857600080fd5b506103476106c7366004613c13565b611af6565b3480156106d857600080fd5b506103d56106e7366004613f9f565b7fbc197c810000000000000000000000000000000000000000000000000000000098975050505050505050565b34801561072057600080fd5b5060035461042e9073ffffffffffffffffffffffffffffffffffffffff1681565b34801561074d57600080fd5b50610347611b62565b34801561076257600080fd5b5061034761077136600461405e565b611bc6565b34801561078257600080fd5b50610347610791366004613254565b611ca8565b3480156107a257600080fd5b506107ac60055481565b60405190815260200161031e565b3480156107c657600080fd5b506107da6107d5366004613c13565b611d5c565b6040805192835290151560208301520161031e565b3480156107fb57600080fd5b5061034761080a366004613e6f565b611d8d565b34801561081b57600080fd5b5060065461042e9062010000900473ffffffffffffffffffffffffffffffffffffffff1681565b34801561084e57600080fd5b506103d561085d36600461408c565b7ff0b9e5ba00000000000000000000000000000000000000000000000000000000949350505050565b34801561089257600080fd5b506103d56108a13660046140e8565b7ff23a6e61000000000000000000000000000000000000000000000000000000009695505050505050565b3480156108d857600080fd5b506103476108e7366004613254565b611e2b565b3480156108f857600080fd5b50610347610907366004613254565b611f24565b60005473ffffffffffffffffffffffffffffffffffffffff1633146109785760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e657260448201526064015b60405180910390fd5b6109828147611fd2565b50565b6001546001146109d75760405162461bcd60e51b815260206004820152600a60248201527f5245454e5452414e435900000000000000000000000000000000000000000000604482015260640161096f565b600260015560005b845151811015610b1a5784518051829081106109fd576109fd614164565b602002602001015173ffffffffffffffffffffffffffffffffffffffff166323b872dd333088602001518581518110610a3857610a38614164565b602090810291909101015160405173ffffffffffffffffffffffffffffffffffffffff938416602482015292909116604483015260648201526084016040516020818303038152906040529060e01b6020820180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff8381831617835250505050604051610ac29190614193565b6000604051808303816000865af19150503d8060008114610aff576040519150601f19603f3d011682016040523d82523d6000602084013e610b04565b606091505b5050508080610b12906141ce565b9150506109df565b50610b2482612058565b610b2d83612112565b610b3681612498565b5050600180555050565b60005473ffffffffffffffffffffffffffffffffffffffff163314610ba75760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604482015260640161096f565b73b7f7f6c52f2e2fdb1963eab30438024864c313f673ffffffffffffffffffffffffffffffffffffffff1663ddd81f826040518163ffffffff1660e01b8152600401600060405180830381600087803b158015610c0357600080fd5b505af1158015610c17573d6000803e3d6000fd5b50506040517fa9c7b2c800000000000000000000000000000000000000000000000000000000815230600482015273b7f7f6c52f2e2fdb1963eab30438024864c313f6925063a9c7b2c89150602401602060405180830381865afa158015610c83573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610ca7919061422e565b600480547fffffffffffffffffffffffff00000000000000000000000000000000000000001673ffffffffffffffffffffffffffffffffffffffff929092169190911781556040517fa22cb46500000000000000000000000000000000000000000000000000000000815273c3f733ca98e0dad0386979eb96fb1722a1a05e699181019190915260016024820152737c40c393dc0f283f318791d746d894ddd36935729063a22cb46590604401600060405180830381600087803b158015610d6e57600080fd5b505af1158015610d82573d6000803e3d6000fd5b50505050565b60065460ff16610dda5760405162461bcd60e51b815260206004820152601260248201527f747261646573206e6f7420616c6c6f7765640000000000000000000000000000604482015260640161096f565b600154600114610e2c5760405162461bcd60e51b815260206004820152600a60248201527f5245454e5452414e435900000000000000000000000000000000000000000000604482015260640161096f565b6002600155610e3a8161271a565b610e45878787612820565b610e4e84612058565b610e5783612112565b610e6082612498565b5050600180555050505050565b60078181548110610e7d57600080fd5b60009182526020909120015473ffffffffffffffffffffffffffffffffffffffff8116915074010000000000000000000000000000000000000000900460ff1682565b60005473ffffffffffffffffffffffffffffffffffffffff163314610f275760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604482015260640161096f565b60005b82811015611009578473ffffffffffffffffffffffffffffffffffffffff166323b872dd3084878786818110610f6257610f62614164565b6040517fffffffff0000000000000000000000000000000000000000000000000000000060e088901b16815273ffffffffffffffffffffffffffffffffffffffff958616600482015294909316602485015250602090910201356044820152606401600060405180830381600087803b158015610fde57600080fd5b505af1158015610ff2573d6000803e3d6000fd5b505050508080611001906141ce565b915050610f2a565b5050505050565b60005473ffffffffffffffffffffffffffffffffffffffff1633146110775760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604482015260640161096f565b6040805180820190915290815260016020820181815260088054928301815560005291517ff3f7a9fe364faab93b216da50a3214154f22a0a2b415b23a84c8169e8b636ee360029092029182015590517ff3f7a9fe364faab93b216da50a3214154f22a0a2b415b23a84c8169e8b636ee490910180547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0016911515919091179055565b60005473ffffffffffffffffffffffffffffffffffffffff1633146111815760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604482015260640161096f565b60405180604001604052808373ffffffffffffffffffffffffffffffffffffffff168152602001821515815250600784815481106111c1576111c1614164565b60009182526020918290208351910180549390920151151574010000000000000000000000000000000000000000027fffffffffffffffffffffff00000000000000000000000000000000000000000090931673ffffffffffffffffffffffffffffffffffffffff90911617919091179055505050565b60005473ffffffffffffffffffffffffffffffffffffffff16331461129f5760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604482015260640161096f565b6040517f70a0823100000000000000000000000000000000000000000000000000000000815230600482015273ffffffffffffffffffffffffffffffffffffffff83169063a9059cbb90839083906370a0823190602401602060405180830381865afa158015611313573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611337919061424b565b60405173ffffffffffffffffffffffffffffffffffffffff909216602483015260448201526064016040516020818303038152906040529060e01b6020820180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff83818316178352505050506040516113ad9190614193565b6000604051808303816000865af19150503d8060008114611009576040519150601f19603f3d011682016040523d82523d6000602084013e611009565b60015460011461143c5760405162461bcd60e51b815260206004820152600a60248201527f5245454e5452414e435900000000000000000000000000000000000000000000604482015260640161096f565b600260015560005b815181101561151957737be8076f4ea4a4ad08075c2508e481d6c946d12b73ffffffffffffffffffffffffffffffffffffffff1682828151811061148a5761148a614164565b6020026020010151600001518383815181106114a8576114a8614164565b6020026020010151602001516040516114c19190614193565b60006040518083038185875af1925050503d80600081146114fe576040519150601f19603f3d011682016040523d82523d6000602084013e611503565b606091505b5050508080611511906141ce565b915050611444565b50471561152c5760008060008047335af1505b5060018055565b60005473ffffffffffffffffffffffffffffffffffffffff16331461159a5760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604482015260640161096f565b6115a46000612cc3565b565b60005473ffffffffffffffffffffffffffffffffffffffff16331461160d5760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604482015260640161096f565b6040805180820190915273ffffffffffffffffffffffffffffffffffffffff918216815260016020820181815260078054928301815560005291517fa66cc928b5edb82af9bd49922954155ab7b0942694bea4ce44661d9a8736c68890910180549251151574010000000000000000000000000000000000000000027fffffffffffffffffffffff0000000000000000000000000000000000000000009093169190931617179055565b60005473ffffffffffffffffffffffffffffffffffffffff16331461171e5760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604482015260640161096f565b600680547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0016911515919091179055565b6001546001146117a15760405162461bcd60e51b815260206004820152600a60248201527f5245454e5452414e435900000000000000000000000000000000000000000000604482015260640161096f565b60026001556117af81612112565b471561152c5760008060008047335af1505060018055565b60005473ffffffffffffffffffffffffffffffffffffffff16331461182e5760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604482015260640161096f565b6040517f095ea7b300000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff83811660048301526024820183905284169063095ea7b3906044016020604051808303816000875af11580156118a3573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190610d829190614264565b60005473ffffffffffffffffffffffffffffffffffffffff16331461192e5760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604482015260640161096f565b600380547fffffffffffffffffffffffff00000000000000000000000000000000000000001673ffffffffffffffffffffffffffffffffffffffff92909216919091179055565b60005473ffffffffffffffffffffffffffffffffffffffff1633146119dc5760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604482015260640161096f565b60005b84811015611aed578673ffffffffffffffffffffffffffffffffffffffff1663f242432a3084898986818110611a1757611a17614164565b90506020020135888887818110611a3057611a30614164565b6040517fffffffff0000000000000000000000000000000000000000000000000000000060e089901b16815273ffffffffffffffffffffffffffffffffffffffff968716600482015295909416602486015250604484019190915260209091020135606482015260a06084820152600060a482015260c401600060405180830381600087803b158015611ac257600080fd5b505af1158015611ad6573d6000803e3d6000fd5b505050508080611ae5906141ce565b9150506119df565b50505050505050565b60005473ffffffffffffffffffffffffffffffffffffffff163314611b5d5760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604482015260640161096f565b600555565b60025473ffffffffffffffffffffffffffffffffffffffff163373ffffffffffffffffffffffffffffffffffffffff1614611b9c57600080fd5b600680547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0000169055565b60005473ffffffffffffffffffffffffffffffffffffffff163314611c2d5760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604482015260640161096f565b604051806040016040528083815260200182151581525060088481548110611c5757611c57614164565b6000918252602091829020835160029290920201908155910151600190910180547fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff0016911515919091179055505050565b60005473ffffffffffffffffffffffffffffffffffffffff163314611d0f5760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604482015260640161096f565b6006805473ffffffffffffffffffffffffffffffffffffffff90921662010000027fffffffffffffffffffff0000000000000000000000000000000000000000ffff909216919091179055565b60088181548110611d6c57600080fd5b60009182526020909120600290910201805460019091015490915060ff1682565b60005473ffffffffffffffffffffffffffffffffffffffff163314611df45760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604482015260640161096f565b60068054911515610100027fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff00ff909216919091179055565b60005473ffffffffffffffffffffffffffffffffffffffff163314611e925760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604482015260640161096f565b73ffffffffffffffffffffffffffffffffffffffff8116611f1b5760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201527f6464726573730000000000000000000000000000000000000000000000000000606482015260840161096f565b61098281612cc3565b60005473ffffffffffffffffffffffffffffffffffffffff163314611f8b5760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604482015260640161096f565b600280547fffffffffffffffffffffffff00000000000000000000000000000000000000001673ffffffffffffffffffffffffffffffffffffffff92909216919091179055565b600080600080600085875af19050806120535760405162461bcd60e51b815260206004820152602160248201527f5f7472616e736665724574683a20457468207472616e73666572206661696c6560448201527f6400000000000000000000000000000000000000000000000000000000000000606482015260840161096f565b505050565b60005b815181101561210e57600354825160009173ffffffffffffffffffffffffffffffffffffffff169084908490811061209557612095614164565b6020026020010151600001516040516120ae9190614193565b600060405180830381855af49150503d80600081146120e9576040519150601f19603f3d011682016040523d82523d6000602084013e6120ee565b606091505b505090506120fb81612d38565b5080612106816141ce565b91505061205b565b5050565b60005b815181101561210e576000806000600660029054906101000a900473ffffffffffffffffffffffffffffffffffffffff1673ffffffffffffffffffffffffffffffffffffffff1663b1283e7786868151811061217357612173614164565b6020026020010151600001516040518263ffffffff1660e01b815260040161219d91815260200190565b606060405180830381865afa1580156121ba573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906121de9190614281565b925092509250806122315760405162461bcd60e51b815260206004820152601760248201527f5f74726164653a20496e416374697665204d61726b6574000000000000000000604482015260640161096f565b737be8076f4ea4a4ad08075c2508e481d6c946d12b73ffffffffffffffffffffffffffffffffffffffff841614806122925750737f268357a8c2552623316e2562d90e642bb538e573ffffffffffffffffffffffffffffffffffffffff8416145b15612341578273ffffffffffffffffffffffffffffffffffffffff168585815181106122c0576122c0614164565b6020026020010151602001518686815181106122de576122de614164565b6020026020010151604001516040516122f79190614193565b60006040518083038185875af1925050503d8060008114612334576040519150601f19603f3d011682016040523d82523d6000602084013e612339565b606091505b505050612482565b6000826123f0578373ffffffffffffffffffffffffffffffffffffffff1686868151811061237157612371614164565b60200260200101516020015187878151811061238f5761238f614164565b6020026020010151604001516040516123a89190614193565b60006040518083038185875af1925050503d80600081146123e5576040519150601f19603f3d011682016040523d82523d6000602084013e6123ea565b606091505b50612474565b8373ffffffffffffffffffffffffffffffffffffffff1686868151811061241957612419614164565b6020026020010151604001516040516124329190614193565b600060405180830381855af49150503d806000811461246d576040519150601f19603f3d011682016040523d82523d6000602084013e612472565b606091505b505b50905061248081612d38565b505b5050508080612490906141ce565b915050612115565b47156124aa5760008060008047335af1505b60005b815181101561210e5760008282815181106124ca576124ca614164565b60209081029190910101516040517f70a0823100000000000000000000000000000000000000000000000000000000815230600482015273ffffffffffffffffffffffffffffffffffffffff909116906370a0823190602401602060405180830381865afa158015612540573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190612564919061424b565b11156127085781818151811061257c5761257c614164565b602002602001015173ffffffffffffffffffffffffffffffffffffffff1663a9059cbb338484815181106125b2576125b2614164565b60209081029190910101516040517f70a0823100000000000000000000000000000000000000000000000000000000815230600482015273ffffffffffffffffffffffffffffffffffffffff909116906370a0823190602401602060405180830381865afa158015612628573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061264c919061424b565b60405173ffffffffffffffffffffffffffffffffffffffff909216602483015260448201526064016040516020818303038152906040529060e01b6020820180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff83818316178352505050506040516126c29190614193565b6000604051808303816000865af19150503d80600081146126ff576040519150601f19603f3d011682016040523d82523d6000602084013e612704565b606091505b5050505b80612712816141ce565b9150506124ad565b600554602082015110156127705760405162461bcd60e51b815260206004820152601060248201527f496e73756666696369656e742066656500000000000000000000000000000000604482015260640161096f565b6020810151156109825780516007805460009290811061279257612792614164565b60009182526020918290206040805180820190915291015473ffffffffffffffffffffffffffffffffffffffff8116825274010000000000000000000000000000000000000000900460ff16151591810182905291506128125761210e7383d841bc0450d5ac35dcad8d05db53eba29978c28360015b6020020151611fd2565b805161210e90836001612808565b60005b83515181101561295e57835180518290811061284157612841614164565b602002602001015173ffffffffffffffffffffffffffffffffffffffff166323b872dd33308760200151858151811061287c5761287c614164565b602090810291909101015160405173ffffffffffffffffffffffffffffffffffffffff938416602482015292909116604483015260648201526084016040516020818303038152906040529060e01b6020820180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff83818316178352505050506040516129069190614193565b6000604051808303816000865af19150503d8060008114612943576040519150601f19603f3d011682016040523d82523d6000602084013e612948565b606091505b5050508080612956906141ce565b915050612823565b5060005b8251811015612bd55782818151811061297d5761297d614164565b60200260200101516000015173ffffffffffffffffffffffffffffffffffffffff1673b47e3cd837ddf8e4c57f05d70ab865de6e193bbb73ffffffffffffffffffffffffffffffffffffffff1614156129f7576129f28382815181106129e5576129e5614164565b6020026020010151612d47565b612bc3565b828181518110612a0957612a09614164565b60200260200101516000015173ffffffffffffffffffffffffffffffffffffffff167360cd862c9c687a9de49aecdc3a99b74a4fc54ab673ffffffffffffffffffffffffffffffffffffffff161415612a7e576129f2838281518110612a7157612a71614164565b6020026020010151612f25565b60005b838281518110612a9357612a93614164565b60200260200101516040015151811015612bc157838281518110612ab957612ab9614164565b60200260200101516000015173ffffffffffffffffffffffffffffffffffffffff166323b872dd612ae73390565b30878681518110612afa57612afa614164565b6020026020010151604001518581518110612b1757612b17614164565b60209081029190910101516040517fffffffff0000000000000000000000000000000000000000000000000000000060e086901b16815273ffffffffffffffffffffffffffffffffffffffff93841660048201529290911660248301526044820152606401600060405180830381600087803b158015612b9657600080fd5b505af1158015612baa573d6000803e3d6000fd5b505050508080612bb9906141ce565b915050612a81565b505b80612bcd816141ce565b915050612962565b5060005b8151811015610d8257818181518110612bf457612bf4614164565b60200260200101516000015173ffffffffffffffffffffffffffffffffffffffff16632eb2c2d6612c223390565b30858581518110612c3557612c35614164565b602002602001015160200151868681518110612c5357612c53614164565b6020026020010151604001516040518563ffffffff1660e01b8152600401612c7e94939291906142fe565b600060405180830381600087803b158015612c9857600080fd5b505af1158015612cac573d6000803e3d6000fd5b505050508080612cbb906141ce565b915050612bd9565b6000805473ffffffffffffffffffffffffffffffffffffffff8381167fffffffffffffffffffffffff0000000000000000000000000000000000000000831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b80610982573d6000803e3d6000fd5b60005b81604001515181101561210e576000826000015173ffffffffffffffffffffffffffffffffffffffff16635817816884604001518481518110612d8f57612d8f614164565b60200260200101516040518263ffffffff1660e01b8152600401612db591815260200190565b602060405180830381865afa158015612dd2573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190612df6919061422e565b905073ffffffffffffffffffffffffffffffffffffffff81163314612e835760405162461bcd60e51b815260206004820152602560248201527f5f61636365707443727970746f50756e6b3a20696e76616c69642070756e6b2060448201527f6f776e6572000000000000000000000000000000000000000000000000000000606482015260840161096f565b826000015173ffffffffffffffffffffffffffffffffffffffff16638264fe9884604001518481518110612eb957612eb9614164565b60200260200101516040518263ffffffff1660e01b8152600401612edf91815260200190565b600060405180830381600087803b158015612ef957600080fd5b505af1158015612f0d573d6000803e3d6000fd5b50505050508080612f1d906141ce565b915050612d4a565b60005b81604001515181101561210e576000612f5d83604001518381518110612f5057612f50614164565b602002602001015161315c565b83516040517f3894ca570000000000000000000000000000000000000000000000000000000081527fffffffffff0000000000000000000000000000000000000000000000000000008316600482015291925060009173ffffffffffffffffffffffffffffffffffffffff90911690633894ca5790602401602060405180830381865afa158015612ff2573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190613016919061422e565b905073ffffffffffffffffffffffffffffffffffffffff811633146130a35760405162461bcd60e51b815260206004820152602560248201527f5f6163636570744d6f6f6e4361743a20696e76616c6964206d6f6f6e6361742060448201527f6f776e6572000000000000000000000000000000000000000000000000000000606482015260840161096f565b83516040517f1be705100000000000000000000000000000000000000000000000000000000081527fffffffffff0000000000000000000000000000000000000000000000000000008416600482015273ffffffffffffffffffffffffffffffffffffffff90911690631be7051090602401600060405180830381600087803b15801561312f57600080fd5b505af1158015613143573d6000803e3d6000fd5b5050505050508080613154906141ce565b915050612f28565b6040805160208082528183019092526000918291906020820181803683375050506020810184815260405191925060059081830190600a8401905b818310156131af578051835260209283019201613197565b505060058352601f017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe01660405250602001519392505050565b6000602082840312156131fb57600080fd5b81357fffffffff000000000000000000000000000000000000000000000000000000008116811461322b57600080fd5b9392505050565b73ffffffffffffffffffffffffffffffffffffffff8116811461098257600080fd5b60006020828403121561326657600080fd5b813561322b81613232565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b6040805190810167ffffffffffffffff811182821017156132c3576132c3613271565b60405290565b6040516060810167ffffffffffffffff811182821017156132c3576132c3613271565b6040516020810167ffffffffffffffff811182821017156132c3576132c3613271565b604051601f82017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe016810167ffffffffffffffff8111828210171561335657613356613271565b604052919050565b600067ffffffffffffffff82111561337857613378613271565b5060051b60200190565b600082601f83011261339357600080fd5b813560206133a86133a38361335e565b61330f565b82815260059290921b840181019181810190868411156133c757600080fd5b8286015b848110156133eb5780356133de81613232565b83529183019183016133cb565b509695505050505050565b600082601f83011261340757600080fd5b813560206134176133a38361335e565b82815260059290921b8401810191818101908684111561343657600080fd5b8286015b848110156133eb578035835291830191830161343a565b60006040828403121561346357600080fd5b61346b6132a0565b9050813567ffffffffffffffff8082111561348557600080fd5b61349185838601613382565b835260208401359150808211156134a757600080fd5b506134b4848285016133f6565b60208301525092915050565b600082601f8301126134d157600080fd5b813567ffffffffffffffff8111156134eb576134eb613271565b61351c60207fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0601f8401160161330f565b81815284602083860101111561353157600080fd5b816020850160208301376000918101602001919091529392505050565b600082601f83011261355f57600080fd5b8135602061356f6133a38361335e565b82815260059290921b8401810191818101908684111561358e57600080fd5b8286015b848110156133eb57803567ffffffffffffffff808211156135b35760008081fd5b81890191506060807fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0848d030112156135ec5760008081fd5b6135f46132c9565b838801358152604080850135828a01529184013591838311156136175760008081fd5b6136258d8a858801016134c0565b908201528652505050918301918301613592565b600082601f83011261364a57600080fd5b8135602061365a6133a38361335e565b82815260059290921b8401810191818101908684111561367957600080fd5b8286015b848110156133eb57803567ffffffffffffffff8082111561369e5760008081fd5b8189019150857fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0838c030112156136d55760008081fd5b6136dd6132ec565b86830135828111156136ef5760008081fd5b6136fd8c89838701016134c0565b8252508552505091830191830161367d565b6000806000806080858703121561372557600080fd5b843567ffffffffffffffff8082111561373d57600080fd5b61374988838901613451565b9550602087013591508082111561375f57600080fd5b61376b8883890161354e565b9450604087013591508082111561378157600080fd5b61378d88838901613639565b935060608701359150808211156137a357600080fd5b506137b087828801613382565b91505092959194509250565b60008083601f8401126137ce57600080fd5b50813567ffffffffffffffff8111156137e657600080fd5b6020830191508360208285010111156137fe57600080fd5b9250929050565b60008060008060006080868803121561381d57600080fd5b853561382881613232565b9450602086013561383881613232565b935060408601359250606086013567ffffffffffffffff81111561385b57600080fd5b613867888289016137bc565b969995985093965092949392505050565b600082601f83011261388957600080fd5b813560206138996133a38361335e565b82815260059290921b840181019181810190868411156138b857600080fd5b8286015b848110156133eb57803567ffffffffffffffff808211156138dd5760008081fd5b81890191506060807fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0848d030112156139165760008081fd5b61391e6132c9565b8784013561392b81613232565b8152604084810135848111156139415760008081fd5b61394f8e8b83890101613382565b838b0152509184013591838311156139675760008081fd5b6139758d8a858801016133f6565b9082015286525050509183019183016138bc565b600082601f83011261399a57600080fd5b813560206139aa6133a38361335e565b82815260059290921b840181019181810190868411156139c957600080fd5b8286015b848110156133eb57803567ffffffffffffffff808211156139ee5760008081fd5b81890191506060807fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0848d03011215613a275760008081fd5b613a2f6132c9565b87840135613a3c81613232565b815260408481013584811115613a525760008081fd5b613a608e8b838901016133f6565b838b015250918401359183831115613a785760008081fd5b613a868d8a858801016133f6565b9082015286525050509183019183016139cd565b600082601f830112613aab57600080fd5b6040516040810181811067ffffffffffffffff82111715613ace57613ace613271565b8060405250806040840185811115613ae557600080fd5b845b81811015613aff578035835260209283019201613ae7565b509195945050505050565b6000806000806000806000610100888a031215613b2657600080fd5b873567ffffffffffffffff80821115613b3e57600080fd5b613b4a8b838c01613451565b985060208a0135915080821115613b6057600080fd5b613b6c8b838c01613878565b975060408a0135915080821115613b8257600080fd5b613b8e8b838c01613989565b965060608a0135915080821115613ba457600080fd5b613bb08b838c01613639565b955060808a0135915080821115613bc657600080fd5b613bd28b838c0161354e565b945060a08a0135915080821115613be857600080fd5b50613bf58a828b01613382565b925050613c058960c08a01613a9a565b905092959891949750929550565b600060208284031215613c2557600080fd5b5035919050565b60008083601f840112613c3e57600080fd5b50813567ffffffffffffffff811115613c5657600080fd5b6020830191508360208260051b85010111156137fe57600080fd5b60008060008060608587031215613c8757600080fd5b8435613c9281613232565b9350602085013567ffffffffffffffff811115613cae57600080fd5b613cba87828801613c2c565b9094509250506040850135613cce81613232565b939692955090935050565b801515811461098257600080fd5b600080600060608486031215613cfc57600080fd5b833592506020840135613d0e81613232565b91506040840135613d1e81613cd9565b809150509250925092565b60008060408385031215613d3c57600080fd5b8235613d4781613232565b91506020830135613d5781613232565b809150509250929050565b60006020808385031215613d7557600080fd5b823567ffffffffffffffff80821115613d8d57600080fd5b818501915085601f830112613da157600080fd5b8135613daf6133a38261335e565b81815260059190911b83018401908481019088831115613dce57600080fd5b8585015b83811015613e6257803585811115613dea5760008081fd5b86016040818c037fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe001811315613e205760008081fd5b613e286132a0565b828a01358152908201359087821115613e415760008081fd5b613e4f8d8b848601016134c0565b818b015285525050918601918601613dd2565b5098975050505050505050565b600060208284031215613e8157600080fd5b813561322b81613cd9565b600060208284031215613e9e57600080fd5b813567ffffffffffffffff811115613eb557600080fd5b613ec18482850161354e565b949350505050565b600080600060608486031215613ede57600080fd5b8335613ee981613232565b92506020840135613ef981613232565b929592945050506040919091013590565b60008060008060008060808789031215613f2357600080fd5b8635613f2e81613232565b9550602087013567ffffffffffffffff80821115613f4b57600080fd5b613f578a838b01613c2c565b90975095506040890135915080821115613f7057600080fd5b50613f7d89828a01613c2c565b9094509250506060870135613f9181613232565b809150509295509295509295565b60008060008060008060008060a0898b031215613fbb57600080fd5b8835613fc681613232565b97506020890135613fd681613232565b9650604089013567ffffffffffffffff80821115613ff357600080fd5b613fff8c838d01613c2c565b909850965060608b013591508082111561401857600080fd5b6140248c838d01613c2c565b909650945060808b013591508082111561403d57600080fd5b5061404a8b828c016137bc565b999c989b5096995094979396929594505050565b60008060006060848603121561407357600080fd5b83359250602084013591506040840135613d1e81613cd9565b600080600080606085870312156140a257600080fd5b84356140ad81613232565b935060208501359250604085013567ffffffffffffffff8111156140d057600080fd5b6140dc878288016137bc565b95989497509550505050565b60008060008060008060a0878903121561410157600080fd5b863561410c81613232565b9550602087013561411c81613232565b94506040870135935060608701359250608087013567ffffffffffffffff81111561414657600080fd5b61415289828a016137bc565b979a9699509497509295939492505050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b6000825160005b818110156141b4576020818601810151858301520161419a565b818111156141c3576000828501525b509190910192915050565b60007fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff821415614227577f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b5060010190565b60006020828403121561424057600080fd5b815161322b81613232565b60006020828403121561425d57600080fd5b5051919050565b60006020828403121561427657600080fd5b815161322b81613cd9565b60008060006060848603121561429657600080fd5b83516142a181613232565b60208501519093506142b281613cd9565b6040850151909250613d1e81613cd9565b600081518084526020808501945080840160005b838110156142f3578151875295820195908201906001016142d7565b509495945050505050565b600073ffffffffffffffffffffffffffffffffffffffff808716835280861660208401525060a0604083015261433760a08301856142c3565b828103606084015261434981856142c3565b83810360809094019390935250506000815260200194935050505056fea26469706673582212203b00da16931fd55526cb69d4d2dc0b9bfc6074d4c516c0d50944cfb66782ba8864736f6c634300080b0033000000000000000000000000add91d3ebf809f0058d59db2ac3632b3ce55f0ba00000000000000000000000097fb625482464eb51e8f65291515de1f68526337000000000000000000000000073ab1c0cad3677cde9bdb0cdeedc2085c029579

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

000000000000000000000000add91d3ebf809f0058d59db2ac3632b3ce55f0ba00000000000000000000000097fb625482464eb51e8f65291515de1f68526337000000000000000000000000073ab1c0cad3677cde9bdb0cdeedc2085c029579

-----Decoded View---------------
Arg [0] : _marketRegistry (address): 0xadd91d3EbF809f0058D59Db2AC3632B3ce55f0bA
Arg [1] : _converter (address): 0x97Fb625482464eb51E8F65291515de1F68526337
Arg [2] : _guardian (address): 0x073Ab1C0CAd3677cDe9BDb0cDEEDC2085c029579

-----Encoded View---------------
3 Constructor Arguments found :
Arg [0] : 000000000000000000000000add91d3ebf809f0058d59db2ac3632b3ce55f0ba
Arg [1] : 00000000000000000000000097fb625482464eb51e8f65291515de1f68526337
Arg [2] : 000000000000000000000000073ab1c0cad3677cde9bdb0cdeedc2085c029579


Block Transaction Difficulty Gas Used Reward
Block Uncle Number Difficulty Gas Used Reward
Loading
Loading
Make sure to use the "Vote Down" button for any spammy posts, and the "Vote Up" for interesting conversations.

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.