ETH Price: $2,634.01 (+0.83%)

Contract

0x6e1B3e68EE6fc68939ABE89829831DeAa1843DC2
 

Overview

ETH Balance

0 ETH

Eth Value

$0.00

Multichain Info

No addresses found
Transaction Hash
Method
Block
From
To
Purchase164967192023-01-27 7:40:35630 days ago1674805235IN
0x6e1B3e68...Aa1843DC2
0 ETH0.0085609515.00897524
Purchase164829102023-01-25 9:22:23632 days ago1674638543IN
0x6e1B3e68...Aa1843DC2
1 wei0.0039536114.41488567
0x60a06040161872972022-12-15 3:05:11673 days ago1671073511IN
 Create: GigaAggregator
0 ETH0.0294964513.38191857

Latest 4 internal transactions

Advanced mode:
Parent Transaction Hash Block From To
164967192023-01-27 7:40:35630 days ago1674805235
0x6e1B3e68...Aa1843DC2
1 wei
164967192023-01-27 7:40:35630 days ago1674805235
0x6e1B3e68...Aa1843DC2
0 ETH
164967192023-01-27 7:40:35630 days ago1674805235
0x6e1B3e68...Aa1843DC2
0 ETH
164829102023-01-25 9:22:23632 days ago1674638543
0x6e1B3e68...Aa1843DC2
1 wei
Loading...
Loading

Contract Source Code Verified (Exact Match)

Contract Name:
GigaAggregator

Compiler Version
v0.8.15+commit.e14f2714

Optimization Enabled:
Yes with 1337 runs

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

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

import {
	Configuration,
	EscapeHatch,
	IERC20,
	SafeERC20
} from "./lib/Configuration.sol";
import {
	TokenTransferProxy
} from "../marketplace/proxy/TokenTransferProxy.sol";
import {
	NativeTransfer
} from "./../marketplace/libraries/NativeTransfer.sol";

/**
	Thrown if an Ether payment to the aggregator does not match the provided 
	message value.

	@param paymentAmount The payment amount to match with the message value.
	@param messageValue The message value to match.
*/
error ExpectedValueDiffers (
	uint256 paymentAmount,
	uint256 messageValue
);

/// Thrown if purchases in the aggregator are paused.
error Paused ();

/**
	@custom:benediction DEVS BENEDICAT ET PROTEGAT CONTRACTVS MEAM
	@title GigaMart Aggregator
	@author Rostislav Khlebnikov <@catpic5buck>
	@custom:contributor Tim Clancy <@_Enoch>
	
	This contract implements a multi-market aggregator for GigaMart.

	@custom:version 1.1
	@custom:date December 14th, 2022.
*/
contract GigaAggregator is Configuration, ReentrancyGuard {
	using SafeERC20 for IERC20;
	using NativeTransfer for address;

	/// A name used for this contract.
	string public constant name = "GigaAggregator v1.1";

	/// Track the slot for a supported exchange.
	uint256 private constant SUPPORTED_EXCHANGES_SLOT = 4;

	/**
		A convenience struct to contain information regarding total payment amounts 
		accross all orders.

		@param asset The address of a payment token.
		@param amount The amount of asset being paid.
	*/
	struct Payment {
		address asset;
		uint256 amount;
	}

	/// Store an immutable reference to a token transfer proxy.
	TokenTransferProxy public immutable TOKEN_TRANSFER_PROXY;

	/**
		Construct a new GigaMart aggregator.

		@param _exchanges An array of exchange addresses to mark as supported.
		@param _tokens An array of payment tokens to approve to `_transferProxies`.
		@param _transferProxies An array of addresses to set approval for on behalf 
			of this contract.
		@param _tokenTransferProxy The address of a token transfer proxy.
		@param _governance The address of a caller which has rights to manage 
			payment tokens.
		@param _rescuer An address that can pause or unpause the contract and 
			rescue assets.
	*/
	constructor(
		address[] memory _exchanges,
		address[] memory _tokens,
		address[] memory _transferProxies,
		TokenTransferProxy _tokenTransferProxy,
		address _governance,
		address _rescuer
	) Configuration(
		_exchanges,
		_tokens,
		_transferProxies,
		_governance,
		_rescuer
	) {
		TOKEN_TRANSFER_PROXY = _tokenTransferProxy;
	}

	/// Add a payable receive function so that the aggregator can receive Ether.
	receive () external payable { }

	/**
		Reads balances of this contract on payment assets.

		@param _payments An array containing information about token addresses and 
			the total token amounts needed to purchase all orders in the cart.
		@param _balances An array for accumulating the balance of this contract for 
			each asset.
	*/
	function _readBalances (
		Payment[] calldata _payments,
		uint256[] memory _balances
	) private view {
		for (uint256 i; i < _payments.length; ) {

			/*
				Determine the balance of this aggregator contract in either Ether or 
				ERC-20 token, depending on the payment asset.
			*/
			_balances[i] = _payments[i].asset == address(0)
				? address(this).balance - msg.value
				: IERC20(_payments[i].asset).balanceOf(address(this));
			unchecked {
				++i;
			}
		}
	}

	/**
		This function transfers ERC-20 tokens to this aggregator contract which 
		later will be used for executing purchases from cart. The function also 
		verifies native payment.

		@param _payments An array containing information about token addresses and 
			the total token amounts needed to purchase all orders in the cart.

		@custom:throws ExpectedValueDiffers if the message value does not match a 
			provided Ether payment amount.
	*/
	function _gatherPayments (
		Payment[] calldata _payments
	) private {
		for (uint256 i; i < _payments.length; ) {

			// Revert if there is a mismatched Ether balance.
			bool native = _payments[i].asset == address(0);
			if (native && _payments[i].amount != msg.value) {
				revert ExpectedValueDiffers(_payments[i].amount, msg.value);
			}

			// Transfer ERC-20 tokens.
			if (!native) {
				TOKEN_TRANSFER_PROXY.transferERC20(
					_payments[i].asset,
					msg.sender,
					address(this),
					_payments[i].amount
				);	
			}
			unchecked {
				++i;
			}
		}
	}

	/**
		Parse the cart and call targeted exchanges.

		@param _cart The cart to fulfill item purchase calls from.
	*/
	function _buy (
		bytes calldata _cart
	) private {

		// An offset to the start of the cart full of calls.
		uint256 offset = 0x64;
		while (offset < _cart.length) {
			assembly {

				// Retrieve the length of this call.
				let length := calldataload(add(offset, 0x20))

				// Retrieve the exchange for fulfilling purchase of this call.
				let exchange := calldataload(offset)
				
				// Store the exchange and a mapping slot into memory.
				mstore(0x00, exchange)
				mstore(0x20, SUPPORTED_EXCHANGES_SLOT)

				/*
					Hash the exchange and its storage slot, then load the resulting 
					address of the storage slot into memory. If the exchange is 
					supported, continue.
				*/
				if sload(keccak256(0x00, 0x40)) {
					
					// Load the free memory pointer.
					let ptr := mload(0x40)

					// Copy the call into memory.
					calldatacopy(ptr, add(offset, 0x60), length)

					// Pop the result of the call from the stack, ignoring it.
					pop(
						
						// Perform the call from the cart.
						call(
							gas(),
							exchange,
							calldataload(add(offset, 0x40)),
							ptr,
							length,
							0,
							0
						)
					)
				}

				// Iterate to the next call in the cart.
				offset := add(offset, add(length, 0x60))
			}
		}
	}

	/**
		Return unused payment assets back to the message sender.

		@param _payments An array containing information about token addresses and 
			the total token amounts needed to purchase all orders in the cart.
		@param _balances An array containing the balances of payment assets in this 
			contract.
	*/
	function _returnLeftovers (
		Payment[] calldata _payments,
		uint256[] memory _balances
	) private {
		uint256 current;
		for (uint256 i; i < _balances.length; ) {
			unchecked {

				// Attempt to return Ether.
				if (_payments[i].asset == address(0)) {
					current = address(this).balance;
					if (current > _balances[i]) {
						msg.sender.transferEth(current - _balances[i]);
					}

				// Otherwise, attempt to return an ERC-20 token.
				} else {
					current = IERC20(_payments[i].asset).balanceOf(
						address(this)
					);
					if (current > _balances[i]) {
						IERC20(_payments[i].asset).safeTransfer(
							msg.sender,
							current - _balances[i]
						);
					}
				}
				++i;
			}
		}
	}

	/**
		Parse the incoming cart, verify payments status, gracefuly execute orders, 
		and return payments for failed orders.

		@param _cart A bytes array containing encoded calls to exchanges with the 
			exchange, call length, and Ether value as a prefix to each call. For 
			example:
			cart = encode(
				exchange, length, value, call,
				...
				exchange(n), length(n), value(n), call(n)
			)
			... where n is an index of a call.

		@param _payments An array containing information about token addresses and 
			the total token amounts needed to purchase all orders in the cart.

		@custom:throws Paused if purchases on the aggregator have been paused.
	*/
	function purchase (
		bytes calldata _cart,
		Payment[] calldata _payments
	) external payable nonReentrant {
		if (_status == EscapeHatch.Status.Paused) {
			revert Paused();
		}

		// Accumulate the balance of this contract for each payment asset.
		uint256[] memory balances = new uint256[](_payments.length);
		_readBalances(_payments, balances);
		
		// Gather payment assets to the aggregator.
		_gatherPayments(_payments);

		// Perform the asset purchase.
		_buy(_cart);

		// Return leftover balances.
		_returnLeftovers(_payments, balances);
	}
}

