ETH Price: $3,464.47 (+0.02%)

Contract

0x8162BeeC776442afd262B672730Bb5d0d8af16A1
 

Overview

ETH Balance

0 ETH

Eth Value

$0.00

Multichain Info

No addresses found
Transaction Hash
Method
Block
From
To

There are no matching entries

> 10 Internal Transactions and 2 Token Transfers found.

Latest 25 internal transactions (View All)

Advanced mode:
Parent Transaction Hash Block
From
To
169213552023-03-27 21:21:23638 days ago1679952083
0x8162BeeC...0d8af16A1
0.2 ETH
169213552023-03-27 21:21:23638 days ago1679952083
0x8162BeeC...0d8af16A1
0.2 ETH
169109772023-03-26 10:22:11640 days ago1679826131
0x8162BeeC...0d8af16A1
0.0001 ETH
169109772023-03-26 10:22:11640 days ago1679826131
0x8162BeeC...0d8af16A1
0.0001 ETH
169109772023-03-26 10:22:11640 days ago1679826131
0x8162BeeC...0d8af16A1
0.0001 ETH
169109772023-03-26 10:22:11640 days ago1679826131
0x8162BeeC...0d8af16A1
0.0001 ETH
168655242023-03-20 1:09:59646 days ago1679274599
0x8162BeeC...0d8af16A1
0.06 ETH
168655242023-03-20 1:09:59646 days ago1679274599
0x8162BeeC...0d8af16A1
0.06 ETH
168591632023-03-19 3:42:23647 days ago1679197343
0x8162BeeC...0d8af16A1
0.0003 ETH
168591632023-03-19 3:42:23647 days ago1679197343
0x8162BeeC...0d8af16A1
0.0003 ETH
168436322023-03-16 23:20:35649 days ago1679008835
0x8162BeeC...0d8af16A1
0.0001 ETH
168436322023-03-16 23:20:35649 days ago1679008835
0x8162BeeC...0d8af16A1
0.0001 ETH
168168382023-03-13 4:58:23653 days ago1678683503
0x8162BeeC...0d8af16A1
0.09 ETH
168168382023-03-13 4:58:23653 days ago1678683503
0x8162BeeC...0d8af16A1
0.09 ETH
168116242023-03-12 11:23:23654 days ago1678620203
0x8162BeeC...0d8af16A1
0.0001 ETH
168116242023-03-12 11:23:23654 days ago1678620203
0x8162BeeC...0d8af16A1
0.0001 ETH
167788362023-03-07 20:36:47658 days ago1678221407
0x8162BeeC...0d8af16A1
0.062 ETH
167788362023-03-07 20:36:47658 days ago1678221407
0x8162BeeC...0d8af16A1
0.062 ETH
167746882023-03-07 6:37:11659 days ago1678171031
0x8162BeeC...0d8af16A1
0.0009 ETH
167746882023-03-07 6:37:11659 days ago1678171031
0x8162BeeC...0d8af16A1
0.0009 ETH
167743992023-03-07 5:38:59659 days ago1678167539
0x8162BeeC...0d8af16A1
0.0001 ETH
167743992023-03-07 5:38:59659 days ago1678167539
0x8162BeeC...0d8af16A1
0.0001 ETH
167742362023-03-07 5:05:35659 days ago1678165535
0x8162BeeC...0d8af16A1
0.0009 ETH
167742362023-03-07 5:05:35659 days ago1678165535
0x8162BeeC...0d8af16A1
0.0009 ETH
167478432023-03-03 11:59:59663 days ago1677844799
0x8162BeeC...0d8af16A1
0.001 ETH
View All Internal Transactions
Loading...
Loading

Contract Source Code Verified (Exact Match)

Contract Name:
ZeroExV4Module

Compiler Version
v0.8.17+commit.8df45f5f

Optimization Enabled:
Yes with 200 runs

Other Settings:
default evmVersion
File 1 of 13 : ZeroExV4Module.sol
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.9;

import {IERC20} from "@openzeppelin/contracts/token/ERC20/IERC20.sol";
import {SafeERC20} from "@openzeppelin/contracts/token/ERC20/utils/SafeERC20.sol";

import {BaseExchangeModule} from "./BaseExchangeModule.sol";
import {BaseModule} from "../BaseModule.sol";
import {IZeroExV4} from "../../../interfaces/IZeroExV4.sol";

// Notes:
// - supports filling listings (both ERC721/ERC1155)
// - supports filling offers (both ERC721/ERC1155)

contract ZeroExV4Module is BaseExchangeModule {
    using SafeERC20 for IERC20;

    // --- Fields ---

    IZeroExV4 public constant EXCHANGE =
        IZeroExV4(0xDef1C0ded9bec7F1a1670819833240f027b25EfF);

    // --- Constructor ---

    constructor(address owner, address router)
        BaseModule(owner)
        BaseExchangeModule(router)
    {}

    // --- Fallback ---

    receive() external payable {}

    // --- [ERC721] Single ETH listing ---

    function acceptETHListingERC721(
        IZeroExV4.ERC721Order calldata order,
        IZeroExV4.Signature calldata signature,
        ETHListingParams calldata params,
        Fee[] calldata fees
    )
        external
        payable
        nonReentrant
        refundETHLeftover(params.refundTo)
        chargeETHFees(fees, params.amount)
    {
        // Execute fill
        _buyERC721(
            order,
            signature,
            params.fillTo,
            params.revertIfIncomplete,
            params.amount
        );
    }

    // --- [ERC721] Single ERC20 listing ---

    function acceptERC20ListingERC721(
        IZeroExV4.ERC721Order calldata order,
        IZeroExV4.Signature calldata signature,
        ERC20ListingParams calldata params,
        Fee[] calldata fees
    )
        external
        payable
        nonReentrant
        refundERC20Leftover(params.refundTo, params.token)
        chargeERC20Fees(fees, params.token, params.amount)
    {
        // Approve the exchange if needed
        _approveERC20IfNeeded(params.token, address(EXCHANGE), params.amount);

        // Execute fill
        _buyERC721(
            order,
            signature,
            params.fillTo,
            params.revertIfIncomplete,
            0
        );
    }

    // --- [ERC721] Multiple ETH listings ---

    function acceptETHListingsERC721(
        IZeroExV4.ERC721Order[] calldata orders,
        IZeroExV4.Signature[] calldata signatures,
        ETHListingParams calldata params,
        Fee[] calldata fees
    )
        external
        payable
        nonReentrant
        refundETHLeftover(params.refundTo)
        chargeETHFees(fees, params.amount)
    {
        // Execute fill
        _buyERC721s(
            orders,
            signatures,
            params.fillTo,
            params.revertIfIncomplete,
            params.amount
        );
    }

    // --- [ERC721] Multiple ERC20 listings ---

    function acceptERC20ListingsERC721(
        IZeroExV4.ERC721Order[] calldata orders,
        IZeroExV4.Signature[] calldata signatures,
        ERC20ListingParams calldata params,
        Fee[] calldata fees
    )
        external
        payable
        nonReentrant
        refundERC20Leftover(params.refundTo, params.token)
        chargeERC20Fees(fees, params.token, params.amount)
    {
        // Approve the exchange if needed
        _approveERC20IfNeeded(params.token, address(EXCHANGE), params.amount);

        // Execute fill
        _buyERC721s(
            orders,
            signatures,
            params.fillTo,
            params.revertIfIncomplete,
            0
        );
    }

    // --- [ERC1155] Single ETH listing ---

    function acceptETHListingERC1155(
        IZeroExV4.ERC1155Order calldata order,
        IZeroExV4.Signature calldata signature,
        uint128 amount,
        ETHListingParams calldata params,
        Fee[] calldata fees
    )
        external
        payable
        nonReentrant
        refundETHLeftover(params.refundTo)
        chargeETHFees(fees, params.amount)
    {
        // Execute fill
        _buyERC1155(
            order,
            signature,
            amount,
            params.fillTo,
            params.revertIfIncomplete,
            params.amount
        );
    }

    // --- [ERC1155] Single ERC20 listing ---

    function acceptERC20ListingERC1155(
        IZeroExV4.ERC1155Order calldata order,
        IZeroExV4.Signature calldata signature,
        uint128 amount,
        ERC20ListingParams calldata params,
        Fee[] calldata fees
    )
        external
        payable
        nonReentrant
        refundERC20Leftover(params.refundTo, params.token)
        chargeERC20Fees(fees, params.token, params.amount)
    {
        // Approve the exchange if needed
        _approveERC20IfNeeded(params.token, address(EXCHANGE), params.amount);

        // Execute fill
        _buyERC1155(
            order,
            signature,
            amount,
            params.fillTo,
            params.revertIfIncomplete,
            0
        );
    }

    // --- [ERC1155] Multiple ETH listings ---

    function acceptETHListingsERC1155(
        IZeroExV4.ERC1155Order[] calldata orders,
        IZeroExV4.Signature[] calldata signatures,
        uint128[] memory amounts,
        ETHListingParams calldata params,
        Fee[] calldata fees
    )
        external
        payable
        nonReentrant
        refundETHLeftover(params.refundTo)
        chargeETHFees(fees, params.amount)
    {
        // Execute fill
        _buyERC1155s(
            orders,
            signatures,
            amounts,
            params.fillTo,
            params.revertIfIncomplete,
            params.amount
        );
    }

    // --- [ERC1155] Multiple ERC20 listings ---

    function acceptERC20ListingsERC1155(
        IZeroExV4.ERC1155Order[] calldata orders,
        IZeroExV4.Signature[] calldata signatures,
        uint128[] memory amounts,
        ERC20ListingParams calldata params,
        Fee[] calldata fees
    )
        external
        payable
        nonReentrant
        refundERC20Leftover(params.refundTo, params.token)
        chargeERC20Fees(fees, params.token, params.amount)
    {
        // Approve the exchange if needed
        _approveERC20IfNeeded(params.token, address(EXCHANGE), params.amount);

        // Execute fill
        _buyERC1155s(
            orders,
            signatures,
            amounts,
            params.fillTo,
            params.revertIfIncomplete,
            0
        );
    }

    // --- [ERC721] Single offer ---

    function acceptERC721Offer(
        IZeroExV4.ERC721Order calldata order,
        IZeroExV4.Signature calldata signature,
        OfferParams calldata params,
        uint256 tokenId,
        Fee[] calldata fees
    ) external nonReentrant {
        // Approve the exchange if needed
        _approveERC721IfNeeded(order.erc721Token, address(EXCHANGE));

        // Execute fill
        try EXCHANGE.sellERC721(order, signature, tokenId, false, "") {
            // Pay fees
            uint256 feesLength = fees.length;
            for (uint256 i; i < feesLength; ) {
                Fee memory fee = fees[i];
                _sendERC20(fee.recipient, fee.amount, order.erc20Token);

                unchecked {
                    ++i;
                }
            }

            // Forward any left payment to the specified receiver
            _sendAllERC20(params.fillTo, order.erc20Token);
        } catch {
            // Revert if specified
            if (params.revertIfIncomplete) {
                revert UnsuccessfulFill();
            }
        }

        // Refund any ERC721 leftover
        _sendAllERC721(params.refundTo, order.erc721Token, tokenId);
    }

    // --- [ERC1155] Single offer ---

    function acceptERC1155Offer(
        IZeroExV4.ERC1155Order calldata order,
        IZeroExV4.Signature calldata signature,
        uint128 amount,
        OfferParams calldata params,
        uint256 tokenId,
        Fee[] calldata fees
    ) external nonReentrant {
        // Approve the exchange if needed
        _approveERC1155IfNeeded(order.erc1155Token, address(EXCHANGE));

        // Execute fill
        try EXCHANGE.sellERC1155(order, signature, tokenId, amount, false, "") {
            // Pay fees
            uint256 feesLength = fees.length;
            for (uint256 i; i < feesLength; ) {
                Fee memory fee = fees[i];
                _sendERC20(fee.recipient, fee.amount, order.erc20Token);

                unchecked {
                    ++i;
                }
            }

            // Forward any left payment to the specified receiver
            _sendAllERC20(params.fillTo, order.erc20Token);
        } catch {
            // Revert if specified
            if (params.revertIfIncomplete) {
                revert UnsuccessfulFill();
            }
        }

        // Refund any ERC1155 leftover
        _sendAllERC1155(params.refundTo, order.erc1155Token, tokenId);
    }

    // --- ERC721 / ERC1155 hooks ---

    // Single token offer acceptance can be done approval-less by using the
    // standard `safeTransferFrom` method together with specifying data for
    // further contract calls. An example:
    // `safeTransferFrom(
    //      0xWALLET,
    //      0xMODULE,
    //      TOKEN_ID,
    //      0xABI_ENCODED_ROUTER_EXECUTION_CALLDATA_FOR_OFFER_ACCEPTANCE
    // )`

    function onERC721Received(
        address, // operator,
        address, // from
        uint256, // tokenId,
        bytes calldata data
    ) external returns (bytes4) {
        if (data.length > 0) {
            _makeCall(router, data, 0);
        }

        return this.onERC721Received.selector;
    }

    function onERC1155Received(
        address, // operator
        address, // from
        uint256, // tokenId
        uint256, // amount
        bytes calldata data
    ) external returns (bytes4) {
        if (data.length > 0) {
            _makeCall(router, data, 0);
        }

        return this.onERC1155Received.selector;
    }

    // --- Internal ---

    function _buyERC721(
        IZeroExV4.ERC721Order calldata order,
        IZeroExV4.Signature calldata signature,
        address receiver,
        bool revertIfIncomplete,
        uint256 value
    ) internal {
        // Execute fill
        try EXCHANGE.buyERC721{value: value}(order, signature, "") {
            order.erc721Token.safeTransferFrom(
                address(this),
                receiver,
                order.erc721TokenId
            );
        } catch {
            // Revert if specified
            if (revertIfIncomplete) {
                revert UnsuccessfulFill();
            }
        }
    }

    function _buyERC1155(
        IZeroExV4.ERC1155Order calldata order,
        IZeroExV4.Signature calldata signature,
        uint128 amount,
        address receiver,
        bool revertIfIncomplete,
        uint256 value
    ) internal {
        try EXCHANGE.buyERC1155{value: value}(order, signature, amount, "") {
            order.erc1155Token.safeTransferFrom(
                address(this),
                receiver,
                order.erc1155TokenId,
                amount,
                ""
            );
        } catch {
            // Revert if specified
            if (revertIfIncomplete) {
                revert UnsuccessfulFill();
            }
        }
    }

    function _buyERC721s(
        IZeroExV4.ERC721Order[] calldata orders,
        IZeroExV4.Signature[] calldata signatures,
        address receiver,
        bool revertIfIncomplete,
        uint256 value
    ) internal {
        uint256 length = orders.length;

        // Execute fill
        try
            EXCHANGE.batchBuyERC721s{value: value}(
                orders,
                signatures,
                new bytes[](length),
                revertIfIncomplete
            )
        returns (bool[] memory fulfilled) {
            for (uint256 i = 0; i < length; ) {
                if (fulfilled[i]) {
                    orders[i].erc721Token.safeTransferFrom(
                        address(this),
                        receiver,
                        orders[i].erc721TokenId
                    );
                }

                unchecked {
                    ++i;
                }
            }
        } catch {
            // Revert if specified
            if (revertIfIncomplete) {
                revert UnsuccessfulFill();
            }
        }
    }

    function _buyERC1155s(
        IZeroExV4.ERC1155Order[] calldata orders,
        IZeroExV4.Signature[] calldata signatures,
        uint128[] memory amounts,
        address receiver,
        bool revertIfIncomplete,
        uint256 value
    ) internal {
        uint256 length = orders.length;

        uint128[] memory fillAmounts = new uint128[](length);
        for (uint256 i = 0; i < length; ) {
            fillAmounts[i] = amounts[i];

            unchecked {
                ++i;
            }
        }

        // Execute fill
        try
            EXCHANGE.batchBuyERC1155s{value: value}(
                orders,
                signatures,
                fillAmounts,
                new bytes[](length),
                revertIfIncomplete
            )
        returns (bool[] memory fulfilled) {
            for (uint256 i = 0; i < length; ) {
                if (fulfilled[i]) {
                    orders[i].erc1155Token.safeTransferFrom(
                        address(this),
                        receiver,
                        orders[i].erc1155TokenId,
                        fillAmounts[i],
                        ""
                    );
                }

                unchecked {
                    ++i;
                }
            }
        } catch {
            // Revert if specified
            if (revertIfIncomplete) {
                revert UnsuccessfulFill();
            }
        }
    }
}

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

