ETH Price: $3,077.82 (-6.95%)
 

Overview

ETH Balance

0 ETH

Eth Value

$0.00

Multichain Info

No addresses found
Transaction Hash
Method
Block
From
To
Exchange Single ...170472132023-04-14 18:39:11653 days ago1681497551IN
0xcA833F94...f9ebf6b02
0 ETH0.0049716127.50413308
Exchange Single ...170472052023-04-14 18:37:35653 days ago1681497455IN
0xcA833F94...f9ebf6b02
0 ETH0.0043340127.02355891
Exchange Single ...170273142023-04-11 20:51:59656 days ago1681246319IN
0xcA833F94...f9ebf6b02
0 ETH0.005220427.95534899
Cancel Order168715192023-03-20 21:19:59678 days ago1679347199IN
0xcA833F94...f9ebf6b02
0 ETH0.001204320.05411561
Cancel Order168715152023-03-20 21:19:11678 days ago1679347151IN
0xcA833F94...f9ebf6b02
0 ETH0.0011925419.86224391
Cancel Order168715092023-03-20 21:17:59678 days ago1679347079IN
0xcA833F94...f9ebf6b02
0 ETH0.0012446220.72959429
Cancel Order168715042023-03-20 21:16:59678 days ago1679347019IN
0xcA833F94...f9ebf6b02
0 ETH0.0013318822.18300291
Exchange Single ...168363822023-03-15 22:53:11683 days ago1678920791IN
0xcA833F94...f9ebf6b02
0 ETH0.0044990525.34976392
Exchange Single ...168363702023-03-15 22:50:47683 days ago1678920647IN
0xcA833F94...f9ebf6b02
0 ETH0.004622326.04425786
Exchange Single ...168226522023-03-14 0:32:47685 days ago1678753967IN
0xcA833F94...f9ebf6b02
0.027 ETH0.0033105218.4299114
Cancel Order168218102023-03-13 21:42:11685 days ago1678743731IN
0xcA833F94...f9ebf6b02
0 ETH0.0013127921.72164736
Cancel Order167641112023-03-05 18:56:11693 days ago1678042571IN
0xcA833F94...f9ebf6b02
0 ETH0.0019893433.1397584
Cancel Order167582282023-03-04 23:05:59694 days ago1677971159IN
0xcA833F94...f9ebf6b02
0 ETH0.001407822.71384786
Cancel Order167258042023-02-28 9:35:35699 days ago1677576935IN
0xcA833F94...f9ebf6b02
0 ETH0.0013085321.8027584
Exchange Single ...167138592023-02-26 17:22:23700 days ago1677432143IN
0xcA833F94...f9ebf6b02
0 ETH0.0040688321.78645153
Cancel Order166992842023-02-24 16:08:59702 days ago1677254939IN
0xcA833F94...f9ebf6b02
0 ETH0.0055461192.39053568
Cancel Order166962962023-02-24 6:01:35703 days ago1677218495IN
0xcA833F94...f9ebf6b02
0 ETH0.0017904129.84967684
Cancel Order166931202023-02-23 19:16:59703 days ago1677179819IN
0xcA833F94...f9ebf6b02
0 ETH0.0025366342.0132409
Cancel Order166790202023-02-21 19:41:47705 days ago1677008507IN
0xcA833F94...f9ebf6b02
0 ETH0.0017376528.95273333
Cancel Order166732762023-02-21 0:18:35706 days ago1676938715IN
0xcA833F94...f9ebf6b02
0 ETH0.0014865324.7635848
Exchange Multipl...166541162023-02-18 7:43:47709 days ago1676706227IN
0xcA833F94...f9ebf6b02
0.75 ETH0.0178810746.96757402
Cancel Order166514542023-02-17 22:43:35709 days ago1676673815IN
0xcA833F94...f9ebf6b02
0 ETH0.0022105736.82514904
Exchange Single ...166498722023-02-17 17:21:23709 days ago1676654483IN
0xcA833F94...f9ebf6b02
0.6 ETH0.02725871142.4309108
Exchange Single ...166489562023-02-17 14:14:59709 days ago1676643299IN
0xcA833F94...f9ebf6b02
0.25 ETH0.0119428566.68040112
Exchange Single ...166488842023-02-17 13:59:47709 days ago1676642387IN
0xcA833F94...f9ebf6b02
0.12 ETH0.0106590158.90550796
View all transactions

Latest 25 internal transactions (View All)

Advanced mode:
Parent Transaction Hash Block
From
To
171626482023-05-01 1:13:35637 days ago1682903615
0xcA833F94...f9ebf6b02
0.06 ETH
171626482023-05-01 1:13:35637 days ago1682903615
0xcA833F94...f9ebf6b02
0.06 ETH
168226522023-03-14 0:32:47685 days ago1678753967
0xcA833F94...f9ebf6b02
0.027 ETH
166541162023-02-18 7:43:47709 days ago1676706227
0xcA833F94...f9ebf6b02
0.75 ETH
166515112023-02-17 22:55:11709 days ago1676674511
0xcA833F94...f9ebf6b02
0.4 ETH
166515112023-02-17 22:55:11709 days ago1676674511
0xcA833F94...f9ebf6b02
0.4 ETH
166498722023-02-17 17:21:23709 days ago1676654483
0xcA833F94...f9ebf6b02
0.6 ETH
166489562023-02-17 14:14:59709 days ago1676643299
0xcA833F94...f9ebf6b02
0.25 ETH
166488842023-02-17 13:59:47709 days ago1676642387
0xcA833F94...f9ebf6b02
0.12 ETH
166247022023-02-14 4:46:47713 days ago1676350007
0xcA833F94...f9ebf6b02
0.0289 ETH
165989282023-02-10 14:22:59716 days ago1676038979
0xcA833F94...f9ebf6b02
0.43 ETH
165838192023-02-08 11:39:11719 days ago1675856351
0xcA833F94...f9ebf6b02
0.179 ETH
165815532023-02-08 4:03:59719 days ago1675829039
0xcA833F94...f9ebf6b02
0.74 ETH
165814782023-02-08 3:48:59719 days ago1675828139
0xcA833F94...f9ebf6b02
0.69942 ETH
165784652023-02-07 17:42:35719 days ago1675791755
0xcA833F94...f9ebf6b02
0.08 ETH
165784652023-02-07 17:42:35719 days ago1675791755
0xcA833F94...f9ebf6b02
0.138 ETH
165784652023-02-07 17:42:35719 days ago1675791755
0xcA833F94...f9ebf6b02
0.218 ETH
165782172023-02-07 16:52:47719 days ago1675788767
0xcA833F94...f9ebf6b02
0.57 ETH
165782172023-02-07 16:52:47719 days ago1675788767
0xcA833F94...f9ebf6b02
0.03 ETH
165743652023-02-07 3:56:35720 days ago1675742195
0xcA833F94...f9ebf6b02
0.0799 ETH
165737412023-02-07 1:50:59720 days ago1675734659
0xcA833F94...f9ebf6b02
0.1 ETH
165737412023-02-07 1:50:59720 days ago1675734659
0xcA833F94...f9ebf6b02
0.15 ETH
165737412023-02-07 1:50:59720 days ago1675734659
0xcA833F94...f9ebf6b02
0.25 ETH
165719442023-02-06 19:49:59720 days ago1675712999
0xcA833F94...f9ebf6b02
0.79705 ETH
165719442023-02-06 19:49:59720 days ago1675712999
0xcA833F94...f9ebf6b02
0.04195 ETH
View All Internal Transactions
Loading...
Loading

Contract Source Code Verified (Exact Match)

Contract Name:
GigaMart

Compiler Version
v0.8.15+commit.e14f2714

Optimization Enabled:
Yes with 1337 runs

Other Settings:
default evmVersion
File 1 of 21 : GigaMart.sol
// SPDX-License-Identifier: AGPL-3.0-only
pragma solidity ^0.8.15;

import {
	ReentrancyGuard
} from "@openzeppelin/contracts/security/ReentrancyGuard.sol";

import "./core/Executor.sol";

/// Thrown if the count of items in required argument arrays differ.
error ArgumentsLengthMismatched ();

/**
	Thrown during mass-cancelation if the provided nonce is lower than current 
	nonce.

	@param nonce The nonce used to indicate the current set of uncanceled user 
		orders.
*/
error NonceLowerThanCurrent (
	uint256 nonce
);

/// Thrown if attempting to send items to the zero address.
error InvalidRecipient ();

/**
	Thrown if attempting to execute an order that is not valid for fulfillment; 
	this prevents offers from being executed as if they were listings.
*/
error WrongOrderType ();

/**
	@custom:benediction DEVS BENEDICAT ET PROTEGAT CONTRACTVS MEAM
	@title GigaMart Exchange
	@author Rostislav Khlebnikov <@catpic5buck>
	@custom:contributor Tim Clancy <@_Enoch>
	@custom:contributor throw; <@0xthrpw>
	
	GigaMart is a new NFT platform built for the world by the SuperVerse DAO. 
	This is the first iteration of the exchange and is based on a delegated user 
	proxy architecture.

	@custom:date December 4th, 2022.
*/
contract GigaMart is Executor, ReentrancyGuard {

	/**
		Emitted when a user cancels all of their orders. All orders with a nonce 
		less than `minNonce` will be canceled.

		@param sender The caller who is canceling their orders.
		@param minNonce The new nonce to use in mass-cancelation.
	*/
	event AllOrdersCancelled (
		address indexed sender,
		uint256 minNonce
	);

	/**
		Construct a new instance of the GigaMart exchange.

		@param _registry The address of the existing proxy registry.
		@param _tokenTransferProxy The address of the token transfer proxy contract.
		@param _validator The address of a privileged validator for permitting 
			collection administrators to control their royalty fees.
		@param _protocolFeeRecipient The address which receives fees from the 
			exchange.
		@param _protocolFeePercent The percent of fees taken by 
			`_protocolFeeRecipient` in basis points (1/100th %; i.e. 200 = 2%).
	*/
	constructor (
		IProxyRegistry _registry,
		TokenTransferProxy _tokenTransferProxy,
		address _validator,
		address _protocolFeeRecipient,
		uint96 _protocolFeePercent
	) Executor(
		_registry,
		_tokenTransferProxy,
		_validator,
		_protocolFeeRecipient,
		_protocolFeePercent
	) { }

	/**
		Allow the caller to cancel an order so long as they are the maker of the 
		order.

		@param _order The `Order` data to cancel.
	*/
	function cancelOrder (
		Entities.Order calldata _order
	) external {
		_cancelOrder(_order);
	}

	/**
		Allow the caller to cancel a set of particular orders so long as they are 
		the maker of each order.

		@param _orders An array of `Order` data to cancel.
	*/
	function cancelOrders (
		Entities.Order[] calldata _orders
	) public {
		for (uint256 i; i < _orders.length; ) {
			_cancelOrder(_orders[i]);
			unchecked {
				++i;
			}
		}
	}

	/**
		Allow the caller to cancel all of their orders created with a nonce lower 
		than the new `_minNonce`.

		@param _minNonce The new nonce to use in mass-cancelation.

		@custom:throws NonceLowerThanCurrent if the provided nonce is not less than 
			the current nonce.
	*/
	function cancelAllOrders (
		uint256 _minNonce
	) external {

		// Verify that the new nonce is not less than the current nonce.
		if (_minNonce < minOrderNonces[msg.sender]) {
			revert NonceLowerThanCurrent(minOrderNonces[msg.sender]);
		}

		// Set the new minimum nonce and emit an event.
		minOrderNonces[msg.sender] = _minNonce;
		emit AllOrdersCancelled(msg.sender, _minNonce);
	}

	/**
		Transfer multiple items using the user-proxy and executable bytecode.

		@param _targets The array of addresses which should be called with the 
			function calls encoded in `_data`.
		@param _data The array of encoded function calls performed against the 
			addresses in `_targets`.

		@custom:throws ArgumentsLengthMismatched if the `_targets` and `_data` 
			arrays are mismatched.
	*/
	function transferMultipleItems (
		address[] calldata _targets,
		bytes[] calldata _data
	) external {
		if (_targets.length != _data.length) {
			revert ArgumentsLengthMismatched();
		}
		_multiTransfer(_targets, _data);
	}

	/**
		Exchange a single ERC-721 or ERC-1155 item for Ether or ERC-20 tokens.

		@param _recipient The address which will receive the item.
		@param _order The `Order` to execute.
		@param _signature The signature provided for fulfilling the order.
		@param _tokenId The unique token ID of the item.
		@param _toInvalidate An optional array of `Order`s by the same caller to 
			cancel while fulfilling the exchange.

		@custom:throws InvalidRecipient if the item `_recipient` is the zero 
			address.
	*/
	function exchangeSingleItem (
		address _recipient,
		Entities.Order memory _order,
		Entities.Sig calldata _signature,
		uint256 _tokenId,
		Entities.Order[] calldata _toInvalidate
	) external payable nonReentrant {

		// Prevent the item from being sent to the zero address.
		if (_recipient == address(0)) {
			revert InvalidRecipient();
		}

		// Perform the exchange.
		_exchange(_recipient, _order, _signature, _tokenId);
		
		// Optionally invalidate other orders while performing this exchange.
		if (_toInvalidate.length > 0) {
			cancelOrders(_toInvalidate);
		}
	}

	/**
		Exchange multiple ERC-721 or ERC-1155 items for Ether or ERC-20 tokens.

		@param _recipient The address which will receive the items.
		@param _orders The array of orders that are being executed.
		@param _signatures The array of signatures provided for fulfilling the 
			orders.
		@param _toInvalidate An optional array of `Order`s by the same caller to 
			cancel while fulfilling the exchange.

		@custom:throws ArgumentsLengthMismatched if the `_orders` and `_signatures` 
			arrays are mismatched.
		@custom:throws InvalidRecipient if the item `_recipient` is the zero 
			address.
		@custom:throws WrongOrderType if attempting to fulfill an offer using this 
			function.
	*/
	function exchangeMultipleItems (
		address _recipient,
		Entities.Order[] memory _orders,
		Entities.Sig[] calldata _signatures,
		Entities.Order[] calldata _toInvalidate
	) external payable nonReentrant {
		if (_orders.length != _signatures.length) {
			revert ArgumentsLengthMismatched();
		}

		// Prevent the item from being sent to the zero address.
		if (_recipient == address(0)) {
			revert InvalidRecipient();
		}

		// Prepare an accumulator array for collecting payments.
		bytes memory payments = new bytes(32);
		for (uint256 i; i < _orders.length; ) {

			// Prevent offers from being fulfilled by this function.
			if (uint8(_orders[i].outline.saleKind) > 2) {
				revert WrongOrderType();
			}

			// Perform each exchange and accumulate payments.
			_exchangeUnchecked(_recipient, _orders[i], _signatures[i], payments);
			unchecked {
				i++;
			}
		}

		// Fulfill the accumulated payment.
		_pay(payments, msg.sender, address(tokenTransferProxy));

		// Optionally invalidate other orders after performing this exchange.
		if (_toInvalidate.length > 0) {
			cancelOrders(_toInvalidate);
		}
	}
}

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

pragma solidity ^0.8.0;

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

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

    uint256 private _status;

    constructor() {
        _status = _NOT_ENTERED;
    }

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

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

        _;

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

File 3 of 21 : Executor.sol
// SPDX-License-Identifier: AGPL-3.0-only
pragma solidity ^0.8.15;

import {
	Entities,
	Sales,
	AuthenticatedProxy
} from "./Entities.sol";
import {
	RoyaltyManager
} from "./RoyaltyManager.sol";
import {
	NativeTransfer
} from "../libraries/NativeTransfer.sol";
import {
	OwnableDelegateProxy
} from "../proxy/OwnableDelegateProxy.sol";
import {
	TokenTransferProxy,
	IProxyRegistry,
	Address
} from "../proxy/TokenTransferProxy.sol";

/// Thrown if the user proxy does not exist (bytecode length is zero).
error UserProxyDoesNotExist ();

/**
	Thrown if the user-proxy implementation is pointing to an unexpected 
	implementation.
*/
error UnknownUserProxyImplementation ();

/// Thrown if a call to the user-proxy are fails.
error CallToProxyFailed ();

/**
	Thrown on order cancelation if the order already has been fulfilled or 
	canceled.
*/
error OrderIsAlreadyCancelled ();

/**
	Thrown when attempting order cancelation functions, if checks for msg.sender,
	order nonce or signatures are failed. 
*/
error CannotAuthenticateOrder ();

/**
	Thrown if order terms are invalid, expired, or the provided exchange address 
	does not match this contract.
*/
error InvalidOrder ();

/**
	Thrown if insufficient value is sent to fulfill an order price.
*/
error NotEnoughValueSent ();

