More Info
Private Name Tags
ContractCreator
Latest 25 from a total of 588 transactions
Transaction Hash |
Method
|
Block
|
From
|
To
|
Value | ||||
---|---|---|---|---|---|---|---|---|---|
Cancel Order | 17270223 | 419 days ago | IN | 0 ETH | 0.00393654 | ||||
Finalize Order | 16590958 | 515 days ago | IN | 0 ETH | 0.00387741 | ||||
Cancel Order | 16585209 | 516 days ago | IN | 0 ETH | 0.0047875 | ||||
Finalize Order | 16532809 | 523 days ago | IN | 0 ETH | 0.00281491 | ||||
Finalize Order | 16523146 | 524 days ago | IN | 0 ETH | 0.00369784 | ||||
Cancel Order | 16482979 | 530 days ago | IN | 0 ETH | 0.00126936 | ||||
Finalize Order | 16458485 | 534 days ago | IN | 0 ETH | 0.01388744 | ||||
Finalize Order | 16445807 | 535 days ago | IN | 0 ETH | 0.0094037 | ||||
Finalize Order | 16388700 | 543 days ago | IN | 0 ETH | 0.00319404 | ||||
Finalize Order | 16350810 | 549 days ago | IN | 0 ETH | 0.00300141 | ||||
Cancel Order | 16337188 | 550 days ago | IN | 0 ETH | 0.00161829 | ||||
Cancel Order | 16332156 | 551 days ago | IN | 0 ETH | 0.00140306 | ||||
Finalize Order | 16319605 | 553 days ago | IN | 0 ETH | 0.00349346 | ||||
Finalize Order | 16315237 | 554 days ago | IN | 0 ETH | 0.00840753 | ||||
Finalize Order | 16314425 | 554 days ago | IN | 0 ETH | 0.00319491 | ||||
Finalize Order | 16295848 | 556 days ago | IN | 0 ETH | 0.00313767 | ||||
Finalize Order | 16290377 | 557 days ago | IN | 0 ETH | 0.00774802 | ||||
Finalize Order | 16289817 | 557 days ago | IN | 0 ETH | 0.00301874 | ||||
Finalize Order | 16283863 | 558 days ago | IN | 0 ETH | 0.00298302 | ||||
Finalize Order | 16265348 | 560 days ago | IN | 0 ETH | 0.0018308 | ||||
Finalize Order | 16253865 | 562 days ago | IN | 0 ETH | 0.00722893 | ||||
Finalize Order | 16253641 | 562 days ago | IN | 0 ETH | 0.0072312 | ||||
Finalize Order | 16239828 | 564 days ago | IN | 0 ETH | 0.00223575 | ||||
Finalize Order | 16238064 | 564 days ago | IN | 0 ETH | 0.00217944 | ||||
Finalize Order | 16224912 | 566 days ago | IN | 0 ETH | 0.00252943 |
Latest 25 internal transactions (View All)
Advanced mode:
Parent Transaction Hash | Block | From | To | Value | ||
---|---|---|---|---|---|---|
17270223 | 419 days ago | 0.25 ETH | ||||
16590958 | 515 days ago | 0.40474 ETH | ||||
16590958 | 515 days ago | 0.00826 ETH | ||||
16585209 | 516 days ago | 1.6 ETH | ||||
16532809 | 523 days ago | 0.49 ETH | ||||
16532809 | 523 days ago | 0.01 ETH | ||||
16523146 | 524 days ago | 0.2254 ETH | ||||
16523146 | 524 days ago | 0.0046 ETH | ||||
16482979 | 530 days ago | 0.3 ETH | ||||
16458485 | 534 days ago | 0.35 ETH | ||||
16445807 | 535 days ago | 0.05 ETH | ||||
16388700 | 543 days ago | 0.1176 ETH | ||||
16388700 | 543 days ago | 0.0024 ETH | ||||
16350810 | 549 days ago | 0.196 ETH | ||||
16350810 | 549 days ago | 0.004 ETH | ||||
16337188 | 550 days ago | 0.15 ETH | ||||
16332156 | 551 days ago | 0.25 ETH | ||||
16319605 | 553 days ago | 0.2 ETH | ||||
16315237 | 554 days ago | 0.15 ETH | ||||
16314425 | 554 days ago | 0.12 ETH | ||||
16295848 | 556 days ago | 0.1 ETH | ||||
16290377 | 557 days ago | 0.25 ETH | ||||
16289817 | 557 days ago | 0.147 ETH | ||||
16289817 | 557 days ago | 0.003 ETH | ||||
16283863 | 558 days ago | 0.196 ETH |
Loading...
Loading
Contract Name:
RequestMarketV1
Compiler Version
v0.8.2+commit.661d1103
Optimization Enabled:
Yes with 200 runs
Other Settings:
default evmVersion
Contract Source Code (Solidity Standard Json-Input format)
/* .......... .(MMMMMMMMMMMMMMa,. .(MMMMMMMMMMMMMMMMMMMMN, .+MMMMMMMMMMMMMMMMMMMMMMMMN, .MMMMMMMMMMMMMMMMMMMMMMMMMMMMb .MMMMMMMMMMMMMMMMMMMMMMMMMMMMMMh .MMMMMMMF TMMMMMMMMMMMMF` ?MMMMb MMMMMMMa, .+MMMMMMMMMM# ,MMMM, .MMMMMMMMMgMMMMMMMMMMMMN, .MMMM] ,MMMMMMMMMMMMMMMMMMMMMB^ .J.JMMMMMMF .MMMMMMMMMMMMMMMMMMM#= .JMMMMMMMMMMF .JMMMMMMMMMMMMMMMMMB= .(MMMMMMMMMMMM> MMMMMMMMMMMMMMM#"! .JMMMMMMMMMMMMMF ,MMMMMMMMMMMB"` .dMMMMMM9`7MMMMM# .""""""! .(MMMMMMMMMMaMMMMM@ ..MMMMMMMMMMMMMMMMMM3 .&MMMMMMMMMMMMMMMMMMM" ?YMMMMMMMMMMMMMM#"` _7"""""""! */ // SPDX-License-Identifier: MIT pragma solidity ^0.8.0; import "./MarketBase.sol"; /** * @title A request market for NFTs on Recomet. * @notice The Recomet Request Marketplace is a contract for requesters to request and trade NFTs. * It supports buying and selling by request. */ contract RequestMarketV1 is MarketBase { /** * @notice Set immutable variables for the implementation contract. * @dev Using immutable instead of constants allows us to use different values on testnet. * @param name The user readable name of the signing domain. * @param version The current major version of the signing domain. * @param trustedForwarder The Recomet TrustedForwarder address. */ constructor( string memory name, string memory version, address trustedForwarder ) MarketBase(name, version, trustedForwarder) {} }
// SPDX-License-Identifier: MIT pragma solidity ^0.8.0; import "@openzeppelin/contracts/utils/math/SafeMath.sol"; import "@openzeppelin/contracts/security/ReentrancyGuard.sol"; import "./libraries/OrderLib.sol"; import "./libraries/OrderExtLib.sol"; import "./extensions/ERC2771Context.sol"; import "./extensions/MarketEscrow.sol"; import "./extensions/MarketTxValidatable.sol"; /** * @title MarketBase * MarketBase - The Market's central contract. */ abstract contract MarketBase is ERC2771Context, ReentrancyGuard, MarketEscrow, MarketTxValidatable { using SafeMath for uint256; /** * @notice Set immutable variables for the implementation contract. * @dev Using immutable instead of constants allows us to use different values on testnet. * @param name The user readable name of the signing domain. * @param version The current major version of the signing domain. * @param trustedForwarder The Recomet TrustedForwarder address. */ constructor( string memory name, string memory version, address trustedForwarder ) EIP712(name, version) ERC2771Context(trustedForwarder) Ownable() ReentrancyGuard() AdminController(_msgSender()) {} /** * @notice Set the price of the order and escrow to the market contract. * The Deposit is held in escrow until the order is finalized or canceled. * @param order The information of order. * @param signatureLeft The signature of the maker. * @param signatureRight The signature of taker or forwarder. */ function createOrder( OrderLib.OrderData memory order, bytes memory signatureLeft, bytes memory signatureRight ) external payable nonReentrant { (bool isValid, string memory errorMessage) = _validateFull( OrderLib.CREATE_ORDER_TYPE, order, signatureLeft, signatureRight ); require(isValid, errorMessage); bytes32 orderId = OrderLib.hashKey(order); _createDeposit(orderId, order.taker, order.takeAsset); } /** * @notice Update the price of the order, refund the old currency and escrow the new currency to the market contract. * The Deposit is held in escrow until the order is finalized or canceled. * @param order The information of order. * @param signatureLeft The signature of the maker. * @param signatureRight The signature of taker or forwarder. */ function updateOrder( OrderLib.OrderData memory order, bytes memory signatureLeft, bytes memory signatureRight ) external payable nonReentrant { (bool isValid, string memory errorMessage) = _validateFull( OrderLib.UPDATE_ORDER_TYPE, order, signatureLeft, signatureRight ); require(isValid, errorMessage); bytes32 orderId = OrderLib.hashKey(order); _updateDeposit(orderId, order.taker, order.takeAsset); } /** * @notice Cancel the order and refund the currency in the market contract. * @param order The information of order. * @param signatureLeft The signature of the maker. * @param signatureRight The signature of taker or forwarder. */ function cancelOrder( OrderLib.OrderData memory order, bytes memory signatureLeft, bytes memory signatureRight ) external nonReentrant { bytes32 orderId = OrderLib.hashKey(order); AssetLib.AssetData memory asset = getDeposit(orderId); if ( asset.value != 0 && asset.assetType.assetClass != bytes4(0) && order.end < block.timestamp ) { (bool isValid, string memory errorMessage) = _validateOrderAndSig( OrderLib.CANCEL_ORDER_TYPE, order, order.taker, signatureRight ); require(isValid, errorMessage); } else { (bool isValid, string memory errorMessage) = _validateFull( OrderLib.CANCEL_ORDER_TYPE, order, signatureLeft, signatureRight ); require(isValid, errorMessage); } _withdraw(orderId, order.taker); } /** * @notice Finalize the order and allows for payment and NFT to be sent. * @param order The information of order. * @param signatureLeft The signature of the maker. * @param signatureRight The signature of taker or forwarder. */ function finalizeOrder( OrderLib.OrderData memory order, bytes memory signatureLeft, bytes memory signatureRight ) external payable nonReentrant { OrderExtLib.OrderExtData memory data = OrderExtLib.decodeOrderExtData( order.data ); (bool isValid, string memory errorMessage) = _validateFull( OrderLib.FINALIZE_ORDER_TYPE, order, signatureLeft, signatureRight ); require(isValid, errorMessage); bytes32 orderId = OrderLib.hashKey(order); _transfer(order.makeAsset, order.maker, order.taker); _pay(orderId, data.payouts, data.fees); } /** * @notice Get the version of order. */ function getVersion() external pure returns (bytes4) { return OrderExtLib.VERSION; } function _msgSender() internal view override(Context, ERC2771Context) returns (address) { return super._msgSender(); } function _msgData() internal view override(Context, ERC2771Context) returns (bytes memory) { return super._msgData(); } /** * @notice Verify order and signature. * @param orderType The type of order. * @param order The information of order. * @param signatureLeft The signature of the maker. * @param signatureRight The signature of taker or forwarder. */ function _validateFull( bytes4 orderType, OrderLib.OrderData memory order, bytes memory signatureLeft, bytes memory signatureRight ) internal view returns (bool, string memory) { (bool isOrderValid, string memory orderErrorMessage) = _validateOrder( orderType, order ); if (!isOrderValid) { return (isOrderValid, orderErrorMessage); } ( bool isMakerSigValid, string memory makerSigErrorMessage ) = _validateSig(order, order.maker, signatureLeft); if (!isMakerSigValid) { return (isMakerSigValid, makerSigErrorMessage); } ( bool isTakerSigValid, string memory takerSigErrorMessage ) = _validateSig(order, order.taker, signatureRight); if (!isTakerSigValid && orderType != OrderLib.FINALIZE_ORDER_TYPE) { return (isTakerSigValid, takerSigErrorMessage); } else if ( !isTakerSigValid && orderType == OrderLib.FINALIZE_ORDER_TYPE ) { OrderExtLib.OrderExtData memory dataExt = OrderExtLib .decodeOrderExtData(order.data); ( bool isForwarderSigValid, string memory forwarderSigErrorMessage ) = _validateSig(order, dataExt.forwarder, signatureRight); if (!isForwarderSigValid) { return (isForwarderSigValid, forwarderSigErrorMessage); } } return (true, ""); } /** * @notice Verify order and signature. * @param orderType The type of order. * @param order The information of order. * @param signer The address of the signer. * @param signature The signature of signer. */ function _validateOrderAndSig( bytes4 orderType, OrderLib.OrderData memory order, address signer, bytes memory signature ) internal view returns (bool, string memory) { (bool isOrderValid, string memory orderErrorMessag) = _validateOrder( orderType, order ); if (!isOrderValid) { return (isOrderValid, orderErrorMessag); } (bool isSigValid, string memory sigErrorMessage) = _validateSig( order, signer, signature ); if (!isSigValid) { return (isSigValid, sigErrorMessage); } return (true, ""); } /** * @notice Verify order. * @param orderType The type of order. * @param order The information of order. */ function _validateOrder(bytes4 orderType, OrderLib.OrderData memory order) private view returns (bool, string memory) { bool isTargetOrderType = orderType == OrderLib.CREATE_ORDER_TYPE || orderType == OrderLib.UPDATE_ORDER_TYPE || orderType == OrderLib.FINALIZE_ORDER_TYPE; if (order.orderType != orderType) { return (false, "MarketBase: orderType verification failed"); } else if (isTargetOrderType && order.start > block.timestamp) { return (false, "MarketBase: start verification failed"); } else if (isTargetOrderType && order.end < block.timestamp) { return (false, "MarketBase: end verification failed"); } return OrderLib.validate(order); } /** * @notice Verify signature. * @param order The information of order. * @param signer The address of the signer. * @param signature The signature of signer. */ function _validateSig( OrderLib.OrderData memory order, address signer, bytes memory signature ) private view returns (bool, string memory) { bytes32 hash = OrderLib.hash(order); (bool isValid, string memory errorMessage) = _validateTx( signer, hash, signature ); return (isValid, errorMessage); } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts v4.4.1 (utils/math/SafeMath.sol) pragma solidity ^0.8.0; // CAUTION // This version of SafeMath should only be used with Solidity 0.8 or later, // because it relies on the compiler's built in overflow checks. /** * @dev Wrappers over Solidity's arithmetic operations. * * NOTE: `SafeMath` is generally not needed starting with Solidity 0.8, since the compiler * now has built in overflow checking. */ library SafeMath { /** * @dev Returns the addition of two unsigned integers, with an overflow flag. * * _Available since v3.4._ */ function tryAdd(uint256 a, uint256 b) internal pure returns (bool, uint256) { unchecked { uint256 c = a + b; if (c < a) return (false, 0); return (true, c); } } /** * @dev Returns the substraction of two unsigned integers, with an overflow flag. * * _Available since v3.4._ */ function trySub(uint256 a, uint256 b) internal pure returns (bool, uint256) { unchecked { if (b > a) return (false, 0); return (true, a - b); } } /** * @dev Returns the multiplication of two unsigned integers, with an overflow flag. * * _Available since v3.4._ */ function tryMul(uint256 a, uint256 b) internal pure returns (bool, uint256) { unchecked { // Gas optimization: this is cheaper than requiring 'a' not being zero, but the // benefit is lost if 'b' is also tested. // See: https://github.com/OpenZeppelin/openzeppelin-contracts/pull/522 if (a == 0) return (true, 0); uint256 c = a * b; if (c / a != b) return (false, 0); return (true, c); } } /** * @dev Returns the division of two unsigned integers, with a division by zero flag. * * _Available since v3.4._ */ function tryDiv(uint256 a, uint256 b) internal pure returns (bool, uint256) { unchecked { if (b == 0) return (false, 0); return (true, a / b); } } /** * @dev Returns the remainder of dividing two unsigned integers, with a division by zero flag. * * _Available since v3.4._ */ function tryMod(uint256 a, uint256 b) internal pure returns (bool, uint256) { unchecked { if (b == 0) return (false, 0); return (true, a % b); } } /** * @dev Returns the addition of two unsigned integers, reverting on * overflow. * * Counterpart to Solidity's `+` operator. * * Requirements: * * - Addition cannot overflow. */ function add(uint256 a, uint256 b) internal pure returns (uint256) { return a + b; } /** * @dev Returns the subtraction of two unsigned integers, reverting on * overflow (when the result is negative). * * Counterpart to Solidity's `-` operator. * * Requirements: * * - Subtraction cannot overflow. */ function sub(uint256 a, uint256 b) internal pure returns (uint256) { return a - b; } /** * @dev Returns the multiplication of two unsigned integers, reverting on * overflow. * * Counterpart to Solidity's `*` operator. * * Requirements: * * - Multiplication cannot overflow. */ function mul(uint256 a, uint256 b) internal pure returns (uint256) { return a * b; } /** * @dev Returns the integer division of two unsigned integers, reverting on * division by zero. The result is rounded towards zero. * * Counterpart to Solidity's `/` operator. * * Requirements: * * - The divisor cannot be zero. */ function div(uint256 a, uint256 b) internal pure returns (uint256) { return a / b; } /** * @dev Returns the remainder of dividing two unsigned integers. (unsigned integer modulo), * reverting when dividing by zero. * * Counterpart to Solidity's `%` operator. This function uses a `revert` * opcode (which leaves remaining gas untouched) while Solidity uses an * invalid opcode to revert (consuming all remaining gas). * * Requirements: * * - The divisor cannot be zero. */ function mod(uint256 a, uint256 b) internal pure returns (uint256) { return a % b; } /** * @dev Returns the subtraction of two unsigned integers, reverting with custom message on * overflow (when the result is negative). * * CAUTION: This function is deprecated because it requires allocating memory for the error * message unnecessarily. For custom revert reasons use {trySub}. * * Counterpart to Solidity's `-` operator. * * Requirements: * * - Subtraction cannot overflow. */ function sub( uint256 a, uint256 b, string memory errorMessage ) internal pure returns (uint256) { unchecked { require(b <= a, errorMessage); return a - b; } } /** * @dev Returns the integer division of two unsigned integers, reverting with custom message on * division by zero. The result is rounded towards zero. * * Counterpart to Solidity's `/` operator. Note: this function uses a * `revert` opcode (which leaves remaining gas untouched) while Solidity * uses an invalid opcode to revert (consuming all remaining gas). * * Requirements: * * - The divisor cannot be zero. */ function div( uint256 a, uint256 b, string memory errorMessage ) internal pure returns (uint256) { unchecked { require(b > 0, errorMessage); return a / b; } } /** * @dev Returns the remainder of dividing two unsigned integers. (unsigned integer modulo), * reverting with custom message when dividing by zero. * * CAUTION: This function is deprecated because it requires allocating memory for the error * message unnecessarily. For custom revert reasons use {tryMod}. * * Counterpart to Solidity's `%` operator. This function uses a `revert` * opcode (which leaves remaining gas untouched) while Solidity uses an * invalid opcode to revert (consuming all remaining gas). * * Requirements: * * - The divisor cannot be zero. */ function mod( uint256 a, uint256 b, string memory errorMessage ) internal pure returns (uint256) { unchecked { require(b > 0, errorMessage); return a % b; } } }
// 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; } }
// SPDX-License-Identifier: MIT pragma solidity ^0.8.0; import "../../utils/libraries/AssetLib.sol"; import "./OrderExtLib.sol"; library OrderLib { bytes4 public constant CREATE_ORDER_TYPE = bytes4(keccak256("CREATE")); bytes4 public constant UPDATE_ORDER_TYPE = bytes4(keccak256("UPDATE")); bytes4 public constant CANCEL_ORDER_TYPE = bytes4(keccak256("CANCEL")); bytes4 public constant FINALIZE_ORDER_TYPE = bytes4(keccak256("FINALIZE")); bytes32 constant ORDER_TYPEHASH = keccak256( "OrderData(address maker,AssetData makeAsset,address taker,AssetData takeAsset,uint256 salt,uint256 start,uint256 end,bytes4 orderType,bytes data)AssetData(AssetType assetType,uint256 value)AssetType(bytes4 assetClass,bytes data)" ); struct OrderData { address maker; AssetLib.AssetData makeAsset; address taker; AssetLib.AssetData takeAsset; uint256 salt; uint256 start; uint256 end; bytes4 orderType; bytes data; } function hashKey(OrderData memory order) internal pure returns (bytes32) { return keccak256( abi.encode( order.maker, order.taker, order.salt, order.start, order.end, order.data ) ); } function hash(OrderData memory order) internal pure returns (bytes32) { return keccak256( abi.encode( ORDER_TYPEHASH, order.maker, AssetLib.hash(order.makeAsset), order.taker, AssetLib.hash(order.takeAsset), order.salt, order.start, order.end, order.orderType, keccak256(order.data) ) ); } function validate(OrderData memory order) internal pure returns (bool, string memory) { if (order.maker == address(0)) { return (false, "OrderLib: maker validation failed"); } else if ( order.makeAsset.value == 0 || order.makeAsset.assetType.assetClass == bytes4(0) ) { return (false, "OrderLib: makeAsset validation failed"); } else if (order.taker == address(0)) { return (false, "OrderLib: taker validation failed"); } else if ( order.takeAsset.value == 0 || order.takeAsset.assetType.assetClass == bytes4(0) ) { return (false, "OrderLib: takeAsset validation failed"); } else if (order.salt == 0) { return (false, "OrderLib: salt validation failed"); } else if (order.start == 0) { return (false, "OrderLib: start validation failed"); } else if (order.end == 0) { return (false, "OrderLib: end validation failed"); } else if ( !(order.orderType == CREATE_ORDER_TYPE || order.orderType == UPDATE_ORDER_TYPE || order.orderType == CANCEL_ORDER_TYPE || order.orderType == FINALIZE_ORDER_TYPE) ) { return (false, "OrderLib: orderType validation failed"); } return OrderExtLib.validate(OrderExtLib.decodeOrderExtData(order.data)); } }
// SPDX-License-Identifier: MIT pragma solidity ^0.8.0; import "../../utils/libraries/AssetLib.sol"; import "../../utils/libraries/PartLib.sol"; library OrderExtLib { bytes4 public constant VERSION = bytes4(keccak256("V1")); bytes32 constant ORDER_EXT_TYPEHASH = keccak256( "OrderExtData(bytes4 version,address forwarder,PartData[] payouts,PartData[] fees)PartData(address account,uint256 value)" ); struct OrderExtData { bytes4 version; address forwarder; PartLib.PartData[] payouts; PartLib.PartData[] fees; } function hash(OrderExtData memory orderExt) internal pure returns (bytes32) { bytes32[] memory payoutsBytes = new bytes32[](orderExt.payouts.length); for (uint256 i = 0; i < orderExt.payouts.length; i++) { payoutsBytes[i] = PartLib.hash(orderExt.payouts[i]); } bytes32[] memory feesBytes = new bytes32[](orderExt.fees.length); for (uint256 i = 0; i < orderExt.fees.length; i++) { feesBytes[i] = PartLib.hash(orderExt.fees[i]); } return keccak256( abi.encode( ORDER_EXT_TYPEHASH, orderExt.version, orderExt.forwarder, keccak256(abi.encodePacked(payoutsBytes)), keccak256(abi.encodePacked(feesBytes)) ) ); } function decodeOrderExtData(bytes memory data) internal pure returns (OrderExtData memory) { return abi.decode(data, (OrderExtData)); } function validate(OrderExtData memory orderExt) internal pure returns (bool, string memory) { if (orderExt.version != VERSION) { return (false, "OrderExtLib: version validation failed"); } else if (orderExt.payouts.length == 0) { return (false, "OrderExtLib: payouts validation failed"); } return (true, ""); } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts v4.4.1 (metatx/ERC2771Context.sol) pragma solidity ^0.8.0; import "@openzeppelin/contracts/utils/Context.sol"; /** * @title ERC2771Context * ERC2771Context - This contract manages the ERC2771 for market. */ abstract contract ERC2771Context is Context { address private _trustedForwarder; constructor(address trustedForwarder) { _trustedForwarder = trustedForwarder; } function isTrustedForwarder(address forwarder) public view virtual returns (bool) { return forwarder == _trustedForwarder; } function _msgSender() internal view virtual override returns (address sender) { if (isTrustedForwarder(msg.sender)) { // The assembly code is more direct than the Solidity version using `abi.decode`. assembly { sender := shr(96, calldataload(sub(calldatasize(), 20))) } } else { return super._msgSender(); } } function _msgData() internal view virtual override returns (bytes calldata) { if (isTrustedForwarder(msg.sender)) { return msg.data[:msg.data.length - 20]; } else { return super._msgData(); } } }
// SPDX-License-Identifier: MIT pragma solidity ^0.8.0; import "@openzeppelin/contracts/utils/math/SafeMath.sol"; import "../../utils/libraries/AssetLib.sol"; import "../../utils/libraries/BasisPointLib.sol"; import "../../utils/libraries/PartLib.sol"; import "./MarketTransfer.sol"; /** * @title MarketEscrow * MarketEscrow - This contract manages the escrow for Market. */ abstract contract MarketEscrow is MarketTransfer { using BasisPointLib for uint256; using SafeMath for uint256; enum UpdateAssetStatus { TypeChange, ValueChangeUp, ValueChangeDown, NoChange } mapping(bytes32 => AssetLib.AssetData) private _deposits; mapping(bytes32 => bool) private _completed; event Deposited( bytes32 id, address indexed payee, AssetLib.AssetData asset ); event Paid( bytes32 id, PartLib.PartData[] payouts, PartLib.PartData[] fees, AssetLib.AssetData asset ); event Withdrawn( bytes32 id, address indexed payee, AssetLib.AssetData asset ); modifier whenEscrowDeposited(bytes32 id) { require( getDeposit(id).value != 0 && getDeposit(id).assetType.assetClass != bytes4(0), "MarketEscrow: escrow already not depositd" ); _; } modifier whenNotEscrowCompleted(bytes32 id) { require(!getCompleted(id), "MarketEscrow: escrow already completed"); _; } function getCompleted(bytes32 id) public view returns (bool) { return _completed[id]; } function getDeposit(bytes32 id) public view returns (AssetLib.AssetData memory) { return _deposits[id]; } function _createDeposit( bytes32 id, address payee, AssetLib.AssetData memory asset ) internal whenNotEscrowCompleted(id) { _setDeposit(id, asset); _transfer(asset, payee, address(this)); emit Deposited(id, payee, asset); } function _updateDeposit( bytes32 id, address payee, AssetLib.AssetData memory newAsset ) internal whenEscrowDeposited(id) whenNotEscrowCompleted(id) { AssetLib.AssetData memory currentAsset = getDeposit(id); UpdateAssetStatus status = _matchUpdateAssetStatus( currentAsset, newAsset ); if (status == UpdateAssetStatus.TypeChange) { _setDeposit(id, newAsset); _transfer(currentAsset, address(this), payee); _transfer(newAsset, payee, address(this)); } else if (status == UpdateAssetStatus.ValueChangeDown) { uint256 diffValue = currentAsset.value.sub(newAsset.value); _setDeposit(id, newAsset); _transfer( AssetLib.AssetData(currentAsset.assetType, diffValue), address(this), payee ); } else if (status == UpdateAssetStatus.ValueChangeUp) { uint256 diffValue = newAsset.value.sub(currentAsset.value); _setDeposit(id, newAsset); _transfer( AssetLib.AssetData(currentAsset.assetType, diffValue), payee, address(this) ); } else { revert("MarketEscrow: no asset change"); } emit Deposited(id, payee, newAsset); } function _pay( bytes32 id, PartLib.PartData[] memory payouts, PartLib.PartData[] memory fees ) internal whenEscrowDeposited(id) whenNotEscrowCompleted(id) { AssetLib.AssetData memory asset = _deposits[id]; _setCompleted(id, true); uint256 rest = asset.value; (rest, ) = _transferFees( asset.assetType, rest, asset.value, address(this), fees ); _transferPayouts(asset.assetType, rest, address(this), payouts); emit Paid(id, payouts, fees, asset); } function _withdraw(bytes32 id, address payee) internal whenEscrowDeposited(id) whenNotEscrowCompleted(id) { AssetLib.AssetData memory asset = _deposits[id]; _setCompleted(id, true); _transfer(asset, address(this), payee); emit Withdrawn(id, payee, asset); } function _transferFees( AssetLib.AssetType memory assetType, uint256 rest, uint256 amount, address from, PartLib.PartData[] memory fees ) internal returns (uint256 restValue, uint256 totalFees) { totalFees = 0; restValue = rest; for (uint256 i = 0; i < fees.length; i++) { totalFees = totalFees.add(fees[i].value); (uint256 newRestValue, uint256 feeValue) = _subFeeInBp( restValue, amount, fees[i].value ); restValue = newRestValue; if (feeValue > 0) { _transfer( AssetLib.AssetData(assetType, feeValue), from, fees[i].account ); } } } function _transferPayouts( AssetLib.AssetType memory assetType, uint256 amount, address from, PartLib.PartData[] memory payouts ) internal { uint256 sumBps = 0; uint256 restValue = amount; for (uint256 i = 0; i < payouts.length - 1; i++) { uint256 currentAmount = amount.bp(payouts[i].value); sumBps = sumBps.add(payouts[i].value); if (currentAmount > 0) { restValue = restValue.sub(currentAmount); _transfer( AssetLib.AssetData(assetType, currentAmount), from, payouts[i].account ); } } PartLib.PartData memory lastPayout = payouts[payouts.length - 1]; sumBps = sumBps.add(lastPayout.value); require( sumBps == 10000, "MarketEscrow: sum payouts bps not equal 100%" ); if (restValue > 0) { _transfer( AssetLib.AssetData(assetType, restValue), from, lastPayout.account ); } } function _matchUpdateAssetStatus( AssetLib.AssetData memory currentAsset, AssetLib.AssetData memory newAsset ) internal pure returns (UpdateAssetStatus) { bool matchAssetClass = currentAsset.assetType.assetClass == newAsset.assetType.assetClass; bool matchToken; bool matchTokenId; if ( matchAssetClass && currentAsset.assetType.assetClass == AssetLib.ERC20_ASSET_CLASS ) { (address currentToken, ) = AssetLib.decodeAssetTypeData( currentAsset.assetType ); (address newToken, ) = AssetLib.decodeAssetTypeData( newAsset.assetType ); matchToken = currentToken == newToken; } else if ( matchAssetClass && (currentAsset.assetType.assetClass == AssetLib.ERC721_ASSET_CLASS || currentAsset.assetType.assetClass == AssetLib.ERC1155_ASSET_CLASS) ) { (address currentToken, uint256 currentTokenId) = AssetLib .decodeAssetTypeData(currentAsset.assetType); (address newToken, uint256 newTokenId) = AssetLib .decodeAssetTypeData(newAsset.assetType); matchToken = currentToken == newToken; matchTokenId = currentTokenId == newTokenId; } if ( !matchAssetClass || (!matchToken && (currentAsset.assetType.assetClass == AssetLib.ERC20_ASSET_CLASS || currentAsset.assetType.assetClass == AssetLib.ERC721_ASSET_CLASS || currentAsset.assetType.assetClass == AssetLib.ERC1155_ASSET_CLASS)) || (!matchTokenId && (currentAsset.assetType.assetClass == AssetLib.ERC721_ASSET_CLASS || currentAsset.assetType.assetClass == AssetLib.ERC1155_ASSET_CLASS)) ) { return UpdateAssetStatus.TypeChange; } else { if (currentAsset.value > newAsset.value) { return UpdateAssetStatus.ValueChangeDown; } else if (currentAsset.value < newAsset.value) { return UpdateAssetStatus.ValueChangeUp; } return UpdateAssetStatus.NoChange; } } function _setDeposit(bytes32 id, AssetLib.AssetData memory asset) internal { _deposits[id] = asset; } function _setCompleted(bytes32 id, bool status) internal { _completed[id] = status; } function _subFeeInBp( uint256 value, uint256 total, uint256 feeInBp ) internal pure returns (uint256 newValue, uint256 realFee) { return _subFee(value, total.bp(feeInBp)); } function _subFee(uint256 value, uint256 fee) internal pure returns (uint256 newValue, uint256 realFee) { if (value > fee) { newValue = value.sub(fee); realFee = fee; } else { newValue = 0; realFee = value; } } }
// SPDX-License-Identifier: MIT pragma solidity ^0.8.0; import "@openzeppelin/contracts/utils/Context.sol"; import "@openzeppelin/contracts/utils/cryptography/draft-EIP712.sol"; import "@openzeppelin/contracts/utils/cryptography/SignatureChecker.sol"; /** * @title MarketTxValidatable * MarketTxValidatable - This contract manages the tx for market. */ abstract contract MarketTxValidatable is Context, EIP712 { using SignatureChecker for address; function _validateTx( address signer, bytes32 hash, bytes memory signature ) internal view returns (bool, string memory) { if (signature.length == 0) { address sender = _msgSender(); if (signer != sender) { return ( false, "MarketTxValidatable: sender verification failed" ); } } else { if ( !signer.isValidSignatureNow(_hashTypedDataV4(hash), signature) ) { return ( false, "MarketTxValidatable: signature verification failed" ); } } return (true, ""); } }
// SPDX-License-Identifier: MIT pragma solidity ^0.8.0; library AssetLib { bytes4 public constant ETH_ASSET_CLASS = bytes4(keccak256("ETH")); bytes4 public constant ERC20_ASSET_CLASS = bytes4(keccak256("ERC20")); bytes4 public constant ERC721_ASSET_CLASS = bytes4(keccak256("ERC721")); bytes4 public constant ERC1155_ASSET_CLASS = bytes4(keccak256("ERC1155")); bytes4 public constant COLLECTION = bytes4(keccak256("COLLECTION")); bytes32 constant ASSET_TYPE_TYPEHASH = keccak256("AssetType(bytes4 assetClass,bytes data)"); bytes32 constant ASSET_TYPEHASH = keccak256( "AssetData(AssetType assetType,uint256 value)AssetType(bytes4 assetClass,bytes data)" ); struct AssetType { bytes4 assetClass; bytes data; } struct AssetData { AssetType assetType; uint256 value; } function decodeAssetTypeData(AssetType memory assetType) internal pure returns (address, uint256) { if (assetType.assetClass == AssetLib.ERC20_ASSET_CLASS) { address token = abi.decode(assetType.data, (address)); return (token, 0); } else if ( assetType.assetClass == AssetLib.ERC721_ASSET_CLASS || assetType.assetClass == AssetLib.ERC1155_ASSET_CLASS ) { (address token, uint256 tokenId) = abi.decode( assetType.data, (address, uint256) ); return (token, tokenId); } return (address(0), 0); } function hash(AssetType memory assetType) internal pure returns (bytes32) { return keccak256( abi.encode( ASSET_TYPE_TYPEHASH, assetType.assetClass, keccak256(assetType.data) ) ); } function hash(AssetData memory asset) internal pure returns (bytes32) { return keccak256( abi.encode(ASSET_TYPEHASH, hash(asset.assetType), asset.value) ); } }
// SPDX-License-Identifier: MIT pragma solidity ^0.8.0; import "./BasisPointLib.sol"; library PartLib { bytes32 public constant TYPE_HASH = keccak256("PartData(address account,uint256 value)"); struct PartData { address payable account; uint256 value; } function hash(PartData memory part) internal pure returns (bytes32) { return keccak256(abi.encode(TYPE_HASH, part.account, part.value)); } function validate(PartData memory part) internal pure returns (bool, string memory) { if (part.account == address(0x0)) { return (false, "PartLib: account verification failed"); } if (part.value == 0 || part.value > BasisPointLib._BPS_BASE) { return (false, "PartLib: value verification failed"); } return (true, ""); } }
// SPDX-License-Identifier: MIT pragma solidity ^0.8.0; import "@openzeppelin/contracts/utils/math/SafeMath.sol"; library BasisPointLib { using SafeMath for uint256; uint256 constant _BPS_BASE = 10000; function bp(uint256 value, uint256 bpValue) internal pure returns (uint256) { return value.mul(bpValue).div(_BPS_BASE); } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts v4.4.1 (utils/Context.sol) pragma solidity ^0.8.0; /** * @dev Provides information about the current execution context, including the * sender of the transaction and its data. While these are generally available * via msg.sender and msg.data, they should not be accessed in such a direct * manner, since when dealing with meta-transactions the account sending and * paying for execution may not be the actual sender (as far as an application * is concerned). * * This contract is only required for intermediate, library-like contracts. */ abstract contract Context { function _msgSender() internal view virtual returns (address) { return msg.sender; } function _msgData() internal view virtual returns (bytes calldata) { return msg.data; } }
// SPDX-License-Identifier: MIT pragma solidity ^0.8.0; import "@openzeppelin/contracts/utils/Address.sol"; import "@openzeppelin/contracts/token/ERC20/utils/SafeERC20.sol"; import "@openzeppelin/contracts/token/ERC20/IERC20.sol"; import "@openzeppelin/contracts/token/ERC721/IERC721.sol"; import "@openzeppelin/contracts/token/ERC721/utils/ERC721Holder.sol"; import "@openzeppelin/contracts/token/ERC1155/IERC1155.sol"; import "@openzeppelin/contracts/token/ERC1155/utils/ERC1155Holder.sol"; import "../../transfer-proxy/interfaces/ITransferProxy.sol"; import "../../utils/libraries/AssetLib.sol"; import "./AdminController.sol"; /** * @title MarketTransfer * MarketTransfer - This contract manages the transfer for Market. */ abstract contract MarketTransfer is ERC721Holder, ERC1155Holder, AdminController { using Address for address; using SafeERC20 for IERC20; mapping(bytes4 => address) private _proxies; event ProxyUpdated(bytes4 indexed assetType, address proxy); event Transferred(AssetLib.AssetData asset, address from, address to); function setTransferProxy(bytes4 assetType, address proxy) external onlyAdmin { require( proxy.isContract(), "MarketTransfer: Address is not a contract" ); _proxies[assetType] = proxy; emit ProxyUpdated(assetType, proxy); } function getTransferProxy(bytes4 assetType) public view returns (address) { return _proxies[assetType]; } function _transfer( AssetLib.AssetData memory asset, address from, address to ) internal { if (asset.assetType.assetClass == AssetLib.ETH_ASSET_CLASS) { _ethTransfer(from, to, asset.value); } else if (asset.assetType.assetClass == AssetLib.ERC20_ASSET_CLASS) { (address token, ) = AssetLib.decodeAssetTypeData(asset.assetType); _erc20safeTransferFrom(token, from, to, asset.value); } else if (asset.assetType.assetClass == AssetLib.ERC721_ASSET_CLASS) { (address token, uint256 tokenId) = AssetLib.decodeAssetTypeData( asset.assetType ); require(asset.value == 1, "MarketTransfer: erc721 value error"); _erc721safeTransferFrom(token, from, to, tokenId); } else if (asset.assetType.assetClass == AssetLib.ERC1155_ASSET_CLASS) { (address token, uint256 tokenId) = AssetLib.decodeAssetTypeData( asset.assetType ); _erc1155safeTransferFrom(token, from, to, tokenId, asset.value); } else { _transferProxyTransfer(asset, from, to); } emit Transferred(asset, from, to); } function _ethTransfer( address from, address to, uint256 value ) private { if (from == address(this)) { require( address(this).balance >= value, "MarketTransfer: insufficient balance" ); } else { require(msg.value >= value, "MarketTransfer: insufficient balance"); } if (to != address(this)) { (bool success, ) = to.call{value: value}(""); require( success, "MarketTransfer: unable to send value, recipient may have reverted" ); } } function _erc20safeTransferFrom( address token, address from, address to, uint256 value ) private { if (from == address(this)) { IERC20(token).safeTransfer(to, value); } else { IERC20(token).safeTransferFrom(from, to, value); } } function _erc721safeTransferFrom( address token, address from, address to, uint256 tokenId ) private { IERC721(token).safeTransferFrom(from, to, tokenId); } function _erc1155safeTransferFrom( address token, address from, address to, uint256 id, uint256 value ) private { IERC1155(token).safeTransferFrom(from, to, id, value, ""); } function _transferProxyTransfer( AssetLib.AssetData memory asset, address from, address to ) private { ITransferProxy(getTransferProxy(asset.assetType.assetClass)).transfer( asset, from, to ); } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v4.5.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 assembly { let returndata_size := mload(returndata) revert(add(32, returndata), returndata_size) } } else { revert(errorMessage); } } } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts v4.4.1 (token/ERC20/utils/SafeERC20.sol) pragma solidity ^0.8.0; import "../IERC20.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)); } } /** * @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"); } } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v4.5.0) (token/ERC20/IERC20.sol) pragma solidity ^0.8.0; /** * @dev Interface of the ERC20 standard as defined in the EIP. */ interface IERC20 { /** * @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); /** * @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); }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts v4.4.1 (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`, 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 be 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 Returns the account approved for `tokenId` token. * * Requirements: * * - `tokenId` must exist. */ function getApproved(uint256 tokenId) external view returns (address operator); /** * @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 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); /** * @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; }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts v4.4.1 (token/ERC721/utils/ERC721Holder.sol) pragma solidity ^0.8.0; import "../IERC721Receiver.sol"; /** * @dev Implementation of the {IERC721Receiver} interface. * * Accepts all token transfers. * Make sure the contract is able to use its token with {IERC721-safeTransferFrom}, {IERC721-approve} or {IERC721-setApprovalForAll}. */ contract ERC721Holder is IERC721Receiver { /** * @dev See {IERC721Receiver-onERC721Received}. * * Always returns `IERC721Receiver.onERC721Received.selector`. */ function onERC721Received( address, address, uint256, bytes memory ) public virtual override returns (bytes4) { return this.onERC721Received.selector; } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts v4.4.1 (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 be 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; }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v4.5.0) (token/ERC1155/utils/ERC1155Holder.sol) pragma solidity ^0.8.0; import "./ERC1155Receiver.sol"; /** * Simple implementation of `ERC1155Receiver` that will allow a contract to hold ERC1155 tokens. * * IMPORTANT: When inheriting this contract, you must include a way to use the received tokens, otherwise they will be * stuck. * * @dev _Available since v3.1._ */ contract ERC1155Holder is ERC1155Receiver { function onERC1155Received( address, address, uint256, uint256, bytes memory ) public virtual override returns (bytes4) { return this.onERC1155Received.selector; } function onERC1155BatchReceived( address, address, uint256[] memory, uint256[] memory, bytes memory ) public virtual override returns (bytes4) { return this.onERC1155BatchReceived.selector; } }
// SPDX-License-Identifier: MIT pragma solidity ^0.8.0; import "../../utils/libraries/AssetLib.sol"; interface ITransferProxy { function transfer( AssetLib.AssetData calldata asset, address from, address to ) external; }
// SPDX-License-Identifier: MIT pragma solidity ^0.8.0; import "@openzeppelin/contracts/utils/Context.sol"; import "@openzeppelin/contracts/access/Ownable.sol"; /** * @title AdminController * AdminController -This contract manages the admin. */ abstract contract AdminController is Context, Ownable { mapping(address => bool) private _admins; event AdminSet(address indexed account, bool indexed status); constructor(address account) { _setAdmin(account, true); } modifier onlyAdmin() { address sender = _msgSender(); (bool isValid, string memory errorMessage) = _validateAdmin(sender); require(isValid, errorMessage); _; } modifier onlyAdminOrOwner() { address sender = _msgSender(); (bool isValid, string memory errorMessage) = _validateAdminOrOwner( sender ); require(isValid, errorMessage); _; } function addAdmin(address account) external onlyOwner { _setAdmin(account, true); } function removeAdmin(address account) external onlyAdminOrOwner { _setAdmin(account, false); } function isAdmin(address account) external view returns (bool) { return _isAdmin(account); } function _setAdmin(address account, bool status) internal { _admins[account] = status; emit AdminSet(account, status); } function _isAdmin(address account) internal view returns (bool) { return _admins[account]; } function _isAdminOrOwner(address account) internal view returns (bool) { return owner() == account || _isAdmin(account); } function _validateAdmin(address account) internal view returns (bool, string memory) { if (!_isAdmin(account)) { return (false, "AdminController: admin verification failed"); } return (true, ""); } function _validateAdminOrOwner(address account) internal view returns (bool, string memory) { if (!_isAdminOrOwner(account)) { return ( false, "AdminController: admin or owner verification failed" ); } return (true, ""); } }
// 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); }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts v4.4.1 (token/ERC721/IERC721Receiver.sol) pragma solidity ^0.8.0; /** * @title ERC721 token receiver interface * @dev Interface for any contract that wants to support safeTransfers * from ERC721 asset contracts. */ interface IERC721Receiver { /** * @dev Whenever an {IERC721} `tokenId` token is transferred to this contract via {IERC721-safeTransferFrom} * by `operator` from `from`, this function is called. * * It must return its Solidity selector to confirm the token transfer. * If any other value is returned or the interface is not implemented by the recipient, the transfer will be reverted. * * The selector can be obtained in Solidity with `IERC721.onERC721Received.selector`. */ function onERC721Received( address operator, address from, uint256 tokenId, bytes calldata data ) external returns (bytes4); }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts v4.4.1 (token/ERC1155/utils/ERC1155Receiver.sol) pragma solidity ^0.8.0; import "../IERC1155Receiver.sol"; import "../../../utils/introspection/ERC165.sol"; /** * @dev _Available since v3.1._ */ abstract contract ERC1155Receiver is ERC165, IERC1155Receiver { /** * @dev See {IERC165-supportsInterface}. */ function supportsInterface(bytes4 interfaceId) public view virtual override(ERC165, IERC165) returns (bool) { return interfaceId == type(IERC1155Receiver).interfaceId || super.supportsInterface(interfaceId); } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v4.5.0) (token/ERC1155/IERC1155Receiver.sol) pragma solidity ^0.8.0; import "../../utils/introspection/IERC165.sol"; /** * @dev _Available since v3.1._ */ interface IERC1155Receiver is IERC165 { /** * @dev Handles the receipt of a single ERC1155 token type. This function is * called at the end of a `safeTransferFrom` after the balance has been updated. * * NOTE: To accept the transfer, this must return * `bytes4(keccak256("onERC1155Received(address,address,uint256,uint256,bytes)"))` * (i.e. 0xf23a6e61, or its own function selector). * * @param operator The address which initiated the transfer (i.e. msg.sender) * @param from The address which previously owned the token * @param id The ID of the token being transferred * @param value The amount of tokens being transferred * @param data Additional data with no specified format * @return `bytes4(keccak256("onERC1155Received(address,address,uint256,uint256,bytes)"))` if transfer is allowed */ function onERC1155Received( address operator, address from, uint256 id, uint256 value, bytes calldata data ) external returns (bytes4); /** * @dev Handles the receipt of a multiple ERC1155 token types. This function * is called at the end of a `safeBatchTransferFrom` after the balances have * been updated. * * NOTE: To accept the transfer(s), this must return * `bytes4(keccak256("onERC1155BatchReceived(address,address,uint256[],uint256[],bytes)"))` * (i.e. 0xbc197c81, or its own function selector). * * @param operator The address which initiated the batch transfer (i.e. msg.sender) * @param from The address which previously owned the token * @param ids An array containing ids of each token being transferred (order and length must match values array) * @param values An array containing amounts of each token being transferred (order and length must match ids array) * @param data Additional data with no specified format * @return `bytes4(keccak256("onERC1155BatchReceived(address,address,uint256[],uint256[],bytes)"))` if transfer is allowed */ function onERC1155BatchReceived( address operator, address from, uint256[] calldata ids, uint256[] calldata values, bytes calldata data ) external returns (bytes4); }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts v4.4.1 (utils/introspection/ERC165.sol) pragma solidity ^0.8.0; import "./IERC165.sol"; /** * @dev Implementation of the {IERC165} interface. * * Contracts that want to implement ERC165 should inherit from this contract and override {supportsInterface} to check * for the additional interface id that will be supported. For example: * * ```solidity * function supportsInterface(bytes4 interfaceId) public view virtual override returns (bool) { * return interfaceId == type(MyInterface).interfaceId || super.supportsInterface(interfaceId); * } * ``` * * Alternatively, {ERC165Storage} provides an easier to use but more expensive implementation. */ abstract contract ERC165 is IERC165 { /** * @dev See {IERC165-supportsInterface}. */ function supportsInterface(bytes4 interfaceId) public view virtual override returns (bool) { return interfaceId == type(IERC165).interfaceId; } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts v4.4.1 (access/Ownable.sol) pragma solidity ^0.8.0; import "../utils/Context.sol"; /** * @dev Contract module which provides a basic access control mechanism, where * there is an account (an owner) that can be granted exclusive access to * specific functions. * * By default, the owner account will be the one that deploys the contract. This * can later be changed with {transferOwnership}. * * This module is used through inheritance. It will make available the modifier * `onlyOwner`, which can be applied to your functions to restrict their use to * the owner. */ abstract contract Ownable is Context { address private _owner; event OwnershipTransferred(address indexed previousOwner, address indexed newOwner); /** * @dev Initializes the contract setting the deployer as the initial owner. */ constructor() { _transferOwnership(_msgSender()); } /** * @dev Returns the address of the current owner. */ function owner() public view virtual returns (address) { return _owner; } /** * @dev Throws if called by any account other than the owner. */ modifier onlyOwner() { require(owner() == _msgSender(), "Ownable: caller is not the owner"); _; } /** * @dev Leaves the contract without owner. It will not be possible to call * `onlyOwner` functions anymore. Can only be called by the current owner. * * NOTE: Renouncing ownership will leave the contract without an owner, * thereby removing any functionality that is only available to the owner. */ function renounceOwnership() public virtual onlyOwner { _transferOwnership(address(0)); } /** * @dev Transfers ownership of the contract to a new account (`newOwner`). * Can only be called by the current owner. */ function transferOwnership(address newOwner) public virtual onlyOwner { require(newOwner != address(0), "Ownable: new owner is the zero address"); _transferOwnership(newOwner); } /** * @dev Transfers ownership of the contract to a new account (`newOwner`). * Internal function without access restriction. */ function _transferOwnership(address newOwner) internal virtual { address oldOwner = _owner; _owner = newOwner; emit OwnershipTransferred(oldOwner, newOwner); } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts v4.4.1 (utils/cryptography/draft-EIP712.sol) pragma solidity ^0.8.0; import "./ECDSA.sol"; /** * @dev https://eips.ethereum.org/EIPS/eip-712[EIP 712] is a standard for hashing and signing of typed structured data. * * The encoding specified in the EIP is very generic, and such a generic implementation in Solidity is not feasible, * thus this contract does not implement the encoding itself. Protocols need to implement the type-specific encoding * they need in their contracts using a combination of `abi.encode` and `keccak256`. * * This contract implements the EIP 712 domain separator ({_domainSeparatorV4}) that is used as part of the encoding * scheme, and the final step of the encoding to obtain the message digest that is then signed via ECDSA * ({_hashTypedDataV4}). * * The implementation of the domain separator was designed to be as efficient as possible while still properly updating * the chain id to protect against replay attacks on an eventual fork of the chain. * * NOTE: This contract implements the version of the encoding known as "v4", as implemented by the JSON RPC method * https://docs.metamask.io/guide/signing-data.html[`eth_signTypedDataV4` in MetaMask]. * * _Available since v3.4._ */ abstract contract EIP712 { /* solhint-disable var-name-mixedcase */ // Cache the domain separator as an immutable value, but also store the chain id that it corresponds to, in order to // invalidate the cached domain separator if the chain id changes. bytes32 private immutable _CACHED_DOMAIN_SEPARATOR; uint256 private immutable _CACHED_CHAIN_ID; address private immutable _CACHED_THIS; bytes32 private immutable _HASHED_NAME; bytes32 private immutable _HASHED_VERSION; bytes32 private immutable _TYPE_HASH; /* solhint-enable var-name-mixedcase */ /** * @dev Initializes the domain separator and parameter caches. * * The meaning of `name` and `version` is specified in * https://eips.ethereum.org/EIPS/eip-712#definition-of-domainseparator[EIP 712]: * * - `name`: the user readable name of the signing domain, i.e. the name of the DApp or the protocol. * - `version`: the current major version of the signing domain. * * NOTE: These parameters cannot be changed except through a xref:learn::upgrading-smart-contracts.adoc[smart * contract upgrade]. */ constructor(string memory name, string memory version) { bytes32 hashedName = keccak256(bytes(name)); bytes32 hashedVersion = keccak256(bytes(version)); bytes32 typeHash = keccak256( "EIP712Domain(string name,string version,uint256 chainId,address verifyingContract)" ); _HASHED_NAME = hashedName; _HASHED_VERSION = hashedVersion; _CACHED_CHAIN_ID = block.chainid; _CACHED_DOMAIN_SEPARATOR = _buildDomainSeparator(typeHash, hashedName, hashedVersion); _CACHED_THIS = address(this); _TYPE_HASH = typeHash; } /** * @dev Returns the domain separator for the current chain. */ function _domainSeparatorV4() internal view returns (bytes32) { if (address(this) == _CACHED_THIS && block.chainid == _CACHED_CHAIN_ID) { return _CACHED_DOMAIN_SEPARATOR; } else { return _buildDomainSeparator(_TYPE_HASH, _HASHED_NAME, _HASHED_VERSION); } } function _buildDomainSeparator( bytes32 typeHash, bytes32 nameHash, bytes32 versionHash ) private view returns (bytes32) { return keccak256(abi.encode(typeHash, nameHash, versionHash, block.chainid, address(this))); } /** * @dev Given an already https://eips.ethereum.org/EIPS/eip-712#definition-of-hashstruct[hashed struct], this * function returns the hash of the fully encoded EIP712 message for this domain. * * This hash can be used together with {ECDSA-recover} to obtain the signer of a message. For example: * * ```solidity * bytes32 digest = _hashTypedDataV4(keccak256(abi.encode( * keccak256("Mail(address to,string contents)"), * mailTo, * keccak256(bytes(mailContents)) * ))); * address signer = ECDSA.recover(digest, signature); * ``` */ function _hashTypedDataV4(bytes32 structHash) internal view virtual returns (bytes32) { return ECDSA.toTypedDataHash(_domainSeparatorV4(), structHash); } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v4.5.0) (utils/cryptography/SignatureChecker.sol) pragma solidity ^0.8.0; import "./ECDSA.sol"; import "../Address.sol"; import "../../interfaces/IERC1271.sol"; /** * @dev Signature verification helper that can be used instead of `ECDSA.recover` to seamlessly support both ECDSA * signatures from externally owned accounts (EOAs) as well as ERC1271 signatures from smart contract wallets like * Argent and Gnosis Safe. * * _Available since v4.1._ */ library SignatureChecker { /** * @dev Checks if a signature is valid for a given signer and data hash. If the signer is a smart contract, the * signature is validated against that smart contract using ERC1271, otherwise it's validated using `ECDSA.recover`. * * NOTE: Unlike ECDSA signatures, contract signatures are revocable, and the outcome of this function can thus * change through time. It could return true at block N and false at block N+1 (or the opposite). */ function isValidSignatureNow( address signer, bytes32 hash, bytes memory signature ) internal view returns (bool) { (address recovered, ECDSA.RecoverError error) = ECDSA.tryRecover(hash, signature); if (error == ECDSA.RecoverError.NoError && recovered == signer) { return true; } (bool success, bytes memory result) = signer.staticcall( abi.encodeWithSelector(IERC1271.isValidSignature.selector, hash, signature) ); return (success && result.length == 32 && abi.decode(result, (bytes4)) == IERC1271.isValidSignature.selector); } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v4.5.0) (utils/cryptography/ECDSA.sol) pragma solidity ^0.8.0; import "../Strings.sol"; /** * @dev Elliptic Curve Digital Signature Algorithm (ECDSA) operations. * * These functions can be used to verify that a message was signed by the holder * of the private keys of a given address. */ library ECDSA { enum RecoverError { NoError, InvalidSignature, InvalidSignatureLength, InvalidSignatureS, InvalidSignatureV } function _throwError(RecoverError error) private pure { if (error == RecoverError.NoError) { return; // no error: do nothing } else if (error == RecoverError.InvalidSignature) { revert("ECDSA: invalid signature"); } else if (error == RecoverError.InvalidSignatureLength) { revert("ECDSA: invalid signature length"); } else if (error == RecoverError.InvalidSignatureS) { revert("ECDSA: invalid signature 's' value"); } else if (error == RecoverError.InvalidSignatureV) { revert("ECDSA: invalid signature 'v' value"); } } /** * @dev Returns the address that signed a hashed message (`hash`) with * `signature` or error string. This address can then be used for verification purposes. * * The `ecrecover` EVM opcode allows for malleable (non-unique) signatures: * this function rejects them by requiring the `s` value to be in the lower * half order, and the `v` value to be either 27 or 28. * * IMPORTANT: `hash` _must_ be the result of a hash operation for the * verification to be secure: it is possible to craft signatures that * recover to arbitrary addresses for non-hashed data. A safe way to ensure * this is by receiving a hash of the original message (which may otherwise * be too long), and then calling {toEthSignedMessageHash} on it. * * Documentation for signature generation: * - with https://web3js.readthedocs.io/en/v1.3.4/web3-eth-accounts.html#sign[Web3.js] * - with https://docs.ethers.io/v5/api/signer/#Signer-signMessage[ethers] * * _Available since v4.3._ */ function tryRecover(bytes32 hash, bytes memory signature) internal pure returns (address, RecoverError) { // Check the signature length // - case 65: r,s,v signature (standard) // - case 64: r,vs signature (cf https://eips.ethereum.org/EIPS/eip-2098) _Available since v4.1._ if (signature.length == 65) { bytes32 r; bytes32 s; uint8 v; // ecrecover takes the signature parameters, and the only way to get them // currently is to use assembly. assembly { r := mload(add(signature, 0x20)) s := mload(add(signature, 0x40)) v := byte(0, mload(add(signature, 0x60))) } return tryRecover(hash, v, r, s); } else if (signature.length == 64) { bytes32 r; bytes32 vs; // ecrecover takes the signature parameters, and the only way to get them // currently is to use assembly. assembly { r := mload(add(signature, 0x20)) vs := mload(add(signature, 0x40)) } return tryRecover(hash, r, vs); } else { return (address(0), RecoverError.InvalidSignatureLength); } } /** * @dev Returns the address that signed a hashed message (`hash`) with * `signature`. This address can then be used for verification purposes. * * The `ecrecover` EVM opcode allows for malleable (non-unique) signatures: * this function rejects them by requiring the `s` value to be in the lower * half order, and the `v` value to be either 27 or 28. * * IMPORTANT: `hash` _must_ be the result of a hash operation for the * verification to be secure: it is possible to craft signatures that * recover to arbitrary addresses for non-hashed data. A safe way to ensure * this is by receiving a hash of the original message (which may otherwise * be too long), and then calling {toEthSignedMessageHash} on it. */ function recover(bytes32 hash, bytes memory signature) internal pure returns (address) { (address recovered, RecoverError error) = tryRecover(hash, signature); _throwError(error); return recovered; } /** * @dev Overload of {ECDSA-tryRecover} that receives the `r` and `vs` short-signature fields separately. * * See https://eips.ethereum.org/EIPS/eip-2098[EIP-2098 short signatures] * * _Available since v4.3._ */ function tryRecover( bytes32 hash, bytes32 r, bytes32 vs ) internal pure returns (address, RecoverError) { bytes32 s = vs & bytes32(0x7fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffff); uint8 v = uint8((uint256(vs) >> 255) + 27); return tryRecover(hash, v, r, s); } /** * @dev Overload of {ECDSA-recover} that receives the `r and `vs` short-signature fields separately. * * _Available since v4.2._ */ function recover( bytes32 hash, bytes32 r, bytes32 vs ) internal pure returns (address) { (address recovered, RecoverError error) = tryRecover(hash, r, vs); _throwError(error); return recovered; } /** * @dev Overload of {ECDSA-tryRecover} that receives the `v`, * `r` and `s` signature fields separately. * * _Available since v4.3._ */ function tryRecover( bytes32 hash, uint8 v, bytes32 r, bytes32 s ) internal pure returns (address, RecoverError) { // EIP-2 still allows signature malleability for ecrecover(). Remove this possibility and make the signature // unique. Appendix F in the Ethereum Yellow paper (https://ethereum.github.io/yellowpaper/paper.pdf), defines // the valid range for s in (301): 0 < s < secp256k1n ÷ 2 + 1, and for v in (302): v ∈ {27, 28}. Most // signatures from current libraries generate a unique signature with an s-value in the lower half order. // // If your library generates malleable signatures, such as s-values in the upper range, calculate a new s-value // with 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFEBAAEDCE6AF48A03BBFD25E8CD0364141 - s1 and flip v from 27 to 28 or // vice versa. If your library also generates signatures with 0/1 for v instead 27/28, add 27 to v to accept // these malleable signatures as well. if (uint256(s) > 0x7FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF5D576E7357A4501DDFE92F46681B20A0) { return (address(0), RecoverError.InvalidSignatureS); } if (v != 27 && v != 28) { return (address(0), RecoverError.InvalidSignatureV); } // If the signature is valid (and not malleable), return the signer address address signer = ecrecover(hash, v, r, s); if (signer == address(0)) { return (address(0), RecoverError.InvalidSignature); } return (signer, RecoverError.NoError); } /** * @dev Overload of {ECDSA-recover} that receives the `v`, * `r` and `s` signature fields separately. */ function recover( bytes32 hash, uint8 v, bytes32 r, bytes32 s ) internal pure returns (address) { (address recovered, RecoverError error) = tryRecover(hash, v, r, s); _throwError(error); return recovered; } /** * @dev Returns an Ethereum Signed Message, created from a `hash`. This * produces hash corresponding to the one signed with the * https://eth.wiki/json-rpc/API#eth_sign[`eth_sign`] * JSON-RPC method as part of EIP-191. * * See {recover}. */ function toEthSignedMessageHash(bytes32 hash) internal pure returns (bytes32) { // 32 is the length in bytes of hash, // enforced by the type signature above return keccak256(abi.encodePacked("\x19Ethereum Signed Message:\n32", hash)); } /** * @dev Returns an Ethereum Signed Message, created from `s`. This * produces hash corresponding to the one signed with the * https://eth.wiki/json-rpc/API#eth_sign[`eth_sign`] * JSON-RPC method as part of EIP-191. * * See {recover}. */ function toEthSignedMessageHash(bytes memory s) internal pure returns (bytes32) { return keccak256(abi.encodePacked("\x19Ethereum Signed Message:\n", Strings.toString(s.length), s)); } /** * @dev Returns an Ethereum Signed Typed Data, created from a * `domainSeparator` and a `structHash`. This produces hash corresponding * to the one signed with the * https://eips.ethereum.org/EIPS/eip-712[`eth_signTypedData`] * JSON-RPC method as part of EIP-712. * * See {recover}. */ function toTypedDataHash(bytes32 domainSeparator, bytes32 structHash) internal pure returns (bytes32) { return keccak256(abi.encodePacked("\x19\x01", domainSeparator, structHash)); } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts v4.4.1 (utils/Strings.sol) pragma solidity ^0.8.0; /** * @dev String operations. */ library Strings { bytes16 private constant _HEX_SYMBOLS = "0123456789abcdef"; /** * @dev Converts a `uint256` to its ASCII `string` decimal representation. */ function toString(uint256 value) internal pure returns (string memory) { // Inspired by OraclizeAPI's implementation - MIT licence // https://github.com/oraclize/ethereum-api/blob/b42146b063c7d6ee1358846c198246239e9360e8/oraclizeAPI_0.4.25.sol if (value == 0) { return "0"; } uint256 temp = value; uint256 digits; while (temp != 0) { digits++; temp /= 10; } bytes memory buffer = new bytes(digits); while (value != 0) { digits -= 1; buffer[digits] = bytes1(uint8(48 + uint256(value % 10))); value /= 10; } return string(buffer); } /** * @dev Converts a `uint256` to its ASCII `string` hexadecimal representation. */ function toHexString(uint256 value) internal pure returns (string memory) { if (value == 0) { return "0x00"; } uint256 temp = value; uint256 length = 0; while (temp != 0) { length++; temp >>= 8; } return toHexString(value, length); } /** * @dev Converts a `uint256` to its ASCII `string` hexadecimal representation with fixed length. */ function toHexString(uint256 value, uint256 length) internal pure returns (string memory) { bytes memory buffer = new bytes(2 * length + 2); buffer[0] = "0"; buffer[1] = "x"; for (uint256 i = 2 * length + 1; i > 1; --i) { buffer[i] = _HEX_SYMBOLS[value & 0xf]; value >>= 4; } require(value == 0, "Strings: hex length insufficient"); return string(buffer); } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts v4.4.1 (interfaces/IERC1271.sol) pragma solidity ^0.8.0; /** * @dev Interface of the ERC1271 standard signature validation method for * contracts as defined in https://eips.ethereum.org/EIPS/eip-1271[ERC-1271]. * * _Available since v4.1._ */ interface IERC1271 { /** * @dev Should return whether the signature provided is valid for the provided data * @param hash Hash of the data to be signed * @param signature Signature byte array associated with _data */ function isValidSignature(bytes32 hash, bytes memory signature) external view returns (bytes4 magicValue); }
{ "optimizer": { "enabled": true, "runs": 200 }, "outputSelection": { "*": { "*": [ "evm.bytecode", "evm.deployedBytecode", "devdoc", "userdoc", "metadata", "abi" ] } }, "metadata": { "useLiteralContent": true }, "libraries": {} }
Contract Security Audit
- No Contract Security Audit Submitted- Submit Audit Here
[{"inputs":[{"internalType":"string","name":"name","type":"string"},{"internalType":"string","name":"version","type":"string"},{"internalType":"address","name":"trustedForwarder","type":"address"}],"stateMutability":"nonpayable","type":"constructor"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"account","type":"address"},{"indexed":true,"internalType":"bool","name":"status","type":"bool"}],"name":"AdminSet","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"bytes32","name":"id","type":"bytes32"},{"indexed":true,"internalType":"address","name":"payee","type":"address"},{"components":[{"components":[{"internalType":"bytes4","name":"assetClass","type":"bytes4"},{"internalType":"bytes","name":"data","type":"bytes"}],"internalType":"struct AssetLib.AssetType","name":"assetType","type":"tuple"},{"internalType":"uint256","name":"value","type":"uint256"}],"indexed":false,"internalType":"struct AssetLib.AssetData","name":"asset","type":"tuple"}],"name":"Deposited","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"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"bytes32","name":"id","type":"bytes32"},{"components":[{"internalType":"address payable","name":"account","type":"address"},{"internalType":"uint256","name":"value","type":"uint256"}],"indexed":false,"internalType":"struct PartLib.PartData[]","name":"payouts","type":"tuple[]"},{"components":[{"internalType":"address payable","name":"account","type":"address"},{"internalType":"uint256","name":"value","type":"uint256"}],"indexed":false,"internalType":"struct PartLib.PartData[]","name":"fees","type":"tuple[]"},{"components":[{"components":[{"internalType":"bytes4","name":"assetClass","type":"bytes4"},{"internalType":"bytes","name":"data","type":"bytes"}],"internalType":"struct AssetLib.AssetType","name":"assetType","type":"tuple"},{"internalType":"uint256","name":"value","type":"uint256"}],"indexed":false,"internalType":"struct AssetLib.AssetData","name":"asset","type":"tuple"}],"name":"Paid","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"bytes4","name":"assetType","type":"bytes4"},{"indexed":false,"internalType":"address","name":"proxy","type":"address"}],"name":"ProxyUpdated","type":"event"},{"anonymous":false,"inputs":[{"components":[{"components":[{"internalType":"bytes4","name":"assetClass","type":"bytes4"},{"internalType":"bytes","name":"data","type":"bytes"}],"internalType":"struct AssetLib.AssetType","name":"assetType","type":"tuple"},{"internalType":"uint256","name":"value","type":"uint256"}],"indexed":false,"internalType":"struct AssetLib.AssetData","name":"asset","type":"tuple"},{"indexed":false,"internalType":"address","name":"from","type":"address"},{"indexed":false,"internalType":"address","name":"to","type":"address"}],"name":"Transferred","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"bytes32","name":"id","type":"bytes32"},{"indexed":true,"internalType":"address","name":"payee","type":"address"},{"components":[{"components":[{"internalType":"bytes4","name":"assetClass","type":"bytes4"},{"internalType":"bytes","name":"data","type":"bytes"}],"internalType":"struct AssetLib.AssetType","name":"assetType","type":"tuple"},{"internalType":"uint256","name":"value","type":"uint256"}],"indexed":false,"internalType":"struct AssetLib.AssetData","name":"asset","type":"tuple"}],"name":"Withdrawn","type":"event"},{"inputs":[{"internalType":"address","name":"account","type":"address"}],"name":"addAdmin","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"components":[{"internalType":"address","name":"maker","type":"address"},{"components":[{"components":[{"internalType":"bytes4","name":"assetClass","type":"bytes4"},{"internalType":"bytes","name":"data","type":"bytes"}],"internalType":"struct AssetLib.AssetType","name":"assetType","type":"tuple"},{"internalType":"uint256","name":"value","type":"uint256"}],"internalType":"struct AssetLib.AssetData","name":"makeAsset","type":"tuple"},{"internalType":"address","name":"taker","type":"address"},{"components":[{"components":[{"internalType":"bytes4","name":"assetClass","type":"bytes4"},{"internalType":"bytes","name":"data","type":"bytes"}],"internalType":"struct AssetLib.AssetType","name":"assetType","type":"tuple"},{"internalType":"uint256","name":"value","type":"uint256"}],"internalType":"struct AssetLib.AssetData","name":"takeAsset","type":"tuple"},{"internalType":"uint256","name":"salt","type":"uint256"},{"internalType":"uint256","name":"start","type":"uint256"},{"internalType":"uint256","name":"end","type":"uint256"},{"internalType":"bytes4","name":"orderType","type":"bytes4"},{"internalType":"bytes","name":"data","type":"bytes"}],"internalType":"struct OrderLib.OrderData","name":"order","type":"tuple"},{"internalType":"bytes","name":"signatureLeft","type":"bytes"},{"internalType":"bytes","name":"signatureRight","type":"bytes"}],"name":"cancelOrder","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"components":[{"internalType":"address","name":"maker","type":"address"},{"components":[{"components":[{"internalType":"bytes4","name":"assetClass","type":"bytes4"},{"internalType":"bytes","name":"data","type":"bytes"}],"internalType":"struct AssetLib.AssetType","name":"assetType","type":"tuple"},{"internalType":"uint256","name":"value","type":"uint256"}],"internalType":"struct AssetLib.AssetData","name":"makeAsset","type":"tuple"},{"internalType":"address","name":"taker","type":"address"},{"components":[{"components":[{"internalType":"bytes4","name":"assetClass","type":"bytes4"},{"internalType":"bytes","name":"data","type":"bytes"}],"internalType":"struct AssetLib.AssetType","name":"assetType","type":"tuple"},{"internalType":"uint256","name":"value","type":"uint256"}],"internalType":"struct AssetLib.AssetData","name":"takeAsset","type":"tuple"},{"internalType":"uint256","name":"salt","type":"uint256"},{"internalType":"uint256","name":"start","type":"uint256"},{"internalType":"uint256","name":"end","type":"uint256"},{"internalType":"bytes4","name":"orderType","type":"bytes4"},{"internalType":"bytes","name":"data","type":"bytes"}],"internalType":"struct OrderLib.OrderData","name":"order","type":"tuple"},{"internalType":"bytes","name":"signatureLeft","type":"bytes"},{"internalType":"bytes","name":"signatureRight","type":"bytes"}],"name":"createOrder","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[{"components":[{"internalType":"address","name":"maker","type":"address"},{"components":[{"components":[{"internalType":"bytes4","name":"assetClass","type":"bytes4"},{"internalType":"bytes","name":"data","type":"bytes"}],"internalType":"struct AssetLib.AssetType","name":"assetType","type":"tuple"},{"internalType":"uint256","name":"value","type":"uint256"}],"internalType":"struct AssetLib.AssetData","name":"makeAsset","type":"tuple"},{"internalType":"address","name":"taker","type":"address"},{"components":[{"components":[{"internalType":"bytes4","name":"assetClass","type":"bytes4"},{"internalType":"bytes","name":"data","type":"bytes"}],"internalType":"struct AssetLib.AssetType","name":"assetType","type":"tuple"},{"internalType":"uint256","name":"value","type":"uint256"}],"internalType":"struct AssetLib.AssetData","name":"takeAsset","type":"tuple"},{"internalType":"uint256","name":"salt","type":"uint256"},{"internalType":"uint256","name":"start","type":"uint256"},{"internalType":"uint256","name":"end","type":"uint256"},{"internalType":"bytes4","name":"orderType","type":"bytes4"},{"internalType":"bytes","name":"data","type":"bytes"}],"internalType":"struct OrderLib.OrderData","name":"order","type":"tuple"},{"internalType":"bytes","name":"signatureLeft","type":"bytes"},{"internalType":"bytes","name":"signatureRight","type":"bytes"}],"name":"finalizeOrder","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[{"internalType":"bytes32","name":"id","type":"bytes32"}],"name":"getCompleted","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes32","name":"id","type":"bytes32"}],"name":"getDeposit","outputs":[{"components":[{"components":[{"internalType":"bytes4","name":"assetClass","type":"bytes4"},{"internalType":"bytes","name":"data","type":"bytes"}],"internalType":"struct AssetLib.AssetType","name":"assetType","type":"tuple"},{"internalType":"uint256","name":"value","type":"uint256"}],"internalType":"struct AssetLib.AssetData","name":"","type":"tuple"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes4","name":"assetType","type":"bytes4"}],"name":"getTransferProxy","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"getVersion","outputs":[{"internalType":"bytes4","name":"","type":"bytes4"}],"stateMutability":"pure","type":"function"},{"inputs":[{"internalType":"address","name":"account","type":"address"}],"name":"isAdmin","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"forwarder","type":"address"}],"name":"isTrustedForwarder","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"},{"internalType":"address","name":"","type":"address"},{"internalType":"uint256[]","name":"","type":"uint256[]"},{"internalType":"uint256[]","name":"","type":"uint256[]"},{"internalType":"bytes","name":"","type":"bytes"}],"name":"onERC1155BatchReceived","outputs":[{"internalType":"bytes4","name":"","type":"bytes4"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"},{"internalType":"address","name":"","type":"address"},{"internalType":"uint256","name":"","type":"uint256"},{"internalType":"uint256","name":"","type":"uint256"},{"internalType":"bytes","name":"","type":"bytes"}],"name":"onERC1155Received","outputs":[{"internalType":"bytes4","name":"","type":"bytes4"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"},{"internalType":"address","name":"","type":"address"},{"internalType":"uint256","name":"","type":"uint256"},{"internalType":"bytes","name":"","type":"bytes"}],"name":"onERC721Received","outputs":[{"internalType":"bytes4","name":"","type":"bytes4"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"owner","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"account","type":"address"}],"name":"removeAdmin","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"renounceOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes4","name":"assetType","type":"bytes4"},{"internalType":"address","name":"proxy","type":"address"}],"name":"setTransferProxy","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes4","name":"interfaceId","type":"bytes4"}],"name":"supportsInterface","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"newOwner","type":"address"}],"name":"transferOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"components":[{"internalType":"address","name":"maker","type":"address"},{"components":[{"components":[{"internalType":"bytes4","name":"assetClass","type":"bytes4"},{"internalType":"bytes","name":"data","type":"bytes"}],"internalType":"struct AssetLib.AssetType","name":"assetType","type":"tuple"},{"internalType":"uint256","name":"value","type":"uint256"}],"internalType":"struct AssetLib.AssetData","name":"makeAsset","type":"tuple"},{"internalType":"address","name":"taker","type":"address"},{"components":[{"components":[{"internalType":"bytes4","name":"assetClass","type":"bytes4"},{"internalType":"bytes","name":"data","type":"bytes"}],"internalType":"struct AssetLib.AssetType","name":"assetType","type":"tuple"},{"internalType":"uint256","name":"value","type":"uint256"}],"internalType":"struct AssetLib.AssetData","name":"takeAsset","type":"tuple"},{"internalType":"uint256","name":"salt","type":"uint256"},{"internalType":"uint256","name":"start","type":"uint256"},{"internalType":"uint256","name":"end","type":"uint256"},{"internalType":"bytes4","name":"orderType","type":"bytes4"},{"internalType":"bytes","name":"data","type":"bytes"}],"internalType":"struct OrderLib.OrderData","name":"order","type":"tuple"},{"internalType":"bytes","name":"signatureLeft","type":"bytes"},{"internalType":"bytes","name":"signatureRight","type":"bytes"}],"name":"updateOrder","outputs":[],"stateMutability":"payable","type":"function"}]
Contract Creation Code
6101406040523480156200001257600080fd5b5060405162004168380380620041688339810160408190526200003591620002e2565b82828282826200004462000126565b600080546001600160a01b0319166001600160a01b03861617905560018055620000776200007162000126565b62000143565b6200008481600162000195565b50815160208084019190912082518383012060e08290526101008190524660a0818152604080517f8b73c3c69bb8fe3d512ecc4cf759cc79239f7b179b0ffacaa9a75d522b39400f81880181905281830187905260608201869052608082019490945230818401528151808203909301835260c00190528051940193909320919290916080523060601b60c05261012052506200038198505050505050505050565b60006200013d620001e960201b62000bd11760201c565b90505b90565b600280546001600160a01b038381166001600160a01b0319831681179093556040519116919082907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a35050565b6001600160a01b038216600081815260036020526040808220805460ff191685151590811790915590519092917fe68d2c359a771606c400cf8b87000cf5864010363d6a736e98f5047b7bbe18e991a35050565b600080546001600160a01b03163314156200020e575060131936013560601c62000140565b620002236200022b60201b62000bfd1760201c565b905062000140565b3390565b600082601f83011262000240578081fd5b81516001600160401b03808211156200025d576200025d6200036b565b604051601f8301601f19908116603f011681019082821181831017156200028857620002886200036b565b81604052838152602092508683858801011115620002a4578485fd5b8491505b83821015620002c75785820183015181830184015290820190620002a8565b83821115620002d857848385830101525b9695505050505050565b600080600060608486031215620002f7578283fd5b83516001600160401b03808211156200030e578485fd5b6200031c878388016200022f565b9450602086015191508082111562000332578384fd5b5062000341868287016200022f565b604086015190935090506001600160a01b038116811462000360578182fd5b809150509250925092565b634e487b7160e01b600052604160045260246000fd5b60805160a05160c05160601c60e0516101005161012051613d94620003d46000396000612b6101526000612bb001526000612b8b01526000612ae301526000612b0d01526000612b370152613d946000f3fe60806040526004361061011f5760003560e01c8063704b64b3116100a05780638da5cb5b116100645780638da5cb5b14610353578063bc197c8114610371578063d5e787e71461039d578063f23a6e61146103b0578063f2fde38b146103dc5761011f565b8063704b64b3146102bb578063715018a6146102eb5780637a86983f146103005780637f74628a1461032d57806389c34c9c146103405761011f565b806330c642f1116100e757806330c642f1146101f45780634fcf89b514610214578063572b6c051461024c578063629219c81461027b578063704802751461029b5761011f565b806301ffc9a7146101245780630d8e6e2c14610159578063150b7a02146101875780631785f53c146101b257806324d7806c146101d4575b600080fd5b34801561013057600080fd5b5061014461013f3660046133dd565b6103fc565b60405190151581526020015b60405180910390f35b34801561016557600080fd5b5061016e610435565b6040516001600160e01b03199091168152602001610150565b34801561019357600080fd5b5061016e6101a23660046132d4565b630a85bd0160e11b949350505050565b3480156101be57600080fd5b506101d26101cd3660046131c5565b61045a565b005b3480156101e057600080fd5b506101446101ef3660046131c5565b6104b1565b34801561020057600080fd5b506101d261020f366004613415565b6104d2565b34801561022057600080fd5b5061023461022f3660046133dd565b6105e9565b6040516001600160a01b039091168152602001610150565b34801561025857600080fd5b506101446102673660046131c5565b6000546001600160a01b0390811691161490565b34801561028757600080fd5b506101d261029636600461344d565b61060e565b3480156102a757600080fd5b506101d26102b63660046131c5565b610753565b3480156102c757600080fd5b506101446102d63660046133c5565b60009081526006602052604090205460ff1690565b3480156102f757600080fd5b506101d26107aa565b34801561030c57600080fd5b5061032061031b3660046133c5565b6107ff565b604051610150919061392f565b6101d261033b36600461344d565b610902565b6101d261034e36600461344d565b6109aa565b34801561035f57600080fd5b506002546001600160a01b0316610234565b34801561037d57600080fd5b5061016e61038c36600461322a565b63bc197c8160e01b95945050505050565b6101d26103ab36600461344d565b610a46565b3480156103bc57600080fd5b5061016e6103cb36600461333e565b63f23a6e6160e01b95945050505050565b3480156103e857600080fd5b506101d26103f73660046131c5565b610b1a565b60006001600160e01b03198216630271189760e51b148061042d57506301ffc9a760e01b6001600160e01b03198316145b90505b919050565b7f4c23426613a5dc69e08fbd2787e6210aa679d4522e95a89d4dd88c4fd13a22835b90565b6000610464610c01565b905060008061047283610c10565b9150915081819061049f5760405162461bcd60e51b815260040161049691906137dd565b60405180910390fd5b506104ab846000610c5f565b50505050565b6001600160a01b03811660009081526003602052604081205460ff1661042d565b60006104dc610c01565b90506000806104ea83610cb3565b9150915081819061050e5760405162461bcd60e51b815260040161049691906137dd565b506001600160a01b0384163b6105785760405162461bcd60e51b815260206004820152602960248201527f4d61726b65745472616e736665723a2041646472657373206973206e6f7420616044820152680818dbdb9d1c9858dd60ba1b6064820152608401610496565b6001600160e01b0319851660008181526004602090815260409182902080546001600160a01b0319166001600160a01b03891690811790915591519182527f04376b3ce5c4f313e7d536ce7b350d0dd3c3c1adaf7c8e254763c0dfd4d199b691015b60405180910390a25050505050565b6001600160e01b0319166000908152600460205260409020546001600160a01b031690565b600260015414156106315760405162461bcd60e51b8152600401610496906138f8565b6002600155600061064184610cfa565b9050600061064e826107ff565b9050806020015160001415801561067057508051516001600160e01b03191615155b801561067f5750428560c00151105b156106e3576000806106b77fa323ce5da2da0ba8547fdf3b766db1a951382101b4bc34c557dc16614e7c251d88896040015188610d4d565b915091508181906106db5760405162461bcd60e51b815260040161049691906137dd565b50505061073a565b6000806107127fa323ce5da2da0ba8547fdf3b766db1a951382101b4bc34c557dc16614e7c251d888888610db9565b915091508181906107365760405162461bcd60e51b815260040161049691906137dd565b5050505b610748828660400151610ed7565b505060018055505050565b61075b610c01565b6001600160a01b03166107766002546001600160a01b031690565b6001600160a01b03161461079c5760405162461bcd60e51b8152600401610496906137f0565b6107a7816001610c5f565b50565b6107b2610c01565b6001600160a01b03166107cd6002546001600160a01b031690565b6001600160a01b0316146107f35760405162461bcd60e51b8152600401610496906137f0565b6107fd6000611091565b565b60408051608081018252600091810182815260608083015281526020810191909152600082815260056020526040908190208151608081018352815460e01b6001600160e01b031916928101928352600182018054919384929091849160608501919061086b90613a64565b80601f016020809104026020016040519081016040528092919081815260200182805461089790613a64565b80156108e45780601f106108b9576101008083540402835291602001916108e4565b820191906000526020600020905b8154815290600101906020018083116108c757829003601f168201915b50505050508152505081526020016002820154815250509050919050565b600260015414156109255760405162461bcd60e51b8152600401610496906138f8565b60026001556000806109597fc87f724facc6795a5744816bb2f8c13d2a51fd5baa39f1c0f298a19323b341bf868686610db9565b9150915081819061097d5760405162461bcd60e51b815260040161049691906137dd565b50600061098986610cfa565b905061099e81876040015188606001516110e3565b50506001805550505050565b600260015414156109cd5760405162461bcd60e51b8152600401610496906138f8565b6002600155600080610a017f8c40c1e8946416673984fcabe51d93ca7f795d4572deebda294064e6ec0dcee6868686610db9565b91509150818190610a255760405162461bcd60e51b815260040161049691906137dd565b506000610a3186610cfa565b905061099e818760400151886060015161134b565b60026001541415610a695760405162461bcd60e51b8152600401610496906138f8565b6002600155610100830151600090610a80906113da565b9050600080610ab17f14d00b81931cb7dafec4a36b54eb00dd0a0bea1e838291d99ae988b8cec83ef5878787610db9565b91509150818190610ad55760405162461bcd60e51b815260040161049691906137dd565b506000610ae187610cfa565b9050610afa876020015188600001518960400151611411565b610b0d81856040015186606001516115af565b5050600180555050505050565b610b22610c01565b6001600160a01b0316610b3d6002546001600160a01b031690565b6001600160a01b031614610b635760405162461bcd60e51b8152600401610496906137f0565b6001600160a01b038116610bc85760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b6064820152608401610496565b6107a781611091565b600080546001600160a01b0316331415610bf4575060131936013560601c610457565b335b9050610457565b3390565b6000610c0b610bd1565b905090565b60006060610c1d8361178f565b610c45576000604051806060016040528060338152602001613b806033913991509150610c5a565b50506040805160208101909152600081526001905b915091565b6001600160a01b038216600081815260036020526040808220805460ff191685151590811790915590519092917fe68d2c359a771606c400cf8b87000cf5864010363d6a736e98f5047b7bbe18e991a35050565b6001600160a01b03811660009081526003602052604081205460609060ff16610c455760006040518060600160405280602a8152602001613c72602a913991509150610c5a565b60008160000151826040015183608001518460a001518560c00151866101000151604051602001610d309695949392919061372f565b604051602081830303815290604052805190602001209050919050565b60006060600080610d5e88886117de565b9150915081610d71579092509050610db0565b600080610d7f8989896118fd565b9150915081610d95579094509250610db0915050565b60016040518060200160405280600081525095509550505050505b94509492505050565b60006060600080610dca88886117de565b9150915081610ddd579092509050610db0565b600080610def898a600001518a6118fd565b9150915081610e05579094509250610db0915050565b600080610e178b8c604001518b6118fd565b9150915081158015610e3a57506001600160e01b03198c166314d00b8160e01b14155b15610e4e579096509450610db09350505050565b81158015610e6c57506001600160e01b03198c166314d00b8160e01b145b15610eb4576000610e818c61010001516113da565b9050600080610e958e84602001518e6118fd565b9150915081610eb0579099509750610db09650505050505050565b5050505b505060408051602081019091526000815260019b909a5098505050505050505050565b81610ee1816107ff565b6020015115801590610f0857506000610ef9826107ff565b51516001600160e01b03191614155b610f245760405162461bcd60e51b8152600401610496906138af565b600083815260066020526040902054839060ff1615610f555760405162461bcd60e51b815260040161049690613825565b6000848152600560205260408082208151608081018352815460e01b6001600160e01b0319169281019283526001820180549193849290918491606085019190610f9e90613a64565b80601f0160208091040260200160405190810160405280929190818152602001828054610fca90613a64565b80156110175780601f10610fec57610100808354040283529160200191611017565b820191906000526020600020905b815481529060010190602001808311610ffa57829003601f168201915b505050919092525050508152600291909101546020918201526000878152600690915260409020805460ff191660011790559050611056813086611411565b836001600160a01b03167f5a83728f635630ad40af9806f027d16901925691f6e2f6aa18dff23cacc67a9186836040516105da9291906137c4565b600280546001600160a01b038381166001600160a01b0319831681179093556040519116919082907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a35050565b826110ed816107ff565b602001511580159061111457506000611105826107ff565b51516001600160e01b03191614155b6111305760405162461bcd60e51b8152600401610496906138af565b600084815260066020526040902054849060ff16156111615760405162461bcd60e51b815260040161049690613825565b600061116c866107ff565b9050600061117a828661192d565b9050600081600381111561119e57634e487b7160e01b600052602160045260246000fd5b14156111c9576111ae8786611b26565b6111b9823088611411565b6111c4858730611411565b6112ff565b60028160038111156111eb57634e487b7160e01b600052602160045260246000fd5b141561124357600061120e86602001518460200151611b7e90919063ffffffff16565b905061121a8887611b26565b61123d604051806040016040528085600001518152602001838152503089611411565b506112ff565b600181600381111561126557634e487b7160e01b600052602160045260246000fd5b14156112b757600061128883602001518760200151611b7e90919063ffffffff16565b90506112948887611b26565b61123d604051806040016040528085600001518152602001838152508830611411565b60405162461bcd60e51b815260206004820152601d60248201527f4d61726b6574457363726f773a206e6f206173736574206368616e67650000006044820152606401610496565b856001600160a01b03167f1e8094be28d9d505742f8d09beff5561a0c9029aa02b165529101291ed18e845888760405161133a9291906137c4565b60405180910390a250505050505050565b600083815260066020526040902054839060ff161561137c5760405162461bcd60e51b815260040161049690613825565b6113868483611b26565b611391828430611411565b826001600160a01b03167f1e8094be28d9d505742f8d09beff5561a0c9029aa02b165529101291ed18e84585846040516113cc9291906137c4565b60405180910390a250505050565b60408051608081018252600080825260208201526060918101829052818101919091528180602001905181019061042d919061359e565b8251516001600160e01b0319166355575f5d60e11b14156114405761143b82828560200151611b91565b61156f565b8251516001600160e01b0319166322ba176160e21b141561148357600061146a8460000151611ccf565b50905061147d8184848760200151611d7e565b5061156f565b8251516001600160e01b0319166339d690a360e11b1415611524576000806114ae8560000151611ccf565b9150915084602001516001146115115760405162461bcd60e51b815260206004820152602260248201527f4d61726b65745472616e736665723a206572633732312076616c75652065727260448201526137b960f11b6064820152608401610496565b61151d82858584611dbd565b505061156f565b8251516001600160e01b03191663025ceed960e61b14156115645760008061154f8560000151611ccf565b9150915061151d828585848960200151611e2d565b61156f838383611eb3565b7fb8b2690abd5dacd67f0ba4ec749c19e577e7baafb0a6016c1a93aa21cc1a30cf8383836040516115a293929190613942565b60405180910390a1505050565b826115b9816107ff565b60200151158015906115e0575060006115d1826107ff565b51516001600160e01b03191614155b6115fc5760405162461bcd60e51b8152600401610496906138af565b600084815260066020526040902054849060ff161561162d5760405162461bcd60e51b815260040161049690613825565b6000858152600560205260408082208151608081018352815460e01b6001600160e01b031916928101928352600182018054919384929091849160608501919061167690613a64565b80601f01602080910402602001604051908101604052809291908181526020018280546116a290613a64565b80156116ef5780601f106116c4576101008083540402835291602001916116ef565b820191906000526020600020905b8154815290600101906020018083116116d257829003601f168201915b505050919092525050508152600291909101546020918201526000888152600690915260409020805460ff191660011790559050602081015181516117379082803089611f25565b50825190915061174990823089612024565b7f4736e9eb68a8ec7c6598a4d42aeb7bad08b5e0af1b2ea3e1d5eaa47d28c418708787878560405161177e949392919061376c565b60405180910390a150505050505050565b6000816001600160a01b03166117ad6002546001600160a01b031690565b6001600160a01b0316148061042d57506001600160a01b03821660009081526003602052604090205460ff1661042d565b60006060816001600160e01b03198516631188183d60e31b148061181257506001600160e01b0319851663c87f724f60e01b145b8061182d57506001600160e01b031985166314d00b8160e01b145b9050846001600160e01b0319168460e001516001600160e01b03191614611873576000604051806060016040528060298152602001613bd86029913992509250506118f6565b8080156118835750428460a00151115b156118ad576000604051806060016040528060258152602001613cc16025913992509250506118f6565b8080156118bd5750428460c00151105b156118e7576000604051806060016040528060238152602001613b5d6023913992509250506118f6565b6118f084612200565b92509250505b9250929050565b60006060600061190c86612480565b905060008061191c878488612558565b90955093505050505b935093915050565b8051518251516000916001600160e01b0319918216911614818082801561196657508551516001600160e01b0319166322ba176160e21b145b156119ad57600061197a8760000151611ccf565b509050600061198c8760000151611ccf565b509050806001600160a01b0316826001600160a01b03161493505050611a2c565b8280156119e857508551516001600160e01b0319166339d690a360e11b14806119e857508551516001600160e01b03191663025ceed960e61b145b15611a2c576000806119fd8860000151611ccf565b91509150600080611a118960000151611ccf565b6001600160a01b039586169590911694909414955050501490505b821580611a8d575081158015611a8d57508551516001600160e01b0319166322ba176160e21b1480611a7057508551516001600160e01b0319166339d690a360e11b145b80611a8d57508551516001600160e01b03191663025ceed960e61b145b80611acf575080158015611acf57508551516001600160e01b0319166339d690a360e11b1480611acf57508551516001600160e01b03191663025ceed960e61b145b15611ae05760009350505050611b20565b846020015186602001511115611afc5760029350505050611b20565b846020015186602001511015611b185760019350505050611b20565b600393505050505b92915050565b600082815260056020908152604090912082518051825463ffffffff191660e09190911c17825580830151805185948492611b6a9260018501929190910190612f11565b505050602082015181600201559050505050565b6000611b8a8284613a21565b9392505050565b6001600160a01b038316301415611bc75780471015611bc25760405162461bcd60e51b81526004016104969061386b565b611be7565b80341015611be75760405162461bcd60e51b81526004016104969061386b565b6001600160a01b0382163014611cca576000826001600160a01b03168260405160006040518083038185875af1925050503d8060008114611c44576040519150601f19603f3d011682016040523d82523d6000602084013e611c49565b606091505b50509050806104ab5760405162461bcd60e51b815260206004820152604160248201527f4d61726b65745472616e736665723a20756e61626c6520746f2073656e64207660448201527f616c75652c20726563697069656e74206d6179206861766520726576657274656064820152601960fa1b608482015260a401610496565b505050565b805160009081906001600160e01b0319166322ba176160e21b1415611d155760008360200151806020019051810190611d0891906131e1565b925060009150610c5a9050565b82516001600160e01b0319166339d690a360e11b1480611d46575082516001600160e01b03191663025ceed960e61b145b15611d73576000808460200151806020019051810190611d6691906131fd565b9094509250610c5a915050565b506000905080915091565b6001600160a01b038316301415611da857611da36001600160a01b0385168383612617565b6104ab565b6104ab6001600160a01b03851684848461267a565b604051632142170760e11b81526001600160a01b0384811660048301528381166024830152604482018390528516906342842e0e90606401600060405180830381600087803b158015611e0f57600080fd5b505af1158015611e23573d6000803e3d6000fd5b5050505050505050565b604051637921219560e11b81526001600160a01b0385811660048301528481166024830152604482018490526064820183905260a06084830152600060a483015286169063f242432a9060c401600060405180830381600087803b158015611e9457600080fd5b505af1158015611ea8573d6000803e3d6000fd5b505050505050505050565b825151611ebf906105e9565b6001600160a01b03166354bc0cf18484846040518463ffffffff1660e01b8152600401611eee93929190613942565b600060405180830381600087803b158015611f0857600080fd5b505af1158015611f1c573d6000803e3d6000fd5b50505050505050565b836000805b835181101561201957611f71848281518110611f5657634e487b7160e01b600052603260045260246000fd5b602002602001015160200151836126b290919063ffffffff16565b9150600080611fac8589888681518110611f9b57634e487b7160e01b600052603260045260246000fd5b6020026020010151602001516126be565b909550859250905080156120045761200460405180604001604052808c81526020018381525088888681518110611ff357634e487b7160e01b600052603260045260246000fd5b602002602001015160000151611411565b5050808061201190613a9f565b915050611f2a565b509550959350505050565b600083815b600184516120379190613a21565b81101561211e57600061207e85838151811061206357634e487b7160e01b600052603260045260246000fd5b602002602001015160200151886126e090919063ffffffff16565b90506120be8583815181106120a357634e487b7160e01b600052603260045260246000fd5b602002602001015160200151856126b290919063ffffffff16565b9350801561210b576120d08382611b7e565b925061210b60405180604001604052808a81526020018381525087878581518110611ff357634e487b7160e01b600052603260045260246000fd5b508061211681613a9f565b915050612029565b50600083600185516121309190613a21565b8151811061214e57634e487b7160e01b600052603260045260246000fd5b6020026020010151905061216f8160200151846126b290919063ffffffff16565b925082612710146121d75760405162461bcd60e51b815260206004820152602c60248201527f4d61726b6574457363726f773a2073756d207061796f75747320627073206e6f60448201526b7420657175616c203130302560a01b6064820152608401610496565b8115611f1c57611f1c604051806040016040528089815260200184815250868360000151611411565b80516000906060906001600160a01b0316612239576000604051806060016040528060218152602001613c306021913991509150610c5a565b6020808401510151158061225b5750602083015151516001600160e01b031916155b15612284576000604051806060016040528060258152602001613b126025913991509150610c5a565b60408301516001600160a01b03166122ba576000604051806060016040528060218152602001613c516021913991509150610c5a565b60608301516020015115806122dd5750606083015151516001600160e01b031916155b15612306576000604051806060016040528060258152602001613bb36025913991509150610c5a565b60808301516123505760006040518060400160405280602081526020017f4f726465724c69623a2073616c742076616c69646174696f6e206661696c656481525091509150610c5a565b60a083015161237d576000604051806060016040528060218152602001613d3e6021913991509150610c5a565b60c08301516123c457505060408051808201909152601f81527f4f726465724c69623a20656e642076616c69646174696f6e206661696c6564006020820152600090610c5a565b60e08301516001600160e01b031916631188183d60e31b14806123fb575060e08301516001600160e01b03191663c87f724f60e01b145b8061241a575060e08301516001600160e01b03191663a323ce5d60e01b145b80612439575060e08301516001600160e01b0319166314d00b8160e01b145b612461576000604051806060016040528060258152602001613c9c6025913991509150610c5a565b6124776124728461010001516113da565b6126f8565b91509150915091565b60007f0d999f36d3a716accb518c8df572d62f9ad18e61e5d2fc0a8873e5209034741882600001516124b58460200151612769565b84604001516124c78660600151612769565b608087015160a088015160c089015160e08a01516101008b01518051602091820120604051610d309b9a999897969594939201998a526001600160a01b0398891660208b015260408a0197909752949096166060880152608087019290925260a086015260c085015260e08401929092526001600160e01b0319919091166101008301526101208201526101400190565b600060608251600014156125b6576000612570610c01565b9050806001600160a01b0316866001600160a01b0316146125b05760006040518060600160405280602f8152602001613c01602f91399250925050611925565b506125fb565b6125d36125c2856127bf565b6001600160a01b038716908561280d565b6125fb576000604051806060016040528060328152602001613ce66032913991509150611925565b5050604080516020810190915260008152600190935093915050565b6040516001600160a01b038316602482015260448101829052611cca90849063a9059cbb60e01b906064015b60408051601f198184030181529190526020810180516001600160e01b03166001600160e01b031990931692909217909152612967565b6040516001600160a01b03808516602483015283166044820152606481018290526104ab9085906323b872dd60e01b90608401612643565b6000611b8a82846139ca565b6000806126d4856126cf86866126e0565b612a39565b91509150935093915050565b6000611b8a6127106126f28585612a61565b90612a6d565b80516000906060906001600160e01b031916632611a13360e11b1461273b576000604051806060016040528060268152602001613b376026913991509150610c5a565b604083015151610c45576000604051806060016040528060268152602001613d186026913991509150610c5a565b60007f0f853a4679bbff6b17a175889551060b2026c90a7d72a4e5e48cc56f3d234f246127998360000151612a79565b602080850151604051610d30949392019283526020830191909152604082015260600190565b600061042d6127cc612ad6565b8360405161190160f01b6020820152602281018390526042810182905260009060620160405160208183030381529060405280519060200120905092915050565b600080600061281c8585612c00565b9092509050600081600481111561284357634e487b7160e01b600052602160045260246000fd5b1480156128615750856001600160a01b0316826001600160a01b0316145b1561287157600192505050611b8a565b600080876001600160a01b0316631626ba7e60e01b88886040516024016128999291906137ab565b60408051601f198184030181529181526020820180516001600160e01b03166001600160e01b03199094169390931790925290516128d79190613713565b600060405180830381855afa9150503d8060008114612912576040519150601f19603f3d011682016040523d82523d6000602084013e612917565b606091505b509150915081801561292a575080516020145b801561295b57508051630b135d3f60e11b9061294f90830160209081019084016133f9565b6001600160e01b031916145b98975050505050505050565b60006129bc826040518060400160405280602081526020017f5361666545524332303a206c6f772d6c6576656c2063616c6c206661696c6564815250856001600160a01b0316612c6d9092919063ffffffff16565b805190915015611cca57808060200190518101906129da91906133a5565b611cca5760405162461bcd60e51b815260206004820152602a60248201527f5361666545524332303a204552433230206f7065726174696f6e20646964206e6044820152691bdd081cdd58d8d9595960b21b6064820152608401610496565b60008082841115612a5857612a4e8484611b7e565b91508290506118f6565b50600093915050565b6000611b8a8284613a02565b6000611b8a82846139e2565b8051602080830151805190820120604051600093610d30937f452a0dc408cb0d27ffc3b3caff933a5208040a53a9dbecd8d89cad2c0d40e00c939192019283526001600160e01b0319919091166020830152604082015260600190565b6000306001600160a01b037f000000000000000000000000000000000000000000000000000000000000000016148015612b2f57507f000000000000000000000000000000000000000000000000000000000000000046145b15612b5b57507f0000000000000000000000000000000000000000000000000000000000000000610457565b604080517f00000000000000000000000000000000000000000000000000000000000000006020808301919091527f0000000000000000000000000000000000000000000000000000000000000000828401527f000000000000000000000000000000000000000000000000000000000000000060608301524660808301523060a0808401919091528351808403909101815260c09092019092528051910120610bf6565b600080825160411415612c375760208301516040840151606085015160001a612c2b87828585612c84565b945094505050506118f6565b825160401415612c615760208301516040840151612c56868383612d6e565b9350935050506118f6565b506000905060026118f6565b6060612c7c8484600085612da7565b949350505050565b6000807f7fffffffffffffffffffffffffffffff5d576e7357a4501ddfe92f46681b20a0831115612cbb5750600090506003610db0565b8460ff16601b14158015612cd357508460ff16601c14155b15612ce45750600090506004610db0565b6040805160008082526020820180845289905260ff881692820192909252606081018690526080810185905260019060a0016020604051602081039080840390855afa158015612d38573d6000803e3d6000fd5b5050604051601f1901519150506001600160a01b038116612d6157600060019250925050610db0565b9660009650945050505050565b6000806001600160ff1b03831681612d8b60ff86901c601b6139ca565b9050612d9987828885612c84565b935093505050935093915050565b606082471015612e085760405162461bcd60e51b815260206004820152602660248201527f416464726573733a20696e73756666696369656e742062616c616e636520666f6044820152651c8818d85b1b60d21b6064820152608401610496565b6001600160a01b0385163b612e5f5760405162461bcd60e51b815260206004820152601d60248201527f416464726573733a2063616c6c20746f206e6f6e2d636f6e74726163740000006044820152606401610496565b600080866001600160a01b03168587604051612e7b9190613713565b60006040518083038185875af1925050503d8060008114612eb8576040519150601f19603f3d011682016040523d82523d6000602084013e612ebd565b606091505b5091509150612ecd828286612ed8565b979650505050505050565b60608315612ee7575081611b8a565b825115612ef75782518084602001fd5b8160405162461bcd60e51b815260040161049691906137dd565b828054612f1d90613a64565b90600052602060002090601f016020900481019282612f3f5760008555612f85565b82601f10612f5857805160ff1916838001178555612f85565b82800160010185558215612f85579182015b82811115612f85578251825591602001919060010190612f6a565b50612f91929150612f95565b5090565b5b80821115612f915760008155600101612f96565b803561043081613ae6565b600082601f830112612fc5578081fd5b81516020612fda612fd5836139a6565b613975565b82815281810190858301604080860288018501891015612ff8578687fd5b865b868110156130405781838b031215613010578788fd5b61301982613975565b835161302481613ae6565b8152838701518782015285529385019391810191600101612ffa565b509198975050505050505050565b600082601f83011261305e578081fd5b8135602061306e612fd5836139a6565b828152818101908583018385028701840188101561308a578586fd5b855b858110156130a85781358452928401929084019060010161308c565b5090979650505050505050565b803561043081613afb565b600082601f8301126130d0578081fd5b813567ffffffffffffffff8111156130ea576130ea613ad0565b6130fd601f8201601f1916602001613975565b818152846020838601011115613111578283fd5b816020850160208301379081016020019190915292915050565b60006040828403121561313c578081fd5b6131466040613975565b9050813567ffffffffffffffff8082111561316057600080fd5b908301906040828603121561317457600080fd5b61317e6040613975565b823561318981613afb565b815260208301358281111561319d57600080fd5b6131a9878286016130c0565b6020830152508084525050506020820135602082015292915050565b6000602082840312156131d6578081fd5b8135611b8a81613ae6565b6000602082840312156131f2578081fd5b8151611b8a81613ae6565b6000806040838503121561320f578081fd5b825161321a81613ae6565b6020939093015192949293505050565b600080600080600060a08688031215613241578081fd5b853561324c81613ae6565b9450602086013561325c81613ae6565b9350604086013567ffffffffffffffff80821115613278578283fd5b61328489838a0161304e565b94506060880135915080821115613299578283fd5b6132a589838a0161304e565b935060808801359150808211156132ba578283fd5b506132c7888289016130c0565b9150509295509295909350565b600080600080608085870312156132e9578182fd5b84356132f481613ae6565b9350602085013561330481613ae6565b925060408501359150606085013567ffffffffffffffff811115613326578182fd5b613332878288016130c0565b91505092959194509250565b600080600080600060a08688031215613355578283fd5b853561336081613ae6565b9450602086013561337081613ae6565b93506040860135925060608601359150608086013567ffffffffffffffff811115613399578182fd5b6132c7888289016130c0565b6000602082840312156133b6578081fd5b81518015158114611b8a578182fd5b6000602082840312156133d6578081fd5b5035919050565b6000602082840312156133ee578081fd5b8135611b8a81613afb565b60006020828403121561340a578081fd5b8151611b8a81613afb565b60008060408385031215613427578182fd5b823561343281613afb565b9150602083013561344281613ae6565b809150509250929050565b600080600060608486031215613461578081fd5b833567ffffffffffffffff80821115613478578283fd5b818601915061012080838903121561348e578384fd5b61349781613975565b90506134a283612faa565b81526020830135828111156134b5578485fd5b6134c18982860161312b565b6020830152506134d360408401612faa565b60408201526060830135828111156134e9578485fd5b6134f58982860161312b565b6060830152506080830135608082015260a083013560a082015260c083013560c082015261352560e084016130b5565b60e0820152610100808401358381111561353d578586fd5b6135498a8287016130c0565b828401525050809550506020860135915080821115613566578283fd5b613572878388016130c0565b93506040860135915080821115613587578283fd5b50613594868287016130c0565b9150509250925092565b6000602082840312156135af578081fd5b815167ffffffffffffffff808211156135c6578283fd5b90830190608082860312156135d9578283fd5b6135e36080613975565b82516135ee81613afb565b815260208301516135fe81613ae6565b6020820152604083015182811115613614578485fd5b61362087828601612fb5565b604083015250606083015182811115613637578485fd5b61364387828601612fb5565b60608301525095945050505050565b6000815180845260208085019450808401835b8381101561369557815180516001600160a01b031688528301518388015260409096019590820190600101613665565b509495945050505050565b600081518084526136b8816020860160208601613a38565b601f01601f19169290920160200192915050565b600081516040845263ffffffff60e01b815116604085015260208101519050604060608501526136ff60808501826136a0565b602093840151949093019390935250919050565b60008251613725818460208701613a38565b9190910192915050565b600060018060a01b03808916835280881660208401525085604083015284606083015283608083015260c060a083015261295b60c08301846136a0565b6000858252608060208301526137856080830186613652565b82810360408401526137978186613652565b90508281036060840152612ecd81856136cc565b600083825260406020830152612c7c60408301846136a0565b600083825260406020830152612c7c60408301846136cc565b600060208252611b8a60208301846136a0565b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b60208082526026908201527f4d61726b6574457363726f773a20657363726f7720616c726561647920636f6d6040820152651c1b195d195960d21b606082015260800190565b60208082526024908201527f4d61726b65745472616e736665723a20696e73756666696369656e742062616c604082015263616e636560e01b606082015260800190565b60208082526029908201527f4d61726b6574457363726f773a20657363726f7720616c7265616479206e6f746040820152680819195c1bdcda5d1960ba1b606082015260800190565b6020808252601f908201527f5265656e7472616e637947756172643a207265656e7472616e742063616c6c00604082015260600190565b600060208252611b8a60208301846136cc565b60006060825261395560608301866136cc565b6001600160a01b0394851660208401529290931660409091015292915050565b604051601f8201601f1916810167ffffffffffffffff8111828210171561399e5761399e613ad0565b604052919050565b600067ffffffffffffffff8211156139c0576139c0613ad0565b5060209081020190565b600082198211156139dd576139dd613aba565b500190565b6000826139fd57634e487b7160e01b81526012600452602481fd5b500490565b6000816000190483118215151615613a1c57613a1c613aba565b500290565b600082821015613a3357613a33613aba565b500390565b60005b83811015613a53578181015183820152602001613a3b565b838111156104ab5750506000910152565b600281046001821680613a7857607f821691505b60208210811415613a9957634e487b7160e01b600052602260045260246000fd5b50919050565b6000600019821415613ab357613ab3613aba565b5060010190565b634e487b7160e01b600052601160045260246000fd5b634e487b7160e01b600052604160045260246000fd5b6001600160a01b03811681146107a757600080fd5b6001600160e01b0319811681146107a757600080fdfe4f726465724c69623a206d616b6541737365742076616c69646174696f6e206661696c65644f726465724578744c69623a2076657273696f6e2076616c69646174696f6e206661696c65644d61726b6574426173653a20656e6420766572696669636174696f6e206661696c656441646d696e436f6e74726f6c6c65723a2061646d696e206f72206f776e657220766572696669636174696f6e206661696c65644f726465724c69623a2074616b6541737365742076616c69646174696f6e206661696c65644d61726b6574426173653a206f726465725479706520766572696669636174696f6e206661696c65644d61726b6574547856616c6964617461626c653a2073656e64657220766572696669636174696f6e206661696c65644f726465724c69623a206d616b65722076616c69646174696f6e206661696c65644f726465724c69623a2074616b65722076616c69646174696f6e206661696c656441646d696e436f6e74726f6c6c65723a2061646d696e20766572696669636174696f6e206661696c65644f726465724c69623a206f72646572547970652076616c69646174696f6e206661696c65644d61726b6574426173653a20737461727420766572696669636174696f6e206661696c65644d61726b6574547856616c6964617461626c653a207369676e617475726520766572696669636174696f6e206661696c65644f726465724578744c69623a207061796f7574732076616c69646174696f6e206661696c65644f726465724c69623a2073746172742076616c69646174696f6e206661696c6564a264697066735822122087b5cfaaa4d2be30d1a37a25aa09750df00e4229cd467ff973074c94aba15d1064736f6c63430008020033000000000000000000000000000000000000000000000000000000000000006000000000000000000000000000000000000000000000000000000000000000a00000000000000000000000009123dfe6cf35f81d3368fe683aa311386abde4a1000000000000000000000000000000000000000000000000000000000000000f526571756573744d61726b65745631000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000025631000000000000000000000000000000000000000000000000000000000000
Deployed Bytecode
0x60806040526004361061011f5760003560e01c8063704b64b3116100a05780638da5cb5b116100645780638da5cb5b14610353578063bc197c8114610371578063d5e787e71461039d578063f23a6e61146103b0578063f2fde38b146103dc5761011f565b8063704b64b3146102bb578063715018a6146102eb5780637a86983f146103005780637f74628a1461032d57806389c34c9c146103405761011f565b806330c642f1116100e757806330c642f1146101f45780634fcf89b514610214578063572b6c051461024c578063629219c81461027b578063704802751461029b5761011f565b806301ffc9a7146101245780630d8e6e2c14610159578063150b7a02146101875780631785f53c146101b257806324d7806c146101d4575b600080fd5b34801561013057600080fd5b5061014461013f3660046133dd565b6103fc565b60405190151581526020015b60405180910390f35b34801561016557600080fd5b5061016e610435565b6040516001600160e01b03199091168152602001610150565b34801561019357600080fd5b5061016e6101a23660046132d4565b630a85bd0160e11b949350505050565b3480156101be57600080fd5b506101d26101cd3660046131c5565b61045a565b005b3480156101e057600080fd5b506101446101ef3660046131c5565b6104b1565b34801561020057600080fd5b506101d261020f366004613415565b6104d2565b34801561022057600080fd5b5061023461022f3660046133dd565b6105e9565b6040516001600160a01b039091168152602001610150565b34801561025857600080fd5b506101446102673660046131c5565b6000546001600160a01b0390811691161490565b34801561028757600080fd5b506101d261029636600461344d565b61060e565b3480156102a757600080fd5b506101d26102b63660046131c5565b610753565b3480156102c757600080fd5b506101446102d63660046133c5565b60009081526006602052604090205460ff1690565b3480156102f757600080fd5b506101d26107aa565b34801561030c57600080fd5b5061032061031b3660046133c5565b6107ff565b604051610150919061392f565b6101d261033b36600461344d565b610902565b6101d261034e36600461344d565b6109aa565b34801561035f57600080fd5b506002546001600160a01b0316610234565b34801561037d57600080fd5b5061016e61038c36600461322a565b63bc197c8160e01b95945050505050565b6101d26103ab36600461344d565b610a46565b3480156103bc57600080fd5b5061016e6103cb36600461333e565b63f23a6e6160e01b95945050505050565b3480156103e857600080fd5b506101d26103f73660046131c5565b610b1a565b60006001600160e01b03198216630271189760e51b148061042d57506301ffc9a760e01b6001600160e01b03198316145b90505b919050565b7f4c23426613a5dc69e08fbd2787e6210aa679d4522e95a89d4dd88c4fd13a22835b90565b6000610464610c01565b905060008061047283610c10565b9150915081819061049f5760405162461bcd60e51b815260040161049691906137dd565b60405180910390fd5b506104ab846000610c5f565b50505050565b6001600160a01b03811660009081526003602052604081205460ff1661042d565b60006104dc610c01565b90506000806104ea83610cb3565b9150915081819061050e5760405162461bcd60e51b815260040161049691906137dd565b506001600160a01b0384163b6105785760405162461bcd60e51b815260206004820152602960248201527f4d61726b65745472616e736665723a2041646472657373206973206e6f7420616044820152680818dbdb9d1c9858dd60ba1b6064820152608401610496565b6001600160e01b0319851660008181526004602090815260409182902080546001600160a01b0319166001600160a01b03891690811790915591519182527f04376b3ce5c4f313e7d536ce7b350d0dd3c3c1adaf7c8e254763c0dfd4d199b691015b60405180910390a25050505050565b6001600160e01b0319166000908152600460205260409020546001600160a01b031690565b600260015414156106315760405162461bcd60e51b8152600401610496906138f8565b6002600155600061064184610cfa565b9050600061064e826107ff565b9050806020015160001415801561067057508051516001600160e01b03191615155b801561067f5750428560c00151105b156106e3576000806106b77fa323ce5da2da0ba8547fdf3b766db1a951382101b4bc34c557dc16614e7c251d88896040015188610d4d565b915091508181906106db5760405162461bcd60e51b815260040161049691906137dd565b50505061073a565b6000806107127fa323ce5da2da0ba8547fdf3b766db1a951382101b4bc34c557dc16614e7c251d888888610db9565b915091508181906107365760405162461bcd60e51b815260040161049691906137dd565b5050505b610748828660400151610ed7565b505060018055505050565b61075b610c01565b6001600160a01b03166107766002546001600160a01b031690565b6001600160a01b03161461079c5760405162461bcd60e51b8152600401610496906137f0565b6107a7816001610c5f565b50565b6107b2610c01565b6001600160a01b03166107cd6002546001600160a01b031690565b6001600160a01b0316146107f35760405162461bcd60e51b8152600401610496906137f0565b6107fd6000611091565b565b60408051608081018252600091810182815260608083015281526020810191909152600082815260056020526040908190208151608081018352815460e01b6001600160e01b031916928101928352600182018054919384929091849160608501919061086b90613a64565b80601f016020809104026020016040519081016040528092919081815260200182805461089790613a64565b80156108e45780601f106108b9576101008083540402835291602001916108e4565b820191906000526020600020905b8154815290600101906020018083116108c757829003601f168201915b50505050508152505081526020016002820154815250509050919050565b600260015414156109255760405162461bcd60e51b8152600401610496906138f8565b60026001556000806109597fc87f724facc6795a5744816bb2f8c13d2a51fd5baa39f1c0f298a19323b341bf868686610db9565b9150915081819061097d5760405162461bcd60e51b815260040161049691906137dd565b50600061098986610cfa565b905061099e81876040015188606001516110e3565b50506001805550505050565b600260015414156109cd5760405162461bcd60e51b8152600401610496906138f8565b6002600155600080610a017f8c40c1e8946416673984fcabe51d93ca7f795d4572deebda294064e6ec0dcee6868686610db9565b91509150818190610a255760405162461bcd60e51b815260040161049691906137dd565b506000610a3186610cfa565b905061099e818760400151886060015161134b565b60026001541415610a695760405162461bcd60e51b8152600401610496906138f8565b6002600155610100830151600090610a80906113da565b9050600080610ab17f14d00b81931cb7dafec4a36b54eb00dd0a0bea1e838291d99ae988b8cec83ef5878787610db9565b91509150818190610ad55760405162461bcd60e51b815260040161049691906137dd565b506000610ae187610cfa565b9050610afa876020015188600001518960400151611411565b610b0d81856040015186606001516115af565b5050600180555050505050565b610b22610c01565b6001600160a01b0316610b3d6002546001600160a01b031690565b6001600160a01b031614610b635760405162461bcd60e51b8152600401610496906137f0565b6001600160a01b038116610bc85760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201526564647265737360d01b6064820152608401610496565b6107a781611091565b600080546001600160a01b0316331415610bf4575060131936013560601c610457565b335b9050610457565b3390565b6000610c0b610bd1565b905090565b60006060610c1d8361178f565b610c45576000604051806060016040528060338152602001613b806033913991509150610c5a565b50506040805160208101909152600081526001905b915091565b6001600160a01b038216600081815260036020526040808220805460ff191685151590811790915590519092917fe68d2c359a771606c400cf8b87000cf5864010363d6a736e98f5047b7bbe18e991a35050565b6001600160a01b03811660009081526003602052604081205460609060ff16610c455760006040518060600160405280602a8152602001613c72602a913991509150610c5a565b60008160000151826040015183608001518460a001518560c00151866101000151604051602001610d309695949392919061372f565b604051602081830303815290604052805190602001209050919050565b60006060600080610d5e88886117de565b9150915081610d71579092509050610db0565b600080610d7f8989896118fd565b9150915081610d95579094509250610db0915050565b60016040518060200160405280600081525095509550505050505b94509492505050565b60006060600080610dca88886117de565b9150915081610ddd579092509050610db0565b600080610def898a600001518a6118fd565b9150915081610e05579094509250610db0915050565b600080610e178b8c604001518b6118fd565b9150915081158015610e3a57506001600160e01b03198c166314d00b8160e01b14155b15610e4e579096509450610db09350505050565b81158015610e6c57506001600160e01b03198c166314d00b8160e01b145b15610eb4576000610e818c61010001516113da565b9050600080610e958e84602001518e6118fd565b9150915081610eb0579099509750610db09650505050505050565b5050505b505060408051602081019091526000815260019b909a5098505050505050505050565b81610ee1816107ff565b6020015115801590610f0857506000610ef9826107ff565b51516001600160e01b03191614155b610f245760405162461bcd60e51b8152600401610496906138af565b600083815260066020526040902054839060ff1615610f555760405162461bcd60e51b815260040161049690613825565b6000848152600560205260408082208151608081018352815460e01b6001600160e01b0319169281019283526001820180549193849290918491606085019190610f9e90613a64565b80601f0160208091040260200160405190810160405280929190818152602001828054610fca90613a64565b80156110175780601f10610fec57610100808354040283529160200191611017565b820191906000526020600020905b815481529060010190602001808311610ffa57829003601f168201915b505050919092525050508152600291909101546020918201526000878152600690915260409020805460ff191660011790559050611056813086611411565b836001600160a01b03167f5a83728f635630ad40af9806f027d16901925691f6e2f6aa18dff23cacc67a9186836040516105da9291906137c4565b600280546001600160a01b038381166001600160a01b0319831681179093556040519116919082907f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e090600090a35050565b826110ed816107ff565b602001511580159061111457506000611105826107ff565b51516001600160e01b03191614155b6111305760405162461bcd60e51b8152600401610496906138af565b600084815260066020526040902054849060ff16156111615760405162461bcd60e51b815260040161049690613825565b600061116c866107ff565b9050600061117a828661192d565b9050600081600381111561119e57634e487b7160e01b600052602160045260246000fd5b14156111c9576111ae8786611b26565b6111b9823088611411565b6111c4858730611411565b6112ff565b60028160038111156111eb57634e487b7160e01b600052602160045260246000fd5b141561124357600061120e86602001518460200151611b7e90919063ffffffff16565b905061121a8887611b26565b61123d604051806040016040528085600001518152602001838152503089611411565b506112ff565b600181600381111561126557634e487b7160e01b600052602160045260246000fd5b14156112b757600061128883602001518760200151611b7e90919063ffffffff16565b90506112948887611b26565b61123d604051806040016040528085600001518152602001838152508830611411565b60405162461bcd60e51b815260206004820152601d60248201527f4d61726b6574457363726f773a206e6f206173736574206368616e67650000006044820152606401610496565b856001600160a01b03167f1e8094be28d9d505742f8d09beff5561a0c9029aa02b165529101291ed18e845888760405161133a9291906137c4565b60405180910390a250505050505050565b600083815260066020526040902054839060ff161561137c5760405162461bcd60e51b815260040161049690613825565b6113868483611b26565b611391828430611411565b826001600160a01b03167f1e8094be28d9d505742f8d09beff5561a0c9029aa02b165529101291ed18e84585846040516113cc9291906137c4565b60405180910390a250505050565b60408051608081018252600080825260208201526060918101829052818101919091528180602001905181019061042d919061359e565b8251516001600160e01b0319166355575f5d60e11b14156114405761143b82828560200151611b91565b61156f565b8251516001600160e01b0319166322ba176160e21b141561148357600061146a8460000151611ccf565b50905061147d8184848760200151611d7e565b5061156f565b8251516001600160e01b0319166339d690a360e11b1415611524576000806114ae8560000151611ccf565b9150915084602001516001146115115760405162461bcd60e51b815260206004820152602260248201527f4d61726b65745472616e736665723a206572633732312076616c75652065727260448201526137b960f11b6064820152608401610496565b61151d82858584611dbd565b505061156f565b8251516001600160e01b03191663025ceed960e61b14156115645760008061154f8560000151611ccf565b9150915061151d828585848960200151611e2d565b61156f838383611eb3565b7fb8b2690abd5dacd67f0ba4ec749c19e577e7baafb0a6016c1a93aa21cc1a30cf8383836040516115a293929190613942565b60405180910390a1505050565b826115b9816107ff565b60200151158015906115e0575060006115d1826107ff565b51516001600160e01b03191614155b6115fc5760405162461bcd60e51b8152600401610496906138af565b600084815260066020526040902054849060ff161561162d5760405162461bcd60e51b815260040161049690613825565b6000858152600560205260408082208151608081018352815460e01b6001600160e01b031916928101928352600182018054919384929091849160608501919061167690613a64565b80601f01602080910402602001604051908101604052809291908181526020018280546116a290613a64565b80156116ef5780601f106116c4576101008083540402835291602001916116ef565b820191906000526020600020905b8154815290600101906020018083116116d257829003601f168201915b505050919092525050508152600291909101546020918201526000888152600690915260409020805460ff191660011790559050602081015181516117379082803089611f25565b50825190915061174990823089612024565b7f4736e9eb68a8ec7c6598a4d42aeb7bad08b5e0af1b2ea3e1d5eaa47d28c418708787878560405161177e949392919061376c565b60405180910390a150505050505050565b6000816001600160a01b03166117ad6002546001600160a01b031690565b6001600160a01b0316148061042d57506001600160a01b03821660009081526003602052604090205460ff1661042d565b60006060816001600160e01b03198516631188183d60e31b148061181257506001600160e01b0319851663c87f724f60e01b145b8061182d57506001600160e01b031985166314d00b8160e01b145b9050846001600160e01b0319168460e001516001600160e01b03191614611873576000604051806060016040528060298152602001613bd86029913992509250506118f6565b8080156118835750428460a00151115b156118ad576000604051806060016040528060258152602001613cc16025913992509250506118f6565b8080156118bd5750428460c00151105b156118e7576000604051806060016040528060238152602001613b5d6023913992509250506118f6565b6118f084612200565b92509250505b9250929050565b60006060600061190c86612480565b905060008061191c878488612558565b90955093505050505b935093915050565b8051518251516000916001600160e01b0319918216911614818082801561196657508551516001600160e01b0319166322ba176160e21b145b156119ad57600061197a8760000151611ccf565b509050600061198c8760000151611ccf565b509050806001600160a01b0316826001600160a01b03161493505050611a2c565b8280156119e857508551516001600160e01b0319166339d690a360e11b14806119e857508551516001600160e01b03191663025ceed960e61b145b15611a2c576000806119fd8860000151611ccf565b91509150600080611a118960000151611ccf565b6001600160a01b039586169590911694909414955050501490505b821580611a8d575081158015611a8d57508551516001600160e01b0319166322ba176160e21b1480611a7057508551516001600160e01b0319166339d690a360e11b145b80611a8d57508551516001600160e01b03191663025ceed960e61b145b80611acf575080158015611acf57508551516001600160e01b0319166339d690a360e11b1480611acf57508551516001600160e01b03191663025ceed960e61b145b15611ae05760009350505050611b20565b846020015186602001511115611afc5760029350505050611b20565b846020015186602001511015611b185760019350505050611b20565b600393505050505b92915050565b600082815260056020908152604090912082518051825463ffffffff191660e09190911c17825580830151805185948492611b6a9260018501929190910190612f11565b505050602082015181600201559050505050565b6000611b8a8284613a21565b9392505050565b6001600160a01b038316301415611bc75780471015611bc25760405162461bcd60e51b81526004016104969061386b565b611be7565b80341015611be75760405162461bcd60e51b81526004016104969061386b565b6001600160a01b0382163014611cca576000826001600160a01b03168260405160006040518083038185875af1925050503d8060008114611c44576040519150601f19603f3d011682016040523d82523d6000602084013e611c49565b606091505b50509050806104ab5760405162461bcd60e51b815260206004820152604160248201527f4d61726b65745472616e736665723a20756e61626c6520746f2073656e64207660448201527f616c75652c20726563697069656e74206d6179206861766520726576657274656064820152601960fa1b608482015260a401610496565b505050565b805160009081906001600160e01b0319166322ba176160e21b1415611d155760008360200151806020019051810190611d0891906131e1565b925060009150610c5a9050565b82516001600160e01b0319166339d690a360e11b1480611d46575082516001600160e01b03191663025ceed960e61b145b15611d73576000808460200151806020019051810190611d6691906131fd565b9094509250610c5a915050565b506000905080915091565b6001600160a01b038316301415611da857611da36001600160a01b0385168383612617565b6104ab565b6104ab6001600160a01b03851684848461267a565b604051632142170760e11b81526001600160a01b0384811660048301528381166024830152604482018390528516906342842e0e90606401600060405180830381600087803b158015611e0f57600080fd5b505af1158015611e23573d6000803e3d6000fd5b5050505050505050565b604051637921219560e11b81526001600160a01b0385811660048301528481166024830152604482018490526064820183905260a06084830152600060a483015286169063f242432a9060c401600060405180830381600087803b158015611e9457600080fd5b505af1158015611ea8573d6000803e3d6000fd5b505050505050505050565b825151611ebf906105e9565b6001600160a01b03166354bc0cf18484846040518463ffffffff1660e01b8152600401611eee93929190613942565b600060405180830381600087803b158015611f0857600080fd5b505af1158015611f1c573d6000803e3d6000fd5b50505050505050565b836000805b835181101561201957611f71848281518110611f5657634e487b7160e01b600052603260045260246000fd5b602002602001015160200151836126b290919063ffffffff16565b9150600080611fac8589888681518110611f9b57634e487b7160e01b600052603260045260246000fd5b6020026020010151602001516126be565b909550859250905080156120045761200460405180604001604052808c81526020018381525088888681518110611ff357634e487b7160e01b600052603260045260246000fd5b602002602001015160000151611411565b5050808061201190613a9f565b915050611f2a565b509550959350505050565b600083815b600184516120379190613a21565b81101561211e57600061207e85838151811061206357634e487b7160e01b600052603260045260246000fd5b602002602001015160200151886126e090919063ffffffff16565b90506120be8583815181106120a357634e487b7160e01b600052603260045260246000fd5b602002602001015160200151856126b290919063ffffffff16565b9350801561210b576120d08382611b7e565b925061210b60405180604001604052808a81526020018381525087878581518110611ff357634e487b7160e01b600052603260045260246000fd5b508061211681613a9f565b915050612029565b50600083600185516121309190613a21565b8151811061214e57634e487b7160e01b600052603260045260246000fd5b6020026020010151905061216f8160200151846126b290919063ffffffff16565b925082612710146121d75760405162461bcd60e51b815260206004820152602c60248201527f4d61726b6574457363726f773a2073756d207061796f75747320627073206e6f60448201526b7420657175616c203130302560a01b6064820152608401610496565b8115611f1c57611f1c604051806040016040528089815260200184815250868360000151611411565b80516000906060906001600160a01b0316612239576000604051806060016040528060218152602001613c306021913991509150610c5a565b6020808401510151158061225b5750602083015151516001600160e01b031916155b15612284576000604051806060016040528060258152602001613b126025913991509150610c5a565b60408301516001600160a01b03166122ba576000604051806060016040528060218152602001613c516021913991509150610c5a565b60608301516020015115806122dd5750606083015151516001600160e01b031916155b15612306576000604051806060016040528060258152602001613bb36025913991509150610c5a565b60808301516123505760006040518060400160405280602081526020017f4f726465724c69623a2073616c742076616c69646174696f6e206661696c656481525091509150610c5a565b60a083015161237d576000604051806060016040528060218152602001613d3e6021913991509150610c5a565b60c08301516123c457505060408051808201909152601f81527f4f726465724c69623a20656e642076616c69646174696f6e206661696c6564006020820152600090610c5a565b60e08301516001600160e01b031916631188183d60e31b14806123fb575060e08301516001600160e01b03191663c87f724f60e01b145b8061241a575060e08301516001600160e01b03191663a323ce5d60e01b145b80612439575060e08301516001600160e01b0319166314d00b8160e01b145b612461576000604051806060016040528060258152602001613c9c6025913991509150610c5a565b6124776124728461010001516113da565b6126f8565b91509150915091565b60007f0d999f36d3a716accb518c8df572d62f9ad18e61e5d2fc0a8873e5209034741882600001516124b58460200151612769565b84604001516124c78660600151612769565b608087015160a088015160c089015160e08a01516101008b01518051602091820120604051610d309b9a999897969594939201998a526001600160a01b0398891660208b015260408a0197909752949096166060880152608087019290925260a086015260c085015260e08401929092526001600160e01b0319919091166101008301526101208201526101400190565b600060608251600014156125b6576000612570610c01565b9050806001600160a01b0316866001600160a01b0316146125b05760006040518060600160405280602f8152602001613c01602f91399250925050611925565b506125fb565b6125d36125c2856127bf565b6001600160a01b038716908561280d565b6125fb576000604051806060016040528060328152602001613ce66032913991509150611925565b5050604080516020810190915260008152600190935093915050565b6040516001600160a01b038316602482015260448101829052611cca90849063a9059cbb60e01b906064015b60408051601f198184030181529190526020810180516001600160e01b03166001600160e01b031990931692909217909152612967565b6040516001600160a01b03808516602483015283166044820152606481018290526104ab9085906323b872dd60e01b90608401612643565b6000611b8a82846139ca565b6000806126d4856126cf86866126e0565b612a39565b91509150935093915050565b6000611b8a6127106126f28585612a61565b90612a6d565b80516000906060906001600160e01b031916632611a13360e11b1461273b576000604051806060016040528060268152602001613b376026913991509150610c5a565b604083015151610c45576000604051806060016040528060268152602001613d186026913991509150610c5a565b60007f0f853a4679bbff6b17a175889551060b2026c90a7d72a4e5e48cc56f3d234f246127998360000151612a79565b602080850151604051610d30949392019283526020830191909152604082015260600190565b600061042d6127cc612ad6565b8360405161190160f01b6020820152602281018390526042810182905260009060620160405160208183030381529060405280519060200120905092915050565b600080600061281c8585612c00565b9092509050600081600481111561284357634e487b7160e01b600052602160045260246000fd5b1480156128615750856001600160a01b0316826001600160a01b0316145b1561287157600192505050611b8a565b600080876001600160a01b0316631626ba7e60e01b88886040516024016128999291906137ab565b60408051601f198184030181529181526020820180516001600160e01b03166001600160e01b03199094169390931790925290516128d79190613713565b600060405180830381855afa9150503d8060008114612912576040519150601f19603f3d011682016040523d82523d6000602084013e612917565b606091505b509150915081801561292a575080516020145b801561295b57508051630b135d3f60e11b9061294f90830160209081019084016133f9565b6001600160e01b031916145b98975050505050505050565b60006129bc826040518060400160405280602081526020017f5361666545524332303a206c6f772d6c6576656c2063616c6c206661696c6564815250856001600160a01b0316612c6d9092919063ffffffff16565b805190915015611cca57808060200190518101906129da91906133a5565b611cca5760405162461bcd60e51b815260206004820152602a60248201527f5361666545524332303a204552433230206f7065726174696f6e20646964206e6044820152691bdd081cdd58d8d9595960b21b6064820152608401610496565b60008082841115612a5857612a4e8484611b7e565b91508290506118f6565b50600093915050565b6000611b8a8284613a02565b6000611b8a82846139e2565b8051602080830151805190820120604051600093610d30937f452a0dc408cb0d27ffc3b3caff933a5208040a53a9dbecd8d89cad2c0d40e00c939192019283526001600160e01b0319919091166020830152604082015260600190565b6000306001600160a01b037f0000000000000000000000002027d285a5f9a27ab0d7d9848a04b6b2dfb5effd16148015612b2f57507f000000000000000000000000000000000000000000000000000000000000000146145b15612b5b57507f4231a6c5908e2f619cd9294c692e30dde482c2003ce3ae69bf277a20d22d40e3610457565b604080517f8b73c3c69bb8fe3d512ecc4cf759cc79239f7b179b0ffacaa9a75d522b39400f6020808301919091527fe44445d874d38f028519f5ecfb5ac9de16bde982e441daa3283968fc281435a6828401527f4c23426613a5dc69e08fbd2787e6210aa679d4522e95a89d4dd88c4fd13a228360608301524660808301523060a0808401919091528351808403909101815260c09092019092528051910120610bf6565b600080825160411415612c375760208301516040840151606085015160001a612c2b87828585612c84565b945094505050506118f6565b825160401415612c615760208301516040840151612c56868383612d6e565b9350935050506118f6565b506000905060026118f6565b6060612c7c8484600085612da7565b949350505050565b6000807f7fffffffffffffffffffffffffffffff5d576e7357a4501ddfe92f46681b20a0831115612cbb5750600090506003610db0565b8460ff16601b14158015612cd357508460ff16601c14155b15612ce45750600090506004610db0565b6040805160008082526020820180845289905260ff881692820192909252606081018690526080810185905260019060a0016020604051602081039080840390855afa158015612d38573d6000803e3d6000fd5b5050604051601f1901519150506001600160a01b038116612d6157600060019250925050610db0565b9660009650945050505050565b6000806001600160ff1b03831681612d8b60ff86901c601b6139ca565b9050612d9987828885612c84565b935093505050935093915050565b606082471015612e085760405162461bcd60e51b815260206004820152602660248201527f416464726573733a20696e73756666696369656e742062616c616e636520666f6044820152651c8818d85b1b60d21b6064820152608401610496565b6001600160a01b0385163b612e5f5760405162461bcd60e51b815260206004820152601d60248201527f416464726573733a2063616c6c20746f206e6f6e2d636f6e74726163740000006044820152606401610496565b600080866001600160a01b03168587604051612e7b9190613713565b60006040518083038185875af1925050503d8060008114612eb8576040519150601f19603f3d011682016040523d82523d6000602084013e612ebd565b606091505b5091509150612ecd828286612ed8565b979650505050505050565b60608315612ee7575081611b8a565b825115612ef75782518084602001fd5b8160405162461bcd60e51b815260040161049691906137dd565b828054612f1d90613a64565b90600052602060002090601f016020900481019282612f3f5760008555612f85565b82601f10612f5857805160ff1916838001178555612f85565b82800160010185558215612f85579182015b82811115612f85578251825591602001919060010190612f6a565b50612f91929150612f95565b5090565b5b80821115612f915760008155600101612f96565b803561043081613ae6565b600082601f830112612fc5578081fd5b81516020612fda612fd5836139a6565b613975565b82815281810190858301604080860288018501891015612ff8578687fd5b865b868110156130405781838b031215613010578788fd5b61301982613975565b835161302481613ae6565b8152838701518782015285529385019391810191600101612ffa565b509198975050505050505050565b600082601f83011261305e578081fd5b8135602061306e612fd5836139a6565b828152818101908583018385028701840188101561308a578586fd5b855b858110156130a85781358452928401929084019060010161308c565b5090979650505050505050565b803561043081613afb565b600082601f8301126130d0578081fd5b813567ffffffffffffffff8111156130ea576130ea613ad0565b6130fd601f8201601f1916602001613975565b818152846020838601011115613111578283fd5b816020850160208301379081016020019190915292915050565b60006040828403121561313c578081fd5b6131466040613975565b9050813567ffffffffffffffff8082111561316057600080fd5b908301906040828603121561317457600080fd5b61317e6040613975565b823561318981613afb565b815260208301358281111561319d57600080fd5b6131a9878286016130c0565b6020830152508084525050506020820135602082015292915050565b6000602082840312156131d6578081fd5b8135611b8a81613ae6565b6000602082840312156131f2578081fd5b8151611b8a81613ae6565b6000806040838503121561320f578081fd5b825161321a81613ae6565b6020939093015192949293505050565b600080600080600060a08688031215613241578081fd5b853561324c81613ae6565b9450602086013561325c81613ae6565b9350604086013567ffffffffffffffff80821115613278578283fd5b61328489838a0161304e565b94506060880135915080821115613299578283fd5b6132a589838a0161304e565b935060808801359150808211156132ba578283fd5b506132c7888289016130c0565b9150509295509295909350565b600080600080608085870312156132e9578182fd5b84356132f481613ae6565b9350602085013561330481613ae6565b925060408501359150606085013567ffffffffffffffff811115613326578182fd5b613332878288016130c0565b91505092959194509250565b600080600080600060a08688031215613355578283fd5b853561336081613ae6565b9450602086013561337081613ae6565b93506040860135925060608601359150608086013567ffffffffffffffff811115613399578182fd5b6132c7888289016130c0565b6000602082840312156133b6578081fd5b81518015158114611b8a578182fd5b6000602082840312156133d6578081fd5b5035919050565b6000602082840312156133ee578081fd5b8135611b8a81613afb565b60006020828403121561340a578081fd5b8151611b8a81613afb565b60008060408385031215613427578182fd5b823561343281613afb565b9150602083013561344281613ae6565b809150509250929050565b600080600060608486031215613461578081fd5b833567ffffffffffffffff80821115613478578283fd5b818601915061012080838903121561348e578384fd5b61349781613975565b90506134a283612faa565b81526020830135828111156134b5578485fd5b6134c18982860161312b565b6020830152506134d360408401612faa565b60408201526060830135828111156134e9578485fd5b6134f58982860161312b565b6060830152506080830135608082015260a083013560a082015260c083013560c082015261352560e084016130b5565b60e0820152610100808401358381111561353d578586fd5b6135498a8287016130c0565b828401525050809550506020860135915080821115613566578283fd5b613572878388016130c0565b93506040860135915080821115613587578283fd5b50613594868287016130c0565b9150509250925092565b6000602082840312156135af578081fd5b815167ffffffffffffffff808211156135c6578283fd5b90830190608082860312156135d9578283fd5b6135e36080613975565b82516135ee81613afb565b815260208301516135fe81613ae6565b6020820152604083015182811115613614578485fd5b61362087828601612fb5565b604083015250606083015182811115613637578485fd5b61364387828601612fb5565b60608301525095945050505050565b6000815180845260208085019450808401835b8381101561369557815180516001600160a01b031688528301518388015260409096019590820190600101613665565b509495945050505050565b600081518084526136b8816020860160208601613a38565b601f01601f19169290920160200192915050565b600081516040845263ffffffff60e01b815116604085015260208101519050604060608501526136ff60808501826136a0565b602093840151949093019390935250919050565b60008251613725818460208701613a38565b9190910192915050565b600060018060a01b03808916835280881660208401525085604083015284606083015283608083015260c060a083015261295b60c08301846136a0565b6000858252608060208301526137856080830186613652565b82810360408401526137978186613652565b90508281036060840152612ecd81856136cc565b600083825260406020830152612c7c60408301846136a0565b600083825260406020830152612c7c60408301846136cc565b600060208252611b8a60208301846136a0565b6020808252818101527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e6572604082015260600190565b60208082526026908201527f4d61726b6574457363726f773a20657363726f7720616c726561647920636f6d6040820152651c1b195d195960d21b606082015260800190565b60208082526024908201527f4d61726b65745472616e736665723a20696e73756666696369656e742062616c604082015263616e636560e01b606082015260800190565b60208082526029908201527f4d61726b6574457363726f773a20657363726f7720616c7265616479206e6f746040820152680819195c1bdcda5d1960ba1b606082015260800190565b6020808252601f908201527f5265656e7472616e637947756172643a207265656e7472616e742063616c6c00604082015260600190565b600060208252611b8a60208301846136cc565b60006060825261395560608301866136cc565b6001600160a01b0394851660208401529290931660409091015292915050565b604051601f8201601f1916810167ffffffffffffffff8111828210171561399e5761399e613ad0565b604052919050565b600067ffffffffffffffff8211156139c0576139c0613ad0565b5060209081020190565b600082198211156139dd576139dd613aba565b500190565b6000826139fd57634e487b7160e01b81526012600452602481fd5b500490565b6000816000190483118215151615613a1c57613a1c613aba565b500290565b600082821015613a3357613a33613aba565b500390565b60005b83811015613a53578181015183820152602001613a3b565b838111156104ab5750506000910152565b600281046001821680613a7857607f821691505b60208210811415613a9957634e487b7160e01b600052602260045260246000fd5b50919050565b6000600019821415613ab357613ab3613aba565b5060010190565b634e487b7160e01b600052601160045260246000fd5b634e487b7160e01b600052604160045260246000fd5b6001600160a01b03811681146107a757600080fd5b6001600160e01b0319811681146107a757600080fdfe4f726465724c69623a206d616b6541737365742076616c69646174696f6e206661696c65644f726465724578744c69623a2076657273696f6e2076616c69646174696f6e206661696c65644d61726b6574426173653a20656e6420766572696669636174696f6e206661696c656441646d696e436f6e74726f6c6c65723a2061646d696e206f72206f776e657220766572696669636174696f6e206661696c65644f726465724c69623a2074616b6541737365742076616c69646174696f6e206661696c65644d61726b6574426173653a206f726465725479706520766572696669636174696f6e206661696c65644d61726b6574547856616c6964617461626c653a2073656e64657220766572696669636174696f6e206661696c65644f726465724c69623a206d616b65722076616c69646174696f6e206661696c65644f726465724c69623a2074616b65722076616c69646174696f6e206661696c656441646d696e436f6e74726f6c6c65723a2061646d696e20766572696669636174696f6e206661696c65644f726465724c69623a206f72646572547970652076616c69646174696f6e206661696c65644d61726b6574426173653a20737461727420766572696669636174696f6e206661696c65644d61726b6574547856616c6964617461626c653a207369676e617475726520766572696669636174696f6e206661696c65644f726465724578744c69623a207061796f7574732076616c69646174696f6e206661696c65644f726465724c69623a2073746172742076616c69646174696f6e206661696c6564a264697066735822122087b5cfaaa4d2be30d1a37a25aa09750df00e4229cd467ff973074c94aba15d1064736f6c63430008020033
Constructor Arguments (ABI-Encoded and is the last bytes of the Contract Creation Code above)
000000000000000000000000000000000000000000000000000000000000006000000000000000000000000000000000000000000000000000000000000000a00000000000000000000000009123dfe6cf35f81d3368fe683aa311386abde4a1000000000000000000000000000000000000000000000000000000000000000f526571756573744d61726b65745631000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000025631000000000000000000000000000000000000000000000000000000000000
-----Decoded View---------------
Arg [0] : name (string): RequestMarketV1
Arg [1] : version (string): V1
Arg [2] : trustedForwarder (address): 0x9123DfE6cF35F81D3368fE683AA311386ABdE4a1
-----Encoded View---------------
7 Constructor Arguments found :
Arg [0] : 0000000000000000000000000000000000000000000000000000000000000060
Arg [1] : 00000000000000000000000000000000000000000000000000000000000000a0
Arg [2] : 0000000000000000000000009123dfe6cf35f81d3368fe683aa311386abde4a1
Arg [3] : 000000000000000000000000000000000000000000000000000000000000000f
Arg [4] : 526571756573744d61726b657456310000000000000000000000000000000000
Arg [5] : 0000000000000000000000000000000000000000000000000000000000000002
Arg [6] : 5631000000000000000000000000000000000000000000000000000000000000
Loading...
Loading
Loading...
Loading
Multichain Portfolio | 26 Chains
Chain | Token | Portfolio % | Price | Amount | Value |
---|---|---|---|---|---|
ETH | 100.00% | $3,018.2 | 0.24 | $724.37 |
Loading...
Loading
[ Download: CSV Export ]
[ 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.