pragma solidity ^0.8.0;

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

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

    uint256 private _status;

    constructor() {
        _status = _NOT_ENTERED;
    }

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

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

        _;

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

File 3 of 13 : IERC1155.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.7.0) (token/ERC1155/IERC1155.sol)

pragma solidity ^0.8.0;

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

/**
 * @dev Required interface of an ERC1155 compliant contract, as defined in the
 * https://eips.ethereum.org/EIPS/eip-1155[EIP].
 *
 * _Available since v3.1._
 */
interface IERC1155 is IERC165 {
    /**
     * @dev Emitted when `value` tokens of token type `id` are transferred from `from` to `to` by `operator`.
     */
    event TransferSingle(address indexed operator, address indexed from, address indexed to, uint256 id, uint256 value);

    /**
     * @dev Equivalent to multiple {TransferSingle} events, where `operator`, `from` and `to` are the same for all
     * transfers.
     */
    event TransferBatch(
        address indexed operator,
        address indexed from,
        address indexed to,
        uint256[] ids,
        uint256[] values
    );

    /**
     * @dev Emitted when `account` grants or revokes permission to `operator` to transfer their tokens, according to
     * `approved`.
     */
    event ApprovalForAll(address indexed account, address indexed operator, bool approved);

    /**
     * @dev Emitted when the URI for token type `id` changes to `value`, if it is a non-programmatic URI.
     *
     * If an {URI} event was emitted for `id`, the standard
     * https://eips.ethereum.org/EIPS/eip-1155#metadata-extensions[guarantees] that `value` will equal the value
     * returned by {IERC1155MetadataURI-uri}.
     */
    event URI(string value, uint256 indexed id);

    /**
     * @dev Returns the amount of tokens of token type `id` owned by `account`.
     *
     * Requirements:
     *
     * - `account` cannot be the zero address.
     */
    function balanceOf(address account, uint256 id) external view returns (uint256);

    /**
     * @dev xref:ROOT:erc1155.adoc#batch-operations[Batched] version of {balanceOf}.
     *
     * Requirements:
     *
     * - `accounts` and `ids` must have the same length.
     */
    function balanceOfBatch(address[] calldata accounts, uint256[] calldata ids)
        external
        view
        returns (uint256[] memory);

    /**
     * @dev Grants or revokes permission to `operator` to transfer the caller's tokens, according to `approved`,
     *
     * Emits an {ApprovalForAll} event.
     *
     * Requirements:
     *
     * - `operator` cannot be the caller.
     */
    function setApprovalForAll(address operator, bool approved) external;

    /**
     * @dev Returns true if `operator` is approved to transfer ``account``'s tokens.
     *
     * See {setApprovalForAll}.
     */
    function isApprovedForAll(address account, address operator) external view returns (bool);

    /**
     * @dev Transfers `amount` tokens of token type `id` from `from` to `to`.
     *
     * Emits a {TransferSingle} event.
     *
     * Requirements:
     *
     * - `to` cannot be the zero address.
     * - If the caller is not `from`, it must have been approved to spend ``from``'s tokens via {setApprovalForAll}.
     * - `from` must have a balance of tokens of type `id` of at least `amount`.
     * - If `to` refers to a smart contract, it must implement {IERC1155Receiver-onERC1155Received} and return the
     * acceptance magic value.
     */
    function safeTransferFrom(
        address from,
        address to,
        uint256 id,
        uint256 amount,
        bytes calldata data
    ) external;

    /**
     * @dev xref:ROOT:erc1155.adoc#batch-operations[Batched] version of {safeTransferFrom}.
     *
     * Emits a {TransferBatch} event.
     *
     * Requirements:
     *
     * - `ids` and `amounts` must have the same length.
     * - If `to` refers to a smart contract, it must implement {IERC1155Receiver-onERC1155BatchReceived} and return the
     * acceptance magic value.
     */
    function safeBatchTransferFrom(
        address from,
        address to,
        uint256[] calldata ids,
        uint256[] calldata amounts,
        bytes calldata data
    ) external;
}

File 4 of 13 : draft-IERC20Permit.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (token/ERC20/extensions/draft-IERC20Permit.sol)

pragma solidity ^0.8.0;

/**
 * @dev Interface of the ERC20 Permit extension allowing approvals to be made via signatures, as defined in
 * https://eips.ethereum.org/EIPS/eip-2612[EIP-2612].
 *
 * Adds the {permit} method, which can be used to change an account's ERC20 allowance (see {IERC20-allowance}) by
 * presenting a message signed by the account. By not relying on {IERC20-approve}, the token holder account doesn't
 * need to send a transaction, and thus is not required to hold Ether at all.
 */
interface IERC20Permit {
    /**
     * @dev Sets `value` as the allowance of `spender` over ``owner``'s tokens,
     * given ``owner``'s signed approval.
     *
     * IMPORTANT: The same issues {IERC20-approve} has related to transaction
     * ordering also apply here.
     *
     * Emits an {Approval} event.
     *
     * Requirements:
     *
     * - `spender` cannot be the zero address.
     * - `deadline` must be a timestamp in the future.
     * - `v`, `r` and `s` must be a valid `secp256k1` signature from `owner`
     * over the EIP712-formatted function arguments.
     * - the signature must use ``owner``'s current nonce (see {nonces}).
     *
     * For more information on the signature format, see the
     * https://eips.ethereum.org/EIPS/eip-2612#specification[relevant EIP
     * section].
     */
    function permit(
        address owner,
        address spender,
        uint256 value,
        uint256 deadline,
        uint8 v,
        bytes32 r,
        bytes32 s
    ) external;

    /**
     * @dev Returns the current nonce for `owner`. This value must be
     * included whenever a signature is generated for {permit}.
     *
     * Every successful call to {permit} increases ``owner``'s nonce by one. This
     * prevents a signature from being used multiple times.
     */
    function nonces(address owner) external view returns (uint256);

    /**
     * @dev Returns the domain separator used in the encoding of the signature for {permit}, as defined by {EIP712}.
     */
    // solhint-disable-next-line func-name-mixedcase
    function DOMAIN_SEPARATOR() external view returns (bytes32);
}

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

pragma solidity ^0.8.0;

/**
 * @dev Interface of the ERC20 standard as defined in the EIP.
 */
interface IERC20 {
    /**
     * @dev Emitted when `value` tokens are moved from one account (`from`) to
     * another (`to`).
     *
     * Note that `value` may be zero.
     */
    event Transfer(address indexed from, address indexed to, uint256 value);

    /**
     * @dev Emitted when the allowance of a `spender` for an `owner` is set by
     * a call to {approve}. `value` is the new allowance.
     */
    event Approval(address indexed owner, address indexed spender, uint256 value);

    /**
     * @dev Returns the amount of tokens in existence.
     */
    function totalSupply() external view returns (uint256);

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

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

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

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

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

File 6 of 13 : SafeERC20.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.7.0) (token/ERC20/utils/SafeERC20.sol)

pragma solidity ^0.8.0;

import "../IERC20.sol";
import "../extensions/draft-IERC20Permit.sol";
import "../../../utils/Address.sol";

/**
 * @title SafeERC20
 * @dev Wrappers around ERC20 operations that throw on failure (when the token
 * contract returns false). Tokens that return no value (and instead revert or
 * throw on failure) are also supported, non-reverting calls are assumed to be
 * successful.
 * To use this library you can add a `using SafeERC20 for IERC20;` statement to your contract,
 * which allows you to call the safe operations as `token.safeTransfer(...)`, etc.
 */
library SafeERC20 {
    using Address for address;

    function safeTransfer(
        IERC20 token,
        address to,
        uint256 value
    ) internal {
        _callOptionalReturn(token, abi.encodeWithSelector(token.transfer.selector, to, value));
    }

    function safeTransferFrom(
        IERC20 token,
        address from,
        address to,
        uint256 value
    ) internal {
        _callOptionalReturn(token, abi.encodeWithSelector(token.transferFrom.selector, from, to, value));
    }

    /**
     * @dev Deprecated. This function has issues similar to the ones found in
     * {IERC20-approve}, and its usage is discouraged.
     *
     * Whenever possible, use {safeIncreaseAllowance} and
     * {safeDecreaseAllowance} instead.
     */
    function safeApprove(
        IERC20 token,
        address spender,
        uint256 value
    ) internal {
        // safeApprove should only be called when setting an initial allowance,
        // or when resetting it to zero. To increase and decrease it, use
        // 'safeIncreaseAllowance' and 'safeDecreaseAllowance'
        require(
            (value == 0) || (token.allowance(address(this), spender) == 0),
            "SafeERC20: approve from non-zero to non-zero allowance"
        );
        _callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, value));
    }

    function safeIncreaseAllowance(
        IERC20 token,
        address spender,
        uint256 value
    ) internal {
        uint256 newAllowance = token.allowance(address(this), spender) + value;
        _callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, newAllowance));
    }

    function safeDecreaseAllowance(
        IERC20 token,
        address spender,
        uint256 value
    ) internal {
        unchecked {
            uint256 oldAllowance = token.allowance(address(this), spender);
            require(oldAllowance >= value, "SafeERC20: decreased allowance below zero");
            uint256 newAllowance = oldAllowance - value;
            _callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, newAllowance));
        }
    }

    function safePermit(
        IERC20Permit token,
        address owner,
        address spender,
        uint256 value,
        uint256 deadline,
        uint8 v,
        bytes32 r,
        bytes32 s
    ) internal {
        uint256 nonceBefore = token.nonces(owner);
        token.permit(owner, spender, value, deadline, v, r, s);
        uint256 nonceAfter = token.nonces(owner);
        require(nonceAfter == nonceBefore + 1, "SafeERC20: permit did not succeed");
    }

    /**
     * @dev Imitates a Solidity high-level call (i.e. a regular function call to a contract), relaxing the requirement
     * on the return value: the return value is optional (but if data is returned, it must not be false).
     * @param token The token targeted by the call.
     * @param data The call data (encoded using abi.encode or one of its variants).
     */
    function _callOptionalReturn(IERC20 token, bytes memory data) private {
        // We need to perform a low level call here, to bypass Solidity's return data size checking mechanism, since
        // we're implementing it ourselves. We use {Address.functionCall} to perform this call, which verifies that
        // the target address contains contract code and also asserts for success in the low-level call.

        bytes memory returndata = address(token).functionCall(data, "SafeERC20: low-level call failed");
        if (returndata.length > 0) {
            // Return data is optional
            require(abi.decode(returndata, (bool)), "SafeERC20: ERC20 operation did not succeed");
        }
    }
}

File 7 of 13 : IERC721.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.7.0) (token/ERC721/IERC721.sol)

pragma solidity ^0.8.0;

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

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

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

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

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

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

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

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

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

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

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

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

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

File 8 of 13 : Address.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.7.0) (utils/Address.sol)

pragma solidity ^0.8.1;

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

        return account.code.length > 0;
    }

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

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

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

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

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

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

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

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

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

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

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

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

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

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

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

pragma solidity ^0.8.0;

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

File 10 of 13 : IZeroExV4.sol
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.9;

import {IERC1155} from "@openzeppelin/contracts/token/ERC1155/IERC1155.sol";
import {IERC20} from "@openzeppelin/contracts/token/ERC20/IERC20.sol";
import {IERC721} from "@openzeppelin/contracts/token/ERC721/IERC721.sol";

interface IZeroExV4 {
    struct Property {
        address propertyValidator;
        bytes propertyData;
    }

    struct Fee {
        address recipient;
        uint256 amount;
        bytes feeData;
    }

    struct ERC721Order {
        uint8 direction;
        address maker;
        address taker;
        uint256 expiry;
        uint256 nonce;
        IERC20 erc20Token;
        uint256 erc20TokenAmount;
        Fee[] fees;
        IERC721 erc721Token;
        uint256 erc721TokenId;
        Property[] erc721TokenProperties;
    }

    struct ERC1155Order {
        uint8 direction;
        address maker;
        address taker;
        uint256 expiry;
        uint256 nonce;
        IERC20 erc20Token;
        uint256 erc20TokenAmount;
        Fee[] fees;
        IERC1155 erc1155Token;
        uint256 erc1155TokenId;
        Property[] erc1155TokenProperties;
        uint128 erc1155TokenAmount;
    }

    struct Signature {
        uint8 signatureType;
        uint8 v;
        bytes32 r;
        bytes32 s;
    }

    function buyERC721(
        ERC721Order calldata sellOrder,
        Signature calldata signature,
        bytes memory callbackData
    ) external payable;

    function batchBuyERC721s(
        ERC721Order[] calldata sellOrders,
        Signature[] calldata signatures,
        bytes[] calldata callbackData,
        bool revertIfIncomplete
    ) external payable returns (bool[] memory);

    function sellERC721(
        ERC721Order calldata buyOrder,
        Signature calldata signature,
        uint256 erc721TokenId,
        bool unwrapNativeToken,
        bytes memory callbackData
    ) external;

    function buyERC1155(
        ERC1155Order calldata sellOrder,
        Signature calldata signature,
        uint128 erc1155BuyAmount,
        bytes calldata callbackData
    ) external payable;

    function batchBuyERC1155s(
        ERC1155Order[] calldata sellOrders,
        Signature[] calldata signatures,
        uint128[] calldata erc1155FillAmounts,
        bytes[] calldata callbackData,
        bool revertIfIncomplete
    ) external payable returns (bool[] memory successes);

    function sellERC1155(
        ERC1155Order calldata buyOrder,
        Signature calldata signature,
        uint256 erc1155TokenId,
        uint128 erc1155SellAmount,
        bool unwrapNativeToken,
        bytes calldata callbackData
    ) external;
}

File 11 of 13 : TwoStepOwnable.sol
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.9;

// Adapted from:
// https://github.com/boringcrypto/BoringSolidity/blob/e74c5b22a61bfbadd645e51a64aa1d33734d577a/contracts/BoringOwnable.sol
contract TwoStepOwnable {
    // --- Fields ---

    address public owner;
    address public pendingOwner;

    // --- Events ---

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

    // --- Errors ---

    error InvalidParams();
    error Unauthorized();

    // --- Modifiers ---

    modifier onlyOwner() {
        if (msg.sender != owner) {
            revert Unauthorized();
        }

        _;
    }

    // --- Constructor ---

    constructor(address initialOwner) {
        owner = initialOwner;
        emit OwnershipTransferred(address(0), initialOwner);
    }

    // --- Methods ---

    function transferOwnership(address newOwner) public onlyOwner {
        pendingOwner = newOwner;
    }

    function claimOwnership() public {
        address _pendingOwner = pendingOwner;
        if (msg.sender != _pendingOwner) {
            revert Unauthorized();
        }

        owner = _pendingOwner;
        pendingOwner = address(0);
        emit OwnershipTransferred(owner, _pendingOwner);
    }
}