File 2 of 17 : 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 17 : Configuration.sol
// SPDX-License-Identifier: AGPL-3.0-only
pragma solidity ^0.8.15;

import {
	EscapeHatch,
	IERC20,
	SafeERC20
} from "./EscapeHatch.sol";

/**
	@custom:benediction DEVS BENEDICAT ET PROTEGAT CONTRACTVS MEAM
	@title GigaMart Aggregator Configuration
	@author Rostislav Khlebnikov <@catpic5buck>
	@custom:contributor Tim Clancy <@_Enoch>
	
	This contract contains configuration controls for the GigaMart aggregator.

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

	/// The identifier for the right to adjust the aggregator configuration.
	bytes32 private constant AGGREGATOR_CONFIG = keccak256("AGGREGATOR_CONFIG");

	/// A mapping to track flags for supported exchange addresses.
	mapping ( address => bool ) public supportedExchanges;

	/**
		Construct an instance of the GigaMart aggregator configuration.

		@param _exchanges An array of exchange addresses to mark as supported.
		@param _tokens An array of payment tokens to approve to `_transferProxies`.
		@param _transferProxies An array of addresses to set approval for on behalf 
			of this contract.
		@param _governance The address of a caller which has rights to manage 
			payment tokens.
		@param _rescuer An address that can pause or unpause the contract and 
			rescue assets.
	*/
	constructor (
		address[] memory _exchanges,
		address[] memory _tokens,
		address[] memory _transferProxies,
		address _governance,
		address _rescuer
	) EscapeHatch(_rescuer) {

		// Immediately flag any provided exchanges as supported.
		for (uint256 i; i < _exchanges.length; ) {
			supportedExchanges[_exchanges[i]] = true;
			unchecked {
				++i;
			}
		}

		// Approve any provided tokens for use on the exchanges.
		for (uint256 j; j < _transferProxies.length; ) {
			for (uint256 k; k < _tokens.length; ) {
				IERC20(_tokens[k]).approve(
					_transferProxies[j],
					type(uint256).max
				);
				unchecked {
					++k;
				}
			}
			unchecked {
				++j;
			}
		}

		// Set the permit of the aggregator configurator.
		setPermit(_governance, UNIVERSAL, AGGREGATOR_CONFIG, type(uint256).max);
	}

	/**
		Set approval on the given array `_tokens` of payment tokens to each 
		transfer proxy in `_transferProxies`.

		@param _tokens An array of payment tokens to approve `transferProxies` to 
			spend.
		@param _transferProxies An array of addresses to set approvals for on 
			behalf of this contract.
	*/
	function addPaymentTokens (
		address[] calldata _tokens,
		address[] calldata _transferProxies
	) external hasValidPermit(UNIVERSAL, AGGREGATOR_CONFIG) {
		for (uint256 i; i < _transferProxies.length; ) {
			for (uint256 j; j < _tokens.length; ) {

				// Approve each token on each proxy.
				IERC20(_tokens[j]).approve(
					_transferProxies[i],
					type(uint256).max
				);
				unchecked {
					++j;
				}
			}
			unchecked {
				++i;
			}
		}
	}

	/**
		Revoke approval on the given array `_tokens` of payment tokens from each 
		transfer proxy in `_transferProxies`.

		@param _tokens An array of payment tokens to revoke approval of 
			`transferProxies` to spend.
		@param _transferProxies An array of addresses to revoke approvals from on 
			behalf of this contract.
	*/
	function removePaymentTokens (
		address[] calldata _tokens,
		address[] calldata _transferProxies
	) external hasValidPermit(UNIVERSAL, AGGREGATOR_CONFIG) {
		for (uint256 i; i < _transferProxies.length; ) {
			for (uint256 j; j < _tokens.length; ) {

				// Revoke approval for each token on each proxy.
				IERC20(_tokens[j]).approve(_transferProxies[i], 0);
				unchecked {
					++j;
				}
			}
			unchecked {
				++i;
			}
		}
	}

	/**
		Include `_exchange` for order aggregation.

		@param _exchange The address of an exchange to authorize as a supported 
			target.
	*/
	function addExchange (
		address _exchange
	) external hasValidPermit(UNIVERSAL, AGGREGATOR_CONFIG) {
		supportedExchanges[_exchange] = true;
	}

	/**
		Exclude `_exchange` from order aggregation.

		@param _exchange The address of an exchange to invalidate as a supported 
			target.
	*/
	function removeExchange (
		address _exchange
	) external hasValidPermit(UNIVERSAL, AGGREGATOR_CONFIG) {
		supportedExchanges[_exchange] = false;
	}
}

File 4 of 17 : 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 5 of 17 : 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 6 of 17 : EscapeHatch.sol
// SPDX-License-Identifier: AGPL-3.0-only
pragma solidity ^0.8.15;

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

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

/**
	Thrown in the event that attempting to rescue an asset from the contract 
	fails.

	@param index The index of the asset whose rescue failed.
*/
error RescueFailed (uint256 index);

/**
	@custom:benediction DEVS BENEDICAT ET PROTEGAT CONTRACTVS MEAM
	@title Escape Hatch
	@author Rostislav Khlebnikov <@catpic5buck>
	@custom:contributor Tim Clancy <@_Enoch>
	
	This contract contains logic for pausing contract operations during updates 
	and a backup mechanism for user assets restoration.

	@custom:date December 4th, 2022.
*/
abstract contract EscapeHatch is PermitControl {
	using SafeERC20 for IERC20;

	/// The public identifier for the right to rescue assets.
	bytes32 internal constant ASSET_RESCUER = keccak256("ASSET_RESCUER");

	/**
		An enum type representing the status of the contract being escaped.

		@param None A default value used to avoid setting storage unnecessarily.
		@param Unpaused The contract is unpaused.
		@param Paused The contract is paused.
	*/
	enum Status {
		None,
		Unpaused,
		Paused
	}

	/**
		An enum type representing the type of asset this contract may be dealing 
		with.

		@param Native The type for Ether.
		@param ERC20 The type for an ERC-20 token.
		@param ERC721 The type for an ERC-721 token.
		@param ERC1155 The type for an ERC-1155 token.
	*/
	enum AssetType {
		Native,
		ERC20,
		ERC721,
		ERC1155
	}

	/**
		A struct containing information about a particular asset transfer.

		@param assetType The type of the asset involved.
		@param asset The address of the asset.
		@param id The ID of the asset.
		@param amount The amount of asset being transferred.
		@param to The destination address where the asset is being sent.
	*/
	struct Asset {
		AssetType assetType;
		address asset;
		uint256 id;
		uint256 amount;
		address to;
	}

	/// A flag to track whether or not the contract is paused.
	Status internal _status = Status.Unpaused;

	/**
		Construct a new instance of an escape hatch, which supports pausing and the 
		rescue of trapped assets.

		@param _rescuer The address of the rescuer caller that can pause, unpause, 
			and rescue assets.
	*/
	constructor (
		address _rescuer
	) {

		// Set the permit for the rescuer.
		setPermit(_rescuer, UNIVERSAL, ASSET_RESCUER, type(uint256).max);
	}

	/// An administrative function to pause the contract.
	function pause () external hasValidPermit(UNIVERSAL, ASSET_RESCUER) {
		_status = Status.Paused;
	}

	/// An administrative function to resume the contract.
	function unpause () external hasValidPermit(UNIVERSAL, ASSET_RESCUER) {
		_status = Status.Unpaused;
	}

	/**
		An admin function used in emergency situations to transfer assets from this 
		contract if they get stuck.

		@param _assets An array of `Asset` structs to attempt transfers.

		@custom:throws RescueFailed if an Ether asset could not be rescued.
	*/
	function rescueAssets (
		Asset[] calldata _assets
	) external hasValidPermit(UNIVERSAL, ASSET_RESCUER) {
		for (uint256 i; i < _assets.length; ) {

			// If the asset is Ether, attempt a rescue; skip on reversion.
			if (_assets[i].assetType == AssetType.Native) {
				(bool result, ) = _assets[i].to.call{ value: _assets[i].amount }("");
				if (!result) {
					revert RescueFailed(i);
				}
				unchecked {
					++i;
				}
				continue;
			}

			// Attempt to rescue ERC-20 items.
			if (_assets[i].assetType == AssetType.ERC20) {
				IERC20(_assets[i].asset).safeTransfer(
					_assets[i].to,
					_assets[i].amount
				);
			}

			// Attempt to rescue ERC-721 items.
			if (_assets[i].assetType == AssetType.ERC721) {
				IERC721(_assets[i].asset).transferFrom(
					address(this),
					_assets[i].to,
					_assets[i].id
				);
			}

			// Attempt to rescue ERC-1155 items.
			if (_assets[i].assetType == AssetType.ERC1155) {
				IERC1155(_assets[i].asset).safeTransferFrom(
					address(this),
					_assets[i].to,
					_assets[i].id,
					_assets[i].amount,
					""
				);
			}
			unchecked {
				++i;
			}
		}
	}
}

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

