MATIC Price: $0.352118 (-21.93%)
 

Overview

MATIC Balance

Polygon PoS Chain LogoPolygon PoS Chain LogoPolygon PoS Chain Logo0 MATIC

MATIC Value

$0.00

Token Holdings

Multichain Info

No addresses found
Transaction Hash
Method
Block
From
To
Match Orders602212642024-08-05 11:44:5429 secs ago1722858294IN
0x78769D50...5aabff29e
0 MATIC0.05702018245.95687841
Match Orders602212612024-08-05 11:44:4241 secs ago1722858282IN
0x78769D50...5aabff29e
0 MATIC0.10075158242.71935184
Match Orders602212592024-08-05 11:44:3449 secs ago1722858274IN
0x78769D50...5aabff29e
0 MATIC0.06858408279.20908535
Match Orders602212572024-08-05 11:44:2657 secs ago1722858266IN
0x78769D50...5aabff29e
0 MATIC0.09106763234.19311178
Match Orders602212572024-08-05 11:44:2657 secs ago1722858266IN
0x78769D50...5aabff29e
0 MATIC0.05578433234.19311178
Match Orders602212552024-08-05 11:44:181 min ago1722858258IN
0x78769D50...5aabff29e
0 MATIC0.0620769260.63676704
Match Orders602212412024-08-05 11:43:321 min ago1722858212IN
0x78769D50...5aabff29e
0 MATIC0.05184917217.68355917
Match Orders602212382024-08-05 11:43:261 min ago1722858206IN
0x78769D50...5aabff29e
0 MATIC0.14721164316.60052908
Match Orders602212332024-08-05 11:43:162 mins ago1722858196IN
0x78769D50...5aabff29e
0 MATIC0.09877221230.92188927
Match Orders602212322024-08-05 11:43:142 mins ago1722858194IN
0x78769D50...5aabff29e
0 MATIC0.06250796233.82497607
Match Orders602212292024-08-05 11:43:062 mins ago1722858186IN
0x78769D50...5aabff29e
0 MATIC0.05655877225.80785178
Match Orders602212192024-08-05 11:42:462 mins ago1722858166IN
0x78769D50...5aabff29e
0 MATIC0.05856905245.89630816
Match Orders602212132024-08-05 11:42:322 mins ago1722858152IN
0x78769D50...5aabff29e
0 MATIC0.12836017255.67159449
Match Orders602212092024-08-05 11:42:242 mins ago1722858144IN
0x78769D50...5aabff29e
0 MATIC0.06358558255.85287554
Match Orders602212082024-08-05 11:42:223 mins ago1722858142IN
0x78769D50...5aabff29e
0 MATIC0.15600902337.16152453
Match Orders602212042024-08-05 11:42:143 mins ago1722858134IN
0x78769D50...5aabff29e
0 MATIC0.1146723244.81861638
Match Orders602212002024-08-05 11:42:063 mins ago1722858126IN
0x78769D50...5aabff29e
0 MATIC0.10421799286.02164188
Match Orders602211992024-08-05 11:42:023 mins ago1722858122IN
0x78769D50...5aabff29e
0 MATIC0.06038301236.92715753
Match Orders602211982024-08-05 11:42:003 mins ago1722858120IN
0x78769D50...5aabff29e
0 MATIC0.10770385237.55653692
Match Orders602211982024-08-05 11:42:003 mins ago1722858120IN
0x78769D50...5aabff29e
0 MATIC0.05659237.55653692
Match Orders602211982024-08-05 11:42:003 mins ago1722858120IN
0x78769D50...5aabff29e
0 MATIC0.09437931237.55653692
Match Orders602211982024-08-05 11:42:003 mins ago1722858120IN
0x78769D50...5aabff29e
0 MATIC0.05652752237.55653692
Match Orders602211982024-08-05 11:42:003 mins ago1722858120IN
0x78769D50...5aabff29e
0 MATIC0.05659855237.55653692
Match Orders602211982024-08-05 11:42:003 mins ago1722858120IN
0x78769D50...5aabff29e
0 MATIC0.06465457237.55653692
Match Orders602211982024-08-05 11:42:003 mins ago1722858120IN
0x78769D50...5aabff29e
0 MATIC0.05652752237.55653692
View all transactions

Parent Transaction Hash Block From To
View All Internal Transactions
Loading...
Loading

Contract Source Code Verified (Exact Match)

Contract Name:
NegRiskFeeModule

Compiler Version
v0.8.15+commit.e14f2714

Optimization Enabled:
Yes with 1000000 runs

Other Settings:
london EvmVersion
File 1 of 14 : NegRiskFeeModule.sol
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.15;

import {FeeModule, IExchange} from "../lib/exchange-fee-module/src/FeeModule.sol";
import {IConditionalTokens} from "./interfaces/IConditionalTokens.sol";

/// @title NegRiskFeeModule
/// @notice A slightly modified version of FeeModule
/// @notice with added approvals for the NegRiskAdapter
contract NegRiskFeeModule is FeeModule {
    constructor(address _negRiskCtfExchange, address _negRiskAdapter, address _ctf) FeeModule(_negRiskCtfExchange) {
        IConditionalTokens(_ctf).setApprovalForAll(_negRiskAdapter, true);
        IConditionalTokens(_ctf).setApprovalForAll(address(this), true);
    }
}

File 2 of 14 : FeeModule.sol
// SPDX-License-Identifier: MIT
pragma solidity 0.8.15;

import { ERC1155TokenReceiver } from "solmate/tokens/ERC1155.sol";

import { Auth } from "./mixins/Auth.sol";
import { Transfers } from "./mixins/Transfers.sol";

import { IExchange } from "./interfaces/IExchange.sol";
import { IFeeModule } from "./interfaces/IFeeModule.sol";

import { Order, Side } from "./libraries/Structs.sol";
import { CalculatorHelper } from "./libraries/CalculatorHelper.sol";

/// @title Polymarket CTF Fee Module
/// @notice Proxies the CTFExchange contract and refunds maker orders
/// @author Jon Amenechi ([email protected])
contract FeeModule is IFeeModule, Auth, Transfers, ERC1155TokenReceiver {
    /// @notice The Exchange contract
    IExchange public immutable exchange;

    /// @notice The Collateral token
    address public immutable collateral;

    /// @notice The CTF contract
    address public immutable ctf;

    constructor(address _exchange) {
        exchange = IExchange(_exchange);
        collateral = exchange.getCollateral();
        ctf = exchange.getCtf();
    }

    /// @notice Matches a taker order against a list of maker orders, refunding maker order fees if necessary
    /// @param takerOrder       - The active order to be matched
    /// @param makerOrders      - The array of maker orders to be matched against the active order
    /// @param takerFillAmount  - The amount to fill on the taker order, always in terms of the maker amount
    /// @param makerFillAmounts - The array of amounts to fill on the maker orders, always in terms of the maker amount
    /// @param makerFeeRate     - The fee rate to be charged to maker orders
    function matchOrders(
        Order memory takerOrder,
        Order[] memory makerOrders,
        uint256 takerFillAmount,
        uint256[] memory makerFillAmounts,
        uint256 makerFeeRate
    ) external onlyAdmin {
        // Match the orders on the exchange
        exchange.matchOrders(takerOrder, makerOrders, takerFillAmount, makerFillAmounts);

        // Refund maker fees
        _refundFees(makerOrders, makerFillAmounts, makerFeeRate);
    }

    /// @notice Withdraw collected fees
    /// @param id       - The tokenID to be withdrawn. If 0, will be the collateral token.
    /// @param amount   - The amount to be withdrawn
    function withdrawFees(address to, uint256 id, uint256 amount) external onlyAdmin {
        address token = id == 0 ? collateral : ctf;
        _transfer(token, address(this), to, id, amount);
        emit FeeWithdrawn(token, to, id, amount);
    }

    /// @notice Refund fees for a set of orders
    /// @param orders       - The array of orders
    /// @param fillAmounts  - The array of fill amounts for the orders
    /// @param feeRate      - The fee rate to be charged to maker orders
    function _refundFees(Order[] memory orders, uint256[] memory fillAmounts, uint256 feeRate) internal {
        uint256 length = orders.length;
        uint256 i = 0;
        for (; i < length;) {
            if(orders[i].feeRateBps > feeRate) {
                _refundFee(orders[i], fillAmounts[i], feeRate);
            }
            unchecked {
                ++i;
            }
        }
    }

    /// @notice Refund fee for an order
    /// @param order        - The order
    /// @param fillAmount   - The fill amount for the order
    /// @param feeRate      - The fee rate to be charged to maker orders
    function _refundFee(Order memory order, uint256 fillAmount, uint256 feeRate) internal {
        // Calculate refund for the order, if any
        uint256 refund = CalculatorHelper.calcRefund(
            order.feeRateBps,
            feeRate,
            order.side == Side.BUY ? CalculatorHelper.calculateTakingAmount(fillAmount, order.makerAmount, order.takerAmount) : fillAmount,
            order.makerAmount,
            order.takerAmount,
            order.side
        );

        uint256 id = order.side == Side.BUY ? order.tokenId : 0;
        address token = order.side == Side.BUY ? ctf : collateral;

        // If the refund is non-zero, transfer it to the order maker
        if (refund > 0) {
            _transfer(token, address(this), order.maker, id, refund);
            emit FeeRefunded(token, order.maker, id, refund);
        }
    }
}

File 3 of 14 : IConditionalTokens.sol
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.15;

/// @notice references to IERC20 are replaced by address

/// @notice Interface for Gnosis Conditional Tokens
interface IERC1155 {
    event TransferSingle(address indexed operator, address indexed from, address indexed to, uint256 id, uint256 value);