File 12 of 13 : BaseModule.sol
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.9;

import {ReentrancyGuard} from "@openzeppelin/contracts/security/ReentrancyGuard.sol";
import {IERC20} from "@openzeppelin/contracts/token/ERC20/IERC20.sol";
import {SafeERC20} from "@openzeppelin/contracts/token/ERC20/utils/SafeERC20.sol";

import {TwoStepOwnable} from "../../misc/TwoStepOwnable.sol";

// Notes:
// - includes common helpers useful for all modules

abstract contract BaseModule is TwoStepOwnable, ReentrancyGuard {
    using SafeERC20 for IERC20;

    // --- Events ---

    event CallExecuted(address target, bytes data, uint256 value);

    // --- Errors ---

    error UnsuccessfulCall();
    error UnsuccessfulPayment();
    error WrongParams();

    // --- Constructor ---

    constructor(address owner) TwoStepOwnable(owner) {}

    // --- Owner ---

    // To be able to recover anything that gets stucked by mistake in the module,
    // we allow the owner to perform any arbitrary call. Since the goal is to be
    // stateless, this should only happen in case of mistakes. In addition, this
    // method is also useful for withdrawing any earned trading rewards.
    function makeCalls(
        address[] calldata targets,
        bytes[] calldata data,
        uint256[] calldata values
    ) external payable onlyOwner nonReentrant {
        uint256 length = targets.length;
        for (uint256 i = 0; i < length; ) {
            _makeCall(targets[i], data[i], values[i]);
            emit CallExecuted(targets[i], data[i], values[i]);

            unchecked {
                ++i;
            }
        }
    }

    // --- Helpers ---

    function _sendETH(address to, uint256 amount) internal {
        if (amount > 0) {
            (bool success, ) = payable(to).call{value: amount}("");
            if (!success) {
                revert UnsuccessfulPayment();
            }
        }
    }

    function _sendERC20(
        address to,
        uint256 amount,
        IERC20 token
    ) internal {
        if (amount > 0) {
            token.safeTransfer(to, amount);
        }
    }

    function _makeCall(
        address target,
        bytes memory data,
        uint256 value
    ) internal {
        (bool success, ) = payable(target).call{value: value}(data);
        if (!success) {
            revert UnsuccessfulCall();
        }
    }
}

File 13 of 13 : BaseExchangeModule.sol
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.9;

import {IERC20} from "@openzeppelin/contracts/token/ERC20/IERC20.sol";
import {SafeERC20} from "@openzeppelin/contracts/token/ERC20/utils/SafeERC20.sol";
import {IERC721} from "@openzeppelin/contracts/token/ERC721/IERC721.sol";
import {IERC1155} from "@openzeppelin/contracts/token/ERC1155/IERC1155.sol";

import {BaseModule} from "../BaseModule.sol";

// Notes:
// - includes common helpers useful for all marketplace/exchange modules

abstract contract BaseExchangeModule is BaseModule {
    using SafeERC20 for IERC20;

    // --- Structs ---

    // Every fill execution has the following parameters:
    // - `fillTo`: the recipient of the received items
    // - `refundTo`: the recipient of any refunds
    // - `revertIfIncomplete`: whether to revert or skip unsuccessful fills

    // The below `ETHListingParams` and `ERC20ListingParams` rely on the
    // off-chain execution encoder to ensure that the orders filled with
    // the passed in listing parameters exactly match (eg. order amounts
    // and payment tokens match).

    struct ETHListingParams {
        address fillTo;
        address refundTo;
        bool revertIfIncomplete;
        // The total amount of ETH to be provided when filling
        uint256 amount;
    }

    struct ERC20ListingParams {
        address fillTo;
        address refundTo;
        bool revertIfIncomplete;
        // The ERC20 payment token for the listings
        IERC20 token;
        // The total amount of `token` to be provided when filling
        uint256 amount;
    }

    struct OfferParams {
        address fillTo;
        address refundTo;
        bool revertIfIncomplete;
    }

    struct Fee {
        address recipient;
        uint256 amount;
    }

    // --- Fields ---

    address public immutable router;

    // --- Errors ---

    error UnsuccessfulFill();

    // --- Constructor ---

    constructor(address routerAddress) {
        router = routerAddress;
    }

    // --- Modifiers ---

    modifier refundETHLeftover(address refundTo) {
        _;

        uint256 leftover = address(this).balance;
        if (leftover > 0) {
            _sendETH(refundTo, leftover);
        }
    }

    modifier refundERC20Leftover(address refundTo, IERC20 token) {
        _;

        uint256 leftover = token.balanceOf(address(this));
        if (leftover > 0) {
            token.safeTransfer(refundTo, leftover);
        }
    }

    modifier chargeETHFees(Fee[] calldata fees, uint256 amount) {
        if (fees.length == 0) {
            _;
        } else {
            uint256 balanceBefore = address(this).balance;

            _;

            uint256 length = fees.length;
            if (length > 0) {
                uint256 balanceAfter = address(this).balance;
                uint256 actualPaid = balanceBefore - balanceAfter;

                uint256 actualFee;
                for (uint256 i = 0; i < length; ) {
                    // Adjust the fee to what was actually paid
                    actualFee = (fees[i].amount * actualPaid) / amount;
                    if (actualFee > 0) {
                        _sendETH(fees[i].recipient, actualFee);
                    }

                    unchecked {
                        ++i;
                    }
                }
            }
        }
    }

    modifier chargeERC20Fees(
        Fee[] calldata fees,
        IERC20 token,
        uint256 amount
    ) {
        if (fees.length == 0) {
            _;
        } else {
            uint256 balanceBefore = token.balanceOf(address(this));

            _;

            uint256 length = fees.length;
            if (length > 0) {
                uint256 balanceAfter = token.balanceOf(address(this));
                uint256 actualPaid = balanceBefore - balanceAfter;

                uint256 actualFee;
                for (uint256 i = 0; i < length; ) {
                    // Adjust the fee to what was actually paid
                    actualFee = (fees[i].amount * actualPaid) / amount;
                    if (actualFee > 0) {
                        token.safeTransfer(fees[i].recipient, actualFee);
                    }

                    unchecked {
                        ++i;
                    }
                }
            }
        }
    }

    // --- Helpers ---

    function _sendAllETH(address to) internal {
        _sendETH(to, address(this).balance);
    }

    function _sendAllERC20(address to, IERC20 token) internal {
        uint256 balance = token.balanceOf(address(this));
        if (balance > 0) {
            token.safeTransfer(to, balance);
        }
    }

    function _sendAllERC721(
        address to,
        IERC721 token,
        uint256 tokenId
    ) internal {
        if (token.ownerOf(tokenId) == address(this)) {
            token.safeTransferFrom(address(this), to, tokenId);
        }
    }

    function _sendAllERC1155(
        address to,
        IERC1155 token,
        uint256 tokenId
    ) internal {
        uint256 balance = token.balanceOf(address(this), tokenId);
        if (balance > 0) {
            token.safeTransferFrom(address(this), to, tokenId, balance, "");
        }
    }

    function _approveERC20IfNeeded(
        IERC20 token,
        address spender,
        uint256 amount
    ) internal {
        uint256 allowance = token.allowance(address(this), spender);
        if (allowance < amount) {
            token.approve(spender, amount - allowance);
        }
    }

    function _approveERC721IfNeeded(IERC721 token, address operator) internal {
        bool isApproved = token.isApprovedForAll(address(this), operator);
        if (!isApproved) {
            token.setApprovalForAll(operator, true);
        }
    }

    function _approveERC1155IfNeeded(IERC1155 token, address operator)
        internal
    {
        bool isApproved = token.isApprovedForAll(address(this), operator);
        if (!isApproved) {
            token.setApprovalForAll(operator, true);
        }
    }
}

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

Contract Security Audit

Contract ABI