pragma solidity ^0.8.0;

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

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

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

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

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

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

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

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

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

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

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

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

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

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

pragma solidity ^0.8.0;

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

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

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

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

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

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

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

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

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

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

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

File 9 of 17 : 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 10 of 17 : 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 11 of 17 : IERC165.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (utils/introspection/IERC165.sol)

pragma solidity ^0.8.0;

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

File 12 of 17 : 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 13 of 17 : draft-IERC20Permit.sol
// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (token/ERC20/extensions/draft-IERC20Permit.sol)

pragma solidity ^0.8.0;

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

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

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

File 14 of 17 : 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 15 of 17 : 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 16 of 17 : 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 17 of 17 : 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);
}

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

Contract Security Audit

Contract ABI

[{"inputs":[{"internalType":"address[]","name":"_exchanges","type":"address[]"},{"internalType":"address[]","name":"_tokens","type":"address[]"},{"internalType":"address[]","name":"_transferProxies","type":"address[]"},{"internalType":"contract TokenTransferProxy","name":"_tokenTransferProxy","type":"address"},{"internalType":"address","name":"_governance","type":"address"},{"internalType":"address","name":"_rescuer","type":"address"}],"stateMutability":"nonpayable","type":"constructor"},{"inputs":[{"internalType":"uint256","name":"paymentAmount","type":"uint256"},{"internalType":"uint256","name":"messageValue","type":"uint256"}],"name":"ExpectedValueDiffers","type":"error"},{"inputs":[],"name":"Paused","type":"error"},{"inputs":[{"internalType":"uint256","name":"index","type":"uint256"}],"name":"RescueFailed","type":"error"},{"inputs":[],"name":"TransferFailed","type":"error"},{"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":"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"},{"inputs":[],"name":"MANAGER","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"TOKEN_TRANSFER_PROXY","outputs":[{"internalType":"contract TokenTransferProxy","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"UNIVERSAL","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":"address","name":"_exchange","type":"address"}],"name":"addExchange","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address[]","name":"_tokens","type":"address[]"},{"internalType":"address[]","name":"_transferProxies","type":"address[]"}],"name":"addPaymentTokens","outputs":[],"stateMutability":"nonpayable","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":"bytes32","name":"","type":"bytes32"}],"name":"managerRight","outputs":[{"internalType":"bytes32","name":"","type":"bytes32"}],"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":[],"name":"pause","outputs":[],"stateMutability":"nonpayable","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":[{"internalType":"bytes","name":"_cart","type":"bytes"},{"components":[{"internalType":"address","name":"asset","type":"address"},{"internalType":"uint256","name":"amount","type":"uint256"}],"internalType":"struct GigaAggregator.Payment[]","name":"_payments","type":"tuple[]"}],"name":"purchase","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[{"internalType":"address","name":"_exchange","type":"address"}],"name":"removeExchange","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address[]","name":"_tokens","type":"address[]"},{"internalType":"address[]","name":"_transferProxies","type":"address[]"}],"name":"removePaymentTokens","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"renounceOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"components":[{"internalType":"enum EscapeHatch.AssetType","name":"assetType","type":"uint8"},{"internalType":"address","name":"asset","type":"address"},{"internalType":"uint256","name":"id","type":"uint256"},{"internalType":"uint256","name":"amount","type":"uint256"},{"internalType":"address","name":"to","type":"address"}],"internalType":"struct EscapeHatch.Asset[]","name":"_assets","type":"tuple[]"}],"name":"rescueAssets","outputs":[],"stateMutability":"nonpayable","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":"","type":"address"}],"name":"supportedExchanges","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"newOwner","type":"address"}],"name":"transferOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"unpause","outputs":[],"stateMutability":"nonpayable","type":"function"},{"stateMutability":"payable","type":"receive"}]