    event TransferBatch(
        address indexed operator, address indexed from, address indexed to, uint256[] ids, uint256[] values
    );

    event ApprovalForAll(address indexed owner, address indexed operator, bool approved);

    event URI(string value, uint256 indexed id);

    function balanceOf(address owner, uint256 id) external view returns (uint256);

    function balanceOfBatch(address[] memory owners, uint256[] memory ids) external view returns (uint256[] memory);

    function setApprovalForAll(address operator, bool approved) external;

    function isApprovedForAll(address owner, address operator) external view returns (bool);

    function safeTransferFrom(address from, address to, uint256 id, uint256 value, bytes calldata data) external;

    function safeBatchTransferFrom(
        address from,
        address to,
        uint256[] calldata ids,
        uint256[] calldata values,
        bytes calldata data
    ) external;
}

interface IConditionalTokensEE {
    event ConditionPreparation(
        bytes32 indexed conditionId, address indexed oracle, bytes32 indexed questionId, uint256 outcomeSlotCount
    );

    event ConditionResolution(
        bytes32 indexed conditionId,
        address indexed oracle,
        bytes32 indexed questionId,
        uint256 outcomeSlotCount,
        uint256[] payoutNumerators
    );

    /// @dev Emitted when a position is successfully split.
    event PositionSplit(
        address indexed stakeholder,
        address collateralToken,
        bytes32 indexed parentCollectionId,
        bytes32 indexed conditionId,
        uint256[] partition,
        uint256 amount
    );
    /// @dev Emitted when positions are successfully merged.
    event PositionsMerge(
        address indexed stakeholder,
        address collateralToken,
        bytes32 indexed parentCollectionId,
        bytes32 indexed conditionId,
        uint256[] partition,
        uint256 amount
    );
    event PayoutRedemption(
        address indexed redeemer,
        address indexed collateralToken,
        bytes32 indexed parentCollectionId,
        bytes32 conditionId,
        uint256[] indexSets,
        uint256 payout
    );
}

interface IConditionalTokens is IConditionalTokensEE, IERC1155 {
    function payoutNumerators(bytes32 conditionId, uint256 index) external view returns (uint256);

    function payoutDenominator(bytes32 conditionId) external view returns (uint256);

    /// @dev This function prepares a condition by initializing a payout vector associated with the
    /// condition.
    /// @param oracle The account assigned to report the result for the prepared condition.
    /// @param questionId An identifier for the question to be answered by the oracle.
    /// @param outcomeSlotCount The number of outcome slots which should be used for this condition.
    /// Must not exceed 256.
    function prepareCondition(address oracle, bytes32 questionId, uint256 outcomeSlotCount) external;

    /// @dev Called by the oracle for reporting results of conditions. Will set the payout vector
    /// for the condition with the ID ``keccak256(abi.encodePacked(oracle, questionId,
    /// outcomeSlotCount))``, where oracle is the message sender, questionId is one of the
    /// parameters of this function, and outcomeSlotCount is the length of the payouts parameter,
    /// which contains the payoutNumerators for each outcome slot of the condition.
    /// @param questionId The question ID the oracle is answering for
    /// @param payouts The oracle's answer
    function reportPayouts(bytes32 questionId, uint256[] calldata payouts) external;

    /// @dev This function splits a position. If splitting from the collateral, this contract will
    /// attempt to transfer `amount` collateral from the message sender to itself. Otherwise, this
    /// contract will burn `amount` stake held by the message sender in the position being split
    /// worth of EIP 1155 tokens. Regardless, if successful, `amount` stake will be minted in the
    /// split target positions. If any of the transfers, mints, or burns fail, the transaction will
    /// revert. The transaction will also revert if the given partition is trivial, invalid, or
    /// refers to more slots than the condition is prepared with.
    /// @param collateralToken The address of the positions' backing collateral token.
    /// @param parentCollectionId The ID of the outcome collections common to the position being
    /// split and the split target positions. May be null, in which only the collateral is shared.
    /// @param conditionId The ID of the condition to split on.
    /// @param partition An array of disjoint index sets representing a nontrivial partition of the
    /// outcome slots of the given condition. E.g. A|B and C but not A|B and B|C (is not disjoint).
    /// Each element's a number which, together with the condition, represents the outcome
    /// collection. E.g. 0b110 is A|B, 0b010 is B, etc.
    /// @param amount The amount of collateral or stake to split.
    function splitPosition(
        address collateralToken,
        bytes32 parentCollectionId,
        bytes32 conditionId,
        uint256[] calldata partition,
        uint256 amount
    ) external;

    function mergePositions(
        address collateralToken,
        bytes32 parentCollectionId,
        bytes32 conditionId,
        uint256[] calldata partition,
        uint256 amount
    ) external;

    function redeemPositions(
        address collateralToken,
        bytes32 parentCollectionId,
        bytes32 conditionId,
        uint256[] calldata indexSets
    ) external;

    /// @dev Gets the outcome slot count of a condition.
    /// @param conditionId ID of the condition.
    /// @return Number of outcome slots associated with a condition, or zero if condition has not
    /// been prepared yet.
    function getOutcomeSlotCount(bytes32 conditionId) external view returns (uint256);

    /// @dev Constructs a condition ID from an oracle, a question ID, and the outcome slot count for
    /// the question.
    /// @param oracle The account assigned to report the result for the prepared condition.
    /// @param questionId An identifier for the question to be answered by the oracle.
    /// @param outcomeSlotCount The number of outcome slots which should be used for this condition.
    /// Must not exceed 256.
    function getConditionId(address oracle, bytes32 questionId, uint256 outcomeSlotCount)
        external
        pure
        returns (bytes32);

    /// @dev Constructs an outcome collection ID from a parent collection and an outcome collection.
    /// @param parentCollectionId Collection ID of the parent outcome collection, or bytes32(0) if
    /// there's no parent.
    /// @param conditionId Condition ID of the outcome collection to combine with the parent outcome
    /// collection.
    /// @param indexSet Index set of the outcome collection to combine with the parent outcome
    /// collection.
    function getCollectionId(bytes32 parentCollectionId, bytes32 conditionId, uint256 indexSet)
        external
        view
        returns (bytes32);

    /// @dev Constructs a position ID from a collateral token and an outcome collection. These IDs
    /// are used as the ERC-1155 ID for this contract.
    /// @param collateralToken Collateral token which backs the position.
    /// @param collectionId ID of the outcome collection associated with this position.
    function getPositionId(address collateralToken, bytes32 collectionId) external pure returns (uint256);
}

File 4 of 14 : ERC1155.sol
// SPDX-License-Identifier: AGPL-3.0-only
pragma solidity >=0.8.0;