[{"inputs":[{"internalType":"address","name":"owner","type":"address"},{"internalType":"address","name":"router","type":"address"}],"stateMutability":"nonpayable","type":"constructor"},{"inputs":[],"name":"InvalidParams","type":"error"},{"inputs":[],"name":"Unauthorized","type":"error"},{"inputs":[],"name":"UnsuccessfulCall","type":"error"},{"inputs":[],"name":"UnsuccessfulFill","type":"error"},{"inputs":[],"name":"UnsuccessfulPayment","type":"error"},{"inputs":[],"name":"WrongParams","type":"error"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"target","type":"address"},{"indexed":false,"internalType":"bytes","name":"data","type":"bytes"},{"indexed":false,"internalType":"uint256","name":"value","type":"uint256"}],"name":"CallExecuted","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"previousOwner","type":"address"},{"indexed":true,"internalType":"address","name":"newOwner","type":"address"}],"name":"OwnershipTransferred","type":"event"},{"inputs":[],"name":"EXCHANGE","outputs":[{"internalType":"contract IZeroExV4","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"components":[{"internalType":"uint8","name":"direction","type":"uint8"},{"internalType":"address","name":"maker","type":"address"},{"internalType":"address","name":"taker","type":"address"},{"internalType":"uint256","name":"expiry","type":"uint256"},{"internalType":"uint256","name":"nonce","type":"uint256"},{"internalType":"contract IERC20","name":"erc20Token","type":"address"},{"internalType":"uint256","name":"erc20TokenAmount","type":"uint256"},{"components":[{"internalType":"address","name":"recipient","type":"address"},{"internalType":"uint256","name":"amount","type":"uint256"},{"internalType":"bytes","name":"feeData","type":"bytes"}],"internalType":"struct IZeroExV4.Fee[]","name":"fees","type":"tuple[]"},{"internalType":"contract IERC1155","name":"erc1155Token","type":"address"},{"internalType":"uint256","name":"erc1155TokenId","type":"uint256"},{"components":[{"internalType":"address","name":"propertyValidator","type":"address"},{"internalType":"bytes","name":"propertyData","type":"bytes"}],"internalType":"struct IZeroExV4.Property[]","name":"erc1155TokenProperties","type":"tuple[]"},{"internalType":"uint128","name":"erc1155TokenAmount","type":"uint128"}],"internalType":"struct IZeroExV4.ERC1155Order","name":"order","type":"tuple"},{"components":[{"internalType":"uint8","name":"signatureType","type":"uint8"},{"internalType":"uint8","name":"v","type":"uint8"},{"internalType":"bytes32","name":"r","type":"bytes32"},{"internalType":"bytes32","name":"s","type":"bytes32"}],"internalType":"struct IZeroExV4.Signature","name":"signature","type":"tuple"},{"internalType":"uint128","name":"amount","type":"uint128"},{"components":[{"internalType":"address","name":"fillTo","type":"address"},{"internalType":"address","name":"refundTo","type":"address"},{"internalType":"bool","name":"revertIfIncomplete","type":"bool"}],"internalType":"struct BaseExchangeModule.OfferParams","name":"params","type":"tuple"},{"internalType":"uint256","name":"tokenId","type":"uint256"},{"components":[{"internalType":"address","name":"recipient","type":"address"},{"internalType":"uint256","name":"amount","type":"uint256"}],"internalType":"struct BaseExchangeModule.Fee[]","name":"fees","type":"tuple[]"}],"name":"acceptERC1155Offer","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"components":[{"internalType":"uint8","name":"direction","type":"uint8"},{"internalType":"address","name":"maker","type":"address"},{"internalType":"address","name":"taker","type":"address"},{"internalType":"uint256","name":"expiry","type":"uint256"},{"internalType":"uint256","name":"nonce","type":"uint256"},{"internalType":"contract IERC20","name":"erc20Token","type":"address"},{"internalType":"uint256","name":"erc20TokenAmount","type":"uint256"},{"components":[{"internalType":"address","name":"recipient","type":"address"},{"internalType":"uint256","name":"amount","type":"uint256"},{"internalType":"bytes","name":"feeData","type":"bytes"}],"internalType":"struct IZeroExV4.Fee[]","name":"fees","type":"tuple[]"},{"internalType":"contract IERC1155","name":"erc1155Token","type":"address"},{"internalType":"uint256","name":"erc1155TokenId","type":"uint256"},{"components":[{"internalType":"address","name":"propertyValidator","type":"address"},{"internalType":"bytes","name":"propertyData","type":"bytes"}],"internalType":"struct IZeroExV4.Property[]","name":"erc1155TokenProperties","type":"tuple[]"},{"internalType":"uint128","name":"erc1155TokenAmount","type":"uint128"}],"internalType":"struct IZeroExV4.ERC1155Order","name":"order","type":"tuple"},{"components":[{"internalType":"uint8","name":"signatureType","type":"uint8"},{"internalType":"uint8","name":"v","type":"uint8"},{"internalType":"bytes32","name":"r","type":"bytes32"},{"internalType":"bytes32","name":"s","type":"bytes32"}],"internalType":"struct IZeroExV4.Signature","name":"signature","type":"tuple"},{"internalType":"uint128","name":"amount","type":"uint128"},{"components":[{"internalType":"address","name":"fillTo","type":"address"},{"internalType":"address","name":"refundTo","type":"address"},{"internalType":"bool","name":"revertIfIncomplete","type":"bool"},{"internalType":"contract IERC20","name":"token","type":"address"},{"internalType":"uint256","name":"amount","type":"uint256"}],"internalType":"struct BaseExchangeModule.ERC20ListingParams","name":"params","type":"tuple"},{"components":[{"internalType":"address","name":"recipient","type":"address"},{"internalType":"uint256","name":"amount","type":"uint256"}],"internalType":"struct BaseExchangeModule.Fee[]","name":"fees","type":"tuple[]"}],"name":"acceptERC20ListingERC1155","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[{"components":[{"internalType":"uint8","name":"direction","type":"uint8"},{"internalType":"address","name":"maker","type":"address"},{"internalType":"address","name":"taker","type":"address"},{"internalType":"uint256","name":"expiry","type":"uint256"},{"internalType":"uint256","name":"nonce","type":"uint256"},{"internalType":"contract IERC20","name":"erc20Token","type":"address"},{"internalType":"uint256","name":"erc20TokenAmount","type":"uint256"},{"components":[{"internalType":"address","name":"recipient","type":"address"},{"internalType":"uint256","name":"amount","type":"uint256"},{"internalType":"bytes","name":"feeData","type":"bytes"}],"internalType":"struct IZeroExV4.Fee[]","name":"fees","type":"tuple[]"},{"internalType":"contract IERC721","name":"erc721Token","type":"address"},{"internalType":"uint256","name":"erc721TokenId","type":"uint256"},{"components":[{"internalType":"address","name":"propertyValidator","type":"address"},{"internalType":"bytes","name":"propertyData","type":"bytes"}],"internalType":"struct IZeroExV4.Property[]","name":"erc721TokenProperties","type":"tuple[]"}],"internalType":"struct IZeroExV4.ERC721Order","name":"order","type":"tuple"},{"components":[{"internalType":"uint8","name":"signatureType","type":"uint8"},{"internalType":"uint8","name":"v","type":"uint8"},{"internalType":"bytes32","name":"r","type":"bytes32"},{"internalType":"bytes32","name":"s","type":"bytes32"}],"internalType":"struct IZeroExV4.Signature","name":"signature","type":"tuple"},{"components":[{"internalType":"address","name":"fillTo","type":"address"},{"internalType":"address","name":"refundTo","type":"address"},{"internalType":"bool","name":"revertIfIncomplete","type":"bool"},{"internalType":"contract IERC20","name":"token","type":"address"},{"internalType":"uint256","name":"amount","type":"uint256"}],"internalType":"struct BaseExchangeModule.ERC20ListingParams","name":"params","type":"tuple"},{"components":[{"internalType":"address","name":"recipient","type":"address"},{"internalType":"uint256","name":"amount","type":"uint256"}],"internalType":"struct BaseExchangeModule.Fee[]","name":"fees","type":"tuple[]"}],"name":"acceptERC20ListingERC721","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[{"components":[{"internalType":"uint8","name":"direction","type":"uint8"},{"internalType":"address","name":"maker","type":"address"},{"internalType":"address","name":"taker","type":"address"},{"internalType":"uint256","name":"expiry","type":"uint256"},{"internalType":"uint256","name":"nonce","type":"uint256"},{"internalType":"contract IERC20","name":"erc20Token","type":"address"},{"internalType":"uint256","name":"erc20TokenAmount","type":"uint256"},{"components":[{"internalType":"address","name":"recipient","type":"address"},{"internalType":"uint256","name":"amount","type":"uint256"},{"internalType":"bytes","name":"feeData","type":"bytes"}],"internalType":"struct IZeroExV4.Fee[]","name":"fees","type":"tuple[]"},{"internalType":"contract IERC1155","name":"erc1155Token","type":"address"},{"internalType":"uint256","name":"erc1155TokenId","type":"uint256"},{"components":[{"internalType":"address","name":"propertyValidator","type":"address"},{"internalType":"bytes","name":"propertyData","type":"bytes"}],"internalType":"struct IZeroExV4.Property[]","name":"erc1155TokenProperties","type":"tuple[]"},{"internalType":"uint128","name":"erc1155TokenAmount","type":"uint128"}],"internalType":"struct IZeroExV4.ERC1155Order[]","name":"orders","type":"tuple[]"},{"components":[{"internalType":"uint8","name":"signatureType","type":"uint8"},{"internalType":"uint8","name":"v","type":"uint8"},{"internalType":"bytes32","name":"r","type":"bytes32"},{"internalType":"bytes32","name":"s","type":"bytes32"}],"internalType":"struct IZeroExV4.Signature[]","name":"signatures","type":"tuple[]"},{"internalType":"uint128[]","name":"amounts","type":"uint128[]"},{"components":[{"internalType":"address","name":"fillTo","type":"address"},{"internalType":"address","name":"refundTo","type":"address"},{"internalType":"bool","name":"revertIfIncomplete","type":"bool"},{"internalType":"contract IERC20","name":"token","type":"address"},{"internalType":"uint256","name":"amount","type":"uint256"}],"internalType":"struct BaseExchangeModule.ERC20ListingParams","name":"params","type":"tuple"},{"components":[{"internalType":"address","name":"recipient","type":"address"},{"internalType":"uint256","name":"amount","type":"uint256"}],"internalType":"struct BaseExchangeModule.Fee[]","name":"fees","type":"tuple[]"}],"name":"acceptERC20ListingsERC1155","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[{"components":[{"internalType":"uint8","name":"direction","type":"uint8"},{"internalType":"address","name":"maker","type":"address"},{"internalType":"address","name":"taker","type":"address"},{"internalType":"uint256","name":"expiry","type":"uint256"},{"internalType":"uint256","name":"nonce","type":"uint256"},{"internalType":"contract IERC20","name":"erc20Token","type":"address"},{"internalType":"uint256","name":"erc20TokenAmount","type":"uint256"},{"components":[{"internalType":"address","name":"recipient","type":"address"},{"internalType":"uint256","name":"amount","type":"uint256"},{"internalType":"bytes","name":"feeData","type":"bytes"}],"internalType":"struct IZeroExV4.Fee[]","name":"fees","type":"tuple[]"},{"internalType":"contract IERC721","name":"erc721Token","type":"address"},{"internalType":"uint256","name":"erc721TokenId","type":"uint256"},{"components":[{"internalType":"address","name":"propertyValidator","type":"address"},{"internalType":"bytes","name":"propertyData","type":"bytes"}],"internalType":"struct IZeroExV4.Property[]","name":"erc721TokenProperties","type":"tuple[]"}],"internalType":"struct IZeroExV4.ERC721Order[]","name":"orders","type":"tuple[]"},{"components":[{"internalType":"uint8","name":"signatureType","type":"uint8"},{"internalType":"uint8","name":"v","type":"uint8"},{"internalType":"bytes32","name":"r","type":"bytes32"},{"internalType":"bytes32","name":"s","type":"bytes32"}],"internalType":"struct IZeroExV4.Signature[]","name":"signatures","type":"tuple[]"},{"components":[{"internalType":"address","name":"fillTo","type":"address"},{"internalType":"address","name":"refundTo","type":"address"},{"internalType":"bool","name":"revertIfIncomplete","type":"bool"},{"internalType":"contract IERC20","name":"token","type":"address"},{"internalType":"uint256","name":"amount","type":"uint256"}],"internalType":"struct BaseExchangeModule.ERC20ListingParams","name":"params","type":"tuple"},{"components":[{"internalType":"address","name":"recipient","type":"address"},{"internalType":"uint256","name":"amount","type":"uint256"}],"internalType":"struct BaseExchangeModule.Fee[]","name":"fees","type":"tuple[]"}],"name":"acceptERC20ListingsERC721","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[{"components":[{"internalType":"uint8","name":"direction","type":"uint8"},{"internalType":"address","name":"maker","type":"address"},{"internalType":"address","name":"taker","type":"address"},{"internalType":"uint256","name":"expiry","type":"uint256"},{"internalType":"uint256","name":"nonce","type":"uint256"},{"internalType":"contract IERC20","name":"erc20Token","type":"address"},{"internalType":"uint256","name":"erc20TokenAmount","type":"uint256"},{"components":[{"internalType":"address","name":"recipient","type":"address"},{"internalType":"uint256","name":"amount","type":"uint256"},{"internalType":"bytes","name":"feeData","type":"bytes"}],"internalType":"struct IZeroExV4.Fee[]","name":"fees","type":"tuple[]"},{"internalType":"contract IERC721","name":"erc721Token","type":"address"},{"internalType":"uint256","name":"erc721TokenId","type":"uint256"},{"components":[{"internalType":"address","name":"propertyValidator","type":"address"},{"internalType":"bytes","name":"propertyData","type":"bytes"}],"internalType":"struct IZeroExV4.Property[]","name":"erc721TokenProperties","type":"tuple[]"}],"internalType":"struct IZeroExV4.ERC721Order","name":"order","type":"tuple"},{"components":[{"internalType":"uint8","name":"signatureType","type":"uint8"},{"internalType":"uint8","name":"v","type":"uint8"},{"internalType":"bytes32","name":"r","type":"bytes32"},{"internalType":"bytes32","name":"s","type":"bytes32"}],"internalType":"struct IZeroExV4.Signature","name":"signature","type":"tuple"},{"components":[{"internalType":"address","name":"fillTo","type":"address"},{"internalType":"address","name":"refundTo","type":"address"},{"internalType":"bool","name":"revertIfIncomplete","type":"bool"}],"internalType":"struct BaseExchangeModule.OfferParams","name":"params","type":"tuple"},{"internalType":"uint256","name":"tokenId","type":"uint256"},{"components":[{"internalType":"address","name":"recipient","type":"address"},{"internalType":"uint256","name":"amount","type":"uint256"}],"internalType":"struct BaseExchangeModule.Fee[]","name":"fees","type":"tuple[]"}],"name":"acceptERC721Offer","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"components":[{"internalType":"uint8","name":"direction","type":"uint8"},{"internalType":"address","name":"maker","type":"address"},{"internalType":"address","name":"taker","type":"address"},{"internalType":"uint256","name":"expiry","type":"uint256"},{"internalType":"uint256","name":"nonce","type":"uint256"},{"internalType":"contract IERC20","name":"erc20Token","type":"address"},{"internalType":"uint256","name":"erc20TokenAmount","type":"uint256"},{"components":[{"internalType":"address","name":"recipient","type":"address"},{"internalType":"uint256","name":"amount","type":"uint256"},{"internalType":"bytes","name":"feeData","type":"bytes"}],"internalType":"struct IZeroExV4.Fee[]","name":"fees","type":"tuple[]"},{"internalType":"contract IERC1155","name":"erc1155Token","type":"address"},{"internalType":"uint256","name":"erc1155TokenId","type":"uint256"},{"components":[{"internalType":"address","name":"propertyValidator","type":"address"},{"internalType":"bytes","name":"propertyData","type":"bytes"}],"internalType":"struct IZeroExV4.Property[]","name":"erc1155TokenProperties","type":"tuple[]"},{"internalType":"uint128","name":"erc1155TokenAmount","type":"uint128"}],"internalType":"struct IZeroExV4.ERC1155Order","name":"order","type":"tuple"},{"components":[{"internalType":"uint8","name":"signatureType","type":"uint8"},{"internalType":"uint8","name":"v","type":"uint8"},{"internalType":"bytes32","name":"r","type":"bytes32"},{"internalType":"bytes32","name":"s","type":"bytes32"}],"internalType":"struct IZeroExV4.Signature","name":"signature","type":"tuple"},{"internalType":"uint128","name":"amount","type":"uint128"},{"components":[{"internalType":"address","name":"fillTo","type":"address"},{"internalType":"address","name":"refundTo","type":"address"},{"internalType":"bool","name":"revertIfIncomplete","type":"bool"},{"internalType":"uint256","name":"amount","type":"uint256"}],"internalType":"struct BaseExchangeModule.ETHListingParams","name":"params","type":"tuple"},{"components":[{"internalType":"address","name":"recipient","type":"address"},{"internalType":"uint256","name":"amount","type":"uint256"}],"internalType":"struct BaseExchangeModule.Fee[]","name":"fees","type":"tuple[]"}],"name":"acceptETHListingERC1155","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[{"components":[{"internalType":"uint8","name":"direction","type":"uint8"},{"internalType":"address","name":"maker","type":"address"},{"internalType":"address","name":"taker","type":"address"},{"internalType":"uint256","name":"expiry","type":"uint256"},{"internalType":"uint256","name":"nonce","type":"uint256"},{"internalType":"contract IERC20","name":"erc20Token","type":"address"},{"internalType":"uint256","name":"erc20TokenAmount","type":"uint256"},{"components":[{"internalType":"address","name":"recipient","type":"address"},{"internalType":"uint256","name":"amount","type":"uint256"},{"internalType":"bytes","name":"feeData","type":"bytes"}],"internalType":"struct IZeroExV4.Fee[]","name":"fees","type":"tuple[]"},{"internalType":"contract IERC721","name":"erc721Token","type":"address"},{"internalType":"uint256","name":"erc721TokenId","type":"uint256"},{"components":[{"internalType":"address","name":"propertyValidator","type":"address"},{"internalType":"bytes","name":"propertyData","type":"bytes"}],"internalType":"struct IZeroExV4.Property[]","name":"erc721TokenProperties","type":"tuple[]"}],"internalType":"struct IZeroExV4.ERC721Order","name":"order","type":"tuple"},{"components":[{"internalType":"uint8","name":"signatureType","type":"uint8"},{"internalType":"uint8","name":"v","type":"uint8"},{"internalType":"bytes32","name":"r","type":"bytes32"},{"internalType":"bytes32","name":"s","type":"bytes32"}],"internalType":"struct IZeroExV4.Signature","name":"signature","type":"tuple"},{"components":[{"internalType":"address","name":"fillTo","type":"address"},{"internalType":"address","name":"refundTo","type":"address"},{"internalType":"bool","name":"revertIfIncomplete","type":"bool"},{"internalType":"uint256","name":"amount","type":"uint256"}],"internalType":"struct BaseExchangeModule.ETHListingParams","name":"params","type":"tuple"},{"components":[{"internalType":"address","name":"recipient","type":"address"},{"internalType":"uint256","name":"amount","type":"uint256"}],"internalType":"struct BaseExchangeModule.Fee[]","name":"fees","type":"tuple[]"}],"name":"acceptETHListingERC721","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[{"components":[{"internalType":"uint8","name":"direction","type":"uint8"},{"internalType":"address","name":"maker","type":"address"},{"internalType":"address","name":"taker","type":"address"},{"internalType":"uint256","name":"expiry","type":"uint256"},{"internalType":"uint256","name":"nonce","type":"uint256"},{"internalType":"contract IERC20","name":"erc20Token","type":"address"},{"internalType":"uint256","name":"erc20TokenAmount","type":"uint256"},{"components":[{"internalType":"address","name":"recipient","type":"address"},{"internalType":"uint256","name":"amount","type":"uint256"},{"internalType":"bytes","name":"feeData","type":"bytes"}],"internalType":"struct IZeroExV4.Fee[]","name":"fees","type":"tuple[]"},{"internalType":"contract IERC1155","name":"erc1155Token","type":"address"},{"internalType":"uint256","name":"erc1155TokenId","type":"uint256"},{"components":[{"internalType":"address","name":"propertyValidator","type":"address"},{"internalType":"bytes","name":"propertyData","type":"bytes"}],"internalType":"struct IZeroExV4.Property[]","name":"erc1155TokenProperties","type":"tuple[]"},{"internalType":"uint128","name":"erc1155TokenAmount","type":"uint128"}],"internalType":"struct IZeroExV4.ERC1155Order[]","name":"orders","type":"tuple[]"},{"components":[{"internalType":"uint8","name":"signatureType","type":"uint8"},{"internalType":"uint8","name":"v","type":"uint8"},{"internalType":"bytes32","name":"r","type":"bytes32"},{"internalType":"bytes32","name":"s","type":"bytes32"}],"internalType":"struct IZeroExV4.Signature[]","name":"signatures","type":"tuple[]"},{"internalType":"uint128[]","name":"amounts","type":"uint128[]"},{"components":[{"internalType":"address","name":"fillTo","type":"address"},{"internalType":"address","name":"refundTo","type":"address"},{"internalType":"bool","name":"revertIfIncomplete","type":"bool"},{"internalType":"uint256","name":"amount","type":"uint256"}],"internalType":"struct BaseExchangeModule.ETHListingParams","name":"params","type":"tuple"},{"components":[{"internalType":"address","name":"recipient","type":"address"},{"internalType":"uint256","name":"amount","type":"uint256"}],"internalType":"struct BaseExchangeModule.Fee[]","name":"fees","type":"tuple[]"}],"name":"acceptETHListingsERC1155","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[{"components":[{"internalType":"uint8","name":"direction","type":"uint8"},{"internalType":"address","name":"maker","type":"address"},{"internalType":"address","name":"taker","type":"address"},{"internalType":"uint256","name":"expiry","type":"uint256"},{"internalType":"uint256","name":"nonce","type":"uint256"},{"internalType":"contract IERC20","name":"erc20Token","type":"address"},{"internalType":"uint256","name":"erc20TokenAmount","type":"uint256"},{"components":[{"internalType":"address","name":"recipient","type":"address"},{"internalType":"uint256","name":"amount","type":"uint256"},{"internalType":"bytes","name":"feeData","type":"bytes"}],"internalType":"struct IZeroExV4.Fee[]","name":"fees","type":"tuple[]"},{"internalType":"contract IERC721","name":"erc721Token","type":"address"},{"internalType":"uint256","name":"erc721TokenId","type":"uint256"},{"components":[{"internalType":"address","name":"propertyValidator","type":"address"},{"internalType":"bytes","name":"propertyData","type":"bytes"}],"internalType":"struct IZeroExV4.Property[]","name":"erc721TokenProperties","type":"tuple[]"}],"internalType":"struct IZeroExV4.ERC721Order[]","name":"orders","type":"tuple[]"},{"components":[{"internalType":"uint8","name":"signatureType","type":"uint8"},{"internalType":"uint8","name":"v","type":"uint8"},{"internalType":"bytes32","name":"r","type":"bytes32"},{"internalType":"bytes32","name":"s","type":"bytes32"}],"internalType":"struct IZeroExV4.Signature[]","name":"signatures","type":"tuple[]"},{"components":[{"internalType":"address","name":"fillTo","type":"address"},{"internalType":"address","name":"refundTo","type":"address"},{"internalType":"bool","name":"revertIfIncomplete","type":"bool"},{"internalType":"uint256","name":"amount","type":"uint256"}],"internalType":"struct BaseExchangeModule.ETHListingParams","name":"params","type":"tuple"},{"components":[{"internalType":"address","name":"recipient","type":"address"},{"internalType":"uint256","name":"amount","type":"uint256"}],"internalType":"struct BaseExchangeModule.Fee[]","name":"fees","type":"tuple[]"}],"name":"acceptETHListingsERC721","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[],"name":"claimOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address[]","name":"targets","type":"address[]"},{"internalType":"bytes[]","name":"data","type":"bytes[]"},{"internalType":"uint256[]","name":"values","type":"uint256[]"}],"name":"makeCalls","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":"data","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":"data","type":"bytes"}],"name":"onERC721Received","outputs":[{"internalType":"bytes4","name":"","type":"bytes4"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"owner","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"pendingOwner","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"router","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"newOwner","type":"address"}],"name":"transferOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"stateMutability":"payable","type":"receive"}]