/**
	@custom:benediction DEVS BENEDICAT ET PROTEGAT CONTRACTVS MEAM
	@title GigaMart Executor
	@author Rostislav Khlebnikov <@catpic5buck>
	@custom:contributor Tim Clancy <@_Enoch>
	@custom:contributor throw; <@0xthrpw>
	
	This first iteration of the exchange executor is inspired by the old Wyvern 
	architecture `ExchangeCore`.

	@custom:date December 4th, 2022.
*/
abstract contract Executor is RoyaltyManager {
	using Entities for Entities.Order;
	using NativeTransfer for address;

	/**
		A specific 13 second duration, slightly longer than the duration of one 
		block, so as to allow the successful execution of orders within a leeway of 
		approximately one block.
	*/
	uint256 private constant LUCKY_NUMBER = 13;

	/// The selector for EIP-1271 contract-based signatures.
	bytes4 internal constant EIP_1271_SELECTOR = bytes4(
		keccak256("isValidSignature(bytes32,bytes)")
	);

	/// A reference to the immutable proxy registry.
	IProxyRegistry public immutable registry;

	/// A global, shared token transfer proxy for fulfilling exchanges.
	TokenTransferProxy public immutable tokenTransferProxy;

	/**
		A mapping from each caller to the minimum nonce of their order books. When 
		a caller increments their nonce, all user offers with nonces below the 
		value in this mapping are canceled.
	*/
	mapping ( address => uint256 ) public minOrderNonces;

	/// A mapping of all orders which have been canceled or finalized.
	mapping ( bytes32 => bool ) public cancelledOrFinalized;

	/**
		Emitted when an order is canceled.

		@param maker The order maker's address.
		@param hash The hash of the order.
		@param data The parameters of the order concatenated together, e.g. 
			{collection address, encoded transfer function call}.
	*/
	event OrderCancelled (
		address indexed maker,
		bytes32 hash,
		bytes data
	);

	/**
		Emitted when an item has been successfully exchanged.

		@param order The hash of the order.
		@param maker The order maker's address.
		@param taker The order taker's address.
		@param data An array of bytes that contains the order sale kind, price, 
			target, data, and success status.
	*/
	event OrderResult (
		bytes32 order,
		address indexed maker,
		address indexed taker,
		bytes data
	);

	/**
		Construct a new instance of the GigaMart order executor.

		@param _registry The address of the existing proxy registry.
		@param _tokenTransferProxy The address of the token transfer proxy contract.
		@param _validator The address of a privileged validator for permitting 
			collection administrators to control their royalty fees.
		@param _protocolFeeRecipient The address which receives fees from the 
			exchange.
		@param _protocolFeePercent The percent of fees taken by 
			`_protocolFeeRecipient` in basis points (1/100th %; i.e. 200 = 2%).
	*/
	constructor (
		IProxyRegistry _registry,
		TokenTransferProxy _tokenTransferProxy,
		address _validator,
		address _protocolFeeRecipient,
		uint96 _protocolFeePercent
	) RoyaltyManager(_validator, _protocolFeeRecipient, _protocolFeePercent) {
		tokenTransferProxy = _tokenTransferProxy;
		registry = _registry;
	}

	/**
		Hash an order and return the hash that a client must sign, including the 
		standard message prefix.

		@param _order The order to sign.

		@return _ The order hash that must be signed by the client.
	*/
	function _hashToSign (
		Entities.Order memory _order
	) private view returns (bytes32) {
		return keccak256(
			abi.encodePacked(
				"\x19\x01",
				_deriveDomainSeparator(),
				_order.hash()
			)
		);
	}

	/**
		Cancel an order, preventing it from being matched. An order must be 
		canceled by its maker.
		
		@param order The `Order` to cancel.

		@custom:throws OrderAlreadyCancelled if the order has already been 
			fulfilled, individually canceled, or mass-canceled.
		@custom:throws CannotAuthenticateOrder if the caller is not the maker of 
			the order.
	*/
	function _cancelOrder (
		Entities.Order calldata order
	) internal {

		// Calculate the order hash.
		bytes32 hash = _hashToSign(order);

		// Verify order is still live.
		if (
			cancelledOrFinalized[hash] ||	order.nonce < minOrderNonces[msg.sender]
		) {
			revert OrderIsAlreadyCancelled();
		}

		// Verify the order is being canceled by its maker.
		if (order.outline.maker != msg.sender) {
			revert CannotAuthenticateOrder();
		}

		// Cancel the order and log the event.
		cancelledOrFinalized[hash] = true;
		emit OrderCancelled(
			order.outline.maker,
			hash,
			abi.encode(order.outline.target, order.data)
		);
	}

	/**
		Transfer multiple items using the user-proxy and executable bytecode.

		@param _targets The array of addresses which should be called with the 
			function calls encoded in `_data`.
		@param _data The array of encoded function calls performed against the 
			addresses in `_targets`.

		@custom:throws UserProxyDoesNotExist if the targeted delegate proxy for the 
			user does not exist.
		@custom:throws UnknownUserProxyImplementation if the targeted delegate 
			proxy implementation is not as expected.
		@custom:throws CallToProxyFailed if an encoded call to the proxy fails.
	*/
	function _multiTransfer (
		address[] calldata _targets,
		bytes[] calldata _data
	) internal {

		// Store the registry object in memory to save gas.
		IProxyRegistry proxyRegistry = registry;

		// Retrieve the caller's delegate proxy, verifying that it exists.
		address delegateProxy = proxyRegistry.proxies(msg.sender);
		if (!Address.isContract(delegateProxy)) {
			revert UserProxyDoesNotExist();
		}

		// Verify that the implementation of the user's delegate proxy is expected.
		if (
			OwnableDelegateProxy(payable(delegateProxy)).implementation() !=
			proxyRegistry.delegateProxyImplementation()
		) {
			revert UnknownUserProxyImplementation();
		}

		// Access the passthrough `AuthenticatedProxy` to make transfer calls.
		AuthenticatedProxy proxy = AuthenticatedProxy(payable(delegateProxy));
		for (uint256 i; i < _targets.length; ) {

			// Perform each encoded call and verify that they succeeded.
			if (
				!proxy.call(
					_targets[i],
					AuthenticatedProxy.CallType.Call,
					_data[i]
				)
			) {
				revert CallToProxyFailed();
			}
			unchecked {
				++i;
			}
		}
	}

	/**
		Perform validation on the supplied `_taker` and `_order` address. This 
		validation ensures that the correct exchange is used and that the order 
		maker is neither the recipient, message sender, or zero address. This 
		validation also ensures that the salekind is sensible and matches the 
		provided order parameters.

		@param _taker The address of the order taker.
		@param _order The order to perform parameter validation against.

		@return _ Whether or not the specified `_order` is valid to be fulfilled by 
			the `_taker`.
	*/
	function _validateOrderParameters (
		address _taker,
		Entities.Order memory _order
	) private view returns (bool) {

		// Verify that the order is targeted at this exchange contract.
		if (_order.outline.exchange != address(this)) {
			return false;
		}

		/*
			Verify that the order maker is not the `_taker`, nor the msg.sender, nor 
			the zero address.
		*/
		if (
			_order.outline.maker == _taker ||
			_order.outline.maker == msg.sender ||
			_order.outline.maker == address(0)
		) {
			return false;
		}

		/*
			In a typical Wyvern order flow, this is the point where one would ensure 
			that the order target exists. This is done to prevent the low-hanging 
			attack of a malicious item collection self-destructing and rendering 
			orders worthless. This protection uses a not-insignificant amount of gas 
			and does not prevent against additional malicious attacks such as 
			front-running from an upgradeable contract. Given the number of other 
			possible rugpulls that an item collection could pull against its holders, 
			this seems like a reasonable trade-off.
		*/

		/*
			Allow the fulfillment of an order if the current block time is within the 
			listing and expiration time of that order, less a small gap to support 
			the case of immediate signature creation and fulfillment within a single 
			block.
		*/
		if (
			!Sales._canSettleOrder(
				_order.outline.listingTime - LUCKY_NUMBER,
				_order.outline.expirationTime
			)
		) {
			return false;
		}

		// Validate the call to ensure the correct function selector is being used.
		if (!_order.validateCall()) {
			return false;
		}

		// The order must possess a valid sale kind parameter.
		uint8 saleKind = uint8(_order.outline.saleKind);
		if (saleKind > 5) {
			return false;
		}

		// Reject item sales which are presented as buy-sided.
		if (saleKind < 3 && _order.outline.side == Sales.Side.Buy) {
			return false;
		}

		// Reject item offers which are presented as sell-sided.
		if (saleKind > 2 && _order.outline.side == Sales.Side.Sell) {
			return false;
		}

		/*
			There is no need to validate the `_taker` that may be later inserted into 
			the order call data for our `FixedPrice` or `DecreasingPrice` sale kinds. 
			In each of these cases, the message sender cannot achieve anything 
			malicious by attempting to modify the `_taker` which is later inserted 
			into the order.
		*/

		/*
			This sale kind is a `DirectListing`, which is meant to be a private 
			listing of an item fulfillable by a single specific taker. For this kind 
			of order, we validate that the `_taker` specified is the same as the 
			taker encoded in the order.
		*/
		if (saleKind == 2 && _taker != _order.outline.taker) {
			return false;
		}

		/*
			This sale kind is a `DirectOffer`, which is meant to be a private offer 
			fulfillable against only a single item by a single specific taker. In 
			other words, the offer does not follow the item if the item finds itself 
			in the hands of a new holder. For this kind of order, we validate that 
			the `_taker` is both the message sender and the taker encoded in the 
			order.
		*/
		if (
			saleKind == 3 &&
			(_order.outline.taker != msg.sender || _taker != _order.outline.taker)
		) {
			return false;
		}

		/*
			These two sale kinds correspond to `Offer` and `CollectionOffer`, each of 
			which are publically fulfillable by multiple potential takers. For 
			fulfilling these kinds of orders, the `_taker` specified must be the 
			message sender, lest an item holder be forced to accept an offer against 
			their will.
		*/
		if ((saleKind == 4 || saleKind == 5) && _taker != msg.sender) {
			return false;
		}

		// All is validated successfully.
		return true;
	}

	/**
		A helper function to validate an EIP-1271 contract signature.

		@param _orderMaker The smart contract maker of the order.
		@param _hash The hash of the order.
		@param _sig The signature of the order to validate.

		@return _ Whether or not `_sig` is a valid signature of `_hash` by the 
			`_orderMaker` smart contract.
	*/
	function _recoverContractSignature (
		address _orderMaker,
		bytes32 _hash,
		Entities.Sig memory _sig
	) private view returns (bool) {
		bytes memory isValidSignatureData = abi.encodeWithSelector(
			EIP_1271_SELECTOR,
			_hash,
			abi.encodePacked(_sig.r, _sig.s, _sig.v)
		);

		/*
			Call the `_orderMaker` smart contract and check for the specific magic 
			EIP-1271 result.
		*/
		bytes4 result;
		assembly {
			let success := staticcall(
				
				// Forward all available gas.
				gas(),
				_orderMaker,
		
				// The calldata offset comes after length.
				add(isValidSignatureData, 0x20),

				// Load calldata length.
				mload(isValidSignatureData), // load calldata length

				// Do not use memory for return data.
				0,
				0
			)

			/*
				If the call failed, copy return data to memory and pass through revert 
				data.
			*/
			if iszero(success) {
				returndatacopy(0, 0, returndatasize())
				revert(0, returndatasize())
			}

			/*
				If the return data is the expected size, copy it to memory and load it 
				to our `result` on the stack.
			*/
			if eq(returndatasize(), 0x20) {
				returndatacopy(0, 0, 0x20)
				result := mload(0)
			}
		}

		// If the collected result is the expected selector, the signature is valid.
		return result == EIP_1271_SELECTOR;
	}

	/**
		Validate that a provided order `_hash` does not correspond to a finalized 
		order, was not created with an invalidated nonce, and was actually signed 
		by its maker `_maker` with signature `_sig`.

		@param _hash A hash of an `Order` to validate.
		@param _maker The address of the maker who signed the order `_hash`.
		@param _nonce A nonce in the order for checking validity in 
			mass-cancelation.
		@param _sig The ECDSA signature of the order `_hash`, which must have been 
			signed by the order `_maker`.

		@return _ Whether or not the specified order `_hash` is authenticated as 
			valid to continue fulfilling.
	*/
	function _authenticateOrder (
		bytes32 _hash,
		address _maker,
		uint256 _nonce,
		Entities.Sig calldata _sig
	) private view returns (bool) {

		// Verify that the order has not already been canceled or fulfilled.
		if (cancelledOrFinalized[_hash]) {
			return false;
		}

		// Verify that the order was not createed with an expired nonce.
		if (_nonce < minOrderNonces[_maker]) {
			return false;
		}

		/* EOA-only authentication: ECDSA-signed by maker. */
		// Verify that the order hash was actually signed by the provided `_maker`.
		if (ecrecover(_hash, _sig.v, _sig.r, _sig.s) == _maker) {
			return true;
		}

		/*
			If the `_maker` is a smart contract, recover an EIP-1271 contract 
			signature for attempted authentication.
		*/
		if (Address.isContract(_maker)) {
			return _recoverContractSignature(_maker, _hash, _sig);
		}

		/*
			The signature is not validated against either an EOA or smart contract 
			signer and is therefore not valid.
		*/
		return false;
	}

	/**
		Execute all ERC-20 token or Ether transfers associated with an order match, 
		paid for by the message sender.

		@param _order The order whose payment is being matched.
		@param _royaltyIndex Th

		@return _ The amount of payment required for order fulfillment in ERC-20 
			token or Ether.

		@custom:throws NotEnoughValueSent if message value is insufficient to cover 
			an Ether payment.
	*/
	function _pay (
		Entities.Order memory _order,
		uint256 _royaltyIndex
	) private returns (uint256) {

		/*
			If the order being fulfilled is an offer, the message sender is the party 
			selling an item. If the order being fulfilled is a listing, the message 
			sender is the party buying an item.
		*/
		(address seller, address buyer) = _order.outline.side == Sales.Side.Buy
			? (msg.sender, _order.outline.maker)
			: (_order.outline.maker, msg.sender);

		// Calculate a total price for fulfilling the order.
		uint256 requiredAmount = Sales._calculateFinalPrice(
			_order.outline.saleKind,
			_order.outline.basePrice,
			_order.extra,
			_order.outline.listingTime
		);

		// If the amount required for order fulfillment is not zero, then transfer.
		if (requiredAmount > 0) {

			/*
				Track the amount of payment that the seller will ultimately receive 
				after fees are deducted.
			*/
			uint256 receiveAmount = requiredAmount;

			// Handle a payment in ERC-20 token.
			if (_order.outline.paymentToken != address(0)) {

				// Store the token transfer proxy in memory to save gas.
				TokenTransferProxy proxy = tokenTransferProxy;

				/*
					Store fee configuration and charge platform fees. Platform fees are 
					configured in basis points.
				*/
				uint256 config = _protocolFee;
				if (uint96(config) != 0) {
					uint256 fee = (requiredAmount * uint96(config)) / 10_000;

					/*
						Extract the fee recipient address from the fee configuration and 
						transfer the platform fee. Deduct the fee from the maker's receipt.
					*/
					proxy.transferERC20(
						_order.outline.paymentToken,
						buyer,
						address(uint160(config >> 96)),
						fee
					);
					receiveAmount -= fee;
				}

				// Charge creator royalty fees based on the royalty index.
				config = royalties[_order.outline.target][_royaltyIndex];
				if (uint96(config) != 0) {
					uint256 fee = (requiredAmount * uint96(config)) / 10_000;

					/*
						Extract the fee recipient address from the fee configuration and 
						transfer the royalty fee. Deduct the fee from the maker's receipt.
					*/
					proxy.transferERC20(
						_order.outline.paymentToken,
						buyer,
						address(uint160(config >> 96)),
						fee
					);
					receiveAmount -= fee;
				}

				// Transfer the remainder of the payment to the item seller.
				proxy.transferERC20(
					_order.outline.paymentToken,
					buyer,
					seller,
					receiveAmount
				);

			// Handle a payment in Ether.
			} else {
				if (msg.value < requiredAmount) {
					revert NotEnoughValueSent();
				}

				/*
					Store fee configuration and charge platform fees. Platform fees are 
					configured in basis points.
				*/
				uint256 config = _protocolFee;
				if (uint96(config) != 0) {
					uint256 fee = (requiredAmount * uint96(config)) / 10_000;

					/*
						Extract the fee recipient address from the fee configuration and 
						transfer the platform fee. Deduct the fee from the maker's receipt.
					*/
					address(uint160(config >> 96)).transferEth(fee);
					receiveAmount -= fee;
				}

				// Charge creator royalty fees based on the the royalty index.
				config = royalties[_order.outline.target][_royaltyIndex];
				if (uint96(config) != 0) {
					uint256 fee = (requiredAmount * uint96(config)) / 10_000;

					/*
						Extract the fee recipient address from the fee configuration and 
						transfer the royalty fee. Deduct the fee from the maker's receipt.
					*/
					address(uint160(config >> 96)).transferEth(fee);
					receiveAmount -= fee;
				}

				// Transfer the remainder of the payment to the item seller.
				seller.transferEth(receiveAmount);
			}
		}

		// Return the required payment amount.
		return requiredAmount;
	}

	/**
		Perform the exchange of an item for an ERC-20 token or Ether in fulfilling 
		the given `_order`.

		@param _taker The address of the caller who fulfills the order.
		@param _order The `Order` to execute.
		@param _signature The signature provided for fulfilling the order, signed 
			by the order maker.
		@param _tokenId The unique token ID of the item involved in the order.

		@custom:throws InvalidOrder if the order parameters cannot be validated.
		@custom:throws CannotAuthenticateOrder if the order parameters cannot be 
			authenticated.
		@custom:throws UserProxyDoesNotExist if the targeted delegate proxy for the 
			user does not exist.
		@custom:throws UnknownUserProxyImplementation if the targeted delegate 
			proxy implementation is not as expected.
		@custom:throws CallToProxyFailed if the encoded call to the proxy fails.
	*/
	function _exchange (
		address _taker,
		Entities.Order memory _order,
		Entities.Sig calldata _signature,
		uint256 _tokenId
	) internal {

		// Retrieve the order hash.
		bytes32 hash = _hashToSign(_order);

		// Validate the order.
		if (!_validateOrderParameters(_taker, _order)) {
			revert InvalidOrder();
		}

		// Authenticate the order.
		if (
			!_authenticateOrder(
				hash,
				_order.outline.maker,
				_order.nonce,
				_signature
			)
		) { 
			revert CannotAuthenticateOrder();
		}

		// Store the registry object in memory to save gas.
		IProxyRegistry proxyRegistry = registry;

		/*
			Retrieve the delegate proxy address and implementation contract address 
			of the side of the order exchanging their item for an ERC-20 token or 
			Ether.
		*/
		(address delegateProxy, address implementation) = proxyRegistry
			.userProxyConfig(
				_order.outline.side == Sales.Side.Buy
					? msg.sender
					: _order.outline.maker
			);

		// Verify that the user's delegate proxy exists.
		if (!Address.isContract(delegateProxy)) {
			revert UserProxyDoesNotExist();
		}

		// Verify that the implementation of the user's delegate proxy is expected.
		if (
			OwnableDelegateProxy(payable(delegateProxy)).implementation() !=
			implementation
		) {
			revert UnknownUserProxyImplementation();
		}

		// Access the passthrough `AuthenticatedProxy` to make transfer calls.
		AuthenticatedProxy proxy = AuthenticatedProxy(payable(delegateProxy));

		// Populate the order call data depending on the sale type.
		_order.generateCall(_taker, _tokenId);

		/*
			Perform the encoded call against the delegate proxy and verify that it 
			succeeded.
		*/
		if (
			!proxy.call(
				_order.outline.target,
				AuthenticatedProxy.CallType.Call,
				_order.data
			)
		) {
			revert CallToProxyFailed();
		}

		/*
			Fulfill order payment and refund the message sender if needed. The first 
			element of the order extra field contains the royalty index corresponding 
			to the collection royalty fee that was created at the time of order 
			signing.
		*/
		uint256 price = _pay(_order, _order.extra[0]);
		if (msg.value > price) {
			msg.sender.transferEth(msg.value - price);
		}

		// Mark the order as finalized.
		cancelledOrFinalized[hash] = true;

		// Condense order settlement status for event emission.
		bytes memory settledParameters = abi.encodePacked(
			_order.outline.saleKind,
			price,
			_order.outline.target,
			_order.data,
			bytes1(0xFF)
		);

		// Emit an event with the results of this order.
		emit OrderResult(
			hash,
			_order.outline.maker,
			_taker,
			settledParameters
		);
	}

	/**
		A helper function to emit an `OrderResult` event while avoiding a 
		stack-depth error.

		@param _recipient The address which will receive the item.
		@param _order The `Order` to execute.
		@param _hash The hash of the order.
		@param _code Error codes for the reason of order failure.
		@param _price The price at which the order was fulfilled.
	*/
	function _emitResult (
		address _recipient,
		Entities.Order memory _order,
		bytes32 _hash,
		bytes1 _code,
		uint256 _price
	) private {
		emit OrderResult(
			_hash,
			_order.outline.maker,
			_recipient,
			abi.encodePacked(
				_order.outline.saleKind,
				_price,
				_order.outline.target,
				_order.data,
				_code
			)
		);
	}

	/**
		Find similiar existing payment token addresses and increases their amount.
		If payment tokens are not found, create a new payment element.

		@param _payments An array to accumulate payment elements.
		@param _paymentToken The payment token used in fulfilling the order.
		@param _recipient The order maker.
		@param _price The price of fulfilling the order.
	*/
	function _insert (
		bytes memory _payments,
		address _paymentToken,
		uint256 _recipient,
		uint256 _price
	) private pure {
		assembly {

			// Iterate through the `_payments` array in chunks of size 0x60.
			let len := div(mload(add(_payments, 0x00)), 0x60)
			let found := false
			for {
				let i := 0
			} lt(i, len) {
				i := add(i, 1)
			} {

				/*
					Load the token at this position of the array. If it is equal to the 
					payment token, check the payment destination.
				*/
				let token := mload(add(_payments, add(mul(i, 0x60), 0x20)))
				if eq(token, _paymentToken) {
					let offset := add(_payments, add(mul(i, 0x60), 0x60))

					/*
						If the payment destination is the recipient, increase the amount 
						they are already being paid.
					*/
					let to := mload(add(_payments, add(mul(i, 0x60), 0x40)))
					if eq(to, _recipient) {
						let amount := mload(offset)
						mstore(offset, add(amount, _price))
						found := true
					}
				}
			}

			// If the payment recipient was not found, insert their payment.
			if eq(found, 0) {
				switch len

				/*
					In the event of the initial insert, we've already allocated 0x20 
					bytes and only need to allocate 0x40 more to fit our three payment 
					variables.
				*/
				case 0 {
					mstore(
						add(_payments, 0x00),
						add(mload(add(_payments, 0x00)), 0x40)
					)
				}

				// Increase the size of the array by 0x60.
				default {
					mstore(
						add(_payments, 0x00),
						add(mload(add(_payments, 0x00)), 0x60)
					)
				}

				// Store the payment token, recipient, and amount.
				let offset := add(_payments, mul(len, 0x60))
				mstore(add(offset, 0x20), _paymentToken)
				mstore(add(offset, 0x40), _recipient)
				mstore(add(offset, 0x60), _price)
			}
		}
	}

	/**
		Generates a unique payment token transfer calls and adds it to the 
		`_payments` array.

		@param _payments An array to accumulate payment elements.
		@param _paymentToken The payment token used in fulfilling the order.
		@param _royaltyIndex The index of the royalty for the item collection with 
			which royalty fees should be calculated.
		@param _recipient The order maker.
		@param _price The price of fulfilling the order.
		@param _collection The item collection address.
	*/
	function _addPayment (
		bytes memory _payments,
		address _paymentToken,
		uint256 _royaltyIndex,
		uint256 _recipient,
		uint256 _price,
		address _collection
	) private view {
		uint256 finalPrice = _price;

		// Insert the protocol fee.
		uint256 config = _protocolFee;
		if (uint96(config) != 0) {
			unchecked {
				uint256 fee = (_price * uint96(config)) / 10_000;
				config = (config >> 96);
				_insert(_payments, _paymentToken, config, fee);
				finalPrice -= fee;
			}
		}

		// Insert the royalty payment.
		config = royalties[_collection][_royaltyIndex];
		if (uint96(config) != 0) {
			unchecked {
				uint256 fee = (_price * uint96(config)) / 10_000;
				config = (config >> 96);
				_insert(_payments, _paymentToken, config, fee);
				finalPrice -= fee;
			}
		}

		// Insert the final payment to the end recipient into the payment array.
		_insert(_payments, _paymentToken, _recipient, finalPrice);
	}

	/**
		Executes orders in the context of fulfilling potentially-multiple item 
		listings. This function cannot be used for fulfilling offers. This function 
		accumulates payment information in `_payments` for single-shot processing.

		@param _recipient The address which will receive the item.
		@param _order The `Order` to execute.
		@param _signature The signature provided for fulfilling the order, signed 
			by the order maker.
		@param _payments An array for accumulating payment information.
	*/
	function _exchangeUnchecked (
		address _recipient,
		Entities.Order memory _order,
		Entities.Sig calldata _signature,
		bytes memory _payments
	) internal {

		// Retrieve the order hash.
		bytes32 hash = _hashToSign(_order);
		{

			// Validate the order.
			if (!_validateOrderParameters(_recipient, _order)) {
				_emitResult(_recipient, _order, hash, 0x11, 0);
				return;
			}

			// Authenticate the order.
			if (
				!_authenticateOrder(
					hash,
					_order.outline.maker,
					_order.nonce,
					_signature
				)
			) {
				_emitResult(_recipient, _order, hash, 0x12, 0);
				return;
			}

			// Store the registry object in memory to save gas.
			IProxyRegistry proxyRegistry = registry;

			/*
				Retrieve the delegate proxy address and implementation contract address 
				of the side of the order exchanging their item for an ERC-20 token or 
				Ether.
			*/
			(address delegateProxy, address implementation) = proxyRegistry
				.userProxyConfig(_order.outline.maker);

			// Verify that the user's delegate proxy exists.
			if (!Address.isContract(delegateProxy)) {
				_emitResult(_recipient, _order, hash, 0x43, 0);
				return;
			}

			// Verify the implementation of the user's delegate proxy is expected.
			if (
				OwnableDelegateProxy(payable(delegateProxy)).implementation() !=
				implementation
			) {
				_emitResult(_recipient, _order, hash, 0x44, 0);
				return;
			}

			// Access the passthrough `AuthenticatedProxy` to make transfer calls.
			AuthenticatedProxy proxy = AuthenticatedProxy(payable(delegateProxy));

			// Populate the order call data depending on the sale type.
			_order.generateCall(_recipient, 0);

			/*
				Perform the encoded call against the delegate proxy and verify that it 
				succeeded.
			*/
			if (
				!proxy.call(
					_order.outline.target,
					AuthenticatedProxy.CallType.Call,
					_order.data
				)
			) {
				_emitResult(_recipient, _order, hash, 0x50, 0);
				return;
			}
		}
		{

			// Calculate a total price for fulfilling the order.
			uint256 price = Sales._calculateFinalPrice(
				_order.outline.saleKind,
				_order.outline.basePrice,
				_order.extra,
				_order.outline.listingTime
			);

			// Add the calculated price to the payments accumulator.
			_addPayment(
				_payments,
				_order.outline.paymentToken,
				_order.extra[0],
				uint256(uint160(_order.outline.maker)),
				price,
				_order.outline.target
			);

			// Mark the order as finalized and emit the final result.
			cancelledOrFinalized[hash] = true;
			_emitResult(_recipient, _order, hash, 0xFF, price);
		}
	}

	/**
		Execute all payments from the provided `_payments` array.

		@param _payments A bytes array of accumulated payment data, populated by 
			`_exchangeUnchecked` and `_addPayment`.
		@param _buyer The caller paying to fulfill these payments.
		@param _proxy The address of a token transfer proxy.
	*/
	function _pay (
		bytes memory _payments,
		address _buyer,
		address _proxy
	) internal {
		bytes4 sig = TokenTransferProxy.transferERC20.selector;
		uint256 ethPayment;
		assembly {

			/*
				Take the `_payments` and determine the length in discrete chunks of 
				size 0x60. Iterate through each chunk.
			*/
			let len := div(mload(add(_payments, 0x00)), 0x60)
			for {
				let i := 0
			} lt(i, len) {
				i := add(i, 1)
			} {

				// Extract the token, to, and amount tuples from the array chunks.
				let token := mload(add(_payments, add(mul(i, 0x60), 0x20)))
				let to := mload(add(_payments, add(mul(i, 0x60), 0x40)))
				let amount := mload(add(_payments, add(mul(i, 0x60), 0x60)))
				
				// Switch and handle the case of sending and accumulating Ether.
				switch token
				case 0 {
					ethPayment := add(ethPayment, amount)

					/*
						Attempt to pay `amount` Ether to the `to` destination, reverting if 
						unsuccessful.
					*/
					let result := call(gas(), to, amount, 0, 0, 0, 0)
					if iszero(result) {
						revert(0, 0)
					}
				}

				// Handle the case of ERC-20 token transfers.
				default {

					// Create a pointer at position 0x40.
					let data := mload(0x40)

					/*
						Create a valid `transferERC20` payload in data. TransferERC20 takes 
						as parameters `_token`, `_from`, `_to`, and `_amount`.
					*/
					mstore(data, sig)
					mstore(add(data, 0x04), token)
					mstore(add(data, 0x24), _buyer)
					mstore(add(data, 0x44), to)
					mstore(add(data, 0x64), amount)

					/*
						Attempt to execute the ERC-20 transfer, reverting upon failure. The 
						size of the data is 0x84.
					*/
					let result := call(gas(), _proxy, 0, data, 0x84, 0, 0)
					if iszero(result) {
						revert(0, 0)
					}
				}
			}
		}

		// Refund any excess Ether to the buyer.
		if (msg.value > ethPayment) {
			_buyer.transferEth(msg.value - ethPayment);
		}
	}
}

