Overview
APE Balance
0 APE
APE Value
$0.00More Info
Private Name Tags
ContractCreator
Latest 1 from a total of 1 transactions
Transaction Hash |
Method
|
Block
|
From
|
To
|
|||||
---|---|---|---|---|---|---|---|---|---|
0x60c03462 | 1021453 | 29 days ago | IN | 0 APE | 0.08211406 |
Loading...
Loading
Contract Name:
AlienswapV2Module
Compiler Version
v0.8.17+commit.8df45f5f
Optimization Enabled:
Yes with 200 runs
Other Settings:
default evmVersion
Contract Source Code (Solidity Standard Json-Input format)
// SPDX-License-Identifier: MIT pragma solidity ^0.8.9; import {IERC1155} from "@openzeppelin/contracts/token/ERC1155/IERC1155.sol"; import {IERC20} from "@openzeppelin/contracts/token/ERC20/IERC20.sol"; import {IERC721} from "@openzeppelin/contracts/token/ERC721/IERC721.sol"; import "@openzeppelin/contracts/token/ERC20/utils/SafeERC20.sol"; import {BaseExchangeModule} from "./BaseExchangeModule.sol"; import {BaseModule} from "../BaseModule.sol"; import {ISeaport} from "../../../interfaces/ISeaport.sol"; // Notes on the Seaport module: // - supports filling listings (both ERC721/ERC1155) // - supports filling offers (both ERC721/ERC1155) contract AlienswapV2Module is BaseExchangeModule { using SafeERC20 for IERC20; // --- Structs --- struct SeaportETHListingWithPrice { ISeaport.AdvancedOrder order; uint256 price; } // --- Fields --- ISeaport public immutable EXCHANGE; // --- Constructor --- constructor( address owner, address router, address exchange ) BaseModule(owner) BaseExchangeModule(router) { EXCHANGE = ISeaport(exchange); } // --- Fallback --- receive() external payable {} // --- WithDraw Unexpected Tokens --- function _payout(address fundsRecipient, uint256 amount) internal { (bool success, ) = payable(fundsRecipient).call{value: amount}(""); require(success, "Transfer failed"); } function withdrawETH(address to, uint256 amount) external onlyOwner { require(amount <= address(this).balance, "Insufficient balance"); if (amount > 0) { _payout(to, amount); } } function withdrawERC20(address tokenAddress, address to, uint256 amount) external onlyOwner { IERC20 token = IERC20(tokenAddress); uint256 balance = token.balanceOf(address(this)); require(amount <= balance, "Insufficient balance"); token.safeTransfer(to, amount); } function withdrawERC721(address tokenAddress, address to, uint256 tokenId) external onlyOwner { IERC721 token = IERC721(tokenAddress); require(token.ownerOf(tokenId) == address(this), "Token is not owned by contract"); token.safeTransferFrom(address(this), to, tokenId); } function withdrawERC1155( address tokenAddress, address to, uint256 tokenId, uint256 amount, bytes calldata data ) external onlyOwner { IERC1155 token = IERC1155(tokenAddress); uint256 balance = token.balanceOf(address(this), tokenId); require(amount <= balance, "Insufficient balance"); token.safeTransferFrom(address(this), to, tokenId, amount, data); } // --- Single ETH listing --- function acceptETHListing( ISeaport.AdvancedOrder calldata order, ETHListingParams calldata params, Fee[] calldata fees ) external payable nonReentrant refundETHLeftover(params.refundTo) chargeETHFees(fees, params.amount) { // Execute the fill params.revertIfIncomplete ? _fillSingleOrderWithRevertIfIncomplete( order, new ISeaport.CriteriaResolver[](0), params.fillTo, params.amount ) : _fillSingleOrder(order, new ISeaport.CriteriaResolver[](0), params.fillTo, params.amount); } // --- Single ERC20 listing --- function acceptERC20Listing( ISeaport.AdvancedOrder calldata order, ERC20ListingParams calldata params, Fee[] calldata fees ) external nonReentrant refundERC20Leftover(params.refundTo, params.token) chargeERC20Fees(fees, params.token, params.amount) { // Approve the exchange if needed _approveERC20IfNeeded(params.token, address(EXCHANGE), params.amount); // Execute the fill params.revertIfIncomplete ? _fillSingleOrderWithRevertIfIncomplete( order, new ISeaport.CriteriaResolver[](0), params.fillTo, 0 ) : _fillSingleOrder(order, new ISeaport.CriteriaResolver[](0), params.fillTo, 0); } // --- Multiple ETH listings --- function acceptETHListings( SeaportETHListingWithPrice[] calldata orders, ETHListingParams calldata params, Fee[] calldata fees ) external payable nonReentrant refundETHLeftover(params.refundTo) chargeETHFees(fees, params.amount) { uint256 length = orders.length; ISeaport.CriteriaResolver[] memory criteriaResolvers = new ISeaport.CriteriaResolver[](0); // Execute the fills if (params.revertIfIncomplete) { for (uint256 i; i < length; ) { _fillSingleOrderWithRevertIfIncomplete( orders[i].order, criteriaResolvers, params.fillTo, orders[i].price ); unchecked { ++i; } } } else { for (uint256 i; i < length; ) { _fillSingleOrder(orders[i].order, criteriaResolvers, params.fillTo, orders[i].price); unchecked { ++i; } } } } // --- Multiple ERC20 listings --- function acceptERC20Listings( ISeaport.AdvancedOrder[] calldata orders, ERC20ListingParams calldata params, Fee[] calldata fees ) external nonReentrant refundERC20Leftover(params.refundTo, params.token) chargeERC20Fees(fees, params.token, params.amount) { // Approve the exchange if needed _approveERC20IfNeeded(params.token, address(EXCHANGE), params.amount); uint256 length = orders.length; ISeaport.CriteriaResolver[] memory criteriaResolvers = new ISeaport.CriteriaResolver[](0); // Execute the fills if (params.revertIfIncomplete) { for (uint256 i; i < length; ) { _fillSingleOrderWithRevertIfIncomplete(orders[i], criteriaResolvers, params.fillTo, 0); unchecked { ++i; } } } else { for (uint256 i; i < length; ) { _fillSingleOrder(orders[i], criteriaResolvers, params.fillTo, 0); unchecked { ++i; } } } } // --- Single ERC721 offer --- function acceptERC721Offer( ISeaport.AdvancedOrder calldata order, // Use `memory` instead of `calldata` to avoid `Stack too deep` errors ISeaport.CriteriaResolver[] memory criteriaResolvers, OfferParams calldata params, Fee[] calldata fees ) external nonReentrant { // Extract the ERC721 token from the consideration items ISeaport.ConsiderationItem calldata nftItem = order.parameters.consideration[0]; if ( nftItem.itemType != ISeaport.ItemType.ERC721 && nftItem.itemType != ISeaport.ItemType.ERC721_WITH_CRITERIA ) { revert WrongParams(); } IERC721 nftToken = IERC721(nftItem.token); // Extract the payment token from the offer items ISeaport.OfferItem calldata paymentItem = order.parameters.offer[0]; IERC20 paymentToken = IERC20(paymentItem.token); // Approve the exchange if needed _approveERC721IfNeeded(nftToken, address(EXCHANGE)); _approveERC20IfNeeded(paymentToken, address(EXCHANGE), type(uint256).max); // Execute the fill params.revertIfIncomplete ? _fillSingleOrderWithRevertIfIncomplete(order, criteriaResolvers, address(this), 0) : _fillSingleOrder(order, criteriaResolvers, address(this), 0); uint256 identifier = nftItem.itemType == ISeaport.ItemType.ERC721 ? nftItem.identifierOrCriteria : criteriaResolvers[0].identifier; // Pay fees if (nftToken.ownerOf(identifier) != address(this)) { // Only pay fees if the fill was successful uint256 feesLength = fees.length; for (uint256 i; i < feesLength; ) { Fee memory fee = fees[i]; _sendERC20(fee.recipient, fee.amount, paymentToken); unchecked { ++i; } } } // Refund any ERC721 leftover _sendAllERC721(params.refundTo, nftToken, identifier); // Forward any left payment to the specified receiver _sendAllERC20(params.fillTo, paymentToken); } // --- Single ERC1155 offer --- function acceptERC1155Offer( ISeaport.AdvancedOrder calldata order, // Use `memory` instead of `calldata` to avoid `Stack too deep` errors ISeaport.CriteriaResolver[] memory criteriaResolvers, OfferParams calldata params, Fee[] calldata fees ) external nonReentrant { // Extract the ERC1155 token from the consideration items ISeaport.ConsiderationItem calldata nftItem = order.parameters.consideration[0]; if ( nftItem.itemType != ISeaport.ItemType.ERC1155 && nftItem.itemType != ISeaport.ItemType.ERC1155_WITH_CRITERIA ) { revert WrongParams(); } IERC1155 nftToken = IERC1155(nftItem.token); // Extract the payment token from the offer items ISeaport.OfferItem calldata paymentItem = order.parameters.offer[0]; IERC20 paymentToken = IERC20(paymentItem.token); // Approve the exchange if needed _approveERC1155IfNeeded(nftToken, address(EXCHANGE)); _approveERC20IfNeeded(paymentToken, address(EXCHANGE), type(uint256).max); uint256 identifier = nftItem.itemType == ISeaport.ItemType.ERC1155 ? nftItem.identifierOrCriteria : criteriaResolvers[0].identifier; uint256 balanceBefore = nftToken.balanceOf(address(this), identifier); // Execute the fill params.revertIfIncomplete ? _fillSingleOrderWithRevertIfIncomplete(order, criteriaResolvers, address(this), 0) : _fillSingleOrder(order, criteriaResolvers, address(this), 0); uint256 balanceAfter = nftToken.balanceOf(address(this), identifier); // Pay fees uint256 amountFilled = balanceBefore - balanceAfter; if (amountFilled > 0) { uint256 feesLength = fees.length; for (uint256 i; i < feesLength; ) { Fee memory fee = fees[i]; _sendERC20( fee.recipient, // Only pay fees for the amount that was actually filled (fee.amount * amountFilled) / order.numerator, paymentToken ); unchecked { ++i; } } } // Refund any ERC1155 leftover _sendAllERC1155(params.refundTo, nftToken, identifier); // Forward any left payment to the specified receiver _sendAllERC20(params.fillTo, paymentToken); } // --- Generic handler (used for Seaport-based approvals) --- function matchOrders( ISeaport.Order[] calldata orders, ISeaport.Fulfillment[] calldata fulfillments ) external nonReentrant { // We don't perform any kind of input or return value validation, // so this function should be used with precaution - the official // way to use it is only for Seaport-based approvals EXCHANGE.matchOrders(orders, fulfillments); } // --- ERC721 / ERC1155 hooks --- // Single token offer acceptance can be done approval-less by using the // standard `safeTransferFrom` method together with specifying data for // further contract calls. An example: // `safeTransferFrom( // 0xWALLET, // 0xMODULE, // TOKEN_ID, // 0xABI_ENCODED_ROUTER_EXECUTION_CALLDATA_FOR_OFFER_ACCEPTANCE // )` function onERC721Received( address, // operator, address, // from uint256, // tokenId, bytes calldata data ) external returns (bytes4) { if (data.length > 0) { _makeCall(router, data, 0); } return this.onERC721Received.selector; } function onERC1155Received( address, // operator address, // from uint256, // tokenId uint256, // amount bytes calldata data ) external returns (bytes4) { if (data.length > 0) { _makeCall(router, data, 0); } return this.onERC1155Received.selector; } // --- Internal --- // NOTE: In lots of cases, Seaport will not revert if fills were not // fully executed. An example of that is partial filling, which will // successfully fill any amount that is still available (including a // zero amount). One way to ensure that we revert in case of partial // executions is to check the order's filled amount before and after // we trigger the fill (we can use Seaport's `getOrderStatus` method // to check). Since this can be expensive in terms of gas, we have a // separate method variant to be called when reverts are enabled. function _fillSingleOrder( ISeaport.AdvancedOrder calldata order, // Use `memory` instead of `calldata` to avoid `Stack too deep` errors ISeaport.CriteriaResolver[] memory criteriaResolvers, address receiver, uint256 value ) internal { // Execute the fill try EXCHANGE.fulfillAdvancedOrder{value: value}(order, criteriaResolvers, bytes32(0), receiver) {} catch {} } function _fillSingleOrderWithRevertIfIncomplete( ISeaport.AdvancedOrder calldata order, // Use `memory` instead of `calldata` to avoid `Stack too deep` errors ISeaport.CriteriaResolver[] memory criteriaResolvers, address receiver, uint256 value ) internal { // Cache the order's hash bytes32 orderHash = _getOrderHash(order.parameters); // Before filling, get the order's filled amount uint256 beforeFilledAmount = _getFilledAmount(orderHash); // Execute the fill bool success; try EXCHANGE.fulfillAdvancedOrder{value: value}(order, criteriaResolvers, bytes32(0), receiver) returns (bool fulfilled) { success = fulfilled; } catch { revert UnsuccessfulFill(); } if (!success) { revert UnsuccessfulFill(); } else { // After successfully filling, get the order's filled amount uint256 afterFilledAmount = _getFilledAmount(orderHash); // Make sure the amount filled as part of this call is correct if (afterFilledAmount - beforeFilledAmount != order.numerator) { revert UnsuccessfulFill(); } } } function _getOrderHash( // Must use `memory` instead of `calldata` for the below cast ISeaport.OrderParameters memory orderParameters ) internal view returns (bytes32 orderHash) { // `OrderParameters` and `OrderComponents` share the exact same // fields, apart from the last one, so here we simply treat the // `orderParameters` argument as `OrderComponents` and then set // the last field to the correct data ISeaport.OrderComponents memory orderComponents; assembly { orderComponents := orderParameters } orderComponents.counter = EXCHANGE.getCounter(orderParameters.offerer); orderHash = EXCHANGE.getOrderHash(orderComponents); } function _getFilledAmount(bytes32 orderHash) internal view returns (uint256 totalFilled) { (, , totalFilled, ) = EXCHANGE.getOrderStatus(orderHash); } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v4.9.0) (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() { _nonReentrantBefore(); _; _nonReentrantAfter(); } function _nonReentrantBefore() private { // On the first call to nonReentrant, _status will be _NOT_ENTERED require(_status != _ENTERED, "ReentrancyGuard: reentrant call"); // Any calls to nonReentrant after this point will fail _status = _ENTERED; } function _nonReentrantAfter() private { // By storing the original value once again, a refund is triggered (see // https://eips.ethereum.org/EIPS/eip-2200) _status = _NOT_ENTERED; } /** * @dev Returns true if the reentrancy guard is currently set to "entered", which indicates there is a * `nonReentrant` function in the call stack. */ function _reentrancyGuardEntered() internal view returns (bool) { return _status == _ENTERED; } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v4.9.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; }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v4.9.0) (token/ERC20/extensions/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); }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v4.9.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); }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v4.9.3) (token/ERC20/utils/SafeERC20.sol) pragma solidity ^0.8.0; import "../IERC20.sol"; import "../extensions/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; /** * @dev Transfer `value` amount of `token` from the calling contract to `to`. If `token` returns no value, * non-reverting calls are assumed to be successful. */ function safeTransfer(IERC20 token, address to, uint256 value) internal { _callOptionalReturn(token, abi.encodeWithSelector(token.transfer.selector, to, value)); } /** * @dev Transfer `value` amount of `token` from `from` to `to`, spending the approval given by `from` to the * calling contract. If `token` returns no value, non-reverting calls are assumed to be successful. */ 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)); } /** * @dev Increase the calling contract's allowance toward `spender` by `value`. If `token` returns no value, * non-reverting calls are assumed to be successful. */ function safeIncreaseAllowance(IERC20 token, address spender, uint256 value) internal { uint256 oldAllowance = token.allowance(address(this), spender); _callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, oldAllowance + value)); } /** * @dev Decrease the calling contract's allowance toward `spender` by `value`. If `token` returns no value, * non-reverting calls are assumed to be successful. */ 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"); _callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, oldAllowance - value)); } } /** * @dev Set the calling contract's allowance toward `spender` to `value`. If `token` returns no value, * non-reverting calls are assumed to be successful. Meant to be used with tokens that require the approval * to be set to zero before setting it to a non-zero value, such as USDT. */ function forceApprove(IERC20 token, address spender, uint256 value) internal { bytes memory approvalCall = abi.encodeWithSelector(token.approve.selector, spender, value); if (!_callOptionalReturnBool(token, approvalCall)) { _callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, 0)); _callOptionalReturn(token, approvalCall); } } /** * @dev Use a ERC-2612 signature to set the `owner` approval toward `spender` on `token`. * Revert on invalid signature. */ 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"); require(returndata.length == 0 || abi.decode(returndata, (bool)), "SafeERC20: ERC20 operation 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). * * This is a variant of {_callOptionalReturn} that silents catches all reverts and returns a bool instead. */ function _callOptionalReturnBool(IERC20 token, bytes memory data) private returns (bool) { // 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 cannot use {Address-functionCall} here since this should return false // and not revert is the subcall reverts. (bool success, bytes memory returndata) = address(token).call(data); return success && (returndata.length == 0 || abi.decode(returndata, (bool))) && Address.isContract(address(token)); } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v4.9.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: Note that the caller is responsible to confirm that the recipient is capable of receiving ERC721 * or else they may be permanently lost. Usage of {safeTransferFrom} prevents loss, though the caller must * understand this adds an external call which potentially creates a reentrancy vulnerability. * * 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); }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v4.9.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 * * Furthermore, `isContract` will also return true if the target contract within * the same transaction is already scheduled for destruction by `SELFDESTRUCT`, * which only has an effect at the end of a transaction. * ==== * * [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://consensys.net/diligence/blog/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.8.0/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 functionCallWithValue(target, data, 0, "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"); (bool success, bytes memory returndata) = target.call{value: value}(data); return verifyCallResultFromTarget(target, 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) { (bool success, bytes memory returndata) = target.staticcall(data); return verifyCallResultFromTarget(target, 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) { (bool success, bytes memory returndata) = target.delegatecall(data); return verifyCallResultFromTarget(target, success, returndata, errorMessage); } /** * @dev Tool to verify that a low level call to smart-contract was successful, and revert (either by bubbling * the revert reason or using the provided one) in case of unsuccessful call or if target was not a contract. * * _Available since v4.8._ */ function verifyCallResultFromTarget( address target, bool success, bytes memory returndata, string memory errorMessage ) internal view returns (bytes memory) { if (success) { if (returndata.length == 0) { // only check isContract if the call was successful and the return data is empty // otherwise we already know that it was a contract require(isContract(target), "Address: call to non-contract"); } return returndata; } else { _revert(returndata, errorMessage); } } /** * @dev Tool to verify that a low level call was successful, and revert if it wasn't, either by bubbling the * revert reason or 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 { _revert(returndata, errorMessage); } } function _revert(bytes memory returndata, string memory errorMessage) private pure { // 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); } } }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts v4.4.1 (utils/introspection/IERC165.sol) pragma solidity ^0.8.0; /** * @dev Interface of the ERC165 standard, as defined in the * https://eips.ethereum.org/EIPS/eip-165[EIP]. * * Implementers can declare support of contract interfaces, which can then be * queried by others ({ERC165Checker}). * * For an implementation, see {ERC165}. */ interface IERC165 { /** * @dev Returns true if this contract implements the interface defined by * `interfaceId`. See the corresponding * https://eips.ethereum.org/EIPS/eip-165#how-interfaces-are-identified[EIP section] * to learn more about how these ids are created. * * This function call must use less than 30 000 gas. */ function supportsInterface(bytes4 interfaceId) external view returns (bool); }
// SPDX-License-Identifier: MIT pragma solidity ^0.8.9; interface ISeaport { enum OrderType { FULL_OPEN, PARTIAL_OPEN, FULL_RESTRICTED, PARTIAL_RESTRICTED } enum ItemType { NATIVE, ERC20, ERC721, ERC1155, ERC721_WITH_CRITERIA, ERC1155_WITH_CRITERIA } enum Side { OFFER, CONSIDERATION } struct OfferItem { ItemType itemType; address token; uint256 identifierOrCriteria; uint256 startAmount; uint256 endAmount; } struct ConsiderationItem { ItemType itemType; address token; uint256 identifierOrCriteria; uint256 startAmount; uint256 endAmount; address recipient; } struct SpentItem { ItemType itemType; address token; uint256 identifier; uint256 amount; } struct ReceivedItem { ItemType itemType; address token; uint256 identifier; uint256 amount; address recipient; } struct OrderComponents { address offerer; address zone; OfferItem[] offer; ConsiderationItem[] consideration; OrderType orderType; uint256 startTime; uint256 endTime; bytes32 zoneHash; uint256 salt; bytes32 conduitKey; uint256 counter; } struct OrderParameters { address offerer; address zone; OfferItem[] offer; ConsiderationItem[] consideration; OrderType orderType; uint256 startTime; uint256 endTime; bytes32 zoneHash; uint256 salt; bytes32 conduitKey; uint256 totalOriginalConsiderationItems; } struct Order { OrderParameters parameters; bytes signature; } struct AdvancedOrder { OrderParameters parameters; uint120 numerator; uint120 denominator; bytes signature; bytes extraData; } struct CriteriaResolver { uint256 orderIndex; Side side; uint256 index; uint256 identifier; bytes32[] criteriaProof; } struct FulfillmentComponent { uint256 orderIndex; uint256 itemIndex; } struct Fulfillment { FulfillmentComponent[] offerComponents; FulfillmentComponent[] considerationComponents; } struct Execution { ReceivedItem item; address offerer; bytes32 conduitKey; } struct ZoneParameters { bytes32 orderHash; address fulfiller; address offerer; SpentItem[] offer; ReceivedItem[] consideration; bytes extraData; bytes32[] orderHashes; uint256 startTime; uint256 endTime; bytes32 zoneHash; } struct Schema { uint256 id; bytes metadata; } function getOrderHash(OrderComponents calldata order) external view returns (bytes32 orderHash); function getOrderStatus(bytes32 orderHash) external view returns ( bool isValidated, bool isCancelled, uint256 totalFilled, uint256 totalSize ); function getCounter(address offerer) external view returns (uint256 counter); function fulfillAdvancedOrder( AdvancedOrder calldata advancedOrder, CriteriaResolver[] calldata criteriaResolvers, bytes32 fulfillerConduitKey, address recipient ) external payable returns (bool fulfilled); function fulfillAvailableAdvancedOrders( AdvancedOrder[] memory advancedOrders, CriteriaResolver[] calldata criteriaResolvers, FulfillmentComponent[][] calldata offerFulfillments, FulfillmentComponent[][] calldata considerationFulfillments, bytes32 fulfillerConduitKey, address recipient, uint256 maximumFulfilled ) external payable returns (bool[] memory availableOrders, Execution[] memory executions); function matchOrders(Order[] calldata orders, Fulfillment[] calldata fulfillments) external payable returns (Execution[] memory executions); function matchAdvancedOrders( AdvancedOrder[] calldata advancedOrders, CriteriaResolver[] calldata criteriaResolvers, Fulfillment[] calldata fulfillments, address recipient ) external payable returns (Execution[] memory executions); }
// SPDX-License-Identifier: MIT pragma solidity ^0.8.9; // Adapted from: // https://github.com/boringcrypto/BoringSolidity/blob/e74c5b22a61bfbadd645e51a64aa1d33734d577a/contracts/BoringOwnable.sol contract TwoStepOwnable { // --- Fields --- address public owner; address public pendingOwner; // --- Events --- event OwnershipTransferred(address indexed previousOwner, address indexed newOwner); // --- Errors --- error InvalidParams(); error Unauthorized(); // --- Modifiers --- modifier onlyOwner() { if (msg.sender != owner) { revert Unauthorized(); } _; } // --- Constructor --- constructor(address initialOwner) { owner = initialOwner; emit OwnershipTransferred(address(0), initialOwner); } // --- Methods --- function transferOwnership(address newOwner) public onlyOwner { pendingOwner = newOwner; } function claimOwnership() public { address _pendingOwner = pendingOwner; if (msg.sender != _pendingOwner) { revert Unauthorized(); } owner = _pendingOwner; pendingOwner = address(0); emit OwnershipTransferred(owner, _pendingOwner); } }
// SPDX-License-Identifier: MIT pragma solidity ^0.8.9; import {ReentrancyGuard} from "@openzeppelin/contracts/security/ReentrancyGuard.sol"; import {IERC20} from "@openzeppelin/contracts/token/ERC20/IERC20.sol"; import {SafeERC20} from "@openzeppelin/contracts/token/ERC20/utils/SafeERC20.sol"; import {TwoStepOwnable} from "../../misc/TwoStepOwnable.sol"; // Notes: // - includes common helpers useful for all modules abstract contract BaseModule is TwoStepOwnable, ReentrancyGuard { using SafeERC20 for IERC20; // --- Events --- event CallExecuted(address target, bytes data, uint256 value); // --- Errors --- error UnsuccessfulCall(); error UnsuccessfulPayment(); error WrongParams(); // --- Constructor --- constructor(address owner) TwoStepOwnable(owner) {} // --- Owner --- // To be able to recover anything that gets stucked by mistake in the module, // we allow the owner to perform any arbitrary call. Since the goal is to be // stateless, this should only happen in case of mistakes. In addition, this // method is also useful for withdrawing any earned trading rewards. function makeCalls( address[] calldata targets, bytes[] calldata data, uint256[] calldata values ) external payable onlyOwner nonReentrant { uint256 length = targets.length; for (uint256 i = 0; i < length; ) { _makeCall(targets[i], data[i], values[i]); emit CallExecuted(targets[i], data[i], values[i]); unchecked { ++i; } } } // --- Helpers --- function _sendETH(address to, uint256 amount) internal { if (amount > 0) { (bool success, ) = payable(to).call{value: amount}(""); if (!success) { revert UnsuccessfulPayment(); } } } function _sendERC20( address to, uint256 amount, IERC20 token ) internal { if (amount > 0) { token.safeTransfer(to, amount); } } function _makeCall( address target, bytes memory data, uint256 value ) internal { (bool success, ) = payable(target).call{value: value}(data); if (!success) { revert UnsuccessfulCall(); } } }
// SPDX-License-Identifier: MIT pragma solidity ^0.8.9; import {IERC20} from "@openzeppelin/contracts/token/ERC20/IERC20.sol"; import {SafeERC20} from "@openzeppelin/contracts/token/ERC20/utils/SafeERC20.sol"; import {IERC721} from "@openzeppelin/contracts/token/ERC721/IERC721.sol"; import {IERC1155} from "@openzeppelin/contracts/token/ERC1155/IERC1155.sol"; import {BaseModule} from "../BaseModule.sol"; // Notes: // - includes common helpers useful for all marketplace/exchange modules abstract contract BaseExchangeModule is BaseModule { using SafeERC20 for IERC20; // --- Structs --- // Every fill execution has the following parameters: // - `fillTo`: the recipient of the received items // - `refundTo`: the recipient of any refunds // - `revertIfIncomplete`: whether to revert or skip unsuccessful fills // The below `ETHListingParams` and `ERC20ListingParams` rely on the // off-chain execution encoder to ensure that the orders filled with // the passed in listing parameters exactly match (eg. order amounts // and payment tokens match). struct ETHListingParams { address fillTo; address refundTo; bool revertIfIncomplete; // The total amount of ETH to be provided when filling uint256 amount; } struct ERC20ListingParams { address fillTo; address refundTo; bool revertIfIncomplete; // The ERC20 payment token for the listings IERC20 token; // The total amount of `token` to be provided when filling uint256 amount; } struct OfferParams { address fillTo; address refundTo; bool revertIfIncomplete; } struct Fee { address recipient; uint256 amount; } // --- Fields --- address public immutable router; // --- Errors --- error UnsuccessfulFill(); // --- Constructor --- constructor(address routerAddress) { router = routerAddress; } // --- Modifiers --- modifier refundETHLeftover(address refundTo) { _; uint256 leftover = address(this).balance; if (leftover > 0) { _sendETH(refundTo, leftover); } } modifier refundERC20Leftover(address refundTo, IERC20 token) { _; uint256 leftover = token.balanceOf(address(this)); if (leftover > 0) { token.safeTransfer(refundTo, leftover); } } modifier chargeETHFees(Fee[] calldata fees, uint256 amount) { if (fees.length == 0) { _; } else { uint256 balanceBefore = address(this).balance; _; uint256 length = fees.length; if (length > 0) { uint256 balanceAfter = address(this).balance; uint256 actualPaid = balanceBefore - balanceAfter; uint256 actualFee; for (uint256 i = 0; i < length; ) { // Adjust the fee to what was actually paid actualFee = (fees[i].amount * actualPaid) / amount; if (actualFee > 0) { _sendETH(fees[i].recipient, actualFee); } unchecked { ++i; } } } } } modifier chargeERC20Fees( Fee[] calldata fees, IERC20 token, uint256 amount ) { if (fees.length == 0) { _; } else { uint256 balanceBefore = token.balanceOf(address(this)); _; uint256 length = fees.length; if (length > 0) { uint256 balanceAfter = token.balanceOf(address(this)); uint256 actualPaid = balanceBefore - balanceAfter; uint256 actualFee; for (uint256 i = 0; i < length; ) { // Adjust the fee to what was actually paid actualFee = (fees[i].amount * actualPaid) / amount; if (actualFee > 0) { token.safeTransfer(fees[i].recipient, actualFee); } unchecked { ++i; } } } } } // --- Helpers --- function _sendAllETH(address to) internal { _sendETH(to, address(this).balance); } function _sendAllERC20(address to, IERC20 token) internal { uint256 balance = token.balanceOf(address(this)); if (balance > 0) { token.safeTransfer(to, balance); } } function _sendAllERC721(address to, IERC721 token, uint256 tokenId) internal { if (token.ownerOf(tokenId) == address(this)) { token.safeTransferFrom(address(this), to, tokenId); } } function _sendAllERC1155(address to, IERC1155 token, uint256 tokenId) internal { uint256 balance = token.balanceOf(address(this), tokenId); if (balance > 0) { token.safeTransferFrom(address(this), to, tokenId, balance, ""); } } function _approveERC20IfNeeded(IERC20 token, address spender, uint256 amount) internal { uint256 allowance = token.allowance(address(this), spender); if (allowance < amount) { // Some contracts revert if trying to approve starting from a non-zero amount if (allowance > 0) { _approveERC20(address(token), spender, 0); } _approveERC20(address(token), spender, amount); } } function _approveERC721IfNeeded(IERC721 token, address operator) internal { bool isApproved = token.isApprovedForAll(address(this), operator); if (!isApproved) { token.setApprovalForAll(operator, true); } } function _approveERC1155IfNeeded(IERC1155 token, address operator) internal { bool isApproved = token.isApprovedForAll(address(this), operator); if (!isApproved) { token.setApprovalForAll(operator, true); } } function _approveERC20(address token, address spender, uint256 amount) internal { // To avoid extra calldata padding (which some contracts reject) (bool success, ) = token.call( abi.encodeWithSignature("approve(address,uint256)", spender, amount) ); if (!success) { revert UnsuccessfulFill(); } } }
{ "viaIR": true, "optimizer": { "enabled": true, "runs": 200 }, "outputSelection": { "*": { "*": [ "evm.bytecode", "evm.deployedBytecode", "devdoc", "userdoc", "metadata", "abi" ] } }, "libraries": {} }
Contract Security Audit
- No Contract Security Audit Submitted- Submit Audit Here
[{"inputs":[{"internalType":"address","name":"owner","type":"address"},{"internalType":"address","name":"router","type":"address"},{"internalType":"address","name":"exchange","type":"address"}],"stateMutability":"nonpayable","type":"constructor"},{"inputs":[],"name":"InvalidParams","type":"error"},{"inputs":[],"name":"Unauthorized","type":"error"},{"inputs":[],"name":"UnsuccessfulCall","type":"error"},{"inputs":[],"name":"UnsuccessfulFill","type":"error"},{"inputs":[],"name":"UnsuccessfulPayment","type":"error"},{"inputs":[],"name":"WrongParams","type":"error"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"target","type":"address"},{"indexed":false,"internalType":"bytes","name":"data","type":"bytes"},{"indexed":false,"internalType":"uint256","name":"value","type":"uint256"}],"name":"CallExecuted","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"previousOwner","type":"address"},{"indexed":true,"internalType":"address","name":"newOwner","type":"address"}],"name":"OwnershipTransferred","type":"event"},{"inputs":[],"name":"EXCHANGE","outputs":[{"internalType":"contract ISeaport","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"components":[{"components":[{"internalType":"address","name":"offerer","type":"address"},{"internalType":"address","name":"zone","type":"address"},{"components":[{"internalType":"enum ISeaport.ItemType","name":"itemType","type":"uint8"},{"internalType":"address","name":"token","type":"address"},{"internalType":"uint256","name":"identifierOrCriteria","type":"uint256"},{"internalType":"uint256","name":"startAmount","type":"uint256"},{"internalType":"uint256","name":"endAmount","type":"uint256"}],"internalType":"struct ISeaport.OfferItem[]","name":"offer","type":"tuple[]"},{"components":[{"internalType":"enum ISeaport.ItemType","name":"itemType","type":"uint8"},{"internalType":"address","name":"token","type":"address"},{"internalType":"uint256","name":"identifierOrCriteria","type":"uint256"},{"internalType":"uint256","name":"startAmount","type":"uint256"},{"internalType":"uint256","name":"endAmount","type":"uint256"},{"internalType":"address","name":"recipient","type":"address"}],"internalType":"struct ISeaport.ConsiderationItem[]","name":"consideration","type":"tuple[]"},{"internalType":"enum ISeaport.OrderType","name":"orderType","type":"uint8"},{"internalType":"uint256","name":"startTime","type":"uint256"},{"internalType":"uint256","name":"endTime","type":"uint256"},{"internalType":"bytes32","name":"zoneHash","type":"bytes32"},{"internalType":"uint256","name":"salt","type":"uint256"},{"internalType":"bytes32","name":"conduitKey","type":"bytes32"},{"internalType":"uint256","name":"totalOriginalConsiderationItems","type":"uint256"}],"internalType":"struct ISeaport.OrderParameters","name":"parameters","type":"tuple"},{"internalType":"uint120","name":"numerator","type":"uint120"},{"internalType":"uint120","name":"denominator","type":"uint120"},{"internalType":"bytes","name":"signature","type":"bytes"},{"internalType":"bytes","name":"extraData","type":"bytes"}],"internalType":"struct ISeaport.AdvancedOrder","name":"order","type":"tuple"},{"components":[{"internalType":"uint256","name":"orderIndex","type":"uint256"},{"internalType":"enum ISeaport.Side","name":"side","type":"uint8"},{"internalType":"uint256","name":"index","type":"uint256"},{"internalType":"uint256","name":"identifier","type":"uint256"},{"internalType":"bytes32[]","name":"criteriaProof","type":"bytes32[]"}],"internalType":"struct ISeaport.CriteriaResolver[]","name":"criteriaResolvers","type":"tuple[]"},{"components":[{"internalType":"address","name":"fillTo","type":"address"},{"internalType":"address","name":"refundTo","type":"address"},{"internalType":"bool","name":"revertIfIncomplete","type":"bool"}],"internalType":"struct BaseExchangeModule.OfferParams","name":"params","type":"tuple"},{"components":[{"internalType":"address","name":"recipient","type":"address"},{"internalType":"uint256","name":"amount","type":"uint256"}],"internalType":"struct BaseExchangeModule.Fee[]","name":"fees","type":"tuple[]"}],"name":"acceptERC1155Offer","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"components":[{"components":[{"internalType":"address","name":"offerer","type":"address"},{"internalType":"address","name":"zone","type":"address"},{"components":[{"internalType":"enum ISeaport.ItemType","name":"itemType","type":"uint8"},{"internalType":"address","name":"token","type":"address"},{"internalType":"uint256","name":"identifierOrCriteria","type":"uint256"},{"internalType":"uint256","name":"startAmount","type":"uint256"},{"internalType":"uint256","name":"endAmount","type":"uint256"}],"internalType":"struct ISeaport.OfferItem[]","name":"offer","type":"tuple[]"},{"components":[{"internalType":"enum ISeaport.ItemType","name":"itemType","type":"uint8"},{"internalType":"address","name":"token","type":"address"},{"internalType":"uint256","name":"identifierOrCriteria","type":"uint256"},{"internalType":"uint256","name":"startAmount","type":"uint256"},{"internalType":"uint256","name":"endAmount","type":"uint256"},{"internalType":"address","name":"recipient","type":"address"}],"internalType":"struct ISeaport.ConsiderationItem[]","name":"consideration","type":"tuple[]"},{"internalType":"enum ISeaport.OrderType","name":"orderType","type":"uint8"},{"internalType":"uint256","name":"startTime","type":"uint256"},{"internalType":"uint256","name":"endTime","type":"uint256"},{"internalType":"bytes32","name":"zoneHash","type":"bytes32"},{"internalType":"uint256","name":"salt","type":"uint256"},{"internalType":"bytes32","name":"conduitKey","type":"bytes32"},{"internalType":"uint256","name":"totalOriginalConsiderationItems","type":"uint256"}],"internalType":"struct ISeaport.OrderParameters","name":"parameters","type":"tuple"},{"internalType":"uint120","name":"numerator","type":"uint120"},{"internalType":"uint120","name":"denominator","type":"uint120"},{"internalType":"bytes","name":"signature","type":"bytes"},{"internalType":"bytes","name":"extraData","type":"bytes"}],"internalType":"struct ISeaport.AdvancedOrder","name":"order","type":"tuple"},{"components":[{"internalType":"address","name":"fillTo","type":"address"},{"internalType":"address","name":"refundTo","type":"address"},{"internalType":"bool","name":"revertIfIncomplete","type":"bool"},{"internalType":"contract IERC20","name":"token","type":"address"},{"internalType":"uint256","name":"amount","type":"uint256"}],"internalType":"struct BaseExchangeModule.ERC20ListingParams","name":"params","type":"tuple"},{"components":[{"internalType":"address","name":"recipient","type":"address"},{"internalType":"uint256","name":"amount","type":"uint256"}],"internalType":"struct BaseExchangeModule.Fee[]","name":"fees","type":"tuple[]"}],"name":"acceptERC20Listing","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"components":[{"components":[{"internalType":"address","name":"offerer","type":"address"},{"internalType":"address","name":"zone","type":"address"},{"components":[{"internalType":"enum ISeaport.ItemType","name":"itemType","type":"uint8"},{"internalType":"address","name":"token","type":"address"},{"internalType":"uint256","name":"identifierOrCriteria","type":"uint256"},{"internalType":"uint256","name":"startAmount","type":"uint256"},{"internalType":"uint256","name":"endAmount","type":"uint256"}],"internalType":"struct ISeaport.OfferItem[]","name":"offer","type":"tuple[]"},{"components":[{"internalType":"enum ISeaport.ItemType","name":"itemType","type":"uint8"},{"internalType":"address","name":"token","type":"address"},{"internalType":"uint256","name":"identifierOrCriteria","type":"uint256"},{"internalType":"uint256","name":"startAmount","type":"uint256"},{"internalType":"uint256","name":"endAmount","type":"uint256"},{"internalType":"address","name":"recipient","type":"address"}],"internalType":"struct ISeaport.ConsiderationItem[]","name":"consideration","type":"tuple[]"},{"internalType":"enum ISeaport.OrderType","name":"orderType","type":"uint8"},{"internalType":"uint256","name":"startTime","type":"uint256"},{"internalType":"uint256","name":"endTime","type":"uint256"},{"internalType":"bytes32","name":"zoneHash","type":"bytes32"},{"internalType":"uint256","name":"salt","type":"uint256"},{"internalType":"bytes32","name":"conduitKey","type":"bytes32"},{"internalType":"uint256","name":"totalOriginalConsiderationItems","type":"uint256"}],"internalType":"struct ISeaport.OrderParameters","name":"parameters","type":"tuple"},{"internalType":"uint120","name":"numerator","type":"uint120"},{"internalType":"uint120","name":"denominator","type":"uint120"},{"internalType":"bytes","name":"signature","type":"bytes"},{"internalType":"bytes","name":"extraData","type":"bytes"}],"internalType":"struct ISeaport.AdvancedOrder[]","name":"orders","type":"tuple[]"},{"components":[{"internalType":"address","name":"fillTo","type":"address"},{"internalType":"address","name":"refundTo","type":"address"},{"internalType":"bool","name":"revertIfIncomplete","type":"bool"},{"internalType":"contract IERC20","name":"token","type":"address"},{"internalType":"uint256","name":"amount","type":"uint256"}],"internalType":"struct BaseExchangeModule.ERC20ListingParams","name":"params","type":"tuple"},{"components":[{"internalType":"address","name":"recipient","type":"address"},{"internalType":"uint256","name":"amount","type":"uint256"}],"internalType":"struct BaseExchangeModule.Fee[]","name":"fees","type":"tuple[]"}],"name":"acceptERC20Listings","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"components":[{"components":[{"internalType":"address","name":"offerer","type":"address"},{"internalType":"address","name":"zone","type":"address"},{"components":[{"internalType":"enum ISeaport.ItemType","name":"itemType","type":"uint8"},{"internalType":"address","name":"token","type":"address"},{"internalType":"uint256","name":"identifierOrCriteria","type":"uint256"},{"internalType":"uint256","name":"startAmount","type":"uint256"},{"internalType":"uint256","name":"endAmount","type":"uint256"}],"internalType":"struct ISeaport.OfferItem[]","name":"offer","type":"tuple[]"},{"components":[{"internalType":"enum ISeaport.ItemType","name":"itemType","type":"uint8"},{"internalType":"address","name":"token","type":"address"},{"internalType":"uint256","name":"identifierOrCriteria","type":"uint256"},{"internalType":"uint256","name":"startAmount","type":"uint256"},{"internalType":"uint256","name":"endAmount","type":"uint256"},{"internalType":"address","name":"recipient","type":"address"}],"internalType":"struct ISeaport.ConsiderationItem[]","name":"consideration","type":"tuple[]"},{"internalType":"enum ISeaport.OrderType","name":"orderType","type":"uint8"},{"internalType":"uint256","name":"startTime","type":"uint256"},{"internalType":"uint256","name":"endTime","type":"uint256"},{"internalType":"bytes32","name":"zoneHash","type":"bytes32"},{"internalType":"uint256","name":"salt","type":"uint256"},{"internalType":"bytes32","name":"conduitKey","type":"bytes32"},{"internalType":"uint256","name":"totalOriginalConsiderationItems","type":"uint256"}],"internalType":"struct ISeaport.OrderParameters","name":"parameters","type":"tuple"},{"internalType":"uint120","name":"numerator","type":"uint120"},{"internalType":"uint120","name":"denominator","type":"uint120"},{"internalType":"bytes","name":"signature","type":"bytes"},{"internalType":"bytes","name":"extraData","type":"bytes"}],"internalType":"struct ISeaport.AdvancedOrder","name":"order","type":"tuple"},{"components":[{"internalType":"uint256","name":"orderIndex","type":"uint256"},{"internalType":"enum ISeaport.Side","name":"side","type":"uint8"},{"internalType":"uint256","name":"index","type":"uint256"},{"internalType":"uint256","name":"identifier","type":"uint256"},{"internalType":"bytes32[]","name":"criteriaProof","type":"bytes32[]"}],"internalType":"struct ISeaport.CriteriaResolver[]","name":"criteriaResolvers","type":"tuple[]"},{"components":[{"internalType":"address","name":"fillTo","type":"address"},{"internalType":"address","name":"refundTo","type":"address"},{"internalType":"bool","name":"revertIfIncomplete","type":"bool"}],"internalType":"struct BaseExchangeModule.OfferParams","name":"params","type":"tuple"},{"components":[{"internalType":"address","name":"recipient","type":"address"},{"internalType":"uint256","name":"amount","type":"uint256"}],"internalType":"struct BaseExchangeModule.Fee[]","name":"fees","type":"tuple[]"}],"name":"acceptERC721Offer","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"components":[{"components":[{"internalType":"address","name":"offerer","type":"address"},{"internalType":"address","name":"zone","type":"address"},{"components":[{"internalType":"enum ISeaport.ItemType","name":"itemType","type":"uint8"},{"internalType":"address","name":"token","type":"address"},{"internalType":"uint256","name":"identifierOrCriteria","type":"uint256"},{"internalType":"uint256","name":"startAmount","type":"uint256"},{"internalType":"uint256","name":"endAmount","type":"uint256"}],"internalType":"struct ISeaport.OfferItem[]","name":"offer","type":"tuple[]"},{"components":[{"internalType":"enum ISeaport.ItemType","name":"itemType","type":"uint8"},{"internalType":"address","name":"token","type":"address"},{"internalType":"uint256","name":"identifierOrCriteria","type":"uint256"},{"internalType":"uint256","name":"startAmount","type":"uint256"},{"internalType":"uint256","name":"endAmount","type":"uint256"},{"internalType":"address","name":"recipient","type":"address"}],"internalType":"struct ISeaport.ConsiderationItem[]","name":"consideration","type":"tuple[]"},{"internalType":"enum ISeaport.OrderType","name":"orderType","type":"uint8"},{"internalType":"uint256","name":"startTime","type":"uint256"},{"internalType":"uint256","name":"endTime","type":"uint256"},{"internalType":"bytes32","name":"zoneHash","type":"bytes32"},{"internalType":"uint256","name":"salt","type":"uint256"},{"internalType":"bytes32","name":"conduitKey","type":"bytes32"},{"internalType":"uint256","name":"totalOriginalConsiderationItems","type":"uint256"}],"internalType":"struct ISeaport.OrderParameters","name":"parameters","type":"tuple"},{"internalType":"uint120","name":"numerator","type":"uint120"},{"internalType":"uint120","name":"denominator","type":"uint120"},{"internalType":"bytes","name":"signature","type":"bytes"},{"internalType":"bytes","name":"extraData","type":"bytes"}],"internalType":"struct ISeaport.AdvancedOrder","name":"order","type":"tuple"},{"components":[{"internalType":"address","name":"fillTo","type":"address"},{"internalType":"address","name":"refundTo","type":"address"},{"internalType":"bool","name":"revertIfIncomplete","type":"bool"},{"internalType":"uint256","name":"amount","type":"uint256"}],"internalType":"struct BaseExchangeModule.ETHListingParams","name":"params","type":"tuple"},{"components":[{"internalType":"address","name":"recipient","type":"address"},{"internalType":"uint256","name":"amount","type":"uint256"}],"internalType":"struct BaseExchangeModule.Fee[]","name":"fees","type":"tuple[]"}],"name":"acceptETHListing","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[{"components":[{"components":[{"components":[{"internalType":"address","name":"offerer","type":"address"},{"internalType":"address","name":"zone","type":"address"},{"components":[{"internalType":"enum ISeaport.ItemType","name":"itemType","type":"uint8"},{"internalType":"address","name":"token","type":"address"},{"internalType":"uint256","name":"identifierOrCriteria","type":"uint256"},{"internalType":"uint256","name":"startAmount","type":"uint256"},{"internalType":"uint256","name":"endAmount","type":"uint256"}],"internalType":"struct ISeaport.OfferItem[]","name":"offer","type":"tuple[]"},{"components":[{"internalType":"enum ISeaport.ItemType","name":"itemType","type":"uint8"},{"internalType":"address","name":"token","type":"address"},{"internalType":"uint256","name":"identifierOrCriteria","type":"uint256"},{"internalType":"uint256","name":"startAmount","type":"uint256"},{"internalType":"uint256","name":"endAmount","type":"uint256"},{"internalType":"address","name":"recipient","type":"address"}],"internalType":"struct ISeaport.ConsiderationItem[]","name":"consideration","type":"tuple[]"},{"internalType":"enum ISeaport.OrderType","name":"orderType","type":"uint8"},{"internalType":"uint256","name":"startTime","type":"uint256"},{"internalType":"uint256","name":"endTime","type":"uint256"},{"internalType":"bytes32","name":"zoneHash","type":"bytes32"},{"internalType":"uint256","name":"salt","type":"uint256"},{"internalType":"bytes32","name":"conduitKey","type":"bytes32"},{"internalType":"uint256","name":"totalOriginalConsiderationItems","type":"uint256"}],"internalType":"struct ISeaport.OrderParameters","name":"parameters","type":"tuple"},{"internalType":"uint120","name":"numerator","type":"uint120"},{"internalType":"uint120","name":"denominator","type":"uint120"},{"internalType":"bytes","name":"signature","type":"bytes"},{"internalType":"bytes","name":"extraData","type":"bytes"}],"internalType":"struct ISeaport.AdvancedOrder","name":"order","type":"tuple"},{"internalType":"uint256","name":"price","type":"uint256"}],"internalType":"struct AlienswapV2Module.SeaportETHListingWithPrice[]","name":"orders","type":"tuple[]"},{"components":[{"internalType":"address","name":"fillTo","type":"address"},{"internalType":"address","name":"refundTo","type":"address"},{"internalType":"bool","name":"revertIfIncomplete","type":"bool"},{"internalType":"uint256","name":"amount","type":"uint256"}],"internalType":"struct BaseExchangeModule.ETHListingParams","name":"params","type":"tuple"},{"components":[{"internalType":"address","name":"recipient","type":"address"},{"internalType":"uint256","name":"amount","type":"uint256"}],"internalType":"struct BaseExchangeModule.Fee[]","name":"fees","type":"tuple[]"}],"name":"acceptETHListings","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[],"name":"claimOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address[]","name":"targets","type":"address[]"},{"internalType":"bytes[]","name":"data","type":"bytes[]"},{"internalType":"uint256[]","name":"values","type":"uint256[]"}],"name":"makeCalls","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[{"components":[{"components":[{"internalType":"address","name":"offerer","type":"address"},{"internalType":"address","name":"zone","type":"address"},{"components":[{"internalType":"enum ISeaport.ItemType","name":"itemType","type":"uint8"},{"internalType":"address","name":"token","type":"address"},{"internalType":"uint256","name":"identifierOrCriteria","type":"uint256"},{"internalType":"uint256","name":"startAmount","type":"uint256"},{"internalType":"uint256","name":"endAmount","type":"uint256"}],"internalType":"struct ISeaport.OfferItem[]","name":"offer","type":"tuple[]"},{"components":[{"internalType":"enum ISeaport.ItemType","name":"itemType","type":"uint8"},{"internalType":"address","name":"token","type":"address"},{"internalType":"uint256","name":"identifierOrCriteria","type":"uint256"},{"internalType":"uint256","name":"startAmount","type":"uint256"},{"internalType":"uint256","name":"endAmount","type":"uint256"},{"internalType":"address","name":"recipient","type":"address"}],"internalType":"struct ISeaport.ConsiderationItem[]","name":"consideration","type":"tuple[]"},{"internalType":"enum ISeaport.OrderType","name":"orderType","type":"uint8"},{"internalType":"uint256","name":"startTime","type":"uint256"},{"internalType":"uint256","name":"endTime","type":"uint256"},{"internalType":"bytes32","name":"zoneHash","type":"bytes32"},{"internalType":"uint256","name":"salt","type":"uint256"},{"internalType":"bytes32","name":"conduitKey","type":"bytes32"},{"internalType":"uint256","name":"totalOriginalConsiderationItems","type":"uint256"}],"internalType":"struct ISeaport.OrderParameters","name":"parameters","type":"tuple"},{"internalType":"bytes","name":"signature","type":"bytes"}],"internalType":"struct ISeaport.Order[]","name":"orders","type":"tuple[]"},{"components":[{"components":[{"internalType":"uint256","name":"orderIndex","type":"uint256"},{"internalType":"uint256","name":"itemIndex","type":"uint256"}],"internalType":"struct ISeaport.FulfillmentComponent[]","name":"offerComponents","type":"tuple[]"},{"components":[{"internalType":"uint256","name":"orderIndex","type":"uint256"},{"internalType":"uint256","name":"itemIndex","type":"uint256"}],"internalType":"struct ISeaport.FulfillmentComponent[]","name":"considerationComponents","type":"tuple[]"}],"internalType":"struct ISeaport.Fulfillment[]","name":"fulfillments","type":"tuple[]"}],"name":"matchOrders","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"},{"internalType":"address","name":"","type":"address"},{"internalType":"uint256","name":"","type":"uint256"},{"internalType":"uint256","name":"","type":"uint256"},{"internalType":"bytes","name":"data","type":"bytes"}],"name":"onERC1155Received","outputs":[{"internalType":"bytes4","name":"","type":"bytes4"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"","type":"address"},{"internalType":"address","name":"","type":"address"},{"internalType":"uint256","name":"","type":"uint256"},{"internalType":"bytes","name":"data","type":"bytes"}],"name":"onERC721Received","outputs":[{"internalType":"bytes4","name":"","type":"bytes4"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"owner","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"pendingOwner","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"router","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"newOwner","type":"address"}],"name":"transferOwnership","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"tokenAddress","type":"address"},{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256","name":"tokenId","type":"uint256"},{"internalType":"uint256","name":"amount","type":"uint256"},{"internalType":"bytes","name":"data","type":"bytes"}],"name":"withdrawERC1155","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"tokenAddress","type":"address"},{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256","name":"amount","type":"uint256"}],"name":"withdrawERC20","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"tokenAddress","type":"address"},{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256","name":"tokenId","type":"uint256"}],"name":"withdrawERC721","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"to","type":"address"},{"internalType":"uint256","name":"amount","type":"uint256"}],"name":"withdrawETH","outputs":[],"stateMutability":"nonpayable","type":"function"},{"stateMutability":"payable","type":"receive"}]
Contract Creation Code
60c0346200012857601f620039e038819003918201601f19168301916001600160401b038311848410176200012d5780849260609460405283398101031262000128576200004d8162000143565b620000696040620000616020850162000143565b930162000143565b600080546001600160a01b0319166001600160a01b03938416908117825560405194917f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e08180a360016002556080521660a052613887908162000159823960805181818161040f01526117d9015260a05181818161080701528181610edd015281816114c8015281816115be01528181611f8b01528181612abf01528181612b4401528181612e0501528181612f060152818161319201526132710152f35b600080fd5b634e487b7160e01b600052604160045260246000fd5b51906001600160a01b0382168203620001285756fe6080604052600436101561001b575b361561001957600080fd5b005b60003560e01c806312f3a43f146101ab578063150b7a02146101a25780632b8a88ec146101995780634025feb21461019057806344004cc1146101875780634782f7791461017e5780634e71e0c814610175578063590823091461016c5780636baab5f71461016357806376af66291461015a57806380b102ff1461015157806386f20e8c146101485780638da5cb5b1461013f578063a817440414610136578063b50e44b81461012d578063c426320314610124578063e30c39781461011b578063f23a6e6114610112578063f2fde38b146101095763f887ea400361000e576101046117c2565b61000e565b50610104611771565b5061010461172e565b50610104611704565b50610104611639565b506101046115a7565b50610104611418565b506101046113ee565b5061010461136a565b506101046111cb565b50610104611061565b50610104610e57565b50610104610d4f565b50610104610ce5565b50610104610c37565b50610104610ba4565b50610104610a8a565b5061010461074f565b5061010461039f565b506101046101e9565b9181601f840112156101e4578235916001600160401b0383116101e4576020808501948460051b0101116101e457565b600080fd5b506060806003193601126101e4576001600160401b03906004358281116101e4576102189036906004016101b4565b6024939193358281116101e4576102339036906004016101b4565b926044359081116101e45761024c9036906004016101b4565b60005491956001600160a01b03949092851633036103435761026c611915565b60005b818110610280576100196001600255565b807fa3f06cf374cf66be06f5fe85cdd3b13d9d9fdef6482f640d2de1d44c3ed7332c8787868c6103368f878f8181610307828f60019f976103028c8e6102fc8e6102f38861031a9f806103129f6102db6102eb938d8d61181f565b35976102e689610354565b611844565b96909361181f565b359336916118bd565b906119d5565b61181f565b35986102e68a610354565b95909461181f565b359160409384519687961686528c60208701528c8601916118f4565b918301520390a10161026f565b6040516282b42960e81b8152600490fd5b6001600160a01b038116036101e457565b359061037082610354565b565b9181601f840112156101e4578235916001600160401b0383116101e457602083818601950101116101e457565b50346101e45760803660031901126101e4576103bc600435610354565b6103c7602435610354565b6064356001600160401b0381116101e4576103e6903690600401610372565b806103fe575b604051630a85bd0160e11b8152602090f35b6104339161040d9136916118bd565b7f0000000000000000000000000000000000000000000000000000000000000000611999565b38806103ec565b60a09060231901126101e457602490565b908160a09103126101e45790565b50634e487b7160e01b600052604160045260246000fd5b60a081019081106001600160401b0382111761048b57604052565b610493610459565b604052565b6001600160401b03811161048b57604052565b606081019081106001600160401b0382111761048b57604052565b60c081019081106001600160401b0382111761048b57604052565b604081019081106001600160401b0382111761048b57604052565b608081019081106001600160401b0382111761048b57604052565b90601f801991011681019081106001600160401b0382111761048b57604052565b6040519061016082018281106001600160401b0382111761048b57604052565b6020906001600160401b038111610571575b60051b0190565b610579610459565b61056a565b81601f820112156101e45780359161059583610558565b926105a36040519485610517565b808452602092838086019260051b8201019283116101e4578301905b8282106105cd575050505090565b813581529083019083016105bf565b60609060431901126101e457604490565b9181601f840112156101e4578235916001600160401b0383116101e4576020808501948460061b0101116101e457565b60c06003198201126101e4576001600160401b03906004358281116101e457816106499160040161044b565b9260248035908482116101e457836023830112156101e45781600401359161067083610558565b92604061067f81519586610517565b818552602093808587019360051b850101938885116101e457818101935b8585106106d05750505050505050926106b5836105dc565b9260a4359182116101e4576106cc916004016105ed565b9091565b84358b81116101e45782019060a0828c0360231901126101e4578451906106f682610470565b848301358252604483013560028110156101e457898301526064830135868301526084830135606083015260a4830135918d83116101e45761073f8d878c96958796010161057e565b608082015281520194019361069d565b50346101e45761075e3661061d565b61076a94919294611915565b61078a61078461077a84806122b3565b60608101906122c9565b906122fe565b92600361079685612342565b61079f81612330565b141580610a42575b610a30576020916107c86107bc848701611837565b6001600160a01b031690565b936108ed6108d36107f66107bc876107f06107846107e688806122b3565b604081019061234c565b01611837565b986001600160a01b039887906108387f00000000000000000000000000000000000000000000000000000000000000008c16610832818d613730565b8d613550565b600361084382612342565b61084c81612330565b03610a1a5760400135809a5b604051627eeac760e11b808252306004830152602482018490529094918c16918f8587604481875afa968715610a0d575b6000976109e7575b50604061089e9101611d90565b156109d6576108af9030908a612db5565b60405190815230600482015260248101929092529093849190829081906044820190565b03915afa9182156109c9575b60009261099a575b50611d2a565b9182610925575b61091b886109168b6109118b8b61090c8c8501611837565b613450565b611837565b613304565b6100196001600255565b60005b81811061093557506108f4565b806109948a61094f61094a600195878b611d3f565b61239b565b805161098e9061096e908a908d906001600160a01b0316940151611d5d565b61098861097c8d8b0161240d565b6001600160781b031690565b90611d70565b906123e9565b01610928565b6109bb919250873d89116109c2575b6109b38183610517565b810190611a3a565b90386108e7565b503d6109a9565b6109d1611a49565b6108df565b6109e29030908a612a97565b6108af565b61089e919750610a05604091883d8a116109c2576109b38183610517565b979150610891565b610a15611a49565b610889565b506060610a2683612381565b510151809a610858565b604051635863f78960e01b8152600490fd5b506005610a4e85612342565b610a5781612330565b14156107a7565b60609060031901126101e457600435610a7681610354565b90602435610a8381610354565b9060443590565b50346101e457610a9936610a5e565b60008054909391906001600160a01b039081163303610343576040516331a9108f60e11b8152600481018390528593821691610af19190602082602481875afa918215610b97575b8692610b67575b50163014611c94565b803b15610b6357604051632142170760e11b81523060048201526001600160a01b03909416602485015260448401919091528290818381606481015b03925af18015610b56575b610b40575080f35b80610b4d610b5392610498565b80610cda565b80f35b610b5e611a49565b610b38565b8280fd5b610b8991925060203d8111610b90575b610b818183610517565b810190611c7f565b9038610ae8565b503d610b77565b610b9f611a49565b610ae1565b50346101e457610bb336610a5e565b6000549091906001600160a01b039081163303610343576100199316610c076040516370a0823160e01b8152306004820152602081602481865afa908115610c2a575b600091610c0c575b508411156119f7565b611a56565b610c24915060203d81116109c2576109b38183610517565b38610bfe565b610c32611a49565b610bf6565b50346101e45760403660031901126101e457600435610c5581610354565b60008054909190602435906001600160a01b039081163303610343578392610c7f478411156119f7565b82610c8957505050f35b839283928392165af1610c9a611969565b5015610ca35780f35b60405162461bcd60e51b815260206004820152600f60248201526e151c985b9cd9995c8819985a5b1959608a1b6044820152606490fd5b60009103126101e457565b50346101e457600080600319360112610d4c576001546001600160a01b03811690338290036103435782546001600160a01b03199081168317845516600155807f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e08380a380f35b80fd5b50346101e45760e03660031901126101e4576001600160401b036004358181116101e457610d819036906004016101b4565b9091610d8c3661043a565b60c4359182116101e457610da7610dd39236906004016105ed565b91610db0611915565b602081013594610dbf86610354565b606082013596610dce88610354565b6120ee565b6040516370a0823160e01b8152306004820152906020826024816001600160a01b0387165afa918215610e4a575b600092610e2a575b5081610e19576100196001600255565b610e2292611a56565b38808061091b565b610e4391925060203d81116109c2576109b38183610517565b9038610e09565b610e52611a49565b610e01565b50346101e457610e663661061d565b610e74949294939193611915565b610e8461078461077a85806122b3565b936002610e9086612342565b610e9981612330565b141580611034575b610a3057602091610eb66107bc848801611837565b93610ece6107bc856107f06107846107e68b806122b3565b966001600160a01b0396610f0e7f00000000000000000000000000000000000000000000000000000000000000008916610f08818a613730565b8a613550565b610f1a60408b01611d90565b1561102357610f2b90833091612db5565b6002610f3682612342565b610f3f81612330565b0361100e57604091500135945b6040516331a9108f60e11b8152600481018790529084826024818985165afa918215611001575b600092610fe2575b5030911603610fa2575b61091b86610916896109118989610f9d8a8501611837565b613372565b60005b818110610fb25750610f85565b80610fdc88610fc761094a6001958789611d3f565b805190880151906001600160a01b03166123e9565b01610fa5565b610ffa919250853d8711610b9057610b818183610517565b9038610f7b565b611009611a49565b610f73565b5061101a606091612381565b51015194610f4c565b61102f90833091612a97565b610f2b565b50600461104086612342565b61104981612330565b1415610ea1565b60809060231901126101e457602490565b5060c03660031901126101e4576001600160401b036004358181116101e45761108e90369060040161044b565b61109736611050565b9160a4359081116101e4576110b09036906004016105ed565b9290916110bb611915565b602080830135936110cb85610354565b60608401359580611104575050506110e4929350611dcb565b47806110f4576100196001600255565b6110fd91611e12565b388061091b565b9193926111469193874792604083013561111d81611b77565b156111a95761113f9261112e611d9a565b90359161113a83610354565b612ebe565b4790611d2a565b60005b82811061115c57505050505090506110e4565b8061117f8861117a85896111736001978a8c611d3f565b0135611d5d565b611d70565b8061118c575b5001611149565b6111a39061119e61091184888a611d3f565b611e12565b38611185565b6111c6926111b5611d9a565b9035916111c183610354565b612b1a565b61113f565b5060c03660031901126101e4576001600160401b036004358181116101e4576111f89036906004016101b4565b9161120236611050565b9060a4359081116101e45761121b9036906004016105ed565b939092611226611915565b6020808401359461123686610354565b6060850135968061124f575050506110e493945061204b565b929194939093479261125f611d9a565b61126b60408401611d90565b1561131a5760005b8481106112dc57505050505061128a904790611d2a565b60005b8281106112a057505050505090506110e4565b806112b78861117a85896111736001978a8c611d3f565b806112c4575b500161128d565b6112d69061119e61091184888a611d3f565b386112bd565b806113146112f66112f06001948988612006565b80612036565b6112ff87611837565b858d61130c868c8b612006565b013592612ebe565b01611273565b60005b84811061133257505050505061128a9061113f565b806113646113466112f06001948988612006565b61134f87611837565b858d61135c868c8b612006565b013592612b1a565b0161131d565b50346101e45760e03660031901126101e4576001600160401b036004358181116101e45761139c90369060040161044b565b906113a63661043a565b9060c4359081116101e4576113c2610dd39136906004016105ed565b906113cb611915565b6020840135936113da85610354565b6060810135956113e987610354565b611e51565b50346101e45760003660031901126101e4576000546040516001600160a01b039091168152602090f35b50346101e457604060031981813601126101e4576001600160401b03906004358281116101e45761144d9036906004016101b4565b90926024359081116101e45791611469859336906004016101b4565b91611472611915565b8451958694632a05d10160e21b8652806044870188600489015252606486019160648260051b8801019781936000925b8484106115375789600081806114c38f8e8e8e85840301602486015261286a565b0381837f00000000000000000000000000000000000000000000000000000000000000006001600160a01b03165af1801561152a575b611507576100196001600255565b611523903d806000833e61151b8183610517565b810190612417565b508061091b565b611532611a49565b6114f9565b919395969798509193986115866001916063198d820301855261159361155d8d866127e3565b9161157761156b848061251d565b898352898301906126de565b906020948486809601906127b2565b91858185039101526118f4565b9b019301940191938a9897969593916114a2565b50346101e45760003660031901126101e4576040517f00000000000000000000000000000000000000000000000000000000000000006001600160a01b03168152602090f35b60a06003198201126101e45760043561160581610354565b9160243561161281610354565b916044359160643591608435906001600160401b0382116101e4576106cc91600401610372565b50346101e457611648366115ed565b6000805490969295929491906001600160a01b03908116330361034357604051627eeac760e11b81523060048201526024810184905288969190911693906116ab90602081604481895afa9081156116f7575b88916116d9575b508611156119f7565b833b156116d557610b2d869260405198899788968795637921219560e11b87523060048801611ce0565b8580fd5b6116f1915060203d81116109c2576109b38183610517565b386116a2565b6116ff611a49565b61169b565b50346101e45760003660031901126101e4576001546040516001600160a01b039091168152602090f35b50346101e45761173d366115ed565b9350935050508061175b575b60405163f23a6e6160e01b8152602090f35b61176a9161040d9136916118bd565b3880611749565b50346101e45760203660031901126101e45760043561178f81610354565b6000546001600160a01b0391908216330361034357166bffffffffffffffffffffffff60a01b6001541617600155600080f35b50346101e45760003660031901126101e4576040517f00000000000000000000000000000000000000000000000000000000000000006001600160a01b03168152602090f35b50634e487b7160e01b600052603260045260246000fd5b919081101561182f5760051b0190565b610579611808565b3561184181610354565b90565b9190811015611886575b60051b81013590601e19813603018212156101e45701908135916001600160401b0383116101e45760200182360381136101e4579190565b61188e611808565b61184e565b6020906001600160401b0381116118b0575b601f01601f19160190565b6118b8610459565b6118a5565b9291926118c982611893565b916118d76040519384610517565b8294818452818301116101e4578281602093846000960137010152565b908060209392818452848401376000828201840152601f01601f1916010190565b60028054146119245760028055565b60405162461bcd60e51b815260206004820152601f60248201527f5265656e7472616e637947756172643a207265656e7472616e742063616c6c006044820152606490fd5b3d15611994573d9061197a82611893565b916119886040519384610517565b82523d6000602084013e565b606090565b8151600092839260209091019083906001600160a01b03165af16119bb611969565b50156119c357565b6040516322092f2f60e11b8152600490fd5b8151600093849391926020909201916001600160a01b03165af16119bb611969565b156119fe57565b60405162461bcd60e51b8152602060048201526014602482015273496e73756666696369656e742062616c616e636560601b6044820152606490fd5b908160209103126101e4575190565b506040513d6000823e3d90fd5b60405163a9059cbb60e01b60208083019182526001600160a01b039490941660248301526044808301959095529381529192611aef92916000908190611a9d606486610517565b60018060a01b03169260405194611ab3866104e1565b8786527f5361666545524332303a206c6f772d6c6576656c2063616c6c206661696c656488870152519082855af1611ae9611969565b91611be2565b805190828215928315611b5f575b50505015611b085750565b6084906040519062461bcd60e51b82526004820152602a60248201527f5361666545524332303a204552433230206f7065726174696f6e20646964206e6044820152691bdd081cdd58d8d9595960b21b6064820152fd5b611b6f9350820181019101611b81565b388281611afd565b801515036101e457565b908160209103126101e4575161184181611b77565b15611b9d57565b60405162461bcd60e51b815260206004820152601d60248201527f416464726573733a2063616c6c20746f206e6f6e2d636f6e74726163740000006044820152606490fd5b91929015611c025750815115611bf6575090565b611841903b1515611b96565b825190915015611c155750805190602001fd5b6040519062461bcd60e51b82528160208060048301528251908160248401526000935b828510611c5b575050604492506000838284010152601f80199101168101030190fd5b8481018201518686016044015293810193859350611c38565b519061037082610354565b908160209103126101e4575161184181610354565b15611c9b57565b60405162461bcd60e51b815260206004820152601e60248201527f546f6b656e206973206e6f74206f776e656420627920636f6e747261637400006044820152606490fd5b919261184196949160a094600180871b0380921685521660208401526040830152606082015281608082015201916118f4565b50634e487b7160e01b600052601160045260246000fd5b91908203918211611d3757565b610370611d13565b9190811015611d50575b60061b0190565b611d58611808565b611d49565b81810292918115918404141715611d3757565b8115611d7a570490565b634e487b7160e01b600052601260045260246000fd5b3561184181611b77565b604051602081018181106001600160401b03821117611dbe575b6040526000815290565b611dc6610459565b611db4565b6040820135611dd981611b77565b15611df85761037091611dea611d9a565b606082359261130c84610354565b61037091611e04611d9a565b606082359261135c84610354565b81611e1b575050565b6000918291829182916001600160a01b03165af1611e37611969565b5015611e3f57565b60405163d2dcf4f360e01b8152600490fd5b9091939293611e6260608401611837565b60808401359580611e7b57505050610370929350611f72565b6040516370a0823160e01b808252306004830152602096949593949293611eea936001600160a01b038716939289929091908385602481895afa948515611f65575b600095611f40575b5090611ed091611f72565b6040519081523060048201529283908180602481016108d3565b60005b828110611efe575050505050509050565b80611f158961117a858a6111736001978a8d611d3f565b80611f22575b5001611eed565b611f3a90611f3461091184888b611d3f565b87611a56565b38611f1b565b611ed092919550611f5d90853d87116109c2576109b38183610517565b949091611ec5565b611f6d611a49565b611ebd565b611fb96060830135611f8381610354565b6080840135907f00000000000000000000000000000000000000000000000000000000000000006001600160a01b031690613635565b6040820135611fc781611b77565b15611fe95761037091611fd8611d9a565b903591611fe483610354565b612db5565b61037091611ff5611d9a565b90359161200183610354565b612a97565b9190811015612029575b60051b81013590603e19813603018212156101e4570190565b612031611808565b612010565b903590609e19813603018212156101e4570190565b909291612056611d9a565b9161206360408301611d90565b156120ab5760005b85811061207a57505050509050565b806120a561208e6112f06001948a87612006565b61209786611837565b87602061130c868d8a612006565b0161206b565b60005b8581106120bd57505050509050565b806120e86120d16112f06001948a87612006565b6120da86611837565b87602061135c868d8a612006565b016120ae565b90919294939461210060608501611837565b6080850135968061211957505050610370939450612218565b6040516370a0823160e01b80825230600483015260209794969395929461216e946001600160a01b038816948a9392919084866024818a5afa9586156121e5575b6000966121be575b5090611ed09291612218565b60005b828110612182575050505050509050565b806121998961117a858a6111736001978a8d611d3f565b806121a6575b5001612171565b6121b890611f3461091184888b611d3f565b3861219f565b611ed093929196506121dc90863d88116109c2576109b38183610517565b95909192612162565b6121ed611a49565b61215a565b90916118419281101561220b575b60051b810190612036565b612213611808565b612200565b9190612229611f8360608401611837565b612231611d9a565b9061223e60408401611d90565b1561227b5760005b818110612254575050505050565b8061227561226560019385896121f2565b8561226f88611837565b91612db5565b01612246565b60005b81811061228c575050505050565b806122ad61229d60019385896121f2565b856122a788611837565b91612a97565b0161227e565b90359061015e19813603018212156101e4570190565b903590601e19813603018212156101e457018035906001600160401b0382116101e4576020019160c08202360383136101e457565b90156123075790565b611841611808565b600611156101e457565b50634e487b7160e01b600052602160045260246000fd5b6006111561233a57565b610370612319565b356118418161230f565b903590601e19813603018212156101e457018035906001600160401b0382116101e4576020019160a08202360383136101e457565b60209080511561238f570190565b612397611808565b0190565b6040813603126101e457602060405191604083018381106001600160401b038211176123dc575b60405280356123d081610354565b83520135602082015290565b6123e4610459565b6123c2565b816123f357505050565b61037092611a56565b6001600160781b038116036101e457565b35611841816123fc565b60209081818403126101e4578051906001600160401b0382116101e4570182601f820112156101e45780519161244c83610558565b93604061245b81519687610517565b848652828601918360e0809702860101948186116101e4578401925b858410612488575050505050505090565b8382038781126101e45783519161249e836104ab565b60a08092126101e4578892612505889387516124b981610470565b89516124c48161230f565b8152858a01516124d381610354565b86820152888a0151898201526060808b0151908201526080808b0151906124f982610354565b82015283528801611c74565b8382015260c087015186820152815201930192612477565b903561015e19823603018112156101e4570190565b9035601e19823603018112156101e45701602081359101916001600160401b0382116101e45760a08202360383136101e457565b9060068210156125735752565b61257b612319565b52565b9190808252602080920192916000905b82821061259c575050505090565b90919293806125b760019287356125b28161230f565b612566565b828601356125c481610354565b828060a01b03168382015260408087013590820152606080870135908201526080808701359082015260a0809101950192019092919261258e565b9035601e19823603018112156101e45701602081359101916001600160401b0382116101e45760c08202360383136101e457565b9190808252602080920192916000905b828210612651575050505090565b909192938061266760019287356125b28161230f565b8286013561267481610354565b828060a01b038091168483015260408088013590830152606080880135908301526080808801359083015260a090818801356126af81610354565b169082015260c0908101950193920190612643565b359060048210156101e457565b9060048210156125735752565b906126f9816126ec84610365565b6001600160a01b03169052565b61271861270860208401610365565b6001600160a01b03166020830152565b61275761273c61272b6040850185612532565b61016080604087015285019161257e565b61274960608501856125ff565b908483036060860152612633565b91612771612767608083016126c4565b60808401906126d1565b60a081013560a083015260c081013560c083015260e081013560e0830152610100808201359083015261012080820135908301526101408091013591015290565b9035601e19823603018112156101e45701602081359101916001600160401b0382116101e45781360383136101e457565b9035603e19823603018112156101e4570190565b9035601e19823603018112156101e45701602081359101916001600160401b0382116101e4578160061b360383136101e457565b9190808252602080920192916000905b828210612849575050505090565b8335855283810135858201526040948501949093019260019091019061283b565b90808352602080930192838260051b850194846000925b858410612892575050505050505090565b9091929394959685806128e583856001950388526128b08c886127e3565b906128d86128ce6128c184806127f7565b604080865285019161282b565b92858101906127f7565b918581850391015261282b565b990194019401929594939190612881565b90815180825260208092019182818360051b8201950193600080925b858410612923575050505050505090565b9091929394959681810384528751908660c060a09283810193855182528386015160028110156129bb575b8483015260408087015190830152606080870151908301526080958601519582015284519384905291939101919083019085905b8082106129a2575050509080600192990194019401929594939190612912565b9193806001929486518152019401920188939291612982565b6129c3612319565b61294e565b939290612a7d61037093612a6f6060936080895288612a5f612a54612a026129f0858061251d565b60a060808601526101208501906126de565b6020850135612a10816123fc565b6001600160781b0380911660a08601526040860135612a2e816123fc565b1660c0850152612a40898601866127b2565b90607f199560e087828603019101526118f4565b9260808101906127b2565b918b8403016101008c01526118f4565b9087820360208901526128f6565b600060408701526001600160a01b03909216940193909352565b90602091612ab960405194859384936339eb2ac960e21b8552600485016129c8565b038160007f00000000000000000000000000000000000000000000000000000000000000006001600160a01b03165af1612af05750565b612b109060203d8111612b13575b612b088183610517565b810190611b81565b50565b503d612afe565b9260209291612b4094604051958694859384936339eb2ac960e21b8552600485016129c8565b03917f00000000000000000000000000000000000000000000000000000000000000006001600160a01b03165af1612af05750565b81601f820112156101e457803590612b8c82610558565b92604090612b9c82519586610517565b838552602091828601918360a0809702860101948186116101e4578401925b858410612bcc575050505050505090565b86848303126101e4578487918451612be381610470565b8635612bee8161230f565b815282870135612bfd81610354565b8382015285870135868201526060808801359082015260808088013590820152815201930192612bbb565b81601f820112156101e457803590612c3f82610558565b92604090612c4f82519586610517565b838552602091828601918360c0809702860101948186116101e4578401925b858410612c7f575050505050505090565b86848303126101e4578487918451612c96816104c6565b8635612ca18161230f565b815282870135612cb081610354565b838201528587013586820152606080880135908201526080808801359082015260a08088013590612ce082610354565b820152815201930192612c6e565b610160813603126101e457612d01610538565b90612d0b81610365565b8252612d1960208201610365565b60208301526001600160401b0360408201358181116101e457612d3f9036908401612b75565b604084015260608201359081116101e457612d5d9036908301612c28565b6060830152612d6e608082016126c4565b608083015260a081013560a083015260c081013560c083015260e081013560e083015261010080820135908301526101208082013590830152610140809101359082015290565b9190612e00612dd4612dcf612dca86806122b3565b612cee565b61315f565b916020612de084613254565b9460009260405194859283926339eb2ac960e21b84528a600485016129c8565b0381847f00000000000000000000000000000000000000000000000000000000000000006001600160a01b03165af1909181612e9e575b50612e4e57604051631298f31b60e11b8152600490fd5b612e6457604051631298f31b60e11b8152600490fd5b6020612e7e612e8593612e7961097c94613254565b611d2a565b930161240d565b03612e8c57565b604051631298f31b60e11b8152600490fd5b612eb791925060203d8111612b1357612b088183610517565b9038612e37565b929190612f02906020612ed7612dcf612dca88806122b3565b93612ee185613254565b956000936040518096819482936339eb2ac960e21b84528c600485016129c8565b03917f00000000000000000000000000000000000000000000000000000000000000006001600160a01b03165af1909181612e9e5750612e4e57604051631298f31b60e11b8152600490fd5b6040519061016082018281106001600160401b03821117612fb4575b60405281610140600091828152826020820152606060408201526060808201528260808201528260a08201528260c08201528260e082015282610100820152826101208201520152565b612fbc610459565b612f6a565b90815180825260208080930193019160005b828110612fe1575050505090565b909192938260a06001928751612ff8828251612566565b8084015185841b869003168285015260408082015190830152606080820151908301526080908101519082015201950193929101612fd3565b90815180825260208080930193019160005b828110613051575050505090565b909192938260c06001928751613068828251612566565b848060a01b038085830151168584015260408083015190840152606080830151908401526080808301519084015260a0809201511690820152019501910192919092613043565b602080825282516001600160a01b03169082015260208201516001600160a01b03166040820152604082015161310c6130f661016092836060860152610180850190612fc1565b6060850151848203601f19016080860152613031565b9261311f608082015160a08501906126d1565b60a081015160c084015260c081015160e084015260e081015161010090818501528101516101209081850152810151906101409182850152015191015290565b613167612f4e565b50805160405163f07ec37360e01b81526001600160a01b0391821660048201526020926131ef9284927f0000000000000000000000000000000000000000000000000000000000000000909116908381602481855afa908115613247575b60009161322a575b5061014083015260405180809581946379df72bd60e01b8352600483016130af565b03915afa91821561321d575b60009261320757505090565b6118419250803d106109c2576109b38183610517565b613225611a49565b6131fb565b6132419150843d86116109c2576109b38183610517565b386131cd565b61324f611a49565b6131c5565b6040516346423aa760e01b815260048101919091526080816024817f00000000000000000000000000000000000000000000000000000000000000006001600160a01b03165afa9081156132f7575b6000916132ae575090565b906080823d82116132ef575b816132c760809383610517565b81010312610d4c5750806132dd60409251611b77565b6132ea6020820151611b77565b015190565b3d91506132ba565b6132ff611a49565b6132a3565b6040516370a0823160e01b8152306004820152906020826024816001600160a01b0387165afa918215613365575b600092613345575b50816123f357505050565b61335e91925060203d81116109c2576109b38183610517565b903861333a565b61336d611a49565b613332565b6040516331a9108f60e11b8152600481018490526001600160a01b03928316939192602082602481885afa918215613443575b600092613423575b501630146133ba57505050565b823b156101e457604051632142170760e11b81523060048201526001600160a01b0390921660248301526044820152906000908290818381606481015b03925af18015613416575b6134095750565b80610b4d61037092610498565b61341e611a49565b613402565b61343c91925060203d8111610b9057610b818183610517565b90386133ad565b61344b611a49565b6133a5565b604051627eeac760e11b81523060048201526024810184905290916001600160a01b0316602082604481845afa918215613543575b600092613523575b508161349a575b50505050565b803b156101e457604051637921219560e11b81523060048201526001600160a01b039390931660248401526044830193909352606482015260a06084820152600060a482018190529091829060c490829084905af18015613516575b613503575b808080613494565b80610b4d61351092610498565b386134fb565b61351e611a49565b6134f6565b61353c91925060203d81116109c2576109b38183610517565b903861348d565b61354b611a49565b613485565b604051636eb1769f60e11b81523060048201526001600160a01b038381166024830152929091831690602083604481855afa928315613628575b600093613608575b50600019928381106135a6575b5050505050565b600094859485926135f9575b60405191602083019463095ea7b360e01b86521660248301526044820152604481526135dd816104fc565b51925af16135e9611969565b5015612e8c57388080808061359f565b61360384866137e2565b6135b2565b61362191935060203d81116109c2576109b38183610517565b9138613592565b613630611a49565b61358a565b604051636eb1769f60e11b81523060048201526001600160a01b038381166024830152909392911690602084604481855afa938415613723575b600094613703575b508284106136855750505050565b60006136cb6136d982969583966136f4575b60405163095ea7b360e01b602082019081526001600160a01b03909616602482015260448101919091529182906064820190565b03601f198101835282610517565b51925af16136e5611969565b5015612e8c5738808080613494565b6136fe85876137e2565b613697565b61371c91945060203d81116109c2576109b38183610517565b9238613677565b61372b611a49565b61366f565b60405163e985e9c560e01b81523060048201526001600160a01b0383811660248301529190911690602081604481855afa9081156137d5575b6000916137b7575b501561377b575050565b803b156101e45760405163a22cb46560e01b81526001600160a01b039092166004830152600160248301526000908290818381604481016133f7565b6137cf915060203d8111612b1357612b088183610517565b38613771565b6137dd611a49565b613769565b60405163095ea7b360e01b602082019081526001600160a01b039093166024820152600060448083018290528252928392918390608081016001600160401b03811182821017613844575b60405251925af161383c611969565b5015612e8c57565b61384c610459565b61382d56fea2646970667358221220bb34e34976c2bd0b782730f7ac99705e4aeb0f04cc5b28ad34a00557f8eb74a164736f6c63430008110033000000000000000000000000c813078eeddf805768627d63bfb7043e1c5af7ff00000000000000000000000074acccde5e3ea9fcc8656b65d1373be3f355b9bf000000000000000000000000790a46e50d154a8fe012e537cc1613db80bbc9c3
Deployed Bytecode
0x6080604052600436101561001b575b361561001957600080fd5b005b60003560e01c806312f3a43f146101ab578063150b7a02146101a25780632b8a88ec146101995780634025feb21461019057806344004cc1146101875780634782f7791461017e5780634e71e0c814610175578063590823091461016c5780636baab5f71461016357806376af66291461015a57806380b102ff1461015157806386f20e8c146101485780638da5cb5b1461013f578063a817440414610136578063b50e44b81461012d578063c426320314610124578063e30c39781461011b578063f23a6e6114610112578063f2fde38b146101095763f887ea400361000e576101046117c2565b61000e565b50610104611771565b5061010461172e565b50610104611704565b50610104611639565b506101046115a7565b50610104611418565b506101046113ee565b5061010461136a565b506101046111cb565b50610104611061565b50610104610e57565b50610104610d4f565b50610104610ce5565b50610104610c37565b50610104610ba4565b50610104610a8a565b5061010461074f565b5061010461039f565b506101046101e9565b9181601f840112156101e4578235916001600160401b0383116101e4576020808501948460051b0101116101e457565b600080fd5b506060806003193601126101e4576001600160401b03906004358281116101e4576102189036906004016101b4565b6024939193358281116101e4576102339036906004016101b4565b926044359081116101e45761024c9036906004016101b4565b60005491956001600160a01b03949092851633036103435761026c611915565b60005b818110610280576100196001600255565b807fa3f06cf374cf66be06f5fe85cdd3b13d9d9fdef6482f640d2de1d44c3ed7332c8787868c6103368f878f8181610307828f60019f976103028c8e6102fc8e6102f38861031a9f806103129f6102db6102eb938d8d61181f565b35976102e689610354565b611844565b96909361181f565b359336916118bd565b906119d5565b61181f565b35986102e68a610354565b95909461181f565b359160409384519687961686528c60208701528c8601916118f4565b918301520390a10161026f565b6040516282b42960e81b8152600490fd5b6001600160a01b038116036101e457565b359061037082610354565b565b9181601f840112156101e4578235916001600160401b0383116101e457602083818601950101116101e457565b50346101e45760803660031901126101e4576103bc600435610354565b6103c7602435610354565b6064356001600160401b0381116101e4576103e6903690600401610372565b806103fe575b604051630a85bd0160e11b8152602090f35b6104339161040d9136916118bd565b7f00000000000000000000000074acccde5e3ea9fcc8656b65d1373be3f355b9bf611999565b38806103ec565b60a09060231901126101e457602490565b908160a09103126101e45790565b50634e487b7160e01b600052604160045260246000fd5b60a081019081106001600160401b0382111761048b57604052565b610493610459565b604052565b6001600160401b03811161048b57604052565b606081019081106001600160401b0382111761048b57604052565b60c081019081106001600160401b0382111761048b57604052565b604081019081106001600160401b0382111761048b57604052565b608081019081106001600160401b0382111761048b57604052565b90601f801991011681019081106001600160401b0382111761048b57604052565b6040519061016082018281106001600160401b0382111761048b57604052565b6020906001600160401b038111610571575b60051b0190565b610579610459565b61056a565b81601f820112156101e45780359161059583610558565b926105a36040519485610517565b808452602092838086019260051b8201019283116101e4578301905b8282106105cd575050505090565b813581529083019083016105bf565b60609060431901126101e457604490565b9181601f840112156101e4578235916001600160401b0383116101e4576020808501948460061b0101116101e457565b60c06003198201126101e4576001600160401b03906004358281116101e457816106499160040161044b565b9260248035908482116101e457836023830112156101e45781600401359161067083610558565b92604061067f81519586610517565b818552602093808587019360051b850101938885116101e457818101935b8585106106d05750505050505050926106b5836105dc565b9260a4359182116101e4576106cc916004016105ed565b9091565b84358b81116101e45782019060a0828c0360231901126101e4578451906106f682610470565b848301358252604483013560028110156101e457898301526064830135868301526084830135606083015260a4830135918d83116101e45761073f8d878c96958796010161057e565b608082015281520194019361069d565b50346101e45761075e3661061d565b61076a94919294611915565b61078a61078461077a84806122b3565b60608101906122c9565b906122fe565b92600361079685612342565b61079f81612330565b141580610a42575b610a30576020916107c86107bc848701611837565b6001600160a01b031690565b936108ed6108d36107f66107bc876107f06107846107e688806122b3565b604081019061234c565b01611837565b986001600160a01b039887906108387f000000000000000000000000790a46e50d154a8fe012e537cc1613db80bbc9c38c16610832818d613730565b8d613550565b600361084382612342565b61084c81612330565b03610a1a5760400135809a5b604051627eeac760e11b808252306004830152602482018490529094918c16918f8587604481875afa968715610a0d575b6000976109e7575b50604061089e9101611d90565b156109d6576108af9030908a612db5565b60405190815230600482015260248101929092529093849190829081906044820190565b03915afa9182156109c9575b60009261099a575b50611d2a565b9182610925575b61091b886109168b6109118b8b61090c8c8501611837565b613450565b611837565b613304565b6100196001600255565b60005b81811061093557506108f4565b806109948a61094f61094a600195878b611d3f565b61239b565b805161098e9061096e908a908d906001600160a01b0316940151611d5d565b61098861097c8d8b0161240d565b6001600160781b031690565b90611d70565b906123e9565b01610928565b6109bb919250873d89116109c2575b6109b38183610517565b810190611a3a565b90386108e7565b503d6109a9565b6109d1611a49565b6108df565b6109e29030908a612a97565b6108af565b61089e919750610a05604091883d8a116109c2576109b38183610517565b979150610891565b610a15611a49565b610889565b506060610a2683612381565b510151809a610858565b604051635863f78960e01b8152600490fd5b506005610a4e85612342565b610a5781612330565b14156107a7565b60609060031901126101e457600435610a7681610354565b90602435610a8381610354565b9060443590565b50346101e457610a9936610a5e565b60008054909391906001600160a01b039081163303610343576040516331a9108f60e11b8152600481018390528593821691610af19190602082602481875afa918215610b97575b8692610b67575b50163014611c94565b803b15610b6357604051632142170760e11b81523060048201526001600160a01b03909416602485015260448401919091528290818381606481015b03925af18015610b56575b610b40575080f35b80610b4d610b5392610498565b80610cda565b80f35b610b5e611a49565b610b38565b8280fd5b610b8991925060203d8111610b90575b610b818183610517565b810190611c7f565b9038610ae8565b503d610b77565b610b9f611a49565b610ae1565b50346101e457610bb336610a5e565b6000549091906001600160a01b039081163303610343576100199316610c076040516370a0823160e01b8152306004820152602081602481865afa908115610c2a575b600091610c0c575b508411156119f7565b611a56565b610c24915060203d81116109c2576109b38183610517565b38610bfe565b610c32611a49565b610bf6565b50346101e45760403660031901126101e457600435610c5581610354565b60008054909190602435906001600160a01b039081163303610343578392610c7f478411156119f7565b82610c8957505050f35b839283928392165af1610c9a611969565b5015610ca35780f35b60405162461bcd60e51b815260206004820152600f60248201526e151c985b9cd9995c8819985a5b1959608a1b6044820152606490fd5b60009103126101e457565b50346101e457600080600319360112610d4c576001546001600160a01b03811690338290036103435782546001600160a01b03199081168317845516600155807f8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e08380a380f35b80fd5b50346101e45760e03660031901126101e4576001600160401b036004358181116101e457610d819036906004016101b4565b9091610d8c3661043a565b60c4359182116101e457610da7610dd39236906004016105ed565b91610db0611915565b602081013594610dbf86610354565b606082013596610dce88610354565b6120ee565b6040516370a0823160e01b8152306004820152906020826024816001600160a01b0387165afa918215610e4a575b600092610e2a575b5081610e19576100196001600255565b610e2292611a56565b38808061091b565b610e4391925060203d81116109c2576109b38183610517565b9038610e09565b610e52611a49565b610e01565b50346101e457610e663661061d565b610e74949294939193611915565b610e8461078461077a85806122b3565b936002610e9086612342565b610e9981612330565b141580611034575b610a3057602091610eb66107bc848801611837565b93610ece6107bc856107f06107846107e68b806122b3565b966001600160a01b0396610f0e7f000000000000000000000000790a46e50d154a8fe012e537cc1613db80bbc9c38916610f08818a613730565b8a613550565b610f1a60408b01611d90565b1561102357610f2b90833091612db5565b6002610f3682612342565b610f3f81612330565b0361100e57604091500135945b6040516331a9108f60e11b8152600481018790529084826024818985165afa918215611001575b600092610fe2575b5030911603610fa2575b61091b86610916896109118989610f9d8a8501611837565b613372565b60005b818110610fb25750610f85565b80610fdc88610fc761094a6001958789611d3f565b805190880151906001600160a01b03166123e9565b01610fa5565b610ffa919250853d8711610b9057610b818183610517565b9038610f7b565b611009611a49565b610f73565b5061101a606091612381565b51015194610f4c565b61102f90833091612a97565b610f2b565b50600461104086612342565b61104981612330565b1415610ea1565b60809060231901126101e457602490565b5060c03660031901126101e4576001600160401b036004358181116101e45761108e90369060040161044b565b61109736611050565b9160a4359081116101e4576110b09036906004016105ed565b9290916110bb611915565b602080830135936110cb85610354565b60608401359580611104575050506110e4929350611dcb565b47806110f4576100196001600255565b6110fd91611e12565b388061091b565b9193926111469193874792604083013561111d81611b77565b156111a95761113f9261112e611d9a565b90359161113a83610354565b612ebe565b4790611d2a565b60005b82811061115c57505050505090506110e4565b8061117f8861117a85896111736001978a8c611d3f565b0135611d5d565b611d70565b8061118c575b5001611149565b6111a39061119e61091184888a611d3f565b611e12565b38611185565b6111c6926111b5611d9a565b9035916111c183610354565b612b1a565b61113f565b5060c03660031901126101e4576001600160401b036004358181116101e4576111f89036906004016101b4565b9161120236611050565b9060a4359081116101e45761121b9036906004016105ed565b939092611226611915565b6020808401359461123686610354565b6060850135968061124f575050506110e493945061204b565b929194939093479261125f611d9a565b61126b60408401611d90565b1561131a5760005b8481106112dc57505050505061128a904790611d2a565b60005b8281106112a057505050505090506110e4565b806112b78861117a85896111736001978a8c611d3f565b806112c4575b500161128d565b6112d69061119e61091184888a611d3f565b386112bd565b806113146112f66112f06001948988612006565b80612036565b6112ff87611837565b858d61130c868c8b612006565b013592612ebe565b01611273565b60005b84811061133257505050505061128a9061113f565b806113646113466112f06001948988612006565b61134f87611837565b858d61135c868c8b612006565b013592612b1a565b0161131d565b50346101e45760e03660031901126101e4576001600160401b036004358181116101e45761139c90369060040161044b565b906113a63661043a565b9060c4359081116101e4576113c2610dd39136906004016105ed565b906113cb611915565b6020840135936113da85610354565b6060810135956113e987610354565b611e51565b50346101e45760003660031901126101e4576000546040516001600160a01b039091168152602090f35b50346101e457604060031981813601126101e4576001600160401b03906004358281116101e45761144d9036906004016101b4565b90926024359081116101e45791611469859336906004016101b4565b91611472611915565b8451958694632a05d10160e21b8652806044870188600489015252606486019160648260051b8801019781936000925b8484106115375789600081806114c38f8e8e8e85840301602486015261286a565b0381837f000000000000000000000000790a46e50d154a8fe012e537cc1613db80bbc9c36001600160a01b03165af1801561152a575b611507576100196001600255565b611523903d806000833e61151b8183610517565b810190612417565b508061091b565b611532611a49565b6114f9565b919395969798509193986115866001916063198d820301855261159361155d8d866127e3565b9161157761156b848061251d565b898352898301906126de565b906020948486809601906127b2565b91858185039101526118f4565b9b019301940191938a9897969593916114a2565b50346101e45760003660031901126101e4576040517f000000000000000000000000790a46e50d154a8fe012e537cc1613db80bbc9c36001600160a01b03168152602090f35b60a06003198201126101e45760043561160581610354565b9160243561161281610354565b916044359160643591608435906001600160401b0382116101e4576106cc91600401610372565b50346101e457611648366115ed565b6000805490969295929491906001600160a01b03908116330361034357604051627eeac760e11b81523060048201526024810184905288969190911693906116ab90602081604481895afa9081156116f7575b88916116d9575b508611156119f7565b833b156116d557610b2d869260405198899788968795637921219560e11b87523060048801611ce0565b8580fd5b6116f1915060203d81116109c2576109b38183610517565b386116a2565b6116ff611a49565b61169b565b50346101e45760003660031901126101e4576001546040516001600160a01b039091168152602090f35b50346101e45761173d366115ed565b9350935050508061175b575b60405163f23a6e6160e01b8152602090f35b61176a9161040d9136916118bd565b3880611749565b50346101e45760203660031901126101e45760043561178f81610354565b6000546001600160a01b0391908216330361034357166bffffffffffffffffffffffff60a01b6001541617600155600080f35b50346101e45760003660031901126101e4576040517f00000000000000000000000074acccde5e3ea9fcc8656b65d1373be3f355b9bf6001600160a01b03168152602090f35b50634e487b7160e01b600052603260045260246000fd5b919081101561182f5760051b0190565b610579611808565b3561184181610354565b90565b9190811015611886575b60051b81013590601e19813603018212156101e45701908135916001600160401b0383116101e45760200182360381136101e4579190565b61188e611808565b61184e565b6020906001600160401b0381116118b0575b601f01601f19160190565b6118b8610459565b6118a5565b9291926118c982611893565b916118d76040519384610517565b8294818452818301116101e4578281602093846000960137010152565b908060209392818452848401376000828201840152601f01601f1916010190565b60028054146119245760028055565b60405162461bcd60e51b815260206004820152601f60248201527f5265656e7472616e637947756172643a207265656e7472616e742063616c6c006044820152606490fd5b3d15611994573d9061197a82611893565b916119886040519384610517565b82523d6000602084013e565b606090565b8151600092839260209091019083906001600160a01b03165af16119bb611969565b50156119c357565b6040516322092f2f60e11b8152600490fd5b8151600093849391926020909201916001600160a01b03165af16119bb611969565b156119fe57565b60405162461bcd60e51b8152602060048201526014602482015273496e73756666696369656e742062616c616e636560601b6044820152606490fd5b908160209103126101e4575190565b506040513d6000823e3d90fd5b60405163a9059cbb60e01b60208083019182526001600160a01b039490941660248301526044808301959095529381529192611aef92916000908190611a9d606486610517565b60018060a01b03169260405194611ab3866104e1565b8786527f5361666545524332303a206c6f772d6c6576656c2063616c6c206661696c656488870152519082855af1611ae9611969565b91611be2565b805190828215928315611b5f575b50505015611b085750565b6084906040519062461bcd60e51b82526004820152602a60248201527f5361666545524332303a204552433230206f7065726174696f6e20646964206e6044820152691bdd081cdd58d8d9595960b21b6064820152fd5b611b6f9350820181019101611b81565b388281611afd565b801515036101e457565b908160209103126101e4575161184181611b77565b15611b9d57565b60405162461bcd60e51b815260206004820152601d60248201527f416464726573733a2063616c6c20746f206e6f6e2d636f6e74726163740000006044820152606490fd5b91929015611c025750815115611bf6575090565b611841903b1515611b96565b825190915015611c155750805190602001fd5b6040519062461bcd60e51b82528160208060048301528251908160248401526000935b828510611c5b575050604492506000838284010152601f80199101168101030190fd5b8481018201518686016044015293810193859350611c38565b519061037082610354565b908160209103126101e4575161184181610354565b15611c9b57565b60405162461bcd60e51b815260206004820152601e60248201527f546f6b656e206973206e6f74206f776e656420627920636f6e747261637400006044820152606490fd5b919261184196949160a094600180871b0380921685521660208401526040830152606082015281608082015201916118f4565b50634e487b7160e01b600052601160045260246000fd5b91908203918211611d3757565b610370611d13565b9190811015611d50575b60061b0190565b611d58611808565b611d49565b81810292918115918404141715611d3757565b8115611d7a570490565b634e487b7160e01b600052601260045260246000fd5b3561184181611b77565b604051602081018181106001600160401b03821117611dbe575b6040526000815290565b611dc6610459565b611db4565b6040820135611dd981611b77565b15611df85761037091611dea611d9a565b606082359261130c84610354565b61037091611e04611d9a565b606082359261135c84610354565b81611e1b575050565b6000918291829182916001600160a01b03165af1611e37611969565b5015611e3f57565b60405163d2dcf4f360e01b8152600490fd5b9091939293611e6260608401611837565b60808401359580611e7b57505050610370929350611f72565b6040516370a0823160e01b808252306004830152602096949593949293611eea936001600160a01b038716939289929091908385602481895afa948515611f65575b600095611f40575b5090611ed091611f72565b6040519081523060048201529283908180602481016108d3565b60005b828110611efe575050505050509050565b80611f158961117a858a6111736001978a8d611d3f565b80611f22575b5001611eed565b611f3a90611f3461091184888b611d3f565b87611a56565b38611f1b565b611ed092919550611f5d90853d87116109c2576109b38183610517565b949091611ec5565b611f6d611a49565b611ebd565b611fb96060830135611f8381610354565b6080840135907f000000000000000000000000790a46e50d154a8fe012e537cc1613db80bbc9c36001600160a01b031690613635565b6040820135611fc781611b77565b15611fe95761037091611fd8611d9a565b903591611fe483610354565b612db5565b61037091611ff5611d9a565b90359161200183610354565b612a97565b9190811015612029575b60051b81013590603e19813603018212156101e4570190565b612031611808565b612010565b903590609e19813603018212156101e4570190565b909291612056611d9a565b9161206360408301611d90565b156120ab5760005b85811061207a57505050509050565b806120a561208e6112f06001948a87612006565b61209786611837565b87602061130c868d8a612006565b0161206b565b60005b8581106120bd57505050509050565b806120e86120d16112f06001948a87612006565b6120da86611837565b87602061135c868d8a612006565b016120ae565b90919294939461210060608501611837565b6080850135968061211957505050610370939450612218565b6040516370a0823160e01b80825230600483015260209794969395929461216e946001600160a01b038816948a9392919084866024818a5afa9586156121e5575b6000966121be575b5090611ed09291612218565b60005b828110612182575050505050509050565b806121998961117a858a6111736001978a8d611d3f565b806121a6575b5001612171565b6121b890611f3461091184888b611d3f565b3861219f565b611ed093929196506121dc90863d88116109c2576109b38183610517565b95909192612162565b6121ed611a49565b61215a565b90916118419281101561220b575b60051b810190612036565b612213611808565b612200565b9190612229611f8360608401611837565b612231611d9a565b9061223e60408401611d90565b1561227b5760005b818110612254575050505050565b8061227561226560019385896121f2565b8561226f88611837565b91612db5565b01612246565b60005b81811061228c575050505050565b806122ad61229d60019385896121f2565b856122a788611837565b91612a97565b0161227e565b90359061015e19813603018212156101e4570190565b903590601e19813603018212156101e457018035906001600160401b0382116101e4576020019160c08202360383136101e457565b90156123075790565b611841611808565b600611156101e457565b50634e487b7160e01b600052602160045260246000fd5b6006111561233a57565b610370612319565b356118418161230f565b903590601e19813603018212156101e457018035906001600160401b0382116101e4576020019160a08202360383136101e457565b60209080511561238f570190565b612397611808565b0190565b6040813603126101e457602060405191604083018381106001600160401b038211176123dc575b60405280356123d081610354565b83520135602082015290565b6123e4610459565b6123c2565b816123f357505050565b61037092611a56565b6001600160781b038116036101e457565b35611841816123fc565b60209081818403126101e4578051906001600160401b0382116101e4570182601f820112156101e45780519161244c83610558565b93604061245b81519687610517565b848652828601918360e0809702860101948186116101e4578401925b858410612488575050505050505090565b8382038781126101e45783519161249e836104ab565b60a08092126101e4578892612505889387516124b981610470565b89516124c48161230f565b8152858a01516124d381610354565b86820152888a0151898201526060808b0151908201526080808b0151906124f982610354565b82015283528801611c74565b8382015260c087015186820152815201930192612477565b903561015e19823603018112156101e4570190565b9035601e19823603018112156101e45701602081359101916001600160401b0382116101e45760a08202360383136101e457565b9060068210156125735752565b61257b612319565b52565b9190808252602080920192916000905b82821061259c575050505090565b90919293806125b760019287356125b28161230f565b612566565b828601356125c481610354565b828060a01b03168382015260408087013590820152606080870135908201526080808701359082015260a0809101950192019092919261258e565b9035601e19823603018112156101e45701602081359101916001600160401b0382116101e45760c08202360383136101e457565b9190808252602080920192916000905b828210612651575050505090565b909192938061266760019287356125b28161230f565b8286013561267481610354565b828060a01b038091168483015260408088013590830152606080880135908301526080808801359083015260a090818801356126af81610354565b169082015260c0908101950193920190612643565b359060048210156101e457565b9060048210156125735752565b906126f9816126ec84610365565b6001600160a01b03169052565b61271861270860208401610365565b6001600160a01b03166020830152565b61275761273c61272b6040850185612532565b61016080604087015285019161257e565b61274960608501856125ff565b908483036060860152612633565b91612771612767608083016126c4565b60808401906126d1565b60a081013560a083015260c081013560c083015260e081013560e0830152610100808201359083015261012080820135908301526101408091013591015290565b9035601e19823603018112156101e45701602081359101916001600160401b0382116101e45781360383136101e457565b9035603e19823603018112156101e4570190565b9035601e19823603018112156101e45701602081359101916001600160401b0382116101e4578160061b360383136101e457565b9190808252602080920192916000905b828210612849575050505090565b8335855283810135858201526040948501949093019260019091019061283b565b90808352602080930192838260051b850194846000925b858410612892575050505050505090565b9091929394959685806128e583856001950388526128b08c886127e3565b906128d86128ce6128c184806127f7565b604080865285019161282b565b92858101906127f7565b918581850391015261282b565b990194019401929594939190612881565b90815180825260208092019182818360051b8201950193600080925b858410612923575050505050505090565b9091929394959681810384528751908660c060a09283810193855182528386015160028110156129bb575b8483015260408087015190830152606080870151908301526080958601519582015284519384905291939101919083019085905b8082106129a2575050509080600192990194019401929594939190612912565b9193806001929486518152019401920188939291612982565b6129c3612319565b61294e565b939290612a7d61037093612a6f6060936080895288612a5f612a54612a026129f0858061251d565b60a060808601526101208501906126de565b6020850135612a10816123fc565b6001600160781b0380911660a08601526040860135612a2e816123fc565b1660c0850152612a40898601866127b2565b90607f199560e087828603019101526118f4565b9260808101906127b2565b918b8403016101008c01526118f4565b9087820360208901526128f6565b600060408701526001600160a01b03909216940193909352565b90602091612ab960405194859384936339eb2ac960e21b8552600485016129c8565b038160007f000000000000000000000000790a46e50d154a8fe012e537cc1613db80bbc9c36001600160a01b03165af1612af05750565b612b109060203d8111612b13575b612b088183610517565b810190611b81565b50565b503d612afe565b9260209291612b4094604051958694859384936339eb2ac960e21b8552600485016129c8565b03917f000000000000000000000000790a46e50d154a8fe012e537cc1613db80bbc9c36001600160a01b03165af1612af05750565b81601f820112156101e457803590612b8c82610558565b92604090612b9c82519586610517565b838552602091828601918360a0809702860101948186116101e4578401925b858410612bcc575050505050505090565b86848303126101e4578487918451612be381610470565b8635612bee8161230f565b815282870135612bfd81610354565b8382015285870135868201526060808801359082015260808088013590820152815201930192612bbb565b81601f820112156101e457803590612c3f82610558565b92604090612c4f82519586610517565b838552602091828601918360c0809702860101948186116101e4578401925b858410612c7f575050505050505090565b86848303126101e4578487918451612c96816104c6565b8635612ca18161230f565b815282870135612cb081610354565b838201528587013586820152606080880135908201526080808801359082015260a08088013590612ce082610354565b820152815201930192612c6e565b610160813603126101e457612d01610538565b90612d0b81610365565b8252612d1960208201610365565b60208301526001600160401b0360408201358181116101e457612d3f9036908401612b75565b604084015260608201359081116101e457612d5d9036908301612c28565b6060830152612d6e608082016126c4565b608083015260a081013560a083015260c081013560c083015260e081013560e083015261010080820135908301526101208082013590830152610140809101359082015290565b9190612e00612dd4612dcf612dca86806122b3565b612cee565b61315f565b916020612de084613254565b9460009260405194859283926339eb2ac960e21b84528a600485016129c8565b0381847f000000000000000000000000790a46e50d154a8fe012e537cc1613db80bbc9c36001600160a01b03165af1909181612e9e575b50612e4e57604051631298f31b60e11b8152600490fd5b612e6457604051631298f31b60e11b8152600490fd5b6020612e7e612e8593612e7961097c94613254565b611d2a565b930161240d565b03612e8c57565b604051631298f31b60e11b8152600490fd5b612eb791925060203d8111612b1357612b088183610517565b9038612e37565b929190612f02906020612ed7612dcf612dca88806122b3565b93612ee185613254565b956000936040518096819482936339eb2ac960e21b84528c600485016129c8565b03917f000000000000000000000000790a46e50d154a8fe012e537cc1613db80bbc9c36001600160a01b03165af1909181612e9e5750612e4e57604051631298f31b60e11b8152600490fd5b6040519061016082018281106001600160401b03821117612fb4575b60405281610140600091828152826020820152606060408201526060808201528260808201528260a08201528260c08201528260e082015282610100820152826101208201520152565b612fbc610459565b612f6a565b90815180825260208080930193019160005b828110612fe1575050505090565b909192938260a06001928751612ff8828251612566565b8084015185841b869003168285015260408082015190830152606080820151908301526080908101519082015201950193929101612fd3565b90815180825260208080930193019160005b828110613051575050505090565b909192938260c06001928751613068828251612566565b848060a01b038085830151168584015260408083015190840152606080830151908401526080808301519084015260a0809201511690820152019501910192919092613043565b602080825282516001600160a01b03169082015260208201516001600160a01b03166040820152604082015161310c6130f661016092836060860152610180850190612fc1565b6060850151848203601f19016080860152613031565b9261311f608082015160a08501906126d1565b60a081015160c084015260c081015160e084015260e081015161010090818501528101516101209081850152810151906101409182850152015191015290565b613167612f4e565b50805160405163f07ec37360e01b81526001600160a01b0391821660048201526020926131ef9284927f000000000000000000000000790a46e50d154a8fe012e537cc1613db80bbc9c3909116908381602481855afa908115613247575b60009161322a575b5061014083015260405180809581946379df72bd60e01b8352600483016130af565b03915afa91821561321d575b60009261320757505090565b6118419250803d106109c2576109b38183610517565b613225611a49565b6131fb565b6132419150843d86116109c2576109b38183610517565b386131cd565b61324f611a49565b6131c5565b6040516346423aa760e01b815260048101919091526080816024817f000000000000000000000000790a46e50d154a8fe012e537cc1613db80bbc9c36001600160a01b03165afa9081156132f7575b6000916132ae575090565b906080823d82116132ef575b816132c760809383610517565b81010312610d4c5750806132dd60409251611b77565b6132ea6020820151611b77565b015190565b3d91506132ba565b6132ff611a49565b6132a3565b6040516370a0823160e01b8152306004820152906020826024816001600160a01b0387165afa918215613365575b600092613345575b50816123f357505050565b61335e91925060203d81116109c2576109b38183610517565b903861333a565b61336d611a49565b613332565b6040516331a9108f60e11b8152600481018490526001600160a01b03928316939192602082602481885afa918215613443575b600092613423575b501630146133ba57505050565b823b156101e457604051632142170760e11b81523060048201526001600160a01b0390921660248301526044820152906000908290818381606481015b03925af18015613416575b6134095750565b80610b4d61037092610498565b61341e611a49565b613402565b61343c91925060203d8111610b9057610b818183610517565b90386133ad565b61344b611a49565b6133a5565b604051627eeac760e11b81523060048201526024810184905290916001600160a01b0316602082604481845afa918215613543575b600092613523575b508161349a575b50505050565b803b156101e457604051637921219560e11b81523060048201526001600160a01b039390931660248401526044830193909352606482015260a06084820152600060a482018190529091829060c490829084905af18015613516575b613503575b808080613494565b80610b4d61351092610498565b386134fb565b61351e611a49565b6134f6565b61353c91925060203d81116109c2576109b38183610517565b903861348d565b61354b611a49565b613485565b604051636eb1769f60e11b81523060048201526001600160a01b038381166024830152929091831690602083604481855afa928315613628575b600093613608575b50600019928381106135a6575b5050505050565b600094859485926135f9575b60405191602083019463095ea7b360e01b86521660248301526044820152604481526135dd816104fc565b51925af16135e9611969565b5015612e8c57388080808061359f565b61360384866137e2565b6135b2565b61362191935060203d81116109c2576109b38183610517565b9138613592565b613630611a49565b61358a565b604051636eb1769f60e11b81523060048201526001600160a01b038381166024830152909392911690602084604481855afa938415613723575b600094613703575b508284106136855750505050565b60006136cb6136d982969583966136f4575b60405163095ea7b360e01b602082019081526001600160a01b03909616602482015260448101919091529182906064820190565b03601f198101835282610517565b51925af16136e5611969565b5015612e8c5738808080613494565b6136fe85876137e2565b613697565b61371c91945060203d81116109c2576109b38183610517565b9238613677565b61372b611a49565b61366f565b60405163e985e9c560e01b81523060048201526001600160a01b0383811660248301529190911690602081604481855afa9081156137d5575b6000916137b7575b501561377b575050565b803b156101e45760405163a22cb46560e01b81526001600160a01b039092166004830152600160248301526000908290818381604481016133f7565b6137cf915060203d8111612b1357612b088183610517565b38613771565b6137dd611a49565b613769565b60405163095ea7b360e01b602082019081526001600160a01b039093166024820152600060448083018290528252928392918390608081016001600160401b03811182821017613844575b60405251925af161383c611969565b5015612e8c57565b61384c610459565b61382d56fea2646970667358221220bb34e34976c2bd0b782730f7ac99705e4aeb0f04cc5b28ad34a00557f8eb74a164736f6c63430008110033
Constructor Arguments (ABI-Encoded and is the last bytes of the Contract Creation Code above)
000000000000000000000000c813078eeddf805768627d63bfb7043e1c5af7ff00000000000000000000000074acccde5e3ea9fcc8656b65d1373be3f355b9bf000000000000000000000000790a46e50d154a8fe012e537cc1613db80bbc9c3
-----Decoded View---------------
Arg [0] : owner (address): 0xc813078EeddF805768627D63BFB7043e1C5af7Ff
Arg [1] : router (address): 0x74ACCcDe5e3Ea9Fcc8656B65d1373Be3f355b9Bf
Arg [2] : exchange (address): 0x790A46E50D154A8fE012E537cc1613dB80BbC9c3
-----Encoded View---------------
3 Constructor Arguments found :
Arg [0] : 000000000000000000000000c813078eeddf805768627d63bfb7043e1c5af7ff
Arg [1] : 00000000000000000000000074acccde5e3ea9fcc8656b65d1373be3f355b9bf
Arg [2] : 000000000000000000000000790a46e50d154a8fe012e537cc1613db80bbc9c3
Loading...
Loading
Loading...
Loading
Multichain Portfolio | 30 Chains
Chain | Token | Portfolio % | Price | Amount | Value |
---|
[ 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.