/// @notice Minimalist and gas efficient standard ERC1155 implementation.
/// @author Solmate (https://github.com/transmissions11/solmate/blob/main/src/tokens/ERC1155.sol)
abstract contract ERC1155 {
    /*//////////////////////////////////////////////////////////////
                                 EVENTS
    //////////////////////////////////////////////////////////////*/

    event TransferSingle(
        address indexed operator,
        address indexed from,
        address indexed to,
        uint256 id,
        uint256 amount
    );

    event TransferBatch(
        address indexed operator,
        address indexed from,
        address indexed to,
        uint256[] ids,
        uint256[] amounts
    );

    event ApprovalForAll(address indexed owner, address indexed operator, bool approved);

    event URI(string value, uint256 indexed id);

    /*//////////////////////////////////////////////////////////////
                             ERC1155 STORAGE
    //////////////////////////////////////////////////////////////*/

    mapping(address => mapping(uint256 => uint256)) public balanceOf;

    mapping(address => mapping(address => bool)) public isApprovedForAll;

    /*//////////////////////////////////////////////////////////////
                             METADATA LOGIC
    //////////////////////////////////////////////////////////////*/

    function uri(uint256 id) public view virtual returns (string memory);

    /*//////////////////////////////////////////////////////////////
                              ERC1155 LOGIC
    //////////////////////////////////////////////////////////////*/

    function setApprovalForAll(address operator, bool approved) public virtual {
        isApprovedForAll[msg.sender][operator] = approved;

        emit ApprovalForAll(msg.sender, operator, approved);
    }

    function safeTransferFrom(
        address from,
        address to,
        uint256 id,
        uint256 amount,
        bytes calldata data
    ) public virtual {
        require(msg.sender == from || isApprovedForAll[from][msg.sender], "NOT_AUTHORIZED");

        balanceOf[from][id] -= amount;
        balanceOf[to][id] += amount;

        emit TransferSingle(msg.sender, from, to, id, amount);

        require(
            to.code.length == 0
                ? to != address(0)
                : ERC1155TokenReceiver(to).onERC1155Received(msg.sender, from, id, amount, data) ==
                    ERC1155TokenReceiver.onERC1155Received.selector,
            "UNSAFE_RECIPIENT"
        );
    }

    function safeBatchTransferFrom(
        address from,
        address to,
        uint256[] calldata ids,
        uint256[] calldata amounts,
        bytes calldata data
    ) public virtual {
        require(ids.length == amounts.length, "LENGTH_MISMATCH");

        require(msg.sender == from || isApprovedForAll[from][msg.sender], "NOT_AUTHORIZED");

        // Storing these outside the loop saves ~15 gas per iteration.
        uint256 id;
        uint256 amount;

        for (uint256 i = 0; i < ids.length; ) {
            id = ids[i];
            amount = amounts[i];

            balanceOf[from][id] -= amount;
            balanceOf[to][id] += amount;

            // An array can't have a total length
            // larger than the max uint256 value.
            unchecked {
                ++i;
            }
        }

        emit TransferBatch(msg.sender, from, to, ids, amounts);

        require(
            to.code.length == 0
                ? to != address(0)
                : ERC1155TokenReceiver(to).onERC1155BatchReceived(msg.sender, from, ids, amounts, data) ==
                    ERC1155TokenReceiver.onERC1155BatchReceived.selector,
            "UNSAFE_RECIPIENT"
        );
    }

    function balanceOfBatch(address[] calldata owners, uint256[] calldata ids)
        public
        view
        virtual
        returns (uint256[] memory balances)
    {
        require(owners.length == ids.length, "LENGTH_MISMATCH");

        balances = new uint256[](owners.length);

        // Unchecked because the only math done is incrementing
        // the array index counter which cannot possibly overflow.
        unchecked {
            for (uint256 i = 0; i < owners.length; ++i) {
                balances[i] = balanceOf[owners[i]][ids[i]];
            }
        }
    }

    /*//////////////////////////////////////////////////////////////
                              ERC165 LOGIC
    //////////////////////////////////////////////////////////////*/

    function supportsInterface(bytes4 interfaceId) public view virtual returns (bool) {
        return
            interfaceId == 0x01ffc9a7 || // ERC165 Interface ID for ERC165
            interfaceId == 0xd9b67a26 || // ERC165 Interface ID for ERC1155
            interfaceId == 0x0e89341c; // ERC165 Interface ID for ERC1155MetadataURI
    }

    /*//////////////////////////////////////////////////////////////
                        INTERNAL MINT/BURN LOGIC
    //////////////////////////////////////////////////////////////*/

    function _mint(
        address to,
        uint256 id,
        uint256 amount,
        bytes memory data
    ) internal virtual {
        balanceOf[to][id] += amount;

        emit TransferSingle(msg.sender, address(0), to, id, amount);

        require(
            to.code.length == 0
                ? to != address(0)
                : ERC1155TokenReceiver(to).onERC1155Received(msg.sender, address(0), id, amount, data) ==
                    ERC1155TokenReceiver.onERC1155Received.selector,
            "UNSAFE_RECIPIENT"
        );
    }

    function _batchMint(
        address to,
        uint256[] memory ids,
        uint256[] memory amounts,
        bytes memory data
    ) internal virtual {
        uint256 idsLength = ids.length; // Saves MLOADs.

        require(idsLength == amounts.length, "LENGTH_MISMATCH");

        for (uint256 i = 0; i < idsLength; ) {
            balanceOf[to][ids[i]] += amounts[i];

            // An array can't have a total length
            // larger than the max uint256 value.
            unchecked {
                ++i;
            }
        }

        emit TransferBatch(msg.sender, address(0), to, ids, amounts);

        require(
            to.code.length == 0
                ? to != address(0)
                : ERC1155TokenReceiver(to).onERC1155BatchReceived(msg.sender, address(0), ids, amounts, data) ==
                    ERC1155TokenReceiver.onERC1155BatchReceived.selector,
            "UNSAFE_RECIPIENT"
        );
    }

    function _batchBurn(
        address from,
        uint256[] memory ids,
        uint256[] memory amounts
    ) internal virtual {
        uint256 idsLength = ids.length; // Saves MLOADs.

        require(idsLength == amounts.length, "LENGTH_MISMATCH");

        for (uint256 i = 0; i < idsLength; ) {
            balanceOf[from][ids[i]] -= amounts[i];

            // An array can't have a total length
            // larger than the max uint256 value.
            unchecked {
                ++i;
            }
        }

        emit TransferBatch(msg.sender, from, address(0), ids, amounts);
    }

    function _burn(
        address from,
        uint256 id,
        uint256 amount
    ) internal virtual {
        balanceOf[from][id] -= amount;

        emit TransferSingle(msg.sender, from, address(0), id, amount);
    }
}