File 4 of 21 : Entities.sol
// SPDX-License-Identifier: AGPL-3.0-only
pragma solidity ^0.8.15;

import "../libraries/Sales.sol";
import "../proxy/AuthenticatedProxy.sol";

/**
	@custom:benediction DEVS BENEDICAT ET PROTEGAT CONTRACTVS MEAM
	@title Entities Library
	@author Rostislav Khlebnikov <@catpic5buck>
	@custom:contributor Tim Clancy <@_Enoch>

	A library for managing supported order entities and helper functions.

	@custom:date December 4th, 2022.
*/
library Entities {

	/// The function selector for an ERC-1155 transfer.
	bytes4 internal constant _ERC1155_TRANSFER_SELECTOR = 0xf242432a;

	/// The function selector for an ERC-721 transfer.
	bytes4 internal constant _ERC721_TRANSFER_SELECTOR = 0x23b872dd;

	/// The EIP-712 typehash of an order outline.
	bytes32 public constant OUTLINE_TYPEHASH =
		keccak256(
			"Outline(uint256 basePrice,uint256 listingTime,uint256 expirationTime,address exchange,address maker,uint8 side,address taker,uint8 saleKind,address target,uint8 callType,address paymentToken)"
		);

	/// The EIP-712 typehash of an order.
	bytes32 public constant ORDER_TYPEHASH =
		keccak256(
			"Order(uint256 nonce,Outline outline,uint256[] extra,bytes data)Outline(uint256 basePrice,uint256 listingTime,uint256 expirationTime,address exchange,address maker,uint8 side,address taker,uint8 saleKind,address target,uint8 callType,address paymentToken)"
		);

	/**
		A struct for supporting internal Order details in order to avoidd 
		stack-depth issues.

		@param basePrice The base price of the order in `paymentToken`. This is the 
			price of fulfillment for static sale kinds. This is the starting price 
			for `DecreasingPrice` sale kinds.
		@param listingTime The listing time of the order.
		@param expirationTime The expiration time of the order.
		@param exchange The address of the exchange contract, intended as a 
			versioning mechanism if the exchange is upgraded.
		@param maker The address of the order maker.
		@param side The sale side of the deal (Buy or Sell). This is a handy flag 
			for determining which delegate proxy to use depending for participants on 
			different ends of the order.
		@param taker The order taker address if one is specified. This 
			spepcification is only honored in `DirectListing` and `DirectOffer` sale 
			kinds; in other cases we write dynamic addresses.
		@param saleKind The kind of sale to fulfill in this order.
		@param target The target of the order. This should be the address of an 
			item collection to perform a transfer on.
		@param callType The type of proxy call to perform in fulfilling this order.
		@param paymentToken The address of an ERC-20 token used to pay for the 
			order, or the zero address to fulfill payment with Ether.
	*/
	struct Outline {
		uint256 basePrice;
		uint256 listingTime;
		uint256 expirationTime;
		address exchange;
		address maker;
		Sales.Side side;
		address taker;
		Sales.SaleKind saleKind;
		address target;
		AuthenticatedProxy.CallType callType;
		address paymentToken;
	}

	/**
		A struct for managing an order on the exchange.

		@param nonce The order nonce used to prevent duplicate order hashes.
		@param outline A struct of internal order details.
		@param extra An array of extra order information. The first element of this 
			array should be the index for on-chain royalties of the collection 
			involved in the order. In the event of a `DecreasingPrice` sale kind, the 
			second element should be the targeted floor price of the listing and the 
			third element should be the time at which the floor price is reached.
		@param data The call data of the order.
	*/
	struct Order {
		uint256 nonce;
		Outline outline;
		uint256[] extra;
		bytes data;
	}

	/**
		A struct for an ECDSA signature.

		@param v The v component of the signature.
		@param r The r component of the signature.
		@param s The s component of the signature.
	*/
	struct Sig {
		uint8 v;
		bytes32 r;
		bytes32 s;
	}

	/**
		A helper function to hash the outline of an `Order`.

		@param _outline The outline of an `Order` to hash.

		@return _ A hash of the order outline.
	*/
	function _hash (
		Outline memory _outline
	) private pure returns (bytes32) {
		return keccak256(
			abi.encode(
				OUTLINE_TYPEHASH,
				_outline.basePrice,
				_outline.listingTime,
				_outline.expirationTime,
				_outline.exchange,
				_outline.maker,
				_outline.side,
				_outline.taker,
				_outline.saleKind,
				_outline.target,
				_outline.callType,
				_outline.paymentToken
			)
		);
	}

	/**
		Hash an order and return the canonical order hash without a message prefix.

		@param _order The `Order` to hash.

		@return _ The hash of `_order`.
	*/
	function hash (
		Order memory _order
	) internal pure returns (bytes32) {
		return keccak256(
			abi.encode(
				ORDER_TYPEHASH,
				_order.nonce,
				_hash(_order.outline),
				keccak256(abi.encodePacked(_order.extra)),
				keccak256(_order.data)
			)
		);
	}

	/**
		Validate the selector of the call data of the provided `Order` `_order`. 
		This prevents callers from executing arbitrary functions; only attempted 
		transfers. The transfers may still be arbitrary and malicious, however.

		@param _order The `Order` to validate the call data selector for.

		@return _ Whether or not the call has been validated.
	*/
	function validateCall (
		Order memory _order
	) internal pure returns (bool) {
		bytes memory data = _order.data;

		/*
			Retrieve the selector and verify that it matches either of the ERC-721 or 
			ERC-1155 transfer functions.
		*/
		bytes4 selector;
		assembly {
			selector := mload(add(data, 0x20))
		}
		return
			selector == _ERC1155_TRANSFER_SELECTOR ||
			selector == _ERC721_TRANSFER_SELECTOR;
	}

	/**
		Populate the call data of the provided `Order` `_order` with the `_taker` 
		address and item `_tokenId` based on the kind of sale specified in the 
		`_order`.

		This function uses assembly to directly manipulate the order data. The 
		offsets are determined based on the length of the order data array and the 
		location of the call parameter being inserted.

		In both the ERC-721 `transferFrom` function and the ERC-1155 
		`safeTransferFrom` functions, the `_from` address is the first parameter, 
		the `_to` address is the second parameter and the `_tokenId` is the third 
		parameter.

		The length of the order data is always 0x20 and the function selector is 
		0x04. Therefore the first parameter begins at 0x24. The second parameter 
		lands at 0x44, and the third parameter lands at 0x64. Depending on the sale 
		kind of the order, this function inserts any required dynamic information 
		into the order data.

		@param _order The `Order` to populate call data for based on its sale kind.
		@param _taker The address of the caller who fulfills the order.
		@param _tokenId The token ID of the item involved in the `_order`.

		@param data The order call data with the new fields inserted as needed.
	*/
	function generateCall (
		Order memory _order,
		address _taker,
		uint256 _tokenId
	) internal pure returns (bytes memory data) {

		data = _order.data;
		uint8 saleKind = uint8(_order.outline.saleKind);
		assembly {
			switch saleKind

			/*
				In a `FixedPrice` order, insert the `taker` address as the `_to` 
				parameter in the transfer call.
			*/
			case 0 {
				mstore(add(data, 0x44), _taker)
			}

			/*
				In a `DecreasingPrice` order, insert the `taker` address as the `_to` 
				parameter in the transfer call.
			*/
			case 1 {
				mstore(add(data, 0x44), _taker)
			}

			/*
				In an `Offer` order, insert the `taker` address as the `_from` 
				parameter in the transfer call.
			*/
			case 4 {
				mstore(add(data, 0x24), _taker)
			}

			/*
				In a `CollectionOffer` order, insert the `taker` address as the 
				`_from` parameter and the `_tokenId` as the `_tokenId` parameter in the 
				transfer call.
			*/
			case 5 {
				mstore(add(data, 0x24), _taker)
				mstore(add(data, 0x64), _tokenId)
			}

			/*
				In the `DirectListing` and `DirectOffer` sale kinds, all elements of 
				the order are fully specified and no generation occurs.
			*/
			default {
			}
		}
	}
}

File 5 of 21 : RoyaltyManager.sol
// SPDX-License-Identifier: AGPL-3.0-only
pragma solidity ^0.8.15;

import {
	BaseFeeManager
} from "./BaseFeeManager.sol";
import {
	EIP712
} from "../libraries/EIP712.sol";

/// Thrown if attempting to set the validator address to zero.
error ValidatorAddressCannotBeZero ();

/// Thrown if the signature provided by the validator is expired.
error SignatureExpired ();

/// Thrown if the signature provided by the validator is invalid.
error BadSignature ();

/**
	@custom:benediction DEVS BENEDICAT ET PROTEGAT CONTRACTVS MEAM
	@title GigaMart Royalty Manager
	@author Rostislav Khlebnikov <@catpic5buck>
	@custom:contributor Tim Clancy <@_Enoch>

	A contract for providing an EIP-712 signature-based approach for on-chain 
	direct royalty payments with royalty management as gated by an off-chain 
	validator.

	This approach to royalty management is a point of centralization on GigaMart. 
	The validator key gives its controller the ability to arbitrarily change 
	collection royalty fees.

	This approach is justified based on the fact that it allows GigaMart to offer 
	a gas-optimized middle ground where royalty fees are paid out directly to 
	collection owners while still allowing an arbitrary number of collection 
	administrators to manage collection royalty fees based on off-chain role 
	management semantics.

	@custom:date December 4th, 2022.
*/
abstract contract RoyaltyManager is EIP712, BaseFeeManager {

	/// The public identifier for the right to change the validator address.
	bytes32 public constant VALIDATOR_SETTER = keccak256("VALIDATOR_SETTER");

	/// The EIP-712 typehash of a royalty update.
	bytes32 public constant ROYALTY_TYPEHASH =
		keccak256(
			"Royalty(address setter,address collection,uint256 deadline,uint256 newRoyalties)"
		);

	/// The address of the off-chain validator.
	address internal validator;

	/**
		A double mapping of collection address to index to royalty percent. This 
		allows makers to securely sign their orders safe in the knowledge that 
		royalty fees cannot be altered from beneath them.
	*/
	mapping ( address => mapping ( uint256 => uint256 )) public royalties;
	
	/// A mapping of collection addresses to the current royalty index.
	mapping ( address => uint256 ) public indices;

	/**
		Emitted after altering the royalty fee of a collection.

		@param setter The address which altered the royalty fee.
		@param collection The collection which had its royalty fee altered.
		@param oldRoyalties The old royalty fee of the collection.
		@param newRoyalties The new royalty fee of the collection.
	*/
	event RoyaltyChanged (
		address indexed setter,
		address indexed collection,
		uint256 oldRoyalties,
		uint256 newRoyalties
	);

	/**
		Construct a new instance of the GigaMart royalty fee manager.

		@param _validator The address to use as the royalty change validation 
			signer.
		@param _protocolFeeRecipient The address which receives protocol fees.
		@param _protocolFeePercent The percent in basis points of the protocol fee.
	*/
	constructor (
		address _validator,
		address _protocolFeeRecipient,
		uint96 _protocolFeePercent
	) BaseFeeManager(_protocolFeeRecipient, _protocolFeePercent) {
		validator = _validator;
	}

	/**
		Returns the current royalty fees of a collection.

		@param _collection The collection to return the royalty fees for.

		@return _ A tuple pairing the address of a collection fee recipient with 
			the actual royalty fee.
	*/
	function currentRoyalties (
		address _collection
	) external view returns (address, uint256) {
		uint256 fee = royalties[_collection][indices[_collection]];

		// The fee is a packed address-fee pair into a single 256 bit integer.
		return (address(uint160(fee >> 96)), uint256(uint96(fee)));
	}

	/**
		Change the `validator` address.

		@param _validator The new `validator` address to set.

		@custom:throws ValidatorAddressCannotBeZero if attempting to set the 
			`validator` address to the zero address.
	*/
	function changeValidator (
		address _validator
	) external hasValidPermit(UNIVERSAL, VALIDATOR_SETTER) {
		if (_validator == address(0)) {
			revert ValidatorAddressCannotBeZero();
		}
		validator = _validator;
	}

	/**
		Generate a hash from the royalty changing parameters.
		
		@param _setter The caller setting the royalty changes.
		@param _collection The address of the collection for which royalties will 
			be altered.
		@param _deadline The time when the `_setter` loses the right to alter 
			royalties.
		@param _newRoyalties The new royalty information to set.

		@return _ The hash of the royalty parameters for checking signature 
			validation.
	*/
	function _hash (
		address _setter,
		address _collection,
		uint256 _deadline,
		uint256 _newRoyalties
	) internal view returns (bytes32) {
		return keccak256(
			abi.encodePacked(
				"\x19\x01",
				_deriveDomainSeparator(),
				keccak256(
					abi.encode(
						ROYALTY_TYPEHASH,
						_setter,
						_collection,
						_deadline,
						_newRoyalties
					)
				)
			)
		);
	}

	/**
		Update the royalty mapping for a collection with a new royalty.

		@param _collection The address of the collection for which `_newRoyalties` 
			are set.
		@param _deadline The time until which the `_signature` is valid.
		@param _newRoyalties The updated royalties to set.
		@param _signature A signature signed by the `validator`.

		@custom:throws BadSignature if the signature submitted for setting 
			royalties is invalid.
		@custom:throws SignatureExpired if the signature is expired.
	*/
	function setRoyalties (
		address _collection,
		uint256 _deadline,
		uint256 _newRoyalties,
		bytes calldata _signature
	) external {

		// Verify that the signature was signed by the royalty validator.
		if (
			_recover(
				_hash(msg.sender, _collection, _deadline, _newRoyalties),
				_signature
			) != validator
		) {
			revert BadSignature();
		}

		// Verify that the signature has not expired.
		if (_deadline < block.timestamp) {
			revert SignatureExpired();
		}
		
		/*
			Increment the current royalty index for the collection and update its 
			royalty information.
		*/
		uint256 oldRoyalties = royalties[_collection][indices[_collection]];
		indices[_collection]++;
		royalties[_collection][indices[_collection]] = _newRoyalties;

		// Emit an event notifying about the royalty change.
		emit RoyaltyChanged(msg.sender, _collection, oldRoyalties, _newRoyalties);
	}
}

File 6 of 21 : NativeTransfer.sol
// SPDX-License-Identifier: AGPL-3.0-only
pragma solidity ^0.8.15;

/// Emitted in the event that transfer of Ether fails.
error TransferFailed ();

/**
	@custom:benediction DEVS BENEDICAT ET PROTEGAT CONTRACTVS MEAM
	@title Native Ether Transfer Library
	@author Rostislav Khlebnikov <@catpic5buck>
	@custom:contributor Tim Clancy <@_Enoch>

	A library for safely conducting Ether transfers and verifying success.

	@custom:date December 4th, 2022.
*/
library NativeTransfer {

	/**
		A helper function for wrapping a low-level Ether transfer call with modern 
		error reversion.

		@param _to The address to send Ether to.
		@param _value The value of Ether to send to `_to`.

		@custom:throws TransferFailed if the transfer of Ether fails.
	*/
	function transferEth (
		address _to,
		uint _value
	) internal {
		(bool success, ) = _to.call{ value: _value }("");
		if (!success) {
			revert TransferFailed();
		}
	}
}

File 7 of 21 : OwnableDelegateProxy.sol
// SPDX-License-Identifier: AGPL-3.0-only
pragma solidity ^0.8.15;

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

import "./DelegateProxy.sol";

/// Thrown if the initial delgate call from this proxy is not successful.
error InitialTargetCallFailed ();

/**
	@custom:benediction DEVS BENEDICAT ET PROTEGAT CONTRACTVS MEAM
	@title Ownable Delegate Proxy
	@author Protinam, Project Wyvern
	@author Tim Clancy <@_Enoch>
	@author Rostislav Khlebnikov <@catpic5buck>

	A call-delegating proxy with an owner. This contract was originally developed 
	by Project Wyvern. It has been modified to support a more modern version of 
	Solidity with associated best practices. The documentation has also been 
	improved to provide more clarity.

	@custom:date December 4th, 2022.
*/
contract OwnableDelegateProxy is Ownable, DelegateProxy {

	/// Whether or not the proxy was initialized.
	bool public initialized;

	/**
		This is a storage escape slot to match `AuthenticatedProxy` storage.
		uint8(bool) + uint184 = 192 bits. This prevents target (160 bits) from
		being placed in this storage slot.
	*/
	uint184 private _escape;

	/// The address of the proxy's current target.
	address public target;

	/**
		Construct this delegate proxy with an owner, initial target, and an initial
		call sent to the target.

		@param _owner The address which should own this proxy.
		@param _target The initial target of this proxy.
		@param _data The initial call to delegate to `_target`.

		@custom:throws InitialTargetCallFailed if the proxy initialization call 
			fails.
	*/
	constructor (
		address _owner,
		address _target,
		bytes memory _data
	) {
	
		/*
			Do not perform a redundant ownership transfer if the deployer should remain as the owner of this contract.
		*/
		if (_owner != owner()) {
			transferOwnership(_owner);
		}
		target = _target;

		/**
			Immediately delegate a call to the initial implementation and require it 
			to succeed. This is often used to trigger some kind of initialization 
			function on the target.
		*/
		(bool success, ) = _target.delegatecall(_data);
		if (!success) {
			revert InitialTargetCallFailed();
		}
	}

	/**
		Return the current address where all calls to this proxy are delegated. If
		`proxyType()` returns `1`, ERC-897 dictates that this address MUST not
		change.

		@return _ The current address where calls to this proxy are delegated.
	*/
	function implementation () public view override returns (address) {
		return target;
	}
}

File 8 of 21 : TokenTransferProxy.sol
// SPDX-License-Identifier: AGPL-3.0-only
pragma solidity ^0.8.15;

