Address Contract Verified
Address
0xa57D7CeF617271F4cEa4f665D33ebcFcBA4929f6
Balance
0 ETH
Nonce
1
Code Size
2623 bytes
Creator
Create2 Deployer at tx 0xc38cfbf4...f5297a
Indexed Transactions
0
Contract Bytecode
2623 bytes
0x6080604052600436106100f35760003560e01c8063a5eb43ef1161008a578063dd4cbf6b11610059578063dd4cbf6b14610230578063e8025d7714610252578063ec04840114610230578063f4bfa0001461026d57600080fd5b8063a5eb43ef14610133578063ac862bfa146101de578063ad967e15146101f9578063c2da75f01461013357600080fd5b806354bb0c1d116100c657806354bb0c1d1461016d5780637f7b6002146101885780638f0c2916146101a35780639dde5977146101c357600080fd5b806301b88f86146100f857806302c6bb6a146101185780633f66feff146101335780633fad77fc14610152575b600080fd5b34801561010457600080fd5b506101166101133660046103c7565b50565b005b34801561012457600080fd5b506101166101133660046104c7565b34801561013f57600080fd5b5061011661014e3660046105f8565b5050565b34801561015e57600080fd5b5061011661014e36600461063a565b34801561017957600080fd5b506101166101133660046106af565b34801561019457600080fd5b5061011661014e3660046106d1565b3480156101af57600080fd5b506101166101be366004610734565b505050565b3480156101cf57600080fd5b5061011661014e366004610770565b3480156101ea57600080fd5b5061011661014e366004610818565b61021661020736600461084e565b60008097509795505050505050565b604080519283526020830191909152015b60405180910390f35b34801561023c57600080fd5b5061011661024b366004610906565b5050505050565b34801561025e57600080fd5b50610116610113366004610987565b34801561027957600080fd5b50610291610288366004610818565b50606091829150565b6040516102279291906109db565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052604160045260246000fd5b60405160e0810167ffffffffffffffff811182821017156102f1576102f161029f565b60405290565b60405160c0810167ffffffffffffffff811182821017156102f1576102f161029f565b604051601f82017fffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffffe016810167ffffffffffffffff811182821017156103615761036161029f565b604052919050565b600067ffffffffffffffff8211156103835761038361029f565b5060051b60200190565b803573ffffffffffffffffffffffffffffffffffffffff811681146103b157600080fd5b919050565b803560ff811681146103b157600080fd5b600060208083850312156103da57600080fd5b823567ffffffffffffffff8111156103f157600080fd5b8301601f8101851361040257600080fd5b803561041561041082610369565b61031a565b81815260e0918202830184019184820191908884111561043457600080fd5b938501935b838510156104bb5780858a0312156104515760008081fd5b6104596102ce565b6104628661038d565b815261046f87870161038d565b8782015260406104808188016103b6565b90820152606086810135908201526080808701359082015260a0808701359082015260c0808701359082015283529384019391850191610439565b50979650505050505050565b600060208083850312156104da57600080fd5b823567ffffffffffffffff8111156104f157600080fd5b8301601f8101851361050257600080fd5b803561051061041082610369565b81815260c0918202830184019184820191908884111561052f57600080fd5b938501935b838510156104bb5780858a03121561054c5760008081fd5b6105546102f7565b61055d8661038d565b815261056a87870161038d565b87820152604061057b8188016103b6565b90820152606086810135908201526080808701359082015260a0808701359082015283529384019391850191610534565b60008083601f8401126105be57600080fd5b50813567ffffffffffffffff8111156105d657600080fd5b6020830191508360208260061b85010111156105f157600080fd5b9250929050565b6000806020838503121561060b57600080fd5b823567ffffffffffffffff81111561062257600080fd5b61062e858286016105ac565b90969095509350505050565b6000806020838503121561064d57600080fd5b823567ffffffffffffffff8082111561066557600080fd5b818501915085601f83011261067957600080fd5b81358181111561068857600080fd5b86602060a08302850101111561069d57600080fd5b60209290920196919550909350505050565b6000602082840312156106c157600080fd5b6106ca8261038d565b9392505050565b600080602083850312156106e457600080fd5b823567ffffffffffffffff808211156106fc57600080fd5b818501915085601f83011261071057600080fd5b81358181111561071f57600080fd5b8660208260071b850101111561069d57600080fd5b60008060006060848603121561074957600080fd5b6107528461038d565b92506107606020850161038d565b9150604084013590509250925092565b6000806020838503121561078357600080fd5b823567ffffffffffffffff8082111561079b57600080fd5b818501915085601f8301126107af57600080fd5b8135818111156107be57600080fd5b86602060e08302850101111561069d57600080fd5b60008083601f8401126107e557600080fd5b50813567ffffffffffffffff8111156107fd57600080fd5b6020830191508360208260051b85010111156105f157600080fd5b6000806020838503121561082b57600080fd5b823567ffffffffffffffff81111561084257600080fd5b61062e858286016107d3565b600080600080600080600060c0888a03121561086957600080fd5b6108728861038d565b9650602088013595506040880135945061088e6060890161038d565b935061089c6080890161038d565b925060a088013567ffffffffffffffff808211156108b957600080fd5b818a0191508a601f8301126108cd57600080fd5b8135818111156108dc57600080fd5b8b60208285010111156108ee57600080fd5b60208301945080935050505092959891949750929550565b60008060008060006060868803121561091e57600080fd5b6109278661038d565b9450602086013567ffffffffffffffff8082111561094457600080fd5b61095089838a016107d3565b9096509450604088013591508082111561096957600080fd5b50610976888289016107d3565b969995985093965092949392505050565b60006020828403121561099957600080fd5b5035919050565b600081518084526020808501945080840160005b838110156109d0578151875295820195908201906001016109b4565b509495945050505050565b6040815260006109ee60408301856109a0565b8281036020840152610a0081856109a0565b9594505050505056fea2646970667358221220653825dcc21dc62e41877983d329296bcc44f0519c22ea7426f467e0e3b0ebfe64736f6c63430008150033
Verified Source Code Full Match
Compiler: v0.8.21+commit.d9974bed
EVM: paris
Optimization: Yes (10000000 runs)
dummyImpl.sol 66 lines
// SPDX-License-Identifier: BUSL-1.1
pragma solidity 0.8.21;
import { IFluidLiquidityLogic, IFluidLiquidityAdmin } from "./interfaces/iLiquidity.sol";
import { Structs as AdminModuleStructs } from "./adminModule/structs.sol";
/// @notice Liquidity dummy implementation used for Fluid Liquidity infinite proxy.
/// @dev see https://github.com/Instadapp/infinite-proxy?tab=readme-ov-file#dummy-implementation
contract FluidLiquidityDummyImpl is IFluidLiquidityLogic {
/// @inheritdoc IFluidLiquidityAdmin
function updateAuths(AdminModuleStructs.AddressBool[] calldata authsStatus_) external {}
/// @inheritdoc IFluidLiquidityAdmin
function updateGuardians(AdminModuleStructs.AddressBool[] calldata guardiansStatus_) external {}
/// @inheritdoc IFluidLiquidityAdmin
function updateRevenueCollector(address revenueCollector_) external {}
/// @inheritdoc IFluidLiquidityAdmin
function changeStatus(uint256 newStatus_) external {}
/// @inheritdoc IFluidLiquidityAdmin
function updateRateDataV1s(AdminModuleStructs.RateDataV1Params[] calldata tokensRateData_) external {}
/// @inheritdoc IFluidLiquidityAdmin
function updateRateDataV2s(AdminModuleStructs.RateDataV2Params[] calldata tokensRateData_) external {}
/// @inheritdoc IFluidLiquidityAdmin
function updateTokenConfigs(AdminModuleStructs.TokenConfig[] calldata tokenConfigs_) external {}
/// @inheritdoc IFluidLiquidityAdmin
function updateUserClasses(AdminModuleStructs.AddressUint256[] calldata userClasses_) external {}
/// @inheritdoc IFluidLiquidityAdmin
function updateUserSupplyConfigs(AdminModuleStructs.UserSupplyConfig[] memory userSupplyConfigs_) external {}
/// @inheritdoc IFluidLiquidityAdmin
function updateUserWithdrawalLimit(address user_, address token_, uint256 newLimit_) external {}
/// @inheritdoc IFluidLiquidityAdmin
function updateUserBorrowConfigs(AdminModuleStructs.UserBorrowConfig[] memory userBorrowConfigs_) external {}
/// @inheritdoc IFluidLiquidityAdmin
function pauseUser(address user_, address[] calldata supplyTokens_, address[] calldata borrowTokens_) external {}
/// @inheritdoc IFluidLiquidityAdmin
function unpauseUser(address user_, address[] calldata supplyTokens_, address[] calldata borrowTokens_) external {}
/// @inheritdoc IFluidLiquidityAdmin
function collectRevenue(address[] calldata tokens_) external {}
/// @inheritdoc IFluidLiquidityAdmin
function updateExchangePrices(
address[] calldata tokens_
) external returns (uint256[] memory supplyExchangePrices_, uint256[] memory borrowExchangePrices_) {}
/// @inheritdoc IFluidLiquidityLogic
function operate(
address token_,
int256 supplyAmount_,
int256 borrowAmount_,
address withdrawTo_,
address borrowTo_,
bytes calldata callbackData_
) external payable returns (uint256 memVar3_, uint256 memVar4_) {}
}
structs.sol 145 lines
// SPDX-License-Identifier: BUSL-1.1
pragma solidity 0.8.21;
abstract contract Structs {
struct AddressBool {
address addr;
bool value;
}
struct AddressUint256 {
address addr;
uint256 value;
}
/// @notice struct to set borrow rate data for version 1
struct RateDataV1Params {
///
/// @param token for rate data
address token;
///
/// @param kink in borrow rate. in 1e2: 100% = 10_000; 1% = 100
/// utilization below kink usually means slow increase in rate, once utilization is above kink borrow rate increases fast
uint256 kink;
///
/// @param rateAtUtilizationZero desired borrow rate when utilization is zero. in 1e2: 100% = 10_000; 1% = 100
/// i.e. constant minimum borrow rate
/// e.g. at utilization = 0.01% rate could still be at least 4% (rateAtUtilizationZero would be 400 then)
uint256 rateAtUtilizationZero;
///
/// @param rateAtUtilizationKink borrow rate when utilization is at kink. in 1e2: 100% = 10_000; 1% = 100
/// e.g. when rate should be 7% at kink then rateAtUtilizationKink would be 700
uint256 rateAtUtilizationKink;
///
/// @param rateAtUtilizationMax borrow rate when utilization is maximum at 100%. in 1e2: 100% = 10_000; 1% = 100
/// e.g. when rate should be 125% at 100% then rateAtUtilizationMax would be 12_500
uint256 rateAtUtilizationMax;
}
/// @notice struct to set borrow rate data for version 2
struct RateDataV2Params {
///
/// @param token for rate data
address token;
///
/// @param kink1 first kink in borrow rate. in 1e2: 100% = 10_000; 1% = 100
/// utilization below kink 1 usually means slow increase in rate, once utilization is above kink 1 borrow rate increases faster
uint256 kink1;
///
/// @param kink2 second kink in borrow rate. in 1e2: 100% = 10_000; 1% = 100
/// utilization below kink 2 usually means slow / medium increase in rate, once utilization is above kink 2 borrow rate increases fast
uint256 kink2;
///
/// @param rateAtUtilizationZero desired borrow rate when utilization is zero. in 1e2: 100% = 10_000; 1% = 100
/// i.e. constant minimum borrow rate
/// e.g. at utilization = 0.01% rate could still be at least 4% (rateAtUtilizationZero would be 400 then)
uint256 rateAtUtilizationZero;
///
/// @param rateAtUtilizationKink1 desired borrow rate when utilization is at first kink. in 1e2: 100% = 10_000; 1% = 100
/// e.g. when rate should be 7% at first kink then rateAtUtilizationKink would be 700
uint256 rateAtUtilizationKink1;
///
/// @param rateAtUtilizationKink2 desired borrow rate when utilization is at second kink. in 1e2: 100% = 10_000; 1% = 100
/// e.g. when rate should be 7% at second kink then rateAtUtilizationKink would be 1_200
uint256 rateAtUtilizationKink2;
///
/// @param rateAtUtilizationMax desired borrow rate when utilization is maximum at 100%. in 1e2: 100% = 10_000; 1% = 100
/// e.g. when rate should be 125% at 100% then rateAtUtilizationMax would be 12_500
uint256 rateAtUtilizationMax;
}
/// @notice struct to set token config
struct TokenConfig {
///
/// @param token address
address token;
///
/// @param fee charges on borrower's interest. in 1e2: 100% = 10_000; 1% = 100
uint256 fee;
///
/// @param threshold on when to update the storage slot. in 1e2: 100% = 10_000; 1% = 100
uint256 threshold;
///
/// @param maxUtilization maximum allowed utilization. in 1e2: 100% = 10_000; 1% = 100
/// set to 100% to disable and have default limit of 100% (avoiding SLOAD).
uint256 maxUtilization;
}
/// @notice struct to set user supply & withdrawal config
struct UserSupplyConfig {
///
/// @param user address
address user;
///
/// @param token address
address token;
///
/// @param mode: 0 = without interest. 1 = with interest
uint8 mode;
///
/// @param expandPercent withdrawal limit expand percent. in 1e2: 100% = 10_000; 1% = 100
/// Also used to calculate rate at which withdrawal limit should decrease (instant).
uint256 expandPercent;
///
/// @param expandDuration withdrawal limit expand duration in seconds.
/// used to calculate rate together with expandPercent
uint256 expandDuration;
///
/// @param baseWithdrawalLimit base limit, below this, user can withdraw the entire amount.
/// amount in raw (to be multiplied with exchange price) or normal depends on configured mode in user config for the token:
/// with interest -> raw, without interest -> normal
uint256 baseWithdrawalLimit;
}
/// @notice struct to set user borrow & payback config
struct UserBorrowConfig {
///
/// @param user address
address user;
///
/// @param token address
address token;
///
/// @param mode: 0 = without interest. 1 = with interest
uint8 mode;
///
/// @param expandPercent debt limit expand percent. in 1e2: 100% = 10_000; 1% = 100
/// Also used to calculate rate at which debt limit should decrease (instant).
uint256 expandPercent;
///
/// @param expandDuration debt limit expand duration in seconds.
/// used to calculate rate together with expandPercent
uint256 expandDuration;
///
/// @param baseDebtCeiling base borrow limit. until here, borrow limit remains as baseDebtCeiling
/// (user can borrow until this point at once without stepped expansion). Above this, automated limit comes in place.
/// amount in raw (to be multiplied with exchange price) or normal depends on configured mode in user config for the token:
/// with interest -> raw, without interest -> normal
uint256 baseDebtCeiling;
///
/// @param maxDebtCeiling max borrow ceiling, maximum amount the user can borrow.
/// amount in raw (to be multiplied with exchange price) or normal depends on configured mode in user config for the token:
/// with interest -> raw, without interest -> normal
uint256 maxDebtCeiling;
}
}
iProxy.sol 22 lines
// SPDX-License-Identifier: MIT
pragma solidity 0.8.21;
interface IProxy {
function setAdmin(address newAdmin_) external;
function setDummyImplementation(address newDummyImplementation_) external;
function addImplementation(address implementation_, bytes4[] calldata sigs_) external;
function removeImplementation(address implementation_) external;
function getAdmin() external view returns (address);
function getDummyImplementation() external view returns (address);
function getImplementationSigs(address impl_) external view returns (bytes4[] memory);
function getSigsImplementation(bytes4 sig_) external view returns (address);
function readFromStorage(bytes32 slot_) external view returns (uint256 result_);
}
iLiquidity.sol 129 lines
//SPDX-License-Identifier: MIT
pragma solidity 0.8.21;
import { IProxy } from "../../infiniteProxy/interfaces/iProxy.sol";
import { Structs as AdminModuleStructs } from "../adminModule/structs.sol";
interface IFluidLiquidityAdmin {
/// @notice adds/removes auths. Auths generally could be contracts which can have restricted actions defined on contract.
/// auths can be helpful in reducing governance overhead where it's not needed.
/// @param authsStatus_ array of structs setting allowed status for an address.
/// status true => add auth, false => remove auth
function updateAuths(AdminModuleStructs.AddressBool[] calldata authsStatus_) external;
/// @notice adds/removes guardians. Only callable by Governance.
/// @param guardiansStatus_ array of structs setting allowed status for an address.
/// status true => add guardian, false => remove guardian
function updateGuardians(AdminModuleStructs.AddressBool[] calldata guardiansStatus_) external;
/// @notice changes the revenue collector address (contract that is sent revenue). Only callable by Governance.
/// @param revenueCollector_ new revenue collector address
function updateRevenueCollector(address revenueCollector_) external;
/// @notice changes current status, e.g. for pausing or unpausing all user operations. Only callable by Auths.
/// @param newStatus_ new status
/// status = 2 -> pause, status = 1 -> resume.
function changeStatus(uint256 newStatus_) external;
/// @notice update tokens rate data version 1. Only callable by Auths.
/// @param tokensRateData_ array of RateDataV1Params with rate data to set for each token
function updateRateDataV1s(AdminModuleStructs.RateDataV1Params[] calldata tokensRateData_) external;
/// @notice update tokens rate data version 2. Only callable by Auths.
/// @param tokensRateData_ array of RateDataV2Params with rate data to set for each token
function updateRateDataV2s(AdminModuleStructs.RateDataV2Params[] calldata tokensRateData_) external;
/// @notice updates token configs: fee charge on borrowers interest & storage update utilization threshold.
/// Only callable by Auths.
/// @param tokenConfigs_ contains token address, fee & utilization threshold
function updateTokenConfigs(AdminModuleStructs.TokenConfig[] calldata tokenConfigs_) external;
/// @notice updates user classes: 0 is for new protocols, 1 is for established protocols.
/// Only callable by Auths.
/// @param userClasses_ struct array of uint256 value to assign for each user address
function updateUserClasses(AdminModuleStructs.AddressUint256[] calldata userClasses_) external;
/// @notice sets user supply configs per token basis. Eg: with interest or interest-free and automated limits.
/// Only callable by Auths.
/// @param userSupplyConfigs_ struct array containing user supply config, see `UserSupplyConfig` struct for more info
function updateUserSupplyConfigs(AdminModuleStructs.UserSupplyConfig[] memory userSupplyConfigs_) external;
/// @notice sets a new withdrawal limit as the current limit for a certain user
/// @param user_ user address for which to update the withdrawal limit
/// @param token_ token address for which to update the withdrawal limit
/// @param newLimit_ new limit until which user supply can decrease to.
/// Important: input in raw. Must account for exchange price in input param calculation.
/// Note any limit that is < max expansion or > current user supply will set max expansion limit or
/// current user supply as limit respectively.
/// - set 0 to make maximum possible withdrawable: instant full expansion, and if that goes
/// below base limit then fully down to 0.
/// - set type(uint256).max to make current withdrawable 0 (sets current user supply as limit).
function updateUserWithdrawalLimit(address user_, address token_, uint256 newLimit_) external;
/// @notice setting user borrow configs per token basis. Eg: with interest or interest-free and automated limits.
/// Only callable by Auths.
/// @param userBorrowConfigs_ struct array containing user borrow config, see `UserBorrowConfig` struct for more info
function updateUserBorrowConfigs(AdminModuleStructs.UserBorrowConfig[] memory userBorrowConfigs_) external;
/// @notice pause operations for a particular user in class 0 (class 1 users can't be paused by guardians).
/// Only callable by Guardians.
/// @param user_ address of user to pause operations for
/// @param supplyTokens_ token addresses to pause withdrawals for
/// @param borrowTokens_ token addresses to pause borrowings for
function pauseUser(address user_, address[] calldata supplyTokens_, address[] calldata borrowTokens_) external;
/// @notice unpause operations for a particular user in class 0 (class 1 users can't be paused by guardians).
/// Only callable by Guardians.
/// @param user_ address of user to unpause operations for
/// @param supplyTokens_ token addresses to unpause withdrawals for
/// @param borrowTokens_ token addresses to unpause borrowings for
function unpauseUser(address user_, address[] calldata supplyTokens_, address[] calldata borrowTokens_) external;
/// @notice collects revenue for tokens to configured revenueCollector address.
/// @param tokens_ array of tokens to collect revenue for
/// @dev Note that this can revert if token balance is < revenueAmount (utilization > 100%)
function collectRevenue(address[] calldata tokens_) external;
/// @notice gets the current updated exchange prices for n tokens and updates all prices, rates related data in storage.
/// @param tokens_ tokens to update exchange prices for
/// @return supplyExchangePrices_ new supply rates of overall system for each token
/// @return borrowExchangePrices_ new borrow rates of overall system for each token
function updateExchangePrices(
address[] calldata tokens_
) external returns (uint256[] memory supplyExchangePrices_, uint256[] memory borrowExchangePrices_);
}
interface IFluidLiquidityLogic is IFluidLiquidityAdmin {
/// @notice Single function which handles supply, withdraw, borrow & payback
/// @param token_ address of token (0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE for native)
/// @param supplyAmount_ if +ve then supply, if -ve then withdraw, if 0 then nothing
/// @param borrowAmount_ if +ve then borrow, if -ve then payback, if 0 then nothing
/// @param withdrawTo_ if withdrawal then to which address
/// @param borrowTo_ if borrow then to which address
/// @param callbackData_ callback data passed to `liquidityCallback` method of protocol
/// @return memVar3_ updated supplyExchangePrice
/// @return memVar4_ updated borrowExchangePrice
/// @dev to trigger skipping in / out transfers (gas optimization):
/// - ` callbackData_` MUST be encoded so that "from" address is the last 20 bytes in the last 32 bytes slot,
/// also for native token operations where liquidityCallback is not triggered!
/// from address must come at last position if there is more data. I.e. encode like:
/// abi.encode(otherVar1, otherVar2, FROM_ADDRESS). Note dynamic types used with abi.encode come at the end
/// so if dynamic types are needed, you must use abi.encodePacked to ensure the from address is at the end.
/// - this "from" address must match withdrawTo_ or borrowTo_ and must be == `msg.sender`
/// - `callbackData_` must in addition to the from address as described above include bytes32 SKIP_TRANSFERS
/// in the slot before (bytes 32 to 63)
/// - `msg.value` must be 0.
/// - Amounts must be either:
/// - supply(+) == borrow(+), withdraw(-) == payback(-).
/// - Liquidity must be on the winning side (deposit < borrow OR payback < withdraw).
function operate(
address token_,
int256 supplyAmount_,
int256 borrowAmount_,
address withdrawTo_,
address borrowTo_,
bytes calldata callbackData_
) external payable returns (uint256 memVar3_, uint256 memVar4_);
}
interface IFluidLiquidity is IProxy, IFluidLiquidityLogic {}
Write Contract 16 functions
These functions modify contract state and require a wallet transaction to execute.
changeStatus 0xe8025d77
uint256 newStatus_
collectRevenue 0xac862bfa
address[] tokens_
operate 0xad967e15
address token_
int256 supplyAmount_
int256 borrowAmount_
address withdrawTo_
address borrowTo_
bytes callbackData_
returns: uint256, uint256
pauseUser 0xdd4cbf6b
address user_
address[] supplyTokens_
address[] borrowTokens_
unpauseUser 0xec048401
address user_
address[] supplyTokens_
address[] borrowTokens_
updateAuths 0xdc45bb7d
tuple[] authsStatus_
updateExchangePrices 0xf4bfa000
address[] tokens_
returns: uint256[], uint256[]
updateGuardians 0xf466933c
tuple[] guardiansStatus_
updateRateDataV1s 0x8d52fb87
tuple[] tokensRateData_
updateRateDataV2s 0x865a0a7d
tuple[] tokensRateData_
updateRevenueCollector 0x54bb0c1d
address revenueCollector_
updateTokenConfigs 0xd5dae5a8
tuple[] tokenConfigs_
updateUserBorrowConfigs 0x6c7c4965
tuple[] userBorrowConfigs_
updateUserClasses 0x7e511f4e
tuple[] userClasses_
updateUserSupplyConfigs 0x0fa674b3
tuple[] userSupplyConfigs_
updateUserWithdrawalLimit 0x8f0c2916
address user_
address token_
uint256 newLimit_
Recent Transactions
No transactions found for this address