60a06040526003805460ff191660011790553480156200001e57600080fd5b5060405162002796380380620027968339810160408190526200004191620004c5565b85858584848062000052336200023d565b6200008a816001600160801b03197fc598636fccf548e3965f4576afe7d756c8dc5e4b6518916ae98acca4926fa6a86000196200028d565b5060005b8551811015620000ee57600160046000888481518110620000b357620000b362000597565b6020908102919091018101516001600160a01b03168252810191909152604001600020805460ff19169115159190911790556001016200008e565b5060005b8351811015620001e05760005b8551811015620001d6578581815181106200011e576200011e62000597565b60200260200101516001600160a01b031663095ea7b386848151811062000149576200014962000597565b60200260200101516000196040518363ffffffff1660e01b8152600401620001869291906001600160a01b03929092168252602082015260400190565b6020604051808303816000875af1158015620001a6573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190620001cc9190620005ad565b50600101620000ff565b50600101620000f2565b5062000219826001600160801b03197fe75aa544803e2a59b2250dbf1cee784c148698d4aa836757d01a82b79e54d80a6000196200028d565b505060016005555050506001600160a01b0390921660805250620005d89350505050565b600080546001600160a01b038381166001600160a01b0319831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b6000828152600260205260409020546001600160801b031990620002b96000546001600160a01b031690565b6001600160a01b0316336001600160a01b03161480620002fa5750336000908152600160209081526040808320858452825280832084845290915290205442105b620003315760405162461bcd60e51b8152602060048201526002602482015261503160f01b60448201526064015b60405180910390fd5b83620003655760405162461bcd60e51b8152602060048201526002602482015261281960f11b604482015260640162000328565b6001600160a01b03861660008181526001602090815260408083208984528252808320888452825291829020869055815188815290810186905286929133917f71b8ef6d2e182fa6ca30442059cc10398330b3e0561fd4ecc7232b62a8678cb6910160405180910390a4505050505050565b634e487b7160e01b600052604160045260246000fd5b6001600160a01b03811681146200040357600080fd5b50565b80516200041381620003ed565b919050565b600082601f8301126200042a57600080fd5b815160206001600160401b0380831115620004495762000449620003d7565b8260051b604051601f19603f83011681018181108482111715620004715762000471620003d7565b6040529384528581018301938381019250878511156200049057600080fd5b83870191505b84821015620004ba57620004aa8262000406565b8352918301919083019062000496565b979650505050505050565b60008060008060008060c08789031215620004df57600080fd5b86516001600160401b0380821115620004f757600080fd5b620005058a838b0162000418565b975060208901519150808211156200051c57600080fd5b6200052a8a838b0162000418565b965060408901519150808211156200054157600080fd5b506200055089828a0162000418565b94505060608701516200056381620003ed565b60808801519093506200057681620003ed565b60a08801519092506200058981620003ed565b809150509295509295509295565b634e487b7160e01b600052603260045260246000fd5b600060208284031215620005c057600080fd5b81518015158114620005d157600080fd5b9392505050565b60805161219b620005fb600039600081816103af0152611625015261219b6000f3fe6080604052600436106101845760003560e01c80638da5cb5b116100d6578063bd2ebd431161007f578063cf64d4c211610059578063cf64d4c214610493578063d1324225146104b3578063f2fde38b146104e357600080fd5b8063bd2ebd4314610426578063c5b16c5914610446578063cc2af3081461047357600080fd5b8063a625776e116100b0578063a625776e146103d1578063aa10ce22146103e6578063b7b469aa1461040657600080fd5b80638da5cb5b1461034b5780638e0be3691461037d57806390e148991461039d57600080fd5b8063483ba44e11610138578063715018a611610112578063715018a6146102c15780638456cb59146102d65780638681d49c146102eb57600080fd5b8063483ba44e14610243578063618507f61461028157806366a0e54d146102a157600080fd5b80631b2df850116101695780631b2df850146101ef578063307792b3146102195780633f4ba83a1461022e57600080fd5b806306fdde031461019057806317f5ebb4146101ef57600080fd5b3661018b57005b600080fd5b34801561019c57600080fd5b506101d96040518060400160405280601381526020017f4769676141676772656761746f722076312e310000000000000000000000000081525081565b6040516101e69190611d83565b60405180910390f35b3480156101fb57600080fd5b5061020b6001600160801b031981565b6040519081526020016101e6565b61022c610227366004611db6565b610503565b005b34801561023a57600080fd5b5061022c61062c565b34801561024f57600080fd5b5061020b61025e366004611e97565b600160209081526000938452604080852082529284528284209052825290205481565b34801561028d57600080fd5b5061022c61029c366004611f16565b610700565b3480156102ad57600080fd5b5061020b6102bc366004611e97565b61088f565b3480156102cd57600080fd5b5061022c6108c3565b3480156102e257600080fd5b5061022c6108d7565b3480156102f757600080fd5b5061033b610306366004611e97565b6001600160a01b0383166000908152600160209081526040808320858452825280832084845290915290205442109392505050565b60405190151581526020016101e6565b34801561035757600080fd5b506000546001600160a01b03165b6040516001600160a01b0390911681526020016101e6565b34801561038957600080fd5b5061022c610398366004611f82565b61097b565b3480156103a957600080fd5b506103657f000000000000000000000000000000000000000000000000000000000000000081565b3480156103dd57600080fd5b5061020b600081565b3480156103f257600080fd5b5061022c610401366004611f82565b610a2e565b34801561041257600080fd5b5061022c610421366004611f9d565b610ae4565b34801561043257600080fd5b5061022c610441366004611f16565b610ff4565b34801561045257600080fd5b5061020b610461366004612012565b60026020526000908152604090205481565b34801561047f57600080fd5b5061022c61048e36600461202b565b611179565b34801561049f57600080fd5b5061022c6104ae36600461204d565b611278565b3480156104bf57600080fd5b5061033b6104ce366004611f82565b60046020526000908152604090205460ff1681565b3480156104ef57600080fd5b5061022c6104fe366004611f82565b6113b6565b60026005540361055a5760405162461bcd60e51b815260206004820152601f60248201527f5265656e7472616e637947756172643a207265656e7472616e742063616c6c0060448201526064015b60405180910390fd5b6002600581905560035460ff16600281111561057857610578612086565b036105af576040517f9e87fac800000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b60008167ffffffffffffffff8111156105ca576105ca61209c565b6040519080825280602002602001820160405280156105f3578160200160208202803683370190505b509050610601838383611446565b61060b8383611555565b6106158585611717565b610620838383611761565b50506001600555505050565b6001600160801b03197fc598636fccf548e3965f4576afe7d756c8dc5e4b6518916ae98acca4926fa6a86106686000546001600160a01b031690565b6001600160a01b0316336001600160a01b031614806106b757506106b7335b6001600160a01b031660009081526001602090815260408083208684528252808320858452909152902054421090565b6106e85760405162461bcd60e51b8152602060048201526002602482015261503160f01b6044820152606401610551565b600380546001919060ff191682805b02179055505050565b6001600160801b03197fe75aa544803e2a59b2250dbf1cee784c148698d4aa836757d01a82b79e54d80a61073c6000546001600160a01b031690565b6001600160a01b0316336001600160a01b0316148061075f575061075f33610687565b6107905760405162461bcd60e51b8152602060048201526002602482015261503160f01b6044820152606401610551565b60005b838110156108865760005b8681101561087d578787828181106107b8576107b86120b2565b90506020020160208101906107cd9190611f82565b6001600160a01b031663095ea7b38787858181106107ed576107ed6120b2565b90506020020160208101906108029190611f82565b6040516001600160e01b031960e084901b1681526001600160a01b03909116600482015260001960248201526044016020604051808303816000875af1158015610850573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061087491906120c8565b5060010161079e565b50600101610793565b50505050505050565b6001600160a01b038316600090815260016020908152604080832085845282528083208484529091529020545b9392505050565b6108cb61190b565b6108d56000611965565b565b6001600160801b03197fc598636fccf548e3965f4576afe7d756c8dc5e4b6518916ae98acca4926fa6a86109136000546001600160a01b031690565b6001600160a01b0316336001600160a01b03161480610936575061093633610687565b6109675760405162461bcd60e51b8152602060048201526002602482015261503160f01b6044820152606401610551565b600380546002919060ff19166001836106f7565b6001600160801b03197fe75aa544803e2a59b2250dbf1cee784c148698d4aa836757d01a82b79e54d80a6109b76000546001600160a01b031690565b6001600160a01b0316336001600160a01b031614806109da57506109da33610687565b610a0b5760405162461bcd60e51b8152602060048201526002602482015261503160f01b6044820152606401610551565b50506001600160a01b03166000908152600460205260409020805460ff19169055565b6001600160801b03197fe75aa544803e2a59b2250dbf1cee784c148698d4aa836757d01a82b79e54d80a610a6a6000546001600160a01b031690565b6001600160a01b0316336001600160a01b03161480610a8d5750610a8d33610687565b610abe5760405162461bcd60e51b8152602060048201526002602482015261503160f01b6044820152606401610551565b50506001600160a01b03166000908152600460205260409020805460ff19166001179055565b6001600160801b03197fc598636fccf548e3965f4576afe7d756c8dc5e4b6518916ae98acca4926fa6a8610b206000546001600160a01b031690565b6001600160a01b0316336001600160a01b03161480610b435750610b4333610687565b610b745760405162461bcd60e51b8152602060048201526002602482015261503160f01b6044820152606401610551565b60005b83811015610fed576000858583818110610b9357610b936120b2565b610ba992602060a09092020190810191506120ea565b6003811115610bba57610bba612086565b03610c9c576000858583818110610bd357610bd36120b2565b905060a002016080016020810190610beb9190611f82565b6001600160a01b0316868684818110610c0657610c066120b2565b905060a002016060013560405160006040518083038185875af1925050503d8060008114610c50576040519150601f19603f3d011682016040523d82523d6000602084013e610c55565b606091505b5050905080610c93576040517f74c41da700000000000000000000000000000000000000000000000000000000815260048101839052602401610551565b50600101610b77565b6001858583818110610cb057610cb06120b2565b610cc692602060a09092020190810191506120ea565b6003811115610cd757610cd7612086565b03610d5f57610d5f858583818110610cf157610cf16120b2565b905060a002016080016020810190610d099190611f82565b868684818110610d1b57610d1b6120b2565b905060a0020160600135878785818110610d3757610d376120b2565b905060a002016020016020810190610d4f9190611f82565b6001600160a01b031691906119cd565b6002858583818110610d7357610d736120b2565b610d8992602060a09092020190810191506120ea565b6003811115610d9a57610d9a612086565b03610e8a57848482818110610db157610db16120b2565b905060a002016020016020810190610dc99190611f82565b6001600160a01b03166323b872dd30878785818110610dea57610dea6120b2565b905060a002016080016020810190610e029190611f82565b888886818110610e1457610e146120b2565b604080516001600160e01b031960e089901b1681526001600160a01b03968716600482015295909416602486015260a002919091019190910135604483015250606401600060405180830381600087803b158015610e7157600080fd5b505af1158015610e85573d6000803e3d6000fd5b505050505b6003858583818110610e9e57610e9e6120b2565b610eb492602060a09092020190810191506120ea565b6003811115610ec557610ec5612086565b03610fe557848482818110610edc57610edc6120b2565b905060a002016020016020810190610ef49190611f82565b6001600160a01b031663f242432a30878785818110610f1557610f156120b2565b905060a002016080016020810190610f2d9190611f82565b888886818110610f3f57610f3f6120b2565b905060a0020160400135898987818110610f5b57610f5b6120b2565b6040516001600160e01b031960e089901b1681526001600160a01b039687166004820152959094166024860152506044840191909152606060a092830291909101013560648301526084820152600060a482015260c401600060405180830381600087803b158015610fcc57600080fd5b505af1158015610fe0573d6000803e3d6000fd5b505050505b600101610b77565b5050505050565b6001600160801b03197fe75aa544803e2a59b2250dbf1cee784c148698d4aa836757d01a82b79e54d80a6110306000546001600160a01b031690565b6001600160a01b0316336001600160a01b03161480611053575061105333610687565b6110845760405162461bcd60e51b8152602060048201526002602482015261503160f01b6044820152606401610551565b60005b838110156108865760005b86811015611170578787828181106110ac576110ac6120b2565b90506020020160208101906110c19190611f82565b6001600160a01b031663095ea7b38787858181106110e1576110e16120b2565b90506020020160208101906110f69190611f82565b6040516001600160e01b031960e084901b1681526001600160a01b039091166004820152600060248201526044016020604051808303816000875af1158015611143573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061116791906120c8565b50600101611092565b50600101611087565b6001600160801b0319806111956000546001600160a01b031690565b6001600160a01b0316336001600160a01b031614806111b857506111b833610687565b6111e95760405162461bcd60e51b8152602060048201526002602482015261503160f01b6044820152606401610551565b836112365760405162461bcd60e51b815260206004820152600260248201527f50330000000000000000000000000000000000000000000000000000000000006044820152606401610551565b600084815260026020526040808220859055518491869133917fad26b90be8a18bd2262e914f6fd4919c42f9dd6a0d07a15fa728ec603a836a8891a450505050565b6000828152600260205260409020546001600160801b0319906112a36000546001600160a01b031690565b6001600160a01b0316336001600160a01b031614806112c657506112c633610687565b6112f75760405162461bcd60e51b8152602060048201526002602482015261503160f01b6044820152606401610551565b836113445760405162461bcd60e51b815260206004820152600260248201527f50320000000000000000000000000000000000000000000000000000000000006044820152606401610551565b6001600160a01b03861660008181526001602090815260408083208984528252808320888452825291829020869055815188815290810186905286929133917f71b8ef6d2e182fa6ca30442059cc10398330b3e0561fd4ecc7232b62a8678cb6910160405180910390a4505050505050565b6113be61190b565b6001600160a01b03811661143a5760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201527f64647265737300000000000000000000000000000000000000000000000000006064820152608401610551565b61144381611965565b50565b60005b8281101561154f576000848483818110611465576114656120b2565b61147b9260206040909202019081019150611f82565b6001600160a01b0316146115205783838281811061149b5761149b6120b2565b6114b19260206040909202019081019150611f82565b6040516370a0823160e01b81523060048201526001600160a01b0391909116906370a0823190602401602060405180830381865afa1580156114f7573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061151b919061210b565b61152a565b61152a3447612124565b82828151811061153c5761153c6120b2565b6020908102919091010152600101611449565b50505050565b60005b8181101561171257600080848484818110611575576115756120b2565b61158b9260206040909202019081019150611f82565b6001600160a01b03161490508080156115bf5750348484848181106115b2576115b26120b2565b9050604002016020013514155b1561161e578383838181106115d6576115d66120b2565b90506040020160200135346040517f5e41f4bc000000000000000000000000000000000000000000000000000000008152600401610551929190918252602082015260400190565b80611709577f00000000000000000000000000000000000000000000000000000000000000006001600160a01b031663da3e8ce4858585818110611664576116646120b2565b61167a9260206040909202019081019150611f82565b333088888881811061168e5761168e6120b2565b6040805160e089901b6001600160e01b03191681526001600160a01b0397881660048201529587166024870152939095166044850152509202909101602001356064820152608401600060405180830381600087803b1580156116f057600080fd5b505af1158015611704573d6000803e3d6000fd5b505050505b50600101611558565b505050565b60645b81811015611712576020810135813580600052600460205260406000205415611757576040518260608501823760008084836040880135865af150505b500160600161171a565b6000805b8251811015610fed576000858583818110611782576117826120b2565b6117989260206040909202019081019150611f82565b6001600160a01b031603611806574791508281815181106117bb576117bb6120b2565b6020026020010151821115611801576118018382815181106117df576117df6120b2565b60200260200101518303336001600160a01b0316611a4d90919063ffffffff16565b611903565b848482818110611818576118186120b2565b61182e9260206040909202019081019150611f82565b6040516370a0823160e01b81523060048201526001600160a01b0391909116906370a0823190602401602060405180830381865afa158015611874573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611898919061210b565b91508281815181106118ac576118ac6120b2565b602002602001015182111561190357611903338483815181106118d1576118d16120b2565b602002602001015184038787858181106118ed576118ed6120b2565b610d4f9260206040909202019081019150611f82565b600101611765565b6000546001600160a01b031633146108d55760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e65726044820152606401610551565b600080546001600160a01b038381167fffffffffffffffffffffffff0000000000000000000000000000000000000000831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b604080516001600160a01b038416602482015260448082018490528251808303909101815260649091019091526020810180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff167fa9059cbb00000000000000000000000000000000000000000000000000000000179052611712908490611ada565b6000826001600160a01b03168260405160006040518083038185875af1925050503d8060008114611a9a576040519150601f19603f3d011682016040523d82523d6000602084013e611a9f565b606091505b5050905080611712576040517f90b8ec1800000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6000611b2f826040518060400160405280602081526020017f5361666545524332303a206c6f772d6c6576656c2063616c6c206661696c6564815250856001600160a01b0316611bbf9092919063ffffffff16565b8051909150156117125780806020019051810190611b4d91906120c8565b6117125760405162461bcd60e51b815260206004820152602a60248201527f5361666545524332303a204552433230206f7065726174696f6e20646964206e60448201527f6f742073756363656564000000000000000000000000000000000000000000006064820152608401610551565b6060611bce8484600085611bd6565b949350505050565b606082471015611c4e5760405162461bcd60e51b815260206004820152602660248201527f416464726573733a20696e73756666696369656e742062616c616e636520666f60448201527f722063616c6c00000000000000000000000000000000000000000000000000006064820152608401610551565b6001600160a01b0385163b611ca55760405162461bcd60e51b815260206004820152601d60248201527f416464726573733a2063616c6c20746f206e6f6e2d636f6e74726163740000006044820152606401610551565b600080866001600160a01b03168587604051611cc19190612149565b60006040518083038185875af1925050503d8060008114611cfe576040519150601f19603f3d011682016040523d82523d6000602084013e611d03565b606091505b5091509150611d13828286611d1e565b979650505050505050565b60608315611d2d5750816108bc565b825115611d3d5782518084602001fd5b8160405162461bcd60e51b81526004016105519190611d83565b60005b83811015611d72578181015183820152602001611d5a565b8381111561154f5750506000910152565b6020815260008251806020840152611da2816040850160208701611d57565b601f01601f19169190910160400192915050565b60008060008060408587031215611dcc57600080fd5b843567ffffffffffffffff80821115611de457600080fd5b818701915087601f830112611df857600080fd5b813581811115611e0757600080fd5b886020828501011115611e1957600080fd5b602092830196509450908601359080821115611e3457600080fd5b818701915087601f830112611e4857600080fd5b813581811115611e5757600080fd5b8860208260061b8501011115611e6c57600080fd5b95989497505060200194505050565b80356001600160a01b0381168114611e9257600080fd5b919050565b600080600060608486031215611eac57600080fd5b611eb584611e7b565b95602085013595506040909401359392505050565b60008083601f840112611edc57600080fd5b50813567ffffffffffffffff811115611ef457600080fd5b6020830191508360208260051b8501011115611f0f57600080fd5b9250929050565b60008060008060408587031215611f2c57600080fd5b843567ffffffffffffffff80821115611f4457600080fd5b611f5088838901611eca565b90965094506020870135915080821115611f6957600080fd5b50611f7687828801611eca565b95989497509550505050565b600060208284031215611f9457600080fd5b6108bc82611e7b565b60008060208385031215611fb057600080fd5b823567ffffffffffffffff80821115611fc857600080fd5b818501915085601f830112611fdc57600080fd5b813581811115611feb57600080fd5b86602060a08302850101111561200057600080fd5b60209290920196919550909350505050565b60006020828403121561202457600080fd5b5035919050565b6000806040838503121561203e57600080fd5b50508035926020909101359150565b6000806000806080858703121561206357600080fd5b61206c85611e7b565b966020860135965060408601359560600135945092505050565b634e487b7160e01b600052602160045260246000fd5b634e487b7160e01b600052604160045260246000fd5b634e487b7160e01b600052603260045260246000fd5b6000602082840312156120da57600080fd5b815180151581146108bc57600080fd5b6000602082840312156120fc57600080fd5b8135600481106108bc57600080fd5b60006020828403121561211d57600080fd5b5051919050565b60008282101561214457634e487b7160e01b600052601160045260246000fd5b500390565b6000825161215b818460208701611d57565b919091019291505056fea264697066735822122008e1801ef245bc4a37d54dacde69b92e9db689bbe1aa4c47fb72e995dbabeeca64736f6c634300080f003300000000000000000000000000000000000000000000000000000000000000c0000000000000000000000000000000000000000000000000000000000000014000000000000000000000000000000000000000000000000000000000000001800000000000000000000000002f0809aa3f09b19d5e8cd869108427032683e9010000000000000000000000006969b5d5bd910aaaf2b153fc3e2231b81d5d928a0000000000000000000000006969b5d5bd910aaaf2b153fc3e2231b81d5d928a0000000000000000000000000000000000000000000000000000000000000003000000000000000000000000ca833f943a0c7d3c4021b0b161a2686f9ebf6b02000000000000000000000000ec5ce37242b17d9c54ade5dd71c29d2183faefd100000000000000000000000000000000006c3852cbef3e08e8df289169ede5810000000000000000000000000000000000000000000000000000000000000001000000000000000000000000c02aaa39b223fe8d0a0e5c4f27ead9083c756cc200000000000000000000000000000000000000000000000000000000000000030000000000000000000000002f0809aa3f09b19d5e8cd869108427032683e90100000000000000000000000000000000006c3852cbef3e08e8df289169ede5810000000000000000000000001e0049783f008a0085193e00003d00cd54003c71