import "@openzeppelin/contracts/token/ERC20/utils/SafeERC20.sol";

import "../interfaces/IProxyRegistry.sol";

/**
	@custom:benediction DEVS BENEDICAT ET PROTEGAT CONTRACTVS MEAM
	@title Token Transfer Proxy
	@author Project Wyvern Developers
	@author Tim Clancy <@_Enoch>
	@custom:contributor Rostislav Khlebnikov <@catpic5buck>

	A token transfer proxy contract. This contract was originally developed by 
	Project Wyvern. It has been modified to support a more modern version of 
	Solidity with associated best practices. The documentation has also been 
	improved to provide more clarity.

	@custom:date December 4th, 2022.
*/
contract TokenTransferProxy {
	using SafeERC20 for IERC20;

	/// The address of the immutable authentication registry.
	IProxyRegistry public immutable registry;

	/**
		Construct a new instance of this token transfer proxy given the associated 
		registry.

		@param _registry The address of a proxy registry.
	*/
	constructor (
		address _registry
	) {
		registry = IProxyRegistry(_registry);
	}

	/**
		Perform a transfer on a targeted ERC-20 token, rejecting unauthorized callers.

		@param _token The address of the ERC-20 token to transfer.
		@param _from The address to transfer ERC-20 tokens from.
		@param _to The address to transfer ERC-20 tokens to.
		@param _amount The amount of ERC-20 tokens to transfer.

		@custom:throws NonAuthorizedCaller if the caller is not authorized to 
			perform the ERC-20 token transfer.
	*/
	function transferERC20 (
		address _token,
		address _from,
		address _to,
		uint _amount
	) public {
		if (!registry.authorizedCallers(msg.sender)) {
			revert NonAuthorizedCaller();
		}
		IERC20(_token).safeTransferFrom(_from, _to, _amount);
	}
}

File 9 of 21 : Sales.sol
// SPDX-License-Identifier: AGPL-3.0-only
pragma solidity ^0.8.15;

/**
	@custom:benediction DEVS BENEDICAT ET PROTEGAT CONTRACTVS MEAM
	@title Sales Library
	@author Project Wyvern Developers
	@author Rostislav Khlebnikov <@catpic5buck>
	@custom:contributor Tim Clancy <@_Enoch>

	A library for managing supported sale types and sale helper functions.

	@custom:date December 4th, 2022.
*/
library Sales {

	/**
		An enum to track the possible sides of an order to be fulfilled.

		@param Buy A buy order is one in which an offer was made to buy an item.
		@param Sell A sell order is one in which a listing was made to sell an item.
	*/
	enum Side {
		Buy,
		Sell
	}

	/**
		An enum to track the different types of order that can be fulfilled.

		@param FixedPrice A listing of an item for sale by a seller at a static 
			price.
		@param DecreasingPrice A listing of an item for sale by a seller at a price 
			that decreases linearly each second based on extra fields specified in an 
			order.
		@param DirectListing A listing of an item for sale by a seller at a static 
			price fulfillable only by a single buyer specified by the seller.
		@param DirectOffer An offer with a static price made by a buyer for an item 
			owned by a specific seller.
		@param Offer An offer with a static price made by a buyer for an item. The 
			offer is valid no matter who the holder of the item is.
		@param CollectionOffer An offer with a static price made by a buyer for any 
			item in a collection. Any item holder in the collection may fulfill the 
			offer.
	*/
	enum SaleKind {
		FixedPrice,
		DecreasingPrice,
		DirectListing,
		DirectOffer,
		Offer,
		CollectionOffer
	}

	/**
		Return whether or not an order can be settled, verifying that the current
		block time is between order's initial listing and expiration time.

		@param _listingTime The starting time of the order being listed.
		@param _expirationTime The ending time where the order expires.
	*/
	function _canSettleOrder (
		uint _listingTime,
		uint _expirationTime
	) internal view returns (bool) {
		return
			(_listingTime < block.timestamp) &&
			(_expirationTime == 0 || block.timestamp < _expirationTime);
	}

	/**
		Calculate the final settlement price of an order.

		@param _saleKind The sale kind of an order.
		@param _basePrice The base price of the order.
		@param _extra Any extra price or time data for the order; for
			decreasing-price orders, `_extra[1]` is the floor price where price decay
			stops and `_extra[2]` is the timestamp at which the floor price is
			reached.
		@param _listingTime The listing time of the order.

		@return _ The final price of fulfilling an order.
	*/
	function _calculateFinalPrice (
		SaleKind _saleKind,
		uint _basePrice,
		uint[] memory _extra,
		uint _listingTime
	) internal view returns (uint) {

		/*
			If the sale type is a decreasing-price Dutch auction, then the price
			decreases each minute across its configured price range.
		*/
		if (_saleKind == SaleKind.DecreasingPrice) {

			/*
				If the timestamp at which price decrease concludes has been exceeded,
				the item listing price maintains its configured floor price.
			*/
			if (block.timestamp >= _extra[2]) {
				return _extra[1];
			}

			/*
				Calculate the portion of the decreasing total price that has not yet
				decayed.
			*/
			uint undecayed =

				// The total decayable portion of the price.
				(_basePrice - _extra[1]) *

				// The duration in seconds of the time remaining until total decay.
				(_extra[2] - block.timestamp) /

				/*
					The duration in seconds between the order listing time and the time
					of total decay.
				*/
				(_extra[2] - _listingTime);

			// Return the current price as the floor price plus the undecayed portion.
			return _extra[1] + undecayed;

		// In all other types of order sale, the price is entirely static.
		} else {
			return _basePrice;
		}
	}
}

File 10 of 21 : AuthenticatedProxy.sol
// SPDX-License-Identifier: AGPL-3.0-only
pragma solidity ^0.8.15;

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

import "../interfaces/IProxyRegistry.sol";

/**
	Thrown if attempting to initialize a proxy which has already been initialized.
*/
error ProxyAlreadyInitialized ();

/**
	@custom:benediction DEVS BENEDICAT ET PROTEGAT CONTRACTVS MEAM
	@title Authenticated Proxy
	@author Protinam, Project Wyvern
	@author Tim Clancy <@_Enoch>
	@custom:contributor Rostislav Khlebnikov <@catpic5buck>

	An ownable call-delegating proxy which can receive tokens and only make calls 
	against contracts that have been approved by a `ProxyRegistry`. This contract 
	was originally developed by Project Wyvern. It has been modified to support a 
	more modern version of Solidity with associated best practices. The 
	documentation has also been improved to provide more clarity.

	@custom:date December 4th, 2022.
*/
contract AuthenticatedProxy is Ownable {

	/**
		An enum for selecting the method by which we would like to perform a call 
		in the `proxy` function.
	*/
	enum CallType {
		Call,
		DelegateCall
	}

	/// Whether or not this proxy is initialized. It may only initialize once.
	bool public initialized = false;

	/// The associated `ProxyRegistry` contract with authentication information.
	address public registry;

	/// Whether or not access has been revoked.
	bool public revoked;

	/**
		An event fired when the proxy contract's access is revoked or unrevoked.

		@param revoked The status of the revocation call; true if access is 
			revoked and false if access is unrevoked.
	*/
	event Revoked (
		bool revoked
	);

	/**
		Initialize this authenticated proxy for its owner against a specified
		`ProxyRegistry`. The registry controls the eligible targets.

		@param _registry The registry to create this proxy against.
	*/
	function initialize (
		address _registry
	) external {
		if (initialized) {
			revert ProxyAlreadyInitialized();
		}
		initialized = true;
		registry = _registry;
	}

	/**
		Allow the owner of this proxy to set the revocation flag. This permits them
		to revoke access from the associated `ProxyRegistry` if needed.

		@param _revoke The revocation flag to set for this proxy.
	*/
	function setRevoke (
		bool _revoke
	) external onlyOwner {
		revoked = _revoke;
		emit Revoked(_revoke);
	}

	/**
		Trigger this proxy to call a specific address with the provided data. The
		proxy may perform a direct or a delegate call. This proxy can only be called
		by the owner, or on behalf of the owner by a caller authorized by the
		registry. Unless the user has revoked access to the registry, that is.

		@param _target The target address to make the call to.
		@param _type The type of call to make: direct or delegated.
		@param _data The call data to send to `_target`.

		@return _ Whether or not the call succeeded.

		@custom:throws NonAuthorizedCaller if the proxy caller is not the owner or 
			an authorized caller from the proxy registry.
	*/
	function call (
		address _target,
		CallType _type,
		bytes calldata _data
	) public returns (bool) {
		if (
			_msgSender() != owner() &&
			(revoked || !IProxyRegistry(registry).authorizedCallers(_msgSender()))
		) {
			revert NonAuthorizedCaller();
		}

		// The call is authorized to be performed, now select a type and return.
		if (_type == CallType.Call) {
			(bool success, ) = _target.call(_data);
			return success;
		} else if (_type == CallType.DelegateCall) {
			(bool success, ) = _target.delegatecall(_data);
			return success;
		}
		return false;
	}
}

File 11 of 21 : Ownable.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.7.0) (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 Throws if called by any account other than the owner.
     */
    modifier onlyOwner() {
        _checkOwner();
        _;
    }

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

    /**
     * @dev Throws if the sender is not the owner.
     */
    function _checkOwner() internal view virtual {
        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);
    }
}

File 12 of 21 : IProxyRegistry.sol
// SPDX-License-Identifier: AGPL-3.0-only
pragma solidity ^0.8.15;

/// Thrown if a caller is not authorized in the proxy registry.
error NonAuthorizedCaller ();

/**
	@custom:benediction DEVS BENEDICAT ET PROTEGAT CONTRACTVS MEAM
	@title Ownable Delegate Proxy
	@author Protinam, Project Wyvern
	@author Tim Clancy <@_Enoch>
	@author Rostislav Khlebnikov <@catpic5buck>

	A proxy registry contract. This contract was originally developed 
	by Project Wyvern. It has been modified to support a more modern version of 
	Solidity with associated best practices. The documentation has also been 
	improved to provide more clarity.

	@custom:date December 4th, 2022.
*/
interface IProxyRegistry {

	/// Return the address of tje current valid implementation of delegate proxy.
	function delegateProxyImplementation () external view returns (address);

	/**
		Returns the address of a proxy which was registered for the user address 
		before listing items.

		@param _owner The address of items lister.
	*/
	function proxies (
		address _owner
	) external view returns (address);

	/**
		Returns true if the `_caller` to the proxy registry is eligible and 
		registered.

		@param _caller The address of the caller.
	*/
	function authorizedCallers (
		address _caller
	) external view returns (bool);

	/**
		Returns the address of the `_caller`'s proxy and current implementation 
		address.

		@param _caller The address of the caller.
	*/
	function userProxyConfig (
		address _caller
	) external view returns (address, address);

	/**
		Enables an address to register its own proxy contract with this registry.

		@return _ The new contract with its implementation.
	*/
	function registerProxy () external returns (address);
}

File 13 of 21 : Context.sol
// 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;
    }
}

File 14 of 21 : BaseFeeManager.sol
// SPDX-License-Identifier: AGPL-3.0-only
pragma solidity ^0.8.15;

import {
	PermitControl
} from "../../access/PermitControl.sol";

/// Thrown if attempting to set the protocol fee to zero.
error ProtocolFeeRecipientCannotBeZero();

/**
	@custom:benediction DEVS BENEDICAT ET PROTEGAT CONTRACTVS MEAM
	@title GigaMart Base Fee Manager
	@author Rostislav Khlebnikov <@catpic5buck>
	@custom:contributor Tim Clancy <@_Enoch>

	A contract for providing platform fee management capabilities to GigaMart.

	@custom:date December 4th, 2022.
*/
abstract contract BaseFeeManager is PermitControl {

	/// The public identifier for the right to update the fee configuration.
	bytes32 public constant FEE_CONFIG = keccak256("FEE_CONFIG");

	/**
		In protocol fee configuration the recipient address takes the left 160 bits 
		and the fee percentage takes the right 96 bits.
	*/
	uint256 internal _protocolFee;

	/**
		Emmited when protocol fee config is altered.

		@param oldProtocolFeeRecipient The previous recipient address of protocol 
			fees.
		@param newProtocolFeeRecipient The new recipient address of protocol fees.
		@param oldProtocolFeePercent The previous amount of protocol fees.
		@param newProtocolFeePercent The new amount of protocol fees. 
	*/
	event ProtocolFeeChanged (
		address oldProtocolFeeRecipient,
		address newProtocolFeeRecipient,
		uint256 oldProtocolFeePercent,
		uint256 newProtocolFeePercent
	);

	/**
		Construct a new instance of the GigaMart fee manager.

		@param _protocolFeeRecipient The address that receives the protocol fee.
		@param _protocolFeePercent The percentage of the protocol fee in basis 
			points, i.e. 200 = 2%.
	*/
	constructor (
		address _protocolFeeRecipient,
		uint96 _protocolFeePercent
	) {
		unchecked {
			_protocolFee =
				(uint256(uint160(_protocolFeeRecipient)) << 96) +
				uint256(_protocolFeePercent);
		}
	}

	/**
		Returns current protocol fee config.
	*/
	function currentProtocolFee() public view returns (address, uint256) {
		uint256 fee = _protocolFee;
		return (address(uint160(fee >> 96)), uint256(uint96(fee)));
	}

	/**
		Changes the the fee details of the protocol.

		@param _newProtocolFeeRecipient The address of the new protocol fee 
			recipient.
		@param _newProtocolFeePercent The new amount of the protocol fees in basis 
			points, i.e. 200 = 2%.

		@custom:throws ProtocolFeeRecipientCannotBeZero if attempting to set the 
			recipient of the protocol fees to the zero address.
	*/
	function changeProtocolFees (
		address _newProtocolFeeRecipient,
		uint256 _newProtocolFeePercent
	) external hasValidPermit(UNIVERSAL, FEE_CONFIG) {
		if (_newProtocolFeeRecipient == address(0)) {
			revert ProtocolFeeRecipientCannotBeZero();
		}

		// Update the protocol fee.
		uint256 oldProtocolFee = _protocolFee;
		unchecked {
			_protocolFee =
				(uint256(uint160(_newProtocolFeeRecipient)) << 96) +
				uint256(_newProtocolFeePercent);
		}

		// Emit an event notifying about the update.
		emit ProtocolFeeChanged(
			address(uint160(oldProtocolFee >> 96)),
			_newProtocolFeeRecipient,
			uint256(uint96(oldProtocolFee)),
			_newProtocolFeePercent
		);
	}
}

File 15 of 21 : EIP712.sol
// SPDX-License-Identifier: AGPL-3.0-only
pragma solidity ^0.8.15;

/// Thrown if attempting to recover a signature of invalid length.
error InvalidSignatureLength ();

/**
	@custom:benediction DEVS BENEDICAT ET PROTEGAT CONTRACTVS MEAM
	@title EIP-712 Domain Manager
	@author Rostislav Khlebnikov <@catpic5buck>
	@custom:contributor Tim Clancy <@_Enoch>

	A contract for providing EIP-712 signature-services.

	@custom:date December 4th, 2022.
*/
abstract contract EIP712 {

	/**
		The typehash of the EIP-712 domain, used in dynamically deriving a domain 
		separator.
	*/
	bytes32 private constant EIP712_DOMAIN_TYPEHASH = keccak256(
		"EIP712Domain(string name,string version,uint256 chainId,address verifyingContract)"
	);

	/// A name used in the domain separator.
	string public constant name = "GigaMart";

	/// The immutable chain ID detected during construction.
	uint256 private immutable CHAIN_ID;

	/// The immutable chain ID created during construction.
	bytes32 private immutable DOMAIN_SEPARATOR;

	/**
		Construct a new EIP-712 domain instance.
	*/
	constructor () {
		uint chainId;
		assembly {
			chainId := chainid()
		}
		CHAIN_ID = chainId;
		DOMAIN_SEPARATOR = keccak256(
			abi.encode(
				EIP712_DOMAIN_TYPEHASH,
				keccak256(bytes(name)),
				keccak256(bytes(version())),
				chainId,
				address(this)
			)
		);
	}

	/**
		Return the version of this EIP-712 domain.

		@return _ The version of this EIP-712 domain.
	*/
	function version () public pure returns (string memory) {
		return "1";
	}

	/**
		Dynamically derive an EIP-712 domain separator.

		@return _ A constructed domain separator.
	*/
	function _deriveDomainSeparator () internal view returns (bytes32) {
		uint chainId;
		assembly {
			chainId := chainid()
		}
		return chainId == CHAIN_ID
			? DOMAIN_SEPARATOR
			: keccak256(
				abi.encode(
					EIP712_DOMAIN_TYPEHASH,
					keccak256(bytes(name)),
					keccak256(bytes(version())),
					chainId,
					address(this)
				)
			);
	}

	/**
		Recover the address which signed `_hash` with signature `_signature`.

		@param _hash A hash signed by an address.
		@param _signature The signature of the hash.

		@return _ The address which signed `_hash` with signature `_signature.

		@custom:throws InvalidSignatureLength if the signature length is not valid.
	*/
	function _recover (
		bytes32 _hash,
		bytes memory _signature
	) internal pure returns (address) {

		// Validate that the signature length is as expected.
		if (_signature.length != 65) {
			revert InvalidSignatureLength();
		}

		// Divide the signature into r, s and v variables.
		bytes32 r;
		bytes32 s;
		uint8 v;
		assembly {
			r := mload(add(_signature, 0x20))
			s := mload(add(_signature, 0x40))
			v := byte(0, mload(add(_signature, 0x60)))
		}

		// Return the recovered address.
		return ecrecover(_hash, v, r, s);
	}
}

File 16 of 21 : PermitControl.sol
// SPDX-License-Identifier: AGPL-3.0-only
pragma solidity ^0.8.15;

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

/**
	@custom:benediction DEVS BENEDICAT ET PROTEGAT CONTRACTVS MEAM
	@title An advanced permission-management contract.
	@author Tim Clancy <@_Enoch>

	This contract allows for a contract owner to delegate specific rights to
	external addresses. Additionally, these rights can be gated behind certain
	sets of circumstances and granted expiration times. This is useful for some
	more finely-grained access control in contracts.

	The owner of this contract is always a fully-permissioned super-administrator.

	@custom:date August 23rd, 2021.
*/
abstract contract PermitControl is Ownable {
	using Address for address;

	/// A special reserved constant for representing no rights.
	bytes32 public constant ZERO_RIGHT = hex"00000000000000000000000000000000";

	/// A special constant specifying the unique, universal-rights circumstance.
	bytes32 public constant UNIVERSAL = hex"FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF";

	/**
		A special constant specifying the unique manager right. This right allows an
		address to freely-manipulate the `managedRight` mapping.
	*/
	bytes32 public constant MANAGER = hex"FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF";

	/**
		A mapping of per-address permissions to the circumstances, represented as
		an additional layer of generic bytes32 data, under which the addresses have
		various permits. A permit in this sense is represented by a per-circumstance
		mapping which couples some right, represented as a generic bytes32, to an
		expiration time wherein the right may no longer be exercised. An expiration
		time of 0 indicates that there is in fact no permit for the specified
		address to exercise the specified right under the specified circumstance.

		@dev Universal rights MUST be stored under the 0xFFFFFFFFFFFFFFFFFFFFFFFF...
		max-integer circumstance. Perpetual rights may be given an expiry time of
		max-integer.
	*/
	mapping ( address => mapping( bytes32 => mapping( bytes32 => uint256 ))) 
		public permissions;

	/**
		An additional mapping of managed rights to manager rights. This mapping
		represents the administrator relationship that various rights have with one
		another. An address with a manager right may freely set permits for that
		manager right's managed rights. Each right may be managed by only one other
		right.
	*/
	mapping ( bytes32 => bytes32 ) public managerRight;

	/**
		An event emitted when an address has a permit updated. This event captures,
		through its various parameter combinations, the cases of granting a permit,
		updating the expiration time of a permit, or revoking a permit.

		@param updater The address which has updated the permit.
		@param updatee The address whose permit was updated.
		@param circumstance The circumstance wherein the permit was updated.
		@param role The role which was updated.
		@param expirationTime The time when the permit expires.
	*/
	event PermitUpdated (
		address indexed updater,
		address indexed updatee,
		bytes32 circumstance,
		bytes32 indexed role,
		uint256 expirationTime
	);

	/**
		An event emitted when a management relationship in `managerRight` is
		updated. This event captures adding and revoking management permissions via
		observing the update history of the `managerRight` value.

		@param manager The address of the manager performing this update.
		@param managedRight The right which had its manager updated.
		@param managerRight The new manager right which was updated to.
	*/
	event ManagementUpdated (
		address indexed manager,
		bytes32 indexed managedRight,
		bytes32 indexed managerRight
	);

	/**
		A modifier which allows only the super-administrative owner or addresses
		with a specified valid right to perform a call.

		@param _circumstance The circumstance under which to check for the validity
			of the specified `right`.
		@param _right The right to validate for the calling address. It must be
			non-expired and exist within the specified `_circumstance`.
	*/
	modifier hasValidPermit (
		bytes32 _circumstance,
		bytes32 _right
	) {
		require(
			_msgSender() == owner() || hasRight(_msgSender(), _circumstance, _right),
			"P1"
		);
		_;
	}

	/**
		Set the `_managerRight` whose `UNIVERSAL` holders may freely manage the
		specified `_managedRight`.

		@param _managedRight The right which is to have its manager set to
			`_managerRight`.
		@param _managerRight The right whose `UNIVERSAL` holders may manage
			`_managedRight`.
	*/
	function setManagerRight (
		bytes32 _managedRight,
		bytes32 _managerRight
	) external virtual hasValidPermit(UNIVERSAL, MANAGER) {
		require(_managedRight != ZERO_RIGHT, "P3");
		managerRight[_managedRight] = _managerRight;
		emit ManagementUpdated(_msgSender(), _managedRight, _managerRight);
	}

	/**
		Set the permit to a specific address under some circumstances. A permit may
		only be set by the super-administrative contract owner or an address holding
		some delegated management permit.

		@param _address The address to assign the specified `_right` to.
		@param _circumstance The circumstance in which the `_right` is valid.
		@param _right The specific right to assign.
		@param _expirationTime The time when the `_right` expires for the provided
			`_circumstance`.
	*/
	function setPermit (
		address _address,
		bytes32 _circumstance,
		bytes32 _right,
		uint256 _expirationTime
	) public virtual hasValidPermit(UNIVERSAL, managerRight[_right]) {
		require(_right != ZERO_RIGHT, "P2");
		permissions[_address][_circumstance][_right] = _expirationTime;
		emit PermitUpdated(
			_msgSender(),
			_address,
			_circumstance,
			_right,
			_expirationTime
		);
	}

	/**
		Determine whether or not an address has some rights under the given
		circumstance, and if they do have the right, until when.

		@param _address The address to check for the specified `_right`.
		@param _circumstance The circumstance to check the specified `_right` for.
		@param _right The right to check for validity.

		@return The timestamp in seconds when the `_right` expires. If the timestamp
			is zero, we can assume that the user never had the right.
	*/
	function hasRightUntil (
		address _address,
		bytes32 _circumstance,
		bytes32 _right
	) public view returns (uint256) {
		return permissions[_address][_circumstance][_right];
	}

	/**
		Determine whether or not an address has some rights under the given
		circumstance,

		@param _address The address to check for the specified `_right`.
		@param _circumstance The circumstance to check the specified `_right` for.
		@param _right The right to check for validity.

		@return true or false, whether user has rights and time is valid.
	*/
	function hasRight (
		address _address,
		bytes32 _circumstance,
		bytes32 _right
	) public view returns (bool) {
		return permissions[_address][_circumstance][_right] > block.timestamp;
	}
}

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