60a034620000c657601f620035fa38819003918201601f19168301916001600160401b03831184841017620000cb578084926040948552833981010312620000c6576200005a60206200005283620000e1565b9201620000e1565b600080546001600160a01b0319166001600160a01b03909316928317815560405192907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e08180a360016002556080526135039081620000f7823960805181818161054101526106370152f35b600080fd5b634e487b7160e01b600052604160045260246000fd5b51906001600160a01b0382168203620000c65756fe608080604052600436101561001d575b50361561001b57600080fd5b005b600090813560e01c90816312f3a43f1461178e57508063150b7a021461171d5780631b317906146115e957806346a25cbe146113655780634e71e0c8146113005780636a3a0594146110325780637b87ffa314610f2457806389d0604014610c2f5780638da5cb5b14610c08578063b50e44b814610bdf578063c6ed9b55146109a7578063de90447b1461088e578063e30c397814610865578063ecc7271d14610662578063f23a6e61146105cb578063f2fde38b14610570578063f887ea401461052b578063fd1ae9c8146102585763fff10c460361000f5760031961016036820112610254576004356001600160401b039182821161024c57610180908260040192360301126102505760803660231901126102505761013d611a4a565b9160803660c319011261024c576101443590811161024c57610163903690600401611ada565b919092610174600280541415611b0a565b60028055610180611ba8565b936101243593806101ca575050906101aa929161019b611bbe565b906101a4611d97565b92612932565b47806101ba575b82600160025580f35b6101c391611dc5565b38806101b1565b916101de856101e59395479361019b611bbe565b4790611d22565b92855b8281106101f95750505050506101aa565b8061021d836102188860206102116001978a8c611d45565b0135611d55565b611d68565b8061022a575b50016101e8565b6102469061024161023c84888a611d45565b611c00565b611dc5565b38610223565b8380fd5b8280fd5b5080fd5b50610100366003190112610528576001600160401b036004358181116102505761028690369060040161191c565b906024358381116105245761029f9036906004016119b9565b91909360a06043193601126105205760e435908111610520576102c6903690600401611ada565b9390946102d7600280541415611b0a565b600280556102e3611b92565b946102ec611bd4565b966102f5611bd4565b60c43592806103c6575050509061031761032e9592610312611bd4565b61203d565b61031f611bea565b92610328611db6565b94612b7d565b6040516370a0823160e01b8152306004820152906020826024816001600160a01b0387165afa9182156103bb578492610383575b5081610372575b83600160025580f35b61037b92611e32565b388080610369565b9091506020813d82116103b3575b8161039e60209383611a12565b810103126103ae57519038610362565b600080fd5b3d9150610391565b6040513d86823e3d90fd5b6040516370a0823160e01b8082523060048301526020999498939792966001600160a01b03891695909492938e93918c866024818b5afa958615610515578d95966104de575b50610420939495966103178a610312611bd4565b60246040518095819382523060048301525afa9081156104d3578a916104a2575b61044b9250611d22565b885b838110610460575050505050505061032e565b8061047784610218858b6102116001978b8e611d45565b80610484575b500161044d565b61049c9061049661023c84898c611d45565b88611e32565b3861047d565b90508682813d83116104cc575b6104b98183611a12565b810103126103ae5761044b915190610441565b503d6104af565b6040513d8c823e3d90fd5b858195969297503d831161050e575b6104f78183611a12565b810103126103ae578b94610420935195949361040c565b503d6104ed565b6040513d87823e3d90fd5b8580fd5b8480fd5b80fd5b50346105285780600319360112610528576040517f00000000000000000000000000000000000000000000000000000000000000006001600160a01b03168152602090f35b50346105285760203660031901126105285761058a61194c565b81546001600160a01b039190821633036105ba57166bffffffffffffffffffffffff60a01b600154161760015580f35b6040516282b42960e81b8152600490fd5b50346105285760a0366003190112610528576105e561194c565b506105ee611962565b506084356001600160401b0381116102545761060e90369060040161198c565b80610626575b60405163f23a6e6160e01b8152602090f35b61065b91610635913691611c70565b7f0000000000000000000000000000000000000000000000000000000000000000611cf8565b8080610614565b50610160600319818136011261025057600435916001600160401b0391828411610524578360040193360301126102505760803660231901126102505760a03660a31901126102505761014435908111610250576106c4903690600401611ada565b90916106d4600280541415611b0a565b600280556106e0611bbe565b916106e9611e1b565b936106f2611e1b565b610124359280610725575050509061070f61032e92610312611e1b565b610717611bd4565b61071f611da7565b91612796565b6040516370a0823160e01b808252306004830152602096949593949293926001600160a01b0386169290918882602481875afa92831561085a5789928d94610826575b506107799061070f87610312611e1b565b60246040518095819382523060048301525afa9081156104d3578a916107f5575b6107a49250611d22565b885b8381106107b9575050505050505061032e565b806107d084610218858b6102116001978b8e611d45565b806107dd575b50016107a6565b6107ef9061049661023c84898c611d45565b386107d6565b90508682813d831161081f575b61080c8183611a12565b810103126103ae576107a491519061079a565b503d610802565b8381949295503d8311610853575b61083e8183611a12565b810103126103ae576107798992519390610768565b503d610834565b6040513d8e823e3d90fd5b50346105285780600319360112610528576001546040516001600160a01b039091168152602090f35b5060e0366003190112610528576001600160401b03600435818111610250576108bb90369060040161191c565b90602435838111610524576108d49036906004016119b9565b91909360806043193601126105205760c435908111610520576108fb903690600401611ada565b93909261090c600280541415611b0a565b60028055610918611b92565b9560a435948661093f57506101aa9550610930611bea565b92610939611db6565b94612d7f565b94809694610956946101de93944795610930611bea565b92855b82811061096a5750505050506101aa565b80610982836102188860206102116001978a8c611d45565b8061098f575b5001610959565b6109a19061024161023c84888a611d45565b38610988565b50610120366003190112610528576001600160401b03600435818111610250576109d590369060040161191c565b9091602435818111610524576109ef9036906004016119b9565b939092604435838111610bdb57610a0a903690600401611a74565b9260a0366063190112610bdb5761010435908111610bdb57610a30903690600401611ada565b939095610a41600280541415611b0a565b60028055610a4d611b7c565b95610a56611bbe565b97610a5f611bbe565b60e43591908b89610a955750505061032e9650610a7e90610312611bbe565b610a86611b92565b93610a8f611d88565b95612f71565b90969197939294989560018060a01b03881694604051936370a0823160e01b9283865230600487015260209c8d876024818c5afa968715610bd0578e9697610b99575b50610aec94959697610a7e8b610312611bbe565b60246040518095819382523060048301525afa9081156104d3578a91610b68575b610b179250611d22565b885b838110610b2c575050505050505061032e565b80610b4384610218858b6102116001978b8e611d45565b80610b50575b5001610b19565b610b629061049661023c84898c611d45565b38610b49565b90508682813d8311610b92575b610b7f8183611a12565b810103126103ae57610b17915190610b0d565b503d610b75565b868196979298503d8311610bc9575b610bb28183611a12565b810103126103ae578c95610aec9451969594610ad8565b503d610ba8565b6040513d88823e3d90fd5b8680fd5b503461052857806003193601126105285760206040516000805160206134ae8339815191528152f35b5034610528578060031936011261052857546040516001600160a01b039091168152602090f35b503461052857610140366003190112610528576001600160401b03806004351161025457610160600435360360031901126102545760803660231901126102545760603660a3190112610254576101243590811161025457610c95903690600401611ada565b90610ca4600280541415611b0a565b6002805561010491610cc1610cbc8460043501611c00565b6124c8565b6000805160206134ae8339815191523b1561024c57604051632bf786cf60e21b81526101006004820152848082602081610d02898201600435600401612300565b610d0e602483016123d5565b893560a48301528460c48301526003198282030160e4830152848152030181836000805160206134ae8339815191525af19182610f10575b5050610e81575050610d56611da7565b610e6f5781905b610d65611bbe565b6001600160a01b03919082610d7d6004358401611c00565b6040516331a9108f60e11b815284356004820152911693602082602481885afa918215610bd0578692610e32575b50163014610dbc5783600160025580f35b823b15610e2d57604051632142170760e11b81523060048201526001600160a01b03919091166024820152903560448201529082908290606490829084905af18015610e2257610e0e575b8080610369565b610e17906119e9565b610528578038610e07565b6040513d84823e3d90fd5b505050fd5b9091506020813d602011610e67575b81610e4e60209383611a12565b8101031261052057518181168103610520579038610dab565b3d9150610e41565b604051631298f31b60e11b8152600490fd5b83929160043560a40191845b818110610eb757505050610eb290610eac610ea6611bd4565b91611c00565b9061244a565b610d5d565b8293949550610ed2610ecd828460019596611d45565b61240a565b6020838060a01b03825116910151610ee987611c00565b9181610eff575b50505001919085949392610e8d565b610f0892611e32565b388080610ef0565b610f19906119e9565b610524578438610d46565b506003196101403682011261025457600435906001600160401b039081831161024c57610160908360040193360301126102505760803660231901126102505760803660a3190112610250576101243590811161025057610f89903690600401611ada565b9091610f99600280541415611b0a565b60028055610fa5611bbe565b92610104359280610fcd575050906101aa91610fbf611bd4565b610fc7611da7565b9161268b565b9091610fe1906101de854792610fbf611bd4565b92855b828110610ff55750505050506101aa565b8061100d836102188860206102116001978a8c611d45565b8061101a575b5001610fe4565b61102c9061024161023c84888a611d45565b38611013565b5034610528576003196101603682011261025457600435906001600160401b039081831161024c5761018081843603011261024c57608036602319011261024c5761107b611a4a565b60603660c3190112610524576101249384359361014435908111610bdb576110a7903690600401611ada565b90926110b7600280541415611b0a565b600280558761010497888501986110d0610cbc8b611c00565b6000805160206134ae83398151915290813b1561024c576111189484916001600160801b03604051978896633717764f60e11b8852610120600489015287018b60040161259e565b92611125602488016123d5565b8d60a48801521660c48601528260e48601528482039a8b01908501525281836020809a01925af190816112ed575b5061127657505050611163611d97565b610e6f5761118884935b611175611ba8565b6001600160a01b03929091839190611c00565b604051627eeac760e11b815230600482015260248101879052911691908481604481865afa94851561126b578795611238575b5050836111cc575b85600160025580f35b813b15610520578560c49281956040519788968795637921219560e11b87523060048801521660248601526044850152606484015260a060848401528160a48401525af18015610e2257611224575b808080806111c3565b61122d906119e9565b61052857803861121b565b819750809295503d8311611264575b6112518183611a12565b810103126103ae578594519238806111bb565b503d611247565b6040513d89823e3d90fd5b94959460a49091019190855b8181106112a55750505083946112a061118892610eac610ea6611bbe565b61116d565b806112b6610ecd6001938587611d45565b86838060a01b038251169101516112cc87611c00565b91816112dc575b50505001611282565b6112e592611e32565b3880806112d3565b6112f9909891986119e9565b9638611153565b50346105285780600319360112610528576001546001600160a01b03811690338290036105ba5782546001600160a01b03199081168317845516600155807f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e08380a380f35b50610180600319818136011261025057600435916001600160401b039182841161052457836004019336030112610250576080366023190112610250576113aa611a4a565b9060a03660c319011261024c576101643590811161024c576113d0903690600401611ada565b9190926113e1600280541415611b0a565b600280556113ed611ba8565b926113f6611e04565b946113ff611e04565b6101443592806114a8575050509161141c61143393610312611e04565b611424611bbe565b9061142d611d97565b92612849565b6040516370a0823160e01b8152306004820152906020826024816001600160a01b0387165afa9182156103bb5784926114755750816103725783600160025580f35b9091506020813d82116114a0575b8161149060209383611a12565b8101031261024c57519038610362565b3d9150611483565b6040516370a0823160e01b80825230600483015260209794969395929492936001600160a01b038716938c9291908a85602481895afa9485156103bb578b94956115b0575b50906114ff9161141c88610312611e04565b60246040518095819382523060048301525afa9081156104d3578a9161157b575b61152a9250611d22565b885b83811061153f5750505050505050611433565b8061155684610218858b6102116001978b8e611d45565b80611563575b500161152c565b6115759061049661023c84898c611d45565b3861155c565b90508682813d83116115a9575b6115928183611a12565b810103126115a55761152a915190611520565b8980fd5b503d611588565b848193959296503d83116115e2575b6115c98183611a12565b810103126115de5751928992906114ff6114ed565b8c80fd5b503d6115bf565b50610100366003190112610528576001600160401b036004358181116102505761161790369060040161191c565b91602435818111610524576116309036906004016119b9565b929093604435838111610bdb5761164b903690600401611a74565b926080366063190112610bdb5760e435908111610bdb57611670903690600401611ada565b939094611681600280541415611b0a565b6002805561168d611b7c565b9660c43595806116b457506101aa96506116a5611b92565b936116ae611d88565b95613211565b946116cc9487989792946101de9447966116a5611b92565b92855b8281106116e05750505050506101aa565b806116f8836102188860206102116001978a8c611d45565b80611705575b50016116cf565b6117179061024161023c84888a611d45565b386116fe565b50346105285760803660031901126105285761173761194c565b50611740611962565b506064356001600160401b0381116102545761176090369060040161198c565b80611778575b604051630a85bd0160e11b8152602090f35b61178791610635913691611c70565b8080611766565b9050606080600319360112610250576001600160401b0391600435838111610524576117be90369060040161191c565b919093602435818111610bdb576117d990369060040161191c565b9091604435908111611918576117f390369060040161191c565b88546001600160a01b0395908616330361190a5750611816600280541415611b0a565b60028055885b86811061182c5789600160025580f35b61183a61023c82898c611b56565b908a8061186161184b84898b611c14565b919061185886898b611b56565b35923691611c70565b948551918b602080980192165af1611877611cc8565b50156118f8577fa3f06cf374cf66be06f5fe85cdd3b13d9d9fdef6482f640d2de1d44c3ed7332c87876001946118e9888f8f8f6118d38a8f818f96916118c561023c8389986118cb96611b56565b9b611c14565b959096611b56565b3595604051988998168852870152850191611ca7565b9060408301520390a10161181c565b6040516322092f2f60e11b8152600490fd5b6282b42960e81b8152600490fd5b8780fd5b9181601f840112156103ae578235916001600160401b0383116103ae576020808501948460051b0101116103ae57565b600435906001600160a01b03821682036103ae57565b602435906001600160a01b03821682036103ae57565b35906001600160a01b03821682036103ae57565b9181601f840112156103ae578235916001600160401b0383116103ae57602083818601950101116103ae57565b9181601f840112156103ae578235916001600160401b0383116103ae576020808501948460071b0101116103ae57565b6001600160401b0381116119fc57604052565b634e487b7160e01b600052604160045260246000fd5b90601f801991011681019081106001600160401b038211176119fc57604052565b6001600160401b0381116119fc5760051b60200190565b60a435906001600160801b03821682036103ae57565b35906001600160801b03821682036103ae57565b81601f820112156103ae57803591611a8b83611a33565b92611a996040519485611a12565b808452602092838086019260051b8201019283116103ae578301905b828210611ac3575050505090565b838091611acf84611a60565b815201910190611ab5565b9181601f840112156103ae578235916001600160401b0383116103ae576020808501948460061b0101116103ae57565b15611b1157565b60405162461bcd60e51b815260206004820152601f60248201527f5265656e7472616e637947756172643a207265656e7472616e742063616c6c006044820152606490fd5b9190811015611b665760051b0190565b634e487b7160e01b600052603260045260246000fd5b6084356001600160a01b03811681036103ae5790565b6064356001600160a01b03811681036103ae5790565b60e4356001600160a01b03811681036103ae5790565b60c4356001600160a01b03811681036103ae5790565b60a4356001600160a01b03811681036103ae5790565b6044356001600160a01b03811681036103ae5790565b356001600160a01b03811681036103ae5790565b9190811015611b665760051b81013590601e19813603018212156103ae5701908135916001600160401b0383116103ae5760200182360381136103ae579190565b6001600160401b0381116119fc57601f01601f191660200190565b929192611c7c82611c55565b91611c8a6040519384611a12565b8294818452818301116103ae578281602093846000960137010152565b908060209392818452848401376000828201840152601f01601f1916010190565b3d15611cf3573d90611cd982611c55565b91611ce76040519384611a12565b82523d6000602084013e565b606090565b8151600092839260209091019083906001600160a01b03165af1611d1a611cc8565b50156118f857565b91908203918211611d2f57565b634e487b7160e01b600052601160045260246000fd5b9190811015611b665760061b0190565b81810292918115918404141715611d2f57565b8115611d72570490565b634e487b7160e01b600052601260045260246000fd5b60a43580151581036103ae5790565b6101043580151581036103ae5790565b60e43580151581036103ae5790565b60843580151581036103ae5790565b81611dce575050565b6000918291829182916001600160a01b03165af1611dea611cc8565b5015611df257565b60405163d2dcf4f360e01b8152600490fd5b610124356001600160a01b03811681036103ae5790565b610104356001600160a01b03811681036103ae5790565b6040805163a9059cbb60e01b60208083019182526001600160a01b039590951660248301526044808301969096529481529293909291611e73606484611a12565b60018060a01b0316908351928484018481106001600160401b038211176119fc5785528584527f5361666545524332303a206c6f772d6c6576656c2063616c6c206661696c656486850152823b15611f6857611ee2939260009283809351925af1611edc611cc8565b90611ff9565b805180611ef0575b50505050565b818491810103126103ae5782611f069101611fac565b15611f12578080611eea565b60849250519062461bcd60e51b82526004820152602a60248201527f5361666545524332303a204552433230206f7065726174696f6e20646964206e6044820152691bdd081cdd58d8d9595960b21b6064820152fd5b845162461bcd60e51b815260048101879052601d60248201527f416464726573733a2063616c6c20746f206e6f6e2d636f6e74726163740000006044820152606490fd5b519081151582036103ae57565b919082519283825260005b848110611fe5575050826000602080949584010152601f8019910116010190565b602081830181015184830182015201611fc4565b90919015612005575090565b8151156120155750805190602001fd5b60405162461bcd60e51b815260206004820152908190612039906024830190611fb9565b0390fd5b604051636eb1769f60e11b81523060048201526000805160206134ae833981519152602482018190526001600160a01b03929092169260209290918381604481885afa90811561211457600091612120575b5082811061209f575b5050505050565b6120ac6044918594611d22565b916000604051968794859363095ea7b360e01b8552600485015260248401525af18015612114576120e0575b808080612098565b81813d831161210d575b6120f48183611a12565b810103126103ae5761210590611fac565b5038806120d8565b503d6120ea565b6040513d6000823e3d90fd5b908482813d8311612146575b6121368183611a12565b810103126105285750513861208f565b503d61212c565b359060ff821682036103ae57565b9035601e19823603018112156103ae5701602081359101916001600160401b0382116103ae578160051b360383136103ae57565b9035601e19823603018112156103ae5701602081359101916001600160401b0382116103ae5781360383136103ae57565b90918092808252602080920191808260051b8601019484600080925b8584106121ee57505050505050505090565b9091929394959697601f198282030188528835605e198536030181121561024c57600191879182916122589188016001600160a01b0361222d82611978565b16825283810135848301526122476040918281019061218f565b919092606080928201520191611ca7565b9a019801969594019291906121dc565b909182815260208091019283918160051b85019484600080925b85841061229457505050505050505090565b909192939495969781810388528835603e198536030181121561024c57600191879182916122f0916122df9089016001600160a01b036122d382611978565b1683528481019061218f565b909160409081868201520191611ca7565b9a01980196959401929190612282565b60ff61230b8261214d565b1682526001600160a01b03918261232460208401611978565b1660208201528261233760408401611978565b16604082015260608201356060820152608082013560808201528261235e60a08401611978565b1660a082015260c082013560c082015261238f61237e60e084018461215b565b6101608060e08601528401916121c0565b9161010093848201359081168091036103ae576123d29483015261012080820135908301526123c4610140918281019061215b565b929091818503910152612268565b90565b60243560ff81168091036103ae57815260443560ff81168091036103ae57602082015260643560408201526060608435910152565b6040813603126103ae576040519060408201908282106001600160401b038311176119fc5760209160405261243e81611978565b83520135602082015290565b6040516370a0823160e01b8152306004820152906020826024816001600160a01b0387165afa91821561211457600092612495575b508161248a57505050565b61249392611e32565b565b90916020823d82116124c0575b816124af60209383611a12565b81010312610528575051903861247f565b3d91506124a2565b60405163e985e9c560e01b81523060048201526000805160206134ae833981519152602482018190526001600160a01b03929092169190602081604481865afa90811561211457600091612565575b5015612521575050565b813b156103ae5760009160448392604051948593849263a22cb46560e01b84526004840152600160248401525af180156121145761255c5750565b612493906119e9565b906020823d8211612596575b8161257e60209383611a12565b81010312610528575061259090611fac565b38612517565b3d9150612571565b9060ff6125aa8361214d565b1681526001600160a01b03806125c260208501611978565b166020830152806125d560408501611978565b1660408301526060830135606083015260808301356080830152806125fc60a08501611978565b1660a083015260c083013560c083015261262d61261c60e085018561215b565b6101808060e08701528501916121c0565b61010091828501359081168091036103ae5761266d9284015261012080850135908401526101406126608186018661215b565b9185840390860152612268565b916001600160801b03612684610160809301611a60565b1691015290565b9291926000805160206134ae833981519152803b156103ae576040519384809263fbee349d60e01b8252600096879360c0600483015260206126d060c4840189612300565b6126dc602485016123d5565b8684820391600319830160a48701525201925af19081612783575b5061270557505050610e6f57565b919250906001600160a01b0361271e6101008301611c00565b1690813b1561024c57604051632142170760e11b81523060048201526001600160a01b0390931660248401526101200135604483015282908290818381606481015b03925af18015610e2257612772575050565b61277c82916119e9565b6105285750565b61278f909491946119e9565b92386126f7565b906000916000805160206134ae833981519152803b1561024c5783604051809263fbee349d60e01b825260c06004830152818360206127d860c4840189612300565b6127e4602485016123d5565b8284820391600319830160a48701525201925af19081612783575061270557505050610e6f57565b9260c094916001600160801b039360018060a01b038092168652166020850152604084015216606082015260a06080820152600060a08201520190565b916000926000805160206134ae833981519152803b1561052457846040518092630f9b6a9b60e31b825260e060048301528183602061288b60e484018961259e565b612897602485016123d5565b6001600160801b038b1660a48501528284820391600319830160c48701525201925af1908161291f575b506128d05750505050610e6f57565b92935090916001600160a01b036128ea6101008301611c00565b1690813b1561052457906101208580949361276060405197889687958694637921219560e11b8652013590306004860161280c565b61292b909591956119e9565b93386128c1565b9392939190916000805160206134ae833981519152803b156103ae5760405194858092630f9b6a9b60e31b8252600097889360e06004830152602061297a60e484018961259e565b612986602485016123d5565b6001600160801b038b1660a48501528684820391600319830160c48701525201925af1908161291f57506128d05750505050610e6f57565b906129c882611a33565b6129d56040519182611a12565b82815280926129e6601f1991611a33565b019060005b8281106129f757505050565b8060606020809385010152016129eb565b60209081818403126103ae578051906001600160401b0382116103ae57019180601f840112156103ae578251612a3d81611a33565b93612a4b6040519586611a12565b818552838086019260051b8201019283116103ae578301905b828210612a72575050505090565b838091612a7e84611fac565b815201910190612a64565b9190808252602080920192916000905b828210612aa7575050505090565b9091929360019060ff80612aba8861214d565b168252612ac884880161214d565b168184015260408681013590820152606080870135908201526080908101950193920190612a99565b90815180825260208092019182818360051b82019501936000915b848310612b1c5750505050505090565b9091929394958480612b3683856001950387528a51611fb9565b9801930193019194939290612b0c565b8051821015611b665760209160051b010190565b9190811015611b665760051b8101359061015e19813603018212156103ae570190565b94929493909193612b8d836129be565b926040958651809563eae93ee760e01b825260848201998460049b60808d8601525260a483019060a48660051b8501019187906000905b888210612d3d57505050938392612bee612bfd936000976003199485888403016024890152612a89565b91848303016044850152612af1565b88151560648301520381836000805160206134ae8339815191525af160009481612d1a575b50612c405750505050612c33575050565b51631298f31b60e11b8152fd5b909193506000959294955b818110612c5b5750505050505050565b612c658187612b46565b51612c73575b600101612c4b565b6001600160a01b03612c92610100612c8c848688612b5a565b01611c00565b16610120612ca1838587612b5a565b013590803b156103ae578851632142170760e11b8152308782019081526001600160a01b0389166020820152604081019390935291600091839182908490829060600103925af18015612d0f579060019291612d00575b509050612c6b565b612d09906119e9565b38612cf8565b88513d6000823e3d90fd5b612d3691953d8091833e612d2e8183611a12565b810190612a08565b9338612c22565b91949550919260a3198b8203018252843561015e198a3603018112156103ae576001918a612d6b9201612300565b946020809101920192018a95949392612bc4565b9060809695949295612d90826129be565b94604097885196879263eae93ee760e01b8452856084850160049d8e8701525260a484019060a48760051b8601019188906000905b898210612f0a57505050600095938593612bee8594612df1946003199485888403016024890152612a89565b8a1515606483015203916000805160206134ae8339815191525af160009481612eef575b50612e265750505050612c33575050565b909193506000959294955b818110612e415750505050505050565b612e4b8187612b46565b51612e59575b600101612e31565b6001600160a01b03612e72610100612c8c848688612b5a565b16610120612e81838587612b5a565b013590803b156103ae578851632142170760e11b8152308782019081526001600160a01b0389166020820152604081019390935291600091839182908490829060600103925af18015612d0f579060019291612ee0575b509050612e51565b612ee9906119e9565b38612ed8565b612f0391953d8091833e612d2e8183611a12565b9338612e15565b9194959650919260a3198c8203018252843561015e198b3603018112156103ae576001918b612f399201612300565b946020809101920192018b9695949392612dc5565b9190811015611b665760051b8101359061017e19813603018212156103ae570190565b959394919295612f8082611a33565b91604096612f9088519485611a12565b818452612f9c82611a33565b6020858101929091601f190136843760005b8481106131df575050612fc0836129be565b8951978892638468061560e01b845260a484019c8660049e8f870160a090525260c48501908760051b860160c40191899060005b8a81106131985750505090613016916003199485888403016024890152612a89565b828582030160448601528189519182815201959160005b828110613178575050505083839261304f928460009703016064850152612af1565b89151560848301520381836000805160206134ae8339815191525af16000958161315d575b50613086575050505050612c33575050565b90919294506000969395965b8181106130a3575050505050505050565b6130ad8188612b46565b516130bb575b600101613092565b6001600160a01b036130d4610100612c8c848688612f4e565b166101206130e3838587612f4e565b0135906001600160801b036130f88488612b46565b511691813b156103ae5760009189838a6131278f5197889687958694637921219560e11b86523090860161280c565b03925af18015613152579060019291613143575b5090506130b3565b61314c906119e9565b3861313b565b89513d6000823e3d90fd5b61317191963d8091833e612d2e8183611a12565b9438613074565b83516001600160801b03168852968101968c96509281019260010161302d565b919495969760c39491939419908203018352843561017e198c3603018112156103ae57866131cb6001938e83940161259e565b960193019101908d97969594939291612ff4565b806001600160801b036131f9849f9e9b9493600194612b46565b5116613205828a612b46565b52019b90979a9b612fae565b91969492939461322082611a33565b946040986132308a519788611a12565b83875261323c84611a33565b602098888a019291601f190136843760005b86811061347d575050613260856129be565b908b51998a94638468061560e01b86528760a4870160a060048901525260c486019060c48960051b880101918a9060005b8b811061343457505050906132b39160031994858984030160248a0152612a89565b82868203016044870152818b519182815201949160005b82811061341457505050506132ee8385938493846000999703016064850152612af1565b8b1515608483015203916000805160206134ae8339815191525af1600095816133f9575b506133335750505050506133235750565b51631298f31b60e11b8152600490fd5b90919293945060005b81811061334c5750505050505050565b6133568187612b46565b51613364575b60010161333c565b6001600160a01b0361337d610100612c8c848688612f4e565b1661012061338c838587612f4e565b01356001600160801b036133a08489612b46565b5116823b156103ae576133ce92600092838c51809681958294637921219560e11b84528d306004860161280c565b03925af18015612d0f5790600192916133ea575b50905061335c565b6133f3906119e9565b386133e2565b61340d91963d8091833e612d2e8183611a12565b9438613312565b83516001600160801b031687528d975095810195928101926001016132ca565b91949596979860c39491939419908203018352843561017e198d3603018112156103ae57866134686001938f83940161259e565b960193019101908e9897969594939291613291565b806001600160801b03613496600193859e97989e612b46565b51166134a2828d612b46565b52019993929961324e56fe000000000000000000000000def1c0ded9bec7f1a1670819833240f027b25effa264697066735822122085b121bf71b4d1006d1bade9851884f3f5545ece80d079412de8aeeaef49292764736f6c63430008110033000000000000000000000000f3d63166f0ca56c3c1a3508fce03ff0cf3fb691e000000000000000000000000178a86d36d89c7fdebea90b739605da7b131ff6a