/// @notice A generic interface for a contract which properly accepts ERC1155 tokens.
/// @author Solmate (https://github.com/transmissions11/solmate/blob/main/src/tokens/ERC1155.sol)
abstract contract ERC1155TokenReceiver {
    function onERC1155Received(
        address,
        address,
        uint256,
        uint256,
        bytes calldata
    ) external virtual returns (bytes4) {
        return ERC1155TokenReceiver.onERC1155Received.selector;
    }

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

File 5 of 14 : Auth.sol
// SPDX-License-Identifier: MIT
pragma solidity 0.8.15;

import { IAuth } from "../interfaces/IAuth.sol";

/// @title Auth
/// @notice Provides access control modifiers
abstract contract Auth is IAuth {
    /// @notice Auth
    mapping(address => uint256) public admins;

    modifier onlyAdmin() {
        if (admins[msg.sender] != 1) revert NotAdmin();
        _;
    }

    constructor() {
        admins[msg.sender] = 1;
    }

    /// @notice Adds an Admin
    /// @param admin - The address of the admin
    function addAdmin(address admin) external onlyAdmin {
        admins[admin] = 1;
        emit NewAdmin(msg.sender, admin);
    }

    /// @notice Removes an admin
    /// @param admin - The address of the admin to be removed
    function removeAdmin(address admin) external onlyAdmin {
        admins[admin] = 0;
        emit RemovedAdmin(msg.sender, admin);
    }

    /// @notice Renounces Admin privileges from the caller
    function renounceAdmin() external onlyAdmin {
        admins[msg.sender] = 0;
        emit RemovedAdmin(msg.sender, msg.sender);
    }

    /// @notice Checks if an address is an admin
    /// @param addr - The address to be checked
    function isAdmin(address addr) external view returns (bool) {
        return admins[addr] == 1;
    }
}

File 6 of 14 : Transfers.sol
// SPDX-License-Identifier: MIT
pragma solidity 0.8.15;

import { TransferHelper } from "../libraries/TransferHelper.sol";

contract Transfers {
    /// @notice Transfers tokens. no-op if amount is zero
    /// @param token    - The Token to be transferred
    /// @param from     - The originating address
    /// @param to       - The destination address
    /// @param id       - The TokenId to be transferred, 0 if ERC20
    /// @param amount   - The amount of tokens to be transferred
    function _transfer(address token, address from, address to, uint256 id, uint256 amount) internal {
        if (amount > 0) {
            if (id == 0) {
                return from == address(this)
                    ? TransferHelper._transferERC20(token, to, amount)
                    : TransferHelper._transferFromERC20(token, from, to, amount);
            }
            return TransferHelper._transferFromERC1155(token, from, to, id, amount);
        }
    }
}

File 7 of 14 : IExchange.sol
// SPDX-License-Identifier: MIT
pragma solidity 0.8.15;

import { Order } from "../libraries/Structs.sol";

interface IExchange {
    function getCollateral() external view returns (address);

    function getCtf() external view returns (address);

    function matchOrders(
        Order memory takerOrder,
        Order[] memory makerOrders,
        uint256 takerFillAmount,
        uint256[] memory makerFillAmounts
    ) external;
}

File 8 of 14 : IFeeModule.sol
// SPDX-License-Identifier: MIT
pragma solidity 0.8.15;

import { Order } from "../libraries/Structs.sol";

interface IFeeModuleEE {
    /// @notice Emitted when fees are withdrawn from the FeeModule
    event FeeWithdrawn(address token, address to, uint256 id, uint256 amount);

    /// @notice Emitted when fees are refunded to the order maker
    event FeeRefunded(address token, address to, uint256 id, uint256 amount);
}

interface IFeeModule is IFeeModuleEE {
    function matchOrders(
        Order memory takerOrder,
        Order[] memory makerOrders,
        uint256 takerFillAmount,
        uint256[] memory makerFillAmounts,
        uint256 makerFeeRate
    ) external;

    function withdrawFees(address to, uint256 id, uint256 amount) external;
}

File 9 of 14 : Structs.sol
// SPDX-License-Identifier: MIT
pragma solidity 0.8.15;

enum Side {
    // 0: buy
    BUY,
    // 1: sell
    SELL
}

enum SignatureType {
    // 0: ECDSA EIP712 signatures signed by EOAs
    EOA,
    // 1: EIP712 signatures signed by EOAs that own Polymarket Proxy wallets
    POLY_PROXY,
    // 2: EIP712 signatures signed by EOAs that own Polymarket Gnosis safes
    POLY_GNOSIS_SAFE
}

struct OrderStatus {
    bool isFilledOrCancelled;
    uint256 remaining;
}

struct Order {
    /// @notice Unique salt to ensure entropy
    uint256 salt;
    /// @notice Maker of the order, i.e the source of funds for the order
    address maker;
    /// @notice Signer of the order
    address signer;
    /// @notice Address of the order taker. The zero address is used to indicate a public order
    address taker;
    /// @notice Token Id of the CTF ERC1155 asset to be bought or sold
    /// If BUY, this is the tokenId of the asset to be bought, i.e the makerAssetId
    /// If SELL, this is the tokenId of the asset to be sold, i.e the takerAssetId
    uint256 tokenId;
    /// @notice Maker amount, i.e the maximum amount of tokens to be sold
    uint256 makerAmount;
    /// @notice Taker amount, i.e the minimum amount of tokens to be received
    uint256 takerAmount;
    /// @notice Timestamp after which the order is expired
    uint256 expiration;
    /// @notice Nonce used for onchain cancellations
    uint256 nonce;
    /// @notice Fee rate, in basis points, charged to the order maker, charged on proceeds
    uint256 feeRateBps;
    /// @notice The side of the order: BUY or SELL
    Side side;
    /// @notice Signature type used by the Order: EOA, POLY_PROXY or POLY_GNOSIS_SAFE
    SignatureType signatureType;
    /// @notice The order signature
    bytes signature;
}

File 10 of 14 : CalculatorHelper.sol
// SPDX-License-Identifier: MIT
pragma solidity 0.8.15;

import { Order, Side } from "../libraries/Structs.sol";

library CalculatorHelper {
    uint256 internal constant ONE = 10 ** 18;

    uint256 internal constant BPS_DIVISOR = 10_000;

    /// @notice Calculates the fee refund for an Order
    /// @notice Used to refund Order makers if a user signs a fee into an Order that is > the expeceted fee
    /// @param orderFeeRateBps      - The fee rate signed into the order by the user
    /// @param operatorFeeRateBps   - The fee rate chosen by the operator
    /// @param outcomeTokens        - The number of outcome tokens
    /// @param makerAmount          - The maker amount of the order
    /// @param takerAmount          - The taker amount of the order
    /// @param side                 - The side of the order
    function calcRefund(
        uint256 orderFeeRateBps,
        uint256 operatorFeeRateBps,
        uint256 outcomeTokens,
        uint256 makerAmount,
        uint256 takerAmount,
        Side side
    ) internal pure returns (uint256) {
        if (orderFeeRateBps <= operatorFeeRateBps) return 0;

        uint256 fee = calculateFee(orderFeeRateBps, outcomeTokens, makerAmount, takerAmount, side);

        // fee calced using order fee minus fee calced using the operator fee
        if (operatorFeeRateBps == 0) return fee;
        return fee - calculateFee(operatorFeeRateBps, outcomeTokens, makerAmount, takerAmount, side);
    }

    /// @notice Calculates the taking amount, i.e the amount of tokens to be received
    /// @param makingAmount - The making amount
    /// @param makerAmount  - The maker amount of the order
    /// @param takerAmount  - The taker amount of the order
    function calculateTakingAmount(uint256 makingAmount, uint256 makerAmount, uint256 takerAmount)
        internal
        pure
        returns (uint256)
    {
        if (makerAmount == 0) return 0;
        return makingAmount * takerAmount / makerAmount;
    }

    /// @notice Calculates the fee for an order
    /// @dev Fees are calculated based on amount of outcome tokens and the order's feeRate
    /// @param feeRateBps       - Fee rate, in basis points
    /// @param outcomeTokens    - The number of outcome tokens
    /// @param makerAmount      - The maker amount of the order
    /// @param takerAmount      - The taker amount of the order
    /// @param side             - The side of the order
    function calculateFee(
        uint256 feeRateBps,
        uint256 outcomeTokens,
        uint256 makerAmount,
        uint256 takerAmount,
        Side side
    ) internal pure returns (uint256 fee) {
        if (feeRateBps > 0) {
            uint256 price = _calculatePrice(makerAmount, takerAmount, side);
            if (price > 0 && price <= ONE) {
                if (side == Side.BUY) {
                    // Fee charged on Token Proceeds:
                    // baseRate * min(price, 1-price) * (outcomeTokens/price)
                    fee = (feeRateBps * min(price, ONE - price) * outcomeTokens) / (price * BPS_DIVISOR);
                } else {
                    // Fee charged on Collateral proceeds:
                    // baseRate * min(price, 1-price) * outcomeTokens
                    fee = feeRateBps * min(price, ONE - price) * outcomeTokens / (BPS_DIVISOR * ONE);
                }
            }
        }
    }

    function min(uint256 a, uint256 b) internal pure returns (uint256) {
        return a < b ? a : b;
    }

    function _calculatePrice(uint256 makerAmount, uint256 takerAmount, Side side) internal pure returns (uint256) {
        if (side == Side.BUY) return takerAmount != 0 ? makerAmount * ONE / takerAmount : 0;
        return makerAmount != 0 ? takerAmount * ONE / makerAmount : 0;
    }
}

File 11 of 14 : IAuth.sol
// SPDX-License-Identifier: MIT
pragma solidity 0.8.15;

interface IAuthEE {
    error NotAdmin();

    /// @notice Emitted when a new admin is added
    event NewAdmin(address indexed admin, address indexed newAdminAddress);

    /// @notice Emitted when an admin is removed
    event RemovedAdmin(address indexed admin, address indexed removedAdmin);
}

interface IAuth is IAuthEE {
    function isAdmin(address) external view returns (bool);

    function addAdmin(address) external;

    function removeAdmin(address) external;

    function renounceAdmin() external;
}

File 12 of 14 : TransferHelper.sol
// SPDX-License-Identifier: MIT
pragma solidity <0.9.0;

import { ERC1155 } from "solmate/tokens/ERC1155.sol";
import { SafeTransferLib, ERC20 } from "solmate/utils/SafeTransferLib.sol";

/// @title TransferHelper
/// @notice Helper method to transfer tokens
library TransferHelper {
    /// @notice Transfers tokens from msg.sender to a recipient
    /// @param token    - The contract address of the token which will be transferred
    /// @param to       - The recipient of the transfer
    /// @param amount   - The amount to be transferred
    function _transferERC20(address token, address to, uint256 amount) internal {
        SafeTransferLib.safeTransfer(ERC20(token), to, amount);
    }

    /// @notice Transfers tokens from the targeted address to the given destination
    /// @param token    - The contract address of the token to be transferred
    /// @param from     - The originating address from which the tokens will be transferred
    /// @param to       - The destination address of the transfer
    /// @param amount   - The amount to be transferred
    function _transferFromERC20(address token, address from, address to, uint256 amount) internal {
        SafeTransferLib.safeTransferFrom(ERC20(token), from, to, amount);
    }

    /// @notice Transfer an ERC1155 token
    /// @param token    - The contract address of the token to be transferred
    /// @param from     - The originating address from which the tokens will be transferred
    /// @param to       - The destination address of the transfer
    /// @param id       - The tokenId of the token to be transferred
    /// @param amount   - The amount to be transferred
    function _transferFromERC1155(address token, address from, address to, uint256 id, uint256 amount) internal {
        ERC1155(token).safeTransferFrom(from, to, id, amount, "");
    }
}

File 13 of 14 : SafeTransferLib.sol
// SPDX-License-Identifier: AGPL-3.0-only
pragma solidity >=0.8.0;

import {ERC20} from "../tokens/ERC20.sol";

/// @notice Safe ETH and ERC20 transfer library that gracefully handles missing return values.
/// @author Solmate (https://github.com/transmissions11/solmate/blob/main/src/utils/SafeTransferLib.sol)
/// @dev Use with caution! Some functions in this library knowingly create dirty bits at the destination of the free memory pointer.
/// @dev Note that none of the functions in this library check that a token has code at all! That responsibility is delegated to the caller.
library SafeTransferLib {
    /*//////////////////////////////////////////////////////////////
                             ETH OPERATIONS
    //////////////////////////////////////////////////////////////*/

    function safeTransferETH(address to, uint256 amount) internal {
        bool success;

        /// @solidity memory-safe-assembly
        assembly {
            // Transfer the ETH and store if it succeeded or not.
            success := call(gas(), to, amount, 0, 0, 0, 0)
        }

        require(success, "ETH_TRANSFER_FAILED");
    }

    /*//////////////////////////////////////////////////////////////
                            ERC20 OPERATIONS
    //////////////////////////////////////////////////////////////*/

    function safeTransferFrom(
        ERC20 token,
        address from,
        address to,
        uint256 amount
    ) internal {
        bool success;

        /// @solidity memory-safe-assembly
        assembly {
            // Get a pointer to some free memory.
            let freeMemoryPointer := mload(0x40)

            // Write the abi-encoded calldata into memory, beginning with the function selector.
            mstore(freeMemoryPointer, 0x23b872dd00000000000000000000000000000000000000000000000000000000)
            mstore(add(freeMemoryPointer, 4), and(from, 0xffffffffffffffffffffffffffffffffffffffff)) // Append and mask the "from" argument.
            mstore(add(freeMemoryPointer, 36), and(to, 0xffffffffffffffffffffffffffffffffffffffff)) // Append and mask the "to" argument.
            mstore(add(freeMemoryPointer, 68), amount) // Append the "amount" argument. Masking not required as it's a full 32 byte type.

            success := and(
                // Set success to whether the call reverted, if not we check it either
                // returned exactly 1 (can't just be non-zero data), or had no return data.
                or(and(eq(mload(0), 1), gt(returndatasize(), 31)), iszero(returndatasize())),
                // We use 100 because the length of our calldata totals up like so: 4 + 32 * 3.
                // We use 0 and 32 to copy up to 32 bytes of return data into the scratch space.
                // Counterintuitively, this call must be positioned second to the or() call in the
                // surrounding and() call or else returndatasize() will be zero during the computation.
                call(gas(), token, 0, freeMemoryPointer, 100, 0, 32)
            )
        }

        require(success, "TRANSFER_FROM_FAILED");
    }

    function safeTransfer(
        ERC20 token,
        address to,
        uint256 amount
    ) internal {
        bool success;

        /// @solidity memory-safe-assembly
        assembly {
            // Get a pointer to some free memory.
            let freeMemoryPointer := mload(0x40)

            // Write the abi-encoded calldata into memory, beginning with the function selector.
            mstore(freeMemoryPointer, 0xa9059cbb00000000000000000000000000000000000000000000000000000000)
            mstore(add(freeMemoryPointer, 4), and(to, 0xffffffffffffffffffffffffffffffffffffffff)) // Append and mask the "to" argument.
            mstore(add(freeMemoryPointer, 36), amount) // Append the "amount" argument. Masking not required as it's a full 32 byte type.

            success := and(
                // Set success to whether the call reverted, if not we check it either
                // returned exactly 1 (can't just be non-zero data), or had no return data.
                or(and(eq(mload(0), 1), gt(returndatasize(), 31)), iszero(returndatasize())),
                // We use 68 because the length of our calldata totals up like so: 4 + 32 * 2.
                // We use 0 and 32 to copy up to 32 bytes of return data into the scratch space.
                // Counterintuitively, this call must be positioned second to the or() call in the
                // surrounding and() call or else returndatasize() will be zero during the computation.
                call(gas(), token, 0, freeMemoryPointer, 68, 0, 32)
            )
        }

        require(success, "TRANSFER_FAILED");
    }

    function safeApprove(
        ERC20 token,
        address to,
        uint256 amount
    ) internal {
        bool success;

        /// @solidity memory-safe-assembly
        assembly {
            // Get a pointer to some free memory.
            let freeMemoryPointer := mload(0x40)

            // Write the abi-encoded calldata into memory, beginning with the function selector.
            mstore(freeMemoryPointer, 0x095ea7b300000000000000000000000000000000000000000000000000000000)
            mstore(add(freeMemoryPointer, 4), and(to, 0xffffffffffffffffffffffffffffffffffffffff)) // Append and mask the "to" argument.
            mstore(add(freeMemoryPointer, 36), amount) // Append the "amount" argument. Masking not required as it's a full 32 byte type.

            success := and(
                // Set success to whether the call reverted, if not we check it either
                // returned exactly 1 (can't just be non-zero data), or had no return data.
                or(and(eq(mload(0), 1), gt(returndatasize(), 31)), iszero(returndatasize())),
                // We use 68 because the length of our calldata totals up like so: 4 + 32 * 2.
                // We use 0 and 32 to copy up to 32 bytes of return data into the scratch space.
                // Counterintuitively, this call must be positioned second to the or() call in the
                // surrounding and() call or else returndatasize() will be zero during the computation.
                call(gas(), token, 0, freeMemoryPointer, 68, 0, 32)
            )
        }

        require(success, "APPROVE_FAILED");
    }
}

File 14 of 14 : ERC20.sol
// SPDX-License-Identifier: AGPL-3.0-only
pragma solidity >=0.8.0;

/// @notice Modern and gas efficient ERC20 + EIP-2612 implementation.
/// @author Solmate (https://github.com/transmissions11/solmate/blob/main/src/tokens/ERC20.sol)
/// @author Modified from Uniswap (https://github.com/Uniswap/uniswap-v2-core/blob/master/contracts/UniswapV2ERC20.sol)
/// @dev Do not manually set balances without updating totalSupply, as the sum of all user balances must not exceed it.
abstract contract ERC20 {
    /*//////////////////////////////////////////////////////////////
                                 EVENTS
    //////////////////////////////////////////////////////////////*/

    event Transfer(address indexed from, address indexed to, uint256 amount);

    event Approval(address indexed owner, address indexed spender, uint256 amount);

    /*//////////////////////////////////////////////////////////////
                            METADATA STORAGE
    //////////////////////////////////////////////////////////////*/

    string public name;

    string public symbol;

    uint8 public immutable decimals;

    /*//////////////////////////////////////////////////////////////
                              ERC20 STORAGE
    //////////////////////////////////////////////////////////////*/

    uint256 public totalSupply;

    mapping(address => uint256) public balanceOf;

    mapping(address => mapping(address => uint256)) public allowance;

    /*//////////////////////////////////////////////////////////////
                            EIP-2612 STORAGE
    //////////////////////////////////////////////////////////////*/

    uint256 internal immutable INITIAL_CHAIN_ID;

    bytes32 internal immutable INITIAL_DOMAIN_SEPARATOR;

    mapping(address => uint256) public nonces;

    /*//////////////////////////////////////////////////////////////
                               CONSTRUCTOR
    //////////////////////////////////////////////////////////////*/

    constructor(
        string memory _name,
        string memory _symbol,
        uint8 _decimals
    ) {
        name = _name;
        symbol = _symbol;
        decimals = _decimals;

        INITIAL_CHAIN_ID = block.chainid;
        INITIAL_DOMAIN_SEPARATOR = computeDomainSeparator();
    }

    /*//////////////////////////////////////////////////////////////
                               ERC20 LOGIC
    //////////////////////////////////////////////////////////////*/

    function approve(address spender, uint256 amount) public virtual returns (bool) {
        allowance[msg.sender][spender] = amount;

        emit Approval(msg.sender, spender, amount);

        return true;
    }

    function transfer(address to, uint256 amount) public virtual returns (bool) {
        balanceOf[msg.sender] -= amount;

        // Cannot overflow because the sum of all user
        // balances can't exceed the max uint256 value.
        unchecked {
            balanceOf[to] += amount;
        }

        emit Transfer(msg.sender, to, amount);

        return true;
    }

    function transferFrom(
        address from,
        address to,
        uint256 amount
    ) public virtual returns (bool) {
        uint256 allowed = allowance[from][msg.sender]; // Saves gas for limited approvals.

        if (allowed != type(uint256).max) allowance[from][msg.sender] = allowed - amount;

        balanceOf[from] -= amount;

        // Cannot overflow because the sum of all user
        // balances can't exceed the max uint256 value.
        unchecked {
            balanceOf[to] += amount;
        }

        emit Transfer(from, to, amount);

        return true;
    }

    /*//////////////////////////////////////////////////////////////
                             EIP-2612 LOGIC
    //////////////////////////////////////////////////////////////*/

    function permit(
        address owner,
        address spender,
        uint256 value,
        uint256 deadline,
        uint8 v,
        bytes32 r,
        bytes32 s
    ) public virtual {
        require(deadline >= block.timestamp, "PERMIT_DEADLINE_EXPIRED");

        // Unchecked because the only math done is incrementing
        // the owner's nonce which cannot realistically overflow.
        unchecked {
            address recoveredAddress = ecrecover(
                keccak256(
                    abi.encodePacked(
                        "\x19\x01",
                        DOMAIN_SEPARATOR(),
                        keccak256(
                            abi.encode(
                                keccak256(
                                    "Permit(address owner,address spender,uint256 value,uint256 nonce,uint256 deadline)"
                                ),
                                owner,
                                spender,
                                value,
                                nonces[owner]++,
                                deadline
                            )
                        )
                    )
                ),
                v,
                r,
                s
            );

            require(recoveredAddress != address(0) && recoveredAddress == owner, "INVALID_SIGNER");

            allowance[recoveredAddress][spender] = value;
        }

        emit Approval(owner, spender, value);
    }

    function DOMAIN_SEPARATOR() public view virtual returns (bytes32) {
        return block.chainid == INITIAL_CHAIN_ID ? INITIAL_DOMAIN_SEPARATOR : computeDomainSeparator();
    }

    function computeDomainSeparator() internal view virtual returns (bytes32) {
        return
            keccak256(
                abi.encode(
                    keccak256("EIP712Domain(string name,string version,uint256 chainId,address verifyingContract)"),
                    keccak256(bytes(name)),
                    keccak256("1"),
                    block.chainid,
                    address(this)
                )
            );
    }

    /*//////////////////////////////////////////////////////////////
                        INTERNAL MINT/BURN LOGIC
    //////////////////////////////////////////////////////////////*/

    function _mint(address to, uint256 amount) internal virtual {
        totalSupply += amount;

        // Cannot overflow because the sum of all user
        // balances can't exceed the max uint256 value.
        unchecked {
            balanceOf[to] += amount;
        }

        emit Transfer(address(0), to, amount);
    }

    function _burn(address from, uint256 amount) internal virtual {
        balanceOf[from] -= amount;

        // Cannot underflow because a user's balance
        // will never be larger than the total supply.
        unchecked {
            totalSupply -= amount;
        }

        emit Transfer(from, address(0), amount);
    }
}

Settings
{
  "remappings": [
    "ds-test/=lib/forge-std/lib/ds-test/src/",
    "forge-std/=lib/forge-std/src/",
    "solmate/=lib/solmate/src/",
    "forge-gas-snapshot/=lib/forge-gas-snapshot/src/",
    "openzeppelin-contracts/=lib/ctf-exchange/lib/openzeppelin-contracts/contracts/",
    "common/=lib/ctf-exchange/src/common/",
    "creator/=lib/ctf-exchange/src/creator/",
    "ctf-exchange/=lib/ctf-exchange/src/",
    "dev/=lib/ctf-exchange/src/dev/",
    "exchange-fee-module/=lib/exchange-fee-module/src/",
    "exchange/=lib/ctf-exchange/src/exchange/",
    "openzeppelin/=lib/ctf-exchange/lib/openzeppelin-contracts/contracts/"
  ],
  "optimizer": {
    "enabled": true,
    "runs": 1000000
  },
  "metadata": {
    "useLiteralContent": false,
    "bytecodeHash": "ipfs"
  },
  "outputSelection": {
    "*": {
      "*": [
        "evm.bytecode",
        "evm.deployedBytecode",
        "devdoc",
        "userdoc",
        "metadata",
        "abi"
      ]
    }
  },
  "evmVersion": "london",
  "libraries": {}
}

Contract Security Audit

Contract ABI

[{"inputs":[{"internalType":"address","name":"_negRiskCtfExchange","type":"address"},{"internalType":"address","name":"_negRiskAdapter","type":"address"},{"internalType":"address","name":"_ctf","type":"address"}],"stateMutability":"nonpayable","type":"constructor"},{"inputs":[],"name":"NotAdmin","type":"error"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"token","type":"address"},{"indexed":false,"internalType":"address","name":"to","type":"address"},{"indexed":false,"internalType":"uint256","name":"id","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"}],"name":"FeeRefunded","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"token","type":"address"},{"indexed":false,"internalType":"address","name":"to","type":"address"},{"indexed":false,"internalType":"uint256","name":"id","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"amount","type":"uint256"}],"name":"FeeWithdrawn","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"admin","type":"address"},{"indexed":true,"internalType":"address","name":"newAdminAddress","type":"address"}],"name":"NewAdmin","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"admin","type":"address"},{"indexed":true,"internalType":"address","name":"removedAdmin","type":"address"}],"name":"RemovedAdmin","type":"event"},{"inputs":[{"internalType":"address","name":"admin","type":"address"}],"name":"addAdmin","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"}],"name":"admins","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"collateral","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"ctf","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"exchange","outputs":[{"internalType":"contract IExchange","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"addr","type":"address"}],"name":"isAdmin","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"components":[{"internalType":"uint256","name":"salt","type":"uint256"},{"internalType":"address","name":"maker","type":"address"},{"internalType":"address","name":"signer","type":"address"},{"internalType":"address","name":"taker","type":"address"},{"internalType":"uint256","name":"tokenId","type":"uint256"},{"internalType":"uint256","name":"makerAmount","type":"uint256"},{"internalType":"uint256","name":"takerAmount","type":"uint256"},{"internalType":"uint256","name":"expiration","type":"uint256"},{"internalType":"uint256","name":"nonce","type":"uint256"},{"internalType":"uint256","name":"feeRateBps","type":"uint256"},{"internalType":"enum Side","name":"side","type":"uint8"},{"internalType":"enum SignatureType","name":"signatureType","type":"uint8"},{"internalType":"bytes","name":"signature","type":"bytes"}],"internalType":"struct Order","name":"takerOrder","type":"tuple"},{"components":[{"internalType":"uint256","name":"salt","type":"uint256"},{"internalType":"address","name":"maker","type":"address"},{"internalType":"address","name":"signer","type":"address"},{"internalType":"address","name":"taker","type":"address"},{"internalType":"uint256","name":"tokenId","type":"uint256"},{"internalType":"uint256","name":"makerAmount","type":"uint256"},{"internalType":"uint256","name":"takerAmount","type":"uint256"},{"internalType":"uint256","name":"expiration","type":"uint256"},{"internalType":"uint256","name":"nonce","type":"uint256"},{"internalType":"uint256","name":"feeRateBps","type":"uint256"},{"internalType":"enum Side","name":"side","type":"uint8"},{"internalType":"enum SignatureType","name":"signatureType","type":"uint8"},{"internalType":"bytes","name":"signature","type":"bytes"}],"internalType":"struct Order[]","name":"makerOrders","type":"tuple[]"},{"internalType":"uint256","name":"takerFillAmount","type":"uint256"},{"internalType":"uint256[]","name":"makerFillAmounts","type":"uint256[]"},{"internalType":"uint256","name":"makerFeeRate","type":"uint256"}],"name":"matchOrders","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"},{"internalType":"address","name":"","type":"address"},{"internalType":"uint256[]","name":"","type":"uint256[]"},{"internalType":"uint256[]","name":"","type":"uint256[]"},{"internalType":"bytes","name":"","type":"bytes"}],"name":"onERC1155BatchReceived","outputs":[{"internalType":"bytes4","name":"","type":"bytes4"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"},{"internalType":"address","name":"","type":"address"},{"internalType":"uint256","name":"","type":"uint256"},{"internalType":"uint256","name":"","type":"uint256"},{"internalType":"bytes","name":"","type":"bytes"}],"name":"onERC1155Received","outputs":[{"internalType":"bytes4","name":"","type":"bytes4"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"admin","type":"address"}],"name":"removeAdmin","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"renounceAdmin","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256","name":"id","type":"uint256"},{"internalType":"uint256","name":"amount","type":"uint256"}],"name":"withdrawFees","outputs":[],"stateMutability":"nonpayable","type":"function"}]