pragma solidity ^0.8.1;

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

        return account.code.length > 0;
    }

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

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

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

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

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

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

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

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

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

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

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

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

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

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

File 18 of 21 : DelegateProxy.sol
// SPDX-License-Identifier: AGPL-3.0-only
pragma solidity ^0.8.15;

/// Thrown if the proxy's implementation is not set.
error ImplementationIsNotSet ();

/**
	@custom:benediction DEVS BENEDICAT ET PROTEGAT CONTRACTVS MEAM
	@title Delegate Proxy
	@author Facu Spagnuolo, OpenZeppelin
	@author Protinam, Project Wyvern
	@author Tim Clancy <@_Enoch>

	A basic call-delegating proxy contract which is compliant with the current 
	draft version of ERC-897. This contract was originally developed by Project 
	Wyvern. It has been modified to support a more modern version of Solidity 
	with associated best practices. The documentation has also been improved to 
	provide more clarity.

	@custom:date December 4th, 2022.
*/
abstract contract DelegateProxy {

	/**
		This payable fallback function exists to automatically delegate all calls to
		this proxy to the contract specified from `implementation()`. Anything
		returned from the delegated call will also be returned here.

		@custom:throws ImplementationIsNotSet if the contract implementation is not 
			set.
	*/
	fallback () external payable virtual {
		address target = implementation();

		// Ensure that the proxy implementation has been set correctly.
		if (target == address(0)) {
			revert ImplementationIsNotSet();
		}

		// Perform the actual call delegation.
		assembly {
			let ptr := mload(0x40)
			calldatacopy(ptr, 0, calldatasize())
			let result := delegatecall(gas(), target, ptr, calldatasize(), 0, 0)
			let size := returndatasize()
			returndatacopy(ptr, 0, size)
			switch result
			case 0 {
				revert(ptr, size)
			}
			default {
				return(ptr, size)
			}
		}
	}

	/**
		Return the current address where all calls to this proxy are delegated. If
		`proxyType()` returns `1`, ERC-897 dictates that this address MUST not
		change.

		@return _ The current address where calls to this proxy are delegated.
	*/
	function implementation () public view virtual returns (address);
}

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

pragma solidity ^0.8.0;

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

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

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

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

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

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

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

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

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

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

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

pragma solidity ^0.8.0;

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

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

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

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

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

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

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

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

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

pragma solidity ^0.8.0;

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

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

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

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

Contract Security Audit

Contract ABI

[{"inputs":[{"internalType":"contract IProxyRegistry","name":"_registry","type":"address"},{"internalType":"contract TokenTransferProxy","name":"_tokenTransferProxy","type":"address"},{"internalType":"address","name":"_validator","type":"address"},{"internalType":"address","name":"_protocolFeeRecipient","type":"address"},{"internalType":"uint96","name":"_protocolFeePercent","type":"uint96"}],"stateMutability":"nonpayable","type":"constructor"},{"inputs":[],"name":"ArgumentsLengthMismatched","type":"error"},{"inputs":[],"name":"BadSignature","type":"error"},{"inputs":[],"name":"CallToProxyFailed","type":"error"},{"inputs":[],"name":"CannotAuthenticateOrder","type":"error"},{"inputs":[],"name":"InvalidOrder","type":"error"},{"inputs":[],"name":"InvalidRecipient","type":"error"},{"inputs":[],"name":"InvalidSignatureLength","type":"error"},{"inputs":[{"internalType":"uint256","name":"nonce","type":"uint256"}],"name":"NonceLowerThanCurrent","type":"error"},{"inputs":[],"name":"NotEnoughValueSent","type":"error"},{"inputs":[],"name":"OrderIsAlreadyCancelled","type":"error"},{"inputs":[],"name":"ProtocolFeeRecipientCannotBeZero","type":"error"},{"inputs":[],"name":"SignatureExpired","type":"error"},{"inputs":[],"name":"TransferFailed","type":"error"},{"inputs":[],"name":"UnknownUserProxyImplementation","type":"error"},{"inputs":[],"name":"UserProxyDoesNotExist","type":"error"},{"inputs":[],"name":"ValidatorAddressCannotBeZero","type":"error"},{"inputs":[],"name":"WrongOrderType","type":"error"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"sender","type":"address"},{"indexed":false,"internalType":"uint256","name":"minNonce","type":"uint256"}],"name":"AllOrdersCancelled","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"manager","type":"address"},{"indexed":true,"internalType":"bytes32","name":"managedRight","type":"bytes32"},{"indexed":true,"internalType":"bytes32","name":"managerRight","type":"bytes32"}],"name":"ManagementUpdated","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"maker","type":"address"},{"indexed":false,"internalType":"bytes32","name":"hash","type":"bytes32"},{"indexed":false,"internalType":"bytes","name":"data","type":"bytes"}],"name":"OrderCancelled","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"bytes32","name":"order","type":"bytes32"},{"indexed":true,"internalType":"address","name":"maker","type":"address"},{"indexed":true,"internalType":"address","name":"taker","type":"address"},{"indexed":false,"internalType":"bytes","name":"data","type":"bytes"}],"name":"OrderResult","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":true,"internalType":"address","name":"updater","type":"address"},{"indexed":true,"internalType":"address","name":"updatee","type":"address"},{"indexed":false,"internalType":"bytes32","name":"circumstance","type":"bytes32"},{"indexed":true,"internalType":"bytes32","name":"role","type":"bytes32"},{"indexed":false,"internalType":"uint256","name":"expirationTime","type":"uint256"}],"name":"PermitUpdated","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"oldProtocolFeeRecipient","type":"address"},{"indexed":false,"internalType":"address","name":"newProtocolFeeRecipient","type":"address"},{"indexed":false,"internalType":"uint256","name":"oldProtocolFeePercent","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"newProtocolFeePercent","type":"uint256"}],"name":"ProtocolFeeChanged","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"setter","type":"address"},{"indexed":true,"internalType":"address","name":"collection","type":"address"},{"indexed":false,"internalType":"uint256","name":"oldRoyalties","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"newRoyalties","type":"uint256"}],"name":"RoyaltyChanged","type":"event"},{"inputs":[],"name":"FEE_CONFIG","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"MANAGER","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"ROYALTY_TYPEHASH","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"UNIVERSAL","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"VALIDATOR_SETTER","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"ZERO_RIGHT","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"_minNonce","type":"uint256"}],"name":"cancelAllOrders","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"components":[{"internalType":"uint256","name":"nonce","type":"uint256"},{"components":[{"internalType":"uint256","name":"basePrice","type":"uint256"},{"internalType":"uint256","name":"listingTime","type":"uint256"},{"internalType":"uint256","name":"expirationTime","type":"uint256"},{"internalType":"address","name":"exchange","type":"address"},{"internalType":"address","name":"maker","type":"address"},{"internalType":"enum Sales.Side","name":"side","type":"uint8"},{"internalType":"address","name":"taker","type":"address"},{"internalType":"enum Sales.SaleKind","name":"saleKind","type":"uint8"},{"internalType":"address","name":"target","type":"address"},{"internalType":"enum AuthenticatedProxy.CallType","name":"callType","type":"uint8"},{"internalType":"address","name":"paymentToken","type":"address"}],"internalType":"struct Entities.Outline","name":"outline","type":"tuple"},{"internalType":"uint256[]","name":"extra","type":"uint256[]"},{"internalType":"bytes","name":"data","type":"bytes"}],"internalType":"struct Entities.Order","name":"_order","type":"tuple"}],"name":"cancelOrder","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"components":[{"internalType":"uint256","name":"nonce","type":"uint256"},{"components":[{"internalType":"uint256","name":"basePrice","type":"uint256"},{"internalType":"uint256","name":"listingTime","type":"uint256"},{"internalType":"uint256","name":"expirationTime","type":"uint256"},{"internalType":"address","name":"exchange","type":"address"},{"internalType":"address","name":"maker","type":"address"},{"internalType":"enum Sales.Side","name":"side","type":"uint8"},{"internalType":"address","name":"taker","type":"address"},{"internalType":"enum Sales.SaleKind","name":"saleKind","type":"uint8"},{"internalType":"address","name":"target","type":"address"},{"internalType":"enum AuthenticatedProxy.CallType","name":"callType","type":"uint8"},{"internalType":"address","name":"paymentToken","type":"address"}],"internalType":"struct Entities.Outline","name":"outline","type":"tuple"},{"internalType":"uint256[]","name":"extra","type":"uint256[]"},{"internalType":"bytes","name":"data","type":"bytes"}],"internalType":"struct Entities.Order[]","name":"_orders","type":"tuple[]"}],"name":"cancelOrders","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"name":"cancelledOrFinalized","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_newProtocolFeeRecipient","type":"address"},{"internalType":"uint256","name":"_newProtocolFeePercent","type":"uint256"}],"name":"changeProtocolFees","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_validator","type":"address"}],"name":"changeValidator","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"currentProtocolFee","outputs":[{"internalType":"address","name":"","type":"address"},{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_collection","type":"address"}],"name":"currentRoyalties","outputs":[{"internalType":"address","name":"","type":"address"},{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_recipient","type":"address"},{"components":[{"internalType":"uint256","name":"nonce","type":"uint256"},{"components":[{"internalType":"uint256","name":"basePrice","type":"uint256"},{"internalType":"uint256","name":"listingTime","type":"uint256"},{"internalType":"uint256","name":"expirationTime","type":"uint256"},{"internalType":"address","name":"exchange","type":"address"},{"internalType":"address","name":"maker","type":"address"},{"internalType":"enum Sales.Side","name":"side","type":"uint8"},{"internalType":"address","name":"taker","type":"address"},{"internalType":"enum Sales.SaleKind","name":"saleKind","type":"uint8"},{"internalType":"address","name":"target","type":"address"},{"internalType":"enum AuthenticatedProxy.CallType","name":"callType","type":"uint8"},{"internalType":"address","name":"paymentToken","type":"address"}],"internalType":"struct Entities.Outline","name":"outline","type":"tuple"},{"internalType":"uint256[]","name":"extra","type":"uint256[]"},{"internalType":"bytes","name":"data","type":"bytes"}],"internalType":"struct Entities.Order[]","name":"_orders","type":"tuple[]"},{"components":[{"internalType":"uint8","name":"v","type":"uint8"},{"internalType":"bytes32","name":"r","type":"bytes32"},{"internalType":"bytes32","name":"s","type":"bytes32"}],"internalType":"struct Entities.Sig[]","name":"_signatures","type":"tuple[]"},{"components":[{"internalType":"uint256","name":"nonce","type":"uint256"},{"components":[{"internalType":"uint256","name":"basePrice","type":"uint256"},{"internalType":"uint256","name":"listingTime","type":"uint256"},{"internalType":"uint256","name":"expirationTime","type":"uint256"},{"internalType":"address","name":"exchange","type":"address"},{"internalType":"address","name":"maker","type":"address"},{"internalType":"enum Sales.Side","name":"side","type":"uint8"},{"internalType":"address","name":"taker","type":"address"},{"internalType":"enum Sales.SaleKind","name":"saleKind","type":"uint8"},{"internalType":"address","name":"target","type":"address"},{"internalType":"enum AuthenticatedProxy.CallType","name":"callType","type":"uint8"},{"internalType":"address","name":"paymentToken","type":"address"}],"internalType":"struct Entities.Outline","name":"outline","type":"tuple"},{"internalType":"uint256[]","name":"extra","type":"uint256[]"},{"internalType":"bytes","name":"data","type":"bytes"}],"internalType":"struct Entities.Order[]","name":"_toInvalidate","type":"tuple[]"}],"name":"exchangeMultipleItems","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[{"internalType":"address","name":"_recipient","type":"address"},{"components":[{"internalType":"uint256","name":"nonce","type":"uint256"},{"components":[{"internalType":"uint256","name":"basePrice","type":"uint256"},{"internalType":"uint256","name":"listingTime","type":"uint256"},{"internalType":"uint256","name":"expirationTime","type":"uint256"},{"internalType":"address","name":"exchange","type":"address"},{"internalType":"address","name":"maker","type":"address"},{"internalType":"enum Sales.Side","name":"side","type":"uint8"},{"internalType":"address","name":"taker","type":"address"},{"internalType":"enum Sales.SaleKind","name":"saleKind","type":"uint8"},{"internalType":"address","name":"target","type":"address"},{"internalType":"enum AuthenticatedProxy.CallType","name":"callType","type":"uint8"},{"internalType":"address","name":"paymentToken","type":"address"}],"internalType":"struct Entities.Outline","name":"outline","type":"tuple"},{"internalType":"uint256[]","name":"extra","type":"uint256[]"},{"internalType":"bytes","name":"data","type":"bytes"}],"internalType":"struct Entities.Order","name":"_order","type":"tuple"},{"components":[{"internalType":"uint8","name":"v","type":"uint8"},{"internalType":"bytes32","name":"r","type":"bytes32"},{"internalType":"bytes32","name":"s","type":"bytes32"}],"internalType":"struct Entities.Sig","name":"_signature","type":"tuple"},{"internalType":"uint256","name":"_tokenId","type":"uint256"},{"components":[{"internalType":"uint256","name":"nonce","type":"uint256"},{"components":[{"internalType":"uint256","name":"basePrice","type":"uint256"},{"internalType":"uint256","name":"listingTime","type":"uint256"},{"internalType":"uint256","name":"expirationTime","type":"uint256"},{"internalType":"address","name":"exchange","type":"address"},{"internalType":"address","name":"maker","type":"address"},{"internalType":"enum Sales.Side","name":"side","type":"uint8"},{"internalType":"address","name":"taker","type":"address"},{"internalType":"enum Sales.SaleKind","name":"saleKind","type":"uint8"},{"internalType":"address","name":"target","type":"address"},{"internalType":"enum AuthenticatedProxy.CallType","name":"callType","type":"uint8"},{"internalType":"address","name":"paymentToken","type":"address"}],"internalType":"struct Entities.Outline","name":"outline","type":"tuple"},{"internalType":"uint256[]","name":"extra","type":"uint256[]"},{"internalType":"bytes","name":"data","type":"bytes"}],"internalType":"struct Entities.Order[]","name":"_toInvalidate","type":"tuple[]"}],"name":"exchangeSingleItem","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[{"internalType":"address","name":"_address","type":"address"},{"internalType":"bytes32","name":"_circumstance","type":"bytes32"},{"internalType":"bytes32","name":"_right","type":"bytes32"}],"name":"hasRight","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"_address","type":"address"},{"internalType":"bytes32","name":"_circumstance","type":"bytes32"},{"internalType":"bytes32","name":"_right","type":"bytes32"}],"name":"hasRightUntil","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"}],"name":"indices","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"name":"managerRight","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"}],"name":"minOrderNonces","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"name","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"owner","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"},{"internalType":"bytes32","name":"","type":"bytes32"},{"internalType":"bytes32","name":"","type":"bytes32"}],"name":"permissions","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"registry","outputs":[{"internalType":"contract IProxyRegistry","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"renounceOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"},{"internalType":"uint256","name":"","type":"uint256"}],"name":"royalties","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"bytes32","name":"_managedRight","type":"bytes32"},{"internalType":"bytes32","name":"_managerRight","type":"bytes32"}],"name":"setManagerRight","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_address","type":"address"},{"internalType":"bytes32","name":"_circumstance","type":"bytes32"},{"internalType":"bytes32","name":"_right","type":"bytes32"},{"internalType":"uint256","name":"_expirationTime","type":"uint256"}],"name":"setPermit","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_collection","type":"address"},{"internalType":"uint256","name":"_deadline","type":"uint256"},{"internalType":"uint256","name":"_newRoyalties","type":"uint256"},{"internalType":"bytes","name":"_signature","type":"bytes"}],"name":"setRoyalties","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"tokenTransferProxy","outputs":[{"internalType":"contract TokenTransferProxy","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address[]","name":"_targets","type":"address[]"},{"internalType":"bytes[]","name":"_data","type":"bytes[]"}],"name":"transferMultipleItems","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"newOwner","type":"address"}],"name":"transferOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"version","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"pure","type":"function"}]

