fluid-contracts-public/deployments/mainnet/BufferRateHandler_WSTETH_ETH.json
2024-07-11 13:05:09 +00:00

311 lines
86 KiB
JSON

{
"address": "0xDF10FE6163c1bfB99d7179e1bFC2e0Bb6128704f",
"abi": [
{
"inputs": [
{
"internalType": "contract IFluidReserveContract",
"name": "reserveContract_",
"type": "address"
},
{
"internalType": "contract IFluidLiquidity",
"name": "liquidity_",
"type": "address"
},
{
"internalType": "address",
"name": "supplyToken_",
"type": "address"
},
{
"internalType": "address",
"name": "borrowToken_",
"type": "address"
},
{
"internalType": "int256",
"name": "rateBufferKink1_",
"type": "int256"
},
{
"internalType": "int256",
"name": "rateBufferKink2_",
"type": "int256"
},
{
"internalType": "uint256",
"name": "minUpdateDiff_",
"type": "uint256"
}
],
"stateMutability": "nonpayable",
"type": "constructor"
},
{
"inputs": [
{
"internalType": "uint256",
"name": "errorId_",
"type": "uint256"
}
],
"name": "FluidConfigError",
"type": "error"
},
{
"anonymous": false,
"inputs": [
{
"indexed": false,
"internalType": "uint256",
"name": "supplyRate",
"type": "uint256"
},
{
"indexed": false,
"internalType": "uint256",
"name": "oldRateKink1",
"type": "uint256"
},
{
"indexed": false,
"internalType": "uint256",
"name": "newRateKink1",
"type": "uint256"
},
{
"indexed": false,
"internalType": "uint256",
"name": "oldRateKink2",
"type": "uint256"
},
{
"indexed": false,
"internalType": "uint256",
"name": "newRateKink2",
"type": "uint256"
}
],
"name": "LogUpdateRate",
"type": "event"
},
{
"inputs": [],
"name": "BORROW_TOKEN",
"outputs": [
{
"internalType": "address",
"name": "",
"type": "address"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [],
"name": "LIQUIDITY",
"outputs": [
{
"internalType": "contract IFluidLiquidity",
"name": "",
"type": "address"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [],
"name": "MIN_UPDATE_DIFF",
"outputs": [
{
"internalType": "uint256",
"name": "",
"type": "uint256"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [],
"name": "RATE_BUFFER_KINK1",
"outputs": [
{
"internalType": "int256",
"name": "",
"type": "int256"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [],
"name": "RATE_BUFFER_KINK2",
"outputs": [
{
"internalType": "int256",
"name": "",
"type": "int256"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [],
"name": "RESERVE_CONTRACT",
"outputs": [
{
"internalType": "contract IFluidReserveContract",
"name": "",
"type": "address"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [],
"name": "SUPPLY_TOKEN",
"outputs": [
{
"internalType": "address",
"name": "",
"type": "address"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [],
"name": "calcBorrowRates",
"outputs": [
{
"internalType": "uint256",
"name": "rateKink1_",
"type": "uint256"
},
{
"internalType": "uint256",
"name": "rateKink2_",
"type": "uint256"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [],
"name": "configPercentDiff",
"outputs": [
{
"internalType": "uint256",
"name": "configPercentDiff_",
"type": "uint256"
}
],
"stateMutability": "view",
"type": "function"
},
{
"inputs": [],
"name": "rebalance",
"outputs": [],
"stateMutability": "nonpayable",
"type": "function"
},
{
"inputs": [],
"name": "supplyTokenLendingRate",
"outputs": [
{
"internalType": "uint256",
"name": "rate_",
"type": "uint256"
}
],
"stateMutability": "view",
"type": "function"
}
],
"transactionHash": "0x07142e34c2b046d49802e64e6fba5c2e9ff31eeb0e903999c5381442761c929f",
"receipt": {
"to": "0x4e59b44847b379578588920cA78FbF26c0B4956C",
"from": "0x0Ed35B1609Ec45c7079E80d11149a52717e4859A",
"contractAddress": null,
"transactionIndex": 51,
"gasUsed": "1132311",
"logsBloom": "0x00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000",
"blockHash": "0x27d10b496ae7fb2f608b7514312b22bc1f7f859014507081ddf2c301f4eb1fd2",
"transactionHash": "0x07142e34c2b046d49802e64e6fba5c2e9ff31eeb0e903999c5381442761c929f",
"logs": [],
"blockNumber": 19967195,
"cumulativeGasUsed": "20735570",
"status": 1,
"byzantium": true
},
"args": [
"0x264786EF916af64a1DB19F513F24a3681734ce92",
"0x52Aa899454998Be5b000Ad077a46Bbe360F4e497",
"0x7f39C581F595B53c5cb19bD0b3f8dA6c935E2Ca0",
"0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE",
200,
250,
25
],
"numDeployments": 1,
"solcInputHash": "033d84042c3fe6a1afa58a71e8e52d69",
"metadata": "{\"compiler\":{\"version\":\"0.8.21+commit.d9974bed\"},\"language\":\"Solidity\",\"output\":{\"abi\":[{\"inputs\":[{\"internalType\":\"contract IFluidReserveContract\",\"name\":\"reserveContract_\",\"type\":\"address\"},{\"internalType\":\"contract IFluidLiquidity\",\"name\":\"liquidity_\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"supplyToken_\",\"type\":\"address\"},{\"internalType\":\"address\",\"name\":\"borrowToken_\",\"type\":\"address\"},{\"internalType\":\"int256\",\"name\":\"rateBufferKink1_\",\"type\":\"int256\"},{\"internalType\":\"int256\",\"name\":\"rateBufferKink2_\",\"type\":\"int256\"},{\"internalType\":\"uint256\",\"name\":\"minUpdateDiff_\",\"type\":\"uint256\"}],\"stateMutability\":\"nonpayable\",\"type\":\"constructor\"},{\"inputs\":[{\"internalType\":\"uint256\",\"name\":\"errorId_\",\"type\":\"uint256\"}],\"name\":\"FluidConfigError\",\"type\":\"error\"},{\"anonymous\":false,\"inputs\":[{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"supplyRate\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"oldRateKink1\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"newRateKink1\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"oldRateKink2\",\"type\":\"uint256\"},{\"indexed\":false,\"internalType\":\"uint256\",\"name\":\"newRateKink2\",\"type\":\"uint256\"}],\"name\":\"LogUpdateRate\",\"type\":\"event\"},{\"inputs\":[],\"name\":\"BORROW_TOKEN\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"LIQUIDITY\",\"outputs\":[{\"internalType\":\"contract IFluidLiquidity\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"MIN_UPDATE_DIFF\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"RATE_BUFFER_KINK1\",\"outputs\":[{\"internalType\":\"int256\",\"name\":\"\",\"type\":\"int256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"RATE_BUFFER_KINK2\",\"outputs\":[{\"internalType\":\"int256\",\"name\":\"\",\"type\":\"int256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"RESERVE_CONTRACT\",\"outputs\":[{\"internalType\":\"contract IFluidReserveContract\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"SUPPLY_TOKEN\",\"outputs\":[{\"internalType\":\"address\",\"name\":\"\",\"type\":\"address\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"calcBorrowRates\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"rateKink1_\",\"type\":\"uint256\"},{\"internalType\":\"uint256\",\"name\":\"rateKink2_\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"configPercentDiff\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"configPercentDiff_\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"rebalance\",\"outputs\":[],\"stateMutability\":\"nonpayable\",\"type\":\"function\"},{\"inputs\":[],\"name\":\"supplyTokenLendingRate\",\"outputs\":[{\"internalType\":\"uint256\",\"name\":\"rate_\",\"type\":\"uint256\"}],\"stateMutability\":\"view\",\"type\":\"function\"}],\"devdoc\":{\"kind\":\"dev\",\"methods\":{},\"version\":1},\"userdoc\":{\"events\":{\"LogUpdateRate(uint256,uint256,uint256,uint256,uint256)\":{\"notice\":\"emitted when borrow rate for `BORROW_TOKEN` is updated based on supply rate of `SUPPLY_TOKEN` + buffer.\"}},\"kind\":\"user\",\"methods\":{\"BORROW_TOKEN()\":{\"notice\":\"borrow token at Liquidity for which the borrow rate is managed\"},\"RATE_BUFFER_KINK1()\":{\"notice\":\"buffer at kink1 for the rate. borrow rate = supply rate + buffer. In percent (100 = 1%, 1 = 0.01%)\"},\"RATE_BUFFER_KINK2()\":{\"notice\":\"buffer at kink2 for the rate. borrow rate = supply rate + buffer. In percent (100 = 1%, 1 = 0.01%)\"},\"SUPPLY_TOKEN()\":{\"notice\":\"supply token at Liquidity which borrow rate is based on\"},\"calcBorrowRates()\":{\"notice\":\"returns the current calculcated borrow rates at kink1 and kink 2 (for rate data v2).\"},\"configPercentDiff()\":{\"notice\":\"returns how much the new config would be different from current config in percent (100 = 1%, 1 = 0.01%).\"},\"rebalance()\":{\"notice\":\"Rebalances the configs at Fluid Liquidity based on config handler target. Reverts if no update is needed. Can only be called by an authorized rebalancer.\"},\"supplyTokenLendingRate()\":{\"notice\":\"get current `SUPPLY_TOKEN` lending `rate_` at Liquidity\"}},\"notice\":\"Sets borrow rate for `BORROW_TOKEN` at Liquidaty based on supply rate of `SUPPLY_TOKEN` + buffer.\",\"version\":1}},\"settings\":{\"compilationTarget\":{\"contracts/config/bufferRateHandler/main.sol\":\"FluidBufferRateHandler\"},\"evmVersion\":\"paris\",\"libraries\":{},\"metadata\":{\"bytecodeHash\":\"ipfs\",\"useLiteralContent\":true},\"optimizer\":{\"enabled\":true,\"runs\":10000000},\"remappings\":[]},\"sources\":{\"contracts/config/bufferRateHandler/main.sol\":{\"content\":\"// SPDX-License-Identifier: BUSL-1.1\\npragma solidity 0.8.21;\\n\\nimport { IFluidLiquidity } from \\\"../../liquidity/interfaces/iLiquidity.sol\\\";\\nimport { LiquiditySlotsLink } from \\\"../../libraries/liquiditySlotsLink.sol\\\";\\nimport { IFluidReserveContract } from \\\"../../reserve/interfaces/iReserveContract.sol\\\";\\nimport { Error } from \\\"../error.sol\\\";\\nimport { ErrorTypes } from \\\"../errorTypes.sol\\\";\\nimport { FluidConfigHandler } from \\\"../fluidConfigHandler.sol\\\";\\n\\nimport { BigMathMinified } from \\\"../../libraries/bigMathMinified.sol\\\";\\nimport { Structs as AdminModuleStructs } from \\\"../../liquidity/adminModule/structs.sol\\\";\\n\\nabstract contract Constants {\\n IFluidReserveContract public immutable RESERVE_CONTRACT;\\n IFluidLiquidity public immutable LIQUIDITY;\\n\\n /// @notice supply token at Liquidity which borrow rate is based on\\n address public immutable SUPPLY_TOKEN;\\n /// @notice borrow token at Liquidity for which the borrow rate is managed\\n address public immutable BORROW_TOKEN;\\n\\n /// @notice buffer at kink1 for the rate. borrow rate = supply rate + buffer. In percent (100 = 1%, 1 = 0.01%)\\n int256 public immutable RATE_BUFFER_KINK1;\\n /// @notice buffer at kink2 for the rate. borrow rate = supply rate + buffer. In percent (100 = 1%, 1 = 0.01%)\\n /// @dev only used if CURRENT borrow rate mode at Liquidity is V2 (with 2 kinks).\\n int256 public immutable RATE_BUFFER_KINK2;\\n\\n /// @dev minimum percent difference to trigger an update. In percent (100 = 1%, 1 = 0.01%)\\n uint256 public immutable MIN_UPDATE_DIFF;\\n\\n bytes32 internal immutable _LIQUDITY_SUPPLY_TOTAL_AMOUNTS_SLOT;\\n bytes32 internal immutable _LIQUDITY_SUPPLY_EXCHANGE_PRICES_AND_CONFIG_SLOT;\\n\\n bytes32 internal immutable _LIQUDITY_BORROW_RATE_DATA_SLOT;\\n\\n uint256 internal constant EXCHANGE_PRICES_PRECISION = 1e12;\\n\\n uint256 internal constant DEFAULT_EXPONENT_SIZE = 8;\\n uint256 internal constant DEFAULT_EXPONENT_MASK = 0xff;\\n\\n uint256 internal constant X14 = 0x3fff;\\n uint256 internal constant X16 = 0xffff;\\n uint256 internal constant X64 = 0xffffffffffffffff;\\n uint256 internal constant FOUR_DECIMALS = 10000;\\n}\\n\\nabstract contract Events {\\n /// @notice emitted when borrow rate for `BORROW_TOKEN` is updated based on\\n /// supply rate of `SUPPLY_TOKEN` + buffer.\\n event LogUpdateRate(\\n uint256 supplyRate,\\n uint256 oldRateKink1,\\n uint256 newRateKink1,\\n uint256 oldRateKink2,\\n uint256 newRateKink2\\n );\\n}\\n\\n/// @notice Sets borrow rate for `BORROW_TOKEN` at Liquidaty based on supply rate of `SUPPLY_TOKEN` + buffer.\\ncontract FluidBufferRateHandler is Constants, Error, Events, FluidConfigHandler {\\n /// @dev Validates that an address is not the zero address\\n modifier validAddress(address value_) {\\n if (value_ == address(0)) {\\n revert FluidConfigError(ErrorTypes.BufferRateConfigHandler__AddressZero);\\n }\\n _;\\n }\\n\\n /// @dev Validates that an address is a rebalancer (taken from reserve contract)\\n modifier onlyRebalancer() {\\n if (!RESERVE_CONTRACT.isRebalancer(msg.sender)) {\\n revert FluidConfigError(ErrorTypes.BufferRateConfigHandler__Unauthorized);\\n }\\n _;\\n }\\n\\n constructor(\\n IFluidReserveContract reserveContract_,\\n IFluidLiquidity liquidity_,\\n address supplyToken_,\\n address borrowToken_,\\n int256 rateBufferKink1_,\\n int256 rateBufferKink2_,\\n uint256 minUpdateDiff_\\n )\\n validAddress(address(reserveContract_))\\n validAddress(address(liquidity_))\\n validAddress(supplyToken_)\\n validAddress(borrowToken_)\\n {\\n if (\\n minUpdateDiff_ == 0 ||\\n // rate buffer should be within +100% to - 100%\\n rateBufferKink1_ > 1e4 ||\\n rateBufferKink1_ < -int256(1e4) ||\\n rateBufferKink2_ > 1e4 ||\\n rateBufferKink2_ < -int256(1e4)\\n ) {\\n revert FluidConfigError(ErrorTypes.BufferRateConfigHandler__InvalidParams);\\n }\\n\\n RESERVE_CONTRACT = reserveContract_;\\n LIQUIDITY = liquidity_;\\n SUPPLY_TOKEN = supplyToken_;\\n BORROW_TOKEN = borrowToken_;\\n MIN_UPDATE_DIFF = minUpdateDiff_;\\n\\n RATE_BUFFER_KINK1 = rateBufferKink1_;\\n RATE_BUFFER_KINK2 = rateBufferKink2_;\\n\\n _LIQUDITY_SUPPLY_TOTAL_AMOUNTS_SLOT = LiquiditySlotsLink.calculateMappingStorageSlot(\\n LiquiditySlotsLink.LIQUIDITY_TOTAL_AMOUNTS_MAPPING_SLOT,\\n supplyToken_\\n );\\n _LIQUDITY_SUPPLY_EXCHANGE_PRICES_AND_CONFIG_SLOT = LiquiditySlotsLink.calculateMappingStorageSlot(\\n LiquiditySlotsLink.LIQUIDITY_EXCHANGE_PRICES_MAPPING_SLOT,\\n supplyToken_\\n );\\n\\n _LIQUDITY_BORROW_RATE_DATA_SLOT = LiquiditySlotsLink.calculateMappingStorageSlot(\\n LiquiditySlotsLink.LIQUIDITY_RATE_DATA_MAPPING_SLOT,\\n borrowToken_\\n );\\n }\\n\\n /// @inheritdoc FluidConfigHandler\\n function configPercentDiff() public view override returns (uint256 configPercentDiff_) {\\n uint256 rateConfig_ = LIQUIDITY.readFromStorage(_LIQUDITY_BORROW_RATE_DATA_SLOT);\\n\\n (uint256 newRateKink1_, uint256 newRateKink2_) = _calcBorrowRates(supplyTokenLendingRate(), rateConfig_);\\n\\n uint256 rateVersion_ = rateConfig_ & 0xF;\\n if (rateVersion_ == 1) {\\n uint256 oldRateKink1_ = (rateConfig_ >> LiquiditySlotsLink.BITS_RATE_DATA_V1_RATE_AT_UTILIZATION_KINK) &\\n X16;\\n configPercentDiff_ = _percentDiffForValue(oldRateKink1_, newRateKink1_);\\n } else if (rateVersion_ == 2) {\\n uint256 oldRateKink1_ = (rateConfig_ >> LiquiditySlotsLink.BITS_RATE_DATA_V2_RATE_AT_UTILIZATION_KINK1) &\\n X16;\\n uint256 oldRateKink2_ = (rateConfig_ >> LiquiditySlotsLink.BITS_RATE_DATA_V2_RATE_AT_UTILIZATION_KINK2) &\\n X16;\\n\\n configPercentDiff_ = _percentDiffForValue(oldRateKink1_, newRateKink1_);\\n uint256 rateKink2Diff_ = _percentDiffForValue(oldRateKink2_, newRateKink2_);\\n // final diff = biggest diff between all config values\\n configPercentDiff_ = configPercentDiff_ > rateKink2Diff_ ? configPercentDiff_ : rateKink2Diff_;\\n } else {\\n revert FluidConfigError(ErrorTypes.BufferRateConfigHandler__RateVersionUnsupported);\\n }\\n }\\n\\n /// @inheritdoc FluidConfigHandler\\n function rebalance() external override onlyRebalancer {\\n uint256 supplyLendingRate_ = supplyTokenLendingRate();\\n uint256 rateConfig_ = LIQUIDITY.readFromStorage(_LIQUDITY_BORROW_RATE_DATA_SLOT);\\n\\n uint256 rateVersion_ = rateConfig_ & 0xF;\\n if (rateVersion_ == 1) {\\n _rebalanceRateV1(supplyLendingRate_, rateConfig_);\\n } else if (rateVersion_ == 2) {\\n _rebalanceRateV2(supplyLendingRate_, rateConfig_);\\n } else {\\n revert FluidConfigError(ErrorTypes.BufferRateConfigHandler__RateVersionUnsupported);\\n }\\n }\\n\\n /// @notice returns the current calculcated borrow rates at kink1 and kink 2 (for rate data v2).\\n function calcBorrowRates() public view returns (uint256 rateKink1_, uint256 rateKink2_) {\\n return _calcBorrowRates(supplyTokenLendingRate(), LIQUIDITY.readFromStorage(_LIQUDITY_BORROW_RATE_DATA_SLOT));\\n }\\n\\n /// @notice get current `SUPPLY_TOKEN` lending `rate_` at Liquidity\\n function supplyTokenLendingRate() public view returns (uint256 rate_) {\\n // @dev logic here based on Liquidity Resolver .getOverallTokenData()\\n uint256 totalAmounts_ = LIQUIDITY.readFromStorage(_LIQUDITY_SUPPLY_TOTAL_AMOUNTS_SLOT);\\n\\n // Extract supply & borrow amounts\\n uint256 supplyRawInterest_ = totalAmounts_ & X64;\\n supplyRawInterest_ =\\n (supplyRawInterest_ >> DEFAULT_EXPONENT_SIZE) <<\\n (supplyRawInterest_ & DEFAULT_EXPONENT_MASK);\\n\\n uint256 borrowRawInterest_ = (totalAmounts_ >> LiquiditySlotsLink.BITS_TOTAL_AMOUNTS_BORROW_WITH_INTEREST) &\\n X64;\\n borrowRawInterest_ =\\n (borrowRawInterest_ >> DEFAULT_EXPONENT_SIZE) <<\\n (borrowRawInterest_ & DEFAULT_EXPONENT_MASK);\\n\\n if (supplyRawInterest_ > 0) {\\n uint256 exchangePriceAndConfig_ = LIQUIDITY.readFromStorage(\\n _LIQUDITY_SUPPLY_EXCHANGE_PRICES_AND_CONFIG_SLOT\\n );\\n\\n // use old exchange prices for supply rate to be at same level as borrow rate from storage.\\n // Note the rate here can be a tiny bit with higher precision because we use borrowWithInterest_ / supplyWithInterest_\\n // which has higher precision than the utilization used from storage in LiquidityCalcs\\n uint256 supplyWithInterest_ = (supplyRawInterest_ *\\n ((exchangePriceAndConfig_ >> LiquiditySlotsLink.BITS_EXCHANGE_PRICES_SUPPLY_EXCHANGE_PRICE) & X64)) /\\n EXCHANGE_PRICES_PRECISION; // normalized from raw\\n uint256 borrowWithInterest_ = (borrowRawInterest_ *\\n ((exchangePriceAndConfig_ >> LiquiditySlotsLink.BITS_EXCHANGE_PRICES_BORROW_EXCHANGE_PRICE) & X64)) /\\n EXCHANGE_PRICES_PRECISION; // normalized from raw\\n\\n uint256 borrowRate_ = exchangePriceAndConfig_ & X16;\\n uint256 fee_ = (exchangePriceAndConfig_ >> LiquiditySlotsLink.BITS_EXCHANGE_PRICES_FEE) & X14;\\n\\n rate_ =\\n (borrowRate_ * (FOUR_DECIMALS - fee_) * borrowWithInterest_) /\\n (supplyWithInterest_ * FOUR_DECIMALS);\\n }\\n }\\n\\n /// @dev calculates current borrow rates at kinks for supply rate and current rate data\\n function _calcBorrowRates(\\n uint256 supplyRate_,\\n uint256 rateConfig_\\n ) internal view returns (uint256 rateKink1_, uint256 rateKink2_) {\\n // rate can never be <0, > X16.\\n rateKink1_ = (int256(supplyRate_) + RATE_BUFFER_KINK1) > 0\\n ? uint256((int256(supplyRate_) + RATE_BUFFER_KINK1))\\n : 0;\\n // rate can never be > X16\\n rateKink1_ = rateKink1_ > X16 ? X16 : rateKink1_;\\n if ((rateConfig_ & 0xF) == 1) {\\n // v1: only 1 kink\\n // rate at last kink must always be <= rate at 100% utilization\\n uint256 rateAtUtilizationMax_ = (rateConfig_ >>\\n LiquiditySlotsLink.BITS_RATE_DATA_V1_RATE_AT_UTILIZATION_MAX) & X16;\\n if (rateKink1_ > rateAtUtilizationMax_) {\\n rateKink1_ = rateAtUtilizationMax_;\\n }\\n } else {\\n // v2: 2 kinks\\n // rate can never be <0, > X16.\\n rateKink2_ = (int256(supplyRate_) + RATE_BUFFER_KINK2) > 0\\n ? uint256(int256(supplyRate_) + RATE_BUFFER_KINK2)\\n : 0;\\n // rate can never be > X16\\n rateKink2_ = rateKink2_ > X16 ? X16 : rateKink2_;\\n // rate at kink must always be <= rate at 100% utilization\\n uint256 rateAtUtilizationMax_ = (rateConfig_ >>\\n LiquiditySlotsLink.BITS_RATE_DATA_V2_RATE_AT_UTILIZATION_MAX) & X16;\\n if (rateKink1_ > rateAtUtilizationMax_) {\\n rateKink1_ = rateAtUtilizationMax_;\\n }\\n if (rateKink2_ > rateAtUtilizationMax_) {\\n rateKink2_ = rateAtUtilizationMax_;\\n }\\n }\\n }\\n\\n /// @dev gets the percentage difference between `oldValue_` and `newValue_` in relation to `oldValue_`\\n function _percentDiffForValue(\\n uint256 oldValue_,\\n uint256 newValue_\\n ) internal pure returns (uint256 configPercentDiff_) {\\n if (oldValue_ == newValue_) {\\n return 0;\\n }\\n\\n if (oldValue_ > newValue_) {\\n // % of how much new value would be smaller\\n configPercentDiff_ = oldValue_ - newValue_;\\n // e.g. 10 - 8 = 2. 2 * 10000 / 10 -> 2000 (20%)\\n } else {\\n // % of how much new value would be bigger\\n configPercentDiff_ = newValue_ - oldValue_;\\n // e.g. 10 - 8 = 2. 2 * 10000 / 8 -> 2500 (25%)\\n }\\n\\n configPercentDiff_ = (configPercentDiff_ * 1e4) / oldValue_;\\n }\\n\\n /// @dev rebalances for a RateV1 config\\n function _rebalanceRateV1(uint256 supplyRate_, uint256 rateConfig_) internal {\\n AdminModuleStructs.RateDataV1Params memory rateData_;\\n\\n uint256 oldRateKink1_ = (rateConfig_ >> LiquiditySlotsLink.BITS_RATE_DATA_V1_RATE_AT_UTILIZATION_KINK) & X16;\\n (rateData_.rateAtUtilizationKink, ) = _calcBorrowRates(supplyRate_, rateConfig_);\\n\\n // check if diff is enough to trigger update\\n if (_percentDiffForValue(oldRateKink1_, rateData_.rateAtUtilizationKink) < MIN_UPDATE_DIFF) {\\n revert FluidConfigError(ErrorTypes.BufferRateConfigHandler__NoUpdate);\\n }\\n\\n rateData_.token = BORROW_TOKEN;\\n // values that stay the same: kink, rate at 0%, rate at 100%\\n rateData_.rateAtUtilizationZero =\\n (rateConfig_ >> LiquiditySlotsLink.BITS_RATE_DATA_V1_RATE_AT_UTILIZATION_ZERO) &\\n X16;\\n rateData_.kink = (rateConfig_ >> LiquiditySlotsLink.BITS_RATE_DATA_V1_UTILIZATION_AT_KINK) & X16;\\n rateData_.rateAtUtilizationMax =\\n (rateConfig_ >> LiquiditySlotsLink.BITS_RATE_DATA_V1_RATE_AT_UTILIZATION_MAX) &\\n X16;\\n\\n // trigger update\\n AdminModuleStructs.RateDataV1Params[] memory params_ = new AdminModuleStructs.RateDataV1Params[](1);\\n params_[0] = rateData_;\\n LIQUIDITY.updateRateDataV1s(params_);\\n\\n // emit event\\n emit LogUpdateRate(supplyRate_, oldRateKink1_, rateData_.rateAtUtilizationKink, 0, 0);\\n }\\n\\n /// @dev rebalances for a RateV2 config\\n function _rebalanceRateV2(uint256 supplyRate_, uint256 rateConfig_) internal {\\n AdminModuleStructs.RateDataV2Params memory rateData_;\\n\\n uint256 oldRateKink1_ = (rateConfig_ >> LiquiditySlotsLink.BITS_RATE_DATA_V2_RATE_AT_UTILIZATION_KINK1) & X16;\\n uint256 oldRateKink2_ = (rateConfig_ >> LiquiditySlotsLink.BITS_RATE_DATA_V2_RATE_AT_UTILIZATION_KINK2) & X16;\\n (rateData_.rateAtUtilizationKink1, rateData_.rateAtUtilizationKink2) = _calcBorrowRates(\\n supplyRate_,\\n rateConfig_\\n );\\n\\n // check if diff is enough to trigger update\\n if (\\n _percentDiffForValue(oldRateKink1_, rateData_.rateAtUtilizationKink1) < MIN_UPDATE_DIFF &&\\n _percentDiffForValue(oldRateKink2_, rateData_.rateAtUtilizationKink2) < MIN_UPDATE_DIFF\\n ) {\\n revert FluidConfigError(ErrorTypes.BufferRateConfigHandler__NoUpdate);\\n }\\n\\n rateData_.token = BORROW_TOKEN;\\n // values that stay the same: kink1, kink2, rate at 0%, rate at 100%\\n rateData_.rateAtUtilizationZero =\\n (rateConfig_ >> LiquiditySlotsLink.BITS_RATE_DATA_V2_RATE_AT_UTILIZATION_ZERO) &\\n X16;\\n rateData_.kink1 = (rateConfig_ >> LiquiditySlotsLink.BITS_RATE_DATA_V2_UTILIZATION_AT_KINK1) & X16;\\n rateData_.kink2 = (rateConfig_ >> LiquiditySlotsLink.BITS_RATE_DATA_V2_UTILIZATION_AT_KINK2) & X16;\\n rateData_.rateAtUtilizationMax =\\n (rateConfig_ >> LiquiditySlotsLink.BITS_RATE_DATA_V2_RATE_AT_UTILIZATION_MAX) &\\n X16;\\n\\n // trigger update\\n AdminModuleStructs.RateDataV2Params[] memory params_ = new AdminModuleStructs.RateDataV2Params[](1);\\n params_[0] = rateData_;\\n LIQUIDITY.updateRateDataV2s(params_);\\n\\n // emit event\\n emit LogUpdateRate(\\n supplyRate_,\\n oldRateKink1_,\\n rateData_.rateAtUtilizationKink1,\\n oldRateKink2_,\\n rateData_.rateAtUtilizationKink2\\n );\\n }\\n}\\n\",\"keccak256\":\"0xefa0161c120eb18ad65caa381fc205e2c6524a7e9a58144e912ff2f8f449865b\",\"license\":\"BUSL-1.1\"},\"contracts/config/error.sol\":{\"content\":\"// SPDX-License-Identifier: BUSL-1.1\\npragma solidity 0.8.21;\\n\\ncontract Error {\\n error FluidConfigError(uint256 errorId_);\\n}\\n\",\"keccak256\":\"0x7fac063d4cfeb626e3a2720595a2db1d7352353ed6c7df61e95a6c164450c9e6\",\"license\":\"BUSL-1.1\"},\"contracts/config/errorTypes.sol\":{\"content\":\"// SPDX-License-Identifier: BUSL-1.1\\npragma solidity 0.8.21;\\n\\nlibrary ErrorTypes {\\n /***********************************|\\n | ExpandPercentConfigHandler | \\n |__________________________________*/\\n\\n /// @notice thrown when an input address is zero\\n uint256 internal constant ExpandPercentConfigHandler__AddressZero = 100001;\\n\\n /// @notice thrown when an unauthorized `msg.sender` calls a protected method\\n uint256 internal constant ExpandPercentConfigHandler__Unauthorized = 100002;\\n\\n /// @notice thrown when invalid params are passed into a method\\n uint256 internal constant ExpandPercentConfigHandler__InvalidParams = 100003;\\n\\n /// @notice thrown when no update is currently needed\\n uint256 internal constant ExpandPercentConfigHandler__NoUpdate = 100004;\\n\\n /// @notice thrown when slot is not used, e.g. when borrow token is 0 there is no borrow data\\n uint256 internal constant ExpandPercentConfigHandler__SlotDoesNotExist = 100005;\\n\\n /***********************************|\\n | EthenaRateConfigHandler | \\n |__________________________________*/\\n\\n /// @notice thrown when an input address is zero\\n uint256 internal constant EthenaRateConfigHandler__AddressZero = 100011;\\n\\n /// @notice thrown when an unauthorized `msg.sender` calls a protected method\\n uint256 internal constant EthenaRateConfigHandler__Unauthorized = 100012;\\n\\n /// @notice thrown when invalid params are passed into a method\\n uint256 internal constant EthenaRateConfigHandler__InvalidParams = 100013;\\n\\n /// @notice thrown when no update is currently needed\\n uint256 internal constant EthenaRateConfigHandler__NoUpdate = 100014;\\n\\n /***********************************|\\n | MaxBorrowConfigHandler | \\n |__________________________________*/\\n\\n /// @notice thrown when an input address is zero\\n uint256 internal constant MaxBorrowConfigHandler__AddressZero = 100021;\\n\\n /// @notice thrown when an unauthorized `msg.sender` calls a protected method\\n uint256 internal constant MaxBorrowConfigHandler__Unauthorized = 100022;\\n\\n /// @notice thrown when invalid params are passed into a method\\n uint256 internal constant MaxBorrowConfigHandler__InvalidParams = 100023;\\n\\n /// @notice thrown when no update is currently needed\\n uint256 internal constant MaxBorrowConfigHandler__NoUpdate = 100024;\\n\\n /***********************************|\\n | BufferRateConfigHandler | \\n |__________________________________*/\\n\\n /// @notice thrown when an input address is zero\\n uint256 internal constant BufferRateConfigHandler__AddressZero = 100031;\\n\\n /// @notice thrown when an unauthorized `msg.sender` calls a protected method\\n uint256 internal constant BufferRateConfigHandler__Unauthorized = 100032;\\n\\n /// @notice thrown when invalid params are passed into a method\\n uint256 internal constant BufferRateConfigHandler__InvalidParams = 100033;\\n\\n /// @notice thrown when no update is currently needed\\n uint256 internal constant BufferRateConfigHandler__NoUpdate = 100034;\\n\\n /// @notice thrown when rate data version is not supported\\n uint256 internal constant BufferRateConfigHandler__RateVersionUnsupported = 100035;\\n}\\n\",\"keccak256\":\"0xc2f9f4be3c32f5d69f41655abb926627e45c3248c6b622e8e03c79b6faec72f8\",\"license\":\"BUSL-1.1\"},\"contracts/config/fluidConfigHandler.sol\":{\"content\":\"// SPDX-License-Identifier: BUSL-1.1\\npragma solidity 0.8.21;\\n\\nimport { IFluidConfigHandler } from \\\"./interfaces/iFluidConfigHandler.sol\\\";\\n\\n/// @title FluidConfigHandler\\n/// @notice Base contract that any Fluid Config Handler must implement\\nabstract contract FluidConfigHandler is IFluidConfigHandler {\\n /// @inheritdoc IFluidConfigHandler\\n function configPercentDiff() public view virtual returns (uint256 configPercentDiff_);\\n\\n /// @inheritdoc IFluidConfigHandler\\n function rebalance() external virtual;\\n}\\n\",\"keccak256\":\"0xb7fc0b60fe73d8952d31859ee6d77f9a9b959707a6e9752364bb6b8d4353f441\",\"license\":\"BUSL-1.1\"},\"contracts/config/interfaces/iFluidConfigHandler.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity 0.8.21;\\n\\ninterface IFluidConfigHandler {\\n /// @notice returns how much the new config would be different from current config in percent (100 = 1%, 1 = 0.01%).\\n function configPercentDiff() external view returns (uint256 configPercentDiff_);\\n\\n /// @notice Rebalances the configs at Fluid Liquidity based on config handler target.\\n /// Reverts if no update is needed.\\n /// Can only be called by an authorized rebalancer.\\n function rebalance() external;\\n}\\n\",\"keccak256\":\"0x92c16de6fc55a95e4b07138af26677a0714b25680c83950521acc0efaea1d922\",\"license\":\"MIT\"},\"contracts/infiniteProxy/interfaces/iProxy.sol\":{\"content\":\"// SPDX-License-Identifier: MIT\\npragma solidity 0.8.21;\\n\\ninterface IProxy {\\n function setAdmin(address newAdmin_) external;\\n\\n function setDummyImplementation(address newDummyImplementation_) external;\\n\\n function addImplementation(address implementation_, bytes4[] calldata sigs_) external;\\n\\n function removeImplementation(address implementation_) external;\\n\\n function getAdmin() external view returns (address);\\n\\n function getDummyImplementation() external view returns (address);\\n\\n function getImplementationSigs(address impl_) external view returns (bytes4[] memory);\\n\\n function getSigsImplementation(bytes4 sig_) external view returns (address);\\n\\n function readFromStorage(bytes32 slot_) external view returns (uint256 result_);\\n}\\n\",\"keccak256\":\"0xbb605491d4bac08e816248feecae7dd17cfc1877c88b2e555abece2970f5ea00\",\"license\":\"MIT\"},\"contracts/libraries/bigMathMinified.sol\":{\"content\":\"// SPDX-License-Identifier: BUSL-1.1\\npragma solidity 0.8.21;\\n\\n/// @title library that represents a number in BigNumber(coefficient and exponent) format to store in smaller bits.\\n/// @notice the number is divided into two parts: a coefficient and an exponent. This comes at a cost of losing some precision\\n/// at the end of the number because the exponent simply fills it with zeroes. This precision is oftentimes negligible and can\\n/// result in significant gas cost reduction due to storage space reduction.\\n/// Also note, a valid big number is as follows: if the exponent is > 0, then coefficient last bits should be occupied to have max precision.\\n/// @dev roundUp is more like a increase 1, which happens everytime for the same number.\\n/// roundDown simply sets trailing digits after coefficientSize to zero (floor), only once for the same number.\\nlibrary BigMathMinified {\\n /// @dev constants to use for `roundUp` input param to increase readability\\n bool internal constant ROUND_DOWN = false;\\n bool internal constant ROUND_UP = true;\\n\\n /// @dev converts `normal` number to BigNumber with `exponent` and `coefficient` (or precision).\\n /// e.g.:\\n /// 5035703444687813576399599 (normal) = (coefficient[32bits], exponent[8bits])[40bits]\\n /// 5035703444687813576399599 (decimal) => 10000101010010110100000011111011110010100110100000000011100101001101001101011101111 (binary)\\n /// => 10000101010010110100000011111011000000000000000000000000000000000000000000000000000\\n /// ^-------------------- 51(exponent) -------------- ^\\n /// coefficient = 1000,0101,0100,1011,0100,0000,1111,1011 (2236301563)\\n /// exponent = 0011,0011 (51)\\n /// bigNumber = 1000,0101,0100,1011,0100,0000,1111,1011,0011,0011 (572493200179)\\n ///\\n /// @param normal number which needs to be converted into Big Number\\n /// @param coefficientSize at max how many bits of precision there should be (64 = uint64 (64 bits precision))\\n /// @param exponentSize at max how many bits of exponent there should be (8 = uint8 (8 bits exponent))\\n /// @param roundUp signals if result should be rounded down or up\\n /// @return bigNumber converted bigNumber (coefficient << exponent)\\n function toBigNumber(\\n uint256 normal,\\n uint256 coefficientSize,\\n uint256 exponentSize,\\n bool roundUp\\n ) internal pure returns (uint256 bigNumber) {\\n assembly {\\n let lastBit_\\n let number_ := normal\\n if gt(number_, 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF) {\\n number_ := shr(0x80, number_)\\n lastBit_ := 0x80\\n }\\n if gt(number_, 0xFFFFFFFFFFFFFFFF) {\\n number_ := shr(0x40, number_)\\n lastBit_ := add(lastBit_, 0x40)\\n }\\n if gt(number_, 0xFFFFFFFF) {\\n number_ := shr(0x20, number_)\\n lastBit_ := add(lastBit_, 0x20)\\n }\\n if gt(number_, 0xFFFF) {\\n number_ := shr(0x10, number_)\\n lastBit_ := add(lastBit_, 0x10)\\n }\\n if gt(number_, 0xFF) {\\n number_ := shr(0x8, number_)\\n lastBit_ := add(lastBit_, 0x8)\\n }\\n if gt(number_, 0xF) {\\n number_ := shr(0x4, number_)\\n lastBit_ := add(lastBit_, 0x4)\\n }\\n if gt(number_, 0x3) {\\n number_ := shr(0x2, number_)\\n lastBit_ := add(lastBit_, 0x2)\\n }\\n if gt(number_, 0x1) {\\n lastBit_ := add(lastBit_, 1)\\n }\\n if gt(number_, 0) {\\n lastBit_ := add(lastBit_, 1)\\n }\\n if lt(lastBit_, coefficientSize) {\\n // for throw exception\\n lastBit_ := coefficientSize\\n }\\n let exponent := sub(lastBit_, coefficientSize)\\n let coefficient := shr(exponent, normal)\\n if and(roundUp, gt(exponent, 0)) {\\n // rounding up is only needed if exponent is > 0, as otherwise the coefficient fully holds the original number\\n coefficient := add(coefficient, 1)\\n if eq(shl(coefficientSize, 1), coefficient) {\\n // case were coefficient was e.g. 111, with adding 1 it became 1000 (in binary) and coefficientSize 3 bits\\n // final coefficient would exceed it's size. -> reduce coefficent to 100 and increase exponent by 1.\\n coefficient := shl(sub(coefficientSize, 1), 1)\\n exponent := add(exponent, 1)\\n }\\n }\\n if iszero(lt(exponent, shl(exponentSize, 1))) {\\n // if exponent is >= exponentSize, the normal number is too big to fit within\\n // BigNumber with too small sizes for coefficient and exponent\\n revert(0, 0)\\n }\\n bigNumber := shl(exponentSize, coefficient)\\n bigNumber := add(bigNumber, exponent)\\n }\\n }\\n\\n /// @dev get `normal` number from `bigNumber`, `exponentSize` and `exponentMask`\\n function fromBigNumber(\\n uint256 bigNumber,\\n uint256 exponentSize,\\n uint256 exponentMask\\n ) internal pure returns (uint256 normal) {\\n assembly {\\n let coefficient := shr(exponentSize, bigNumber)\\n let exponent := and(bigNumber, exponentMask)\\n normal := shl(exponent, coefficient)\\n }\\n }\\n\\n /// @dev gets the most significant bit `lastBit` of a `normal` number (length of given number of binary format).\\n /// e.g.\\n /// 5035703444687813576399599 = 10000101010010110100000011111011110010100110100000000011100101001101001101011101111\\n /// lastBit = ^--------------------------------- 83 ----------------------------------------^\\n function mostSignificantBit(uint256 normal) internal pure returns (uint lastBit) {\\n assembly {\\n let number_ := normal\\n if gt(normal, 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF) {\\n number_ := shr(0x80, number_)\\n lastBit := 0x80\\n }\\n if gt(number_, 0xFFFFFFFFFFFFFFFF) {\\n number_ := shr(0x40, number_)\\n lastBit := add(lastBit, 0x40)\\n }\\n if gt(number_, 0xFFFFFFFF) {\\n number_ := shr(0x20, number_)\\n lastBit := add(lastBit, 0x20)\\n }\\n if gt(number_, 0xFFFF) {\\n number_ := shr(0x10, number_)\\n lastBit := add(lastBit, 0x10)\\n }\\n if gt(number_, 0xFF) {\\n number_ := shr(0x8, number_)\\n lastBit := add(lastBit, 0x8)\\n }\\n if gt(number_, 0xF) {\\n number_ := shr(0x4, number_)\\n lastBit := add(lastBit, 0x4)\\n }\\n if gt(number_, 0x3) {\\n number_ := shr(0x2, number_)\\n lastBit := add(lastBit, 0x2)\\n }\\n if gt(number_, 0x1) {\\n lastBit := add(lastBit, 1)\\n }\\n if gt(number_, 0) {\\n lastBit := add(lastBit, 1)\\n }\\n }\\n }\\n}\\n\",\"keccak256\":\"0xf0be1002909edf30aec3dc6623c2bd2407ed94064b62674c01032b844dec206a\",\"license\":\"BUSL-1.1\"},\"contracts/libraries/liquiditySlotsLink.sol\":{\"content\":\"// SPDX-License-Identifier: BUSL-1.1\\npragma solidity 0.8.21;\\n\\n/// @notice library that helps in reading / working with storage slot data of Fluid Liquidity.\\n/// @dev as all data for Fluid Liquidity is internal, any data must be fetched directly through manual\\n/// slot reading through this library or, if gas usage is less important, through the FluidLiquidityResolver.\\nlibrary LiquiditySlotsLink {\\n /// @dev storage slot for status at Liquidity\\n uint256 internal constant LIQUIDITY_STATUS_SLOT = 1;\\n /// @dev storage slot for auths mapping at Liquidity\\n uint256 internal constant LIQUIDITY_AUTHS_MAPPING_SLOT = 2;\\n /// @dev storage slot for guardians mapping at Liquidity\\n uint256 internal constant LIQUIDITY_GUARDIANS_MAPPING_SLOT = 3;\\n /// @dev storage slot for user class mapping at Liquidity\\n uint256 internal constant LIQUIDITY_USER_CLASS_MAPPING_SLOT = 4;\\n /// @dev storage slot for exchangePricesAndConfig mapping at Liquidity\\n uint256 internal constant LIQUIDITY_EXCHANGE_PRICES_MAPPING_SLOT = 5;\\n /// @dev storage slot for rateData mapping at Liquidity\\n uint256 internal constant LIQUIDITY_RATE_DATA_MAPPING_SLOT = 6;\\n /// @dev storage slot for totalAmounts mapping at Liquidity\\n uint256 internal constant LIQUIDITY_TOTAL_AMOUNTS_MAPPING_SLOT = 7;\\n /// @dev storage slot for user supply double mapping at Liquidity\\n uint256 internal constant LIQUIDITY_USER_SUPPLY_DOUBLE_MAPPING_SLOT = 8;\\n /// @dev storage slot for user borrow double mapping at Liquidity\\n uint256 internal constant LIQUIDITY_USER_BORROW_DOUBLE_MAPPING_SLOT = 9;\\n /// @dev storage slot for listed tokens array at Liquidity\\n uint256 internal constant LIQUIDITY_LISTED_TOKENS_ARRAY_SLOT = 10;\\n /// @dev storage slot for listed tokens array at Liquidity\\n uint256 internal constant LIQUIDITY_CONFIGS2_MAPPING_SLOT = 11;\\n\\n // --------------------------------\\n // @dev stacked uint256 storage slots bits position data for each:\\n\\n // ExchangePricesAndConfig\\n uint256 internal constant BITS_EXCHANGE_PRICES_BORROW_RATE = 0;\\n uint256 internal constant BITS_EXCHANGE_PRICES_FEE = 16;\\n uint256 internal constant BITS_EXCHANGE_PRICES_UTILIZATION = 30;\\n uint256 internal constant BITS_EXCHANGE_PRICES_UPDATE_THRESHOLD = 44;\\n uint256 internal constant BITS_EXCHANGE_PRICES_LAST_TIMESTAMP = 58;\\n uint256 internal constant BITS_EXCHANGE_PRICES_SUPPLY_EXCHANGE_PRICE = 91;\\n uint256 internal constant BITS_EXCHANGE_PRICES_BORROW_EXCHANGE_PRICE = 155;\\n uint256 internal constant BITS_EXCHANGE_PRICES_SUPPLY_RATIO = 219;\\n uint256 internal constant BITS_EXCHANGE_PRICES_BORROW_RATIO = 234;\\n uint256 internal constant BITS_EXCHANGE_PRICES_USES_CONFIGS2 = 249;\\n\\n // RateData:\\n uint256 internal constant BITS_RATE_DATA_VERSION = 0;\\n // RateData: V1\\n uint256 internal constant BITS_RATE_DATA_V1_RATE_AT_UTILIZATION_ZERO = 4;\\n uint256 internal constant BITS_RATE_DATA_V1_UTILIZATION_AT_KINK = 20;\\n uint256 internal constant BITS_RATE_DATA_V1_RATE_AT_UTILIZATION_KINK = 36;\\n uint256 internal constant BITS_RATE_DATA_V1_RATE_AT_UTILIZATION_MAX = 52;\\n // RateData: V2\\n uint256 internal constant BITS_RATE_DATA_V2_RATE_AT_UTILIZATION_ZERO = 4;\\n uint256 internal constant BITS_RATE_DATA_V2_UTILIZATION_AT_KINK1 = 20;\\n uint256 internal constant BITS_RATE_DATA_V2_RATE_AT_UTILIZATION_KINK1 = 36;\\n uint256 internal constant BITS_RATE_DATA_V2_UTILIZATION_AT_KINK2 = 52;\\n uint256 internal constant BITS_RATE_DATA_V2_RATE_AT_UTILIZATION_KINK2 = 68;\\n uint256 internal constant BITS_RATE_DATA_V2_RATE_AT_UTILIZATION_MAX = 84;\\n\\n // TotalAmounts\\n uint256 internal constant BITS_TOTAL_AMOUNTS_SUPPLY_WITH_INTEREST = 0;\\n uint256 internal constant BITS_TOTAL_AMOUNTS_SUPPLY_INTEREST_FREE = 64;\\n uint256 internal constant BITS_TOTAL_AMOUNTS_BORROW_WITH_INTEREST = 128;\\n uint256 internal constant BITS_TOTAL_AMOUNTS_BORROW_INTEREST_FREE = 192;\\n\\n // UserSupplyData\\n uint256 internal constant BITS_USER_SUPPLY_MODE = 0;\\n uint256 internal constant BITS_USER_SUPPLY_AMOUNT = 1;\\n uint256 internal constant BITS_USER_SUPPLY_PREVIOUS_WITHDRAWAL_LIMIT = 65;\\n uint256 internal constant BITS_USER_SUPPLY_LAST_UPDATE_TIMESTAMP = 129;\\n uint256 internal constant BITS_USER_SUPPLY_EXPAND_PERCENT = 162;\\n uint256 internal constant BITS_USER_SUPPLY_EXPAND_DURATION = 176;\\n uint256 internal constant BITS_USER_SUPPLY_BASE_WITHDRAWAL_LIMIT = 200;\\n uint256 internal constant BITS_USER_SUPPLY_IS_PAUSED = 255;\\n\\n // UserBorrowData\\n uint256 internal constant BITS_USER_BORROW_MODE = 0;\\n uint256 internal constant BITS_USER_BORROW_AMOUNT = 1;\\n uint256 internal constant BITS_USER_BORROW_PREVIOUS_BORROW_LIMIT = 65;\\n uint256 internal constant BITS_USER_BORROW_LAST_UPDATE_TIMESTAMP = 129;\\n uint256 internal constant BITS_USER_BORROW_EXPAND_PERCENT = 162;\\n uint256 internal constant BITS_USER_BORROW_EXPAND_DURATION = 176;\\n uint256 internal constant BITS_USER_BORROW_BASE_BORROW_LIMIT = 200;\\n uint256 internal constant BITS_USER_BORROW_MAX_BORROW_LIMIT = 218;\\n uint256 internal constant BITS_USER_BORROW_IS_PAUSED = 255;\\n\\n // Configs2\\n uint256 internal constant BITS_CONFIGS2_MAX_UTILIZATION = 0;\\n\\n // --------------------------------\\n\\n /// @notice Calculating the slot ID for Liquidity contract for single mapping at `slot_` for `key_`\\n function calculateMappingStorageSlot(uint256 slot_, address key_) internal pure returns (bytes32) {\\n return keccak256(abi.encode(key_, slot_));\\n }\\n\\n /// @notice Calculating the slot ID for Liquidity contract for double mapping at `slot_` for `key1_` and `key2_`\\n function calculateDoubleMappingStorageSlot(\\n uint256 slot_,\\n address key1_,\\n address key2_\\n ) internal pure returns (bytes32) {\\n bytes32 intermediateSlot_ = keccak256(abi.encode(key1_, slot_));\\n return keccak256(abi.encode(key2_, intermediateSlot_));\\n }\\n}\\n\",\"keccak256\":\"0x0ae3e1d231bb6c14b54fc1f5ffa306edc0ac827a6a92279c77c0c09627fe08ae\",\"license\":\"BUSL-1.1\"},\"contracts/liquidity/adminModule/structs.sol\":{\"content\":\"// SPDX-License-Identifier: BUSL-1.1\\npragma solidity 0.8.21;\\n\\nabstract contract Structs {\\n struct AddressBool {\\n address addr;\\n bool value;\\n }\\n\\n struct AddressUint256 {\\n address addr;\\n uint256 value;\\n }\\n\\n /// @notice struct to set borrow rate data for version 1\\n struct RateDataV1Params {\\n ///\\n /// @param token for rate data\\n address token;\\n ///\\n /// @param kink in borrow rate. in 1e2: 100% = 10_000; 1% = 100\\n /// utilization below kink usually means slow increase in rate, once utilization is above kink borrow rate increases fast\\n uint256 kink;\\n ///\\n /// @param rateAtUtilizationZero desired borrow rate when utilization is zero. in 1e2: 100% = 10_000; 1% = 100\\n /// i.e. constant minimum borrow rate\\n /// e.g. at utilization = 0.01% rate could still be at least 4% (rateAtUtilizationZero would be 400 then)\\n uint256 rateAtUtilizationZero;\\n ///\\n /// @param rateAtUtilizationKink borrow rate when utilization is at kink. in 1e2: 100% = 10_000; 1% = 100\\n /// e.g. when rate should be 7% at kink then rateAtUtilizationKink would be 700\\n uint256 rateAtUtilizationKink;\\n ///\\n /// @param rateAtUtilizationMax borrow rate when utilization is maximum at 100%. in 1e2: 100% = 10_000; 1% = 100\\n /// e.g. when rate should be 125% at 100% then rateAtUtilizationMax would be 12_500\\n uint256 rateAtUtilizationMax;\\n }\\n\\n /// @notice struct to set borrow rate data for version 2\\n struct RateDataV2Params {\\n ///\\n /// @param token for rate data\\n address token;\\n ///\\n /// @param kink1 first kink in borrow rate. in 1e2: 100% = 10_000; 1% = 100\\n /// utilization below kink 1 usually means slow increase in rate, once utilization is above kink 1 borrow rate increases faster\\n uint256 kink1;\\n ///\\n /// @param kink2 second kink in borrow rate. in 1e2: 100% = 10_000; 1% = 100\\n /// utilization below kink 2 usually means slow / medium increase in rate, once utilization is above kink 2 borrow rate increases fast\\n uint256 kink2;\\n ///\\n /// @param rateAtUtilizationZero desired borrow rate when utilization is zero. in 1e2: 100% = 10_000; 1% = 100\\n /// i.e. constant minimum borrow rate\\n /// e.g. at utilization = 0.01% rate could still be at least 4% (rateAtUtilizationZero would be 400 then)\\n uint256 rateAtUtilizationZero;\\n ///\\n /// @param rateAtUtilizationKink1 desired borrow rate when utilization is at first kink. in 1e2: 100% = 10_000; 1% = 100\\n /// e.g. when rate should be 7% at first kink then rateAtUtilizationKink would be 700\\n uint256 rateAtUtilizationKink1;\\n ///\\n /// @param rateAtUtilizationKink2 desired borrow rate when utilization is at second kink. in 1e2: 100% = 10_000; 1% = 100\\n /// e.g. when rate should be 7% at second kink then rateAtUtilizationKink would be 1_200\\n uint256 rateAtUtilizationKink2;\\n ///\\n /// @param rateAtUtilizationMax desired borrow rate when utilization is maximum at 100%. in 1e2: 100% = 10_000; 1% = 100\\n /// e.g. when rate should be 125% at 100% then rateAtUtilizationMax would be 12_500\\n uint256 rateAtUtilizationMax;\\n }\\n\\n /// @notice struct to set token config\\n struct TokenConfig {\\n ///\\n /// @param token address\\n address token;\\n ///\\n /// @param fee charges on borrower's interest. in 1e2: 100% = 10_000; 1% = 100\\n uint256 fee;\\n ///\\n /// @param threshold on when to update the storage slot. in 1e2: 100% = 10_000; 1% = 100\\n uint256 threshold;\\n ///\\n /// @param maxUtilization maximum allowed utilization. in 1e2: 100% = 10_000; 1% = 100\\n /// set to 100% to disable and have default limit of 100% (avoiding SLOAD).\\n uint256 maxUtilization;\\n }\\n\\n /// @notice struct to set user supply & withdrawal config\\n struct UserSupplyConfig {\\n ///\\n /// @param user address\\n address user;\\n ///\\n /// @param token address\\n address token;\\n ///\\n /// @param mode: 0 = without interest. 1 = with interest\\n uint8 mode;\\n ///\\n /// @param expandPercent withdrawal limit expand percent. in 1e2: 100% = 10_000; 1% = 100\\n /// Also used to calculate rate at which withdrawal limit should decrease (instant).\\n uint256 expandPercent;\\n ///\\n /// @param expandDuration withdrawal limit expand duration in seconds.\\n /// used to calculate rate together with expandPercent\\n uint256 expandDuration;\\n ///\\n /// @param baseWithdrawalLimit base limit, below this, user can withdraw the entire amount.\\n /// amount in raw (to be multiplied with exchange price) or normal depends on configured mode in user config for the token:\\n /// with interest -> raw, without interest -> normal\\n uint256 baseWithdrawalLimit;\\n }\\n\\n /// @notice struct to set user borrow & payback config\\n struct UserBorrowConfig {\\n ///\\n /// @param user address\\n address user;\\n ///\\n /// @param token address\\n address token;\\n ///\\n /// @param mode: 0 = without interest. 1 = with interest\\n uint8 mode;\\n ///\\n /// @param expandPercent debt limit expand percent. in 1e2: 100% = 10_000; 1% = 100\\n /// Also used to calculate rate at which debt limit should decrease (instant).\\n uint256 expandPercent;\\n ///\\n /// @param expandDuration debt limit expand duration in seconds.\\n /// used to calculate rate together with expandPercent\\n uint256 expandDuration;\\n ///\\n /// @param baseDebtCeiling base borrow limit. until here, borrow limit remains as baseDebtCeiling\\n /// (user can borrow until this point at once without stepped expansion). Above this, automated limit comes in place.\\n /// amount in raw (to be multiplied with exchange price) or normal depends on configured mode in user config for the token:\\n /// with interest -> raw, without interest -> normal\\n uint256 baseDebtCeiling;\\n ///\\n /// @param maxDebtCeiling max borrow ceiling, maximum amount the user can borrow.\\n /// amount in raw (to be multiplied with exchange price) or normal depends on configured mode in user config for the token:\\n /// with interest -> raw, without interest -> normal\\n uint256 maxDebtCeiling;\\n }\\n}\\n\",\"keccak256\":\"0x10353c70015f27b880125cefab806dbed24a4458f187da66964f3ef60488f757\",\"license\":\"BUSL-1.1\"},\"contracts/liquidity/interfaces/iLiquidity.sol\":{\"content\":\"//SPDX-License-Identifier: MIT\\npragma solidity 0.8.21;\\n\\nimport { IProxy } from \\\"../../infiniteProxy/interfaces/iProxy.sol\\\";\\nimport { Structs as AdminModuleStructs } from \\\"../adminModule/structs.sol\\\";\\n\\ninterface IFluidLiquidityAdmin {\\n /// @notice adds/removes auths. Auths generally could be contracts which can have restricted actions defined on contract.\\n /// auths can be helpful in reducing governance overhead where it's not needed.\\n /// @param authsStatus_ array of structs setting allowed status for an address.\\n /// status true => add auth, false => remove auth\\n function updateAuths(AdminModuleStructs.AddressBool[] calldata authsStatus_) external;\\n\\n /// @notice adds/removes guardians. Only callable by Governance.\\n /// @param guardiansStatus_ array of structs setting allowed status for an address.\\n /// status true => add guardian, false => remove guardian\\n function updateGuardians(AdminModuleStructs.AddressBool[] calldata guardiansStatus_) external;\\n\\n /// @notice changes the revenue collector address (contract that is sent revenue). Only callable by Governance.\\n /// @param revenueCollector_ new revenue collector address\\n function updateRevenueCollector(address revenueCollector_) external;\\n\\n /// @notice changes current status, e.g. for pausing or unpausing all user operations. Only callable by Auths.\\n /// @param newStatus_ new status\\n /// status = 2 -> pause, status = 1 -> resume.\\n function changeStatus(uint256 newStatus_) external;\\n\\n /// @notice update tokens rate data version 1. Only callable by Auths.\\n /// @param tokensRateData_ array of RateDataV1Params with rate data to set for each token\\n function updateRateDataV1s(AdminModuleStructs.RateDataV1Params[] calldata tokensRateData_) external;\\n\\n /// @notice update tokens rate data version 2. Only callable by Auths.\\n /// @param tokensRateData_ array of RateDataV2Params with rate data to set for each token\\n function updateRateDataV2s(AdminModuleStructs.RateDataV2Params[] calldata tokensRateData_) external;\\n\\n /// @notice updates token configs: fee charge on borrowers interest & storage update utilization threshold.\\n /// Only callable by Auths.\\n /// @param tokenConfigs_ contains token address, fee & utilization threshold\\n function updateTokenConfigs(AdminModuleStructs.TokenConfig[] calldata tokenConfigs_) external;\\n\\n /// @notice updates user classes: 0 is for new protocols, 1 is for established protocols.\\n /// Only callable by Auths.\\n /// @param userClasses_ struct array of uint256 value to assign for each user address\\n function updateUserClasses(AdminModuleStructs.AddressUint256[] calldata userClasses_) external;\\n\\n /// @notice sets user supply configs per token basis. Eg: with interest or interest-free and automated limits.\\n /// Only callable by Auths.\\n /// @param userSupplyConfigs_ struct array containing user supply config, see `UserSupplyConfig` struct for more info\\n function updateUserSupplyConfigs(AdminModuleStructs.UserSupplyConfig[] memory userSupplyConfigs_) external;\\n\\n /// @notice setting user borrow configs per token basis. Eg: with interest or interest-free and automated limits.\\n /// Only callable by Auths.\\n /// @param userBorrowConfigs_ struct array containing user borrow config, see `UserBorrowConfig` struct for more info\\n function updateUserBorrowConfigs(AdminModuleStructs.UserBorrowConfig[] memory userBorrowConfigs_) external;\\n\\n /// @notice pause operations for a particular user in class 0 (class 1 users can't be paused by guardians).\\n /// Only callable by Guardians.\\n /// @param user_ address of user to pause operations for\\n /// @param supplyTokens_ token addresses to pause withdrawals for\\n /// @param borrowTokens_ token addresses to pause borrowings for\\n function pauseUser(address user_, address[] calldata supplyTokens_, address[] calldata borrowTokens_) external;\\n\\n /// @notice unpause operations for a particular user in class 0 (class 1 users can't be paused by guardians).\\n /// Only callable by Guardians.\\n /// @param user_ address of user to unpause operations for\\n /// @param supplyTokens_ token addresses to unpause withdrawals for\\n /// @param borrowTokens_ token addresses to unpause borrowings for\\n function unpauseUser(address user_, address[] calldata supplyTokens_, address[] calldata borrowTokens_) external;\\n\\n /// @notice collects revenue for tokens to configured revenueCollector address.\\n /// @param tokens_ array of tokens to collect revenue for\\n /// @dev Note that this can revert if token balance is < revenueAmount (utilization > 100%)\\n function collectRevenue(address[] calldata tokens_) external;\\n\\n /// @notice gets the current updated exchange prices for n tokens and updates all prices, rates related data in storage.\\n /// @param tokens_ tokens to update exchange prices for\\n /// @return supplyExchangePrices_ new supply rates of overall system for each token\\n /// @return borrowExchangePrices_ new borrow rates of overall system for each token\\n function updateExchangePrices(\\n address[] calldata tokens_\\n ) external returns (uint256[] memory supplyExchangePrices_, uint256[] memory borrowExchangePrices_);\\n}\\n\\ninterface IFluidLiquidityLogic is IFluidLiquidityAdmin {\\n /// @notice Single function which handles supply, withdraw, borrow & payback\\n /// @param token_ address of token (0xEeeeeEeeeEeEeeEeEeEeeEEEeeeeEeeeeeeeEEeE for native)\\n /// @param supplyAmount_ if +ve then supply, if -ve then withdraw, if 0 then nothing\\n /// @param borrowAmount_ if +ve then borrow, if -ve then payback, if 0 then nothing\\n /// @param withdrawTo_ if withdrawal then to which address\\n /// @param borrowTo_ if borrow then to which address\\n /// @param callbackData_ callback data passed to `liquidityCallback` method of protocol\\n /// @return memVar3_ updated supplyExchangePrice\\n /// @return memVar4_ updated borrowExchangePrice\\n /// @dev to trigger skipping in / out transfers when in&out amounts balance themselves out (gas optimization):\\n /// - supply(+) == borrow(+), withdraw(-) == payback(-).\\n /// - `withdrawTo_` / `borrowTo_` must be msg.sender (protocol)\\n /// - `callbackData_` MUST be encoded so that \\\"from\\\" address is at last 20 bytes (if this optimization is desired),\\n /// also for native token operations where liquidityCallback is not triggered!\\n /// from address must come at last position if there is more data. I.e. encode like:\\n /// abi.encode(otherVar1, otherVar2, FROM_ADDRESS). Note dynamic types used with abi.encode come at the end\\n /// so if dynamic types are needed, you must use abi.encodePacked to ensure the from address is at the end.\\n function operate(\\n address token_,\\n int256 supplyAmount_,\\n int256 borrowAmount_,\\n address withdrawTo_,\\n address borrowTo_,\\n bytes calldata callbackData_\\n ) external payable returns (uint256 memVar3_, uint256 memVar4_);\\n}\\n\\ninterface IFluidLiquidity is IProxy, IFluidLiquidityLogic {}\\n\",\"keccak256\":\"0xc81ac0cfc8183ec57ec4e488b07a4f6d1ecd79787e0aaf0dcfdd0b9b7ac0fc84\",\"license\":\"MIT\"},\"contracts/reserve/interfaces/iReserveContract.sol\":{\"content\":\"// SPDX-License-Identifier: BUSL-1.1\\npragma solidity 0.8.21;\\n\\nimport { IFluidLiquidity } from \\\"../../liquidity/interfaces/iLiquidity.sol\\\";\\n\\ninterface IFluidReserveContract {\\n function isRebalancer(address user) external returns (bool);\\n\\n function initialize(\\n address[] memory _auths,\\n address[] memory _rebalancers,\\n IFluidLiquidity liquidity_,\\n address owner_\\n ) external;\\n\\n function rebalanceFToken(address protocol_) external;\\n\\n function rebalanceVault(address protocol_) external;\\n\\n function transferFunds(address token_) external;\\n\\n function getProtocolTokens(address protocol_) external;\\n\\n function updateAuth(address auth_, bool isAuth_) external;\\n\\n function updateRebalancer(address rebalancer_, bool isRebalancer_) external;\\n\\n function approve(address[] memory protocols_, address[] memory tokens_, uint256[] memory amounts_) external;\\n\\n function revoke(address[] memory protocols_, address[] memory tokens_) external;\\n}\\n\",\"keccak256\":\"0x36f69b8e3cf8479e5a2ab0390c6ac32e5ea4af5e7ecb91fc954c36503624eec8\",\"license\":\"BUSL-1.1\"}},\"version\":1}",
"bytecode": "0x6101c06040523480156200001257600080fd5b50604051620017583803806200175883398101604081905262000035916200023c565b866001600160a01b0381166200006857604051636801712d60e11b8152620186bf60048201526024015b60405180910390fd5b866001600160a01b0381166200009757604051636801712d60e11b8152620186bf60048201526024016200005f565b866001600160a01b038116620000c657604051636801712d60e11b8152620186bf60048201526024016200005f565b866001600160a01b038116620000f557604051636801712d60e11b8152620186bf60048201526024016200005f565b84158062000104575061271087135b806200011b575062000118612710620002c3565b87125b8062000128575061271086135b806200013f57506200013c612710620002c3565b86125b156200016457604051636801712d60e11b8152620186c160048201526024016200005f565b505050506001600160a01b03968716608090815295871660a090815294871660c08181529490971660e0818152610140929092526101009384526101209283526040805160208181018b905260078284015282518083038401815260608301845280519082012061016052988101999099526005898801528051808a0390970187529488018552855195870195909520610180528601939093526006858201528151808603909101815293909101905281519101206101a052620002ee565b6001600160a01b03811681146200023957600080fd5b50565b600080600080600080600060e0888a0312156200025857600080fd5b8751620002658162000223565b6020890151909750620002788162000223565b60408901519096506200028b8162000223565b60608901519095506200029e8162000223565b809450506080880151925060a0880151915060c0880151905092959891949750929550565b6000600160ff1b8201620002e757634e487b7160e01b600052601160045260246000fd5b5060000390565b60805160a05160c05160e05161010051610120516101405161016051610180516101a05161136a620003ee600039600081816105f10152818161072c015261089f01526000610379015260006102760152600081816101a7015281816109b701528181610c9f0152610cd40152600081816101f501528181611005015261103b01526000818160d301528181610f660152610f9c01526000818161018001528181610a210152610d410152600061015901526000818161010d015281816102b6015281816103a2015281816106320152818161076c015281816108c501528181610b5a0152610e940152600081816101ce01526104fd015261136a6000f3fe608060405234801561001057600080fd5b50600436106100c95760003560e01c80636449b8d7116100815780637d7c2a1c1161005b5780637d7c2a1c1461021f5780639dc1056614610229578063ee53f65c1461023157600080fd5b80636449b8d7146101c95780636a4bee28146101f057806376a9a0f71461021757600080fd5b80632bd173cd116100b25780632bd173cd146101545780634c90f25c1461017b578063535af56d146101a257600080fd5b80631cb79486146100ce5780632861c7d114610108575b600080fd5b6100f57f000000000000000000000000000000000000000000000000000000000000000081565b6040519081526020015b60405180910390f35b61012f7f000000000000000000000000000000000000000000000000000000000000000081565b60405173ffffffffffffffffffffffffffffffffffffffff90911681526020016100ff565b61012f7f000000000000000000000000000000000000000000000000000000000000000081565b61012f7f000000000000000000000000000000000000000000000000000000000000000081565b6100f57f000000000000000000000000000000000000000000000000000000000000000081565b61012f7f000000000000000000000000000000000000000000000000000000000000000081565b6100f57f000000000000000000000000000000000000000000000000000000000000000081565b6100f561024e565b6102276104cf565b005b6100f5610704565b610239610869565b604080519283526020830191909152016100ff565b6040517fb5c736e40000000000000000000000000000000000000000000000000000000081527f00000000000000000000000000000000000000000000000000000000000000006004820152600090819073ffffffffffffffffffffffffffffffffffffffff7f0000000000000000000000000000000000000000000000000000000000000000169063b5c736e490602401602060405180830381865afa1580156102fd573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061032191906110f8565b905066ffffffffffffff600882901c811660ff8084169190911b91608884901c16608084901c9091161b81156104c9576040517fb5c736e40000000000000000000000000000000000000000000000000000000081527f000000000000000000000000000000000000000000000000000000000000000060048201526000907f000000000000000000000000000000000000000000000000000000000000000073ffffffffffffffffffffffffffffffffffffffff169063b5c736e490602401602060405180830381865afa1580156103fe573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061042291906110f8565b9050600064e8d4a51000610444605b84901c67ffffffffffffffff1686611140565b61044e9190611157565b9050600064e8d4a51000610470609b85901c67ffffffffffffffff1686611140565b61047a9190611157565b905061ffff8316601084901c613fff1661049661271085611140565b836104a383612710611192565b6104ad9085611140565b6104b79190611140565b6104c19190611157565b985050505050505b50505090565b6040517f467c9eff0000000000000000000000000000000000000000000000000000000081523360048201527f000000000000000000000000000000000000000000000000000000000000000073ffffffffffffffffffffffffffffffffffffffff169063467c9eff906024016020604051808303816000875af115801561055b573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061057f91906111a5565b6105bf576040517fd002e25a000000000000000000000000000000000000000000000000000000008152620186c060048201526024015b60405180910390fd5b60006105c961024e565b6040517fb5c736e40000000000000000000000000000000000000000000000000000000081527f0000000000000000000000000000000000000000000000000000000000000000600482015290915060009073ffffffffffffffffffffffffffffffffffffffff7f0000000000000000000000000000000000000000000000000000000000000000169063b5c736e490602401602060405180830381865afa158015610679573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061069d91906110f8565b9050600f811660018190036106bb576106b68383610952565b505050565b806002036106cd576106b68383610c20565b6040517fd002e25a000000000000000000000000000000000000000000000000000000008152620186c360048201526024016105b6565b6040517fb5c736e40000000000000000000000000000000000000000000000000000000081527f00000000000000000000000000000000000000000000000000000000000000006004820152600090819073ffffffffffffffffffffffffffffffffffffffff7f0000000000000000000000000000000000000000000000000000000000000000169063b5c736e490602401602060405180830381865afa1580156107b3573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906107d791906110f8565b90506000806107ed6107e761024e565b84610f5d565b9092509050600f8316600181900361081a57602484901c61ffff1661081281856110a1565b955050610862565b806002036106cd5761ffff602485901c811690604486901c1661083d82866110a1565b9650600061084b82866110a1565b905080881161085a578061085c565b875b97505050505b5050505090565b60008061094a61087761024e565b6040517fb5c736e40000000000000000000000000000000000000000000000000000000081527f000000000000000000000000000000000000000000000000000000000000000060048201527f000000000000000000000000000000000000000000000000000000000000000073ffffffffffffffffffffffffffffffffffffffff169063b5c736e490602401602060405180830381865afa158015610921573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061094591906110f8565b610f5d565b915091509091565b61099a6040518060a00160405280600073ffffffffffffffffffffffffffffffffffffffff168152602001600081526020016000815260200160008152602001600081525090565b602482901c61ffff166109ad8484610f5d565b50606083018190527f0000000000000000000000000000000000000000000000000000000000000000906109e29083906110a1565b1015610a1f576040517fd002e25a000000000000000000000000000000000000000000000000000000008152620186c260048201526024016105b6565b7f000000000000000000000000000000000000000000000000000000000000000073ffffffffffffffffffffffffffffffffffffffff16825261ffff600484901c81166040840152601484901c81166020840152603484901c16608083015260006001604051908082528060200260200182016040528015610afb57816020015b610ae86040518060a00160405280600073ffffffffffffffffffffffffffffffffffffffff168152602001600081526020016000815260200160008152602001600081525090565b815260200190600190039081610aa05790505b5090508281600081518110610b1257610b126111ce565b60209081029190910101526040517f3fad77fc00000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff7f00000000000000000000000000000000000000000000000000000000000000001690633fad77fc90610b8f9084906004016111fd565b600060405180830381600087803b158015610ba957600080fd5b505af1158015610bbd573d6000803e3d6000fd5b505050606080850151604080518981526020810187905290810191909152600091810182905260808101919091527f24e2edf993a55aa376aad1f221b77e38909f025c6b5010a003b527fc1d111171915060a00160405180910390a15050505050565b610c766040518060e00160405280600073ffffffffffffffffffffffffffffffffffffffff1681526020016000815260200160008152602001600081526020016000815260200160008152602001600081525090565b61ffff602483901c811690604484901c16610c918585610f5d565b60a0850152608084018190527f000000000000000000000000000000000000000000000000000000000000000090610cca9084906110a1565b108015610d0357507f0000000000000000000000000000000000000000000000000000000000000000610d01828560a001516110a1565b105b15610d3f576040517fd002e25a000000000000000000000000000000000000000000000000000000008152620186c260048201526024016105b6565b7f000000000000000000000000000000000000000000000000000000000000000073ffffffffffffffffffffffffffffffffffffffff16835261ffff600485901c81166060850152601485901c81166020850152603485901c81166040850152605485901c1660c084015260006001604051908082528060200260200182016040528015610e3557816020015b610e226040518060e00160405280600073ffffffffffffffffffffffffffffffffffffffff1681526020016000815260200160008152602001600081526020016000815260200160008152602001600081525090565b815260200190600190039081610dcc5790505b5090508381600081518110610e4c57610e4c6111ce565b60209081029190910101526040517f9dde597700000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff7f00000000000000000000000000000000000000000000000000000000000000001690639dde597790610ec9908490600401611281565b600060405180830381600087803b158015610ee357600080fd5b505af1158015610ef7573d6000803e3d6000fd5b50505060808086015160a080880151604080518c8152602081018a90529081019390935260608301879052928201929092527f24e2edf993a55aa376aad1f221b77e38909f025c6b5010a003b527fc1d11117192500160405180910390a1505050505050565b60008080610f8b7f00000000000000000000000000000000000000000000000000000000000000008661130c565b13610f97576000610fc1565b610fc17f00000000000000000000000000000000000000000000000000000000000000008561130c565b915061ffff8211610fd25781610fd6565b61ffff5b915082600f16600103610ffe57603483901c61ffff1680831115610ff8578092505b5061109a565b600061102a7f00000000000000000000000000000000000000000000000000000000000000008661130c565b13611036576000611060565b6110607f00000000000000000000000000000000000000000000000000000000000000008561130c565b905061ffff81116110715780611075565b61ffff5b9050605483901c61ffff168083111561108c578092505b80821115611098578091505b505b9250929050565b60008183036110b2575060006110f2565b818311156110cb576110c48284611192565b90506110d8565b6110d58383611192565b90505b826110e582612710611140565b6110ef9190611157565b90505b92915050565b60006020828403121561110a57600080fd5b5051919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b80820281158282048414176110f2576110f2611111565b60008261118d577f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b500490565b818103818111156110f2576110f2611111565b6000602082840312156111b757600080fd5b815180151581146111c757600080fd5b9392505050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b602080825282518282018190526000919060409081850190868401855b82811015611274578151805173ffffffffffffffffffffffffffffffffffffffff16855286810151878601528581015186860152606080820151908601526080908101519085015260a0909301929085019060010161121a565b5091979650505050505050565b602080825282518282018190526000919060409081850190868401855b82811015611274578151805173ffffffffffffffffffffffffffffffffffffffff16855286810151878601528581015186860152606080820151908601526080808201519086015260a0808201519086015260c0908101519085015260e0909301929085019060010161129e565b808201828112600083128015821682158216171561132c5761132c611111565b50509291505056fea26469706673582212205087a4311328cc9f32ff59139c042387bbc1c6c7fd2ac99a4c91c3c688cc3eef64736f6c63430008150033",
"deployedBytecode": "0x608060405234801561001057600080fd5b50600436106100c95760003560e01c80636449b8d7116100815780637d7c2a1c1161005b5780637d7c2a1c1461021f5780639dc1056614610229578063ee53f65c1461023157600080fd5b80636449b8d7146101c95780636a4bee28146101f057806376a9a0f71461021757600080fd5b80632bd173cd116100b25780632bd173cd146101545780634c90f25c1461017b578063535af56d146101a257600080fd5b80631cb79486146100ce5780632861c7d114610108575b600080fd5b6100f57f000000000000000000000000000000000000000000000000000000000000000081565b6040519081526020015b60405180910390f35b61012f7f000000000000000000000000000000000000000000000000000000000000000081565b60405173ffffffffffffffffffffffffffffffffffffffff90911681526020016100ff565b61012f7f000000000000000000000000000000000000000000000000000000000000000081565b61012f7f000000000000000000000000000000000000000000000000000000000000000081565b6100f57f000000000000000000000000000000000000000000000000000000000000000081565b61012f7f000000000000000000000000000000000000000000000000000000000000000081565b6100f57f000000000000000000000000000000000000000000000000000000000000000081565b6100f561024e565b6102276104cf565b005b6100f5610704565b610239610869565b604080519283526020830191909152016100ff565b6040517fb5c736e40000000000000000000000000000000000000000000000000000000081527f00000000000000000000000000000000000000000000000000000000000000006004820152600090819073ffffffffffffffffffffffffffffffffffffffff7f0000000000000000000000000000000000000000000000000000000000000000169063b5c736e490602401602060405180830381865afa1580156102fd573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061032191906110f8565b905066ffffffffffffff600882901c811660ff8084169190911b91608884901c16608084901c9091161b81156104c9576040517fb5c736e40000000000000000000000000000000000000000000000000000000081527f000000000000000000000000000000000000000000000000000000000000000060048201526000907f000000000000000000000000000000000000000000000000000000000000000073ffffffffffffffffffffffffffffffffffffffff169063b5c736e490602401602060405180830381865afa1580156103fe573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061042291906110f8565b9050600064e8d4a51000610444605b84901c67ffffffffffffffff1686611140565b61044e9190611157565b9050600064e8d4a51000610470609b85901c67ffffffffffffffff1686611140565b61047a9190611157565b905061ffff8316601084901c613fff1661049661271085611140565b836104a383612710611192565b6104ad9085611140565b6104b79190611140565b6104c19190611157565b985050505050505b50505090565b6040517f467c9eff0000000000000000000000000000000000000000000000000000000081523360048201527f000000000000000000000000000000000000000000000000000000000000000073ffffffffffffffffffffffffffffffffffffffff169063467c9eff906024016020604051808303816000875af115801561055b573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061057f91906111a5565b6105bf576040517fd002e25a000000000000000000000000000000000000000000000000000000008152620186c060048201526024015b60405180910390fd5b60006105c961024e565b6040517fb5c736e40000000000000000000000000000000000000000000000000000000081527f0000000000000000000000000000000000000000000000000000000000000000600482015290915060009073ffffffffffffffffffffffffffffffffffffffff7f0000000000000000000000000000000000000000000000000000000000000000169063b5c736e490602401602060405180830381865afa158015610679573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061069d91906110f8565b9050600f811660018190036106bb576106b68383610952565b505050565b806002036106cd576106b68383610c20565b6040517fd002e25a000000000000000000000000000000000000000000000000000000008152620186c360048201526024016105b6565b6040517fb5c736e40000000000000000000000000000000000000000000000000000000081527f00000000000000000000000000000000000000000000000000000000000000006004820152600090819073ffffffffffffffffffffffffffffffffffffffff7f0000000000000000000000000000000000000000000000000000000000000000169063b5c736e490602401602060405180830381865afa1580156107b3573d6000803e3d6000fd5b505050506040513d601f19601f820116820180604052508101906107d791906110f8565b90506000806107ed6107e761024e565b84610f5d565b9092509050600f8316600181900361081a57602484901c61ffff1661081281856110a1565b955050610862565b806002036106cd5761ffff602485901c811690604486901c1661083d82866110a1565b9650600061084b82866110a1565b905080881161085a578061085c565b875b97505050505b5050505090565b60008061094a61087761024e565b6040517fb5c736e40000000000000000000000000000000000000000000000000000000081527f000000000000000000000000000000000000000000000000000000000000000060048201527f000000000000000000000000000000000000000000000000000000000000000073ffffffffffffffffffffffffffffffffffffffff169063b5c736e490602401602060405180830381865afa158015610921573d6000803e3d6000fd5b505050506040513d601f19601f8201168201806040525081019061094591906110f8565b610f5d565b915091509091565b61099a6040518060a00160405280600073ffffffffffffffffffffffffffffffffffffffff168152602001600081526020016000815260200160008152602001600081525090565b602482901c61ffff166109ad8484610f5d565b50606083018190527f0000000000000000000000000000000000000000000000000000000000000000906109e29083906110a1565b1015610a1f576040517fd002e25a000000000000000000000000000000000000000000000000000000008152620186c260048201526024016105b6565b7f000000000000000000000000000000000000000000000000000000000000000073ffffffffffffffffffffffffffffffffffffffff16825261ffff600484901c81166040840152601484901c81166020840152603484901c16608083015260006001604051908082528060200260200182016040528015610afb57816020015b610ae86040518060a00160405280600073ffffffffffffffffffffffffffffffffffffffff168152602001600081526020016000815260200160008152602001600081525090565b815260200190600190039081610aa05790505b5090508281600081518110610b1257610b126111ce565b60209081029190910101526040517f3fad77fc00000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff7f00000000000000000000000000000000000000000000000000000000000000001690633fad77fc90610b8f9084906004016111fd565b600060405180830381600087803b158015610ba957600080fd5b505af1158015610bbd573d6000803e3d6000fd5b505050606080850151604080518981526020810187905290810191909152600091810182905260808101919091527f24e2edf993a55aa376aad1f221b77e38909f025c6b5010a003b527fc1d111171915060a00160405180910390a15050505050565b610c766040518060e00160405280600073ffffffffffffffffffffffffffffffffffffffff1681526020016000815260200160008152602001600081526020016000815260200160008152602001600081525090565b61ffff602483901c811690604484901c16610c918585610f5d565b60a0850152608084018190527f000000000000000000000000000000000000000000000000000000000000000090610cca9084906110a1565b108015610d0357507f0000000000000000000000000000000000000000000000000000000000000000610d01828560a001516110a1565b105b15610d3f576040517fd002e25a000000000000000000000000000000000000000000000000000000008152620186c260048201526024016105b6565b7f000000000000000000000000000000000000000000000000000000000000000073ffffffffffffffffffffffffffffffffffffffff16835261ffff600485901c81166060850152601485901c81166020850152603485901c81166040850152605485901c1660c084015260006001604051908082528060200260200182016040528015610e3557816020015b610e226040518060e00160405280600073ffffffffffffffffffffffffffffffffffffffff1681526020016000815260200160008152602001600081526020016000815260200160008152602001600081525090565b815260200190600190039081610dcc5790505b5090508381600081518110610e4c57610e4c6111ce565b60209081029190910101526040517f9dde597700000000000000000000000000000000000000000000000000000000815273ffffffffffffffffffffffffffffffffffffffff7f00000000000000000000000000000000000000000000000000000000000000001690639dde597790610ec9908490600401611281565b600060405180830381600087803b158015610ee357600080fd5b505af1158015610ef7573d6000803e3d6000fd5b50505060808086015160a080880151604080518c8152602081018a90529081019390935260608301879052928201929092527f24e2edf993a55aa376aad1f221b77e38909f025c6b5010a003b527fc1d11117192500160405180910390a1505050505050565b60008080610f8b7f00000000000000000000000000000000000000000000000000000000000000008661130c565b13610f97576000610fc1565b610fc17f00000000000000000000000000000000000000000000000000000000000000008561130c565b915061ffff8211610fd25781610fd6565b61ffff5b915082600f16600103610ffe57603483901c61ffff1680831115610ff8578092505b5061109a565b600061102a7f00000000000000000000000000000000000000000000000000000000000000008661130c565b13611036576000611060565b6110607f00000000000000000000000000000000000000000000000000000000000000008561130c565b905061ffff81116110715780611075565b61ffff5b9050605483901c61ffff168083111561108c578092505b80821115611098578091505b505b9250929050565b60008183036110b2575060006110f2565b818311156110cb576110c48284611192565b90506110d8565b6110d58383611192565b90505b826110e582612710611140565b6110ef9190611157565b90505b92915050565b60006020828403121561110a57600080fd5b5051919050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052601160045260246000fd5b80820281158282048414176110f2576110f2611111565b60008261118d577f4e487b7100000000000000000000000000000000000000000000000000000000600052601260045260246000fd5b500490565b818103818111156110f2576110f2611111565b6000602082840312156111b757600080fd5b815180151581146111c757600080fd5b9392505050565b7f4e487b7100000000000000000000000000000000000000000000000000000000600052603260045260246000fd5b602080825282518282018190526000919060409081850190868401855b82811015611274578151805173ffffffffffffffffffffffffffffffffffffffff16855286810151878601528581015186860152606080820151908601526080908101519085015260a0909301929085019060010161121a565b5091979650505050505050565b602080825282518282018190526000919060409081850190868401855b82811015611274578151805173ffffffffffffffffffffffffffffffffffffffff16855286810151878601528581015186860152606080820151908601526080808201519086015260a0808201519086015260c0908101519085015260e0909301929085019060010161129e565b808201828112600083128015821682158216171561132c5761132c611111565b50509291505056fea26469706673582212205087a4311328cc9f32ff59139c042387bbc1c6c7fd2ac99a4c91c3c688cc3eef64736f6c63430008150033",
"devdoc": {
"kind": "dev",
"methods": {},
"version": 1
},
"userdoc": {
"events": {
"LogUpdateRate(uint256,uint256,uint256,uint256,uint256)": {
"notice": "emitted when borrow rate for `BORROW_TOKEN` is updated based on supply rate of `SUPPLY_TOKEN` + buffer."
}
},
"kind": "user",
"methods": {
"BORROW_TOKEN()": {
"notice": "borrow token at Liquidity for which the borrow rate is managed"
},
"RATE_BUFFER_KINK1()": {
"notice": "buffer at kink1 for the rate. borrow rate = supply rate + buffer. In percent (100 = 1%, 1 = 0.01%)"
},
"RATE_BUFFER_KINK2()": {
"notice": "buffer at kink2 for the rate. borrow rate = supply rate + buffer. In percent (100 = 1%, 1 = 0.01%)"
},
"SUPPLY_TOKEN()": {
"notice": "supply token at Liquidity which borrow rate is based on"
},
"calcBorrowRates()": {
"notice": "returns the current calculcated borrow rates at kink1 and kink 2 (for rate data v2)."
},
"configPercentDiff()": {
"notice": "returns how much the new config would be different from current config in percent (100 = 1%, 1 = 0.01%)."
},
"rebalance()": {
"notice": "Rebalances the configs at Fluid Liquidity based on config handler target. Reverts if no update is needed. Can only be called by an authorized rebalancer."
},
"supplyTokenLendingRate()": {
"notice": "get current `SUPPLY_TOKEN` lending `rate_` at Liquidity"
}
},
"notice": "Sets borrow rate for `BORROW_TOKEN` at Liquidaty based on supply rate of `SUPPLY_TOKEN` + buffer.",
"version": 1
},
"storageLayout": {
"storage": [],
"types": null
}
}