60e06040523480156200001157600080fd5b5060405162001a3b38038062001a3b83398101604081905262000034916200022b565b3360009081526020818152604091829020600190556001600160a01b03851660808190528251635c1548fb60e01b8152925186939192635c1548fb92600480820193918290030181865afa15801562000091573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190620000b7919062000275565b6001600160a01b031660a0816001600160a01b0316815250506080516001600160a01b0316633b521d786040518163ffffffff1660e01b8152600401602060405180830381865afa15801562000111573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019062000137919062000275565b6001600160a01b0390811660c05260405163a22cb46560e01b8152848216600482015260016024820152908316915063a22cb46590604401600060405180830381600087803b1580156200018a57600080fd5b505af11580156200019f573d6000803e3d6000fd5b505060405163a22cb46560e01b8152306004820152600160248201526001600160a01b038416925063a22cb4659150604401600060405180830381600087803b158015620001ec57600080fd5b505af115801562000201573d6000803e3d6000fd5b505050505050506200029a565b80516001600160a01b03811681146200022657600080fd5b919050565b6000806000606084860312156200024157600080fd5b6200024c846200020e565b92506200025c602085016200020e565b91506200026c604085016200020e565b90509250925092565b6000602082840312156200028857600080fd5b62000293826200020e565b9392505050565b60805160a05160c05161174f620002ec6000396000818160f3015281816103b2015261092701526000818161028f015281816103d801526109010152600081816102680152610612015261174f6000f3fe608060405234801561001057600080fd5b50600436106100d45760003560e01c80638bad0c0a11610081578063d2f7265a1161005b578063d2f7265a14610263578063d8dfeb451461028a578063f23a6e61146102b157600080fd5b80638bad0c0a146101dc578063bc197c81146101e4578063d2539b371461025057600080fd5b8063425c2096116100b2578063425c209614610188578063429b62e51461019b57806370480275146101c957600080fd5b80631785f53c146100d957806322a9339f146100ee57806324d7806c1461013f575b600080fd5b6100ec6100e7366004610db4565b6102c4565b005b6101157f000000000000000000000000000000000000000000000000000000000000000081565b60405173ffffffffffffffffffffffffffffffffffffffff90911681526020015b60405180910390f35b61017861014d366004610db4565b73ffffffffffffffffffffffffffffffffffffffff1660009081526020819052604090205460011490565b6040519015158152602001610136565b6100ec610196366004610dcf565b61035f565b6101bb6101a9366004610db4565b60006020819052908152604090205481565b604051908152602001610136565b6100ec6101d7366004610db4565b61046c565b6100ec610508565b61021f6101f2366004610e90565b7fbc197c810000000000000000000000000000000000000000000000000000000098975050505050505050565b6040517fffffffff000000000000000000000000000000000000000000000000000000009091168152602001610136565b6100ec61025e36600461121a565b61058c565b6101157f000000000000000000000000000000000000000000000000000000000000000081565b6101157f000000000000000000000000000000000000000000000000000000000000000081565b61021f6102bf366004611323565b610691565b3360009081526020819052604090205460011461030d576040517f7bfa4b9f00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b73ffffffffffffffffffffffffffffffffffffffff81166000818152602081905260408082208290555133917f787a2e12f4a55b658b8f573c32432ee11a5e8b51677d1e1e937aaf6a0bb5776e91a350565b336000908152602081905260409020546001146103a8576040517f7bfa4b9f00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b600082156103d6577f00000000000000000000000000000000000000000000000000000000000000006103f8565b7f00000000000000000000000000000000000000000000000000000000000000005b905061040781308686866106bd565b6040805173ffffffffffffffffffffffffffffffffffffffff808416825286166020820152908101849052606081018390527f6ce49f8691a80db5eb4f60cd55b14640529346a7ddf9bf8f77a423fa6a10bfdb9060800160405180910390a150505050565b336000908152602081905260409020546001146104b5576040517f7bfa4b9f00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b73ffffffffffffffffffffffffffffffffffffffff8116600081815260208190526040808220600190555133917ff9ffabca9c8276e99321725bcb43fb076a6c66a54b7f21c4e8146d8519b417dc91a350565b33600090815260208190526040902054600114610551576040517f7bfa4b9f00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b336000818152602081905260408082208290555182917f787a2e12f4a55b658b8f573c32432ee11a5e8b51677d1e1e937aaf6a0bb5776e91a3565b336000908152602081905260409020546001146105d5576040517f7bfa4b9f00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6040517fe60f0c0500000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff7f0000000000000000000000000000000000000000000000000000000000000000169063e60f0c059061064d90889088908890889060040161155c565b600060405180830381600087803b15801561066757600080fd5b505af115801561067b573d6000803e3d6000fd5b5050505061068a848383610711565b5050505050565b7ff23a6e61000000000000000000000000000000000000000000000000000000005b9695505050505050565b801561068a57816000036107045773ffffffffffffffffffffffffffffffffffffffff841630146106f9576106f485858584610789565b61068a565b6106f485848361079b565b6106f485858585856107ab565b825160005b8181101561068a57828582815181106107315761073161162c565b602002602001015161012001511115610781576107818582815181106107595761075961162c565b60200260200101518583815181106107735761077361162c565b602002602001015185610857565b600101610716565b610795848484846109d1565b50505050565b6107a6838383610ac1565b505050565b6040517ff242432a00000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff85811660048301528481166024830152604482018490526064820183905260a06084830152600060a483015286169063f242432a9060c401600060405180830381600087803b15801561083857600080fd5b505af115801561084c573d6000803e3d6000fd5b505050505050505050565b6101208301516000906108b0908383876101400151600181111561087d5761087d61139b565b14610888578561089b565b61089b868860a001518960c00151610b90565b8760a001518860c00151896101400151610bc1565b905060008085610140015160018111156108cc576108cc61139b565b146108d85760006108de565b84608001515b905060008086610140015160018111156108fa576108fa61139b565b14610925577f0000000000000000000000000000000000000000000000000000000000000000610947565b7f00000000000000000000000000000000000000000000000000000000000000005b905082156109c9576109608130886020015185876106bd565b6020808701516040805173ffffffffffffffffffffffffffffffffffffffff808616825290921692820192909252908101839052606081018490527f18fe0464eb77016dc4e227eb0d690e4002756d82b442143bbfb874548952b5f29060800160405180910390a15b505050505050565b60006040517f23b872dd00000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff8516600482015273ffffffffffffffffffffffffffffffffffffffff841660248201528260448201526020600060648360008a5af13d15601f3d116001600051141617169150508061068a576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601460248201527f5452414e534645525f46524f4d5f4641494c454400000000000000000000000060448201526064015b60405180910390fd5b60006040517fa9059cbb00000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff84166004820152826024820152602060006044836000895af13d15601f3d1160016000511416171691505080610795576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152600f60248201527f5452414e534645525f4641494c454400000000000000000000000000000000006044820152606401610ab8565b600082600003610ba257506000610bba565b82610bad838661168a565b610bb791906116c7565b90505b9392505050565b6000858711610bd2575060006106b3565b6000610be18887878787610c15565b905086600003610bf25790506106b3565b610bff8787878787610c15565b610c099082611702565b98975050505050505050565b60008515610cfd576000610c2a858585610d06565b9050600081118015610c445750670de0b6b3a76400008111155b15610cfb576000836001811115610c5d57610c5d61139b565b03610caf57610c6e6127108261168a565b86610c8a83610c8581670de0b6b3a7640000611702565b610d75565b610c94908a61168a565b610c9e919061168a565b610ca891906116c7565b9150610cfb565b610cc3670de0b6b3a764000061271061168a565b86610cda83610c8581670de0b6b3a7640000611702565b610ce4908a61168a565b610cee919061168a565b610cf891906116c7565b91505b505b95945050505050565b600080826001811115610d1b57610d1b61139b565b03610d535782600003610d2f576000610d4c565b82610d42670de0b6b3a76400008661168a565b610d4c91906116c7565b9050610bba565b83600003610d62576000610bb7565b83610bad670de0b6b3a76400008561168a565b6000818310610d845781610bba565b5090919050565b803573ffffffffffffffffffffffffffffffffffffffff81168114610daf57600080fd5b919050565b600060208284031215610dc657600080fd5b610bba82610d8b565b600080600060608486031215610de457600080fd5b610ded84610d8b565b95602085013595506040909401359392505050565b60008083601f840112610e1457600080fd5b50813567ffffffffffffffff811115610e2c57600080fd5b6020830191508360208260051b8501011115610e4757600080fd5b9250929050565b60008083601f840112610e6057600080fd5b50813567ffffffffffffffff811115610e7857600080fd5b602083019150836020828501011115610e4757600080fd5b60008060008060008060008060a0898b031215610eac57600080fd5b610eb589610d8b565b9750610ec360208a01610d8b565b9650604089013567ffffffffffffffff80821115610ee057600080fd5b610eec8c838d01610e02565b909850965060608b0135915080821115610f0557600080fd5b610f118c838d01610e02565b909650945060808b0135915080821115610f2a57600080fd5b50610f378b828c01610e4e565b999c989b5096995094979396929594505050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b6040516101a0810167ffffffffffffffff81118282101715610f9e57610f9e610f4b565b60405290565b604051601f82017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe016810167ffffffffffffffff81118282101715610feb57610feb610f4b565b604052919050565b803560028110610daf57600080fd5b803560038110610daf57600080fd5b600082601f83011261102257600080fd5b813567ffffffffffffffff81111561103c5761103c610f4b565b61106d60207fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0601f84011601610fa4565b81815284602083860101111561108257600080fd5b816020850160208301376000918101602001919091529392505050565b60006101a082840312156110b257600080fd5b6110ba610f7a565b9050813581526110cc60208301610d8b565b60208201526110dd60408301610d8b565b60408201526110ee60608301610d8b565b60608201526080820135608082015260a082013560a082015260c082013560c082015260e082013560e0820152610100808301358183015250610120808301358183015250610140611141818401610ff3565b90820152610160611153838201611002565b908201526101808281013567ffffffffffffffff81111561117357600080fd5b61117f85828601611011565b82840152505092915050565b600067ffffffffffffffff8211156111a5576111a5610f4b565b5060051b60200190565b600082601f8301126111c057600080fd5b813560206111d56111d08361118b565b610fa4565b82815260059290921b840181019181810190868411156111f457600080fd5b8286015b8481101561120f57803583529183019183016111f8565b509695505050505050565b600080600080600060a0868803121561123257600080fd5b853567ffffffffffffffff8082111561124a57600080fd5b61125689838a0161109f565b965060209150818801358181111561126d57600080fd5b8801601f81018a1361127e57600080fd5b803561128c6111d08261118b565b81815260059190911b8201840190848101908c8311156112ab57600080fd5b8584015b838110156112e3578035868111156112c75760008081fd5b6112d58f898389010161109f565b8452509186019186016112af565b50985050505060408801359450606088013591508082111561130457600080fd5b50611311888289016111af565b95989497509295608001359392505050565b60008060008060008060a0878903121561133c57600080fd5b61134587610d8b565b955061135360208801610d8b565b94506040870135935060608701359250608087013567ffffffffffffffff81111561137d57600080fd5b61138989828a01610e4e565b979a9699509497509295939492505050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052602160045260246000fd5b600281106113da576113da61139b565b9052565b600381106113da576113da61139b565b6000815180845260005b81811015611414576020818501810151868301820152016113f8565b81811115611426576000602083870101525b50601f017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0169290920160200192915050565b60006101a0825184526020830151611489602086018273ffffffffffffffffffffffffffffffffffffffff169052565b5060408301516114b1604086018273ffffffffffffffffffffffffffffffffffffffff169052565b5060608301516114d9606086018273ffffffffffffffffffffffffffffffffffffffff169052565b506080830151608085015260a083015160a085015260c083015160c085015260e083015160e08501526101008084015181860152506101208084015181860152506101408084015161152d828701826113ca565b505061016080840151611542828701826113de565b50506101808084015182828701526106b3838701826113ee565b60808152600061156f6080830187611459565b6020838203818501528187518084528284019150828160051b850101838a0160005b838110156115dd577fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe08784030185526115cb838351611459565b94860194925090850190600101611591565b50506040870189905286810360608801528751808252908401945091505081860160005b8281101561161d57815185529383019390830190600101611601565b50929998505050505050505050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b6000817fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff04831182151516156116c2576116c261165b565b500290565b6000826116fd577f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b500490565b6000828210156117145761171461165b565b50039056fea2646970667358221220c04f2b5d87667b52cb5187c5c3f20a9a4d227761c5e990068ae66b0b75eaa30764736f6c634300080f0033000000000000000000000000c5d563a36ae78145c45a50134d48a1215220f80a000000000000000000000000d91e80cf2e7be2e162c6513ced06f1dd0da352960000000000000000000000004d97dcd97ec945f40cf65f87097ace5ea0476045