6101006040523480156200001257600080fd5b5060405162004134380380620041348339810160408190526200003591620001e2565b466080818152604080518082018252600881526711da59d853585c9d60c21b6020918201528151808301835260018152603160f81b9082015281517f8b73c3c69bb8fe3d512ecc4cf759cc79239f7b179b0ffacaa9a75d522b39400f818301527f4380187604bc8a9be1c23a0e8e57396caafc33bae31e91760cb6785d7c9ee657818401527fc89efdaa54c0f20c7adf612882df0950f5a951637e0307cdcb4c672f298b8bc66060820152928301939093523060a08084019190915281518084038201815260c090930190915281519190920120905284848484848282828181620001203362000179565b6001600160601b031660609190911b6001600160601b031916016003555050600480546001600160a01b0319166001600160a01b0392831617905593841660e0525050501660c05250506001600955506200026d915050565b600080546001600160a01b038381166001600160a01b0319831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b6001600160a01b0381168114620001df57600080fd5b50565b600080600080600060a08688031215620001fb57600080fd5b85516200020881620001c9565b60208701519095506200021b81620001c9565b60408701519094506200022e81620001c9565b60608701519093506200024181620001c9565b60808701519092506001600160601b03811681146200025f57600080fd5b809150509295509295909350565b60805160a05160c05160e051613e6a620002ca6000396000818161027a01528181610edd0152612a4d01526000818161051801528181611448015281816119d80152611e28015260006122cf015260006121d60152613e6a6000f3fe6080604052600436106102195760003560e01c80638076f0051161011d578063cf64d4c2116100b0578063f2fde38b1161007f578063f6abfc7611610064578063f6abfc761461075c578063fa5f795e1461077c578063ff0924ee146107b057600080fd5b8063f2fde38b1461071c578063f3b1e3bd1461073c57600080fd5b8063cf64d4c21461069e578063d51115d7146106be578063e1e549c4146106d1578063e6aa5e171461070957600080fd5b8063bd545f53116100ec578063bd545f53146105fd578063be8f07d41461061d578063c5b16c5914610651578063cc2af3081461067e57600080fd5b80638076f0051461053a5780638681d49c1461057a5780638da5cb5b146105ca578063a625776e146105e857600080fd5b8063483ba44e116101b0578063686a6ccf1161017f5780636a2d285d116101645780636a2d285d146104c4578063715018a6146104f15780637b1039991461050657600080fd5b8063686a6ccf1461048457806368a1c3c3146104a457600080fd5b8063483ba44e146103a15780635063e207146103df57806354fd4d501461040c57806366a0e54d1461043657600080fd5b806323728d32116101ec57806323728d32146102e7578063282053ff1461032b5780633f0386e91461035f57806344911d191461038157600080fd5b806306fdde031461021e5780630eefdbad1461026857806317f5ebb4146102b45780631b2df850146102b4575b600080fd5b34801561022a57600080fd5b506102526040518060400160405280600881526020016711da59d853585c9d60c21b81525081565b60405161025f91906131c6565b60405180910390f35b34801561027457600080fd5b5061029c7f000000000000000000000000000000000000000000000000000000000000000081565b6040516001600160a01b03909116815260200161025f565b3480156102c057600080fd5b506102d96fffffffffffffffffffffffffffffffff1981565b60405190815260200161025f565b3480156102f357600080fd5b50600354606081901c906bffffffffffffffffffffffff165b604080516001600160a01b03909316835260208301919091520161025f565b34801561033757600080fd5b506102d97fab7922d407ee68907f3012689fc312513191a8f302400319928e871c6d39f8ec81565b34801561036b57600080fd5b5061037f61037a3660046131d9565b61080e565b005b34801561038d57600080fd5b5061037f61039c366004613261565b61081a565b3480156103ad57600080fd5b506102d96103bc3660046132f2565b600160209081526000938452604080852082529284528284209052825290205481565b3480156103eb57600080fd5b506102d96103fa366004613327565b60066020526000908152604090205481565b34801561041857600080fd5b506040805180820190915260018152603160f81b6020820152610252565b34801561044257600080fd5b506102d96104513660046132f2565b6001600160a01b038316600090815260016020908152604080832085845282528083208484529091529020549392505050565b34801561049057600080fd5b5061037f61049f366004613344565b61084c565b3480156104b057600080fd5b5061037f6104bf3660046133da565b6109d0565b3480156104d057600080fd5b506102d96104df366004613327565b60076020526000908152604090205481565b3480156104fd57600080fd5b5061037f610a14565b34801561051257600080fd5b5061029c7f000000000000000000000000000000000000000000000000000000000000000081565b34801561054657600080fd5b5061056a61055536600461341c565b60086020526000908152604090205460ff1681565b604051901515815260200161025f565b34801561058657600080fd5b5061056a6105953660046132f2565b6001600160a01b0383166000908152600160209081526040808320858452825280832084845290915290205442109392505050565b3480156105d657600080fd5b506000546001600160a01b031661029c565b3480156105f457600080fd5b506102d9600081565b34801561060957600080fd5b5061037f61061836600461341c565b610a28565b34801561062957600080fd5b506102d97f04c68c9fff15bf997e5ceb309a37aa8077e41018445f90182d108811f0c988e381565b34801561065d57600080fd5b506102d961066c36600461341c565b60026020526000908152604090205481565b34801561068a57600080fd5b5061037f610699366004613435565b610ada565b3480156106aa57600080fd5b5061037f6106b9366004613457565b610c0e565b61037f6106cc3660046137d0565b610d55565b3480156106dd57600080fd5b506102d96106ec3660046138eb565b600560209081526000928352604080842090915290825290205481565b61037f610717366004613917565b610f1f565b34801561072857600080fd5b5061037f610737366004613327565b610fc6565b34801561074857600080fd5b5061037f6107573660046138eb565b611053565b34801561076857600080fd5b5061037f610777366004613327565b6111b2565b34801561078857600080fd5b506102d97ffb611fe2ee773273b2db591335adbd769558cf583a410ad6b83eb8860c37f0d781565b3480156107bc57600080fd5b5061030c6107cb366004613327565b6001600160a01b0316600090815260056020908152604080832060068352818420548452909152902054606081901c916bffffffffffffffffffffffff90911690565b610817816112bc565b50565b82811461083a57604051634fb5c99760e11b815260040160405180910390fd5b6108468484848461141a565b50505050565b6004546001600160a01b03166108a3610867338888886116d7565b84848080601f01602080910402602001604051908101604052809392919081815260200183838082843760009201919091525061179492505050565b6001600160a01b0316146108e3576040517f5cd5d23300000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b4284101561091d576040517f0819bdcd00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6001600160a01b03851660008181526005602090815260408083206006808452828520805480875292855292852054958552909252909161095d836139b0565b90915550506001600160a01b038616600081815260056020908152604080832060068352818420548452825291829020879055815184815290810187905233917f035e66676151f71cd262ff6e158221abccf86b65561c02a13a1c623fc3bac62a910160405180910390a3505050505050565b60005b81811015610a0f57610a078383838181106109f0576109f06139c9565b9050602002810190610a0291906139df565b6112bc565b6001016109d3565b505050565b610a1c611847565b610a2660006118a1565b565b33600090815260076020526040902054811015610a8b5733600090815260076020526040908190205490517fa731175a00000000000000000000000000000000000000000000000000000000815260048101919091526024015b60405180910390fd5b3360008181526007602052604090819020839055517f83a782ac7424737a1190d4668474e765f07d603de0485a081dbc343ac1b0209990610acf9084815260200190565b60405180910390a250565b6fffffffffffffffffffffffffffffffff1980610aff6000546001600160a01b031690565b6001600160a01b0316336001600160a01b03161480610b4e5750610b4e335b6001600160a01b031660009081526001602090815260408083208684528252808320858452909152902054421090565b610b7f5760405162461bcd60e51b8152602060048201526002602482015261503160f01b6044820152606401610a82565b83610bcc5760405162461bcd60e51b815260206004820152600260248201527f50330000000000000000000000000000000000000000000000000000000000006044820152606401610a82565b600084815260026020526040808220859055518491869133917fad26b90be8a18bd2262e914f6fd4919c42f9dd6a0d07a15fa728ec603a836a8891a450505050565b6000828152600260205260409020546fffffffffffffffffffffffffffffffff1990610c426000546001600160a01b031690565b6001600160a01b0316336001600160a01b03161480610c655750610c6533610b1e565b610c965760405162461bcd60e51b8152602060048201526002602482015261503160f01b6044820152606401610a82565b83610ce35760405162461bcd60e51b815260206004820152600260248201527f50320000000000000000000000000000000000000000000000000000000000006044820152606401610a82565b6001600160a01b03861660008181526001602090815260408083208984528252808320888452825291829020869055815188815290810186905286929133917f71b8ef6d2e182fa6ca30442059cc10398330b3e0561fd4ecc7232b62a8678cb6910160405180910390a4505050505050565b600260095403610da75760405162461bcd60e51b815260206004820152601f60248201527f5265656e7472616e637947756172643a207265656e7472616e742063616c6c006044820152606401610a82565b600260095584518314610dcd57604051634fb5c99760e11b815260040160405180910390fd5b6001600160a01b038616610df457604051634e46966960e11b815260040160405180910390fd5b60408051602080825281830190925260009160208201818036833701905050905060005b8651811015610ed5576002878281518110610e3557610e356139c9565b60200260200101516020015160e001516005811115610e5657610e56613a00565b60ff161115610e91576040517fbef31f6b00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b610ecd88888381518110610ea757610ea76139c9565b6020026020010151888885818110610ec157610ec16139c9565b905060600201856118fe565b600101610e18565b50610f0181337f0000000000000000000000000000000000000000000000000000000000000000611cda565b8115610f1157610f1183836109d0565b505060016009555050505050565b600260095403610f715760405162461bcd60e51b815260206004820152601f60248201527f5265656e7472616e637947756172643a207265656e7472616e742063616c6c006044820152606401610a82565b60026009556001600160a01b038616610f9d57604051634e46966960e11b815260040160405180910390fd5b610fa986868686611da4565b8015610fb957610fb982826109d0565b5050600160095550505050565b610fce611847565b6001600160a01b03811661104a5760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201527f64647265737300000000000000000000000000000000000000000000000000006064820152608401610a82565b610817816118a1565b6fffffffffffffffffffffffffffffffff197f04c68c9fff15bf997e5ceb309a37aa8077e41018445f90182d108811f0c988e36110986000546001600160a01b031690565b6001600160a01b0316336001600160a01b031614806110bb57506110bb33610b1e565b6110ec5760405162461bcd60e51b8152602060048201526002602482015261503160f01b6044820152606401610a82565b6001600160a01b03841661112c576040517fac2d994800000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b60038054606086811b6bffffffffffffffffffffffff191686019092556040805182841c81526001600160a01b03881660208201526bffffffffffffffffffffffff831691810191909152918201859052907f35b2f65059b366144550b1fea2ed721bed23642eb2b5ce699c8b2c4b401bb4289060800160405180910390a15050505050565b6fffffffffffffffffffffffffffffffff197fab7922d407ee68907f3012689fc312513191a8f302400319928e871c6d39f8ec6111f76000546001600160a01b031690565b6001600160a01b0316336001600160a01b0316148061121a575061121a33610b1e565b61124b5760405162461bcd60e51b8152602060048201526002602482015261503160f01b6044820152606401610a82565b6001600160a01b03831661128b576040517f9ccba9bd00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b50506004805473ffffffffffffffffffffffffffffffffffffffff19166001600160a01b0392909216919091179055565b60006112cf6112ca83613a16565b612182565b60008181526008602052604090205490915060ff16806112fe5750336000908152600760205260409020548235105b15611335576040517f5de2368f00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b3361134660c0840160a08501613327565b6001600160a01b03161461136d576040516324eef54b60e21b815260040160405180910390fd5b6000818152600860205260409020805460ff1916600117905561139660c0830160a08401613327565b6001600160a01b03167f38ecf63abfcfc50a9de80e94dead4932bad05b8fae4ac0a19428c2a7ce54419f826113d361014086016101208701613327565b6113e16101a0870187613a22565b6040516020016113f393929190613a92565b60408051601f198184030181529082905261140e9291613ab5565b60405180910390a25050565b6040517fc45527910000000000000000000000000000000000000000000000000000000081523360048201527f0000000000000000000000000000000000000000000000000000000000000000906000906001600160a01b0383169063c455279190602401602060405180830381865afa15801561149c573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906114c09190613ace565b90506001600160a01b0381163b6114ea5760405163ef5651af60e01b815260040160405180910390fd5b816001600160a01b03166397204d8e6040518163ffffffff1660e01b8152600401602060405180830381865afa158015611528573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061154c9190613ace565b6001600160a01b0316816001600160a01b0316635c60da1b6040518163ffffffff1660e01b8152600401602060405180830381865afa158015611593573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906115b79190613ace565b6001600160a01b0316146115de57604051630f5f164d60e01b815260040160405180910390fd5b8060005b868110156116cd57816001600160a01b03166317437c6d89898481811061160b5761160b6139c9565b90506020020160208101906116209190613327565b6000898986818110611634576116346139c9565b90506020028101906116469190613a22565b6040518563ffffffff1660e01b81526004016116659493929190613b08565b6020604051808303816000875af1158015611684573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906116a89190613b44565b6116c5576040516302d5aa5d60e31b815260040160405180910390fd5b6001016115e2565b5050505050505050565b60006116e16121d1565b604080517ffb611fe2ee773273b2db591335adbd769558cf583a410ad6b83eb8860c37f0d760208201526001600160a01b038089169282019290925290861660608201526080810185905260a0810184905260c0016040516020818303038152906040528051906020012060405160200161177392919061190160f01b81526002810192909252602282015260420190565b6040516020818303038152906040528051906020012090505b949350505050565b600081516041146117d1576040517f4be6321b00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b602082810151604080850151606080870151835160008082529681018086528a9052951a928501839052840183905260808401819052919260019060a0016020604051602081039080840390855afa158015611831573d6000803e3d6000fd5b5050506020604051035193505050505b92915050565b6000546001600160a01b03163314610a265760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e65726044820152606401610a82565b600080546001600160a01b0383811673ffffffffffffffffffffffffffffffffffffffff19831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b600061190984612182565b905061191585856122f5565b61194d576119478585837f1100000000000000000000000000000000000000000000000000000000000000600061253e565b50610846565b611965818560200151608001518660000151866125d4565b611997576119478585837f1200000000000000000000000000000000000000000000000000000000000000600061253e565b6020840151608001516040517fb47e4f810000000000000000000000000000000000000000000000000000000081526001600160a01b0391821660048201527f000000000000000000000000000000000000000000000000000000000000000091600091829184169063b47e4f81906024016040805180830381865afa158015611a25573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611a499190613b66565b91509150611a60826001600160a01b03163b151590565b611a9b57611a928888867f4300000000000000000000000000000000000000000000000000000000000000600061253e565b50505050610846565b806001600160a01b0316826001600160a01b0316635c60da1b6040518163ffffffff1660e01b8152600401602060405180830381865afa158015611ae3573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611b079190613ace565b6001600160a01b031614611b4357611a928888867f4400000000000000000000000000000000000000000000000000000000000000600061253e565b81611b50888a60006126e4565b506020880151610100015160608901516040516317437c6d60e01b81526001600160a01b038416926317437c6d92611b8e9260009190600401613ba0565b6020604051808303816000875af1158015611bad573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611bd19190613b44565b611c0d57611c038989877f5000000000000000000000000000000000000000000000000000000000000000600061253e565b5050505050610846565b505050506000611c3b856020015160e001518660200151600001518760400151886020015160200151612758565b9050611c8c83866020015161014001518760400151600081518110611c6257611c626139c9565b60200260200101518860200151608001516001600160a01b0316858a602001516101000151612875565b6000828152600860205260409020805460ff19166001179055611cd28686847fff000000000000000000000000000000000000000000000000000000000000008561253e565b505050505050565b825163368fa33960e21b9060009060609004815b81811015611d765760608181028801602081015160408201519190920151828015611d4e576040518881528460048201528a602482015283604482015282606482015260008060848360008e5af1905080611d4857600080fd5b50611d67565b95810195600080808085875af180611d6557600080fd5b505b50505050600181019050611cee565b505080341115611d9d57611d9d611d8d8234613bd1565b6001600160a01b0386169061292d565b5050505050565b6000611daf84612182565b9050611dbb85856122f5565b611df1576040517faf61069300000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b611e09818560200151608001518660000151866125d4565b611e26576040516324eef54b60e21b815260040160405180910390fd5b7f00000000000000000000000000000000000000000000000000000000000000006000806001600160a01b03831663b47e4f8182896020015160a001516001811115611e7457611e74613a00565b14611e8757886020015160800151611e89565b335b6040516001600160e01b031960e084901b1681526001600160a01b0390911660048201526024016040805180830381865afa158015611ecc573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611ef09190613b66565b91509150611f07826001600160a01b03163b151590565b611f245760405163ef5651af60e01b815260040160405180910390fd5b806001600160a01b0316826001600160a01b0316635c60da1b6040518163ffffffff1660e01b8152600401602060405180830381865afa158015611f6c573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611f909190613ace565b6001600160a01b031614611fb757604051630f5f164d60e01b815260040160405180910390fd5b81611fc3888a886126e4565b506020880151610100015160608901516040516317437c6d60e01b81526001600160a01b038416926317437c6d926120019260009190600401613ba0565b6020604051808303816000875af1158015612020573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906120449190613b44565b612061576040516302d5aa5d60e31b815260040160405180910390fd5b600061208b898a6040015160008151811061207e5761207e6139c9565b60200260200101516129ba565b9050803411156120a9576120a96120a28234613bd1565b339061292d565b6000868152600860209081526040808320805460ff191660011790558b82015160e0810151610100919091015160608e0151925161210f949293879390917fff000000000000000000000000000000000000000000000000000000000000009101613be8565b60405160208183030381529060405290508a6001600160a01b03168a60200151608001516001600160a01b03167fa6b12b6984bda6bd875df5a33eaeb64d6d12857b59a7d120bf9444b1bf7796a1898460405161216d929190613ab5565b60405180910390a35050505050505050505050565b600061218c6121d1565b61219583612dee565b60405161190160f01b6020820152602281019290925260428201526062015b604051602081830303815290604052805190602001209050919050565b6000467f000000000000000000000000000000000000000000000000000000000000000081146122cd57604080518082018252600881526711da59d853585c9d60c21b6020918201528151808301835260018152603160f81b9082015281517f8b73c3c69bb8fe3d512ecc4cf759cc79239f7b179b0ffacaa9a75d522b39400f818301527f4380187604bc8a9be1c23a0e8e57396caafc33bae31e91760cb6785d7c9ee657818401527fc89efdaa54c0f20c7adf612882df0950f5a951637e0307cdcb4c672f298b8bc66060820152608081018490523060a0808301919091528351808303909101815260c090910190925281519101206122ef565b7f00000000000000000000000000000000000000000000000000000000000000005b91505090565b6020810151606001516000906001600160a01b0316301461231857506000611841565b826001600160a01b03168260200151608001516001600160a01b0316148061235057506020820151608001516001600160a01b031633145b8061236a57506020820151608001516001600160a01b0316155b1561237757506000611841565b61239d600d83602001516020015161238f9190613bd1565b836020015160400151612e86565b6123a957506000611841565b6123b282612ea5565b6123be57506000611841565b6000826020015160e0015160058111156123da576123da613a00565b905060058160ff1611156123f2576000915050611841565b60038160ff1610801561241e57506000836020015160a00151600181111561241c5761241c613a00565b145b1561242d576000915050611841565b60028160ff1611801561245957506001836020015160a00151600181111561245757612457613a00565b145b15612468576000915050611841565b8060ff1660021480156124955750826020015160c001516001600160a01b0316846001600160a01b031614155b156124a4576000915050611841565b8060ff1660031480156124ec5750602083015160c001516001600160a01b0316331415806124ec5750826020015160c001516001600160a01b0316846001600160a01b031614155b156124fb576000915050611841565b8060ff166004148061251057508060ff166005145b801561252557506001600160a01b0384163314155b15612534576000915050611841565b5060019392505050565b846001600160a01b03168460200151608001516001600160a01b03167fa6b12b6984bda6bd875df5a33eaeb64d6d12857b59a7d120bf9444b1bf7796a185876020015160e0015185896020015161010001518a60600151896040516020016125aa959493929190613be8565b60408051601f19818403018152908290526125c59291613ab5565b60405180910390a35050505050565b60008481526008602052604081205460ff16156125f35750600061178c565b6001600160a01b03841660009081526007602052604090205483101561261b5750600061178c565b6001600160a01b0384166001866126356020860186613c80565b604080516000815260208181018084529490945260ff9092168282015291860135606082015290850135608082015260a0016020604051602081039080840390855afa158015612689573d6000803e3d6000fd5b505050602060405103516001600160a01b0316036126a95750600161178c565b6001600160a01b0384163b156126d9576126d284866126cd36869003860186613c9b565b612f1b565b905061178c565b506000949350505050565b6060830151602084015160e00151600090600581111561270657612706613a00565b905080801561272c576001811461272c576004811461273757600581146127425761274f565b84604484015261274f565b84602484015261274f565b8460248401528360648401525b50509392505050565b6000600185600581111561276e5761276e613a00565b0361286e5782600281518110612786576127866139c9565b602002602001015142106127b657826001815181106127a7576127a76139c9565b6020026020010151905061178c565b600082846002815181106127cc576127cc6139c9565b60200260200101516127de9190613bd1565b42856002815181106127f2576127f26139c9565b60200260200101516128049190613bd1565b85600181518110612817576128176139c9565b60200260200101518761282a9190613bd1565b6128349190613cfc565b61283e9190613d1b565b90508084600181518110612854576128546139c9565b60200260200101516128669190613d3d565b91505061178c565b508261178c565b60035482906bffffffffffffffffffffffff8116156128bb57606081901c906127106bffffffffffffffffffffffff9091168502046128b689898484613063565b909103905b506001600160a01b03821660009081526005602090815260408083208884529091529020546bffffffffffffffffffffffff81161561292157606081901c906127106bffffffffffffffffffffffff90911685020461291c89898484613063565b909103905b6116cd88888785613063565b6000826001600160a01b03168260405160006040518083038185875af1925050503d806000811461297a576040519150601f19603f3d011682016040523d82523d6000602084013e61297f565b606091505b5050905080610a0f576040517f90b8ec1800000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6000808080856020015160a0015160018111156129d9576129d9613a00565b146129ed57846020015160800151336129f8565b338560200151608001515b915091506000612a26866020015160e001518760200151600001518860400151896020015160200151612758565b90508015612de5576020860151610140015181906001600160a01b031615612cb4576003547f0000000000000000000000000000000000000000000000000000000000000000906bffffffffffffffffffffffff811615612b39576000612710612a9e6bffffffffffffffffffffffff841687613cfc565b612aa89190613d1b565b60208b0151610140015160405163368fa33960e21b81526001600160a01b0391821660048201528882166024820152606085901c60448201526064810183905291925084169063da3e8ce490608401600060405180830381600087803b158015612b1157600080fd5b505af1158015612b25573d6000803e3d6000fd5b505050508084612b359190613bd1565b9350505b5060208089015161010001516001600160a01b031660009081526005825260408082208a835290925220546bffffffffffffffffffffffff811615612c30576000612710612b956bffffffffffffffffffffffff841687613cfc565b612b9f9190613d1b565b60208b0151610140015160405163368fa33960e21b81526001600160a01b0391821660048201528882166024820152606085901c60448201526064810183905291925084169063da3e8ce490608401600060405180830381600087803b158015612c0857600080fd5b505af1158015612c1c573d6000803e3d6000fd5b505050508084612c2c9190613bd1565b9350505b6020890151610140015160405163368fa33960e21b81526001600160a01b03918216600482015286821660248201528782166044820152606481018590529083169063da3e8ce490608401600060405180830381600087803b158015612c9557600080fd5b505af1158015612ca9573d6000803e3d6000fd5b505050505050612de3565b81341015612cee576040517fdb6b1b5100000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6003546bffffffffffffffffffffffff811615612d4a576000612710612d226bffffffffffffffffffffffff841686613cfc565b612d2c9190613d1b565b9050612d3c606083901c8261292d565b612d468184613bd1565b9250505b5060208088015161010001516001600160a01b0316600090815260058252604080822089835290925220546bffffffffffffffffffffffff811615612dce576000612710612da66bffffffffffffffffffffffff841686613cfc565b612db09190613d1b565b9050612dc0606083901c8261292d565b612dca8184613bd1565b9250505b612de16001600160a01b0386168361292d565b505b505b95945050505050565b60007f0e656a6eeac05e2084d8a58f31a0332ef43725f42b802158a2c45e969c8bb5438260000151612e2384602001516130f6565b8460400151604051602001612e389190613d55565b60408051601f1981840301815282825280516020918201206060808a0151805190840120928501979097529183019490945293810191909152608081019290925260a082015260c0016121b4565b60004283108015612e9e5750811580612e9e57508142105b9392505050565b60608101516020810151600091906001600160e01b031981167ff242432a00000000000000000000000000000000000000000000000000000000148061178c57506001600160e01b031981167f23b872dd0000000000000000000000000000000000000000000000000000000014949350505050565b6000807f1626ba7e356f5979dd355a3d2bfb43e80420a480c3b854edce286a82d749686984846020015185604001518660000151604051602001612f9793929190928352602083019190915260f81b7fff0000000000000000000000000000000000000000000000000000000000000016604082015260410190565b60408051601f1981840301815290829052612fb59291602401613ab5565b60408051601f198184030181529190526020810180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff166001600160e01b0319909316929092178252805190925060009182918291895afa80613019573d6000803e3d6000fd5b5060203d0361302d5760206000803e506000515b6001600160e01b0319167f1626ba7e00000000000000000000000000000000000000000000000000000000149150509392505050565b8351606090046000805b828110156130b357602060608202018701518681036130aa576060828102890160408101519101908781036130a757815187018252600194505b50505b5060010161306d565b5080611cd2578180156130cc57865160600187526130d4565b865160400187525b5060608202860185602082015284604082015283606082015250505050505050565b60007f2fc9a689ed11fb3dff9fe9eda483b4883c00dd54c45b1567a6823ef25fa04046826000015183602001518460400151856060015186608001518760a001518860c001518960e001518a61010001518b61012001518c61014001516040516020016121b49c9b9a99989796959493929190613d8b565b60005b83811015613189578181015183820152602001613171565b838111156108465750506000910152565b600081518084526131b281602086016020860161316e565b601f01601f19169290920160200192915050565b602081526000612e9e602083018461319a565b6000602082840312156131eb57600080fd5b813567ffffffffffffffff81111561320257600080fd5b82016101c08185031215612e9e57600080fd5b60008083601f84011261322757600080fd5b50813567ffffffffffffffff81111561323f57600080fd5b6020830191508360208260051b850101111561325a57600080fd5b9250929050565b6000806000806040858703121561327757600080fd5b843567ffffffffffffffff8082111561328f57600080fd5b61329b88838901613215565b909650945060208701359150808211156132b457600080fd5b506132c187828801613215565b95989497509550505050565b6001600160a01b038116811461081757600080fd5b80356132ed816132cd565b919050565b60008060006060848603121561330757600080fd5b8335613312816132cd565b95602085013595506040909401359392505050565b60006020828403121561333957600080fd5b8135612e9e816132cd565b60008060008060006080868803121561335c57600080fd5b8535613367816132cd565b94506020860135935060408601359250606086013567ffffffffffffffff8082111561339257600080fd5b818801915088601f8301126133a657600080fd5b8135818111156133b557600080fd5b8960208285010111156133c757600080fd5b9699959850939650602001949392505050565b600080602083850312156133ed57600080fd5b823567ffffffffffffffff81111561340457600080fd5b61341085828601613215565b90969095509350505050565b60006020828403121561342e57600080fd5b5035919050565b6000806040838503121561344857600080fd5b50508035926020909101359150565b6000806000806080858703121561346d57600080fd5b8435613478816132cd565b966020860135965060408601359560600135945092505050565b634e487b7160e01b600052604160045260246000fd5b6040516080810167ffffffffffffffff811182821017156134cb576134cb613492565b60405290565b604051610160810167ffffffffffffffff811182821017156134cb576134cb613492565b604051601f8201601f1916810167ffffffffffffffff8111828210171561351e5761351e613492565b604052919050565b600067ffffffffffffffff82111561354057613540613492565b5060051b60200190565b8035600281106132ed57600080fd5b8035600681106132ed57600080fd5b600082601f83011261357957600080fd5b8135602061358e61358983613526565b6134f5565b82815260059290921b840181019181810190868411156135ad57600080fd5b8286015b848110156135c857803583529183019183016135b1565b509695505050505050565b600082601f8301126135e457600080fd5b813567ffffffffffffffff8111156135fe576135fe613492565b613611601f8201601f19166020016134f5565b81815284602083860101111561362657600080fd5b816020850160208301376000918101602001919091529392505050565b60008183036101c081121561365757600080fd5b61365f6134a8565b91508235825261016080601f198301121561367957600080fd5b6136816134d1565b91506020840135825260408401356020830152606084013560408301526136aa608085016132e2565b60608301526136bb60a085016132e2565b60808301526136cc60c0850161354a565b60a08301526136dd60e085016132e2565b60c08301526101006136f0818601613559565b60e08401526101206137038187016132e2565b82850152610140915061371782870161354a565b908401526137268583016132e2565b9083015250602082015261018082013567ffffffffffffffff8082111561374c57600080fd5b61375885838601613568565b60408401526101a084013591508082111561377257600080fd5b5061377f848285016135d3565b60608301525092915050565b60008083601f84011261379d57600080fd5b50813567ffffffffffffffff8111156137b557600080fd5b60208301915083602060608302850101111561325a57600080fd5b600080600080600080608087890312156137e957600080fd5b6137f387356132cd565b8635955060208088013567ffffffffffffffff8082111561381357600080fd5b818a0191508a601f83011261382757600080fd5b813561383561358982613526565b81815260059190911b8301840190848101908d83111561385457600080fd5b8585015b8381101561388a57848135111561386e57600080fd5b61387d8f888335890101613643565b8352918601918601613858565b509950505060408a01359250808311156138a357600080fd5b6138af8b848c0161378b565b909750955060608a01359250869150808311156138cb57600080fd5b50506138d989828a01613215565b979a9699509497509295939492505050565b600080604083850312156138fe57600080fd5b8235613909816132cd565b946020939093013593505050565b60008060008060008086880360e081121561393157600080fd5b873561393c816132cd565b9650602088013567ffffffffffffffff8082111561395957600080fd5b6139658b838c01613643565b97506060603f198401121561397957600080fd5b60408a01965060a08a0135955060c08a01359250808311156138cb57600080fd5b634e487b7160e01b600052601160045260246000fd5b6000600182016139c2576139c261399a565b5060010190565b634e487b7160e01b600052603260045260246000fd5b600082356101be198336030181126139f657600080fd5b9190910192915050565b634e487b7160e01b600052602160045260246000fd5b60006118413683613643565b6000808335601e19843603018112613a3957600080fd5b83018035915067ffffffffffffffff821115613a5457600080fd5b60200191503681900382131561325a57600080fd5b81835281816020850137506000828201602090810191909152601f909101601f19169091010190565b6001600160a01b0384168152604060208201526000612de5604083018486613a69565b82815260406020820152600061178c604083018461319a565b600060208284031215613ae057600080fd5b8151612e9e816132cd565b6002811061081757610817613a00565b613b0481613aeb565b9052565b6001600160a01b0385168152613b1d84613aeb565b836020820152606060408201526000613b3a606083018486613a69565b9695505050505050565b600060208284031215613b5657600080fd5b81518015158114612e9e57600080fd5b60008060408385031215613b7957600080fd5b8251613b84816132cd565b6020840151909250613b95816132cd565b809150509250929050565b6001600160a01b0384168152613bb583613aeb565b826020820152606060408201526000612de5606083018461319a565b600082821015613be357613be361399a565b500390565b600060068710613bfa57613bfa613a00565b8660f81b82528560018301526bffffffffffffffffffffffff198560601b1660218301528351613c3181603585016020880161316e565b80830190507fff0000000000000000000000000000000000000000000000000000000000000084166035820152603681019150509695505050505050565b803560ff811681146132ed57600080fd5b600060208284031215613c9257600080fd5b612e9e82613c6f565b600060608284031215613cad57600080fd5b6040516060810181811067ffffffffffffffff82111715613cd057613cd0613492565b604052613cdc83613c6f565b815260208301356020820152604083013560408201528091505092915050565b6000816000190483118215151615613d1657613d1661399a565b500290565b600082613d3857634e487b7160e01b600052601260045260246000fd5b500490565b60008219821115613d5057613d5061399a565b500190565b815160009082906020808601845b83811015613d7f57815185529382019390820190600101613d63565b50929695505050505050565b6000610180820190508d82528c60208301528b60408301528a60608301526001600160a01b03808b166080840152808a1660a0840152613dca89613aeb565b60c08301899052871660e083015260068610613de857613de8613a00565b85610100830152613e056101208301866001600160a01b03169052565b613e13610140830185613afb565b6001600160a01b0383166101608301529d9c5050505050505050505050505056fea26469706673582212209067682706a7df00bf9823326704d1d77cb713863e192bd2f1b177702ce72a6264736f6c634300080f003300000000000000000000000072939b9d6fe467d58d9b6cd35f35fa7de9383d010000000000000000000000002f0809aa3f09b19d5e8cd869108427032683e901000000000000000000000000a0f5b64ef8a1665243c5e54660277d9a62e58d0d0000000000000000000000006969b5d5bd910aaaf2b153fc3e2231b81d5d928a0000000000000000000000000000000000000000000000000000000000000000

