Overview
S Balance
S Value
$0.00More Info
Private Name Tags
ContractCreator
Transaction Hash |
Method
|
Block
|
From
|
To
|
|||||
---|---|---|---|---|---|---|---|---|---|
Latest 1 internal transaction
Parent Transaction Hash | Block | From | To | |||
---|---|---|---|---|---|---|
516728 | 80 days ago | Contract Creation | 0 S |
Loading...
Loading
Contract Name:
VaultLiquidatorImplementationV1
Compiler Version
v0.8.21+commit.d9974bed
Optimization Enabled:
Yes with 10000000 runs
Other Settings:
paris EvmVersion
Contract Source Code (Solidity Standard Json-Input format)
// SPDX-License-Identifier: BUSL-1.1 pragma solidity 0.8.21; import { IFluidVaultT1 } from "../../../protocols/vault/interfaces/iVaultT1.sol"; import { IFluidVaultT2 } from "../../../protocols/vault/interfaces/iVaultT2.sol"; import { IFluidVaultT3 } from "../../../protocols/vault/interfaces/iVaultT3.sol"; import { IFluidVaultT4 } from "../../../protocols/vault/interfaces/iVaultT4.sol"; import { IERC20 } from "@openzeppelin/contracts/interfaces/IERC20.sol"; import { IWETH9 } from "../../../protocols/lending/interfaces/external/iWETH9.sol"; import { Address } from "@openzeppelin/contracts/utils/Address.sol"; import { SafeTransfer } from "../../../libraries/safeTransfer.sol"; import { SafeApprove } from "../../../libraries/safeApprove.sol"; interface InstaFlashInterface { function flashLoan(address[] memory tokens, uint256[] memory amts, uint route, bytes memory data, bytes memory extraData) external; } interface InstaFlashReceiverInterface { function executeOperation( address[] calldata assets, uint256[] calldata amounts, uint256[] calldata premiums, address initiator, bytes calldata _data ) external returns (bool); } contract VaultLiquidatorImplementationV1 { uint256 internal constant X19 = 0x7ffff; uint256 internal constant X20 = 0xfffff; address constant public ETH_ADDRESS = 0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE; InstaFlashInterface immutable public FLA; IWETH9 immutable public WETH; address internal immutable ADDRESS_THIS = address(this); error FluidVaultLiquidator__InvalidOperation(); error FluidVaultLiquidator__InvalidTimestamp(); error FluidVaultLiquidator__InvalidTopTick(); event Liquidated( address indexed vault, uint256 collateral, uint256 debt ); struct LiquidationParams { address vault; // address of the vault to liquidate uint256 vaultType; // 1 for T1, 2 for T2, 3 for T3, 4 for T4 uint256 expiration; // 0 if no expiration int256 topTick; // type(int256).min if no topTick uint256 route; // Flashloan Route address flashloanToken; // Debt Token uint256 flashloanAmount; // Amount of debt token to payback uint256 token0DebtAmt; uint256 token1DebtAmt; uint256 debtSharesMin; uint256 colPerUnitDebt; // col per unit is w.r.t debt shares and not token0/1 debt amount uint256 token0ColAmtPerUnitShares; // in 1e18 uint256 token1ColAmtPerUnitShares; // in 1e18 bool absorb; address swapToken; // Collateral Token uint256 swapAmount; // Collateral amount to swap address swapRouter; // Dex Aggregator Router Contract address swapApproval; // Dex Aggregator Approval Contract bytes swapData; // Data to swap collateral token } constructor ( address fla_, address weth_ ) { FLA = InstaFlashInterface(fla_); WETH = IWETH9(weth_); } modifier _onlyDelegateCall() { if (address(this) == ADDRESS_THIS) { revert FluidVaultLiquidator__InvalidOperation(); } _; } function _tickHelper(uint tickRaw_) internal pure returns (int tick) { require(tickRaw_ < X20, "invalid-number"); if (tickRaw_ > 0) { tick = tickRaw_ & 1 == 1 ? int((tickRaw_ >> 1) & X19) : -int((tickRaw_ >> 1) & X19); } else { tick = type(int).min; } } function _validateParams(LiquidationParams memory params_) internal view { if (params_.expiration > 0 && params_.expiration < block.timestamp) revert FluidVaultLiquidator__InvalidTimestamp(); uint256 vaultVariables_ = IFluidVaultT1(params_.vault).readFromStorage(0); int256 topTick_ = _tickHelper(((vaultVariables_ >> 2) & X20)); if (params_.topTick > topTick_ && params_.topTick != type(int256).min) revert FluidVaultLiquidator__InvalidTopTick(); } function liquidation(LiquidationParams memory params_) public _onlyDelegateCall { _validateParams(params_); address[] memory tokens = new address[](1); uint256[] memory amts = new uint256[](1); // Take flashloan in borrow token of the vault tokens[0] = params_.flashloanToken == ETH_ADDRESS ? address(WETH) : params_.flashloanToken; amts[0] = params_.flashloanAmount; bytes memory data_ = abi.encode(params_); FLA.flashLoan(tokens, amts, params_.route, data_, abi.encode()); } function executeOperation( address[] calldata assets, uint256[] calldata amounts, uint256[] calldata premiums, address initiator, bytes calldata _data ) external returns (bool) { if (msg.sender != address(FLA)) revert FluidVaultLiquidator__InvalidOperation(); if (initiator != address(this)) revert FluidVaultLiquidator__InvalidOperation(); LiquidationParams memory params_ = abi.decode(_data, (LiquidationParams)); { uint256 value_; if (params_.flashloanToken != ETH_ADDRESS) { SafeApprove.safeApprove(params_.flashloanToken, params_.vault, 0); SafeApprove.safeApprove(params_.flashloanToken, params_.vault, params_.flashloanAmount); value_ = 0; } else { WETH.withdraw(params_.flashloanAmount); value_ = params_.flashloanAmount; } uint256 debtAmount_; uint256 collateralAmount_; if (params_.vaultType == 1) { (debtAmount_, collateralAmount_) = IFluidVaultT1(params_.vault).liquidate{value: value_}(params_.token0DebtAmt, params_.colPerUnitDebt, address(this), params_.absorb); } else if (params_.vaultType == 2) { (debtAmount_, collateralAmount_, , ) = IFluidVaultT2(params_.vault).liquidate{value: value_}(params_.token0DebtAmt, params_.colPerUnitDebt, params_.token0ColAmtPerUnitShares, params_.token1ColAmtPerUnitShares, address(this), params_.absorb); } else if (params_.vaultType == 3) { (debtAmount_, collateralAmount_) = IFluidVaultT3(params_.vault).liquidate{value: value_}(params_.token0DebtAmt, params_.token1DebtAmt, params_.debtSharesMin, params_.colPerUnitDebt, address(this), params_.absorb); } else if (params_.vaultType == 4) { (debtAmount_, collateralAmount_, , ) = IFluidVaultT4(params_.vault).liquidate{value: value_}(params_.token0DebtAmt, params_.token1DebtAmt, params_.debtSharesMin, params_.colPerUnitDebt, params_.token0ColAmtPerUnitShares, params_.token1ColAmtPerUnitShares, address(this), params_.absorb); } if (params_.flashloanToken != params_.swapToken) { if (params_.swapToken != ETH_ADDRESS) { SafeApprove.safeApprove(params_.swapToken, params_.swapApproval, 0); SafeApprove.safeApprove(params_.swapToken, params_.swapApproval, params_.swapAmount); value_ = 0; } else { value_ = params_.swapAmount; } Address.functionCallWithValue(params_.swapRouter, params_.swapData, value_, "Swap: failed"); } emit Liquidated(params_.vault, collateralAmount_, debtAmount_); } uint256 flashloanAmount_ = amounts[0] + premiums[0] + 10; if (params_.flashloanToken == ETH_ADDRESS) { uint256 wethBalance_ = WETH.balanceOf(address(this)); if (wethBalance_ < flashloanAmount_) { WETH.deposit{value: flashloanAmount_ - wethBalance_}(); } } SafeTransfer.safeTransfer(assets[0], msg.sender, flashloanAmount_); return true; } receive() payable external {} }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts v4.4.1 (interfaces/IERC20.sol) pragma solidity ^0.8.0; import "../token/ERC20/IERC20.sol";
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v4.6.0) (token/ERC20/IERC20.sol) pragma solidity ^0.8.0; /** * @dev Interface of the ERC20 standard as defined in the EIP. */ interface IERC20 { /** * @dev Emitted when `value` tokens are moved from one account (`from`) to * another (`to`). * * Note that `value` may be zero. */ event Transfer(address indexed from, address indexed to, uint256 value); /** * @dev Emitted when the allowance of a `spender` for an `owner` is set by * a call to {approve}. `value` is the new allowance. */ event Approval(address indexed owner, address indexed spender, uint256 value); /** * @dev Returns the amount of tokens in existence. */ function totalSupply() external view returns (uint256); /** * @dev Returns the amount of tokens owned by `account`. */ function balanceOf(address account) external view returns (uint256); /** * @dev Moves `amount` tokens from the caller's account to `to`. * * Returns a boolean value indicating whether the operation succeeded. * * Emits a {Transfer} event. */ function transfer(address to, uint256 amount) external returns (bool); /** * @dev Returns the remaining number of tokens that `spender` will be * allowed to spend on behalf of `owner` through {transferFrom}. This is * zero by default. * * This value changes when {approve} or {transferFrom} are called. */ function allowance(address owner, address spender) external view returns (uint256); /** * @dev Sets `amount` as the allowance of `spender` over the caller's tokens. * * Returns a boolean value indicating whether the operation succeeded. * * IMPORTANT: Beware that changing an allowance with this method brings the risk * that someone may use both the old and the new allowance by unfortunate * transaction ordering. One possible solution to mitigate this race * condition is to first reduce the spender's allowance to 0 and set the * desired value afterwards: * https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729 * * Emits an {Approval} event. */ function approve(address spender, uint256 amount) external returns (bool); /** * @dev Moves `amount` tokens from `from` to `to` using the * allowance mechanism. `amount` is then deducted from the caller's * allowance. * * Returns a boolean value indicating whether the operation succeeded. * * Emits a {Transfer} event. */ function transferFrom( address from, address to, uint256 amount ) external returns (bool); }
// SPDX-License-Identifier: MIT // OpenZeppelin Contracts (last updated v4.8.0) (utils/Address.sol) pragma solidity ^0.8.1; /** * @dev Collection of functions related to the address type */ library Address { /** * @dev Returns true if `account` is a contract. * * [IMPORTANT] * ==== * It is unsafe to assume that an address for which this function returns * false is an externally-owned account (EOA) and not a contract. * * Among others, `isContract` will return false for the following * types of addresses: * * - an externally-owned account * - a contract in construction * - an address where a contract will be created * - an address where a contract lived, but was destroyed * ==== * * [IMPORTANT] * ==== * You shouldn't rely on `isContract` to protect against flash loan attacks! * * Preventing calls from contracts is highly discouraged. It breaks composability, breaks support for smart wallets * like Gnosis Safe, and does not provide security since it can be circumvented by calling from a contract * constructor. * ==== */ function isContract(address account) internal view returns (bool) { // This method relies on extcodesize/address.code.length, which returns 0 // for contracts in construction, since the code is only stored at the end // of the constructor execution. return account.code.length > 0; } /** * @dev Replacement for Solidity's `transfer`: sends `amount` wei to * `recipient`, forwarding all available gas and reverting on errors. * * https://eips.ethereum.org/EIPS/eip-1884[EIP1884] increases the gas cost * of certain opcodes, possibly making contracts go over the 2300 gas limit * imposed by `transfer`, making them unable to receive funds via * `transfer`. {sendValue} removes this limitation. * * https://diligence.consensys.net/posts/2019/09/stop-using-soliditys-transfer-now/[Learn more]. * * IMPORTANT: because control is transferred to `recipient`, care must be * taken to not create reentrancy vulnerabilities. Consider using * {ReentrancyGuard} or the * https://solidity.readthedocs.io/en/v0.5.11/security-considerations.html#use-the-checks-effects-interactions-pattern[checks-effects-interactions pattern]. */ function sendValue(address payable recipient, uint256 amount) internal { require(address(this).balance >= amount, "Address: insufficient balance"); (bool success, ) = recipient.call{value: amount}(""); require(success, "Address: unable to send value, recipient may have reverted"); } /** * @dev Performs a Solidity function call using a low level `call`. A * plain `call` is an unsafe replacement for a function call: use this * function instead. * * If `target` reverts with a revert reason, it is bubbled up by this * function (like regular Solidity function calls). * * Returns the raw returned data. To convert to the expected return value, * use https://solidity.readthedocs.io/en/latest/units-and-global-variables.html?highlight=abi.decode#abi-encoding-and-decoding-functions[`abi.decode`]. * * Requirements: * * - `target` must be a contract. * - calling `target` with `data` must not revert. * * _Available since v3.1._ */ function functionCall(address target, bytes memory data) internal returns (bytes memory) { return 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: BUSL-1.1 pragma solidity 0.8.21; library LibsErrorTypes { /***********************************| | LiquidityCalcs | |__________________________________*/ /// @notice thrown when supply or borrow exchange price is zero at calc token data (token not configured yet) uint256 internal constant LiquidityCalcs__ExchangePriceZero = 70001; /// @notice thrown when rate data is set to a version that is not implemented uint256 internal constant LiquidityCalcs__UnsupportedRateVersion = 70002; /// @notice thrown when the calculated borrow rate turns negative. This should never happen. uint256 internal constant LiquidityCalcs__BorrowRateNegative = 70003; /***********************************| | SafeTransfer | |__________________________________*/ /// @notice thrown when safe transfer from for an ERC20 fails uint256 internal constant SafeTransfer__TransferFromFailed = 71001; /// @notice thrown when safe transfer for an ERC20 fails uint256 internal constant SafeTransfer__TransferFailed = 71002; /***********************************| | SafeApprove | |__________________________________*/ /// @notice thrown when safe approve from for an ERC20 fails uint256 internal constant SafeApprove__ApproveFailed = 81001; }
// SPDX-License-Identifier: MIT OR Apache-2.0 pragma solidity 0.8.21; import { LibsErrorTypes as ErrorTypes } from "./errorTypes.sol"; /// @notice provides minimalistic methods for safe approve, e.g. ERC20 safeApprove library SafeApprove { error FluidSafeApproveError(uint256 errorId_); /// @dev Approve `amount_` of `token_` to `to_`. /// If `token_` returns no value, non-reverting calls are assumed to be successful. /// Minimally modified from Solmate SafeTransferLib (address as input param for token, Custom Error): /// https://github.com/transmissions11/solmate/blob/50e15bb566f98b7174da9b0066126a4c3e75e0fd/src/utils/SafeTransferLib.sol#L97-L127 function safeApprove( address token_, address to_, uint256 amount_ ) internal { bool success_; /// @solidity memory-safe-assembly assembly { // Get a pointer to some free memory. let freeMemoryPointer := mload(0x40) // Write the abi-encoded calldata into memory, beginning with the function selector. mstore(freeMemoryPointer, 0x095ea7b300000000000000000000000000000000000000000000000000000000) mstore(add(freeMemoryPointer, 4), and(to_, 0xffffffffffffffffffffffffffffffffffffffff)) // Append and mask the "to" argument. mstore(add(freeMemoryPointer, 36), amount_) // Append the "amount" argument. Masking not required as it's a full 32 byte type. // We use 68 because the length of our calldata totals up like so: 4 + 32 * 2. // We use 0 and 32 to copy up to 32 bytes of return data into the scratch space. success_ := call(gas(), token_, 0, freeMemoryPointer, 68, 0, 32) // Set success to whether the call reverted, if not we check it either // returned exactly 1 (can't just be non-zero data), or had no return data and token has code. if and(iszero(and(eq(mload(0), 1), gt(returndatasize(), 31))), success_) { success_ := iszero(or(iszero(extcodesize(token_)), returndatasize())) } } if (!success_) { revert FluidSafeApproveError(ErrorTypes.SafeApprove__ApproveFailed); } } }
// SPDX-License-Identifier: MIT OR Apache-2.0 pragma solidity 0.8.21; import { LibsErrorTypes as ErrorTypes } from "./errorTypes.sol"; /// @notice provides minimalistic methods for safe transfers, e.g. ERC20 safeTransferFrom library SafeTransfer { uint256 internal constant MAX_NATIVE_TRANSFER_GAS = 20000; // pass max. 20k gas for native transfers error FluidSafeTransferError(uint256 errorId_); /// @dev Transfer `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. /// Minimally modified from Solmate SafeTransferLib (address as input param for token, Custom Error): /// https://github.com/transmissions11/solmate/blob/50e15bb566f98b7174da9b0066126a4c3e75e0fd/src/utils/SafeTransferLib.sol#L31-L63 function safeTransferFrom(address token_, address from_, address to_, uint256 amount_) internal { bool success_; /// @solidity memory-safe-assembly assembly { // Get a pointer to some free memory. let freeMemoryPointer := mload(0x40) // Write the abi-encoded calldata into memory, beginning with the function selector. mstore(freeMemoryPointer, 0x23b872dd00000000000000000000000000000000000000000000000000000000) mstore(add(freeMemoryPointer, 4), and(from_, 0xffffffffffffffffffffffffffffffffffffffff)) // Append and mask the "from_" argument. mstore(add(freeMemoryPointer, 36), and(to_, 0xffffffffffffffffffffffffffffffffffffffff)) // Append and mask the "to_" argument. mstore(add(freeMemoryPointer, 68), amount_) // Append the "amount_" argument. Masking not required as it's a full 32 byte type. success_ := and( // Set success to whether the call reverted, if not we check it either // returned exactly 1 (can't just be non-zero data), or had no return data. or(and(eq(mload(0), 1), gt(returndatasize(), 31)), iszero(returndatasize())), // We use 100 because the length of our calldata totals up like so: 4 + 32 * 3. // We use 0 and 32 to copy up to 32 bytes of return data into the scratch space. // Counterintuitively, this call must be positioned second to the or() call in the // surrounding and() call or else returndatasize() will be zero during the computation. call(gas(), token_, 0, freeMemoryPointer, 100, 0, 32) ) } if (!success_) { revert FluidSafeTransferError(ErrorTypes.SafeTransfer__TransferFromFailed); } } /// @dev Transfer `amount_` of `token_` to `to_`. /// If `token_` returns no value, non-reverting calls are assumed to be successful. /// Minimally modified from Solmate SafeTransferLib (address as input param for token, Custom Error): /// https://github.com/transmissions11/solmate/blob/50e15bb566f98b7174da9b0066126a4c3e75e0fd/src/utils/SafeTransferLib.sol#L65-L95 function safeTransfer(address token_, address to_, uint256 amount_) internal { bool success_; /// @solidity memory-safe-assembly assembly { // Get a pointer to some free memory. let freeMemoryPointer := mload(0x40) // Write the abi-encoded calldata into memory, beginning with the function selector. mstore(freeMemoryPointer, 0xa9059cbb00000000000000000000000000000000000000000000000000000000) mstore(add(freeMemoryPointer, 4), and(to_, 0xffffffffffffffffffffffffffffffffffffffff)) // Append and mask the "to_" argument. mstore(add(freeMemoryPointer, 36), amount_) // Append the "amount_" argument. Masking not required as it's a full 32 byte type. success_ := and( // Set success to whether the call reverted, if not we check it either // returned exactly 1 (can't just be non-zero data), or had no return data. or(and(eq(mload(0), 1), gt(returndatasize(), 31)), iszero(returndatasize())), // We use 68 because the length of our calldata totals up like so: 4 + 32 * 2. // We use 0 and 32 to copy up to 32 bytes of return data into the scratch space. // Counterintuitively, this call must be positioned second to the or() call in the // surrounding and() call or else returndatasize() will be zero during the computation. call(gas(), token_, 0, freeMemoryPointer, 68, 0, 32) ) } if (!success_) { revert FluidSafeTransferError(ErrorTypes.SafeTransfer__TransferFailed); } } /// @dev Transfer `amount_` of ` native token to `to_`. /// Minimally modified from Solmate SafeTransferLib (Custom Error): /// https://github.com/transmissions11/solmate/blob/50e15bb566f98b7174da9b0066126a4c3e75e0fd/src/utils/SafeTransferLib.sol#L15-L25 function safeTransferNative(address to_, uint256 amount_) internal { bool success_; /// @solidity memory-safe-assembly assembly { // Transfer the ETH and store if it succeeded or not. Pass limited gas success_ := call(MAX_NATIVE_TRANSFER_GAS, to_, amount_, 0, 0, 0, 0) } if (!success_) { revert FluidSafeTransferError(ErrorTypes.SafeTransfer__TransferFailed); } } }
//SPDX-License-Identifier: MIT pragma solidity 0.8.21; import { IERC20 } from "@openzeppelin/contracts/token/ERC20/IERC20.sol"; interface IWETH9 is IERC20 { function deposit() external payable; function withdraw(uint256 wad) external; }
//SPDX-License-Identifier: MIT pragma solidity 0.8.21; /// @notice common Fluid vaults interface, some methods only available for vaults > T1 (type, simulateLiquidate, rebalance is different) interface IFluidVault { /// @notice returns the vault id function VAULT_ID() external view returns (uint256); /// @notice returns the vault id function TYPE() external view returns (uint256); /// @notice reads uint256 data `result_` from storage at a bytes32 storage `slot_` key. function readFromStorage(bytes32 slot_) external view returns (uint256 result_); struct Tokens { address token0; address token1; } struct ConstantViews { address liquidity; address factory; address operateImplementation; address adminImplementation; address secondaryImplementation; address deployer; // address which deploys oracle address supply; // either liquidity layer or DEX protocol address borrow; // either liquidity layer or DEX protocol Tokens supplyToken; // if smart collateral then address of token0 & token1 else just supply token address at token0 and token1 as empty Tokens borrowToken; // if smart debt then address of token0 & token1 else just borrow token address at token0 and token1 as empty uint256 vaultId; uint256 vaultType; bytes32 supplyExchangePriceSlot; // if smart collateral then slot is from DEX protocol else from liquidity layer bytes32 borrowExchangePriceSlot; // if smart debt then slot is from DEX protocol else from liquidity layer bytes32 userSupplySlot; // if smart collateral then slot is from DEX protocol else from liquidity layer bytes32 userBorrowSlot; // if smart debt then slot is from DEX protocol else from liquidity layer } /// @notice returns all Vault constants function constantsView() external view returns (ConstantViews memory constantsView_); /// @notice fetches the latest user position after a liquidation function fetchLatestPosition( int256 positionTick_, uint256 positionTickId_, uint256 positionRawDebt_, uint256 tickData_ ) external view returns ( int256, // tick uint256, // raw debt uint256, // raw collateral uint256, // branchID_ uint256 // branchData_ ); /// @notice calculates the updated vault exchange prices function updateExchangePrices( uint256 vaultVariables2_ ) external view returns ( uint256 liqSupplyExPrice_, uint256 liqBorrowExPrice_, uint256 vaultSupplyExPrice_, uint256 vaultBorrowExPrice_ ); /// @notice calculates the updated vault exchange prices and writes them to storage function updateExchangePricesOnStorage() external returns ( uint256 liqSupplyExPrice_, uint256 liqBorrowExPrice_, uint256 vaultSupplyExPrice_, uint256 vaultBorrowExPrice_ ); /// @notice returns the liquidity contract address function LIQUIDITY() external view returns (address); error FluidLiquidateResult(uint256 colLiquidated, uint256 debtLiquidated); function rebalance( int colToken0MinMax_, int colToken1MinMax_, int debtToken0MinMax_, int debtToken1MinMax_ ) external payable returns (int supplyAmt_, int borrowAmt_); /// @notice reverts with FluidLiquidateResult function simulateLiquidate(uint debtAmt_, bool absorb_) external; }
//SPDX-License-Identifier: MIT pragma solidity 0.8.21; interface IFluidVaultT1 { /// @notice returns the vault id function VAULT_ID() external view returns (uint256); /// @notice reads uint256 data `result_` from storage at a bytes32 storage `slot_` key. function readFromStorage(bytes32 slot_) external view returns (uint256 result_); struct ConstantViews { address liquidity; address factory; address adminImplementation; address secondaryImplementation; address supplyToken; address borrowToken; uint8 supplyDecimals; uint8 borrowDecimals; uint vaultId; bytes32 liquiditySupplyExchangePriceSlot; bytes32 liquidityBorrowExchangePriceSlot; bytes32 liquidityUserSupplySlot; bytes32 liquidityUserBorrowSlot; } /// @notice returns all Vault constants function constantsView() external view returns (ConstantViews memory constantsView_); /// @notice fetches the latest user position after a liquidation function fetchLatestPosition( int256 positionTick_, uint256 positionTickId_, uint256 positionRawDebt_, uint256 tickData_ ) external view returns ( int256, // tick uint256, // raw debt uint256, // raw collateral uint256, // branchID_ uint256 // branchData_ ); /// @notice calculates the updated vault exchange prices function updateExchangePrices( uint256 vaultVariables2_ ) external view returns ( uint256 liqSupplyExPrice_, uint256 liqBorrowExPrice_, uint256 vaultSupplyExPrice_, uint256 vaultBorrowExPrice_ ); /// @notice calculates the updated vault exchange prices and writes them to storage function updateExchangePricesOnStorage() external returns ( uint256 liqSupplyExPrice_, uint256 liqBorrowExPrice_, uint256 vaultSupplyExPrice_, uint256 vaultBorrowExPrice_ ); /// @notice returns the liquidity contract address function LIQUIDITY() external view returns (address); function operate( uint256 nftId_, // if 0 then new position int256 newCol_, // if negative then withdraw int256 newDebt_, // if negative then payback address to_ // address at which the borrow & withdraw amount should go to. If address(0) then it'll go to msg.sender ) external payable returns ( uint256, // nftId_ int256, // final supply amount. if - then withdraw int256 // final borrow amount. if - then payback ); function liquidate( uint256 debtAmt_, uint256 colPerUnitDebt_, // min collateral needed per unit of debt in 1e18 address to_, bool absorb_ ) external payable returns (uint actualDebtAmt_, uint actualColAmt_); function absorb() external; function rebalance() external payable returns (int supplyAmt_, int borrowAmt_); error FluidLiquidateResult(uint256 colLiquidated, uint256 debtLiquidated); }
//SPDX-License-Identifier: MIT pragma solidity 0.8.21; import { IFluidVault } from "./iVault.sol"; interface IFluidVaultT2 is IFluidVault { function operate( uint nftId_, int newColToken0_, int newColToken1_, int colSharesMinMax_, int newDebt_, address to_ ) external payable returns ( uint256, // nftId_ int256, // final supply amount. if - then withdraw int256 // final borrow amount. if - then payback ); function operatePerfect( uint nftId_, int perfectColShares_, int colToken0MinMax_, int colToken1MinMax_, int newDebt_, address to_ ) external payable returns ( uint256, // nftId_ int256[] memory r_ ); function liquidate( uint256 debtAmt_, uint256 colPerUnitDebt_, // col per unit is w.r.t debt shares and not token0/1 debt amount uint256 token0ColAmtPerUnitShares_, // in 1e18 uint256 token1ColAmtPerUnitShares_, // in 1e18 address to_, bool absorb_ ) external payable returns (uint256 actualDebt_, uint256 actualColShares_, uint256 token0Col_, uint256 token1Col_); function liquidatePerfect( uint256 debtAmt_, uint256 colPerUnitDebt_, // col per unit is w.r.t debt shares and not token0/1 debt amount uint256 token0ColAmtPerUnitShares_, // in 1e18 uint256 token1ColAmtPerUnitShares_, // in 1e18 address to_, bool absorb_ ) external payable returns (uint256 actualDebt_, uint256 actualColShares_, uint256 token0Col_, uint256 token1Col_); }
//SPDX-License-Identifier: MIT pragma solidity 0.8.21; import { IFluidVault } from "./iVault.sol"; interface IFluidVaultT3 is IFluidVault { function operate( uint nftId_, int newCol_, int newDebtToken0_, int newDebtToken1_, int debtSharesMinMax_, address to_ ) external payable returns ( uint256, // nftId_ int256, // final supply amount. if - then withdraw int256 // final borrow amount. if - then payback ); function operatePerfect( uint nftId_, int newCol_, int perfectDebtShares_, int debtToken0MinMax_, int debtToken1MinMax_, address to_ ) external payable returns ( uint256, // nftId_ int256[] memory r_ ); function liquidate( uint256 token0DebtAmt_, uint256 token1DebtAmt_, uint256 debtSharesMin_, uint256 colPerUnitDebt_, address to_, bool absorb_ ) external payable returns (uint256 actualDebtShares_, uint256 actualCol_); function liquidatePerfect( uint256 debtShares_, uint256 token0DebtAmtPerUnitShares_, uint256 token1DebtAmtPerUnitShares_, uint256 colPerUnitDebt_, address to_, bool absorb_ ) external payable returns (uint256 actualDebtShares_, uint256 token0Debt_, uint256 token1Debt_, uint256 actualCol_); }
//SPDX-License-Identifier: MIT pragma solidity 0.8.21; import { IFluidVault } from "./iVault.sol"; interface IFluidVaultT4 is IFluidVault { function operate( uint nftId_, int newColToken0_, int newColToken1_, int colSharesMinMax_, int newDebtToken0_, int newDebtToken1_, int debtSharesMinMax_, address to_ ) external payable returns ( uint256, // nftId_ int256, // final supply amount. if - then withdraw int256 // final borrow amount. if - then payback ); function operatePerfect( uint nftId_, int perfectColShares_, int colToken0MinMax_, int colToken1MinMax_, int perfectDebtShares_, int debtToken0MinMax_, int debtToken1MinMax_, address to_ ) external payable returns ( uint256, // nftId_ int256[] memory r_ ); function liquidate( uint256 token0DebtAmt_, uint256 token1DebtAmt_, uint256 debtSharesMin_, uint256 colPerUnitDebt_, // col per unit is w.r.t debt shares and not token0/1 debt amount uint256 token0ColAmtPerUnitShares_, // in 1e18 uint256 token1ColAmtPerUnitShares_, // in 1e18 address to_, bool absorb_ ) external payable returns (uint256 actualDebtShares_, uint256 actualColShares_, uint256 token0Col_, uint256 token1Col_); function liquidatePerfect( uint256 debtShares_, uint256 token0DebtAmtPerUnitShares_, uint256 token1DebtAmtPerUnitShares_, uint256 colPerUnitDebt_, // col per unit is w.r.t debt shares and not token0/1 debt amount uint256 token0ColAmtPerUnitShares_, // in 1e18 uint256 token1ColAmtPerUnitShares_, // in 1e18 address to_, bool absorb_ ) external payable returns ( uint256 actualDebtShares_, uint256 token0Debt_, uint256 token1Debt_, uint256 actualColShares_, uint256 token0Col_, uint256 token1Col_ ); }
{ "optimizer": { "enabled": true, "runs": 10000000 }, "evmVersion": "paris", "outputSelection": { "*": { "*": [ "evm.bytecode", "evm.deployedBytecode", "devdoc", "userdoc", "metadata", "abi" ] } }, "metadata": { "useLiteralContent": true }, "libraries": {} }
Contract Security Audit
- No Contract Security Audit Submitted- Submit Audit Here
Contract ABI
API[{"inputs":[{"internalType":"address","name":"fla_","type":"address"},{"internalType":"address","name":"weth_","type":"address"}],"stateMutability":"nonpayable","type":"constructor"},{"inputs":[{"internalType":"uint256","name":"errorId_","type":"uint256"}],"name":"FluidSafeApproveError","type":"error"},{"inputs":[{"internalType":"uint256","name":"errorId_","type":"uint256"}],"name":"FluidSafeTransferError","type":"error"},{"inputs":[],"name":"FluidVaultLiquidator__InvalidOperation","type":"error"},{"inputs":[],"name":"FluidVaultLiquidator__InvalidTimestamp","type":"error"},{"inputs":[],"name":"FluidVaultLiquidator__InvalidTopTick","type":"error"},{"anonymous":false,"inputs":[{"indexed":true,"internalType":"address","name":"vault","type":"address"},{"indexed":false,"internalType":"uint256","name":"collateral","type":"uint256"},{"indexed":false,"internalType":"uint256","name":"debt","type":"uint256"}],"name":"Liquidated","type":"event"},{"inputs":[],"name":"ETH_ADDRESS","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"FLA","outputs":[{"internalType":"contract InstaFlashInterface","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"WETH","outputs":[{"internalType":"contract IWETH9","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address[]","name":"assets","type":"address[]"},{"internalType":"uint256[]","name":"amounts","type":"uint256[]"},{"internalType":"uint256[]","name":"premiums","type":"uint256[]"},{"internalType":"address","name":"initiator","type":"address"},{"internalType":"bytes","name":"_data","type":"bytes"}],"name":"executeOperation","outputs":[{"internalType":"bool","name":"","type":"bool"}],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"components":[{"internalType":"address","name":"vault","type":"address"},{"internalType":"uint256","name":"vaultType","type":"uint256"},{"internalType":"uint256","name":"expiration","type":"uint256"},{"internalType":"int256","name":"topTick","type":"int256"},{"internalType":"uint256","name":"route","type":"uint256"},{"internalType":"address","name":"flashloanToken","type":"address"},{"internalType":"uint256","name":"flashloanAmount","type":"uint256"},{"internalType":"uint256","name":"token0DebtAmt","type":"uint256"},{"internalType":"uint256","name":"token1DebtAmt","type":"uint256"},{"internalType":"uint256","name":"debtSharesMin","type":"uint256"},{"internalType":"uint256","name":"colPerUnitDebt","type":"uint256"},{"internalType":"uint256","name":"token0ColAmtPerUnitShares","type":"uint256"},{"internalType":"uint256","name":"token1ColAmtPerUnitShares","type":"uint256"},{"internalType":"bool","name":"absorb","type":"bool"},{"internalType":"address","name":"swapToken","type":"address"},{"internalType":"uint256","name":"swapAmount","type":"uint256"},{"internalType":"address","name":"swapRouter","type":"address"},{"internalType":"address","name":"swapApproval","type":"address"},{"internalType":"bytes","name":"swapData","type":"bytes"}],"internalType":"struct VaultLiquidatorImplementationV1.LiquidationParams","name":"params_","type":"tuple"}],"name":"liquidation","outputs":[],"stateMutability":"nonpayable","type":"function"},{"stateMutability":"payable","type":"receive"}]
Contract Creation Code
60e06040523060c0523480156200001557600080fd5b5060405162001bd538038062001bd583398101604081905262000038916200006d565b6001600160a01b039182166080521660a052620000a5565b80516001600160a01b03811681146200006857600080fd5b919050565b600080604083850312156200008157600080fd5b6200008c8362000050565b91506200009c6020840162000050565b90509250929050565b60805160a05160c051611ad7620000fe6000396000610a74015260008181610132015281816102fb01528181610902015281816109a30152610b5c015260008181607c015281816101900152610c7c0152611ad76000f3fe60806040526004361061005e5760003560e01c8063a734f06e11610043578063a734f06e146100f8578063ad5c464814610120578063cf50d4501461015457600080fd5b806376ca658a1461006a578063920f5c84146100c857600080fd5b3661006557005b600080fd5b34801561007657600080fd5b5061009e7f000000000000000000000000000000000000000000000000000000000000000081565b60405173ffffffffffffffffffffffffffffffffffffffff90911681526020015b60405180910390f35b3480156100d457600080fd5b506100e86100e33660046112f7565b610176565b60405190151581526020016100bf565b34801561010457600080fd5b5061009e73eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee81565b34801561012c57600080fd5b5061009e7f000000000000000000000000000000000000000000000000000000000000000081565b34801561016057600080fd5b5061017461016f36600461150f565b610a5d565b005b60003373ffffffffffffffffffffffffffffffffffffffff7f000000000000000000000000000000000000000000000000000000000000000016146101e7576040517f97f5318b00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b73ffffffffffffffffffffffffffffffffffffffff84163014610236576040517f97f5318b00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b60006102448385018561150f565b9050600073eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee73ffffffffffffffffffffffffffffffffffffffff168260a0015173ffffffffffffffffffffffffffffffffffffffff16146102c6576102a78260a0015183600001516000610cee565b6102be8260a0015183600001518460c00151610cee565b506000610374565b60c08201516040517f2e1a7d4d00000000000000000000000000000000000000000000000000000000815260048101919091527f000000000000000000000000000000000000000000000000000000000000000073ffffffffffffffffffffffffffffffffffffffff1690632e1a7d4d90602401600060405180830381600087803b15801561035457600080fd5b505af1158015610368573d6000803e3d6000fd5b505050508160c0015190505b600080836020015160010361044a57835160e08501516101408601516101a08701516040517f8433ea22000000000000000000000000000000000000000000000000000000008152600481019390935260248301919091523060448301521515606482015273ffffffffffffffffffffffffffffffffffffffff90911690638433ea229085906084015b604080518083038185885af115801561041b573d6000803e3d6000fd5b50505050506040513d601f19601f820116820180604052508101906104409190611669565b90925090506106e1565b836020015160020361053957835160e08501516101408601516101608701516101808801516101a08901516040517f7bae33610000000000000000000000000000000000000000000000000000000081526004810195909552602485019390935260448401919091526064830152306084830152151560a482015273ffffffffffffffffffffffffffffffffffffffff90911690637bae336190859060c40160806040518083038185885af1158015610507573d6000803e3d6000fd5b50505050506040513d601f19601f8201168201806040525081019061052c919061168d565b5091935091506106e19050565b83602001516003036105dd57835160e08501516101008601516101208701516101408801516101a08901516040517f7bae33610000000000000000000000000000000000000000000000000000000081526004810195909552602485019390935260448401919091526064830152306084830152151560a482015273ffffffffffffffffffffffffffffffffffffffff90911690637bae336190859060c4016103fe565b83602001516004036106e157835160e08501516101008601516101208701516101408801516101608901516101808a01516101a08b01516040517f27fa2b530000000000000000000000000000000000000000000000000000000081526004810197909752602487019590955260448601939093526064850191909152608484015260a48301523060c4830152151560e482015273ffffffffffffffffffffffffffffffffffffffff909116906327fa2b539085906101040160806040518083038185885af11580156106b4573d6000803e3d6000fd5b50505050506040513d601f19601f820116820180604052508101906106d9919061168d565b509193509150505b836101c0015173ffffffffffffffffffffffffffffffffffffffff168460a0015173ffffffffffffffffffffffffffffffffffffffff16146107e2576101c084015173ffffffffffffffffffffffffffffffffffffffff1673eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee1461078c57610769846101c001518561022001516000610cee565b610783846101c00151856102200151866101e00151610cee565b60009250610795565b836101e0015192505b6107e0846102000151856102400151856040518060400160405280600c81526020017f537761703a206661696c65640000000000000000000000000000000000000000815250610da9565b505b8351604080518381526020810185905273ffffffffffffffffffffffffffffffffffffffff909216917f09c223cfcd8c93e245f558f5f8de755fc0930fd9bc257441155ef5d54a170e0f910160405180910390a250505060008787600081811061084e5761084e6116c3565b905060200201358a8a6000818110610868576108686116c3565b905060200201356108799190611721565b61088490600a611721565b905073eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee73ffffffffffffffffffffffffffffffffffffffff168260a0015173ffffffffffffffffffffffffffffffffffffffff1603610a19576040517f70a082310000000000000000000000000000000000000000000000000000000081523060048201526000907f000000000000000000000000000000000000000000000000000000000000000073ffffffffffffffffffffffffffffffffffffffff16906370a0823190602401602060405180830381865afa15801561095e573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906109829190611734565b905081811015610a175773ffffffffffffffffffffffffffffffffffffffff7f00000000000000000000000000000000000000000000000000000000000000001663d0e30db06109d2838561174d565b6040518263ffffffff1660e01b81526004016000604051808303818588803b1580156109fd57600080fd5b505af1158015610a11573d6000803e3d6000fd5b50505050505b505b610a4b8c8c6000818110610a2f57610a2f6116c3565b9050602002016020810190610a449190611760565b3383610ec4565b5060019b9a5050505050505050505050565b73ffffffffffffffffffffffffffffffffffffffff7f0000000000000000000000000000000000000000000000000000000000000000163003610acc576040517f97f5318b00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b610ad581610f68565b6040805160018082528183019092526000916020808301908036833750506040805160018082528183019092529293506000929150602080830190803683370190505060a084015190915073ffffffffffffffffffffffffffffffffffffffff1673eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee14610b5a578260a00151610b7c565b7f00000000000000000000000000000000000000000000000000000000000000005b82600081518110610b8f57610b8f6116c3565b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff16815250508260c0015181600081518110610be157610be16116c3565b602002602001018181525050600083604051602001610c0091906117f0565b604080517fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe081840301815282825260808701516000845260208401928390527f095627e900000000000000000000000000000000000000000000000000000000909252925073ffffffffffffffffffffffffffffffffffffffff7f0000000000000000000000000000000000000000000000000000000000000000169163095627e991610cb6918791879187906024810161197a565b600060405180830381600087803b158015610cd057600080fd5b505af1158015610ce4573d6000803e3d6000fd5b5050505050505050565b60006040517f095ea7b300000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff84166004820152826024820152602060006044836000895af191505080601f3d1160016000511416151615610d625750823b153d17155b80610da3576040517fffd1fc0700000000000000000000000000000000000000000000000000000000815262013c6960048201526024015b60405180910390fd5b50505050565b606082471015610e3b576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602660248201527f416464726573733a20696e73756666696369656e742062616c616e636520666f60448201527f722063616c6c00000000000000000000000000000000000000000000000000006064820152608401610d9a565b6000808673ffffffffffffffffffffffffffffffffffffffff168587604051610e649190611a3a565b60006040518083038185875af1925050503d8060008114610ea1576040519150601f19603f3d011682016040523d82523d6000602084013e610ea6565b606091505b5091509150610eb7878383876110d4565b925050505b949350505050565b60006040517fa9059cbb00000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff84166004820152826024820152602060006044836000895af13d15601f3d1160016000511416171691505080610da3576040517fdee51a8a0000000000000000000000000000000000000000000000000000000081526201155a6004820152602401610d9a565b60008160400151118015610f7f5750428160400151105b15610fb6576040517f2fad55ba00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b80516040517fb5c736e40000000000000000000000000000000000000000000000000000000081526000600482018190529173ffffffffffffffffffffffffffffffffffffffff169063b5c736e490602401602060405180830381865afa158015611025573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906110499190611734565b9050600061105f620fffff600284901c16611174565b905080836060015113801561109857507f8000000000000000000000000000000000000000000000000000000000000000836060015114155b156110cf576040517ff64eca4900000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b505050565b6060831561116a5782516000036111635773ffffffffffffffffffffffffffffffffffffffff85163b611163576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601d60248201527f416464726573733a2063616c6c20746f206e6f6e2d636f6e74726163740000006044820152606401610d9a565b5081610ebc565b610ebc8383611243565b6000620fffff82106111e2576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152600e60248201527f696e76616c69642d6e756d6265720000000000000000000000000000000000006044820152606401610d9a565b811561121b578160011660011461120a57611205600183901c6207ffff16611a56565b611215565b6207ffff600183901c165b92915050565b507f80000000000000000000000000000000000000000000000000000000000000005b919050565b8151156112535781518083602001fd5b806040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610d9a9190611a8e565b60008083601f84011261129957600080fd5b50813567ffffffffffffffff8111156112b157600080fd5b6020830191508360208260051b85010111156112cc57600080fd5b9250929050565b803573ffffffffffffffffffffffffffffffffffffffff8116811461123e57600080fd5b600080600080600080600080600060a08a8c03121561131557600080fd5b893567ffffffffffffffff8082111561132d57600080fd5b6113398d838e01611287565b909b50995060208c013591508082111561135257600080fd5b61135e8d838e01611287565b909950975060408c013591508082111561137757600080fd5b6113838d838e01611287565b909750955085915061139760608d016112d3565b945060808c01359150808211156113ad57600080fd5b818c0191508c601f8301126113c157600080fd5b8135818111156113d057600080fd5b8d60208285010111156113e257600080fd5b6020830194508093505050509295985092959850929598565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b604051610260810167ffffffffffffffff8111828210171561144e5761144e6113fb565b60405290565b8035801515811461123e57600080fd5b600082601f83011261147557600080fd5b813567ffffffffffffffff80821115611490576114906113fb565b604051601f83017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0908116603f011681019082821181831017156114d6576114d66113fb565b816040528381528660208588010111156114ef57600080fd5b836020870160208301376000602085830101528094505050505092915050565b60006020828403121561152157600080fd5b813567ffffffffffffffff8082111561153957600080fd5b90830190610260828603121561154e57600080fd5b61155661142a565b61155f836112d3565b81526020830135602082015260408301356040820152606083013560608201526080830135608082015261159560a084016112d3565b60a082015260c0838101359082015260e08084013590820152610100808401359082015261012080840135908201526101408084013590820152610160808401359082015261018080840135908201526101a06115f3818501611454565b908201526101c06116058482016112d3565b908201526101e083810135908201526102006116228185016112d3565b908201526102206116348482016112d3565b90820152610240838101358381111561164c57600080fd5b61165888828701611464565b918301919091525095945050505050565b6000806040838503121561167c57600080fd5b505080516020909101519092909150565b600080600080608085870312156116a357600080fd5b505082516020840151604085015160609095015191969095509092509050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b80820180821115611215576112156116f2565b60006020828403121561174657600080fd5b5051919050565b81810381811115611215576112156116f2565b60006020828403121561177257600080fd5b61177b826112d3565b9392505050565b60005b8381101561179d578181015183820152602001611785565b50506000910152565b600081518084526117be816020860160208601611782565b601f017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0169290920160200192915050565b6020815261181760208201835173ffffffffffffffffffffffffffffffffffffffff169052565b602082015160408201526040820151606082015260608201516080820152608082015160a0820152600060a083015161186860c084018273ffffffffffffffffffffffffffffffffffffffff169052565b5060c083015160e08381019190915283015161010080840191909152830151610120808401919091528301516101408084019190915283015161016080840191909152830151610180808401919091528301516101a0808401919091528301516101c06118d88185018315159052565b84015190506101e06119018482018373ffffffffffffffffffffffffffffffffffffffff169052565b8401516102008481019190915284015190506102206119378185018373ffffffffffffffffffffffffffffffffffffffff169052565b84015190506102406119608482018373ffffffffffffffffffffffffffffffffffffffff169052565b840151610260848101529050610ebc6102808401826117a6565b60a0808252865190820181905260009060209060c0840190828a01845b828110156119c957815173ffffffffffffffffffffffffffffffffffffffff1684529284019290840190600101611997565b5050508381038285015287518082528883019183019060005b818110156119fe578351835292840192918401916001016119e2565b50508760408601528481036060860152611a1881886117a6565b925050508281036080840152611a2e81856117a6565b98975050505050505050565b60008251611a4c818460208701611782565b9190910192915050565b60007f80000000000000000000000000000000000000000000000000000000000000008203611a8757611a876116f2565b5060000390565b60208152600061177b60208301846117a656fea26469706673582212209ea4634259e0ef466977585c780020b56ab0181e8a78ed6ed7395e7ceb7bf82864736f6c63430008150033000000000000000000000000352423e2fa5d5c99343d371c9e3bc56c87723cc7000000000000000000000000352423e2fa5d5c99343d371c9e3bc56c87723cc7
Deployed Bytecode
0x60806040526004361061005e5760003560e01c8063a734f06e11610043578063a734f06e146100f8578063ad5c464814610120578063cf50d4501461015457600080fd5b806376ca658a1461006a578063920f5c84146100c857600080fd5b3661006557005b600080fd5b34801561007657600080fd5b5061009e7f000000000000000000000000352423e2fa5d5c99343d371c9e3bc56c87723cc781565b60405173ffffffffffffffffffffffffffffffffffffffff90911681526020015b60405180910390f35b3480156100d457600080fd5b506100e86100e33660046112f7565b610176565b60405190151581526020016100bf565b34801561010457600080fd5b5061009e73eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee81565b34801561012c57600080fd5b5061009e7f000000000000000000000000352423e2fa5d5c99343d371c9e3bc56c87723cc781565b34801561016057600080fd5b5061017461016f36600461150f565b610a5d565b005b60003373ffffffffffffffffffffffffffffffffffffffff7f000000000000000000000000352423e2fa5d5c99343d371c9e3bc56c87723cc716146101e7576040517f97f5318b00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b73ffffffffffffffffffffffffffffffffffffffff84163014610236576040517f97f5318b00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b60006102448385018561150f565b9050600073eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee73ffffffffffffffffffffffffffffffffffffffff168260a0015173ffffffffffffffffffffffffffffffffffffffff16146102c6576102a78260a0015183600001516000610cee565b6102be8260a0015183600001518460c00151610cee565b506000610374565b60c08201516040517f2e1a7d4d00000000000000000000000000000000000000000000000000000000815260048101919091527f000000000000000000000000352423e2fa5d5c99343d371c9e3bc56c87723cc773ffffffffffffffffffffffffffffffffffffffff1690632e1a7d4d90602401600060405180830381600087803b15801561035457600080fd5b505af1158015610368573d6000803e3d6000fd5b505050508160c0015190505b600080836020015160010361044a57835160e08501516101408601516101a08701516040517f8433ea22000000000000000000000000000000000000000000000000000000008152600481019390935260248301919091523060448301521515606482015273ffffffffffffffffffffffffffffffffffffffff90911690638433ea229085906084015b604080518083038185885af115801561041b573d6000803e3d6000fd5b50505050506040513d601f19601f820116820180604052508101906104409190611669565b90925090506106e1565b836020015160020361053957835160e08501516101408601516101608701516101808801516101a08901516040517f7bae33610000000000000000000000000000000000000000000000000000000081526004810195909552602485019390935260448401919091526064830152306084830152151560a482015273ffffffffffffffffffffffffffffffffffffffff90911690637bae336190859060c40160806040518083038185885af1158015610507573d6000803e3d6000fd5b50505050506040513d601f19601f8201168201806040525081019061052c919061168d565b5091935091506106e19050565b83602001516003036105dd57835160e08501516101008601516101208701516101408801516101a08901516040517f7bae33610000000000000000000000000000000000000000000000000000000081526004810195909552602485019390935260448401919091526064830152306084830152151560a482015273ffffffffffffffffffffffffffffffffffffffff90911690637bae336190859060c4016103fe565b83602001516004036106e157835160e08501516101008601516101208701516101408801516101608901516101808a01516101a08b01516040517f27fa2b530000000000000000000000000000000000000000000000000000000081526004810197909752602487019590955260448601939093526064850191909152608484015260a48301523060c4830152151560e482015273ffffffffffffffffffffffffffffffffffffffff909116906327fa2b539085906101040160806040518083038185885af11580156106b4573d6000803e3d6000fd5b50505050506040513d601f19601f820116820180604052508101906106d9919061168d565b509193509150505b836101c0015173ffffffffffffffffffffffffffffffffffffffff168460a0015173ffffffffffffffffffffffffffffffffffffffff16146107e2576101c084015173ffffffffffffffffffffffffffffffffffffffff1673eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee1461078c57610769846101c001518561022001516000610cee565b610783846101c00151856102200151866101e00151610cee565b60009250610795565b836101e0015192505b6107e0846102000151856102400151856040518060400160405280600c81526020017f537761703a206661696c65640000000000000000000000000000000000000000815250610da9565b505b8351604080518381526020810185905273ffffffffffffffffffffffffffffffffffffffff909216917f09c223cfcd8c93e245f558f5f8de755fc0930fd9bc257441155ef5d54a170e0f910160405180910390a250505060008787600081811061084e5761084e6116c3565b905060200201358a8a6000818110610868576108686116c3565b905060200201356108799190611721565b61088490600a611721565b905073eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee73ffffffffffffffffffffffffffffffffffffffff168260a0015173ffffffffffffffffffffffffffffffffffffffff1603610a19576040517f70a082310000000000000000000000000000000000000000000000000000000081523060048201526000907f000000000000000000000000352423e2fa5d5c99343d371c9e3bc56c87723cc773ffffffffffffffffffffffffffffffffffffffff16906370a0823190602401602060405180830381865afa15801561095e573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906109829190611734565b905081811015610a175773ffffffffffffffffffffffffffffffffffffffff7f000000000000000000000000352423e2fa5d5c99343d371c9e3bc56c87723cc71663d0e30db06109d2838561174d565b6040518263ffffffff1660e01b81526004016000604051808303818588803b1580156109fd57600080fd5b505af1158015610a11573d6000803e3d6000fd5b50505050505b505b610a4b8c8c6000818110610a2f57610a2f6116c3565b9050602002016020810190610a449190611760565b3383610ec4565b5060019b9a5050505050505050505050565b73ffffffffffffffffffffffffffffffffffffffff7f00000000000000000000000034f82537b836c970cc9b87abc40bb616c3adc975163003610acc576040517f97f5318b00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b610ad581610f68565b6040805160018082528183019092526000916020808301908036833750506040805160018082528183019092529293506000929150602080830190803683370190505060a084015190915073ffffffffffffffffffffffffffffffffffffffff1673eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee14610b5a578260a00151610b7c565b7f000000000000000000000000352423e2fa5d5c99343d371c9e3bc56c87723cc75b82600081518110610b8f57610b8f6116c3565b602002602001019073ffffffffffffffffffffffffffffffffffffffff16908173ffffffffffffffffffffffffffffffffffffffff16815250508260c0015181600081518110610be157610be16116c3565b602002602001018181525050600083604051602001610c0091906117f0565b604080517fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe081840301815282825260808701516000845260208401928390527f095627e900000000000000000000000000000000000000000000000000000000909252925073ffffffffffffffffffffffffffffffffffffffff7f000000000000000000000000352423e2fa5d5c99343d371c9e3bc56c87723cc7169163095627e991610cb6918791879187906024810161197a565b600060405180830381600087803b158015610cd057600080fd5b505af1158015610ce4573d6000803e3d6000fd5b5050505050505050565b60006040517f095ea7b300000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff84166004820152826024820152602060006044836000895af191505080601f3d1160016000511416151615610d625750823b153d17155b80610da3576040517fffd1fc0700000000000000000000000000000000000000000000000000000000815262013c6960048201526024015b60405180910390fd5b50505050565b606082471015610e3b576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152602660248201527f416464726573733a20696e73756666696369656e742062616c616e636520666f60448201527f722063616c6c00000000000000000000000000000000000000000000000000006064820152608401610d9a565b6000808673ffffffffffffffffffffffffffffffffffffffff168587604051610e649190611a3a565b60006040518083038185875af1925050503d8060008114610ea1576040519150601f19603f3d011682016040523d82523d6000602084013e610ea6565b606091505b5091509150610eb7878383876110d4565b925050505b949350505050565b60006040517fa9059cbb00000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff84166004820152826024820152602060006044836000895af13d15601f3d1160016000511416171691505080610da3576040517fdee51a8a0000000000000000000000000000000000000000000000000000000081526201155a6004820152602401610d9a565b60008160400151118015610f7f5750428160400151105b15610fb6576040517f2fad55ba00000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b80516040517fb5c736e40000000000000000000000000000000000000000000000000000000081526000600482018190529173ffffffffffffffffffffffffffffffffffffffff169063b5c736e490602401602060405180830381865afa158015611025573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906110499190611734565b9050600061105f620fffff600284901c16611174565b905080836060015113801561109857507f8000000000000000000000000000000000000000000000000000000000000000836060015114155b156110cf576040517ff64eca4900000000000000000000000000000000000000000000000000000000815260040160405180910390fd5b505050565b6060831561116a5782516000036111635773ffffffffffffffffffffffffffffffffffffffff85163b611163576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152601d60248201527f416464726573733a2063616c6c20746f206e6f6e2d636f6e74726163740000006044820152606401610d9a565b5081610ebc565b610ebc8383611243565b6000620fffff82106111e2576040517f08c379a000000000000000000000000000000000000000000000000000000000815260206004820152600e60248201527f696e76616c69642d6e756d6265720000000000000000000000000000000000006044820152606401610d9a565b811561121b578160011660011461120a57611205600183901c6207ffff16611a56565b611215565b6207ffff600183901c165b92915050565b507f80000000000000000000000000000000000000000000000000000000000000005b919050565b8151156112535781518083602001fd5b806040517f08c379a0000000000000000000000000000000000000000000000000000000008152600401610d9a9190611a8e565b60008083601f84011261129957600080fd5b50813567ffffffffffffffff8111156112b157600080fd5b6020830191508360208260051b85010111156112cc57600080fd5b9250929050565b803573ffffffffffffffffffffffffffffffffffffffff8116811461123e57600080fd5b600080600080600080600080600060a08a8c03121561131557600080fd5b893567ffffffffffffffff8082111561132d57600080fd5b6113398d838e01611287565b909b50995060208c013591508082111561135257600080fd5b61135e8d838e01611287565b909950975060408c013591508082111561137757600080fd5b6113838d838e01611287565b909750955085915061139760608d016112d3565b945060808c01359150808211156113ad57600080fd5b818c0191508c601f8301126113c157600080fd5b8135818111156113d057600080fd5b8d60208285010111156113e257600080fd5b6020830194508093505050509295985092959850929598565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b604051610260810167ffffffffffffffff8111828210171561144e5761144e6113fb565b60405290565b8035801515811461123e57600080fd5b600082601f83011261147557600080fd5b813567ffffffffffffffff80821115611490576114906113fb565b604051601f83017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0908116603f011681019082821181831017156114d6576114d66113fb565b816040528381528660208588010111156114ef57600080fd5b836020870160208301376000602085830101528094505050505092915050565b60006020828403121561152157600080fd5b813567ffffffffffffffff8082111561153957600080fd5b90830190610260828603121561154e57600080fd5b61155661142a565b61155f836112d3565b81526020830135602082015260408301356040820152606083013560608201526080830135608082015261159560a084016112d3565b60a082015260c0838101359082015260e08084013590820152610100808401359082015261012080840135908201526101408084013590820152610160808401359082015261018080840135908201526101a06115f3818501611454565b908201526101c06116058482016112d3565b908201526101e083810135908201526102006116228185016112d3565b908201526102206116348482016112d3565b90820152610240838101358381111561164c57600080fd5b61165888828701611464565b918301919091525095945050505050565b6000806040838503121561167c57600080fd5b505080516020909101519092909150565b600080600080608085870312156116a357600080fd5b505082516020840151604085015160609095015191969095509092509050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b80820180821115611215576112156116f2565b60006020828403121561174657600080fd5b5051919050565b81810381811115611215576112156116f2565b60006020828403121561177257600080fd5b61177b826112d3565b9392505050565b60005b8381101561179d578181015183820152602001611785565b50506000910152565b600081518084526117be816020860160208601611782565b601f017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe0169290920160200192915050565b6020815261181760208201835173ffffffffffffffffffffffffffffffffffffffff169052565b602082015160408201526040820151606082015260608201516080820152608082015160a0820152600060a083015161186860c084018273ffffffffffffffffffffffffffffffffffffffff169052565b5060c083015160e08381019190915283015161010080840191909152830151610120808401919091528301516101408084019190915283015161016080840191909152830151610180808401919091528301516101a0808401919091528301516101c06118d88185018315159052565b84015190506101e06119018482018373ffffffffffffffffffffffffffffffffffffffff169052565b8401516102008481019190915284015190506102206119378185018373ffffffffffffffffffffffffffffffffffffffff169052565b84015190506102406119608482018373ffffffffffffffffffffffffffffffffffffffff169052565b840151610260848101529050610ebc6102808401826117a6565b60a0808252865190820181905260009060209060c0840190828a01845b828110156119c957815173ffffffffffffffffffffffffffffffffffffffff1684529284019290840190600101611997565b5050508381038285015287518082528883019183019060005b818110156119fe578351835292840192918401916001016119e2565b50508760408601528481036060860152611a1881886117a6565b925050508281036080840152611a2e81856117a6565b98975050505050505050565b60008251611a4c818460208701611782565b9190910192915050565b60007f80000000000000000000000000000000000000000000000000000000000000008203611a8757611a876116f2565b5060000390565b60208152600061177b60208301846117a656fea26469706673582212209ea4634259e0ef466977585c780020b56ab0181e8a78ed6ed7395e7ceb7bf82864736f6c63430008150033
Constructor Arguments (ABI-Encoded and is the last bytes of the Contract Creation Code above)
000000000000000000000000352423e2fa5d5c99343d371c9e3bc56c87723cc7000000000000000000000000352423e2fa5d5c99343d371c9e3bc56c87723cc7
-----Decoded View---------------
Arg [0] : fla_ (address): 0x352423e2fA5D5c99343d371C9e3bC56C87723Cc7
Arg [1] : weth_ (address): 0x352423e2fA5D5c99343d371C9e3bC56C87723Cc7
-----Encoded View---------------
2 Constructor Arguments found :
Arg [0] : 000000000000000000000000352423e2fa5d5c99343d371c9e3bc56c87723cc7
Arg [1] : 000000000000000000000000352423e2fa5d5c99343d371c9e3bc56c87723cc7
Loading...
Loading
Loading...
Loading
Multichain Portfolio | 31 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.