Deployed Bytecode

0x608080604052600436101561001d575b50361561001b57600080fd5b005b600090813560e01c90816312f3a43f1461178e57508063150b7a021461171d5780631b317906146115e957806346a25cbe146113655780634e71e0c8146113005780636a3a0594146110325780637b87ffa314610f2457806389d0604014610c2f5780638da5cb5b14610c08578063b50e44b814610bdf578063c6ed9b55146109a7578063de90447b1461088e578063e30c397814610865578063ecc7271d14610662578063f23a6e61146105cb578063f2fde38b14610570578063f887ea401461052b578063fd1ae9c8146102585763fff10c460361000f5760031961016036820112610254576004356001600160401b039182821161024c57610180908260040192360301126102505760803660231901126102505761013d611a4a565b9160803660c319011261024c576101443590811161024c57610163903690600401611ada565b919092610174600280541415611b0a565b60028055610180611ba8565b936101243593806101ca575050906101aa929161019b611bbe565b906101a4611d97565b92612932565b47806101ba575b82600160025580f35b6101c391611dc5565b38806101b1565b916101de856101e59395479361019b611bbe565b4790611d22565b92855b8281106101f95750505050506101aa565b8061021d836102188860206102116001978a8c611d45565b0135611d55565b611d68565b8061022a575b50016101e8565b6102469061024161023c84888a611d45565b611c00565b611dc5565b38610223565b8380fd5b8280fd5b5080fd5b50610100366003190112610528576001600160401b036004358181116102505761028690369060040161191c565b906024358381116105245761029f9036906004016119b9565b91909360a06043193601126105205760e435908111610520576102c6903690600401611ada565b9390946102d7600280541415611b0a565b600280556102e3611b92565b946102ec611bd4565b966102f5611bd4565b60c43592806103c6575050509061031761032e9592610312611bd4565b61203d565b61031f611bea565b92610328611db6565b94612b7d565b6040516370a0823160e01b8152306004820152906020826024816001600160a01b0387165afa9182156103bb578492610383575b5081610372575b83600160025580f35b61037b92611e32565b388080610369565b9091506020813d82116103b3575b8161039e60209383611a12565b810103126103ae57519038610362565b600080fd5b3d9150610391565b6040513d86823e3d90fd5b6040516370a0823160e01b8082523060048301526020999498939792966001600160a01b03891695909492938e93918c866024818b5afa958615610515578d95966104de575b50610420939495966103178a610312611bd4565b60246040518095819382523060048301525afa9081156104d3578a916104a2575b61044b9250611d22565b885b838110610460575050505050505061032e565b8061047784610218858b6102116001978b8e611d45565b80610484575b500161044d565b61049c9061049661023c84898c611d45565b88611e32565b3861047d565b90508682813d83116104cc575b6104b98183611a12565b810103126103ae5761044b915190610441565b503d6104af565b6040513d8c823e3d90fd5b858195969297503d831161050e575b6104f78183611a12565b810103126103ae578b94610420935195949361040c565b503d6104ed565b6040513d87823e3d90fd5b8580fd5b8480fd5b80fd5b50346105285780600319360112610528576040517f000000000000000000000000178a86d36d89c7fdebea90b739605da7b131ff6a6001600160a01b03168152602090f35b50346105285760203660031901126105285761058a61194c565b81546001600160a01b039190821633036105ba57166bffffffffffffffffffffffff60a01b600154161760015580f35b6040516282b42960e81b8152600490fd5b50346105285760a0366003190112610528576105e561194c565b506105ee611962565b506084356001600160401b0381116102545761060e90369060040161198c565b80610626575b60405163f23a6e6160e01b8152602090f35b61065b91610635913691611c70565b7f000000000000000000000000178a86d36d89c7fdebea90b739605da7b131ff6a611cf8565b8080610614565b50610160600319818136011261025057600435916001600160401b0391828411610524578360040193360301126102505760803660231901126102505760a03660a31901126102505761014435908111610250576106c4903690600401611ada565b90916106d4600280541415611b0a565b600280556106e0611bbe565b916106e9611e1b565b936106f2611e1b565b610124359280610725575050509061070f61032e92610312611e1b565b610717611bd4565b61071f611da7565b91612796565b6040516370a0823160e01b808252306004830152602096949593949293926001600160a01b0386169290918882602481875afa92831561085a5789928d94610826575b506107799061070f87610312611e1b565b60246040518095819382523060048301525afa9081156104d3578a916107f5575b6107a49250611d22565b885b8381106107b9575050505050505061032e565b806107d084610218858b6102116001978b8e611d45565b806107dd575b50016107a6565b6107ef9061049661023c84898c611d45565b386107d6565b90508682813d831161081f575b61080c8183611a12565b810103126103ae576107a491519061079a565b503d610802565b8381949295503d8311610853575b61083e8183611a12565b810103126103ae576107798992519390610768565b503d610834565b6040513d8e823e3d90fd5b50346105285780600319360112610528576001546040516001600160a01b039091168152602090f35b5060e0366003190112610528576001600160401b03600435818111610250576108bb90369060040161191c565b90602435838111610524576108d49036906004016119b9565b91909360806043193601126105205760c435908111610520576108fb903690600401611ada565b93909261090c600280541415611b0a565b60028055610918611b92565b9560a435948661093f57506101aa9550610930611bea565b92610939611db6565b94612d7f565b94809694610956946101de93944795610930611bea565b92855b82811061096a5750505050506101aa565b80610982836102188860206102116001978a8c611d45565b8061098f575b5001610959565b6109a19061024161023c84888a611d45565b38610988565b50610120366003190112610528576001600160401b03600435818111610250576109d590369060040161191c565b9091602435818111610524576109ef9036906004016119b9565b939092604435838111610bdb57610a0a903690600401611a74565b9260a0366063190112610bdb5761010435908111610bdb57610a30903690600401611ada565b939095610a41600280541415611b0a565b60028055610a4d611b7c565b95610a56611bbe565b97610a5f611bbe565b60e43591908b89610a955750505061032e9650610a7e90610312611bbe565b610a86611b92565b93610a8f611d88565b95612f71565b90969197939294989560018060a01b03881694604051936370a0823160e01b9283865230600487015260209c8d876024818c5afa968715610bd0578e9697610b99575b50610aec94959697610a7e8b610312611bbe565b60246040518095819382523060048301525afa9081156104d3578a91610b68575b610b179250611d22565b885b838110610b2c575050505050505061032e565b80610b4384610218858b6102116001978b8e611d45565b80610b50575b5001610b19565b610b629061049661023c84898c611d45565b38610b49565b90508682813d8311610b92575b610b7f8183611a12565b810103126103ae57610b17915190610b0d565b503d610b75565b868196979298503d8311610bc9575b610bb28183611a12565b810103126103ae578c95610aec9451969594610ad8565b503d610ba8565b6040513d88823e3d90fd5b8680fd5b503461052857806003193601126105285760206040516000805160206134ae8339815191528152f35b5034610528578060031936011261052857546040516001600160a01b039091168152602090f35b503461052857610140366003190112610528576001600160401b03806004351161025457610160600435360360031901126102545760803660231901126102545760603660a3190112610254576101243590811161025457610c95903690600401611ada565b90610ca4600280541415611b0a565b6002805561010491610cc1610cbc8460043501611c00565b6124c8565b6000805160206134ae8339815191523b1561024c57604051632bf786cf60e21b81526101006004820152848082602081610d02898201600435600401612300565b610d0e602483016123d5565b893560a48301528460c48301526003198282030160e4830152848152030181836000805160206134ae8339815191525af19182610f10575b5050610e81575050610d56611da7565b610e6f5781905b610d65611bbe565b6001600160a01b03919082610d7d6004358401611c00565b6040516331a9108f60e11b815284356004820152911693602082602481885afa918215610bd0578692610e32575b50163014610dbc5783600160025580f35b823b15610e2d57604051632142170760e11b81523060048201526001600160a01b03919091166024820152903560448201529082908290606490829084905af18015610e2257610e0e575b8080610369565b610e17906119e9565b610528578038610e07565b6040513d84823e3d90fd5b505050fd5b9091506020813d602011610e67575b81610e4e60209383611a12565b8101031261052057518181168103610520579038610dab565b3d9150610e41565b604051631298f31b60e11b8152600490fd5b83929160043560a40191845b818110610eb757505050610eb290610eac610ea6611bd4565b91611c00565b9061244a565b610d5d565b8293949550610ed2610ecd828460019596611d45565b61240a565b6020838060a01b03825116910151610ee987611c00565b9181610eff575b50505001919085949392610e8d565b610f0892611e32565b388080610ef0565b610f19906119e9565b610524578438610d46565b506003196101403682011261025457600435906001600160401b039081831161024c57610160908360040193360301126102505760803660231901126102505760803660a3190112610250576101243590811161025057610f89903690600401611ada565b9091610f99600280541415611b0a565b60028055610fa5611bbe565b92610104359280610fcd575050906101aa91610fbf611bd4565b610fc7611da7565b9161268b565b9091610fe1906101de854792610fbf611bd4565b92855b828110610ff55750505050506101aa565b8061100d836102188860206102116001978a8c611d45565b8061101a575b5001610fe4565b61102c9061024161023c84888a611d45565b38611013565b5034610528576003196101603682011261025457600435906001600160401b039081831161024c5761018081843603011261024c57608036602319011261024c5761107b611a4a565b60603660c3190112610524576101249384359361014435908111610bdb576110a7903690600401611ada565b90926110b7600280541415611b0a565b600280558761010497888501986110d0610cbc8b611c00565b6000805160206134ae83398151915290813b1561024c576111189484916001600160801b03604051978896633717764f60e11b8852610120600489015287018b60040161259e565b92611125602488016123d5565b8d60a48801521660c48601528260e48601528482039a8b01908501525281836020809a01925af190816112ed575b5061127657505050611163611d97565b610e6f5761118884935b611175611ba8565b6001600160a01b03929091839190611c00565b604051627eeac760e11b815230600482015260248101879052911691908481604481865afa94851561126b578795611238575b5050836111cc575b85600160025580f35b813b15610520578560c49281956040519788968795637921219560e11b87523060048801521660248601526044850152606484015260a060848401528160a48401525af18015610e2257611224575b808080806111c3565b61122d906119e9565b61052857803861121b565b819750809295503d8311611264575b6112518183611a12565b810103126103ae578594519238806111bb565b503d611247565b6040513d89823e3d90fd5b94959460a49091019190855b8181106112a55750505083946112a061118892610eac610ea6611bbe565b61116d565b806112b6610ecd6001938587611d45565b86838060a01b038251169101516112cc87611c00565b91816112dc575b50505001611282565b6112e592611e32565b3880806112d3565b6112f9909891986119e9565b9638611153565b50346105285780600319360112610528576001546001600160a01b03811690338290036105ba5782546001600160a01b03199081168317845516600155807f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e08380a380f35b50610180600319818136011261025057600435916001600160401b039182841161052457836004019336030112610250576080366023190112610250576113aa611a4a565b9060a03660c319011261024c576101643590811161024c576113d0903690600401611ada565b9190926113e1600280541415611b0a565b600280556113ed611ba8565b926113f6611e04565b946113ff611e04565b6101443592806114a8575050509161141c61143393610312611e04565b611424611bbe565b9061142d611d97565b92612849565b6040516370a0823160e01b8152306004820152906020826024816001600160a01b0387165afa9182156103bb5784926114755750816103725783600160025580f35b9091506020813d82116114a0575b8161149060209383611a12565b8101031261024c57519038610362565b3d9150611483565b6040516370a0823160e01b80825230600483015260209794969395929492936001600160a01b038716938c9291908a85602481895afa9485156103bb578b94956115b0575b50906114ff9161141c88610312611e04565b60246040518095819382523060048301525afa9081156104d3578a9161157b575b61152a9250611d22565b885b83811061153f5750505050505050611433565b8061155684610218858b6102116001978b8e611d45565b80611563575b500161152c565b6115759061049661023c84898c611d45565b3861155c565b90508682813d83116115a9575b6115928183611a12565b810103126115a55761152a915190611520565b8980fd5b503d611588565b848193959296503d83116115e2575b6115c98183611a12565b810103126115de5751928992906114ff6114ed565b8c80fd5b503d6115bf565b50610100366003190112610528576001600160401b036004358181116102505761161790369060040161191c565b91602435818111610524576116309036906004016119b9565b929093604435838111610bdb5761164b903690600401611a74565b926080366063190112610bdb5760e435908111610bdb57611670903690600401611ada565b939094611681600280541415611b0a565b6002805561168d611b7c565b9660c43595806116b457506101aa96506116a5611b92565b936116ae611d88565b95613211565b946116cc9487989792946101de9447966116a5611b92565b92855b8281106116e05750505050506101aa565b806116f8836102188860206102116001978a8c611d45565b80611705575b50016116cf565b6117179061024161023c84888a611d45565b386116fe565b50346105285760803660031901126105285761173761194c565b50611740611962565b506064356001600160401b0381116102545761176090369060040161198c565b80611778575b604051630a85bd0160e11b8152602090f35b61178791610635913691611c70565b8080611766565b9050606080600319360112610250576001600160401b0391600435838111610524576117be90369060040161191c565b919093602435818111610bdb576117d990369060040161191c565b9091604435908111611918576117f390369060040161191c565b88546001600160a01b0395908616330361190a5750611816600280541415611b0a565b60028055885b86811061182c5789600160025580f35b61183a61023c82898c611b56565b908a8061186161184b84898b611c14565b919061185886898b611b56565b35923691611c70565b948551918b602080980192165af1611877611cc8565b50156118f8577fa3f06cf374cf66be06f5fe85cdd3b13d9d9fdef6482f640d2de1d44c3ed7332c87876001946118e9888f8f8f6118d38a8f818f96916118c561023c8389986118cb96611b56565b9b611c14565b959096611b56565b3595604051988998168852870152850191611ca7565b9060408301520390a10161181c565b6040516322092f2f60e11b8152600490fd5b6282b42960e81b8152600490fd5b8780fd5b9181601f840112156103ae578235916001600160401b0383116103ae576020808501948460051b0101116103ae57565b600435906001600160a01b03821682036103ae57565b602435906001600160a01b03821682036103ae57565b35906001600160a01b03821682036103ae57565b9181601f840112156103ae578235916001600160401b0383116103ae57602083818601950101116103ae57565b9181601f840112156103ae578235916001600160401b0383116103ae576020808501948460071b0101116103ae57565b6001600160401b0381116119fc57604052565b634e487b7160e01b600052604160045260246000fd5b90601f801991011681019081106001600160401b038211176119fc57604052565b6001600160401b0381116119fc5760051b60200190565b60a435906001600160801b03821682036103ae57565b35906001600160801b03821682036103ae57565b81601f820112156103ae57803591611a8b83611a33565b92611a996040519485611a12565b808452602092838086019260051b8201019283116103ae578301905b828210611ac3575050505090565b838091611acf84611a60565b815201910190611ab5565b9181601f840112156103ae578235916001600160401b0383116103ae576020808501948460061b0101116103ae57565b15611b1157565b60405162461bcd60e51b815260206004820152601f60248201527f5265656e7472616e637947756172643a207265656e7472616e742063616c6c006044820152606490fd5b9190811015611b665760051b0190565b634e487b7160e01b600052603260045260246000fd5b6084356001600160a01b03811681036103ae5790565b6064356001600160a01b03811681036103ae5790565b60e4356001600160a01b03811681036103ae5790565b60c4356001600160a01b03811681036103ae5790565b60a4356001600160a01b03811681036103ae5790565b6044356001600160a01b03811681036103ae5790565b356001600160a01b03811681036103ae5790565b9190811015611b665760051b81013590601e19813603018212156103ae5701908135916001600160401b0383116103ae5760200182360381136103ae579190565b6001600160401b0381116119fc57601f01601f191660200190565b929192611c7c82611c55565b91611c8a6040519384611a12565b8294818452818301116103ae578281602093846000960137010152565b908060209392818452848401376000828201840152601f01601f1916010190565b3d15611cf3573d90611cd982611c55565b91611ce76040519384611a12565b82523d6000602084013e565b606090565b8151600092839260209091019083906001600160a01b03165af1611d1a611cc8565b50156118f857565b91908203918211611d2f57565b634e487b7160e01b600052601160045260246000fd5b9190811015611b665760061b0190565b81810292918115918404141715611d2f57565b8115611d72570490565b634e487b7160e01b600052601260045260246000fd5b60a43580151581036103ae5790565b6101043580151581036103ae5790565b60e43580151581036103ae5790565b60843580151581036103ae5790565b81611dce575050565b6000918291829182916001600160a01b03165af1611dea611cc8565b5015611df257565b60405163d2dcf4f360e01b8152600490fd5b610124356001600160a01b03811681036103ae5790565b610104356001600160a01b03811681036103ae5790565b6040805163a9059cbb60e01b60208083019182526001600160a01b039590951660248301526044808301969096529481529293909291611e73606484611a12565b60018060a01b0316908351928484018481106001600160401b038211176119fc5785528584527f5361666545524332303a206c6f772d6c6576656c2063616c6c206661696c656486850152823b15611f6857611ee2939260009283809351925af1611edc611cc8565b90611ff9565b805180611ef0575b50505050565b818491810103126103ae5782611f069101611fac565b15611f12578080611eea565b60849250519062461bcd60e51b82526004820152602a60248201527f5361666545524332303a204552433230206f7065726174696f6e20646964206e6044820152691bdd081cdd58d8d9595960b21b6064820152fd5b845162461bcd60e51b815260048101879052601d60248201527f416464726573733a2063616c6c20746f206e6f6e2d636f6e74726163740000006044820152606490fd5b519081151582036103ae57565b919082519283825260005b848110611fe5575050826000602080949584010152601f8019910116010190565b602081830181015184830182015201611fc4565b90919015612005575090565b8151156120155750805190602001fd5b60405162461bcd60e51b815260206004820152908190612039906024830190611fb9565b0390fd5b604051636eb1769f60e11b81523060048201526000805160206134ae833981519152602482018190526001600160a01b03929092169260209290918381604481885afa90811561211457600091612120575b5082811061209f575b5050505050565b6120ac6044918594611d22565b916000604051968794859363095ea7b360e01b8552600485015260248401525af18015612114576120e0575b808080612098565b81813d831161210d575b6120f48183611a12565b810103126103ae5761210590611fac565b5038806120d8565b503d6120ea565b6040513d6000823e3d90fd5b908482813d8311612146575b6121368183611a12565b810103126105285750513861208f565b503d61212c565b359060ff821682036103ae57565b9035601e19823603018112156103ae5701602081359101916001600160401b0382116103ae578160051b360383136103ae57565b9035601e19823603018112156103ae5701602081359101916001600160401b0382116103ae5781360383136103ae57565b90918092808252602080920191808260051b8601019484600080925b8584106121ee57505050505050505090565b9091929394959697601f198282030188528835605e198536030181121561024c57600191879182916122589188016001600160a01b0361222d82611978565b16825283810135848301526122476040918281019061218f565b919092606080928201520191611ca7565b9a019801969594019291906121dc565b909182815260208091019283918160051b85019484600080925b85841061229457505050505050505090565b909192939495969781810388528835603e198536030181121561024c57600191879182916122f0916122df9089016001600160a01b036122d382611978565b1683528481019061218f565b909160409081868201520191611ca7565b9a01980196959401929190612282565b60ff61230b8261214d565b1682526001600160a01b03918261232460208401611978565b1660208201528261233760408401611978565b16604082015260608201356060820152608082013560808201528261235e60a08401611978565b1660a082015260c082013560c082015261238f61237e60e084018461215b565b6101608060e08601528401916121c0565b9161010093848201359081168091036103ae576123d29483015261012080820135908301526123c4610140918281019061215b565b929091818503910152612268565b90565b60243560ff81168091036103ae57815260443560ff81168091036103ae57602082015260643560408201526060608435910152565b6040813603126103ae576040519060408201908282106001600160401b038311176119fc5760209160405261243e81611978565b83520135602082015290565b6040516370a0823160e01b8152306004820152906020826024816001600160a01b0387165afa91821561211457600092612495575b508161248a57505050565b61249392611e32565b565b90916020823d82116124c0575b816124af60209383611a12565b81010312610528575051903861247f565b3d91506124a2565b60405163e985e9c560e01b81523060048201526000805160206134ae833981519152602482018190526001600160a01b03929092169190602081604481865afa90811561211457600091612565575b5015612521575050565b813b156103ae5760009160448392604051948593849263a22cb46560e01b84526004840152600160248401525af180156121145761255c5750565b612493906119e9565b906020823d8211612596575b8161257e60209383611a12565b81010312610528575061259090611fac565b38612517565b3d9150612571565b9060ff6125aa8361214d565b1681526001600160a01b03806125c260208501611978565b166020830152806125d560408501611978565b1660408301526060830135606083015260808301356080830152806125fc60a08501611978565b1660a083015260c083013560c083015261262d61261c60e085018561215b565b6101808060e08701528501916121c0565b61010091828501359081168091036103ae5761266d9284015261012080850135908401526101406126608186018661215b565b9185840390860152612268565b916001600160801b03612684610160809301611a60565b1691015290565b9291926000805160206134ae833981519152803b156103ae576040519384809263fbee349d60e01b8252600096879360c0600483015260206126d060c4840189612300565b6126dc602485016123d5565b8684820391600319830160a48701525201925af19081612783575b5061270557505050610e6f57565b919250906001600160a01b0361271e6101008301611c00565b1690813b1561024c57604051632142170760e11b81523060048201526001600160a01b0390931660248401526101200135604483015282908290818381606481015b03925af18015610e2257612772575050565b61277c82916119e9565b6105285750565b61278f909491946119e9565b92386126f7565b906000916000805160206134ae833981519152803b1561024c5783604051809263fbee349d60e01b825260c06004830152818360206127d860c4840189612300565b6127e4602485016123d5565b8284820391600319830160a48701525201925af19081612783575061270557505050610e6f57565b9260c094916001600160801b039360018060a01b038092168652166020850152604084015216606082015260a06080820152600060a08201520190565b916000926000805160206134ae833981519152803b1561052457846040518092630f9b6a9b60e31b825260e060048301528183602061288b60e484018961259e565b612897602485016123d5565b6001600160801b038b1660a48501528284820391600319830160c48701525201925af1908161291f575b506128d05750505050610e6f57565b92935090916001600160a01b036128ea6101008301611c00565b1690813b1561052457906101208580949361276060405197889687958694637921219560e11b8652013590306004860161280c565b61292b909591956119e9565b93386128c1565b9392939190916000805160206134ae833981519152803b156103ae5760405194858092630f9b6a9b60e31b8252600097889360e06004830152602061297a60e484018961259e565b612986602485016123d5565b6001600160801b038b1660a48501528684820391600319830160c48701525201925af1908161291f57506128d05750505050610e6f57565b906129c882611a33565b6129d56040519182611a12565b82815280926129e6601f1991611a33565b019060005b8281106129f757505050565b8060606020809385010152016129eb565b60209081818403126103ae578051906001600160401b0382116103ae57019180601f840112156103ae578251612a3d81611a33565b93612a4b6040519586611a12565b818552838086019260051b8201019283116103ae578301905b828210612a72575050505090565b838091612a7e84611fac565b815201910190612a64565b9190808252602080920192916000905b828210612aa7575050505090565b9091929360019060ff80612aba8861214d565b168252612ac884880161214d565b168184015260408681013590820152606080870135908201526080908101950193920190612a99565b90815180825260208092019182818360051b82019501936000915b848310612b1c5750505050505090565b9091929394958480612b3683856001950387528a51611fb9565b9801930193019194939290612b0c565b8051821015611b665760209160051b010190565b9190811015611b665760051b8101359061015e19813603018212156103ae570190565b94929493909193612b8d836129be565b926040958651809563eae93ee760e01b825260848201998460049b60808d8601525260a483019060a48660051b8501019187906000905b888210612d3d57505050938392612bee612bfd936000976003199485888403016024890152612a89565b91848303016044850152612af1565b88151560648301520381836000805160206134ae8339815191525af160009481612d1a575b50612c405750505050612c33575050565b51631298f31b60e11b8152fd5b909193506000959294955b818110612c5b5750505050505050565b612c658187612b46565b51612c73575b600101612c4b565b6001600160a01b03612c92610100612c8c848688612b5a565b01611c00565b16610120612ca1838587612b5a565b013590803b156103ae578851632142170760e11b8152308782019081526001600160a01b0389166020820152604081019390935291600091839182908490829060600103925af18015612d0f579060019291612d00575b509050612c6b565b612d09906119e9565b38612cf8565b88513d6000823e3d90fd5b612d3691953d8091833e612d2e8183611a12565b810190612a08565b9338612c22565b91949550919260a3198b8203018252843561015e198a3603018112156103ae576001918a612d6b9201612300565b946020809101920192018a95949392612bc4565b9060809695949295612d90826129be565b94604097885196879263eae93ee760e01b8452856084850160049d8e8701525260a484019060a48760051b8601019188906000905b898210612f0a57505050600095938593612bee8594612df1946003199485888403016024890152612a89565b8a1515606483015203916000805160206134ae8339815191525af160009481612eef575b50612e265750505050612c33575050565b909193506000959294955b818110612e415750505050505050565b612e4b8187612b46565b51612e59575b600101612e31565b6001600160a01b03612e72610100612c8c848688612b5a565b16610120612e81838587612b5a565b013590803b156103ae578851632142170760e11b8152308782019081526001600160a01b0389166020820152604081019390935291600091839182908490829060600103925af18015612d0f579060019291612ee0575b509050612e51565b612ee9906119e9565b38612ed8565b612f0391953d8091833e612d2e8183611a12565b9338612e15565b9194959650919260a3198c8203018252843561015e198b3603018112156103ae576001918b612f399201612300565b946020809101920192018b9695949392612dc5565b9190811015611b665760051b8101359061017e19813603018212156103ae570190565b959394919295612f8082611a33565b91604096612f9088519485611a12565b818452612f9c82611a33565b6020858101929091601f190136843760005b8481106131df575050612fc0836129be565b8951978892638468061560e01b845260a484019c8660049e8f870160a090525260c48501908760051b860160c40191899060005b8a81106131985750505090613016916003199485888403016024890152612a89565b828582030160448601528189519182815201959160005b828110613178575050505083839261304f928460009703016064850152612af1565b89151560848301520381836000805160206134ae8339815191525af16000958161315d575b50613086575050505050612c33575050565b90919294506000969395965b8181106130a3575050505050505050565b6130ad8188612b46565b516130bb575b600101613092565b6001600160a01b036130d4610100612c8c848688612f4e565b166101206130e3838587612f4e565b0135906001600160801b036130f88488612b46565b511691813b156103ae5760009189838a6131278f5197889687958694637921219560e11b86523090860161280c565b03925af18015613152579060019291613143575b5090506130b3565b61314c906119e9565b3861313b565b89513d6000823e3d90fd5b61317191963d8091833e612d2e8183611a12565b9438613074565b83516001600160801b03168852968101968c96509281019260010161302d565b919495969760c39491939419908203018352843561017e198c3603018112156103ae57866131cb6001938e83940161259e565b960193019101908d97969594939291612ff4565b806001600160801b036131f9849f9e9b9493600194612b46565b5116613205828a612b46565b52019b90979a9b612fae565b91969492939461322082611a33565b946040986132308a519788611a12565b83875261323c84611a33565b602098888a019291601f190136843760005b86811061347d575050613260856129be565b908b51998a94638468061560e01b86528760a4870160a060048901525260c486019060c48960051b880101918a9060005b8b811061343457505050906132b39160031994858984030160248a0152612a89565b82868203016044870152818b519182815201949160005b82811061341457505050506132ee8385938493846000999703016064850152612af1565b8b1515608483015203916000805160206134ae8339815191525af1600095816133f9575b506133335750505050506133235750565b51631298f31b60e11b8152600490fd5b90919293945060005b81811061334c5750505050505050565b6133568187612b46565b51613364575b60010161333c565b6001600160a01b0361337d610100612c8c848688612f4e565b1661012061338c838587612f4e565b01356001600160801b036133a08489612b46565b5116823b156103ae576133ce92600092838c51809681958294637921219560e11b84528d306004860161280c565b03925af18015612d0f5790600192916133ea575b50905061335c565b6133f3906119e9565b386133e2565b61340d91963d8091833e612d2e8183611a12565b9438613312565b83516001600160801b031687528d975095810195928101926001016132ca565b91949596979860c39491939419908203018352843561017e198d3603018112156103ae57866134686001938f83940161259e565b960193019101908e9897969594939291613291565b806001600160801b03613496600193859e97989e612b46565b51166134a2828d612b46565b52019993929961324e56fe000000000000000000000000def1c0ded9bec7f1a1670819833240f027b25effa264697066735822122085b121bf71b4d1006d1bade9851884f3f5545ece80d079412de8aeeaef49292764736f6c63430008110033

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

000000000000000000000000f3d63166f0ca56c3c1a3508fce03ff0cf3fb691e000000000000000000000000178a86d36d89c7fdebea90b739605da7b131ff6a

-----Decoded View---------------
Arg [0] : owner (address): 0xf3d63166F0Ca56C3c1A3508FcE03Ff0Cf3Fb691e
Arg [1] : router (address): 0x178A86D36D89c7FDeBeA90b739605da7B131ff6A

-----Encoded View---------------
2 Constructor Arguments found :
Arg [0] : 000000000000000000000000f3d63166f0ca56c3c1a3508fce03ff0cf3fb691e
Arg [1] : 000000000000000000000000178a86d36d89c7fdebea90b739605da7b131ff6a


Block Transaction Difficulty Gas Used Reward
View All Blocks Produced

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

Validator Index Block Amount
View All Withdrawals

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

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