Deployed Bytecode

0x6080604052600436106102195760003560e01c80638076f0051161011d578063cf64d4c2116100b0578063f2fde38b1161007f578063f6abfc7611610064578063f6abfc761461075c578063fa5f795e1461077c578063ff0924ee146107b057600080fd5b8063f2fde38b1461071c578063f3b1e3bd1461073c57600080fd5b8063cf64d4c21461069e578063d51115d7146106be578063e1e549c4146106d1578063e6aa5e171461070957600080fd5b8063bd545f53116100ec578063bd545f53146105fd578063be8f07d41461061d578063c5b16c5914610651578063cc2af3081461067e57600080fd5b80638076f0051461053a5780638681d49c1461057a5780638da5cb5b146105ca578063a625776e146105e857600080fd5b8063483ba44e116101b0578063686a6ccf1161017f5780636a2d285d116101645780636a2d285d146104c4578063715018a6146104f15780637b1039991461050657600080fd5b8063686a6ccf1461048457806368a1c3c3146104a457600080fd5b8063483ba44e146103a15780635063e207146103df57806354fd4d501461040c57806366a0e54d1461043657600080fd5b806323728d32116101ec57806323728d32146102e7578063282053ff1461032b5780633f0386e91461035f57806344911d191461038157600080fd5b806306fdde031461021e5780630eefdbad1461026857806317f5ebb4146102b45780631b2df850146102b4575b600080fd5b34801561022a57600080fd5b506102526040518060400160405280600881526020016711da59d853585c9d60c21b81525081565b60405161025f91906131c6565b60405180910390f35b34801561027457600080fd5b5061029c7f0000000000000000000000002f0809aa3f09b19d5e8cd869108427032683e90181565b6040516001600160a01b03909116815260200161025f565b3480156102c057600080fd5b506102d96fffffffffffffffffffffffffffffffff1981565b60405190815260200161025f565b3480156102f357600080fd5b50600354606081901c906bffffffffffffffffffffffff165b604080516001600160a01b03909316835260208301919091520161025f565b34801561033757600080fd5b506102d97fab7922d407ee68907f3012689fc312513191a8f302400319928e871c6d39f8ec81565b34801561036b57600080fd5b5061037f61037a3660046131d9565b61080e565b005b34801561038d57600080fd5b5061037f61039c366004613261565b61081a565b3480156103ad57600080fd5b506102d96103bc3660046132f2565b600160209081526000938452604080852082529284528284209052825290205481565b3480156103eb57600080fd5b506102d96103fa366004613327565b60066020526000908152604090205481565b34801561041857600080fd5b506040805180820190915260018152603160f81b6020820152610252565b34801561044257600080fd5b506102d96104513660046132f2565b6001600160a01b038316600090815260016020908152604080832085845282528083208484529091529020549392505050565b34801561049057600080fd5b5061037f61049f366004613344565b61084c565b3480156104b057600080fd5b5061037f6104bf3660046133da565b6109d0565b3480156104d057600080fd5b506102d96104df366004613327565b60076020526000908152604090205481565b3480156104fd57600080fd5b5061037f610a14565b34801561051257600080fd5b5061029c7f00000000000000000000000072939b9d6fe467d58d9b6cd35f35fa7de9383d0181565b34801561054657600080fd5b5061056a61055536600461341c565b60086020526000908152604090205460ff1681565b604051901515815260200161025f565b34801561058657600080fd5b5061056a6105953660046132f2565b6001600160a01b0383166000908152600160209081526040808320858452825280832084845290915290205442109392505050565b3480156105d657600080fd5b506000546001600160a01b031661029c565b3480156105f457600080fd5b506102d9600081565b34801561060957600080fd5b5061037f61061836600461341c565b610a28565b34801561062957600080fd5b506102d97f04c68c9fff15bf997e5ceb309a37aa8077e41018445f90182d108811f0c988e381565b34801561065d57600080fd5b506102d961066c36600461341c565b60026020526000908152604090205481565b34801561068a57600080fd5b5061037f610699366004613435565b610ada565b3480156106aa57600080fd5b5061037f6106b9366004613457565b610c0e565b61037f6106cc3660046137d0565b610d55565b3480156106dd57600080fd5b506102d96106ec3660046138eb565b600560209081526000928352604080842090915290825290205481565b61037f610717366004613917565b610f1f565b34801561072857600080fd5b5061037f610737366004613327565b610fc6565b34801561074857600080fd5b5061037f6107573660046138eb565b611053565b34801561076857600080fd5b5061037f610777366004613327565b6111b2565b34801561078857600080fd5b506102d97ffb611fe2ee773273b2db591335adbd769558cf583a410ad6b83eb8860c37f0d781565b3480156107bc57600080fd5b5061030c6107cb366004613327565b6001600160a01b0316600090815260056020908152604080832060068352818420548452909152902054606081901c916bffffffffffffffffffffffff90911690565b610817816112bc565b50565b82811461083a57604051634fb5c99760e11b815260040160405180910390fd5b6108468484848461141a565b50505050565b6004546001600160a01b03166108a3610867338888886116d7565b84848080601f01602080910402602001604051908101604052809392919081815260200183838082843760009201919091525061179492505050565b6001600160a01b0316146108e3576040517f5cd5d23300000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b4284101561091d576040517f0819bdcd00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6001600160a01b03851660008181526005602090815260408083206006808452828520805480875292855292852054958552909252909161095d836139b0565b90915550506001600160a01b038616600081815260056020908152604080832060068352818420548452825291829020879055815184815290810187905233917f035e66676151f71cd262ff6e158221abccf86b65561c02a13a1c623fc3bac62a910160405180910390a3505050505050565b60005b81811015610a0f57610a078383838181106109f0576109f06139c9565b9050602002810190610a0291906139df565b6112bc565b6001016109d3565b505050565b610a1c611847565b610a2660006118a1565b565b33600090815260076020526040902054811015610a8b5733600090815260076020526040908190205490517fa731175a00000000000000000000000000000000000000000000000000000000815260048101919091526024015b60405180910390fd5b3360008181526007602052604090819020839055517f83a782ac7424737a1190d4668474e765f07d603de0485a081dbc343ac1b0209990610acf9084815260200190565b60405180910390a250565b6fffffffffffffffffffffffffffffffff1980610aff6000546001600160a01b031690565b6001600160a01b0316336001600160a01b03161480610b4e5750610b4e335b6001600160a01b031660009081526001602090815260408083208684528252808320858452909152902054421090565b610b7f5760405162461bcd60e51b8152602060048201526002602482015261503160f01b6044820152606401610a82565b83610bcc5760405162461bcd60e51b815260206004820152600260248201527f50330000000000000000000000000000000000000000000000000000000000006044820152606401610a82565b600084815260026020526040808220859055518491869133917fad26b90be8a18bd2262e914f6fd4919c42f9dd6a0d07a15fa728ec603a836a8891a450505050565b6000828152600260205260409020546fffffffffffffffffffffffffffffffff1990610c426000546001600160a01b031690565b6001600160a01b0316336001600160a01b03161480610c655750610c6533610b1e565b610c965760405162461bcd60e51b8152602060048201526002602482015261503160f01b6044820152606401610a82565b83610ce35760405162461bcd60e51b815260206004820152600260248201527f50320000000000000000000000000000000000000000000000000000000000006044820152606401610a82565b6001600160a01b03861660008181526001602090815260408083208984528252808320888452825291829020869055815188815290810186905286929133917f71b8ef6d2e182fa6ca30442059cc10398330b3e0561fd4ecc7232b62a8678cb6910160405180910390a4505050505050565b600260095403610da75760405162461bcd60e51b815260206004820152601f60248201527f5265656e7472616e637947756172643a207265656e7472616e742063616c6c006044820152606401610a82565b600260095584518314610dcd57604051634fb5c99760e11b815260040160405180910390fd5b6001600160a01b038616610df457604051634e46966960e11b815260040160405180910390fd5b60408051602080825281830190925260009160208201818036833701905050905060005b8651811015610ed5576002878281518110610e3557610e356139c9565b60200260200101516020015160e001516005811115610e5657610e56613a00565b60ff161115610e91576040517fbef31f6b00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b610ecd88888381518110610ea757610ea76139c9565b6020026020010151888885818110610ec157610ec16139c9565b905060600201856118fe565b600101610e18565b50610f0181337f0000000000000000000000002f0809aa3f09b19d5e8cd869108427032683e901611cda565b8115610f1157610f1183836109d0565b505060016009555050505050565b600260095403610f715760405162461bcd60e51b815260206004820152601f60248201527f5265656e7472616e637947756172643a207265656e7472616e742063616c6c006044820152606401610a82565b60026009556001600160a01b038616610f9d57604051634e46966960e11b815260040160405180910390fd5b610fa986868686611da4565b8015610fb957610fb982826109d0565b5050600160095550505050565b610fce611847565b6001600160a01b03811661104a5760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201527f64647265737300000000000000000000000000000000000000000000000000006064820152608401610a82565b610817816118a1565b6fffffffffffffffffffffffffffffffff197f04c68c9fff15bf997e5ceb309a37aa8077e41018445f90182d108811f0c988e36110986000546001600160a01b031690565b6001600160a01b0316336001600160a01b031614806110bb57506110bb33610b1e565b6110ec5760405162461bcd60e51b8152602060048201526002602482015261503160f01b6044820152606401610a82565b6001600160a01b03841661112c576040517fac2d994800000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b60038054606086811b6bffffffffffffffffffffffff191686019092556040805182841c81526001600160a01b03881660208201526bffffffffffffffffffffffff831691810191909152918201859052907f35b2f65059b366144550b1fea2ed721bed23642eb2b5ce699c8b2c4b401bb4289060800160405180910390a15050505050565b6fffffffffffffffffffffffffffffffff197fab7922d407ee68907f3012689fc312513191a8f302400319928e871c6d39f8ec6111f76000546001600160a01b031690565b6001600160a01b0316336001600160a01b0316148061121a575061121a33610b1e565b61124b5760405162461bcd60e51b8152602060048201526002602482015261503160f01b6044820152606401610a82565b6001600160a01b03831661128b576040517f9ccba9bd00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b50506004805473ffffffffffffffffffffffffffffffffffffffff19166001600160a01b0392909216919091179055565b60006112cf6112ca83613a16565b612182565b60008181526008602052604090205490915060ff16806112fe5750336000908152600760205260409020548235105b15611335576040517f5de2368f00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b3361134660c0840160a08501613327565b6001600160a01b03161461136d576040516324eef54b60e21b815260040160405180910390fd5b6000818152600860205260409020805460ff1916600117905561139660c0830160a08401613327565b6001600160a01b03167f38ecf63abfcfc50a9de80e94dead4932bad05b8fae4ac0a19428c2a7ce54419f826113d361014086016101208701613327565b6113e16101a0870187613a22565b6040516020016113f393929190613a92565b60408051601f198184030181529082905261140e9291613ab5565b60405180910390a25050565b6040517fc45527910000000000000000000000000000000000000000000000000000000081523360048201527f00000000000000000000000072939b9d6fe467d58d9b6cd35f35fa7de9383d01906000906001600160a01b0383169063c455279190602401602060405180830381865afa15801561149c573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906114c09190613ace565b90506001600160a01b0381163b6114ea5760405163ef5651af60e01b815260040160405180910390fd5b816001600160a01b03166397204d8e6040518163ffffffff1660e01b8152600401602060405180830381865afa158015611528573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061154c9190613ace565b6001600160a01b0316816001600160a01b0316635c60da1b6040518163ffffffff1660e01b8152600401602060405180830381865afa158015611593573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906115b79190613ace565b6001600160a01b0316146115de57604051630f5f164d60e01b815260040160405180910390fd5b8060005b868110156116cd57816001600160a01b03166317437c6d89898481811061160b5761160b6139c9565b90506020020160208101906116209190613327565b6000898986818110611634576116346139c9565b90506020028101906116469190613a22565b6040518563ffffffff1660e01b81526004016116659493929190613b08565b6020604051808303816000875af1158015611684573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906116a89190613b44565b6116c5576040516302d5aa5d60e31b815260040160405180910390fd5b6001016115e2565b5050505050505050565b60006116e16121d1565b604080517ffb611fe2ee773273b2db591335adbd769558cf583a410ad6b83eb8860c37f0d760208201526001600160a01b038089169282019290925290861660608201526080810185905260a0810184905260c0016040516020818303038152906040528051906020012060405160200161177392919061190160f01b81526002810192909252602282015260420190565b6040516020818303038152906040528051906020012090505b949350505050565b600081516041146117d1576040517f4be6321b00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b602082810151604080850151606080870151835160008082529681018086528a9052951a928501839052840183905260808401819052919260019060a0016020604051602081039080840390855afa158015611831573d6000803e3d6000fd5b5050506020604051035193505050505b92915050565b6000546001600160a01b03163314610a265760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e65726044820152606401610a82565b600080546001600160a01b0383811673ffffffffffffffffffffffffffffffffffffffff19831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b600061190984612182565b905061191585856122f5565b61194d576119478585837f1100000000000000000000000000000000000000000000000000000000000000600061253e565b50610846565b611965818560200151608001518660000151866125d4565b611997576119478585837f1200000000000000000000000000000000000000000000000000000000000000600061253e565b6020840151608001516040517fb47e4f810000000000000000000000000000000000000000000000000000000081526001600160a01b0391821660048201527f00000000000000000000000072939b9d6fe467d58d9b6cd35f35fa7de9383d0191600091829184169063b47e4f81906024016040805180830381865afa158015611a25573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611a499190613b66565b91509150611a60826001600160a01b03163b151590565b611a9b57611a928888867f4300000000000000000000000000000000000000000000000000000000000000600061253e565b50505050610846565b806001600160a01b0316826001600160a01b0316635c60da1b6040518163ffffffff1660e01b8152600401602060405180830381865afa158015611ae3573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611b079190613ace565b6001600160a01b031614611b4357611a928888867f4400000000000000000000000000000000000000000000000000000000000000600061253e565b81611b50888a60006126e4565b506020880151610100015160608901516040516317437c6d60e01b81526001600160a01b038416926317437c6d92611b8e9260009190600401613ba0565b6020604051808303816000875af1158015611bad573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611bd19190613b44565b611c0d57611c038989877f5000000000000000000000000000000000000000000000000000000000000000600061253e565b5050505050610846565b505050506000611c3b856020015160e001518660200151600001518760400151886020015160200151612758565b9050611c8c83866020015161014001518760400151600081518110611c6257611c626139c9565b60200260200101518860200151608001516001600160a01b0316858a602001516101000151612875565b6000828152600860205260409020805460ff19166001179055611cd28686847fff000000000000000000000000000000000000000000000000000000000000008561253e565b505050505050565b825163368fa33960e21b9060009060609004815b81811015611d765760608181028801602081015160408201519190920151828015611d4e576040518881528460048201528a602482015283604482015282606482015260008060848360008e5af1905080611d4857600080fd5b50611d67565b95810195600080808085875af180611d6557600080fd5b505b50505050600181019050611cee565b505080341115611d9d57611d9d611d8d8234613bd1565b6001600160a01b0386169061292d565b5050505050565b6000611daf84612182565b9050611dbb85856122f5565b611df1576040517faf61069300000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b611e09818560200151608001518660000151866125d4565b611e26576040516324eef54b60e21b815260040160405180910390fd5b7f00000000000000000000000072939b9d6fe467d58d9b6cd35f35fa7de9383d016000806001600160a01b03831663b47e4f8182896020015160a001516001811115611e7457611e74613a00565b14611e8757886020015160800151611e89565b335b6040516001600160e01b031960e084901b1681526001600160a01b0390911660048201526024016040805180830381865afa158015611ecc573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611ef09190613b66565b91509150611f07826001600160a01b03163b151590565b611f245760405163ef5651af60e01b815260040160405180910390fd5b806001600160a01b0316826001600160a01b0316635c60da1b6040518163ffffffff1660e01b8152600401602060405180830381865afa158015611f6c573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611f909190613ace565b6001600160a01b031614611fb757604051630f5f164d60e01b815260040160405180910390fd5b81611fc3888a886126e4565b506020880151610100015160608901516040516317437c6d60e01b81526001600160a01b038416926317437c6d926120019260009190600401613ba0565b6020604051808303816000875af1158015612020573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906120449190613b44565b612061576040516302d5aa5d60e31b815260040160405180910390fd5b600061208b898a6040015160008151811061207e5761207e6139c9565b60200260200101516129ba565b9050803411156120a9576120a96120a28234613bd1565b339061292d565b6000868152600860209081526040808320805460ff191660011790558b82015160e0810151610100919091015160608e0151925161210f949293879390917fff000000000000000000000000000000000000000000000000000000000000009101613be8565b60405160208183030381529060405290508a6001600160a01b03168a60200151608001516001600160a01b03167fa6b12b6984bda6bd875df5a33eaeb64d6d12857b59a7d120bf9444b1bf7796a1898460405161216d929190613ab5565b60405180910390a35050505050505050505050565b600061218c6121d1565b61219583612dee565b60405161190160f01b6020820152602281019290925260428201526062015b604051602081830303815290604052805190602001209050919050565b6000467f000000000000000000000000000000000000000000000000000000000000000181146122cd57604080518082018252600881526711da59d853585c9d60c21b6020918201528151808301835260018152603160f81b9082015281517f8b73c3c69bb8fe3d512ecc4cf759cc79239f7b179b0ffacaa9a75d522b39400f818301527f4380187604bc8a9be1c23a0e8e57396caafc33bae31e91760cb6785d7c9ee657818401527fc89efdaa54c0f20c7adf612882df0950f5a951637e0307cdcb4c672f298b8bc66060820152608081018490523060a0808301919091528351808303909101815260c090910190925281519101206122ef565b7f3588e4754328d51f25b5ad1b6d1348a7737c9c8fcdf66e995539265e0338c1295b91505090565b6020810151606001516000906001600160a01b0316301461231857506000611841565b826001600160a01b03168260200151608001516001600160a01b0316148061235057506020820151608001516001600160a01b031633145b8061236a57506020820151608001516001600160a01b0316155b1561237757506000611841565b61239d600d83602001516020015161238f9190613bd1565b836020015160400151612e86565b6123a957506000611841565b6123b282612ea5565b6123be57506000611841565b6000826020015160e0015160058111156123da576123da613a00565b905060058160ff1611156123f2576000915050611841565b60038160ff1610801561241e57506000836020015160a00151600181111561241c5761241c613a00565b145b1561242d576000915050611841565b60028160ff1611801561245957506001836020015160a00151600181111561245757612457613a00565b145b15612468576000915050611841565b8060ff1660021480156124955750826020015160c001516001600160a01b0316846001600160a01b031614155b156124a4576000915050611841565b8060ff1660031480156124ec5750602083015160c001516001600160a01b0316331415806124ec5750826020015160c001516001600160a01b0316846001600160a01b031614155b156124fb576000915050611841565b8060ff166004148061251057508060ff166005145b801561252557506001600160a01b0384163314155b15612534576000915050611841565b5060019392505050565b846001600160a01b03168460200151608001516001600160a01b03167fa6b12b6984bda6bd875df5a33eaeb64d6d12857b59a7d120bf9444b1bf7796a185876020015160e0015185896020015161010001518a60600151896040516020016125aa959493929190613be8565b60408051601f19818403018152908290526125c59291613ab5565b60405180910390a35050505050565b60008481526008602052604081205460ff16156125f35750600061178c565b6001600160a01b03841660009081526007602052604090205483101561261b5750600061178c565b6001600160a01b0384166001866126356020860186613c80565b604080516000815260208181018084529490945260ff9092168282015291860135606082015290850135608082015260a0016020604051602081039080840390855afa158015612689573d6000803e3d6000fd5b505050602060405103516001600160a01b0316036126a95750600161178c565b6001600160a01b0384163b156126d9576126d284866126cd36869003860186613c9b565b612f1b565b905061178c565b506000949350505050565b6060830151602084015160e00151600090600581111561270657612706613a00565b905080801561272c576001811461272c576004811461273757600581146127425761274f565b84604484015261274f565b84602484015261274f565b8460248401528360648401525b50509392505050565b6000600185600581111561276e5761276e613a00565b0361286e5782600281518110612786576127866139c9565b602002602001015142106127b657826001815181106127a7576127a76139c9565b6020026020010151905061178c565b600082846002815181106127cc576127cc6139c9565b60200260200101516127de9190613bd1565b42856002815181106127f2576127f26139c9565b60200260200101516128049190613bd1565b85600181518110612817576128176139c9565b60200260200101518761282a9190613bd1565b6128349190613cfc565b61283e9190613d1b565b90508084600181518110612854576128546139c9565b60200260200101516128669190613d3d565b91505061178c565b508261178c565b60035482906bffffffffffffffffffffffff8116156128bb57606081901c906127106bffffffffffffffffffffffff9091168502046128b689898484613063565b909103905b506001600160a01b03821660009081526005602090815260408083208884529091529020546bffffffffffffffffffffffff81161561292157606081901c906127106bffffffffffffffffffffffff90911685020461291c89898484613063565b909103905b6116cd88888785613063565b6000826001600160a01b03168260405160006040518083038185875af1925050503d806000811461297a576040519150601f19603f3d011682016040523d82523d6000602084013e61297f565b606091505b5050905080610a0f576040517f90b8ec1800000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6000808080856020015160a0015160018111156129d9576129d9613a00565b146129ed57846020015160800151336129f8565b338560200151608001515b915091506000612a26866020015160e001518760200151600001518860400151896020015160200151612758565b90508015612de5576020860151610140015181906001600160a01b031615612cb4576003547f0000000000000000000000002f0809aa3f09b19d5e8cd869108427032683e901906bffffffffffffffffffffffff811615612b39576000612710612a9e6bffffffffffffffffffffffff841687613cfc565b612aa89190613d1b565b60208b0151610140015160405163368fa33960e21b81526001600160a01b0391821660048201528882166024820152606085901c60448201526064810183905291925084169063da3e8ce490608401600060405180830381600087803b158015612b1157600080fd5b505af1158015612b25573d6000803e3d6000fd5b505050508084612b359190613bd1565b9350505b5060208089015161010001516001600160a01b031660009081526005825260408082208a835290925220546bffffffffffffffffffffffff811615612c30576000612710612b956bffffffffffffffffffffffff841687613cfc565b612b9f9190613d1b565b60208b0151610140015160405163368fa33960e21b81526001600160a01b0391821660048201528882166024820152606085901c60448201526064810183905291925084169063da3e8ce490608401600060405180830381600087803b158015612c0857600080fd5b505af1158015612c1c573d6000803e3d6000fd5b505050508084612c2c9190613bd1565b9350505b6020890151610140015160405163368fa33960e21b81526001600160a01b03918216600482015286821660248201528782166044820152606481018590529083169063da3e8ce490608401600060405180830381600087803b158015612c9557600080fd5b505af1158015612ca9573d6000803e3d6000fd5b505050505050612de3565b81341015612cee576040517fdb6b1b5100000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6003546bffffffffffffffffffffffff811615612d4a576000612710612d226bffffffffffffffffffffffff841686613cfc565b612d2c9190613d1b565b9050612d3c606083901c8261292d565b612d468184613bd1565b9250505b5060208088015161010001516001600160a01b0316600090815260058252604080822089835290925220546bffffffffffffffffffffffff811615612dce576000612710612da66bffffffffffffffffffffffff841686613cfc565b612db09190613d1b565b9050612dc0606083901c8261292d565b612dca8184613bd1565b9250505b612de16001600160a01b0386168361292d565b505b505b95945050505050565b60007f0e656a6eeac05e2084d8a58f31a0332ef43725f42b802158a2c45e969c8bb5438260000151612e2384602001516130f6565b8460400151604051602001612e389190613d55565b60408051601f1981840301815282825280516020918201206060808a0151805190840120928501979097529183019490945293810191909152608081019290925260a082015260c0016121b4565b60004283108015612e9e5750811580612e9e57508142105b9392505050565b60608101516020810151600091906001600160e01b031981167ff242432a00000000000000000000000000000000000000000000000000000000148061178c57506001600160e01b031981167f23b872dd0000000000000000000000000000000000000000000000000000000014949350505050565b6000807f1626ba7e356f5979dd355a3d2bfb43e80420a480c3b854edce286a82d749686984846020015185604001518660000151604051602001612f9793929190928352602083019190915260f81b7fff0000000000000000000000000000000000000000000000000000000000000016604082015260410190565b60408051601f1981840301815290829052612fb59291602401613ab5565b60408051601f198184030181529190526020810180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff166001600160e01b0319909316929092178252805190925060009182918291895afa80613019573d6000803e3d6000fd5b5060203d0361302d5760206000803e506000515b6001600160e01b0319167f1626ba7e00000000000000000000000000000000000000000000000000000000149150509392505050565b8351606090046000805b828110156130b357602060608202018701518681036130aa576060828102890160408101519101908781036130a757815187018252600194505b50505b5060010161306d565b5080611cd2578180156130cc57865160600187526130d4565b865160400187525b5060608202860185602082015284604082015283606082015250505050505050565b60007f2fc9a689ed11fb3dff9fe9eda483b4883c00dd54c45b1567a6823ef25fa04046826000015183602001518460400151856060015186608001518760a001518860c001518960e001518a61010001518b61012001518c61014001516040516020016121b49c9b9a99989796959493929190613d8b565b60005b83811015613189578181015183820152602001613171565b838111156108465750506000910152565b600081518084526131b281602086016020860161316e565b601f01601f19169290920160200192915050565b602081526000612e9e602083018461319a565b6000602082840312156131eb57600080fd5b813567ffffffffffffffff81111561320257600080fd5b82016101c08185031215612e9e57600080fd5b60008083601f84011261322757600080fd5b50813567ffffffffffffffff81111561323f57600080fd5b6020830191508360208260051b850101111561325a57600080fd5b9250929050565b6000806000806040858703121561327757600080fd5b843567ffffffffffffffff8082111561328f57600080fd5b61329b88838901613215565b909650945060208701359150808211156132b457600080fd5b506132c187828801613215565b95989497509550505050565b6001600160a01b038116811461081757600080fd5b80356132ed816132cd565b919050565b60008060006060848603121561330757600080fd5b8335613312816132cd565b95602085013595506040909401359392505050565b60006020828403121561333957600080fd5b8135612e9e816132cd565b60008060008060006080868803121561335c57600080fd5b8535613367816132cd565b94506020860135935060408601359250606086013567ffffffffffffffff8082111561339257600080fd5b818801915088601f8301126133a657600080fd5b8135818111156133b557600080fd5b8960208285010111156133c757600080fd5b9699959850939650602001949392505050565b600080602083850312156133ed57600080fd5b823567ffffffffffffffff81111561340457600080fd5b61341085828601613215565b90969095509350505050565b60006020828403121561342e57600080fd5b5035919050565b6000806040838503121561344857600080fd5b50508035926020909101359150565b6000806000806080858703121561346d57600080fd5b8435613478816132cd565b966020860135965060408601359560600135945092505050565b634e487b7160e01b600052604160045260246000fd5b6040516080810167ffffffffffffffff811182821017156134cb576134cb613492565b60405290565b604051610160810167ffffffffffffffff811182821017156134cb576134cb613492565b604051601f8201601f1916810167ffffffffffffffff8111828210171561351e5761351e613492565b604052919050565b600067ffffffffffffffff82111561354057613540613492565b5060051b60200190565b8035600281106132ed57600080fd5b8035600681106132ed57600080fd5b600082601f83011261357957600080fd5b8135602061358e61358983613526565b6134f5565b82815260059290921b840181019181810190868411156135ad57600080fd5b8286015b848110156135c857803583529183019183016135b1565b509695505050505050565b600082601f8301126135e457600080fd5b813567ffffffffffffffff8111156135fe576135fe613492565b613611601f8201601f19166020016134f5565b81815284602083860101111561362657600080fd5b816020850160208301376000918101602001919091529392505050565b60008183036101c081121561365757600080fd5b61365f6134a8565b91508235825261016080601f198301121561367957600080fd5b6136816134d1565b91506020840135825260408401356020830152606084013560408301526136aa608085016132e2565b60608301526136bb60a085016132e2565b60808301526136cc60c0850161354a565b60a08301526136dd60e085016132e2565b60c08301526101006136f0818601613559565b60e08401526101206137038187016132e2565b82850152610140915061371782870161354a565b908401526137268583016132e2565b9083015250602082015261018082013567ffffffffffffffff8082111561374c57600080fd5b61375885838601613568565b60408401526101a084013591508082111561377257600080fd5b5061377f848285016135d3565b60608301525092915050565b60008083601f84011261379d57600080fd5b50813567ffffffffffffffff8111156137b557600080fd5b60208301915083602060608302850101111561325a57600080fd5b600080600080600080608087890312156137e957600080fd5b6137f387356132cd565b8635955060208088013567ffffffffffffffff8082111561381357600080fd5b818a0191508a601f83011261382757600080fd5b813561383561358982613526565b81815260059190911b8301840190848101908d83111561385457600080fd5b8585015b8381101561388a57848135111561386e57600080fd5b61387d8f888335890101613643565b8352918601918601613858565b509950505060408a01359250808311156138a357600080fd5b6138af8b848c0161378b565b909750955060608a01359250869150808311156138cb57600080fd5b50506138d989828a01613215565b979a9699509497509295939492505050565b600080604083850312156138fe57600080fd5b8235613909816132cd565b946020939093013593505050565b60008060008060008086880360e081121561393157600080fd5b873561393c816132cd565b9650602088013567ffffffffffffffff8082111561395957600080fd5b6139658b838c01613643565b97506060603f198401121561397957600080fd5b60408a01965060a08a0135955060c08a01359250808311156138cb57600080fd5b634e487b7160e01b600052601160045260246000fd5b6000600182016139c2576139c261399a565b5060010190565b634e487b7160e01b600052603260045260246000fd5b600082356101be198336030181126139f657600080fd5b9190910192915050565b634e487b7160e01b600052602160045260246000fd5b60006118413683613643565b6000808335601e19843603018112613a3957600080fd5b83018035915067ffffffffffffffff821115613a5457600080fd5b60200191503681900382131561325a57600080fd5b81835281816020850137506000828201602090810191909152601f909101601f19169091010190565b6001600160a01b0384168152604060208201526000612de5604083018486613a69565b82815260406020820152600061178c604083018461319a565b600060208284031215613ae057600080fd5b8151612e9e816132cd565b6002811061081757610817613a00565b613b0481613aeb565b9052565b6001600160a01b0385168152613b1d84613aeb565b836020820152606060408201526000613b3a606083018486613a69565b9695505050505050565b600060208284031215613b5657600080fd5b81518015158114612e9e57600080fd5b60008060408385031215613b7957600080fd5b8251613b84816132cd565b6020840151909250613b95816132cd565b809150509250929050565b6001600160a01b0384168152613bb583613aeb565b826020820152606060408201526000612de5606083018461319a565b600082821015613be357613be361399a565b500390565b600060068710613bfa57613bfa613a00565b8660f81b82528560018301526bffffffffffffffffffffffff198560601b1660218301528351613c3181603585016020880161316e565b80830190507fff0000000000000000000000000000000000000000000000000000000000000084166035820152603681019150509695505050505050565b803560ff811681146132ed57600080fd5b600060208284031215613c9257600080fd5b612e9e82613c6f565b600060608284031215613cad57600080fd5b6040516060810181811067ffffffffffffffff82111715613cd057613cd0613492565b604052613cdc83613c6f565b815260208301356020820152604083013560408201528091505092915050565b6000816000190483118215151615613d1657613d1661399a565b500290565b600082613d3857634e487b7160e01b600052601260045260246000fd5b500490565b60008219821115613d5057613d5061399a565b500190565b815160009082906020808601845b83811015613d7f57815185529382019390820190600101613d63565b50929695505050505050565b6000610180820190508d82528c60208301528b60408301528a60608301526001600160a01b03808b166080840152808a1660a0840152613dca89613aeb565b60c08301899052871660e083015260068610613de857613de8613a00565b85610100830152613e056101208301866001600160a01b03169052565b613e13610140830185613afb565b6001600160a01b0383166101608301529d9c5050505050505050505050505056fea26469706673582212209067682706a7df00bf9823326704d1d77cb713863e192bd2f1b177702ce72a6264736f6c634300080f0033

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

