Source Code
Overview
ETH Balance
0 ETH
Eth Value
$0.00More Info
Private Name Tags
ContractCreator
TokenTracker
View more zero value Internal Transactions in Advanced View mode
Advanced mode:
Loading...
Loading
Loading...
Loading
Cross-Chain Transactions
Loading...
Loading
This contract may be a proxy contract. Click on More Options and select Is this a proxy? to confirm and enable the "Read as Proxy" & "Write as Proxy" tabs.
Contract Name:
DealProvider
Compiler Version
v0.8.24+commit.e11b9ed9
Optimization Enabled:
Yes with 200 runs
Other Settings:
istanbul EvmVersion
Contract Source Code (Solidity Standard Json-Input format)
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;
import "./DealProviderState.sol";
import "../Provider/BasicProvider.sol";
import "@poolzfinance/poolz-helper-v2/contracts/CalcUtils.sol";
contract DealProvider is DealProviderState, BasicProvider {
using CalcUtils for uint256;
constructor(ILockDealNFT _nftContract) {
require(address(_nftContract) != address(0x0), "invalid address");
lockDealNFT = _nftContract;
name = "DealProvider";
}
function _withdraw(
uint256 poolId,
uint256 amount
) internal override firewallProtectedSig(0x9e2bf22c) returns (uint256 withdrawnAmount, bool isFinal) {
if (poolIdToAmount[poolId] >= amount) {
poolIdToAmount[poolId] -= amount;
withdrawnAmount = amount;
isFinal = poolIdToAmount[poolId] == 0;
}
}
/// @dev Splits a pool into two pools. Used by the LockedDealNFT contract or Provider
function split(uint256 oldPoolId, uint256 newPoolId, uint256 ratio) external override firewallProtected onlyProvider {
uint256 splitAmount = poolIdToAmount[oldPoolId].calcAmount(ratio);
require(poolIdToAmount[oldPoolId] >= splitAmount, "Split amount exceeds the available amount");
poolIdToAmount[oldPoolId] -= splitAmount;
poolIdToAmount[newPoolId] = splitAmount;
}
/**@dev Providers overrides this function to add additional parameters when creating a pool.
* @param poolId The ID of the pool.
* @param params An array of additional parameters.
*/
function _registerPool(uint256 poolId, uint256[] calldata params) internal override firewallProtectedSig(0x677df66b) {
poolIdToAmount[poolId] = params[0];
emit UpdateParams(poolId, params);
}
function getParams(uint256 poolId) external view override returns (uint256[] memory params) {
uint256 leftAmount = poolIdToAmount[poolId];
params = new uint256[](1);
params[0] = leftAmount; // leftAmount
}
function getWithdrawableAmount(uint256 poolId) public view override returns (uint256) {
return poolIdToAmount[poolId];
}
}// SPDX-License-Identifier: UNLICENSED
// See LICENSE file for full license text.
// Copyright (c) Ironblocks 2024
pragma solidity ^0.8;
import {FirewallConsumerBase} from "./FirewallConsumerBase.sol";
/**
* @title Firewall Consumer
* @author David Benchimol @ Ironblocks
* @dev This contract is a parent contract that can be used to add firewall protection to any contract.
*
* The contract must initializes with the firewall contract disabled, and the deployer
* as the firewall admin.
*
*/
contract FirewallConsumer is FirewallConsumerBase(address(0), msg.sender) {
}// SPDX-License-Identifier: UNLICENSED
// See LICENSE file for full license text.
// Copyright (c) Ironblocks 2024
pragma solidity ^0.8;
import {ERC165Checker} from "@openzeppelin/contracts/utils/introspection/ERC165Checker.sol";
import {Address} from "@openzeppelin/contracts/utils/Address.sol";
import {Context} from "@openzeppelin/contracts/utils/Context.sol";
import {IFirewall} from "./interfaces/IFirewall.sol";
import {IFirewallConsumer} from "./interfaces/IFirewallConsumer.sol";
/**
* @title Firewall Consumer Base Contract
* @author David Benchimol @ Ironblocks
* @dev This contract is a parent contract that can be used to add firewall protection to any contract.
*
* The contract must define a firewall contract which will manage the policies that are applied to the contract.
* It also must define a firewall admin which will be able to add and remove policies.
*
*/
contract FirewallConsumerBase is IFirewallConsumer, Context {
// This slot is used to store the firewall address
bytes32 private constant FIREWALL_STORAGE_SLOT = bytes32(uint256(keccak256("eip1967.firewall")) - 1);
// This slot is used to store the firewall admin address
bytes32 private constant FIREWALL_ADMIN_STORAGE_SLOT = bytes32(uint256(keccak256("eip1967.firewall.admin")) - 1);
// This slot is used to store the new firewall admin address (when changing admin)
bytes32 private constant NEW_FIREWALL_ADMIN_STORAGE_SLOT = bytes32(uint256(keccak256("eip1967.new.firewall.admin")) - 1);
bytes4 private constant SUPPORTS_APPROVE_VIA_SIGNATURE_INTERFACE_ID = bytes4(0x0c908cff); // sighash of approveCallsViaSignature
// This slot is special since it's used for mappings and not a single value
bytes32 private constant APPROVED_TARGETS_MAPPING_SLOT = bytes32(uint256(keccak256("eip1967.approved.targets")) - 1);
event FirewallAdminUpdated(address newAdmin);
event FirewallUpdated(address newFirewall);
/**
* @dev modifier that will run the preExecution and postExecution hooks of the firewall, applying each of
* the subscribed policies.
*
* NOTE: Applying this modifier on functions that exit execution flow by an inline assmebly "return" call will
* prevent the postExecution hook from running - breaking the protection provided by the firewall.
* If you have any questions, please refer to the Firewall's documentation and/or contact our support.
*/
modifier firewallProtected() {
address firewall = _getAddressBySlot(FIREWALL_STORAGE_SLOT);
if (firewall == address(0)) {
_;
return;
}
uint256 value = _msgValue();
IFirewall(firewall).preExecution(_msgSender(), _msgData(), value);
_;
IFirewall(firewall).postExecution(_msgSender(), _msgData(), value);
}
/**
* @dev modifier that will run the preExecution and postExecution hooks of the firewall, applying each of
* the subscribed policies. Allows passing custom data to the firewall, not necessarily msg.data.
* Useful for checking internal function calls
*
* @param data custom data to be passed to the firewall
* NOTE: Using this modifier affects the data that is passed to the firewall, and as such it is mainly meant
* to be used by internal functions, and only in conjuction with policies that whose protection strategy
* requires this data.
*
* Using this modifier incorrectly may result in unexpected behavior.
*
* If you have any questions on how or when to use this modifier, please refer to the Firewall's documentation
* and/or contact our support.
*
* NOTE: Applying this modifier on functions that exit execution flow by an inline assmebly "return" call will
* prevent the postExecution hook from running - breaking the protection provided by the firewall.
* If you have any questions, please refer to the Firewall's documentation and/or contact our support.
*/
modifier firewallProtectedCustom(bytes memory data) {
address firewall = _getAddressBySlot(FIREWALL_STORAGE_SLOT);
if (firewall == address(0)) {
_;
return;
}
uint256 value = _msgValue();
IFirewall(firewall).preExecution(_msgSender(), data, value);
_;
IFirewall(firewall).postExecution(_msgSender(), data, value);
}
/**
* @dev identical to the rest of the modifiers in terms of logic, but makes it more
* aesthetic when all you want to pass are signatures/unique identifiers.
*
* @param selector unique identifier for the function
*
* NOTE: Using this modifier affects the data that is passed to the firewall, and as such it is mainly to
* be used by policies that whose protection strategy relies on the function's signature hahs.
*
* Using this modifier incorrectly may result in unexpected behavior.
*
* If you have any questions on how or when to use this modifier, please refer to the Firewall's documentation
* and/or contact our support.
*
* NOTE: Applying this modifier on functions that exit execution flow by an inline assmebly "return" call will
* prevent the postExecution hook from running - breaking the protection provided by the firewall.
* If you have any questions, please refer to the Firewall's documentation and/or contact our support.
*/
modifier firewallProtectedSig(bytes4 selector) {
address firewall = _getAddressBySlot(FIREWALL_STORAGE_SLOT);
if (firewall == address(0)) {
_;
return;
}
uint256 value = _msgValue();
IFirewall(firewall).preExecution(_msgSender(), abi.encodePacked(selector), value);
_;
IFirewall(firewall).postExecution(_msgSender(), abi.encodePacked(selector), value);
}
/**
* @dev modifier that will run the preExecution and postExecution hooks of the firewall invariant policy,
* applying the subscribed invariant policy
*
* NOTE: Applying this modifier on functions that exit execution flow by an inline assmebly "return" call will
* prevent the postExecution hook from running - breaking the protection provided by the firewall.
* If you have any questions, please refer to the Firewall's documentation and/or contact our support.
*/
modifier invariantProtected() {
address firewall = _getAddressBySlot(FIREWALL_STORAGE_SLOT);
if (firewall == address(0)) {
_;
return;
}
uint256 value = _msgValue();
bytes32[] memory storageSlots = IFirewall(firewall).preExecutionPrivateInvariants(_msgSender(), _msgData(), value);
bytes32[] memory preValues = _readStorage(storageSlots);
_;
bytes32[] memory postValues = _readStorage(storageSlots);
IFirewall(firewall).postExecutionPrivateInvariants(_msgSender(), _msgData(), value, preValues, postValues);
}
/**
* @dev modifier asserting that the target is approved
* @param target address of the target
*/
modifier onlyApprovedTarget(address target) {
// We use the same logic that solidity uses for mapping locations, but we add a pseudorandom
// constant "salt" instead of a constant placeholder so that there are no storage collisions
// if adding this to an upgradeable contract implementation
bytes32 _slot = keccak256(abi.encode(APPROVED_TARGETS_MAPPING_SLOT, target));
bool isApprovedTarget = _getValueBySlot(_slot) != bytes32(0);
require(isApprovedTarget, "FirewallConsumer: Not approved target");
require(ERC165Checker.supportsERC165InterfaceUnchecked(target, SUPPORTS_APPROVE_VIA_SIGNATURE_INTERFACE_ID));
_;
}
/**
* @dev modifier similar to onlyOwner, but for the firewall admin.
*/
modifier onlyFirewallAdmin() {
require(msg.sender == _getAddressBySlot(FIREWALL_ADMIN_STORAGE_SLOT), "FirewallConsumer: not firewall admin");
_;
}
/**
* @dev Initializes a contract protected by a firewall, with a firewall address and a firewall admin.
*/
constructor(
address _firewall,
address _firewallAdmin
) {
_setAddressBySlot(FIREWALL_STORAGE_SLOT, _firewall);
_setAddressBySlot(FIREWALL_ADMIN_STORAGE_SLOT, _firewallAdmin);
}
/**
* @dev Allows calling an approved external target before executing a method.
*
* This can be used for multiple purposes, but the initial one is to call `approveCallsViaSignature` before
* executing a function, allowing synchronous transaction approvals.
*
* @param target address of the target
* @param targetPayload payload to be sent to the target
* @param data data to be executed after the target call
*/
function safeFunctionCall(
address target,
bytes calldata targetPayload,
bytes calldata data
) external payable onlyApprovedTarget(target) {
(bool success, ) = target.call(targetPayload);
require(success);
require(msg.sender == _msgSender(), "FirewallConsumer: No meta transactions");
Address.functionDelegateCall(address(this), data);
}
/**
* @dev Allows firewall admin to set approved targets.
* IMPORTANT: Only set approved target if you know what you're doing. Anyone can cause this contract
* to send any data to an approved target.
*
* @param target address of the target
* @param status status of the target
*/
function setApprovedTarget(address target, bool status) external onlyFirewallAdmin {
bytes32 _slot = keccak256(abi.encode(APPROVED_TARGETS_MAPPING_SLOT, target));
assembly {
sstore(_slot, status)
}
}
/**
* @dev View function for the firewall admin
*/
function firewallAdmin() external override view returns (address) {
return _getAddressBySlot(FIREWALL_ADMIN_STORAGE_SLOT);
}
/**
* @dev Admin only function allowing the consumers admin to set the firewall address.
* @param _firewall address of the firewall
*/
function setFirewall(address _firewall) external onlyFirewallAdmin {
_setAddressBySlot(FIREWALL_STORAGE_SLOT, _firewall);
emit FirewallUpdated(_firewall);
}
/**
* @dev Admin only function, sets new firewall admin. New admin must accept.
* @param _firewallAdmin address of the new firewall admin
*/
function setFirewallAdmin(address _firewallAdmin) external onlyFirewallAdmin {
require(_firewallAdmin != address(0), "FirewallConsumer: zero address");
_setAddressBySlot(NEW_FIREWALL_ADMIN_STORAGE_SLOT, _firewallAdmin);
}
/**
* @dev Accept the role as firewall admin.
*/
function acceptFirewallAdmin() external {
require(msg.sender == _getAddressBySlot(NEW_FIREWALL_ADMIN_STORAGE_SLOT), "FirewallConsumer: not new admin");
_setAddressBySlot(FIREWALL_ADMIN_STORAGE_SLOT, msg.sender);
emit FirewallAdminUpdated(msg.sender);
}
/**
* @dev Internal helper funtion to get the msg.value
* @return value of the msg.value
*/
function _msgValue() internal view returns (uint256 value) {
// We do this because msg.value can only be accessed in payable functions.
assembly {
value := callvalue()
}
}
/**
* @dev Internal helper function to read storage slots
* @param storageSlots array of storage slots
*/
function _readStorage(bytes32[] memory storageSlots) internal view returns (bytes32[] memory) {
uint256 slotsLength = storageSlots.length;
bytes32[] memory values = new bytes32[](slotsLength);
for (uint256 i = 0; i < slotsLength; i++) {
bytes32 slotValue = _getValueBySlot(storageSlots[i]);
values[i] = slotValue;
}
return values;
}
/**
* @dev Internal helper function to set an address in a storage slot
* @param _slot storage slot
* @param _address address to be set
*/
function _setAddressBySlot(bytes32 _slot, address _address) internal {
assembly {
sstore(_slot, _address)
}
}
/**
* @dev Internal helper function to get an address from a storage slot
* @param _slot storage slot
* @return _address from the storage slot
*/
function _getAddressBySlot(bytes32 _slot) internal view returns (address _address) {
assembly {
_address := sload(_slot)
}
}
/**
* @dev Internal helper function to get a value from a storage slot
* @param _slot storage slot
* @return _value from the storage slot
*/
function _getValueBySlot(bytes32 _slot) internal view returns (bytes32 _value) {
assembly {
_value := sload(_slot)
}
}
}// SPDX-License-Identifier: UNLICENSED
// See LICENSE file for full license text.
// Copyright (c) Ironblocks 2024
pragma solidity ^0.8;
interface IFirewall {
function preExecution(address sender, bytes memory data, uint256 value) external;
function postExecution(address sender, bytes memory data, uint256 value) external;
function preExecutionPrivateInvariants(address sender, bytes memory data, uint256 value) external returns (bytes32[] calldata);
function postExecutionPrivateInvariants(
address sender,
bytes memory data,
uint256 value,
bytes32[] calldata preValues,
bytes32[] calldata postValues
) external;
}// SPDX-License-Identifier: UNLICENSED
// See LICENSE file for full license text.
// Copyright (c) Ironblocks 2024
pragma solidity ^0.8;
interface IFirewallConsumer {
function firewallAdmin() external returns (address);
}// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.9.0) (interfaces/IERC2981.sol)
pragma solidity ^0.8.0;
import "../utils/introspection/IERC165.sol";
/**
* @dev Interface for the NFT Royalty Standard.
*
* A standardized way to retrieve royalty payment information for non-fungible tokens (NFTs) to enable universal
* support for royalty payments across all NFT marketplaces and ecosystem participants.
*
* _Available since v4.5._
*/
interface IERC2981 is IERC165 {
/**
* @dev Returns how much royalty is owed and to whom, based on a sale price that may be denominated in any unit of
* exchange. The royalty amount is denominated and should be paid in that same unit of exchange.
*/
function royaltyInfo(
uint256 tokenId,
uint256 salePrice
) external view returns (address receiver, uint256 royaltyAmount);
}// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.5.0) (token/ERC721/extensions/IERC721Enumerable.sol)
pragma solidity ^0.8.0;
import "../IERC721.sol";
/**
* @title ERC-721 Non-Fungible Token Standard, optional enumeration extension
* @dev See https://eips.ethereum.org/EIPS/eip-721
*/
interface IERC721Enumerable is IERC721 {
/**
* @dev Returns the total amount of tokens stored by the contract.
*/
function totalSupply() external view returns (uint256);
/**
* @dev Returns a token ID owned by `owner` at a given `index` of its token list.
* Use along with {balanceOf} to enumerate all of ``owner``'s tokens.
*/
function tokenOfOwnerByIndex(address owner, uint256 index) external view returns (uint256);
/**
* @dev Returns a token ID at a given `index` of all the tokens stored by the contract.
* Use along with {totalSupply} to enumerate all tokens.
*/
function tokenByIndex(uint256 index) external view returns (uint256);
}// 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 (last updated v4.9.4) (utils/Context.sol)
pragma solidity ^0.8.0;
/**
* @dev Provides information about the current execution context, including the
* sender of the transaction and its data. While these are generally available
* via msg.sender and msg.data, they should not be accessed in such a direct
* manner, since when dealing with meta-transactions the account sending and
* paying for execution may not be the actual sender (as far as an application
* is concerned).
*
* This contract is only required for intermediate, library-like contracts.
*/
abstract contract Context {
function _msgSender() internal view virtual returns (address) {
return msg.sender;
}
function _msgData() internal view virtual returns (bytes calldata) {
return msg.data;
}
function _contextSuffixLength() internal view virtual returns (uint256) {
return 0;
}
}// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts v4.4.1 (utils/introspection/ERC165.sol)
pragma solidity ^0.8.0;
import "./IERC165.sol";
/**
* @dev Implementation of the {IERC165} interface.
*
* Contracts that want to implement ERC165 should inherit from this contract and override {supportsInterface} to check
* for the additional interface id that will be supported. For example:
*
* ```solidity
* function supportsInterface(bytes4 interfaceId) public view virtual override returns (bool) {
* return interfaceId == type(MyInterface).interfaceId || super.supportsInterface(interfaceId);
* }
* ```
*
* Alternatively, {ERC165Storage} provides an easier to use but more expensive implementation.
*/
abstract contract ERC165 is IERC165 {
/**
* @dev See {IERC165-supportsInterface}.
*/
function supportsInterface(bytes4 interfaceId) public view virtual override returns (bool) {
return interfaceId == type(IERC165).interfaceId;
}
}// SPDX-License-Identifier: MIT
// OpenZeppelin Contracts (last updated v4.9.0) (utils/introspection/ERC165Checker.sol)
pragma solidity ^0.8.0;
import "./IERC165.sol";
/**
* @dev Library used to query support of an interface declared via {IERC165}.
*
* Note that these functions return the actual result of the query: they do not
* `revert` if an interface is not supported. It is up to the caller to decide
* what to do in these cases.
*/
library ERC165Checker {
// As per the EIP-165 spec, no interface should ever match 0xffffffff
bytes4 private constant _INTERFACE_ID_INVALID = 0xffffffff;
/**
* @dev Returns true if `account` supports the {IERC165} interface.
*/
function supportsERC165(address account) internal view returns (bool) {
// Any contract that implements ERC165 must explicitly indicate support of
// InterfaceId_ERC165 and explicitly indicate non-support of InterfaceId_Invalid
return
supportsERC165InterfaceUnchecked(account, type(IERC165).interfaceId) &&
!supportsERC165InterfaceUnchecked(account, _INTERFACE_ID_INVALID);
}
/**
* @dev Returns true if `account` supports the interface defined by
* `interfaceId`. Support for {IERC165} itself is queried automatically.
*
* See {IERC165-supportsInterface}.
*/
function supportsInterface(address account, bytes4 interfaceId) internal view returns (bool) {
// query support of both ERC165 as per the spec and support of _interfaceId
return supportsERC165(account) && supportsERC165InterfaceUnchecked(account, interfaceId);
}
/**
* @dev Returns a boolean array where each value corresponds to the
* interfaces passed in and whether they're supported or not. This allows
* you to batch check interfaces for a contract where your expectation
* is that some interfaces may not be supported.
*
* See {IERC165-supportsInterface}.
*
* _Available since v3.4._
*/
function getSupportedInterfaces(
address account,
bytes4[] memory interfaceIds
) internal view returns (bool[] memory) {
// an array of booleans corresponding to interfaceIds and whether they're supported or not
bool[] memory interfaceIdsSupported = new bool[](interfaceIds.length);
// query support of ERC165 itself
if (supportsERC165(account)) {
// query support of each interface in interfaceIds
for (uint256 i = 0; i < interfaceIds.length; i++) {
interfaceIdsSupported[i] = supportsERC165InterfaceUnchecked(account, interfaceIds[i]);
}
}
return interfaceIdsSupported;
}
/**
* @dev Returns true if `account` supports all the interfaces defined in
* `interfaceIds`. Support for {IERC165} itself is queried automatically.
*
* Batch-querying can lead to gas savings by skipping repeated checks for
* {IERC165} support.
*
* See {IERC165-supportsInterface}.
*/
function supportsAllInterfaces(address account, bytes4[] memory interfaceIds) internal view returns (bool) {
// query support of ERC165 itself
if (!supportsERC165(account)) {
return false;
}
// query support of each interface in interfaceIds
for (uint256 i = 0; i < interfaceIds.length; i++) {
if (!supportsERC165InterfaceUnchecked(account, interfaceIds[i])) {
return false;
}
}
// all interfaces supported
return true;
}
/**
* @notice Query if a contract implements an interface, does not check ERC165 support
* @param account The address of the contract to query for support of an interface
* @param interfaceId The interface identifier, as specified in ERC-165
* @return true if the contract at account indicates support of the interface with
* identifier interfaceId, false otherwise
* @dev Assumes that account contains a contract that supports ERC165, otherwise
* the behavior of this method is undefined. This precondition can be checked
* with {supportsERC165}.
*
* Some precompiled contracts will falsely indicate support for a given interface, so caution
* should be exercised when using this function.
*
* Interface identification is specified in ERC-165.
*/
function supportsERC165InterfaceUnchecked(address account, bytes4 interfaceId) internal view returns (bool) {
// prepare call
bytes memory encodedParams = abi.encodeWithSelector(IERC165.supportsInterface.selector, interfaceId);
// perform static call
bool success;
uint256 returnSize;
uint256 returnValue;
assembly {
success := staticcall(30000, account, add(encodedParams, 0x20), mload(encodedParams), 0x00, 0x20)
returnSize := returndatasize()
returnValue := mload(0x00)
}
return success && returnSize >= 0x20 && returnValue > 0;
}
}// 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.0;
library CalcUtils {
function calcAmount(uint256 amount, uint256 rate) internal pure returns (uint256 tokenA) {
return (amount * rate) / 1e21;
}
function calcRate(uint256 tokenAValue, uint256 tokenBValue) internal pure returns (uint256 rate) {
return (tokenAValue * 1e21) / tokenBValue;
}
}// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;
import "@openzeppelin/contracts/token/ERC721/extensions/IERC721Enumerable.sol";
import "./IProvider.sol";
import "./IVaultManager.sol";
interface ILockDealNFT is IERC721Enumerable {
function approvedContracts(address contractAddress) external view returns (bool);
function mintAndTransfer(
address owner,
address token,
uint256 amount,
IProvider provider
) external returns (uint256 poolId);
function safeMintAndTransfer(
address owner,
address token,
address from,
uint256 amount,
IProvider provider,
bytes calldata data
) external returns (uint256 poolId);
function cloneVaultId(uint256 destinationPoolId, uint256 sourcePoolId) external;
function mintForProvider(address owner, IProvider provider) external returns (uint256 poolId);
function getData(uint256 poolId) external view returns (BasePoolInfo memory poolInfo);
function getFullData(uint256 poolId) external view returns (BasePoolInfo[] memory poolInfo);
function tokenOf(uint256 poolId) external view returns (address token);
function vaultManager() external view returns (IVaultManager);
function poolIdToProvider(uint256 poolId) external view returns (IProvider provider);
function getWithdrawableAmount(uint256 poolId) external view returns (uint256 withdrawalAmount);
struct BasePoolInfo {
IProvider provider;
string name;
uint256 poolId;
uint256 vaultId;
address owner;
address token;
uint256[] params;
}
}// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;
///@dev Interface for the provider contract
///@notice This interface is used by the NFT contract to call the provider contract
interface IProvider {
event UpdateParams(uint256 indexed poolId, uint256[] params);
function withdraw(uint256 tokenId) external returns (uint256 withdrawnAmount, bool isFinal);
function split(uint256 oldPoolId, uint256 newPoolId, uint256 ratio) external;
function registerPool(uint256 poolId, uint256[] calldata params) external;
function getParams(uint256 poolId) external view returns (uint256[] memory params);
function getWithdrawableAmount(uint256 poolId) external view returns (uint256 withdrawalAmount);
function currentParamsTargetLength() external view returns (uint256);
function name() external view returns (string memory);
function getSubProvidersPoolIds(uint256 poolID) external view returns (uint256[] memory poolIds);
}// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;
import "./IProvider.sol";
///@dev Interface for the simple providers
interface ISimpleProvider is IProvider {
function withdraw(uint256 poolId, uint256 amount) external returns (uint256 withdrawnAmount, bool isFinal);
}// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;
import "@openzeppelin/contracts/interfaces/IERC2981.sol";
interface IVaultManager is IERC2981 {
function depositByToken(address _tokenAddress, uint _amount) external returns (uint vaultId);
function safeDeposit(
address _tokenAddress,
uint _amount,
address _from,
bytes memory _signature
) external returns (uint vaultId);
function withdrawByVaultId(uint _vaultId, address to, uint _amount) external;
function vaultIdToTokenAddress(uint _vaultId) external view returns (address token);
function vaultIdToTradeStartTime(uint256 _vaultId) external view returns (uint256 startTime);
}// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;
library Bundable {
bytes4 public constant _INTERFACE_ID_BUNDABLE = 0x29c8a06d; // bytes4(keccak256("BUNDABLE"))
}// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;
library Refundble {
bytes4 public constant _INTERFACE_ID_REFUNDABLE = 0xb0754565; // bytes4(keccak256("REFUNDABLE"))
}// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;
/// @title DealProviderState contract
/// @notice Contains storage variables, structures
contract DealProviderState {
mapping(uint256 => uint256) public poolIdToAmount;
}// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;
import "./ProviderModifiers.sol";
import "@poolzfinance/poolz-helper-v2/contracts/interfaces/IProvider.sol";
import "@poolzfinance/poolz-helper-v2/contracts/interfaces/ISimpleProvider.sol";
import "../../ERC165/Refundble.sol";
import "../../ERC165/Bundable.sol";
import "@openzeppelin/contracts/utils/introspection/ERC165.sol";
import "@ironblocks/firewall-consumer/contracts/FirewallConsumer.sol";
abstract contract BasicProvider is ProviderModifiers, ISimpleProvider, ERC165, FirewallConsumer {
/**
* @dev Creates a new pool with the specified parameters.
* @param addresses[0] The address of the pool owner.
* @param addresses[1] The address of the token associated with the pool.
* @param params An array of pool parameters.
* @param signature The signature of the pool owner.
* @return poolId The ID of the newly created pool.
*/
function createNewPool(
address[] calldata addresses,
uint256[] calldata params,
bytes calldata signature
)
external
virtual
firewallProtected
validAddressesLength(addresses.length, 2)
validParamsLength(params.length, currentParamsTargetLength())
returns (uint256 poolId)
{
poolId = lockDealNFT.safeMintAndTransfer(addresses[0], addresses[1], msg.sender, params[0], this, signature);
_registerPool(poolId, params);
}
/// @dev used by providers to implement cascading pool creation logic.
function registerPool(
uint256 poolId,
uint256[] calldata params
) external virtual firewallProtected onlyProvider validParamsLength(params.length, currentParamsTargetLength()) {
_registerPool(poolId, params);
}
/**
* @dev used by LockedDealNFT contract to withdraw tokens from a pool.
* @param poolId The ID of the pool.
* @return withdrawnAmount The amount of tokens withdrawn.
* @return isFinal Boolean indicating whether the pool is empty after a withdrawal.
*/
function withdraw(uint256 poolId) external virtual firewallProtected override onlyNFT returns (uint256 withdrawnAmount, bool isFinal) {
(withdrawnAmount, isFinal) = _withdraw(poolId, getWithdrawableAmount(poolId));
}
/// @dev used by providers to implement cascading withdraw logic from the pool.
function withdraw(
uint256 poolId,
uint256 amount
) external virtual firewallProtected onlyProvider returns (uint256 withdrawnAmount, bool isFinal) {
(withdrawnAmount, isFinal) = _withdraw(poolId, amount);
}
function _registerPool(uint256 poolId, uint256[] calldata params) internal virtual;
function _withdraw(
uint256 poolId,
uint256 amount
) internal virtual returns (uint256 withdrawnAmount, bool isFinal) {}
function getWithdrawableAmount(uint256 poolId) public view virtual override returns (uint256);
function supportsInterface(bytes4 interfaceId) public view virtual override returns (bool) {
return
interfaceId == Refundble._INTERFACE_ID_REFUNDABLE ||
interfaceId == Bundable._INTERFACE_ID_BUNDABLE ||
interfaceId == type(ISimpleProvider).interfaceId ||
super.supportsInterface(interfaceId);
}
}// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;
import "./ProviderState.sol";
import "@openzeppelin/contracts/utils/introspection/ERC165Checker.sol";
abstract contract ProviderModifiers is ProviderState {
modifier onlyProvider() {
_onlyProvider();
_;
}
modifier validParamsLength(uint256 paramsLength, uint256 minLength) {
_validParamsLength(paramsLength, minLength);
_;
}
modifier onlyNFT() {
_onlyNFT();
_;
}
modifier validProviderAssociation(uint256 poolId, IProvider provider) {
_validProvider(poolId, provider);
_;
}
modifier validProviderId(uint256 poolId) {
_validProvider(poolId, this);
_;
}
modifier validAddressesLength(uint256 addressLength, uint256 minLength) {
_validAddressLength(addressLength, minLength);
_;
}
function _validAddressLength(uint256 addressLength, uint256 minLength) internal pure {
require(addressLength >= minLength, "invalid addresses length");
}
function _validProvider(uint256 poolId, IProvider provider) internal view {
require(lockDealNFT.poolIdToProvider(poolId) == provider, "Invalid provider poolId");
}
function _onlyNFT() internal view {
require(msg.sender == address(lockDealNFT), "only NFT contract can call this function");
}
function _validParamsLength(uint256 paramsLength, uint256 minLength) private pure {
require(paramsLength >= minLength, "invalid params length");
}
function _onlyProvider() private view {
require(lockDealNFT.approvedContracts(msg.sender), "invalid provider address");
}
function _validProviderInterface(IProvider provider, bytes4 interfaceId) internal view {
require(ERC165Checker.supportsInterface(address(provider), interfaceId), "invalid provider type");
}
}// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;
import "@poolzfinance/poolz-helper-v2/contracts/interfaces/ILockDealNFT.sol";
abstract contract ProviderState is IProvider {
///@dev Each provider sets its own name
string public name;
ILockDealNFT public lockDealNFT;
///@dev each provider decides how many parameters it needs by overriding this function
function currentParamsTargetLength() public view virtual returns (uint256) {
return 1;
}
function getSubProvidersPoolIds(uint256) public view virtual override returns (uint256[] memory poolIds) {
return poolIds;
}
}{
"evmVersion": "istanbul",
"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
Contract ABI
API[{"inputs":[{"internalType":"contract ILockDealNFT","name":"_nftContract","type":"address"}],"stateMutability":"nonpayable","type":"constructor"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"newAdmin","type":"address"}],"name":"FirewallAdminUpdated","type":"event"},{"anonymous":false,"inputs":[{"indexed":false,"internalType":"address","name":"newFirewall","type":"address"}],"name":"FirewallUpdated","type":"event"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"uint256","name":"poolId","type":"uint256"},{"indexed":false,"internalType":"uint256[]","name":"params","type":"uint256[]"}],"name":"UpdateParams","type":"event"},{"inputs":[],"name":"acceptFirewallAdmin","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address[]","name":"addresses","type":"address[]"},{"internalType":"uint256[]","name":"params","type":"uint256[]"},{"internalType":"bytes","name":"signature","type":"bytes"}],"name":"createNewPool","outputs":[{"internalType":"uint256","name":"poolId","type":"uint256"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"currentParamsTargetLength","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"firewallAdmin","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"poolId","type":"uint256"}],"name":"getParams","outputs":[{"internalType":"uint256[]","name":"params","type":"uint256[]"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"","type":"uint256"}],"name":"getSubProvidersPoolIds","outputs":[{"internalType":"uint256[]","name":"poolIds","type":"uint256[]"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"poolId","type":"uint256"}],"name":"getWithdrawableAmount","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"lockDealNFT","outputs":[{"internalType":"contract ILockDealNFT","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"name","outputs":[{"internalType":"string","name":"","type":"string"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"","type":"uint256"}],"name":"poolIdToAmount","outputs":[{"internalType":"uint256","name":"","type":"uint256"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"poolId","type":"uint256"},{"internalType":"uint256[]","name":"params","type":"uint256[]"}],"name":"registerPool","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"target","type":"address"},{"internalType":"bytes","name":"targetPayload","type":"bytes"},{"internalType":"bytes","name":"data","type":"bytes"}],"name":"safeFunctionCall","outputs":[],"stateMutability":"payable","type":"function"},{"inputs":[{"internalType":"address","name":"target","type":"address"},{"internalType":"bool","name":"status","type":"bool"}],"name":"setApprovedTarget","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_firewall","type":"address"}],"name":"setFirewall","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"_firewallAdmin","type":"address"}],"name":"setFirewallAdmin","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"oldPoolId","type":"uint256"},{"internalType":"uint256","name":"newPoolId","type":"uint256"},{"internalType":"uint256","name":"ratio","type":"uint256"}],"name":"split","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"bytes4","name":"interfaceId","type":"bytes4"}],"name":"supportsInterface","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"uint256","name":"poolId","type":"uint256"}],"name":"withdraw","outputs":[{"internalType":"uint256","name":"withdrawnAmount","type":"uint256"},{"internalType":"bool","name":"isFinal","type":"bool"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"uint256","name":"poolId","type":"uint256"},{"internalType":"uint256","name":"amount","type":"uint256"}],"name":"withdraw","outputs":[{"internalType":"uint256","name":"withdrawnAmount","type":"uint256"},{"internalType":"bool","name":"isFinal","type":"bool"}],"stateMutability":"nonpayable","type":"function"}]Contract Creation Code
60806040523480156200001157600080fd5b50604051620024a9380380620024a9833981016040819052620000349162000147565b6000336200006d6200006860017f5dd2e3b890564a8f99f7f203f226a27a8aa59aee19a4ece5cf5eaa77ab91f66262000179565b839055565b620000a36200009e60017f29982a6ac507a2a707ced6dee5d76285dd49725db977de83d9702c628c97413662000179565b829055565b50506001600160a01b038116620000f25760405162461bcd60e51b815260206004820152600f60248201526e696e76616c6964206164647265737360881b604482015260640160405180910390fd5b600280546001600160a01b0319166001600160a01b03831617905560408051808201909152600c81526b2232b0b6283937bb34b232b960a11b60208201526001906200013f908262000248565b505062000314565b6000602082840312156200015a57600080fd5b81516001600160a01b03811681146200017257600080fd5b9392505050565b818103818111156200019b57634e487b7160e01b600052601160045260246000fd5b92915050565b634e487b7160e01b600052604160045260246000fd5b600181811c90821680620001cc57607f821691505b602082108103620001ed57634e487b7160e01b600052602260045260246000fd5b50919050565b601f82111562000243576000816000526020600020601f850160051c810160208610156200021e5750805b601f850160051c820191505b818110156200023f578281556001016200022a565b5050505b505050565b81516001600160401b03811115620002645762000264620001a1565b6200027c81620002758454620001b7565b84620001f3565b602080601f831160018114620002b457600084156200029b5750858301515b600019600386901b1c1916600185901b1785556200023f565b600085815260208120601f198616915b82811015620002e557888601518255948401946001909101908401620002c4565b5085821015620003045787850151600019600388901b60f8161c191681555b5050505050600190811b01905550565b61218580620003246000396000f3fe6080604052600436106101145760003560e01c8063734b7198116100a0578063caf0887d11610064578063caf0887d1461033c578063d1438c3f1461035c578063e9a9fce21461037d578063f05c85821461039d578063f7d646b0146103b257600080fd5b8063734b71981461029a5780637c65c38b146102ba578063875f4384146102cf5780638c36d02d146102fc578063b7f9a7481461031c57600080fd5b806314877c38116100e757806314877c38146101d85780631a8828f4146101f85780632b227bc41461020d5780632e1a7d4d14610245578063441a3e701461027a57600080fd5b806301ffc9a71461011957806306fdde031461014e57806308a4f072146101705780631189edd41461019d575b600080fd5b34801561012557600080fd5b50610139610134366004611a88565b6103c6565b60405190151581526020015b60405180910390f35b34801561015a57600080fd5b50610163610433565b6040516101459190611b02565b34801561017c57600080fd5b5061019061018b366004611b15565b6104c1565b6040516101459190611b2e565b3480156101a957600080fd5b506101ca6101b8366004611b15565b60006020819052908152604090205481565b604051908152602001610145565b3480156101e457600080fd5b506101ca6101f3366004611bf9565b61051a565b61020b610206366004611caf565b61084f565b005b34801561021957600080fd5b5060025461022d906001600160a01b031681565b6040516001600160a01b039091168152602001610145565b34801561025157600080fd5b50610265610260366004611b15565b6109f6565b60408051928352901515602083015201610145565b34801561028657600080fd5b50610265610295366004611d30565b610b52565b3480156102a657600080fd5b5061020b6102b5366004611d52565b610c8d565b3480156102c657600080fd5b5061020b610d65565b3480156102db57600080fd5b506101ca6102ea366004611b15565b60009081526020819052604090205490565b34801561030857600080fd5b5061020b610317366004611d52565b610e49565b34801561032857600080fd5b5061020b610337366004611d7b565b610ef0565b34801561034857600080fd5b5061020b610357366004611db2565b610fa6565b34801561036857600080fd5b50610190610377366004611b15565b50606090565b34801561038957600080fd5b5061020b610398366004611dde565b6111b9565b3480156103a957600080fd5b5061022d6112ad565b3480156103be57600080fd5b5060016101ca565b60006001600160e01b0319821663b075456560e01b14806103f757506001600160e01b031982166329c8a06d60e01b145b8061041257506001600160e01b03198216630441a3e760e41b145b8061042d57506301ffc9a760e01b6001600160e01b03198316145b92915050565b6001805461044090611e2a565b80601f016020809104026020016040519081016040528092919081815260200182805461046c90611e2a565b80156104b95780601f1061048e576101008083540402835291602001916104b9565b820191906000526020600020905b81548152906001019060200180831161049c57829003601f168201915b505050505081565b600081815260208190526040908190205481516001808252818401909352606092816020016020820280368337019050509150808260008151811061050857610508611e64565b60200260200101818152505050919050565b60008061053d61053960016000805160206120e9833981519152611e90565b5490565b90506001600160a01b0381166106605786600261055a82826112d0565b8660016105678282611324565b6002546001600160a01b031663604e38ed8d8d60008161058957610589611e64565b905060200201602081019061059e9190611d52565b8e8e60018181106105b1576105b1611e64565b90506020020160208101906105c69190611d52565b338e8e60008181106105da576105da611e64565b90506020020135308e8e6040518863ffffffff1660e01b81526004016106069796959493929190611ecc565b6020604051808303816000875af1158015610625573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906106499190611f1d565b9550610656868b8b61136c565b5050505050610845565b604051631bf8659f60e21b815234906001600160a01b03831690636fe1967c9061069590339060009036908790600401611f36565b600060405180830381600087803b1580156106af57600080fd5b505af11580156106c3573d6000803e3d6000fd5b505050508888905060026106d782826112d0565b8760016106e48282611324565b6002546001600160a01b031663604e38ed8e8e60008161070657610706611e64565b905060200201602081019061071b9190611d52565b8f8f600181811061072e5761072e611e64565b90506020020160208101906107439190611d52565b338f8f600081811061075757610757611e64565b90506020020135308f8f6040518863ffffffff1660e01b81526004016107839796959493929190611ecc565b6020604051808303816000875af11580156107a2573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906107c69190611f1d565b96506107d3878c8c61136c565b50505050816001600160a01b03166393163a916107ed3390565b600036856040518563ffffffff1660e01b81526004016108109493929190611f36565b600060405180830381600087803b15801561082a57600080fd5b505af115801561083e573d6000803e3d6000fd5b5050505050505b9695505050505050565b84600061087d60017fbee718c342db2a725c831b0c655757cef911f31a4454aacc1b8b75f39bda09a9611e90565b6040805160208101929092526001600160a01b0384169082015260600160405160208183030381529060405280519060200120905060008060001b6108c0835490565b14159050806109245760405162461bcd60e51b815260206004820152602560248201527f4669726577616c6c436f6e73756d65723a204e6f7420617070726f7665642074604482015264185c99d95d60da1b60648201526084015b60405180910390fd5b61093583630c908cff60e01b611589565b61093e57600080fd5b6000886001600160a01b0316888860405161095a929190611f6c565b6000604051808303816000865af19150503d8060008114610997576040519150601f19603f3d011682016040523d82523d6000602084013e61099c565b606091505b50509050806109aa57600080fd5b6109ea3087878080601f01602080910402602001604051908101604052809392919081815260200183838082843760009201919091525061161292505050565b50505050505050505050565b60008080610a1661053960016000805160206120e9833981519152611e90565b90506001600160a01b038116610a5857610a2e61163e565b610a4d84610a488660009081526020819052604090205490565b6116ab565b909590945092505050565b604051631bf8659f60e21b815234906001600160a01b03831690636fe1967c90610a8d90339060009036908790600401611f36565b600060405180830381600087803b158015610aa757600080fd5b505af1158015610abb573d6000803e3d6000fd5b50505050610ac761163e565b610ae185610a488760009081526020819052604090205490565b6040516393163a9160e01b815291955093506001600160a01b038316906393163a9190610b1990339060009036908790600401611f36565b600060405180830381600087803b158015610b3357600080fd5b505af1158015610b47573d6000803e3d6000fd5b505050505050915091565b60008080610b7261053960016000805160206120e9833981519152611e90565b90506001600160a01b038116610ba057610b8a61189c565b610b9485856116ab565b9093509150610c869050565b604051631bf8659f60e21b815234906001600160a01b03831690636fe1967c90610bd590339060009036908790600401611f36565b600060405180830381600087803b158015610bef57600080fd5b505af1158015610c03573d6000803e3d6000fd5b50505050610c0f61189c565b610c1986866116ab565b6040516393163a9160e01b815291955093506001600160a01b038316906393163a9190610c5190339060009036908790600401611f36565b600060405180830381600087803b158015610c6b57600080fd5b505af1158015610c7f573d6000803e3d6000fd5b5050505050505b9250929050565b610ca96105396001600080516020612130833981519152611e90565b6001600160a01b0316336001600160a01b031614610cd95760405162461bcd60e51b815260040161091b90611f7c565b6001600160a01b038116610d2f5760405162461bcd60e51b815260206004820152601e60248201527f4669726577616c6c436f6e73756d65723a207a65726f20616464726573730000604482015260640161091b565b610d62610d5d60017f8583d637b7eb6415d11ef26648cf0702cf161a357dfe51b6ff7a332110d4bdd3611e90565b829055565b50565b610d9361053960017f8583d637b7eb6415d11ef26648cf0702cf161a357dfe51b6ff7a332110d4bdd3611e90565b6001600160a01b0316336001600160a01b031614610df35760405162461bcd60e51b815260206004820152601f60248201527f4669726577616c6c436f6e73756d65723a206e6f74206e65772061646d696e00604482015260640161091b565b610e14610e0f6001600080516020612130833981519152611e90565b339055565b6040513381527f2763a008a9a724a5da2f35346041f5c552001ab556d786252e1ff4ff798dfc1b9060200160405180910390a1565b610e656105396001600080516020612130833981519152611e90565b6001600160a01b0316336001600160a01b031614610e955760405162461bcd60e51b815260040161091b90611f7c565b610eb1610d5d60016000805160206120e9833981519152611e90565b6040516001600160a01b03821681527f60c1452966d777aab347837b9ceeaa613af32925b5aab43918e878fd036086709060200160405180910390a150565b610f0c6105396001600080516020612130833981519152611e90565b6001600160a01b0316336001600160a01b031614610f3c5760405162461bcd60e51b815260040161091b90611f7c565b6000610f6960017fbee718c342db2a725c831b0c655757cef911f31a4454aacc1b8b75f39bda09a9611e90565b6040805160208101929092526001600160a01b03851690820152606001604051602081830303815290604052805190602001209050818155505050565b6000610fc461053960016000805160206120e9833981519152611e90565b90506001600160a01b03811661106157610fdc61189c565b600084815260208190526040812054610ff59084611954565b6000868152602081905260409020549091508111156110265760405162461bcd60e51b815260040161091b90611fc0565b60008581526020819052604081208054839290611044908490611e90565b909155505060009384526020849052604090932092909255505050565b604051631bf8659f60e21b815234906001600160a01b03831690636fe1967c9061109690339060009036908790600401611f36565b600060405180830381600087803b1580156110b057600080fd5b505af11580156110c4573d6000803e3d6000fd5b505050506110d061189c565b6000858152602081905260408120546110e99085611954565b60008781526020819052604090205490915081111561111a5760405162461bcd60e51b815260040161091b90611fc0565b60008681526020819052604081208054839290611138908490611e90565b90915550506000858152602081905260409020556001600160a01b0382166393163a91335b600036856040518563ffffffff1660e01b81526004016111809493929190611f36565b600060405180830381600087803b15801561119a57600080fd5b505af11580156111ae573d6000803e3d6000fd5b505050505050505050565b60006111d761053960016000805160206120e9833981519152611e90565b90506001600160a01b03811661120f576111ef61189c565b8160016111fc8282611324565b61120786868661136c565b505050505050565b604051631bf8659f60e21b815234906001600160a01b03831690636fe1967c9061124490339060009036908790600401611f36565b600060405180830381600087803b15801561125e57600080fd5b505af1158015611272573d6000803e3d6000fd5b5050505061127e61189c565b82600161128b8282611324565b61129687878761136c565b50506001600160a01b0382166393163a913361115d565b60006112cb6105396001600080516020612130833981519152611e90565b905090565b808210156113205760405162461bcd60e51b815260206004820152601860248201527f696e76616c696420616464726573736573206c656e6774680000000000000000604482015260640161091b565b5050565b808210156113205760405162461bcd60e51b81526020600482015260156024820152740d2dcecc2d8d2c840e0c2e4c2dae640d8cadccee8d605b1b604482015260640161091b565b63677df66b60e01b600061139261053960016000805160206120e9833981519152611e90565b90506001600160a01b03811661141257838360008181106113b5576113b5611e64565b9050602002013560008087815260200190815260200160002081905550847f8a8d0156781437c66d28625f74e4d2f9d979f409f4eb3066b5986977323058af8585604051611404929190612009565b60405180910390a250611583565b604080516001600160e01b031984166020820152815160048183030181526024820192839052631bf8659f60e21b90925234916001600160a01b03841691636fe1967c91611467913391908690602801612042565b600060405180830381600087803b15801561148157600080fd5b505af1158015611495573d6000803e3d6000fd5b50505050848460008181106114ac576114ac611e64565b9050602002013560008088815260200190815260200160002081905550857f8a8d0156781437c66d28625f74e4d2f9d979f409f4eb3066b5986977323058af86866040516114fb929190612009565b60405180910390a2604080516001600160e01b0319851660208201528151600481830301815260248201928390526393163a9160e01b9092526001600160a01b038416916393163a91916115559133918690602801612042565b600060405180830381600087803b15801561156f57600080fd5b505af11580156109ea573d6000803e3d6000fd5b50505050565b604080516001600160e01b03198316602480830191909152825180830390910181526044909101909152602080820180516001600160e01b03166301ffc9a760e01b178152825160009392849283928392918391908a617530fa92503d915060005190508280156115fb575060208210155b80156116075750600081115b979650505050505050565b6060611637838360405180606001604052806027815260200161210960279139611974565b9392505050565b6002546001600160a01b031633146116a95760405162461bcd60e51b815260206004820152602860248201527f6f6e6c79204e465420636f6e74726163742063616e2063616c6c207468697320604482015267333ab731ba34b7b760c11b606482015260840161091b565b565b60008063278afc8b60e21b816116d361053960016000805160206120e9833981519152611e90565b90506001600160a01b0381166117375760008681526020819052604090205485116117315760008681526020819052604081208054879290611716908490611e90565b90915550506000868152602081905260409020548594501592505b50611894565b604080516001600160e01b031984166020820152815160048183030181526024820192839052631bf8659f60e21b90925234916001600160a01b03841691636fe1967c9161178c913391908690602801612042565b600060405180830381600087803b1580156117a657600080fd5b505af11580156117ba573d6000803e3d6000fd5b5050506000888152602081905260409020548711905061180d57600087815260208190526040812080548892906117f2908490611e90565b90915550506000878152602081905260409020548695501593505b604080516001600160e01b0319851660208201528151600481830301815260248201928390526393163a9160e01b9092526001600160a01b038416916393163a919161185f9133918690602801612042565b600060405180830381600087803b15801561187957600080fd5b505af115801561188d573d6000803e3d6000fd5b5050505050505b509250929050565b6002546040516326749ad760e01b81523360048201526001600160a01b03909116906326749ad790602401602060405180830381865afa1580156118e4573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906119089190612076565b6116a95760405162461bcd60e51b815260206004820152601860248201527f696e76616c69642070726f766964657220616464726573730000000000000000604482015260640161091b565b6000683635c9adc5dea0000061196a8385612093565b61163791906120aa565b6060600080856001600160a01b03168560405161199191906120cc565b600060405180830381855af49150503d80600081146119cc576040519150601f19603f3d011682016040523d82523d6000602084013e6119d1565b606091505b50915091506108458683838760608315611a4c578251600003611a45576001600160a01b0385163b611a455760405162461bcd60e51b815260206004820152601d60248201527f416464726573733a2063616c6c20746f206e6f6e2d636f6e7472616374000000604482015260640161091b565b5081611a56565b611a568383611a5e565b949350505050565b815115611a6e5781518083602001fd5b8060405162461bcd60e51b815260040161091b9190611b02565b600060208284031215611a9a57600080fd5b81356001600160e01b03198116811461163757600080fd5b60005b83811015611acd578181015183820152602001611ab5565b50506000910152565b60008151808452611aee816020860160208601611ab2565b601f01601f19169290920160200192915050565b6020815260006116376020830184611ad6565b600060208284031215611b2757600080fd5b5035919050565b6020808252825182820181905260009190848201906040850190845b81811015611b6657835183529284019291840191600101611b4a565b50909695505050505050565b60008083601f840112611b8457600080fd5b50813567ffffffffffffffff811115611b9c57600080fd5b6020830191508360208260051b8501011115610c8657600080fd5b60008083601f840112611bc957600080fd5b50813567ffffffffffffffff811115611be157600080fd5b602083019150836020828501011115610c8657600080fd5b60008060008060008060608789031215611c1257600080fd5b863567ffffffffffffffff80821115611c2a57600080fd5b611c368a838b01611b72565b90985096506020890135915080821115611c4f57600080fd5b611c5b8a838b01611b72565b90965094506040890135915080821115611c7457600080fd5b50611c8189828a01611bb7565b979a9699509497509295939492505050565b80356001600160a01b0381168114611caa57600080fd5b919050565b600080600080600060608688031215611cc757600080fd5b611cd086611c93565b9450602086013567ffffffffffffffff80821115611ced57600080fd5b611cf989838a01611bb7565b90965094506040880135915080821115611d1257600080fd5b50611d1f88828901611bb7565b969995985093965092949392505050565b60008060408385031215611d4357600080fd5b50508035926020909101359150565b600060208284031215611d6457600080fd5b61163782611c93565b8015158114610d6257600080fd5b60008060408385031215611d8e57600080fd5b611d9783611c93565b91506020830135611da781611d6d565b809150509250929050565b600080600060608486031215611dc757600080fd5b505081359360208301359350604090920135919050565b600080600060408486031215611df357600080fd5b83359250602084013567ffffffffffffffff811115611e1157600080fd5b611e1d86828701611b72565b9497909650939450505050565b600181811c90821680611e3e57607f821691505b602082108103611e5e57634e487b7160e01b600052602260045260246000fd5b50919050565b634e487b7160e01b600052603260045260246000fd5b634e487b7160e01b600052601160045260246000fd5b8181038181111561042d5761042d611e7a565b81835281816020850137506000828201602090810191909152601f909101601f19169091010190565b6001600160a01b03888116825287811660208301528681166040830152606082018690528416608082015260c060a08201819052600090611f109083018486611ea3565b9998505050505050505050565b600060208284031215611f2f57600080fd5b5051919050565b6001600160a01b0385168152606060208201819052600090611f5b9083018587611ea3565b905082604083015295945050505050565b8183823760009101908152919050565b60208082526024908201527f4669726577616c6c436f6e73756d65723a206e6f74206669726577616c6c20616040820152633236b4b760e11b606082015260800190565b60208082526029908201527f53706c697420616d6f756e7420657863656564732074686520617661696c61626040820152681b1948185b5bdd5b9d60ba1b606082015260800190565b6020808252810182905260006001600160fb1b0383111561202957600080fd5b8260051b80856040850137919091016040019392505050565b6001600160a01b038416815260606020820181905260009061206690830185611ad6565b9050826040830152949350505050565b60006020828403121561208857600080fd5b815161163781611d6d565b808202811582820484141761042d5761042d611e7a565b6000826120c757634e487b7160e01b600052601260045260246000fd5b500490565b600082516120de818460208701611ab2565b919091019291505056fe5dd2e3b890564a8f99f7f203f226a27a8aa59aee19a4ece5cf5eaa77ab91f662416464726573733a206c6f772d6c6576656c2064656c65676174652063616c6c206661696c656429982a6ac507a2a707ced6dee5d76285dd49725db977de83d9702c628c974136a26469706673582212206973a15a806cfa58da7a383d65937151d529e89220fb39f53710a0520d87a37464736f6c634300081800330000000000000000000000005e0bb1ff9003ac3586f039d482d2974a6d7ed781
Deployed Bytecode
0x6080604052600436106101145760003560e01c8063734b7198116100a0578063caf0887d11610064578063caf0887d1461033c578063d1438c3f1461035c578063e9a9fce21461037d578063f05c85821461039d578063f7d646b0146103b257600080fd5b8063734b71981461029a5780637c65c38b146102ba578063875f4384146102cf5780638c36d02d146102fc578063b7f9a7481461031c57600080fd5b806314877c38116100e757806314877c38146101d85780631a8828f4146101f85780632b227bc41461020d5780632e1a7d4d14610245578063441a3e701461027a57600080fd5b806301ffc9a71461011957806306fdde031461014e57806308a4f072146101705780631189edd41461019d575b600080fd5b34801561012557600080fd5b50610139610134366004611a88565b6103c6565b60405190151581526020015b60405180910390f35b34801561015a57600080fd5b50610163610433565b6040516101459190611b02565b34801561017c57600080fd5b5061019061018b366004611b15565b6104c1565b6040516101459190611b2e565b3480156101a957600080fd5b506101ca6101b8366004611b15565b60006020819052908152604090205481565b604051908152602001610145565b3480156101e457600080fd5b506101ca6101f3366004611bf9565b61051a565b61020b610206366004611caf565b61084f565b005b34801561021957600080fd5b5060025461022d906001600160a01b031681565b6040516001600160a01b039091168152602001610145565b34801561025157600080fd5b50610265610260366004611b15565b6109f6565b60408051928352901515602083015201610145565b34801561028657600080fd5b50610265610295366004611d30565b610b52565b3480156102a657600080fd5b5061020b6102b5366004611d52565b610c8d565b3480156102c657600080fd5b5061020b610d65565b3480156102db57600080fd5b506101ca6102ea366004611b15565b60009081526020819052604090205490565b34801561030857600080fd5b5061020b610317366004611d52565b610e49565b34801561032857600080fd5b5061020b610337366004611d7b565b610ef0565b34801561034857600080fd5b5061020b610357366004611db2565b610fa6565b34801561036857600080fd5b50610190610377366004611b15565b50606090565b34801561038957600080fd5b5061020b610398366004611dde565b6111b9565b3480156103a957600080fd5b5061022d6112ad565b3480156103be57600080fd5b5060016101ca565b60006001600160e01b0319821663b075456560e01b14806103f757506001600160e01b031982166329c8a06d60e01b145b8061041257506001600160e01b03198216630441a3e760e41b145b8061042d57506301ffc9a760e01b6001600160e01b03198316145b92915050565b6001805461044090611e2a565b80601f016020809104026020016040519081016040528092919081815260200182805461046c90611e2a565b80156104b95780601f1061048e576101008083540402835291602001916104b9565b820191906000526020600020905b81548152906001019060200180831161049c57829003601f168201915b505050505081565b600081815260208190526040908190205481516001808252818401909352606092816020016020820280368337019050509150808260008151811061050857610508611e64565b60200260200101818152505050919050565b60008061053d61053960016000805160206120e9833981519152611e90565b5490565b90506001600160a01b0381166106605786600261055a82826112d0565b8660016105678282611324565b6002546001600160a01b031663604e38ed8d8d60008161058957610589611e64565b905060200201602081019061059e9190611d52565b8e8e60018181106105b1576105b1611e64565b90506020020160208101906105c69190611d52565b338e8e60008181106105da576105da611e64565b90506020020135308e8e6040518863ffffffff1660e01b81526004016106069796959493929190611ecc565b6020604051808303816000875af1158015610625573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906106499190611f1d565b9550610656868b8b61136c565b5050505050610845565b604051631bf8659f60e21b815234906001600160a01b03831690636fe1967c9061069590339060009036908790600401611f36565b600060405180830381600087803b1580156106af57600080fd5b505af11580156106c3573d6000803e3d6000fd5b505050508888905060026106d782826112d0565b8760016106e48282611324565b6002546001600160a01b031663604e38ed8e8e60008161070657610706611e64565b905060200201602081019061071b9190611d52565b8f8f600181811061072e5761072e611e64565b90506020020160208101906107439190611d52565b338f8f600081811061075757610757611e64565b90506020020135308f8f6040518863ffffffff1660e01b81526004016107839796959493929190611ecc565b6020604051808303816000875af11580156107a2573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906107c69190611f1d565b96506107d3878c8c61136c565b50505050816001600160a01b03166393163a916107ed3390565b600036856040518563ffffffff1660e01b81526004016108109493929190611f36565b600060405180830381600087803b15801561082a57600080fd5b505af115801561083e573d6000803e3d6000fd5b5050505050505b9695505050505050565b84600061087d60017fbee718c342db2a725c831b0c655757cef911f31a4454aacc1b8b75f39bda09a9611e90565b6040805160208101929092526001600160a01b0384169082015260600160405160208183030381529060405280519060200120905060008060001b6108c0835490565b14159050806109245760405162461bcd60e51b815260206004820152602560248201527f4669726577616c6c436f6e73756d65723a204e6f7420617070726f7665642074604482015264185c99d95d60da1b60648201526084015b60405180910390fd5b61093583630c908cff60e01b611589565b61093e57600080fd5b6000886001600160a01b0316888860405161095a929190611f6c565b6000604051808303816000865af19150503d8060008114610997576040519150601f19603f3d011682016040523d82523d6000602084013e61099c565b606091505b50509050806109aa57600080fd5b6109ea3087878080601f01602080910402602001604051908101604052809392919081815260200183838082843760009201919091525061161292505050565b50505050505050505050565b60008080610a1661053960016000805160206120e9833981519152611e90565b90506001600160a01b038116610a5857610a2e61163e565b610a4d84610a488660009081526020819052604090205490565b6116ab565b909590945092505050565b604051631bf8659f60e21b815234906001600160a01b03831690636fe1967c90610a8d90339060009036908790600401611f36565b600060405180830381600087803b158015610aa757600080fd5b505af1158015610abb573d6000803e3d6000fd5b50505050610ac761163e565b610ae185610a488760009081526020819052604090205490565b6040516393163a9160e01b815291955093506001600160a01b038316906393163a9190610b1990339060009036908790600401611f36565b600060405180830381600087803b158015610b3357600080fd5b505af1158015610b47573d6000803e3d6000fd5b505050505050915091565b60008080610b7261053960016000805160206120e9833981519152611e90565b90506001600160a01b038116610ba057610b8a61189c565b610b9485856116ab565b9093509150610c869050565b604051631bf8659f60e21b815234906001600160a01b03831690636fe1967c90610bd590339060009036908790600401611f36565b600060405180830381600087803b158015610bef57600080fd5b505af1158015610c03573d6000803e3d6000fd5b50505050610c0f61189c565b610c1986866116ab565b6040516393163a9160e01b815291955093506001600160a01b038316906393163a9190610c5190339060009036908790600401611f36565b600060405180830381600087803b158015610c6b57600080fd5b505af1158015610c7f573d6000803e3d6000fd5b5050505050505b9250929050565b610ca96105396001600080516020612130833981519152611e90565b6001600160a01b0316336001600160a01b031614610cd95760405162461bcd60e51b815260040161091b90611f7c565b6001600160a01b038116610d2f5760405162461bcd60e51b815260206004820152601e60248201527f4669726577616c6c436f6e73756d65723a207a65726f20616464726573730000604482015260640161091b565b610d62610d5d60017f8583d637b7eb6415d11ef26648cf0702cf161a357dfe51b6ff7a332110d4bdd3611e90565b829055565b50565b610d9361053960017f8583d637b7eb6415d11ef26648cf0702cf161a357dfe51b6ff7a332110d4bdd3611e90565b6001600160a01b0316336001600160a01b031614610df35760405162461bcd60e51b815260206004820152601f60248201527f4669726577616c6c436f6e73756d65723a206e6f74206e65772061646d696e00604482015260640161091b565b610e14610e0f6001600080516020612130833981519152611e90565b339055565b6040513381527f2763a008a9a724a5da2f35346041f5c552001ab556d786252e1ff4ff798dfc1b9060200160405180910390a1565b610e656105396001600080516020612130833981519152611e90565b6001600160a01b0316336001600160a01b031614610e955760405162461bcd60e51b815260040161091b90611f7c565b610eb1610d5d60016000805160206120e9833981519152611e90565b6040516001600160a01b03821681527f60c1452966d777aab347837b9ceeaa613af32925b5aab43918e878fd036086709060200160405180910390a150565b610f0c6105396001600080516020612130833981519152611e90565b6001600160a01b0316336001600160a01b031614610f3c5760405162461bcd60e51b815260040161091b90611f7c565b6000610f6960017fbee718c342db2a725c831b0c655757cef911f31a4454aacc1b8b75f39bda09a9611e90565b6040805160208101929092526001600160a01b03851690820152606001604051602081830303815290604052805190602001209050818155505050565b6000610fc461053960016000805160206120e9833981519152611e90565b90506001600160a01b03811661106157610fdc61189c565b600084815260208190526040812054610ff59084611954565b6000868152602081905260409020549091508111156110265760405162461bcd60e51b815260040161091b90611fc0565b60008581526020819052604081208054839290611044908490611e90565b909155505060009384526020849052604090932092909255505050565b604051631bf8659f60e21b815234906001600160a01b03831690636fe1967c9061109690339060009036908790600401611f36565b600060405180830381600087803b1580156110b057600080fd5b505af11580156110c4573d6000803e3d6000fd5b505050506110d061189c565b6000858152602081905260408120546110e99085611954565b60008781526020819052604090205490915081111561111a5760405162461bcd60e51b815260040161091b90611fc0565b60008681526020819052604081208054839290611138908490611e90565b90915550506000858152602081905260409020556001600160a01b0382166393163a91335b600036856040518563ffffffff1660e01b81526004016111809493929190611f36565b600060405180830381600087803b15801561119a57600080fd5b505af11580156111ae573d6000803e3d6000fd5b505050505050505050565b60006111d761053960016000805160206120e9833981519152611e90565b90506001600160a01b03811661120f576111ef61189c565b8160016111fc8282611324565b61120786868661136c565b505050505050565b604051631bf8659f60e21b815234906001600160a01b03831690636fe1967c9061124490339060009036908790600401611f36565b600060405180830381600087803b15801561125e57600080fd5b505af1158015611272573d6000803e3d6000fd5b5050505061127e61189c565b82600161128b8282611324565b61129687878761136c565b50506001600160a01b0382166393163a913361115d565b60006112cb6105396001600080516020612130833981519152611e90565b905090565b808210156113205760405162461bcd60e51b815260206004820152601860248201527f696e76616c696420616464726573736573206c656e6774680000000000000000604482015260640161091b565b5050565b808210156113205760405162461bcd60e51b81526020600482015260156024820152740d2dcecc2d8d2c840e0c2e4c2dae640d8cadccee8d605b1b604482015260640161091b565b63677df66b60e01b600061139261053960016000805160206120e9833981519152611e90565b90506001600160a01b03811661141257838360008181106113b5576113b5611e64565b9050602002013560008087815260200190815260200160002081905550847f8a8d0156781437c66d28625f74e4d2f9d979f409f4eb3066b5986977323058af8585604051611404929190612009565b60405180910390a250611583565b604080516001600160e01b031984166020820152815160048183030181526024820192839052631bf8659f60e21b90925234916001600160a01b03841691636fe1967c91611467913391908690602801612042565b600060405180830381600087803b15801561148157600080fd5b505af1158015611495573d6000803e3d6000fd5b50505050848460008181106114ac576114ac611e64565b9050602002013560008088815260200190815260200160002081905550857f8a8d0156781437c66d28625f74e4d2f9d979f409f4eb3066b5986977323058af86866040516114fb929190612009565b60405180910390a2604080516001600160e01b0319851660208201528151600481830301815260248201928390526393163a9160e01b9092526001600160a01b038416916393163a91916115559133918690602801612042565b600060405180830381600087803b15801561156f57600080fd5b505af11580156109ea573d6000803e3d6000fd5b50505050565b604080516001600160e01b03198316602480830191909152825180830390910181526044909101909152602080820180516001600160e01b03166301ffc9a760e01b178152825160009392849283928392918391908a617530fa92503d915060005190508280156115fb575060208210155b80156116075750600081115b979650505050505050565b6060611637838360405180606001604052806027815260200161210960279139611974565b9392505050565b6002546001600160a01b031633146116a95760405162461bcd60e51b815260206004820152602860248201527f6f6e6c79204e465420636f6e74726163742063616e2063616c6c207468697320604482015267333ab731ba34b7b760c11b606482015260840161091b565b565b60008063278afc8b60e21b816116d361053960016000805160206120e9833981519152611e90565b90506001600160a01b0381166117375760008681526020819052604090205485116117315760008681526020819052604081208054879290611716908490611e90565b90915550506000868152602081905260409020548594501592505b50611894565b604080516001600160e01b031984166020820152815160048183030181526024820192839052631bf8659f60e21b90925234916001600160a01b03841691636fe1967c9161178c913391908690602801612042565b600060405180830381600087803b1580156117a657600080fd5b505af11580156117ba573d6000803e3d6000fd5b5050506000888152602081905260409020548711905061180d57600087815260208190526040812080548892906117f2908490611e90565b90915550506000878152602081905260409020548695501593505b604080516001600160e01b0319851660208201528151600481830301815260248201928390526393163a9160e01b9092526001600160a01b038416916393163a919161185f9133918690602801612042565b600060405180830381600087803b15801561187957600080fd5b505af115801561188d573d6000803e3d6000fd5b5050505050505b509250929050565b6002546040516326749ad760e01b81523360048201526001600160a01b03909116906326749ad790602401602060405180830381865afa1580156118e4573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906119089190612076565b6116a95760405162461bcd60e51b815260206004820152601860248201527f696e76616c69642070726f766964657220616464726573730000000000000000604482015260640161091b565b6000683635c9adc5dea0000061196a8385612093565b61163791906120aa565b6060600080856001600160a01b03168560405161199191906120cc565b600060405180830381855af49150503d80600081146119cc576040519150601f19603f3d011682016040523d82523d6000602084013e6119d1565b606091505b50915091506108458683838760608315611a4c578251600003611a45576001600160a01b0385163b611a455760405162461bcd60e51b815260206004820152601d60248201527f416464726573733a2063616c6c20746f206e6f6e2d636f6e7472616374000000604482015260640161091b565b5081611a56565b611a568383611a5e565b949350505050565b815115611a6e5781518083602001fd5b8060405162461bcd60e51b815260040161091b9190611b02565b600060208284031215611a9a57600080fd5b81356001600160e01b03198116811461163757600080fd5b60005b83811015611acd578181015183820152602001611ab5565b50506000910152565b60008151808452611aee816020860160208601611ab2565b601f01601f19169290920160200192915050565b6020815260006116376020830184611ad6565b600060208284031215611b2757600080fd5b5035919050565b6020808252825182820181905260009190848201906040850190845b81811015611b6657835183529284019291840191600101611b4a565b50909695505050505050565b60008083601f840112611b8457600080fd5b50813567ffffffffffffffff811115611b9c57600080fd5b6020830191508360208260051b8501011115610c8657600080fd5b60008083601f840112611bc957600080fd5b50813567ffffffffffffffff811115611be157600080fd5b602083019150836020828501011115610c8657600080fd5b60008060008060008060608789031215611c1257600080fd5b863567ffffffffffffffff80821115611c2a57600080fd5b611c368a838b01611b72565b90985096506020890135915080821115611c4f57600080fd5b611c5b8a838b01611b72565b90965094506040890135915080821115611c7457600080fd5b50611c8189828a01611bb7565b979a9699509497509295939492505050565b80356001600160a01b0381168114611caa57600080fd5b919050565b600080600080600060608688031215611cc757600080fd5b611cd086611c93565b9450602086013567ffffffffffffffff80821115611ced57600080fd5b611cf989838a01611bb7565b90965094506040880135915080821115611d1257600080fd5b50611d1f88828901611bb7565b969995985093965092949392505050565b60008060408385031215611d4357600080fd5b50508035926020909101359150565b600060208284031215611d6457600080fd5b61163782611c93565b8015158114610d6257600080fd5b60008060408385031215611d8e57600080fd5b611d9783611c93565b91506020830135611da781611d6d565b809150509250929050565b600080600060608486031215611dc757600080fd5b505081359360208301359350604090920135919050565b600080600060408486031215611df357600080fd5b83359250602084013567ffffffffffffffff811115611e1157600080fd5b611e1d86828701611b72565b9497909650939450505050565b600181811c90821680611e3e57607f821691505b602082108103611e5e57634e487b7160e01b600052602260045260246000fd5b50919050565b634e487b7160e01b600052603260045260246000fd5b634e487b7160e01b600052601160045260246000fd5b8181038181111561042d5761042d611e7a565b81835281816020850137506000828201602090810191909152601f909101601f19169091010190565b6001600160a01b03888116825287811660208301528681166040830152606082018690528416608082015260c060a08201819052600090611f109083018486611ea3565b9998505050505050505050565b600060208284031215611f2f57600080fd5b5051919050565b6001600160a01b0385168152606060208201819052600090611f5b9083018587611ea3565b905082604083015295945050505050565b8183823760009101908152919050565b60208082526024908201527f4669726577616c6c436f6e73756d65723a206e6f74206669726577616c6c20616040820152633236b4b760e11b606082015260800190565b60208082526029908201527f53706c697420616d6f756e7420657863656564732074686520617661696c61626040820152681b1948185b5bdd5b9d60ba1b606082015260800190565b6020808252810182905260006001600160fb1b0383111561202957600080fd5b8260051b80856040850137919091016040019392505050565b6001600160a01b038416815260606020820181905260009061206690830185611ad6565b9050826040830152949350505050565b60006020828403121561208857600080fd5b815161163781611d6d565b808202811582820484141761042d5761042d611e7a565b6000826120c757634e487b7160e01b600052601260045260246000fd5b500490565b600082516120de818460208701611ab2565b919091019291505056fe5dd2e3b890564a8f99f7f203f226a27a8aa59aee19a4ece5cf5eaa77ab91f662416464726573733a206c6f772d6c6576656c2064656c65676174652063616c6c206661696c656429982a6ac507a2a707ced6dee5d76285dd49725db977de83d9702c628c974136a26469706673582212206973a15a806cfa58da7a383d65937151d529e89220fb39f53710a0520d87a37464736f6c63430008180033
Constructor Arguments (ABI-Encoded and is the last bytes of the Contract Creation Code above)
0000000000000000000000005e0bb1ff9003ac3586f039d482d2974a6d7ed781
-----Decoded View---------------
Arg [0] : _nftContract (address): 0x5e0bB1fF9003ac3586f039D482d2974A6D7ED781
-----Encoded View---------------
1 Constructor Arguments found :
Arg [0] : 0000000000000000000000005e0bb1ff9003ac3586f039d482d2974a6d7ed781
Loading...
Loading
Loading...
Loading
Net Worth in USD
$0.00
Net Worth in ETH
0
Multichain Portfolio | 33 Chains
| Chain | Token | Portfolio % | Price | Amount | Value |
|---|
Loading...
Loading
Loading...
Loading
Loading...
Loading
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.