编译器
0.8.11+commit.d7f03943
文件 1 的 12:Context.sol
pragma solidity ^0.8.0;
abstract contract Context {
function _msgSender() internal view virtual returns (address) {
return msg.sender;
}
function _msgData() internal view virtual returns (bytes calldata) {
return msg.data;
}
}
文件 2 的 12:GemSwap.sol
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 {
IWrappedPunk(0xb7F7F6C52F2e2fdb1963Eab30438024864c313F6).registerProxy();
punkProxy = IWrappedPunk(0xb7F7F6C52F2e2fdb1963Eab30438024864c313F6).proxyInfo(address(this));
IERC721(0x7C40c393DC0f283F318791d746d894DdD3693572).setApprovalForAll(0xc3f733ca98E0daD0386979Eb96fb1722A1A05E69, true);
}
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;
}
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 {
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) {
assembly {
returndatacopy(0, 0, returndatasize())
revert(0, returndatasize())
}
}
}
function _transferFromHelper(
ERC20Details memory erc20Details,
SpecialTransferHelper.ERC721Details[] memory erc721Details,
ERC1155Details[] memory erc1155Details
) internal {
for (uint256 i = 0; i < erc20Details.tokenAddrs.length; i++) {
erc20Details.tokenAddrs[i].call(abi.encodeWithSelector(0x23b872dd, msg.sender, address(this), erc20Details.amounts[i]));
}
for (uint256 i = 0; i < erc721Details.length; i++) {
if (erc721Details[i].tokenAddr == 0xb47e3cd837dDF8e4c57F05d70Ab865de6e193BBB) {
_acceptCryptoPunk(erc721Details[i]);
}
else if (erc721Details[i].tokenAddr == 0x60cd862c9C687A9dE49aecdC3A99b74A4fc54aB6) {
_acceptMoonCat(erc721Details[i]);
}
else {
for (uint256 j = 0; j < erc721Details[i].ids.length; j++) {
IERC721(erc721Details[i].tokenAddr).transferFrom(
_msgSender(),
address(this),
erc721Details[i].ids[j]
);
}
}
}
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++) {
(bool success, ) = converter.delegatecall(_converstionDetails[i].conversionData);
_checkCallResult(success);
}
}
function _trade(
MarketRegistry.TradeDetails[] memory _tradeDetails
) internal {
for (uint256 i = 0; i < _tradeDetails.length; i++) {
(address _proxy, bool _isLib, bool _isActive) = marketRegistry.markets(_tradeDetails[i].marketId);
require(_isActive, "_trade: InActive Market");
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);
_checkCallResult(success);
}
}
}
function _returnDust(address[] memory _tokens) internal {
assembly {
if gt(selfbalance(), 0) {
let callStatus := call(
gas(),
caller(),
selfbalance(),
0,
0,
0,
0
)
}
}
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 {
for (uint256 i = 0; i < openseaTrades.length; i++) {
address(0x7Be8076f4EA4A4AD08075C2508e481d6C946D12b).call{value:openseaTrades[i].value}(openseaTrades[i].tradeData);
}
assembly {
if gt(selfbalance(), 0) {
let callStatus := call(
gas(),
caller(),
selfbalance(),
0,
0,
0,
0
)
}
}
}
function batchBuyWithETH(
MarketRegistry.TradeDetails[] memory tradeDetails
) payable external nonReentrant {
_trade(tradeDetails);
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 {
for (uint256 i = 0; i < erc20Details.tokenAddrs.length; i++) {
erc20Details.tokenAddrs[i].call(abi.encodeWithSelector(0x23b872dd, msg.sender, address(this), erc20Details.amounts[i]));
}
_conversionHelper(converstionDetails);
_trade(tradeDetails);
_returnDust(dustTokens);
}
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
) payable external isOpenForTrades nonReentrant {
_collectFee(feeDetails);
_transferFromHelper(
erc20Details,
erc721Details,
erc1155Details
);
_conversionHelper(converstionDetails);
_trade(tradeDetails);
_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;
}
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 {}
function rescueETH(address recipient) onlyOwner external {
_transferEth(recipient, address(this).balance);
}
function rescueERC20(address asset, address recipient) onlyOwner external {
asset.call(abi.encodeWithSelector(0xa9059cbb, recipient, IERC20(asset).balanceOf(address(this))));
}
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]);
}
}
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], "");
}
}
}
文件 3 的 12:ICryptoPunks.sol
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;
}
文件 4 的 12:IERC1155.sol
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);
}
文件 5 的 12:IERC20.sol
pragma solidity 0.8.11;
interface IERC20 {
function balanceOf(address account) external view returns (uint256);
function transfer(address recipient, uint256 amount) external returns (bool);
function transferFrom(address sender, address recipient, uint256 amount) external returns (bool);
function approve(address spender, uint256 amount) external returns (bool);
function allowance(address owner, address spender) external view returns (uint256);
}
文件 6 的 12:IERC721.sol
pragma solidity 0.8.11;
interface IERC721 {
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);
}
文件 7 的 12:IMoonCatsRescue.sol
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);
}
文件 8 的 12:IWrappedPunk.sol
pragma solidity 0.8.11;
interface IWrappedPunk {
function mint(uint256 punkIndex) external;
function burn(uint256 punkIndex) external;
function registerProxy() external;
function proxyInfo(address user) external view returns (address);
}
文件 9 的 12:MarketRegistry.sol
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;
}
}
文件 10 的 12:Ownable.sol
pragma solidity ^0.8.0;
import "../utils/Context.sol";
abstract contract Ownable is Context {
address private _owner;
event OwnershipTransferred(address indexed previousOwner, address indexed newOwner);
constructor() {
_setOwner(_msgSender());
}
function owner() public view virtual returns (address) {
return _owner;
}
modifier onlyOwner() {
require(owner() == _msgSender(), "Ownable: caller is not the owner");
_;
}
function renounceOwnership() public virtual onlyOwner {
_setOwner(address(0));
}
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);
}
}
文件 11 的 12:ReentrancyGuard.sol
pragma solidity 0.8.11;
abstract contract ReentrancyGuard {
uint256 private reentrancyStatus = 1;
modifier nonReentrant() {
require(reentrancyStatus == 1, "REENTRANCY");
reentrancyStatus = 2;
_;
reentrancyStatus = 1;
}
}
文件 12 的 12:SpecialTransferHelper.sol
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 {
tempBytes := mload(0x40)
let lengthmod := and(5, 31)
let mc := add(add(tempBytes, lengthmod), mul(0x20, iszero(lengthmod)))
let end := add(mc, 5)
for {
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)
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]);
}
}
}
{
"compilationTarget": {
"contracts/v1/GemSwap.sol": "GemSwap"
},
"evmVersion": "london",
"libraries": {},
"metadata": {
"bytecodeHash": "ipfs"
},
"optimizer": {
"enabled": true,
"runs": 20000
},
"remappings": []
}
[{"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"}]