Deployed Bytecode

0x608060405234801561001057600080fd5b50600436106100d45760003560e01c80638bad0c0a11610081578063d2f7265a1161005b578063d2f7265a14610263578063d8dfeb451461028a578063f23a6e61146102b157600080fd5b80638bad0c0a146101dc578063bc197c81146101e4578063d2539b371461025057600080fd5b8063425c2096116100b2578063425c209614610188578063429b62e51461019b57806370480275146101c957600080fd5b80631785f53c146100d957806322a9339f146100ee57806324d7806c1461013f575b600080fd5b6100ec6100e7366004610db4565b6102c4565b005b6101157f000000000000000000000000d91e80cf2e7be2e162c6513ced06f1dd0da3529681565b60405173ffffffffffffffffffffffffffffffffffffffff90911681526020015b60405180910390f35b61017861014d366004610db4565b73ffffffffffffffffffffffffffffffffffffffff1660009081526020819052604090205460011490565b6040519015158152602001610136565b6100ec610196366004610dcf565b61035f565b6101bb6101a9366004610db4565b60006020819052908152604090205481565b604051908152602001610136565b6100ec6101d7366004610db4565b61046c565b6100ec610508565b61021f6101f2366004610e90565b7fbc197c810000000000000000000000000000000000000000000000000000000098975050505050505050565b6040517fffffffff000000000000000000000000000000000000000000000000000000009091168152602001610136565b6100ec61025e36600461121a565b61058c565b6101157f000000000000000000000000c5d563a36ae78145c45a50134d48a1215220f80a81565b6101157f0000000000000000000000002791bca1f2de4661ed88a30c99a7a9449aa8417481565b61021f6102bf366004611323565b610691565b3360009081526020819052604090205460011461030d576040517f7bfa4b9f00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b73ffffffffffffffffffffffffffffffffffffffff81166000818152602081905260408082208290555133917f787a2e12f4a55b658b8f573c32432ee11a5e8b51677d1e1e937aaf6a0bb5776e91a350565b336000908152602081905260409020546001146103a8576040517f7bfa4b9f00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b600082156103d6577f000000000000000000000000d91e80cf2e7be2e162c6513ced06f1dd0da352966103f8565b7f0000000000000000000000002791bca1f2de4661ed88a30c99a7a9449aa841745b905061040781308686866106bd565b6040805173ffffffffffffffffffffffffffffffffffffffff808416825286166020820152908101849052606081018390527f6ce49f8691a80db5eb4f60cd55b14640529346a7ddf9bf8f77a423fa6a10bfdb9060800160405180910390a150505050565b336000908152602081905260409020546001146104b5576040517f7bfa4b9f00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b73ffffffffffffffffffffffffffffffffffffffff8116600081815260208190526040808220600190555133917ff9ffabca9c8276e99321725bcb43fb076a6c66a54b7f21c4e8146d8519b417dc91a350565b33600090815260208190526040902054600114610551576040517f7bfa4b9f00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b336000818152602081905260408082208290555182917f787a2e12f4a55b658b8f573c32432ee11a5e8b51677d1e1e937aaf6a0bb5776e91a3565b336000908152602081905260409020546001146105d5576040517f7bfa4b9f00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6040517fe60f0c0500000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff7f000000000000000000000000c5d563a36ae78145c45a50134d48a1215220f80a169063e60f0c059061064d90889088908890889060040161155c565b600060405180830381600087803b15801561066757600080fd5b505af115801561067b573d6000803e3d6000fd5b5050505061068a848383610711565b5050505050565b7ff23a6e61000000000000000000000000000000000000000000000000000000005b9695505050505050565b801561068a57816000036107045773ffffffffffffffffffffffffffffffffffffffff841630146106f9576106f485858584610789565b61068a565b6106f485848361079b565b6106f485858585856107ab565b825160005b8181101561068a57828582815181106107315761073161162c565b602002602001015161012001511115610781576107818582815181106107595761075961162c565b60200260200101518583815181106107735761077361162c565b602002602001015185610857565b600101610716565b610795848484846109d1565b50505050565b6107a6838383610ac1565b505050565b6040517ff242432a00000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff85811660048301528481166024830152604482018490526064820183905260a06084830152600060a483015286169063f242432a9060c401600060405180830381600087803b15801561083857600080fd5b505af115801561084c573d6000803e3d6000fd5b505050505050505050565b6101208301516000906108b0908383876101400151600181111561087d5761087d61139b565b14610888578561089b565b61089b868860a001518960c00151610b90565b8760a001518860c00151896101400151610bc1565b905060008085610140015160018111156108cc576108cc61139b565b146108d85760006108de565b84608001515b905060008086610140015160018111156108fa576108fa61139b565b14610925577f0000000000000000000000002791bca1f2de4661ed88a30c99a7a9449aa84174610947565b7f000000000000000000000000d91e80cf2e7be2e162c6513ced06f1dd0da352965b905082156109c9576109608130886020015185876106bd565b6020808701516040805173ffffffffffffffffffffffffffffffffffffffff808616825290921692820192909252908101839052606081018490527f18fe0464eb77016dc4e227eb0d690e4002756d82b442143bbfb874548952b5f29060800160405180910390a15b505050505050565b60006040517f23b872dd00000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff8516600482015273ffffffffffffffffffffffffffffffffffffffff841660248201528260448201526020600060648360008a5af13d15601f3d116001600051141617169150508061068a576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601460248201527f5452414e534645525f46524f4d5f4641494c454400000000000000000000000060448201526064015b60405180910390fd5b60006040517fa9059cbb00000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff84166004820152826024820152602060006044836000895af13d15601f3d1160016000511416171691505080610795576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152600f60248201527f5452414e534645525f4641494c454400000000000000000000000000000000006044820152606401610ab8565b600082600003610ba257506000610bba565b82610bad838661168a565b610bb791906116c7565b90505b9392505050565b6000858711610bd2575060006106b3565b6000610be18887878787610c15565b905086600003610bf25790506106b3565b610bff8787878787610c15565b610c099082611702565b98975050505050505050565b60008515610cfd576000610c2a858585610d06565b9050600081118015610c445750670de0b6b3a76400008111155b15610cfb576000836001811115610c5d57610c5d61139b565b03610caf57610c6e6127108261168a565b86610c8a83610c8581670de0b6b3a7640000611702565b610d75565b610c94908a61168a565b610c9e919061168a565b610ca891906116c7565b9150610cfb565b610cc3670de0b6b3a764000061271061168a565b86610cda83610c8581670de0b6b3a7640000611702565b610ce4908a61168a565b610cee919061168a565b610cf891906116c7565b91505b505b95945050505050565b600080826001811115610d1b57610d1b61139b565b03610d535782600003610d2f576000610d4c565b82610d42670de0b6b3a76400008661168a565b610d4c91906116c7565b9050610bba565b83600003610d62576000610bb7565b83610bad670de0b6b3a76400008561168a565b6000818310610d845781610bba565b5090919050565b803573ffffffffffffffffffffffffffffffffffffffff81168114610daf57600080fd5b919050565b600060208284031215610dc657600080fd5b610bba82610d8b565b600080600060608486031215610de457600080fd5b610ded84610d8b565b95602085013595506040909401359392505050565b60008083601f840112610e1457600080fd5b50813567ffffffffffffffff811115610e2c57600080fd5b6020830191508360208260051b8501011115610e4757600080fd5b9250929050565b60008083601f840112610e6057600080fd5b50813567ffffffffffffffff811115610e7857600080fd5b602083019150836020828501011115610e4757600080fd5b60008060008060008060008060a0898b031215610eac57600080fd5b610eb589610d8b565b9750610ec360208a01610d8b565b9650604089013567ffffffffffffffff80821115610ee057600080fd5b610eec8c838d01610e02565b909850965060608b0135915080821115610f0557600080fd5b610f118c838d01610e02565b909650945060808b0135915080821115610f2a57600080fd5b50610f378b828c01610e4e565b999c989b5096995094979396929594505050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b6040516101a0810167ffffffffffffffff81118282101715610f9e57610f9e610f4b565b60405290565b604051601f82017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe016810167ffffffffffffffff81118282101715610feb57610feb610f4b565b604052919050565b803560028110610daf57600080fd5b803560038110610daf57600080fd5b600082601f83011261102257600080fd5b813567ffffffffffffffff81111561103c5761103c610f4b565b61106d60207fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0601f84011601610fa4565b81815284602083860101111561108257600080fd5b816020850160208301376000918101602001919091529392505050565b60006101a082840312156110b257600080fd5b6110ba610f7a565b9050813581526110cc60208301610d8b565b60208201526110dd60408301610d8b565b60408201526110ee60608301610d8b565b60608201526080820135608082015260a082013560a082015260c082013560c082015260e082013560e0820152610100808301358183015250610120808301358183015250610140611141818401610ff3565b90820152610160611153838201611002565b908201526101808281013567ffffffffffffffff81111561117357600080fd5b61117f85828601611011565b82840152505092915050565b600067ffffffffffffffff8211156111a5576111a5610f4b565b5060051b60200190565b600082601f8301126111c057600080fd5b813560206111d56111d08361118b565b610fa4565b82815260059290921b840181019181810190868411156111f457600080fd5b8286015b8481101561120f57803583529183019183016111f8565b509695505050505050565b600080600080600060a0868803121561123257600080fd5b853567ffffffffffffffff8082111561124a57600080fd5b61125689838a0161109f565b965060209150818801358181111561126d57600080fd5b8801601f81018a1361127e57600080fd5b803561128c6111d08261118b565b81815260059190911b8201840190848101908c8311156112ab57600080fd5b8584015b838110156112e3578035868111156112c75760008081fd5b6112d58f898389010161109f565b8452509186019186016112af565b50985050505060408801359450606088013591508082111561130457600080fd5b50611311888289016111af565b95989497509295608001359392505050565b60008060008060008060a0878903121561133c57600080fd5b61134587610d8b565b955061135360208801610d8b565b94506040870135935060608701359250608087013567ffffffffffffffff81111561137d57600080fd5b61138989828a01610e4e565b979a9699509497509295939492505050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052602160045260246000fd5b600281106113da576113da61139b565b9052565b600381106113da576113da61139b565b6000815180845260005b81811015611414576020818501810151868301820152016113f8565b81811115611426576000602083870101525b50601f017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0169290920160200192915050565b60006101a0825184526020830151611489602086018273ffffffffffffffffffffffffffffffffffffffff169052565b5060408301516114b1604086018273ffffffffffffffffffffffffffffffffffffffff169052565b5060608301516114d9606086018273ffffffffffffffffffffffffffffffffffffffff169052565b506080830151608085015260a083015160a085015260c083015160c085015260e083015160e08501526101008084015181860152506101208084015181860152506101408084015161152d828701826113ca565b505061016080840151611542828701826113de565b50506101808084015182828701526106b3838701826113ee565b60808152600061156f6080830187611459565b6020838203818501528187518084528284019150828160051b850101838a0160005b838110156115dd577fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe08784030185526115cb838351611459565b94860194925090850190600101611591565b50506040870189905286810360608801528751808252908401945091505081860160005b8281101561161d57815185529383019390830190600101611601565b50929998505050505050505050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b6000817fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff04831182151516156116c2576116c261165b565b500290565b6000826116fd577f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b500490565b6000828210156117145761171461165b565b50039056fea2646970667358221220c04f2b5d87667b52cb5187c5c3f20a9a4d227761c5e990068ae66b0b75eaa30764736f6c634300080f0033

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

000000000000000000000000c5d563a36ae78145c45a50134d48a1215220f80a000000000000000000000000d91e80cf2e7be2e162c6513ced06f1dd0da352960000000000000000000000004d97dcd97ec945f40cf65f87097ace5ea0476045

-----Decoded View---------------
Arg [0] : _negRiskCtfExchange (address): 0xC5d563A36AE78145C45a50134d48A1215220f80a
Arg [1] : _negRiskAdapter (address): 0xd91E80cF2E7be2e162c6513ceD06f1dD0dA35296
Arg [2] : _ctf (address): 0x4D97DCd97eC945f40cF65F87097ACe5EA0476045

-----Encoded View---------------
3 Constructor Arguments found :
Arg [0] : 000000000000000000000000c5d563a36ae78145c45a50134d48a1215220f80a
Arg [1] : 000000000000000000000000d91e80cf2e7be2e162c6513ced06f1dd0da35296
Arg [2] : 0000000000000000000000004d97dcd97ec945f40cf65f87097ace5ea0476045


Block Transaction 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
[ 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.