00000000000000000000000072939b9d6fe467d58d9b6cd35f35fa7de9383d010000000000000000000000002f0809aa3f09b19d5e8cd869108427032683e901000000000000000000000000a0f5b64ef8a1665243c5e54660277d9a62e58d0d0000000000000000000000006969b5d5bd910aaaf2b153fc3e2231b81d5d928a0000000000000000000000000000000000000000000000000000000000000000

-----Decoded View---------------
Arg [0] : _registry (address): 0x72939b9d6fe467d58D9b6cd35F35FA7DE9383D01
Arg [1] : _tokenTransferProxy (address): 0x2f0809Aa3f09b19d5e8CD869108427032683e901
Arg [2] : _validator (address): 0xa0f5b64eF8a1665243C5E54660277D9a62e58D0d
Arg [3] : _protocolFeeRecipient (address): 0x6969b5D5bd910AAAF2b153fC3e2231B81d5D928a
Arg [4] : _protocolFeePercent (uint96): 0

-----Encoded View---------------
5 Constructor Arguments found :
Arg [0] : 00000000000000000000000072939b9d6fe467d58d9b6cd35f35fa7de9383d01
Arg [1] : 0000000000000000000000002f0809aa3f09b19d5e8cd869108427032683e901
Arg [2] : 000000000000000000000000a0f5b64ef8a1665243c5e54660277d9a62e58d0d
Arg [3] : 0000000000000000000000006969b5d5bd910aaaf2b153fc3e2231b81d5d928a
Arg [4] : 0000000000000000000000000000000000000000000000000000000000000000


Block Transaction Difficulty Gas Used Reward
View All Blocks Produced

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

Validator Index Block Amount
View All Withdrawals

Transaction Hash Block Value Eth2 PubKey Valid
View All Deposits
Loading...
Loading
[ Download: CSV Export  ]
[ 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.