Deployed Bytecode

0x6080604052600436106101845760003560e01c80638da5cb5b116100d6578063bd2ebd431161007f578063cf64d4c211610059578063cf64d4c214610493578063d1324225146104b3578063f2fde38b146104e357600080fd5b8063bd2ebd4314610426578063c5b16c5914610446578063cc2af3081461047357600080fd5b8063a625776e116100b0578063a625776e146103d1578063aa10ce22146103e6578063b7b469aa1461040657600080fd5b80638da5cb5b1461034b5780638e0be3691461037d57806390e148991461039d57600080fd5b8063483ba44e11610138578063715018a611610112578063715018a6146102c15780638456cb59146102d65780638681d49c146102eb57600080fd5b8063483ba44e14610243578063618507f61461028157806366a0e54d146102a157600080fd5b80631b2df850116101695780631b2df850146101ef578063307792b3146102195780633f4ba83a1461022e57600080fd5b806306fdde031461019057806317f5ebb4146101ef57600080fd5b3661018b57005b600080fd5b34801561019c57600080fd5b506101d96040518060400160405280601381526020017f4769676141676772656761746f722076312e310000000000000000000000000081525081565b6040516101e69190611d83565b60405180910390f35b3480156101fb57600080fd5b5061020b6001600160801b031981565b6040519081526020016101e6565b61022c610227366004611db6565b610503565b005b34801561023a57600080fd5b5061022c61062c565b34801561024f57600080fd5b5061020b61025e366004611e97565b600160209081526000938452604080852082529284528284209052825290205481565b34801561028d57600080fd5b5061022c61029c366004611f16565b610700565b3480156102ad57600080fd5b5061020b6102bc366004611e97565b61088f565b3480156102cd57600080fd5b5061022c6108c3565b3480156102e257600080fd5b5061022c6108d7565b3480156102f757600080fd5b5061033b610306366004611e97565b6001600160a01b0383166000908152600160209081526040808320858452825280832084845290915290205442109392505050565b60405190151581526020016101e6565b34801561035757600080fd5b506000546001600160a01b03165b6040516001600160a01b0390911681526020016101e6565b34801561038957600080fd5b5061022c610398366004611f82565b61097b565b3480156103a957600080fd5b506103657f0000000000000000000000002f0809aa3f09b19d5e8cd869108427032683e90181565b3480156103dd57600080fd5b5061020b600081565b3480156103f257600080fd5b5061022c610401366004611f82565b610a2e565b34801561041257600080fd5b5061022c610421366004611f9d565b610ae4565b34801561043257600080fd5b5061022c610441366004611f16565b610ff4565b34801561045257600080fd5b5061020b610461366004612012565b60026020526000908152604090205481565b34801561047f57600080fd5b5061022c61048e36600461202b565b611179565b34801561049f57600080fd5b5061022c6104ae36600461204d565b611278565b3480156104bf57600080fd5b5061033b6104ce366004611f82565b60046020526000908152604090205460ff1681565b3480156104ef57600080fd5b5061022c6104fe366004611f82565b6113b6565b60026005540361055a5760405162461bcd60e51b815260206004820152601f60248201527f5265656e7472616e637947756172643a207265656e7472616e742063616c6c0060448201526064015b60405180910390fd5b6002600581905560035460ff16600281111561057857610578612086565b036105af576040517f9e87fac800000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b60008167ffffffffffffffff8111156105ca576105ca61209c565b6040519080825280602002602001820160405280156105f3578160200160208202803683370190505b509050610601838383611446565b61060b8383611555565b6106158585611717565b610620838383611761565b50506001600555505050565b6001600160801b03197fc598636fccf548e3965f4576afe7d756c8dc5e4b6518916ae98acca4926fa6a86106686000546001600160a01b031690565b6001600160a01b0316336001600160a01b031614806106b757506106b7335b6001600160a01b031660009081526001602090815260408083208684528252808320858452909152902054421090565b6106e85760405162461bcd60e51b8152602060048201526002602482015261503160f01b6044820152606401610551565b600380546001919060ff191682805b02179055505050565b6001600160801b03197fe75aa544803e2a59b2250dbf1cee784c148698d4aa836757d01a82b79e54d80a61073c6000546001600160a01b031690565b6001600160a01b0316336001600160a01b0316148061075f575061075f33610687565b6107905760405162461bcd60e51b8152602060048201526002602482015261503160f01b6044820152606401610551565b60005b838110156108865760005b8681101561087d578787828181106107b8576107b86120b2565b90506020020160208101906107cd9190611f82565b6001600160a01b031663095ea7b38787858181106107ed576107ed6120b2565b90506020020160208101906108029190611f82565b6040516001600160e01b031960e084901b1681526001600160a01b03909116600482015260001960248201526044016020604051808303816000875af1158015610850573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061087491906120c8565b5060010161079e565b50600101610793565b50505050505050565b6001600160a01b038316600090815260016020908152604080832085845282528083208484529091529020545b9392505050565b6108cb61190b565b6108d56000611965565b565b6001600160801b03197fc598636fccf548e3965f4576afe7d756c8dc5e4b6518916ae98acca4926fa6a86109136000546001600160a01b031690565b6001600160a01b0316336001600160a01b03161480610936575061093633610687565b6109675760405162461bcd60e51b8152602060048201526002602482015261503160f01b6044820152606401610551565b600380546002919060ff19166001836106f7565b6001600160801b03197fe75aa544803e2a59b2250dbf1cee784c148698d4aa836757d01a82b79e54d80a6109b76000546001600160a01b031690565b6001600160a01b0316336001600160a01b031614806109da57506109da33610687565b610a0b5760405162461bcd60e51b8152602060048201526002602482015261503160f01b6044820152606401610551565b50506001600160a01b03166000908152600460205260409020805460ff19169055565b6001600160801b03197fe75aa544803e2a59b2250dbf1cee784c148698d4aa836757d01a82b79e54d80a610a6a6000546001600160a01b031690565b6001600160a01b0316336001600160a01b03161480610a8d5750610a8d33610687565b610abe5760405162461bcd60e51b8152602060048201526002602482015261503160f01b6044820152606401610551565b50506001600160a01b03166000908152600460205260409020805460ff19166001179055565b6001600160801b03197fc598636fccf548e3965f4576afe7d756c8dc5e4b6518916ae98acca4926fa6a8610b206000546001600160a01b031690565b6001600160a01b0316336001600160a01b03161480610b435750610b4333610687565b610b745760405162461bcd60e51b8152602060048201526002602482015261503160f01b6044820152606401610551565b60005b83811015610fed576000858583818110610b9357610b936120b2565b610ba992602060a09092020190810191506120ea565b6003811115610bba57610bba612086565b03610c9c576000858583818110610bd357610bd36120b2565b905060a002016080016020810190610beb9190611f82565b6001600160a01b0316868684818110610c0657610c066120b2565b905060a002016060013560405160006040518083038185875af1925050503d8060008114610c50576040519150601f19603f3d011682016040523d82523d6000602084013e610c55565b606091505b5050905080610c93576040517f74c41da700000000000000000000000000000000000000000000000000000000815260048101839052602401610551565b50600101610b77565b6001858583818110610cb057610cb06120b2565b610cc692602060a09092020190810191506120ea565b6003811115610cd757610cd7612086565b03610d5f57610d5f858583818110610cf157610cf16120b2565b905060a002016080016020810190610d099190611f82565b868684818110610d1b57610d1b6120b2565b905060a0020160600135878785818110610d3757610d376120b2565b905060a002016020016020810190610d4f9190611f82565b6001600160a01b031691906119cd565b6002858583818110610d7357610d736120b2565b610d8992602060a09092020190810191506120ea565b6003811115610d9a57610d9a612086565b03610e8a57848482818110610db157610db16120b2565b905060a002016020016020810190610dc99190611f82565b6001600160a01b03166323b872dd30878785818110610dea57610dea6120b2565b905060a002016080016020810190610e029190611f82565b888886818110610e1457610e146120b2565b604080516001600160e01b031960e089901b1681526001600160a01b03968716600482015295909416602486015260a002919091019190910135604483015250606401600060405180830381600087803b158015610e7157600080fd5b505af1158015610e85573d6000803e3d6000fd5b505050505b6003858583818110610e9e57610e9e6120b2565b610eb492602060a09092020190810191506120ea565b6003811115610ec557610ec5612086565b03610fe557848482818110610edc57610edc6120b2565b905060a002016020016020810190610ef49190611f82565b6001600160a01b031663f242432a30878785818110610f1557610f156120b2565b905060a002016080016020810190610f2d9190611f82565b888886818110610f3f57610f3f6120b2565b905060a0020160400135898987818110610f5b57610f5b6120b2565b6040516001600160e01b031960e089901b1681526001600160a01b039687166004820152959094166024860152506044840191909152606060a092830291909101013560648301526084820152600060a482015260c401600060405180830381600087803b158015610fcc57600080fd5b505af1158015610fe0573d6000803e3d6000fd5b505050505b600101610b77565b5050505050565b6001600160801b03197fe75aa544803e2a59b2250dbf1cee784c148698d4aa836757d01a82b79e54d80a6110306000546001600160a01b031690565b6001600160a01b0316336001600160a01b03161480611053575061105333610687565b6110845760405162461bcd60e51b8152602060048201526002602482015261503160f01b6044820152606401610551565b60005b838110156108865760005b86811015611170578787828181106110ac576110ac6120b2565b90506020020160208101906110c19190611f82565b6001600160a01b031663095ea7b38787858181106110e1576110e16120b2565b90506020020160208101906110f69190611f82565b6040516001600160e01b031960e084901b1681526001600160a01b039091166004820152600060248201526044016020604051808303816000875af1158015611143573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061116791906120c8565b50600101611092565b50600101611087565b6001600160801b0319806111956000546001600160a01b031690565b6001600160a01b0316336001600160a01b031614806111b857506111b833610687565b6111e95760405162461bcd60e51b8152602060048201526002602482015261503160f01b6044820152606401610551565b836112365760405162461bcd60e51b815260206004820152600260248201527f50330000000000000000000000000000000000000000000000000000000000006044820152606401610551565b600084815260026020526040808220859055518491869133917fad26b90be8a18bd2262e914f6fd4919c42f9dd6a0d07a15fa728ec603a836a8891a450505050565b6000828152600260205260409020546001600160801b0319906112a36000546001600160a01b031690565b6001600160a01b0316336001600160a01b031614806112c657506112c633610687565b6112f75760405162461bcd60e51b8152602060048201526002602482015261503160f01b6044820152606401610551565b836113445760405162461bcd60e51b815260206004820152600260248201527f50320000000000000000000000000000000000000000000000000000000000006044820152606401610551565b6001600160a01b03861660008181526001602090815260408083208984528252808320888452825291829020869055815188815290810186905286929133917f71b8ef6d2e182fa6ca30442059cc10398330b3e0561fd4ecc7232b62a8678cb6910160405180910390a4505050505050565b6113be61190b565b6001600160a01b03811661143a5760405162461bcd60e51b815260206004820152602660248201527f4f776e61626c653a206e6577206f776e657220697320746865207a65726f206160448201527f64647265737300000000000000000000000000000000000000000000000000006064820152608401610551565b61144381611965565b50565b60005b8281101561154f576000848483818110611465576114656120b2565b61147b9260206040909202019081019150611f82565b6001600160a01b0316146115205783838281811061149b5761149b6120b2565b6114b19260206040909202019081019150611f82565b6040516370a0823160e01b81523060048201526001600160a01b0391909116906370a0823190602401602060405180830381865afa1580156114f7573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061151b919061210b565b61152a565b61152a3447612124565b82828151811061153c5761153c6120b2565b6020908102919091010152600101611449565b50505050565b60005b8181101561171257600080848484818110611575576115756120b2565b61158b9260206040909202019081019150611f82565b6001600160a01b03161490508080156115bf5750348484848181106115b2576115b26120b2565b9050604002016020013514155b1561161e578383838181106115d6576115d66120b2565b90506040020160200135346040517f5e41f4bc000000000000000000000000000000000000000000000000000000008152600401610551929190918252602082015260400190565b80611709577f0000000000000000000000002f0809aa3f09b19d5e8cd869108427032683e9016001600160a01b031663da3e8ce4858585818110611664576116646120b2565b61167a9260206040909202019081019150611f82565b333088888881811061168e5761168e6120b2565b6040805160e089901b6001600160e01b03191681526001600160a01b0397881660048201529587166024870152939095166044850152509202909101602001356064820152608401600060405180830381600087803b1580156116f057600080fd5b505af1158015611704573d6000803e3d6000fd5b505050505b50600101611558565b505050565b60645b81811015611712576020810135813580600052600460205260406000205415611757576040518260608501823760008084836040880135865af150505b500160600161171a565b6000805b8251811015610fed576000858583818110611782576117826120b2565b6117989260206040909202019081019150611f82565b6001600160a01b031603611806574791508281815181106117bb576117bb6120b2565b6020026020010151821115611801576118018382815181106117df576117df6120b2565b60200260200101518303336001600160a01b0316611a4d90919063ffffffff16565b611903565b848482818110611818576118186120b2565b61182e9260206040909202019081019150611f82565b6040516370a0823160e01b81523060048201526001600160a01b0391909116906370a0823190602401602060405180830381865afa158015611874573d6000803e3d6000fd5b505050506040513d601f19601f82011682018060405250810190611898919061210b565b91508281815181106118ac576118ac6120b2565b602002602001015182111561190357611903338483815181106118d1576118d16120b2565b602002602001015184038787858181106118ed576118ed6120b2565b610d4f9260206040909202019081019150611f82565b600101611765565b6000546001600160a01b031633146108d55760405162461bcd60e51b815260206004820181905260248201527f4f776e61626c653a2063616c6c6572206973206e6f7420746865206f776e65726044820152606401610551565b600080546001600160a01b038381167fffffffffffffffffffffffff0000000000000000000000000000000000000000831681178455604051919092169283917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e09190a35050565b604080516001600160a01b038416602482015260448082018490528251808303909101815260649091019091526020810180517bffffffffffffffffffffffffffffffffffffffffffffffffffffffff167fa9059cbb00000000000000000000000000000000000000000000000000000000179052611712908490611ada565b6000826001600160a01b03168260405160006040518083038185875af1925050503d8060008114611a9a576040519150601f19603f3d011682016040523d82523d6000602084013e611a9f565b606091505b5050905080611712576040517f90b8ec1800000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b6000611b2f826040518060400160405280602081526020017f5361666545524332303a206c6f772d6c6576656c2063616c6c206661696c6564815250856001600160a01b0316611bbf9092919063ffffffff16565b8051909150156117125780806020019051810190611b4d91906120c8565b6117125760405162461bcd60e51b815260206004820152602a60248201527f5361666545524332303a204552433230206f7065726174696f6e20646964206e60448201527f6f742073756363656564000000000000000000000000000000000000000000006064820152608401610551565b6060611bce8484600085611bd6565b949350505050565b606082471015611c4e5760405162461bcd60e51b815260206004820152602660248201527f416464726573733a20696e73756666696369656e742062616c616e636520666f60448201527f722063616c6c00000000000000000000000000000000000000000000000000006064820152608401610551565b6001600160a01b0385163b611ca55760405162461bcd60e51b815260206004820152601d60248201527f416464726573733a2063616c6c20746f206e6f6e2d636f6e74726163740000006044820152606401610551565b600080866001600160a01b03168587604051611cc19190612149565b60006040518083038185875af1925050503d8060008114611cfe576040519150601f19603f3d011682016040523d82523d6000602084013e611d03565b606091505b5091509150611d13828286611d1e565b979650505050505050565b60608315611d2d5750816108bc565b825115611d3d5782518084602001fd5b8160405162461bcd60e51b81526004016105519190611d83565b60005b83811015611d72578181015183820152602001611d5a565b8381111561154f5750506000910152565b6020815260008251806020840152611da2816040850160208701611d57565b601f01601f19169190910160400192915050565b60008060008060408587031215611dcc57600080fd5b843567ffffffffffffffff80821115611de457600080fd5b818701915087601f830112611df857600080fd5b813581811115611e0757600080fd5b886020828501011115611e1957600080fd5b602092830196509450908601359080821115611e3457600080fd5b818701915087601f830112611e4857600080fd5b813581811115611e5757600080fd5b8860208260061b8501011115611e6c57600080fd5b95989497505060200194505050565b80356001600160a01b0381168114611e9257600080fd5b919050565b600080600060608486031215611eac57600080fd5b611eb584611e7b565b95602085013595506040909401359392505050565b60008083601f840112611edc57600080fd5b50813567ffffffffffffffff811115611ef457600080fd5b6020830191508360208260051b8501011115611f0f57600080fd5b9250929050565b60008060008060408587031215611f2c57600080fd5b843567ffffffffffffffff80821115611f4457600080fd5b611f5088838901611eca565b90965094506020870135915080821115611f6957600080fd5b50611f7687828801611eca565b95989497509550505050565b600060208284031215611f9457600080fd5b6108bc82611e7b565b60008060208385031215611fb057600080fd5b823567ffffffffffffffff80821115611fc857600080fd5b818501915085601f830112611fdc57600080fd5b813581811115611feb57600080fd5b86602060a08302850101111561200057600080fd5b60209290920196919550909350505050565b60006020828403121561202457600080fd5b5035919050565b6000806040838503121561203e57600080fd5b50508035926020909101359150565b6000806000806080858703121561206357600080fd5b61206c85611e7b565b966020860135965060408601359560600135945092505050565b634e487b7160e01b600052602160045260246000fd5b634e487b7160e01b600052604160045260246000fd5b634e487b7160e01b600052603260045260246000fd5b6000602082840312156120da57600080fd5b815180151581146108bc57600080fd5b6000602082840312156120fc57600080fd5b8135600481106108bc57600080fd5b60006020828403121561211d57600080fd5b5051919050565b60008282101561214457634e487b7160e01b600052601160045260246000fd5b500390565b6000825161215b818460208701611d57565b919091019291505056fea264697066735822122008e1801ef245bc4a37d54dacde69b92e9db689bbe1aa4c47fb72e995dbabeeca64736f6c634300080f0033

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

