Description:
Multi-signature wallet contract requiring multiple confirmations for transaction execution.
Blockchain: Ethereum
Source Code: View Code On The Blockchain
Solidity Source Code:
{{
"language": "Solidity",
"settings": {
"evmVersion": "shanghai",
"optimizer": {
"enabled": true,
"runs": 200
},
"outputSelection": {
"*": {
"*": [
"evm.bytecode",
"evm.deployedBytecode",
"devdoc",
"userdoc",
"metadata",
"abi"
]
}
},
"remappings": []
},
"sources": {
"project/contracts/payloads/common/constants.sol": {
"content": "pragma solidity ^0.8.21;
pragma experimental ABIEncoderV2;
import {BigMathMinified} from "../libraries/bigMathMinified.sol";
import {LiquidityCalcs} from "../libraries/liquidityCalcs.sol";
import {LiquiditySlotsLink} from "../libraries/liquiditySlotsLink.sol";
import {IGovernorBravo} from "./interfaces/IGovernorBravo.sol";
import {ITimelock} from "./interfaces/ITimelock.sol";
import {IFluidLiquidityAdmin} from "./interfaces/IFluidLiquidity.sol";
import {IFluidReserveContract} from "./interfaces/IFluidReserveContract.sol";
import {IFluidVaultFactory} from "./interfaces/IFluidVaultFactory.sol";
import {IFluidDexFactory} from "./interfaces/IFluidDexFactory.sol";
import {IFluidSmartLendingFactory} from "./interfaces/IFluidSmartLendingFactory.sol";
import {IFluidLendingFactory} from "./interfaces/IFluidLendingFactory.sol";
import {IFluidDex} from "./interfaces/IFluidDex.sol";
import {IFluidDexResolver} from "./interfaces/IFluidDex.sol";
import {IFluidVault} from "./interfaces/IFluidVault.sol";
import {IFluidVaultT1} from "./interfaces/IFluidVault.sol";
import {IFTokenAdmin} from "./interfaces/IFToken.sol";
import {ILendingRewards} from "./interfaces/IFToken.sol";
import {IDSAV2} from "./interfaces/IDSA.sol";
import {ILite} from "./interfaces/ILite.sol";
import { IDSAConnectorsV2 } from "./interfaces/IDSA.sol";
contract PayloadIGPConstants {
address public immutable ADDRESS_THIS;
// Proposal Creators
address public constant PROPOSER =
0xA45f7bD6A5Ff45D31aaCE6bCD3d426D9328cea01;
address public constant PROPOSER_AVO_MULTISIG =
0x059A94A72951c0ae1cc1CE3BF0dB52421bbE8210;
address public constant PROPOSER_AVO_MULTISIG_2 =
0x9efdE135CA4832AbF0408c44c6f5f370eB0f35e8;
address public constant PROPOSER_AVO_MULTISIG_3 =
0x5C43AAC965ff230AC1cF63e924D0153291D78BaD;
address public constant PROPOSER_AVO_MULTISIG_4 =
0x3dAff61fe5cfB1f1B4eA7FBa8173A58532Ef1841;
address public constant PROPOSER_AVO_MULTISIG_5 =
0xE7EB63a8B6392481A9FDEbb108Cfd580DC8664d3;
// Governance Addresses
IGovernorBravo public constant GOVERNOR =
IGovernorBravo(0x0204Cd037B2ec03605CFdFe482D8e257C765fA1B);
ITimelock public constant TIMELOCK =
ITimelock(0x2386DC45AdDed673317eF068992F19421B481F4c);
IDSAV2 public constant TREASURY =
IDSAV2(0x28849D2b63fA8D361e5fc15cB8aBB13019884d09);
IDSAConnectorsV2 public constant DSA_CONNECTORS_V2 =
IDSAConnectorsV2(0x97b0B3A8bDeFE8cB9563a3c610019Ad10DB8aD11);
// Team Multisig
address public constant TEAM_MULTISIG =
0x4F6F977aCDD1177DCD81aB83074855EcB9C2D49e;
address public constant TEAM_MULTISIG_2 =
0x1e2e1aeD876f67Fe4Fd54090FD7B8F57Ce234219;
// Fluid Addresses
IFluidLiquidityAdmin public constant LIQUIDITY =
IFluidLiquidityAdmin(0x52Aa899454998Be5b000Ad077a46Bbe360F4e497);
IFluidReserveContract public constant FLUID_RESERVE =
IFluidReserveContract(0x264786EF916af64a1DB19F513F24a3681734ce92);
address public constant RESERVE_CONTRACT_PROXY =
0x264786EF916af64a1DB19F513F24a3681734ce92;
// Fluid Factory Addresses
IFluidVaultFactory public constant VAULT_FACTORY =
IFluidVaultFactory(0x324c5Dc1fC42c7a4D43d92df1eBA58a54d13Bf2d);
IFluidDexFactory public constant DEX_FACTORY =
IFluidDexFactory(0x91716C4EDA1Fb55e84Bf8b4c7085f84285c19085);
IFluidSmartLendingFactory public constant SMART_LENDING_FACTORY =
IFluidSmartLendingFactory(0xe57227C7d5900165344b190fc7aa580bceb53B9B);
IFluidLendingFactory public constant LENDING_FACTORY =
IFluidLendingFactory(0x54B91A0D94cb471F37f949c60F7Fa7935b551D03);
ILite public constant IETHV2 =
ILite(0xA0D3707c569ff8C87FA923d3823eC5D81c98Be78);
// Tokens
address internal constant ETH_ADDRESS =
0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE;
address internal constant WETH_ADDRESS =
0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2;
address internal constant wstETH_ADDRESS =
0x7f39C581F595B53c5cb19bD0b3f8dA6c935E2Ca0;
address internal constant stETH_ADDRESS =
0xae7ab96520DE3A18E5e111B5EaAb095312D7fE84;
address internal constant weETH_ADDRESS =
0xCd5fE23C85820F7B72D0926FC9b05b43E359b7ee;
address internal constant rsETH_ADDRESS =
0xA1290d69c65A6Fe4DF752f95823fae25cB99e5A7;
address internal constant weETHs_ADDRESS =
0x917ceE801a67f933F2e6b33fC0cD1ED2d5909D88;
address internal constant mETH_ADDRESS =
0xd5F7838F5C461fefF7FE49ea5ebaF7728bB0ADfa;
address internal constant ezETH_ADDRESS =
0xbf5495Efe5DB9ce00f80364C8B423567e58d2110;
address internal constant USDC_ADDRESS =
0xA0b86991c6218b36c1d19D4a2e9Eb0cE3606eB48;
address internal constant USDT_ADDRESS =
0xdAC17F958D2ee523a2206206994597C13D831ec7;
address internal constant sUSDe_ADDRESS =
0x9D39A5DE30e57443BfF2A8307A4256c8797A3497;
address internal constant syrupUSDC_ADDRESS =
0x80ac24aA929eaF5013f6436cdA2a7ba190f5Cc0b;
address internal constant syrupUSDT_ADDRESS =
0x356B8d89c1e1239Cbbb9dE4815c39A1474d5BA7D;
address internal constant sUSDs_ADDRESS =
0xa3931d71877C0E7a3148CB7Eb4463524FEc27fbD;
address internal constant USDe_ADDRESS =
0x4c9EDD5852cd905f086C759E8383e09bff1E68B3;
address internal constant GHO_ADDRESS =
0x40D16FC0246aD3160Ccc09B8D0D3A2cD28aE6C2f;
address internal constant iUSD_ADDRESS =
0x48f9e38f3070AD8945DFEae3FA70987722E3D89c;
address internal constant deUSD_ADDRESS =
0x15700B564Ca08D9439C58cA5053166E8317aa138;
address internal constant USR_ADDRESS =
0x66a1E37c9b0eAddca17d3662D6c05F4DECf3e110;
address internal constant USD0_ADDRESS =
0x73A15FeD60Bf67631dC6cd7Bc5B6e8da8190aCF5;
address internal constant fxUSD_ADDRESS =
0x085780639CC2cACd35E474e71f4d000e2405d8f6;
address internal constant BOLD_ADDRESS =
0xb01dd87B29d187F3E3a4Bf6cdAebfb97F3D9aB98;
address internal constant USDTb_ADDRESS =
0xC139190F447e929f090Edeb554D95AbB8b18aC1C;
address internal constant csUSDL_ADDRESS =
0xbEeFc011e94f43b8B7b455eBaB290C7Ab4E216f1;
address internal constant JRUSDE_ADDRESS =
0xC58D044404d8B14e953C115E67823784dEA53d8F;
address internal constant SRUSDE_ADDRESS =
0x3d7d6fdf07EE548B939A80edbc9B2256d0cdc003;
address internal constant WBTC_ADDRESS =
0x2260FAC5E5542a773Aa44fBCfeDf7C193bc2C599;
address internal constant cbBTC_ADDRESS =
0xcbB7C0000aB88B473b1f5aFd9ef808440eed33Bf;
address internal constant tBTC_ADDRESS =
0x18084fbA666a33d37592fA2633fD49a74DD93a88;
address internal constant eBTC_ADDRESS =
0x657e8C867D8B37dCC18fA4Caead9C45EB088C642;
address internal constant lBTC_ADDRESS =
0x8236a87084f8B84306f72007F36F2618A5634494;
address internal constant INST_ADDRESS =
0x6f40d4A6237C257fff2dB00FA0510DeEECd303eb;
address internal constant FLUID_ADDRESS =
0x6f40d4A6237C257fff2dB00FA0510DeEECd303eb;
address internal constant RLP_ADDRESS =
0x4956b52aE2fF65D74CA2d61207523288e4528f96;
address internal constant wstUSR_ADDRESS =
0x1202F5C7b4B9E47a1A484E8B270be34dbbC75055;
address internal constant XAUT_ADDRESS =
0x68749665FF8D2d112Fa859AA293F07A622782F38;
address internal constant PAXG_ADDRESS =
0x45804880De22913dAFE09f4980848ECE6EcbAf78;
// fTokens
address internal constant F_USDT_ADDRESS =
0x5C20B550819128074FD538Edf79791733ccEdd18;
address internal constant F_USDC_ADDRESS =
0x9Fb7b4477576Fe5B32be4C1843aFB1e55F251B33;
address internal constant F_WETH_ADDRESS =
0x90551c1795392094FE6D29B758EcCD233cFAa260;
address internal constant F_WSTETH_ADDRESS =
0x2411802D8BEA09be0aF8fD8D08314a63e706b29C;
address internal constant F_GHO_ADDRESS =
0x6A29A46E21C730DcA1d8b23d637c101cec605C5B;
address internal constant F_SUSDs_ADDRESS =
0x2BBE31d63E6813E3AC858C04dae43FB2a72B0D11;
address internal constant F_USDTb_ADDRESS =
0x15e8c742614b5D8Db4083A41Df1A14F5D2bFB400;
// Constants
uint256 internal constant X8 = 0xff;
uint256 internal constant X10 = 0x3ff;
uint256 internal constant X14 = 0x3fff;
uint256 internal constant X15 = 0x7fff;
uint256 internal constant X16 = 0xffff;
uint256 internal constant X17 = 0x1ffff;
uint256 internal constant X18 = 0x3ffff;
uint256 internal constant X24 = 0xffffff;
uint256 internal constant X64 = 0xffffffffffffffff;
uint256 internal constant DEFAULT_EXPONENT_SIZE = 8;
uint256 internal constant DEFAULT_EXPONENT_MASK = 0xff;
constructor() {
ADDRESS_THIS = address(this);
}
}
"
},
"project/contracts/payloads/common/helpers.sol": {
"content": "pragma solidity ^0.8.21;
pragma experimental ABIEncoderV2;
import {BigMathMinified} from "../libraries/bigMathMinified.sol";
import {LiquidityCalcs} from "../libraries/liquidityCalcs.sol";
import {LiquiditySlotsLink} from "../libraries/liquiditySlotsLink.sol";
import {DexSlotsLink} from "../libraries/dexSlotsLink.sol";
import {IGovernorBravo} from "./interfaces/IGovernorBravo.sol";
import {ITimelock} from "./interfaces/ITimelock.sol";
import {IFluidLiquidityAdmin, AdminModuleStructs as FluidLiquidityAdminStructs} from "./interfaces/IFluidLiquidity.sol";
import {IFluidReserveContract} from "./interfaces/IFluidReserveContract.sol";
import {IFluidVaultFactory} from "./interfaces/IFluidVaultFactory.sol";
import {IFluidDexFactory} from "./interfaces/IFluidDexFactory.sol";
import {IFluidLendingFactory} from "./interfaces/IFluidLendingFactory.sol";
import {IFluidDex, IFluidAdminDex} from "./interfaces/IFluidDex.sol";
import {IFluidDexResolver} from "./interfaces/IFluidDex.sol";
import {IFluidVault} from "./interfaces/IFluidVault.sol";
import {IFluidVaultT1} from "./interfaces/IFluidVault.sol";
import {IFTokenAdmin} from "./interfaces/IFToken.sol";
import {ILendingRewards} from "./interfaces/IFToken.sol";
import {ISmartLendingAdmin} from "./interfaces/ISmartLending.sol";
import {IDSAV2} from "./interfaces/IDSA.sol";
import {PayloadIGPConstants} from "./constants.sol";
contract PayloadIGPHelpers is PayloadIGPConstants {
/**
* |
* | Proposal Payload Helpers |
* |__________________________________
*/
function getVaultAddress(uint256 vaultId_) public view returns (address) {
return VAULT_FACTORY.getVaultAddress(vaultId_);
}
function getDexAddress(uint256 dexId_) public view returns (address) {
return DEX_FACTORY.getDexAddress(dexId_);
}
function getFTokenAddress(address token) public view returns (address) {
if (token == WETH_ADDRESS) {
return LENDING_FACTORY.computeToken(token, "NativeUnderlying");
}
return LENDING_FACTORY.computeToken(token, "fToken");
}
function getCurrentBaseWithdrawalLimit(
address token_,
address user_
) internal view returns (uint256) {
bytes32 _LIQUDITY_PROTOCOL_SUPPLY_SLOT = LiquiditySlotsLink
.calculateDoubleMappingStorageSlot(
LiquiditySlotsLink.LIQUIDITY_USER_SUPPLY_DOUBLE_MAPPING_SLOT,
user_,
token_
);
uint256 userSupplyData_ = LIQUIDITY.readFromStorage(
_LIQUDITY_PROTOCOL_SUPPLY_SLOT
);
return
BigMathMinified.fromBigNumber(
(userSupplyData_ >>
LiquiditySlotsLink.BITS_USER_SUPPLY_BASE_WITHDRAWAL_LIMIT) &
X18,
DEFAULT_EXPONENT_SIZE,
DEFAULT_EXPONENT_MASK
);
}
function setProtocolSupplyExpansion(
address protocol,
address token,
uint256 expandPercent,
uint256 expandDuration
) internal {
FluidLiquidityAdminStructs.UserSupplyConfig[]
memory configs_ = new FluidLiquidityAdminStructs.UserSupplyConfig[](
1
);
configs_[0] = FluidLiquidityAdminStructs.UserSupplyConfig({
user: protocol,
token: token,
mode: 1,
expandPercent: expandPercent,
expandDuration: expandDuration,
baseWithdrawalLimit: getCurrentBaseWithdrawalLimit(token, protocol) // Keep existing limit
});
LIQUIDITY.updateUserSupplyConfigs(configs_);
}
/// @dev gets a smart lending address based on the underlying dexId
function getSmartLendingAddress(
uint256 dexId_
) public view returns (address) {
return SMART_LENDING_FACTORY.getSmartLendingAddress(dexId_);
}
struct SupplyProtocolConfig {
address protocol;
address supplyToken;
uint256 expandPercent;
uint256 expandDuration;
uint256 baseWithdrawalLimitInUSD;
}
struct BorrowProtocolConfig {
address protocol;
address borrowToken;
uint256 expandPercent;
uint256 expandDuration;
uint256 baseBorrowLimitInUSD;
uint256 maxBorrowLimitInUSD;
}
function setSupplyProtocolLimits(
SupplyProtocolConfig memory protocolConfig_
) internal {
{
// Supply Limits
FluidLiquidityAdminStructs.UserSupplyConfig[]
memory configs_ = new FluidLiquidityAdminStructs.UserSupplyConfig[](
1
);
configs_[0] = FluidLiquidityAdminStructs.UserSupplyConfig({
user: address(protocolConfig_.protocol),
token: protocolConfig_.supplyToken,
mode: 1,
expandPercent: protocolConfig_.expandPercent,
expandDuration: protocolConfig_.expandDuration,
baseWithdrawalLimit: getRawAmount(
protocolConfig_.supplyToken,
0,
protocolConfig_.baseWithdrawalLimitInUSD,
true
)
});
LIQUIDITY.updateUserSupplyConfigs(configs_);
}
}
function setBorrowProtocolLimits(
BorrowProtocolConfig memory protocolConfig_
) internal {
{
// Borrow Limits
FluidLiquidityAdminStructs.UserBorrowConfig[]
memory configs_ = new FluidLiquidityAdminStructs.UserBorrowConfig[](
1
);
configs_[0] = FluidLiquidityAdminStructs.UserBorrowConfig({
user: address(protocolConfig_.protocol),
token: protocolConfig_.borrowToken,
mode: 1,
expandPercent: protocolConfig_.expandPercent,
expandDuration: protocolConfig_.expandDuration,
baseDebtCeiling: getRawAmount(
protocolConfig_.borrowToken,
0,
protocolConfig_.baseBorrowLimitInUSD,
false
),
maxDebtCeiling: getRawAmount(
protocolConfig_.borrowToken,
0,
protocolConfig_.maxBorrowLimitInUSD,
false
)
});
LIQUIDITY.updateUserBorrowConfigs(configs_);
}
}
function setSupplyProtocolLimitsPaused(
address protocol_,
address token_
) internal {
{
// Supply Limits
FluidLiquidityAdminStructs.UserSupplyConfig[]
memory configs_ = new FluidLiquidityAdminStructs.UserSupplyConfig[](
1
);
configs_[0] = FluidLiquidityAdminStructs.UserSupplyConfig({
user: protocol_,
token: token_,
mode: 1,
expandPercent: 1, // 0.01%
expandDuration: 16777215, // max time
baseWithdrawalLimit: 10
});
LIQUIDITY.updateUserSupplyConfigs(configs_);
}
}
function setBorrowProtocolLimitsPaused(
address protocol_,
address token_
) internal {
{
// Borrow Limits
FluidLiquidityAdminStructs.UserBorrowConfig[]
memory configs_ = new FluidLiquidityAdminStructs.UserBorrowConfig[](
1
);
configs_[0] = FluidLiquidityAdminStructs.UserBorrowConfig({
user: protocol_,
token: token_,
mode: 1,
expandPercent: 1, // 0.01%
expandDuration: 16777215, // max time
baseDebtCeiling: 10,
maxDebtCeiling: 20
});
LIQUIDITY.updateUserBorrowConfigs(configs_);
}
}
function setSupplyProtocolLimitsPausedDex(
address dex_,
address user_
) internal {
{
// Supply Limits for DEX - using DEX-specific interface
IFluidAdminDex.UserSupplyConfig[]
memory configs_ = new IFluidAdminDex.UserSupplyConfig[](1);
configs_[0] = IFluidAdminDex.UserSupplyConfig({
user: user_,
expandPercent: 1, // 0.01%
expandDuration: 16777215, // max time
baseWithdrawalLimit: 10 // minimal limit for pausing
});
IFluidDex(dex_).updateUserSupplyConfigs(configs_);
}
}
function setBorrowProtocolLimitsPausedDex(
address dex_,
address user_
) internal {
{
// Borrow Limits for DEX - using DEX-specific interface
IFluidAdminDex.UserBorrowConfig[]
memory configs_ = new IFluidAdminDex.UserBorrowConfig[](1);
configs_[0] = IFluidAdminDex.UserBorrowConfig({
user: user_,
expandPercent: 1, // 0.01%
expandDuration: 16777215, // max time
baseDebtCeiling: 10, // minimal limit for pausing
maxDebtCeiling: 20 // minimal limit for pausing
});
IFluidDex(dex_).updateUserBorrowConfigs(configs_);
}
}
struct DexBorrowProtocolConfigInShares {
address dex;
address protocol;
uint256 expandPercent;
uint256 expandDuration;
uint256 baseBorrowLimit;
uint256 maxBorrowLimit;
}
function setDexBorrowProtocolLimitsInShares(
DexBorrowProtocolConfigInShares memory protocolConfig_
) internal {
IFluidAdminDex.UserBorrowConfig[]
memory config_ = new IFluidAdminDex.UserBorrowConfig[](1);
config_[0] = IFluidAdminDex.UserBorrowConfig({
user: protocolConfig_.protocol,
expandPercent: protocolConfig_.expandPercent,
expandDuration: protocolConfig_.expandDuration,
baseDebtCeiling: protocolConfig_.baseBorrowLimit,
maxDebtCeiling: protocolConfig_.maxBorrowLimit
});
IFluidDex(protocolConfig_.dex).updateUserBorrowConfigs(config_);
}
function getRawAmount(
address token,
uint256 amount,
uint256 amountInUSD,
bool isSupply
) public view virtual returns (uint256) {
return 0;
}
struct DexConfig {
address dex;
address tokenA;
address tokenB;
bool smartCollateral;
bool smartDebt;
uint256 baseWithdrawalLimitInUSD;
uint256 baseBorrowLimitInUSD;
uint256 maxBorrowLimitInUSD;
}
enum VAULT_TYPE {
TYPE_1,
TYPE_2,
TYPE_3,
TYPE_4
}
struct VaultConfig {
address vault;
VAULT_TYPE vaultType;
address supplyToken;
address borrowToken;
uint256 baseWithdrawalLimitInUSD;
uint256 baseBorrowLimitInUSD;
uint256 maxBorrowLimitInUSD;
}
function setDexLimits(DexConfig memory dex_) internal {
// Smart Collateral
if (dex_.smartCollateral) {
SupplyProtocolConfig
memory protocolConfigTokenA_ = SupplyProtocolConfig({
protocol: dex_.dex,
supplyToken: dex_.tokenA,
expandPercent: 50 * 1e2, // 50%
expandDuration: 1 hours, // 1 hour
baseWithdrawalLimitInUSD: dex_.baseWithdrawalLimitInUSD
});
setSupplyProtocolLimits(protocolConfigTokenA_);
SupplyProtocolConfig
memory protocolConfigTokenB_ = SupplyProtocolConfig({
protocol: dex_.dex,
supplyToken: dex_.tokenB,
expandPercent: 50 * 1e2, // 50%
expandDuration: 1 hours, // 1 hour
baseWithdrawalLimitInUSD: dex_.baseWithdrawalLimitInUSD
});
setSupplyProtocolLimits(protocolConfigTokenB_);
}
// Smart Debt
if (dex_.smartDebt) {
BorrowProtocolConfig
memory protocolConfigTokenA_ = BorrowProtocolConfig({
protocol: dex_.dex,
borrowToken: dex_.tokenA,
expandPercent: 50 * 1e2, // 50%
expandDuration: 1 hours, // 1 hour
baseBorrowLimitInUSD: dex_.baseBorrowLimitInUSD,
maxBorrowLimitInUSD: dex_.maxBorrowLimitInUSD
});
setBorrowProtocolLimits(protocolConfigTokenA_);
BorrowProtocolConfig
memory protocolConfigTokenB_ = BorrowProtocolConfig({
protocol: dex_.dex,
borrowToken: dex_.tokenB,
expandPercent: 50 * 1e2, // 50%
expandDuration: 1 hours, // 1 hour
baseBorrowLimitInUSD: dex_.baseBorrowLimitInUSD,
maxBorrowLimitInUSD: dex_.maxBorrowLimitInUSD
});
setBorrowProtocolLimits(protocolConfigTokenB_);
}
}
function setVaultLimits(VaultConfig memory vault_) internal {
if (vault_.vaultType == VAULT_TYPE.TYPE_1) {
SupplyProtocolConfig memory protocolConfig_ = SupplyProtocolConfig({
protocol: vault_.vault,
supplyToken: vault_.supplyToken,
expandPercent: 50 * 1e2, // 50%
expandDuration: 6 hours, // 6 hours
baseWithdrawalLimitInUSD: vault_.baseWithdrawalLimitInUSD
});
setSupplyProtocolLimits(protocolConfig_);
}
if (vault_.vaultType == VAULT_TYPE.TYPE_1) {
BorrowProtocolConfig memory protocolConfig_ = BorrowProtocolConfig({
protocol: vault_.vault,
borrowToken: vault_.borrowToken,
expandPercent: 50 * 1e2, // 50%
expandDuration: 6 hours, // 6 hours
baseBorrowLimitInUSD: vault_.baseBorrowLimitInUSD,
maxBorrowLimitInUSD: vault_.maxBorrowLimitInUSD
});
setBorrowProtocolLimits(protocolConfig_);
}
if (vault_.vaultType == VAULT_TYPE.TYPE_2) {
BorrowProtocolConfig memory protocolConfig_ = BorrowProtocolConfig({
protocol: vault_.vault,
borrowToken: vault_.borrowToken,
expandPercent: 30 * 1e2, // 30%
expandDuration: 6 hours, // 6 hours
baseBorrowLimitInUSD: vault_.baseBorrowLimitInUSD,
maxBorrowLimitInUSD: vault_.maxBorrowLimitInUSD
});
setBorrowProtocolLimits(protocolConfig_);
}
if (vault_.vaultType == VAULT_TYPE.TYPE_3) {
SupplyProtocolConfig memory protocolConfig_ = SupplyProtocolConfig({
protocol: vault_.vault,
supplyToken: vault_.supplyToken,
expandPercent: 35 * 1e2, // 35%
expandDuration: 6 hours, // 6 hours
baseWithdrawalLimitInUSD: vault_.baseWithdrawalLimitInUSD
});
setSupplyProtocolLimits(protocolConfig_);
}
}
function updateDexBaseLimits(
uint256 dexId,
uint256 maxSupplySharesInUSD,
uint256 maxBorrowSharesInUSD
) internal {
address dexAddress = getDexAddress(dexId);
if (dexAddress == address(0)) return;
(address AddressTokenA, address AddressTokenB) = getDexTokens(
dexAddress
);
uint256 baseWithdrawalInUSD = (maxSupplySharesInUSD * 45) / 100; // 45% of supply cap
uint256 baseBorrowInUSD = (maxBorrowSharesInUSD * 60) / 100; // 60% of max borrow cap
uint256 maxBorrowInUSD = (maxBorrowSharesInUSD * 125) / 100; // 25% increase
DexConfig memory dex_ = DexConfig({
dex: dexAddress,
tokenA: AddressTokenA,
tokenB: AddressTokenB,
smartCollateral: maxSupplySharesInUSD > 0,
smartDebt: maxBorrowSharesInUSD > 0,
baseWithdrawalLimitInUSD: baseWithdrawalInUSD,
baseBorrowLimitInUSD: baseBorrowInUSD,
maxBorrowLimitInUSD: maxBorrowInUSD
});
setDexLimits(dex_);
}
function getDexTokens(
address dexAddress_
) internal view returns (address, address) {
IFluidDex.ConstantViews memory constantViews_ = IFluidDex(dexAddress_)
.constantsView();
return (constantViews_.token0, constantViews_.token1);
}
function updateDexRevenueCut(uint256 dexId, uint256 revenueCut) internal {
address dexAddress = getDexAddress(dexId);
uint256 dexVariables2_ = IFluidDex(dexAddress).readFromStorage(
bytes32(DexSlotsLink.DEX_VARIABLES2_SLOT)
);
uint256 fee_ = (dexVariables2_ >> 2) & X17;
IFluidDex(dexAddress).updateFeeAndRevenueCut(
fee_, // fee stays the same
revenueCut
);
}
}
"
},
"project/contracts/payloads/common/interfaces/ICodeReader.sol": {
"content": "// SPDX-License-Identifier: MIT
pragma solidity ^0.8.21;
interface ICodeReader {
function readCode(address target) external view returns (bytes memory);
} "
},
"project/contracts/payloads/common/interfaces/IDSA.sol": {
"content": "pragma solidity ^0.8.21;
interface IDSAV2 {
function cast(
string[] memory _targetNames,
bytes[] memory _datas,
address _origin
)
external
payable
returns (bytes32);
function isAuth(address user) external view returns (bool);
}
interface IDSAConnectorsV2 {
function toggleChief(address _chiefAddress) external;
}
"
},
"project/contracts/payloads/common/interfaces/IERC20.sol": {
"content": "pragma solidity ^0.8.21;
interface IERC20 {
function allowance(
address spender,
address caller
) external view returns (uint256);
function approve(address spender, uint256 amount) external returns (bool);
function balanceOf(address account) external view returns (uint256);
}"
},
"project/contracts/payloads/common/interfaces/IFluidDex.sol": {
"content": "pragma solidity ^0.8.21;
interface IFluidAdminDex {
/// @param upperThresholdPercent_ in 4 decimals, 10000 = 1%
/// @param lowerThresholdPercent_ in 4 decimals, 10000 = 1%
/// @param thresholdShiftTime_ in secs, in how much time the threshold percent should take to shift the ranges
/// @param shiftTime_ in secs, in how much time the upper config changes should be fully done.
function updateThresholdPercent(
uint upperThresholdPercent_,
uint lowerThresholdPercent_,
uint thresholdShiftTime_,
uint shiftTime_
) external;
function updateCenterPriceLimits(
uint maxCenterPrice_,
uint minCenterPrice_
) external;
function updateCenterPriceAddress(
uint centerPriceAddress_,
uint percent_,
uint time_
) external;
function readFromStorage(
bytes32 slot_
) external view returns (uint256 result_);
function updateMaxSupplyShares(uint maxSupplyShares_) external;
function updateMaxBorrowShares(uint maxBorrowShares_) external;
/// @notice struct to set user supply & withdrawal config
struct UserSupplyConfig {
///
/// @param user address
address user;
///
/// @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 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;
}
function updateUserBorrowConfigs(
UserBorrowConfig[] memory userBorrowConfigs_
) external;
function updateUserSupplyConfigs(
UserSupplyConfig[] memory userSupplyConfigs_
) external;
struct InitializeVariables {
bool smartCol;
uint token0ColAmt;
bool smartDebt;
uint token0DebtAmt;
uint centerPrice;
uint fee;
uint revenueCut;
uint upperPercent;
uint lowerPercent;
uint upperShiftThreshold;
uint lowerShiftThreshold;
uint thresholdShiftTime;
uint centerPriceAddress;
uint hookAddress;
uint maxCenterPrice;
uint minCenterPrice;
}
function initialize(InitializeVariables memory initializeVariables_) external payable;
function updateRangePercents(
uint upperPercent_,
uint lowerPercent_,
uint shiftTime_
) external;
/// @param fee_ in 4 decimals, 10000 = 1%
/// @param revenueCut_ in 4 decimals, 100000 = 10%, 10% cut on fee_, so if fee is 1% and cut is 10% then cut in swap amount will be 10% of 1% = 0.1%
function updateFeeAndRevenueCut(uint fee_, uint revenueCut_) external;
/// @notice pause user operations at DEX level
/// @param user_ address of user to pause operations for
/// @param pauseSupply_ whether to pause supply operations
/// @param pauseBorrow_ whether to pause borrow operations
function pauseUser(address user_, bool pauseSupply_, bool pauseBorrow_) external;
function pauseSwapAndArbitrage() external;
}
interface IFluidUserDex {
struct Implementations {
address shift;
address admin;
address colOperations;
address debtOperations;
address perfectOperationsAndOracle;
}
struct ConstantViews {
uint256 dexId;
address liquidity;
address factory;
Implementations implementations;
address deployerContract;
address token0;
address token1;
bytes32 supplyToken0Slot;
bytes32 borrowToken0Slot;
bytes32 supplyToken1Slot;
bytes32 borrowToken1Slot;
bytes32 exchangePriceToken0Slot;
bytes32 exchangePriceToken1Slot;
uint256 oracleMapping;
}
function constantsView() external view returns (ConstantViews memory constantsView_);
}
interface IFluidDex is IFluidAdminDex, IFluidUserDex {
}
interface IFluidDexResolver {
struct Configs {
bool isSmartCollateralEnabled;
bool isSmartDebtEnabled;
uint256 fee;
uint256 revenueCut;
uint256 upperRange;
uint256 lowerRange;
uint256 upperShiftThreshold;
uint256 lowerShiftThreshold;
uint256 shiftingTime;
address centerPriceAddress;
address hookAddress;
uint256 maxCenterPrice;
uint256 minCenterPrice;
uint256 utilizationLimitToken0;
uint256 utilizationLimitToken1;
uint256 maxSupplyShares;
uint256 maxBorrowShares;
}
function getDexConfigs(
address dex_
) external view returns (Configs memory configs_);
}"
},
"project/contracts/payloads/common/interfaces/IFluidDexFactory.sol": {
"content": "pragma solidity ^0.8.21;
interface IFluidDexFactory {
/// @notice Computes the address of a dex based on its given ID (`dexId_`).
/// @param dexId_ The ID of the dex.
/// @return dex_ Returns the computed address of the dex.
function getDexAddress(uint256 dexId_) external view returns (address dex_);
function setDexAuth(address dex_, address dexAuth_, bool allowed_) external;
/// @notice Sets an address (`globalAuth_`) as a global authorization or not.
/// This function can only be called by the owner.
/// @param globalAuth_ The address to be set as global authorization.
/// @param allowed_ A boolean indicating whether the specified address is allowed to update any dex config.
function setGlobalAuth(address globalAuth_, bool allowed_) external;
/// @notice Sets an address as a factory-level authorization or not.
/// @param auth The address to be set as factory authorization.
/// @param allowed A boolean indicating whether the specified address is allowed as factory auth.
function setFactoryAuth(address auth, bool allowed) external;
/// @notice Sets an address as a deployer or not.
/// @param deployer_ The address to be set as deployer.
/// @param allowed_ A boolean indicating whether the specified address is allowed as deployer.
function setDeployer(address deployer_, bool allowed_) external;
function owner() external view returns (address);
function setDexDeploymentLogic(
address deploymentLogic_,
bool allowed_
) external;
}"
},
"project/contracts/payloads/common/interfaces/IFluidLendingFactory.sol": {
"content": "pragma solidity ^0.8.21;
interface IFluidLendingFactory {
/// @notice Computes the address of a token based on the asset and fToken type.
/// @param asset_ The address of the underlying asset.
/// @param fTokenType_ The type of fToken (e.g., "fToken" or "NativeUnderlying").
/// @return The computed address of the token.
function computeToken(address asset_, string calldata fTokenType_) external view returns (address);
/// @notice Sets an address as a factory-level authorization or not.
/// @param auth The address to be set as factory authorization.
/// @param allowed A boolean indicating whether the specified address is allowed as factory auth.
function setFactoryAuth(address auth, bool allowed) external;
/// @notice Sets an address as a deployer or not.
/// @param deployer_ The address to be set as deployer.
/// @param allowed_ A boolean indicating whether the specified address is allowed as deployer.
function setDeployer(address deployer_, bool allowed_) external;
}"
},
"project/contracts/payloads/common/interfaces/IFluidLiquidity.sol": {
"content": "pragma solidity ^0.8.21;
pragma experimental ABIEncoderV2;
interface AdminModuleStructs {
struct AddressBool {
address addr;
bool value;
}
struct AddressUint256 {
address addr;
uint256 value;
}
struct RateDataV1Params {
address token;
uint256 kink;
uint256 rateAtUtilizationZero;
uint256 rateAtUtilizationKink;
uint256 rateAtUtilizationMax;
}
struct RateDataV2Params {
address token;
uint256 kink1;
uint256 kink2;
uint256 rateAtUtilizationZero;
uint256 rateAtUtilizationKink1;
uint256 rateAtUtilizationKink2;
uint256 rateAtUtilizationMax;
}
struct TokenConfig {
address token;
uint256 fee;
uint256 threshold;
uint256 maxUtilization;
}
struct UserSupplyConfig {
address user;
address token;
uint8 mode;
uint256 expandPercent;
uint256 expandDuration;
uint256 baseWithdrawalLimit;
}
struct UserBorrowConfig {
address user;
address token;
uint8 mode;
uint256 expandPercent;
uint256 expandDuration;
uint256 baseDebtCeiling;
uint256 maxDebtCeiling;
}
}
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 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_
);
function readFromStorage(
bytes32 slot_
) external view returns (uint256 result_);
}"
},
"project/contracts/payloads/common/interfaces/IFluidReserveContract.sol": {
"content": "pragma solidity ^0.8.21;
pragma experimental ABIEncoderV2;
interface IFluidReserveContract {
function isRebalancer(address user) external returns (bool);
function rebalanceFToken(address protocol_) external;
function rebalanceVault(address protocol_) external;
function transferFunds(address token_) external;
function withdrawFunds(
address[] memory tokens_,
uint256[] memory amounts_,
address to_
) external;
function getProtocolTokens(address protocol_) external;
function updateAuth(address auth_, bool isAuth_) external;
function updateRebalancer(address rebalancer_, bool isRebalancer_) external;
function approve(
address[] memory protocols_,
address[] memory tokens_,
uint256[] memory amounts_
) external;
function revoke(
address[] memory protocols_,
address[] memory tokens_
) external;
}"
},
"project/contracts/payloads/common/interfaces/IFluidSmartLendingFactory.sol": {
"content": "pragma solidity ^0.8.21;
interface IFluidSmartLendingFactory {
/// @notice Updates the authorization status of an address for a SmartLending contract. Only callable by owner.
/// @param smartLending_ The address of the SmartLending contract.
/// @param auth_ The address to be updated.
/// @param allowed_ The new authorization status.
function updateSmartLendingAuth(
address smartLending_,
address auth_,
bool allowed_
) external;
/// @notice Sets the creation code for new SmartLending contracts. Only callable by owner.
/// @param creationCode_ New SmartLending contract creation code.
function setSmartLendingCreationCode(bytes calldata creationCode_) external;
/// @notice Computes the address of a SmartLending contract based on a given DEX ID.
/// @param dexId_ The ID of the DEX for which the SmartLending contract address is being computed.
/// @return The computed SmartLending contract address.
function getSmartLendingAddress(
uint256 dexId_
) external view returns (address);
/// @notice Sets an address as a factory-level authorization or not.
/// @param auth The address to be set as factory authorization.
/// @param allowed A boolean indicating whether the specified address is allowed as factory auth.
function setFactoryAuth(address auth, bool allowed) external;
/// @notice Sets an address as a deployer or not.
/// @param deployer_ The address to be set as deployer.
/// @param allowed_ A boolean indicating whether the specified address is allowed as deployer.
function updateDeployer(address deployer_, bool allowed_) external;
}
"
},
"project/contracts/payloads/common/interfaces/IFluidVault.sol": {
"content": "pragma solidity ^0.8.21;
interface IFluidVaultT1 {
/// @notice updates the Vault oracle to `newOracle_`. Must implement the FluidOracle interface.
function updateOracle(address newOracle_) external;
/// @notice updates the all Vault core settings according to input params.
/// All input values are expected in 1e2 (1% = 100, 100% = 10_000).
function updateCoreSettings(
uint256 supplyRateMagnifier_,
uint256 borrowRateMagnifier_,
uint256 collateralFactor_,
uint256 liquidationThreshold_,
uint256 liquidationMaxLimit_,
uint256 withdrawGap_,
uint256 liquidationPenalty_,
uint256 borrowFee_
) external;
/// @notice updates the allowed rebalancer to `newRebalancer_`.
function updateRebalancer(address newRebalancer_) external;
/// @notice updates the supply rate magnifier to `supplyRateMagnifier_`. Input in 1e2 (1% = 100, 100% = 10_000).
function updateSupplyRateMagnifier(uint supplyRateMagnifier_) external;
/// @notice updates the borrow rate magnifier to `borrowRateMagnifier_`. Input in 1e2 (1% = 100, 100% = 10_000).
function updateBorrowRateMagnifier(uint borrowRateMagnifier_) external;
/// @notice updates the collateral factor to `collateralFactor_`. Input in 1e2 (1% = 100, 100% = 10_000).
function updateCollateralFactor(uint collateralFactor_) external;
/// @notice updates the liquidation threshold to `liquidationThreshold_`. Input in 1e2 (1% = 100, 100% = 10_000).
function updateLiquidationThreshold(uint liquidationThreshold_) external;
/// @notice updates the liquidation max limit to `liquidationMaxLimit_`. Input in 1e2 (1% = 100, 100% = 10_000).
function updateLiquidationMaxLimit(uint liquidationMaxLimit_) external;
/// @notice updates the withdrawal gap to `withdrawGap_`. Input in 1e2 (1% = 100, 100% = 10_000).
function updateWithdrawGap(uint withdrawGap_) external;
/// @notice updates the liquidation penalty to `liquidationPenalty_`. Input in 1e2 (1% = 100, 100% = 10_000).
function updateLiquidationPenalty(uint liquidationPenalty_) external;
/// @notice updates the borrow fee to `borrowFee_`. Input in 1e2 (1% = 100, 100% = 10_000).
function updateBorrowFee(uint borrowFee_) external;
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_);
function absorbDustDebt(uint[] memory nftIds) external;
}
interface IFluidSmartVault {
function TYPE() external view returns (uint256);
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_);
function updateOracle(uint256 newOracle_) external;
}
interface IFluidVault {
function updateOracle(uint256 newOracle_) external;
}"
},
"project/contracts/payloads/common/interfaces/IFluidVaultFactory.sol": {
"content": "pragma solidity ^0.8.21;
pragma experimental ABIEncoderV2;
interface IFluidVaultFactory {
/// @notice Sets an address as allowed vault deployment logic (`deploymentLogic_`) contract or not.
/// This function can only be called by the owner.
/// @param deploymentLogic_ The address of the vault deployment logic contract to be set.
/// @param allowed_ A boolean indicating whether the specified address is allowed to deploy new type of vault.
function setVaultDeploymentLogic(
address deploymentLogic_,
bool allowed_
) external;
/// @notice Sets an address (`vaultAuth_`) as allowed vault authorization or not for a specific vault (`vault_`).
/// This function can only be called by the owner.
/// @param vault_ The address of the vault for which the authorization is being set.
/// @param vaultAuth_ The address to be set as vault authorization.
/// @param allowed_ A boolean indicating whether the specified address is allowed to update the specific vault config.
function setVaultAuth(
address vault_,
address vaultAuth_,
bool allowed_
) external;
/// @notice Computes the address of a vault based on its given ID (`vaultId_`).
/// @param vaultId_ The ID of the vault.
/// @return vault_ Returns the computed address of the vault.
function getVaultAddress(
uint256 vaultId_
) external view returns (address vault_);
/// @notice Sets an address (`globalAuth_`) as a global authorization or not.
/// This function can only be called by the owner.
/// @param globalAuth_ The address to be set as global authorization.
/// @param allowed_ A boolean indicating whether the specified address is allowed to update any vault config.
function setGlobalAuth(address globalAuth_, bool allowed_) external;
/// @notice Sets an address as a factory-level authorization or not.
/// @param auth The address to be set as factory authorization.
/// @param allowed A boolean indicating whether the specified address is allowed as factory auth.
function setFactoryAuth(address auth, bool allowed) external;
/// @notice Sets an address as a deployer or not.
/// @param deployer_ The address to be set as deployer.
/// @param allowed_ A boolean indicating whether the specified address is allowed as deployer.
function setDeployer(address deployer_, bool allowed_) external;
}"
},
"project/contracts/payloads/common/interfaces/IFToken.sol": {
"content": "pragma solidity ^0.8.21;
interface IFTokenAdmin {
/// @notice updates the rewards rate model contract.
/// Only callable by LendingFactory auths.
/// @param rewardsRateModel_ the new rewards rate model contract address.
/// can be set to address(0) to set no rewards (to save gas)
function updateRewards(address rewardsRateModel_) external;
/// @notice Balances out the difference between fToken supply at Liquidity vs totalAssets().
/// Deposits underlying from rebalancer address into Liquidity but doesn't mint any shares
/// -> thus making deposit available as rewards.
/// Only callable by rebalancer.
/// @return assets_ amount deposited to Liquidity
function rebalance() external payable returns (uint256 assets_);
/// @notice gets the liquidity exchange price of the underlying asset, calculates the updated exchange price (with reward rates)
/// and writes those values to storage.
/// Callable by anyone.
/// @return tokenExchangePrice_ exchange price of fToken share to underlying asset
/// @return liquidityExchangePrice_ exchange price at Liquidity for the underlying asset
function updateRates()
external
returns (uint256 tokenExchangePrice_, uint256 liquidityExchangePrice_);
/// @notice sends any potentially stuck funds to Liquidity contract. Only callable by LendingFactory auths.
function rescueFunds(address token_) external;
/// @notice Updates the rebalancer address (ReserveContract). Only callable by LendingFactory auths.
function updateRebalancer(address rebalancer_) external;
}
interface ILendingRewards {
function start() external;
}"
},
"project/contracts/payloads/common/interfaces/IGovernorBravo.sol": {
"content": "pragma solidity ^0.8.21;
pragma experimental ABIEncoderV2;
interface IGovernorBravo {
function _acceptAdmin() external;
function _setVotingDelay(uint256 newVotingDelay) external;
function _setVotingPeriod(uint256 newVotingPeriod) external;
function _acceptAdminOnTimelock() external;
function _setImplementation(address implementation_) external;
function propose(
address[] memory targets,
uint256[] memory values,
string[] memory signatures,
bytes[] memory calldatas,
string memory description
) external returns (uint256);
function admin() external view returns (address);
function pendingAdmin() external view returns (address);
function timelock() external view returns (address);
function votingDelay() external view returns (uint256);
function votingPeriod() external view returns (uint256);
}"
},
"project/contracts/payloads/common/interfaces/ILite.sol": {
"content": "pragma solidity ^0.8.21;
interface ILite {
function setAdmin(address newAdmin) external;
function getAdmin() external view returns (address);
function removeImplementation(address implementation_) external;
function addImplementation(
address implementation_,
bytes4[] calldata sigs_
) external;
function setDummyImplementation(address newDummyImplementation_) external;
function updateMaxRiskRatio(
uint8[] memory protocolId_,
uint256[] memory newRiskRatio_
) external;
function updateAggrMaxVaultRatio(uint256 newAggrMaxVaultRatio_) external;
function addDSAAuth(address auth_) external;
// Collect stETH revenue to the treasury address set in Lite
// amount_ is specified in stETH wei (1e18 per stETH)
function collectRevenue(uint256 amount_) external;
function getImplementationSigs(address implementation_) external view returns (bytes4[] memory);
function updateSecondaryAuth(address secondaryAuth_) external;
function updateRebalancer(address rebalancer_, bool isRebalancer_) external;
}"
},
"project/contracts/payloads/common/interfaces/IProxy.sol": {
"content": "pragma solidity ^0.8.21;
interface IProxy {
function upgradeToAndCall(address newImplementation, bytes memory data) external;
}"
},
"project/contracts/payloads/common/interfaces/ISmartLending.sol": {
"content": "pragma solidity ^0.8.21;
interface ISmartLendingAdmin {
/// @notice set the rebalancer address (ReserveContract). Only callable by SmartLendingFactory auths.
function setRebalancer(address rebalancer_) external;
/// @dev Set the fee or reward. Only callable by auths.
/// @param feeOrReward_ The new fee or reward (1e6 = 100%, 1e4 = 1%, minimum 0.0001% fee or reward). 0 means no fee or reward
function setFeeOrReward(int256 feeOrReward_) external;
}"
},
"project/contracts/payloads/common/interfaces/ISmartLendingFactory.sol": {
"content": "// SPDX-License-Identifier: MIT
pragma solidity ^0.8.21;
interface ISmartLendingFactory {
function setSmartLendingCreationCode(bytes memory creationCode) external;
/// @notice Sets an address as a factory-level authorization or not.
/// @param auth The address to be set as factory authorization.
/// @param allowed A boolean indicating whether the specified address is allowed as factory auth.
function setFactoryAuth(address auth, bool allowed) external;
/// @notice Sets an address as a deployer or not.
/// @param deployer_ The address to be set as deployer.
/// @param allowed_ A boolean indicating whether the specified address is allowed as deployer.
function updateDeployer(address deployer_, bool allowed_) external;
} "
},
"project/contracts/payloads/common/interfaces/ITimelock.sol": {
"content": "pragma solidity ^0.8.21;
pragma experimental ABIEncoderV2;
interface ITimelock {
function acceptAdmin() external;
function setDelay(uint256 delay_) external;
function setPendingAdmin(address pendingAdmin_) external;
function queueTransaction(
address target,
uint256 value,
string memory signature,
bytes memory data,
uint256 eta
) external returns (bytes32);
function executeTransaction(
address target,
uint256 value,
string memory signature,
bytes memory data,
uint256 eta
) external payable returns (bytes memory);
function pendingAdmin() external view returns (address);
function admin() external view returns (address);
function delay() external view returns (uint256);
}"
},
"project/contracts/payloads/common/main.sol": {
"content": "pragma solidity ^0.8.21;
pragma experimental ABIEncoderV2;
import {BigMathMinified} from "../libraries/bigMathMinified.sol";
import {LiquidityCalcs} from "../libraries/liquidityCalcs.sol";
import {LiquiditySlotsLink} from "../libraries/liquiditySlotsLink.sol";
import { IGovernorBravo } from "./interfaces/IGovernorBravo.sol";
import { ITimelock } from "./interfaces/ITimelock.sol";
import { IFluidLiquidityAdmin, AdminModuleStructs as FluidLiquidityAdminStructs } from "./interfaces/IFluidLiquidity.sol";
import { IFluidReserveContract } from "./interfaces/IFluidReserveContract.sol";
import { IFluidVaultFactory } from "./interfaces/IFluidVaultFactory.sol";
import { IFluidDexFactory } from "./interfaces/IFluidDexFactory.sol";
import { IFluidDex, IFluidAdminDex } from "./interfaces/IFluidDex.sol";
import { IFluidDexResolver } from "./interfaces/IFluidDex.sol";
import { IFluidVault } from "./interfaces/IFluidVault.sol";
import { IFluidVaultT1 } from "./interfaces/IFluidVault.sol";
import { IFTokenAdmin } from "./interfaces/IFToken.sol";
import { ILendingRewards } from "./interfaces/IFToken.sol";
import { IDSAV2 } from "./interfaces/IDSA.sol";
import { PayloadIGPConstants } from "./constants.sol";
import { PayloadIGPHelpers } from "./helpers.sol";
abstract contract PayloadIGPMain is PayloadIGPHelpers {
/**
* |
* | State Variables |
* |__________________________
*/
/// @notice The unix time when the proposal was created
uint40 internal _proposalCreationTime;
/// @notice Boolean value to check if the proposal is executable. Default is not executable.
bool internal _isProposalExecutable;
/// @notice Actions that can be skipped
mapping(uint256 => bool) internal _skipAction;
/// @notice Modifier to check if an action can be skipped
modifier isActionSkippable(uint256 action_) {
// If function is not skippable, then execute
if (!PayloadIGPMain(ADDRESS_THIS).actionStatus(action_)) {
_;
}
}
/**
* |
* | Team Multisig Actions |
* |__________________________________
*/
function setActionsToSkip(
uint256[] calldata actionsToSkip_
) external {
if (msg.sender != TEAM_MULTISIG) {
revert("not-team-multisig");
}
for (uint256 i = 0; i < actionsToSkip_.length; i++) {
_skipAction[actionsToSkip_[i]] = true;
Submitted on: 2025-10-28 21:04:31
Comments
Log in to comment.
No comments yet.