00000000000000000000000000000000000000000000000000000000000000c0000000000000000000000000000000000000000000000000000000000000014000000000000000000000000000000000000000000000000000000000000001800000000000000000000000002f0809aa3f09b19d5e8cd869108427032683e9010000000000000000000000006969b5d5bd910aaaf2b153fc3e2231b81d5d928a0000000000000000000000006969b5d5bd910aaaf2b153fc3e2231b81d5d928a0000000000000000000000000000000000000000000000000000000000000003000000000000000000000000ca833f943a0c7d3c4021b0b161a2686f9ebf6b02000000000000000000000000ec5ce37242b17d9c54ade5dd71c29d2183faefd100000000000000000000000000000000006c3852cbef3e08e8df289169ede5810000000000000000000000000000000000000000000000000000000000000001000000000000000000000000c02aaa39b223fe8d0a0e5c4f27ead9083c756cc200000000000000000000000000000000000000000000000000000000000000030000000000000000000000002f0809aa3f09b19d5e8cd869108427032683e90100000000000000000000000000000000006c3852cbef3e08e8df289169ede5810000000000000000000000001e0049783f008a0085193e00003d00cd54003c71

-----Decoded View---------------
Arg [0] : _exchanges (address[]): 0xcA833F943a0C7D3C4021B0b161a2686f9ebf6b02,0xEC5cE37242b17D9C54Ade5DD71C29d2183FAEfD1,0x00000000006c3852cbEf3e08E8dF289169EdE581
Arg [1] : _tokens (address[]): 0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2
Arg [2] : _transferProxies (address[]): 0x2f0809Aa3f09b19d5e8CD869108427032683e901,0x00000000006c3852cbEf3e08E8dF289169EdE581,0x1E0049783F008A0085193E00003D00cd54003c71
Arg [3] : _tokenTransferProxy (address): 0x2f0809Aa3f09b19d5e8CD869108427032683e901
Arg [4] : _governance (address): 0x6969b5D5bd910AAAF2b153fC3e2231B81d5D928a
Arg [5] : _rescuer (address): 0x6969b5D5bd910AAAF2b153fC3e2231B81d5D928a

-----Encoded View---------------
16 Constructor Arguments found :
Arg [0] : 00000000000000000000000000000000000000000000000000000000000000c0
Arg [1] : 0000000000000000000000000000000000000000000000000000000000000140
Arg [2] : 0000000000000000000000000000000000000000000000000000000000000180
Arg [3] : 0000000000000000000000002f0809aa3f09b19d5e8cd869108427032683e901
Arg [4] : 0000000000000000000000006969b5d5bd910aaaf2b153fc3e2231b81d5d928a
Arg [5] : 0000000000000000000000006969b5d5bd910aaaf2b153fc3e2231b81d5d928a
Arg [6] : 0000000000000000000000000000000000000000000000000000000000000003
Arg [7] : 000000000000000000000000ca833f943a0c7d3c4021b0b161a2686f9ebf6b02
Arg [8] : 000000000000000000000000ec5ce37242b17d9c54ade5dd71c29d2183faefd1
Arg [9] : 00000000000000000000000000000000006c3852cbef3e08e8df289169ede581
Arg [10] : 0000000000000000000000000000000000000000000000000000000000000001
Arg [11] : 000000000000000000000000c02aaa39b223fe8d0a0e5c4f27ead9083c756cc2
Arg [12] : 0000000000000000000000000000000000000000000000000000000000000003
Arg [13] : 0000000000000000000000002f0809aa3f09b19d5e8cd869108427032683e901
Arg [14] : 00000000000000000000000000000000006c3852cbef3e08e8df289169ede581
Arg [15] : 0000000000000000000000001e0049783f008a0085193e00003d00cd54003c71


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.