Verified contractExactUNLICENSED
FLAMMPolicyLib
Address0xa6b495b2bdcdcf4f327844d9aaa0ed4c550c67f9
- Balance
0 ETH
- Transactions
0
- Compiler
solc 0.8.35
- Same code
Only this contract
Details
- Compiler
- solc 0.8.35+commit.47b9dedd
- Language
- solidity
- Optimization
- Yes, 100 runs
- EVM version
- cancun
- Via IR
- yes
- License
- UNLICENSED
- Match
- Exactcreation code: yes, runtime code: yes
- Verified on Sourcify
- Created in block
- 26,396,553
- Creation transaction
- 0x3e8279e37d…fa1a0b7ec1
- Libraries
- src/core/mm/MMRouterLib.sol:MMRouterLib0xa474…d2b4e5src/core/flamm/FLAMMLane.sol:FLAMMLane0x0988…d22e98src/core/flamm/FLAMMRoute.sol:FLAMMRoute0x312e…0fdaa9src/periphery/FLAMMMaxima.sol:FLAMMMaxima0x4a99…d6259csrc/core/flamm/FLAMMLawLib.sol:FLAMMLawLib0x5d47…27cc62src/core/flamm/FLAMMOpsLib.sol:FLAMMOpsLib0x0bfe…043753src/core/mm/AaveV3ReadsLib.sol:AaveV3ReadsLib0xd53f…ed5983src/core/flamm/FLAMMFlowLib.sol:FLAMMFlowLib0x2577…4e3473src/core/flamm/FLAMMGateLib.sol:FLAMMGateLib0xf0be…2b9555src/core/flamm/FLAMMKeptLib.sol:FLAMMKeptLib0x7a11…58517bsrc/core/mm/CTokenMarketLib.sol:CTokenMarketLib0x18c5…b2071csrc/core/flamm/FLAMMAdmitLib.sol:FLAMMAdmitLib0xa6db…bdcbcbsrc/core/flamm/FLAMMBlindLib.sol:FLAMMBlindLib0x0b8d…2e7e5csrc/core/flamm/FLAMMClaimLib.sol:FLAMMClaimLib0x02b4…731ccesrc/core/flamm/FLAMMFenceLib.sol:FLAMMFenceLib0xa16d…a201e8src/core/flamm/FLAMMFloatLib.sol:FLAMMFloatLib0x539e…a79737src/core/flamm/FLAMMQuoteLib.sol:FLAMMQuoteLib0xa4d3…d5ce2esrc/core/flamm/FLAMMTopUpLib.sol:FLAMMTopUpLib0x7c55…d233dfsrc/core/mm/CTokenRewardsLib.sol:CTokenRewardsLib0xcda6…a4dcf7src/core/mm/MMRouterAdminLib.sol:MMRouterAdminLib0x8423…7adc96src/core/flamm/FLAMMPolicyLib.sol:FLAMMPolicyLib0xa6b4…0c67f9src/core/flamm/FLAMMSettleLib.sol:FLAMMSettleLib0xb489…d3c7cbsrc/core/flamm/FLAMMSharedLib.sol:FLAMMSharedLib0xfaae…2511basrc/periphery/FLAMMExitMaxima.sol:FLAMMExitMaxima0x480f…4e0a81src/hooks/everlong/LeverageLib.sol:LeverageLib0x1b1d…40ad11src/core/flamm/FLAMMMaintainLib.sol:FLAMMMaintainLib0x9499…409cc2src/core/flamm/FLAMMPairQuoteLib.sol:FLAMMPairQuoteLib0x0775…d94cbesrc/hooks/everlong/EverlongOpsLib.sol:EverlongOpsLib0xabe4…7426f7
52 files
The source code is large: one file is shown at a time. Choose a file in the list.
- src/core/flamm/FLAMMPolicyLib.solmain39.49 KB
- lib/openzeppelin-contracts-compat/contracts/interfaces/draft-IERC6093.sol6.54 KB
- lib/openzeppelin-contracts-compat/contracts/token/ERC20/IERC20.sol2.77 KB
- lib/openzeppelin-contracts-compat/contracts/token/ERC20/extensions/IERC20Metadata.sol683 B
- lib/openzeppelin-contracts-compat/contracts/utils/math/Math.sol12.51 KB
- lib/openzeppelin-contracts-compat/contracts/utils/math/SafeCast.sol35.08 KB
- lib/openzeppelin-contracts-upgradeable-compat/contracts/proxy/utils/Initializable.sol8.91 KB
- lib/openzeppelin-contracts-upgradeable-compat/contracts/token/ERC20/ERC20Upgradeable.sol12.23 KB
- lib/openzeppelin-contracts-upgradeable-compat/contracts/utils/ContextUpgradeable.sol1.19 KB
- src/core/PriceFeed.sol19.12 KB
- src/core/flamm/FLAMM.sol54.32 KB
- src/core/flamm/FLAMMAdmitLib.sol37.26 KB
- src/core/flamm/FLAMMBlindLib.sol41.3 KB
- src/core/flamm/FLAMMClaimLib.sol49.42 KB
- src/core/flamm/FLAMMClaimVault.sol1.65 KB
- src/core/flamm/FLAMMFenceLib.sol72.83 KB
- src/core/flamm/FLAMMFloatLib.sol57.91 KB
- src/core/flamm/FLAMMFlowLib.sol55.24 KB
- src/core/flamm/FLAMMGateLib.sol87.39 KB
- src/core/flamm/FLAMMKeptLib.sol45.59 KB
- src/core/flamm/FLAMMLane.sol70.27 KB
- src/core/flamm/FLAMMLawLib.sol60.67 KB
- src/core/flamm/FLAMMMaintainLib.sol41.67 KB
- src/core/flamm/FLAMMOpsLib.sol32.2 KB
- src/core/flamm/FLAMMQuoteLib.sol16.89 KB
- src/core/flamm/FLAMMRoute.sol16.45 KB
- src/core/flamm/FLAMMSettleLib.sol42.92 KB
- src/core/flamm/FLAMMSharedLib.sol13.11 KB
- src/core/flamm/FLAMMStore.sol135.42 KB
- src/core/flamm/FLAMMSwapLib.sol55.65 KB
- src/core/flamm/FLAMMTopUpLib.sol48.97 KB
- src/core/mm/MMRouterAdminLib.sol24.07 KB
- src/core/mm/MMRouterLib.sol72.71 KB
- src/core/mm/VenueAccountBase.sol15.61 KB
- src/core/mm/VenueReads.sol2.05 KB
- src/interfaces/core/IDepositAllowlist.sol1.06 KB
- src/interfaces/core/IEverlongCore.sol889 B
- src/interfaces/core/IPriceFeed.sol3.71 KB
- src/interfaces/core/flamm/IFLAMM.sol52.68 KB
- src/interfaces/core/flamm/IFLAMMHooks.sol8.36 KB
- src/interfaces/core/flamm/IHookCapabilities.sol2.63 KB
- src/interfaces/core/flamm/IPairHook.sol14.14 KB
- src/interfaces/core/mm/IAccountDeployer.sol2.99 KB
- src/interfaces/core/mm/IFinancingAccount.sol46.04 KB
- src/interfaces/core/mm/IHeldRepay.sol2.61 KB
- src/interfaces/core/mm/IMMRouter.sol70.37 KB
- src/interfaces/utils/integrations/IAggregatorV3Interface.sol818 B
- src/libraries/Constants.sol2.11 KB
- src/libraries/DelayLib.sol11.22 KB
- src/libraries/ReentrancyGuardLib.sol2.52 KB
- src/libraries/SafeTransferLib.sol5.11 KB
- src/propamm/libraries/PropAMMLaneLib.sol2.31 KB
src/core/flamm/FLAMMPolicyLib.sol
// SPDX-License-Identifier: UNLICENSED
// Copyright (c) 2025-2026 Everlong Labs Limited
pragma solidity ^0.8.26;
import {Math} from "@openzeppelin/contracts/utils/math/Math.sol";
import {
FLAMMStore, NotCurator, InvalidConfig, GuardianMayOnlyTighten, DialsSet, FeeBoundsSet, FeaturesSet,
TokenConfigSet, MinSupplyBatchSet, CeilingBreached, CeilingsSet, CeilingsScheduled, HookSetNotReady,
VenueReportsLoss, CollateralReserveSet, NotScheduled, TradePairsSet, TradePairsScheduled, TradePairsCancelled,
WAD
} from "src/core/flamm/FLAMMStore.sol";
import {FLAMMAdmitLib} from "src/core/flamm/FLAMMAdmitLib.sol";
import {FLAMMGateLib} from "src/core/flamm/FLAMMGateLib.sol";
import {FLAMMTopUpLib} from "src/core/flamm/FLAMMTopUpLib.sol";
import {FLAMMQuoteLib} from "src/core/flamm/FLAMMQuoteLib.sol";
import {FLAMMLane} from "src/core/flamm/FLAMMLane.sol";
import {FLAMMOpsLib} from "src/core/flamm/FLAMMOpsLib.sol";
import {FLAMMKeptLib} from "src/core/flamm/FLAMMKeptLib.sol";
import {IMMRouter, VENUE_RETIRED} from "src/interfaces/core/mm/IMMRouter.sol";
import {IFinancingAccount, CAP_ACCRUING_COLLATERAL} from "src/interfaces/core/mm/IFinancingAccount.sol";
import {ReentrancyGuardLib} from "src/libraries/ReentrancyGuardLib.sol";
/// @notice The pool's policy setters, the operator's and the guardian's: the features, each token's swap policy, its
/// supply batch and its supply cap, the fee bounds, each pair's caps, its venue-oracle band and its dials, the
/// drawn-token limit, each venue's switches and caps, the committed ceilings, the trade masks and the
/// collateral reserve rules. The pool's dispatch table (`FLAMM.route`) hands each entry here under the
/// pool's own selector, so each takes the pool's storage from its own namespace, checks its own caller and
/// holds the pool's lock. None of it runs on a swap, an entry or an exit.
library FLAMMPolicyLib {
// The pool's own cap and switch setters, which key a cheap-lane pool's delayed loosening in the pending table
// (`FLAMMLane.capDue`), and the fee floors' setters, which key any other pool's delayed cut of a floor there
// (`FLAMMLane.scheduledCut`): the pool's floor by `SET_FEE_BOUNDS` alone, a token's by `SET_TOKEN_CONFIG` and the
// token.
bytes4 internal constant SET_TOKEN_CONFIG =
bytes4(keccak256("setTokenConfig(uint8,uint64,uint64,uint256,uint256)"));
bytes4 internal constant SET_FEE_BOUNDS = bytes4(keccak256("setFeeBounds(uint64,uint64)"));
bytes4 internal constant SET_TOKEN_SUPPLY_CAP = bytes4(keccak256("setTokenSupplyCap(uint8,uint128)"));
bytes4 internal constant SET_PAIR_CAPS = bytes4(keccak256("setPairCaps(uint8,uint128,bool)"));
bytes4 internal constant SET_VENUE_CAPS = bytes4(keccak256("setVenueCaps(uint16,uint128,uint128,uint64)"));
bytes4 internal constant SET_VENUE_FLAGS = bytes4(keccak256("setVenueFlags(uint16,bool,bool)"));
bytes4 internal constant SET_ORACLE_BAND = bytes4(keccak256("setOracleBand(uint8,uint64)"));
bytes4 internal constant SET_MAX_DRAWN_TOKENS = bytes4(keccak256("setMaxDrawnTokens(uint8)"));
bytes4 internal constant SET_MIN_SUPPLY_BATCH = bytes4(keccak256("setMinSupplyBatch(uint8,uint128)"));
bytes4 internal constant SET_FEATURES = bytes4(keccak256("setFeatures(uint256)"));
/// @dev The gate every cap and switch setter shares: the guardian may only tighten (`GuardianMayOnlyTighten`); on
/// a pool whose cheap lane is on a tightening drops the same setting's scheduled loosening, and the curator's
/// loosening waits the pool's delay (`FLAMMLane.capDue`). True while `call` is scheduled, not applied.
function _waits(FLAMMStore.S storage $, bool guardian, bool tight, bytes memory call) private returns (bool) {
if (guardian && !tight) revert GuardianMayOnlyTighten();
return FLAMMLane.capDue($, tight, call) != 0;
}
// ------------------------------------------------------------------ the entries' callers and the lock
// Each entry checks its own caller and holds the pool's lock, in the order its modifiers stand.
/// @dev The curator (`NotCurator`).
modifier onlyCurator() {
FLAMMStore.requireCurator(FLAMMStore.s());
_;
}
/// @dev The curator or the pool's guardian (`NotGuardianOrCurator`).
modifier curatorOrGuardian() {
FLAMMStore.curatorOrGuardian(FLAMMStore.s());
_;
}
/// @dev The keeper or the curator (`NotKeeperOrCurator`).
modifier keeperOrCurator() {
FLAMMStore.requireKeeperOrCurator(FLAMMStore.s(), false);
_;
}
/// @dev The pool's lock, taken for the entry and cleared when it returns.
modifier nonReentrant() {
ReentrancyGuardLib._guard();
_;
ReentrancyGuardLib._unlockGuard();
}
// ------------------------------------------------------------------ features
/// @notice The curator's feature bitmap (`FLAMMStore.FEATURE_*`): the guardian may only clear bits, and on a pool
/// whose cheap lane is on the curator's bitmap that sets one waits the pool's delay (`FLAMMLane.capDue`);
/// no bit gates a redemption. A swap of the pool asset takes `FEATURE_SWAP_SELL` or `FEATURE_SWAP_BUY`; one
/// of two tokens past it takes the trade masks alone (`setTradePairs`).
/// @dev A bit turned on is a loosening: the guardian's refused, and on a pool whose cheap lane is on the curator's
/// waits the pool's delay ({_waits}); a bitmap that turns none on applies at once. The custody-blind law's bit,
/// the operator's share's and the loss marks' are no switches (`FLAMMStore.CUSTODY_BLIND`,
/// `FLAMMStore.OPERATOR_SHARE`, `FLAMMStore.LOSS_MARKS`): every write keeps the first two, and sets the third
/// exactly where a venue slot's kind reports a loss, a redemption fee or not, as an admission does. So the
/// switches as they stand, written again by the operator or the guardian, set that bit at once on a pool
/// whose venues were admitted before it had a meaning, and no write clears it while such a venue is listed.
function setFeatures(uint256 bitmap) public nonReentrant {
FLAMMStore.S storage $ = FLAMMStore.s();
bool guardian = FLAMMStore.curatorOrGuardian($);
if (bitmap & ~FLAMMStore.FEATURES_ALL != 0) revert InvalidConfig();
uint256 cur = $.features;
if (_waits($, guardian, bitmap & ~cur == 0, abi.encode(SET_FEATURES, bitmap))) return;
// the loss marks' bit is read from the venue sets again, as an admission writes it, so a pool whose venues were
// admitted before the bit had a meaning carries it from its first feature write on
cur &= FLAMMStore.CUSTODY_BLIND | FLAMMStore.OPERATOR_SHARE;
if ($.lossVenues != 0) cur |= FLAMMStore.LOSS_MARKS;
$.features = uint16(bitmap | cur);
emit FeaturesSet(bitmap, msg.sender);
}
// ------------------------------------------------------------------ tokens
/// @dev A token's swap policy, its config's and a token's at genesis and admission alike (`FLAMMAdmitLib`): a band
/// in (0, MAX] (zero where `zero`), a fee floor at most the pool's cap, 128-bit caps.
function checkPolicy(FLAMMStore.S storage $, bool zero, uint64 band, uint64 floor, uint256 cap, uint256 target)
internal
view
{
if (zero ? band != 0 : (band == 0 || band > FLAMMStore.MAX_SWAP_PRICE_BAND_WAD)) revert InvalidConfig();
if (floor > $.feeCapWad || cap > type(uint128).max || target > type(uint128).max) revert InvalidConfig();
}
/// @notice Token `t`'s swap policy: its band under the committed ceiling (token 1's is the market band, zero, as it
/// stays, on a pool with no band; the pool asset's is always zero), its fee floor, its notional cap (zero:
/// none) and its reserve target. The guardian may only tighten: a band no wider, a lower or first notional
/// cap, a reserve target and a fee floor no lower (on a custody-blind pool a borrowed token's reserve
/// target no higher, as it caps the buffer a refill holds); on a pool whose cheap lane is on any other
/// change of the curator's waits the pool's delay (`FLAMMLane.capDue`). On any other pool the curator's cut
/// of a token's fee floor waits it, the pool asset's aside (no fill reads that floor), as an admission
/// (`FLAMMLane.scheduledCut`): the first call schedules it (`AdmissionScheduled`), replacing the token's
/// cut scheduled before; the identical call applies it from its due time until one delay later, past which
/// it lapses; a call with a floor no lower, the guardian's included, applies at once and drops it, and the
/// curator or the guardian cancels it (`cancel`). Every other change applies at once there. A due cut
/// stays armed for its whole window, so LPs act on its scheduling event (`AdmissionScheduled`), not on the
/// wait itself.
/// @dev A tighter band can refuse the covering swap that ends a market-oracle freeze, as clearing its direction's
/// feature bit does, and a lower notional cap can cut it short of the debt. The band is at most its committed
/// ceiling ({setBandAndFeeCeilings}); token 1's is zero while the pool has no market band, which only
/// `FLAMM.setMarketBand` attaches, and the pool asset's is always zero (no swap reads it). A wider band keeps
/// the LTV of every live pair of the token within what the band and the protocol's part keep
/// (`FLAMMStore.coverSafe`; `InvalidConfig` otherwise), as the pair's admission, its dial raises and the
/// market band's attach do (`FLAMMQuoteLib.pinsWithinBand`). On a cheap-lane pool token 1's notional cap is
/// written to its mirror in `laneConfig` too (`FLAMMStore.LANE_NOTIONAL_SHIFT`), which the hook pair's fill
/// reads, and every loosening waits the pool's delay (`FLAMMLane.capDue`). On any other pool a cut of a
/// token's fee floor waits it (`FLAMMLane.scheduledCut`, keyed by this setter and the token), the pool
/// asset's aside, as no fill reads that floor (`FLAMMSwapLib`'s bounds): a call with a floor no lower applies
/// at once and drops the token's cut scheduled.
function setTokenConfig(uint8 t, uint64 bandWad, uint64 feeFloorWad, uint256 maxSwapNotional, uint256 reserveTarget)
public
nonReentrant
{
FLAMMStore.S storage $ = FLAMMStore.s();
bool guardian = FLAMMStore.curatorOrGuardian($);
FLAMMStore.checkToken($, t);
checkPolicy($, t == 0 || (t == 1 && $.noBand), bandWad, feeFloorWad, maxSwapNotional, reserveTarget);
FLAMMStore.TokenCfg storage cur = $.tokens[t];
// a tightening: a band no wider, a lower or first notional cap, a reserve target and a fee floor no lower; but
// on a custody-blind pool a borrowed token's target caps the buffer its refill holds in custody
// (`FLAMMBlindLib.refillBuffer`), so there a cut is the tightening and a raise the loosening
bool buffer = cur.partner != FLAMMStore.NO_PARTNER && $.features & FLAMMStore.CUSTODY_BLIND != 0;
bool tight = bandWad <= cur.swapPriceBandWad && FLAMMStore.tighter(maxSwapNotional, cur.maxSwapNotional)
&& (buffer ? reserveTarget <= cur.reserveTarget : reserveTarget >= cur.reserveTarget)
&& feeFloorWad >= cur.feeFloorWad;
if (guardian && !tight) revert GuardianMayOnlyTighten();
if (bandWad > $.bandCeilingWad) revert CeilingBreached();
// A cheap-lane pool's cheap fills honour token 1's notional cap alone, so it takes none on the pool asset;
// every loosening of a token's policy waits its delay there. On any other pool a cut of a token's fee floor
// waits it, the pool asset's aside.
if (t == 0 && maxSwapNotional != 0 && $.swapBits & FLAMMStore.SWAP_LANE != 0) revert InvalidConfig();
bytes memory data = abi.encode(SET_TOKEN_CONFIG, t, bandWad, feeFloorWad, maxSwapNotional, reserveTarget);
if (
$.swapBits & FLAMMStore.SWAP_LANE != 0
? _waits($, false, tight, data)
: t != 0
&& FLAMMLane.scheduledCut(
$, keccak256(abi.encode(SET_TOKEN_CONFIG, t)), feeFloorWad >= cur.feeFloorWad, data
) != 0
) return;
bool wider = bandWad > cur.swapPriceBandWad;
cur.swapPriceBandWad = bandWad;
// a wider band keeps every live pair of the token at an LTV its covers cannot raise past its cap
if (wider) FLAMMQuoteLib.pinsWithinBand($, t);
cur.feeFloorWad = feeFloorWad;
cur.maxSwapNotional = uint128(maxSwapNotional);
cur.reserveTarget = uint128(reserveTarget);
if (t == 0) _poolAssetBits($, maxSwapNotional != 0, cur.minSupplyBatch);
else if (t == 1 && $.swapBits & FLAMMStore.SWAP_LANE != 0) {
$.laneConfig = uint128($.laneConfig) | (maxSwapNotional << FLAMMStore.LANE_NOTIONAL_SHIFT);
}
emit TokenConfigSet(t, bandWad, feeFloorWad, maxSwapNotional, reserveTarget);
}
/// @notice Token `t`'s minimum supply batch, native units: a swap lends once its custody exceeds the reserve target
/// by at least this much, and then lends all of the excess. While it is set, a payout the token cannot
/// borrow also withdraws back up to the reserve target, and a pro-rata supply leg under it stays in (or is
/// paid from) custody, unless its venue refuses the leg's action now, or, for an exit, the token backs a
/// debt (custody of it is backing) or that venue cuts its supply (the slice leaves at face). Zero lends
/// every surplus; the maximum lends none and refills none, as the pool asset's is at birth. The guardian
/// may only raise it; on a pool whose cheap lane is on the curator's cut waits the pool's delay
/// (`FLAMMLane.capDue`). Where a venue holding a minimum position (`CAP_HELD_REPAY`) lends `t`, a batch of
/// at least that minimum and the lenders' rounding (`MMRouterLib.RELEASE_SLACK`) keeps every smaller supply
/// leg in custody, so an entry whose leg would leave that venue under its minimum, which its preview
/// refuses, enters instead (`FLAMMMaxima.maxDepositProRata`).
/// @dev A larger batch lends less often and never more (the maximum lends nothing and stops the refills a market
/// short of cash would refuse), so the guardian may only raise it.
function setMinSupplyBatch(uint8 t, uint128 batch) public nonReentrant {
FLAMMStore.S storage $ = FLAMMStore.s();
bool guardian = FLAMMStore.curatorOrGuardian($);
FLAMMStore.checkToken($, t);
FLAMMStore.TokenCfg storage cur = $.tokens[t];
if (_waits($, guardian, batch >= cur.minSupplyBatch, abi.encode(SET_MIN_SUPPLY_BATCH, t, batch))) return;
cur.minSupplyBatch = batch;
if (t == 0) _poolAssetBits($, cur.maxSwapNotional != 0, batch);
emit MinSupplyBatchSet(t, batch);
}
/// @dev The pool asset's bits a swap reads instead of its record: its notional cap set, its batch under the
/// maximum. The pool's other bits are kept.
function _poolAssetBits(FLAMMStore.S storage $, bool capped, uint128 batch) private {
uint8 bits = $.poolBits & ~(FLAMMStore.POOL_ASSET_CAPPED | FLAMMStore.POOL_ASSET_LENDS);
if (capped) bits |= FLAMMStore.POOL_ASSET_CAPPED;
if (batch != type(uint128).max) bits |= FLAMMStore.POOL_ASSET_LENDS;
$.poolBits = bits;
}
/// @notice The Router's supply cap on token `t` (zero: none); the guardian may only tighten it.
/// @dev The Router's supply cap on token `t`, across every venue lending it; the guardian may only tighten it.
function setTokenSupplyCap(uint8 t, uint128 cap) public nonReentrant {
FLAMMStore.S storage $ = FLAMMStore.s();
bool guardian = FLAMMStore.curatorOrGuardian($);
IMMRouter r = $.router;
bool tight = FLAMMStore.tighter(cap, r.token(address(this), t).supplyCap);
if (_waits($, guardian, tight, abi.encode(SET_TOKEN_SUPPLY_CAP, t, cap))) return;
r.setTokenSupplyCap(t, cap);
}
/// @notice The pool's fee floor and its cap, the cap under the committed ceiling and at or above every floor in
/// force. On a pool whose cheap lane is off a cut of the floor waits the pool's delay as an admission
/// (`FLAMMLane.scheduledCut`, one cut at a time): the first call schedules it (`AdmissionScheduled`),
/// replacing the cut scheduled before; the identical call applies it from its due time until one delay
/// later, past which it lapses; a call with a floor no lower applies at once, the cap's cut or raise
/// included, and drops it; the curator or the guardian cancels it (`cancel`). A due cut stays armed for its
/// whole window, so LPs act on its scheduling event (`AdmissionScheduled`), not on the wait itself. On a
/// pool whose cheap lane is on every call applies at once.
/// @dev The cap may not undercut any token's fee floor, which would wedge `setTokenConfig`, nor pass its committed
/// ceiling ({setBandAndFeeCeilings}). On a pool whose cheap lane is off a cut of the pool's floor waits
/// the pool's delay (`FLAMMLane.scheduledCut`, keyed by this setter's selector alone, so one cut stands at a
/// time and every call with a floor no lower applies at once and drops it); the cap moves at once, down to the
/// floors in force. On a cheap-lane pool every call applies at once.
function setFeeBounds(uint64 floorWad, uint64 capWad) public onlyCurator nonReentrant {
FLAMMStore.S storage $ = FLAMMStore.s();
if (floorWad > capWad || capWad > WAD) revert InvalidConfig();
uint256 n = $.tokenCount;
for (uint256 t; t < n; ++t) {
if ($.tokens[t].feeFloorWad > capWad) revert InvalidConfig();
}
if (capWad > $.feeCapCeilingWad) revert CeilingBreached();
if (
$.swapBits & FLAMMStore.SWAP_LANE == 0
&& FLAMMLane.scheduledCut(
$, bytes32(SET_FEE_BOUNDS), floorWad >= $.feeFloorWad, abi.encode(SET_FEE_BOUNDS, floorWad, capWad)
) != 0
) return;
$.feeFloorWad = floorWad;
$.feeCapWad = capWad;
emit FeeBoundsSet(floorWad, capWad);
}
// ------------------------------------------------------------------ pairs
/// @notice Pair `pair`'s debt cap across its venues (zero: uncapped) and its borrow switch; the guardian may only
/// tighten. With no market band every switch stays off (`setMarketBand`).
/// @dev Pair `p`'s debt cap across its venues (zero: uncapped) and its borrow switch at the Router, the pool's
/// mirror following. `guardian`: the caller is the guardian, who may only tighten each. With no market band
/// every switch stays off.
function setPairCaps(uint8 p, uint128 debtCap, bool borrowEnabled) public nonReentrant {
FLAMMStore.S storage $ = FLAMMStore.s();
bool guardian = FLAMMStore.curatorOrGuardian($);
FLAMMStore.checkPair($, p);
IMMRouter r = $.router;
IMMRouter.PairView memory v = r.pair(address(this), p);
bool tight = FLAMMStore.tighter(debtCap, v.debtCap) && !(borrowEnabled && !v.borrowEnabled);
if (_waits($, guardian, tight, abi.encode(SET_PAIR_CAPS, p, debtCap, borrowEnabled))) return;
if (borrowEnabled && $.noBand) revert InvalidConfig();
r.setPairCaps(p, debtCap, borrowEnabled);
$.pairs[p].borrowOff = !borrowEnabled;
FLAMMOpsLib.syncLanes($);
}
/// @notice Pair `pair`'s venue-oracle band at the Router, which its borrows, priced releases, refinances and venue
/// admissions check the venue's oracle against (but on a pool with no market band, which reads no price),
/// and while it is on `maintainCollateral` prices the pair's venues at their oracle where that is lower and
/// custody can still bring the venue under its threshold there; zero turns it off and no venue oracle is
/// read. The curator sets any value the Router admits; the guardian may only tighten: turn it on, or narrow
/// it. On a pool whose cheap lane is on the curator's widening, or turning it off, waits the pool's delay
/// (`FLAMMLane.capDue`).
/// @dev Pair `p`'s venue-oracle band at the Router, which its borrows, priced releases, refinances and venue
/// admissions check the venue's oracle against; zero turns it off. `guardian`: the caller is the guardian,
/// who may only tighten it (turn it on, or narrow it).
function setOracleBand(uint8 p, uint64 bandWad) public nonReentrant {
FLAMMStore.S storage $ = FLAMMStore.s();
bool guardian = FLAMMStore.curatorOrGuardian($);
IMMRouter r = $.router;
bool tight = FLAMMStore.tighter(bandWad, r.pair(address(this), p).oracleBandWad);
if (_waits($, guardian, tight, abi.encode(SET_ORACLE_BAND, p, bandWad))) return;
r.setOracleBand(p, bandWad);
}
/// @notice How many tokens the Router lets the pool owe at once; the guardian may only lower it, and on a pool
/// whose cheap lane is on the curator's raise waits the pool's delay (`FLAMMLane.capDue`).
/// @dev The Router's drawn-set size, which the pool mirrors for its swaps' draw rule; the guardian may only lower
/// it.
function setMaxDrawnTokens(uint8 n) public nonReentrant {
FLAMMStore.S storage $ = FLAMMStore.s();
bool guardian = FLAMMStore.curatorOrGuardian($);
IMMRouter r = $.router;
if (_waits($, guardian, n <= r.maxDrawnTokens(address(this)), abi.encode(SET_MAX_DRAWN_TOKENS, n))) return;
r.setMaxDrawnTokens(n);
$.maxDrawnTokens = n;
}
/// @notice A venue's borrow and supply switches; the guardian may only switch them off, and on a pool whose cheap
/// lane is on the curator's switch-on waits the pool's delay (`FLAMMLane.capDue`).
/// @dev A venue's borrow and supply switches at the Router. `guardian`: the caller is the guardian, who may only
/// switch them off. Borrowing switched on keeps the larger of the pair's gap and 1 % over the pin: the
/// Router holds the gap first, then `FLAMMGateLib.requireDustGap` the 1 %.
function setVenueFlags(uint16 id, bool borrowEnabled, bool supplyEnabled) public nonReentrant {
FLAMMStore.S storage $ = FLAMMStore.s();
bool guardian = FLAMMStore.curatorOrGuardian($);
IMMRouter r = $.router;
IMMRouter.VenueView memory v = r.venue(address(this), id);
bool on = borrowEnabled && !v.borrowEnabled;
bool tight = !on && !(supplyEnabled && !v.supplyEnabled);
if (_waits($, guardian, tight, abi.encode(SET_VENUE_FLAGS, id, borrowEnabled, supplyEnabled))) return;
r.setVenueFlags(id, borrowEnabled, supplyEnabled);
if (on) FLAMMGateLib.requireDustGap($, v.pair, v.lltvWad);
}
/// @notice A venue's debt and supply caps and its borrow-rate ceiling (zero: uncapped); the guardian may only
/// tighten each.
/// @dev A venue's debt and supply caps and its borrow-rate ceiling at the Router (zero: uncapped). `guardian`:
/// the caller is the guardian, who may only tighten each.
function setVenueCaps(uint16 id, uint128 debtCap, uint128 supplyCap, uint64 maxBorrowRateWad) public nonReentrant {
FLAMMStore.S storage $ = FLAMMStore.s();
bool guardian = FLAMMStore.curatorOrGuardian($);
IMMRouter r = $.router;
IMMRouter.VenueView memory v = r.venue(address(this), id);
bool tight = FLAMMStore.tighter(debtCap, v.debtCap) && FLAMMStore.tighter(supplyCap, v.supplyCap)
&& FLAMMStore.tighter(maxBorrowRateWad, v.maxBorrowRateWad);
if (_waits($, guardian, tight, abi.encode(SET_VENUE_CAPS, id, debtCap, supplyCap, maxBorrowRateWad))) return;
r.setVenueCaps(id, debtCap, supplyCap, maxBorrowRateWad);
}
/// @notice Move pair `pair`'s two dials at once (keeper or curator): each inside its envelope, a credit past
/// `1 / (1 + band)` of the pair's tokens as the band stands stored at that cap (never below the envelope's
/// floor; the dial stores and logs the cap), a higher LTV step-limited and a lower one not, the pair's
/// cooldown, which a lower LTV that raises neither dial skips while a lender's cut stands over the pair's
/// pin; an LTV raised or kept lands at least the larger of the pair's gap and 1 % under the binding
/// threshold, and a lower one there too, at or over the threshold, or at the envelope's floor
/// (`LtvLltvGap`); the Router pin follows the LTV.
/// @dev Pair `p`'s two dials, its pin following ({FLAMMGateLib.validateDialMove}). On a pool that lists a venue
/// whose kind reports a loss, a lower LTV is refused (`VenueReportsLoss`) while a venue of the pair, or of a
/// frame one of them shares, reports a loss on its collateral of `FLAMMStore.LOSS_MOVE_FLOOR` or more, or
/// takes a redemption fee of any size on it (`FLAMMKeptLib.lossAtPair`), unless a lender's cut stands over the
/// pin and the LTV lands no lower than the gap under the lender's threshold; a raise, and any move at a pair
/// with no such venue, is untouched. That cut is read pair-wide, at the lowest threshold of the pair's venues
/// (`IMMRouter.minLltv`): a lender's cut at one venue lets the keeper and the operator lower the pin, to the
/// gap under that threshold, while an owing fee venue of the same pair stands, and the collateral maintainer
/// then posts into the fee venue back to that pin, paying the fee. With no such cut, while any fee stands at a
/// live fee venue of the pair or of a frame mate, the LTV dial is raise-only for the keeper and the operator,
/// even where that venue owes nothing, and the cure under a fee is a repay (a buy's, a flush, an emergency
/// `Repay`), which pays no fee; only a repay that clears the venue's whole debt frees the exits' stall there
/// (`FLAMMFlowLib.redeem`). A taker's draw at a pair one of whose venues that borrows stands under a fee is
/// refused (`FLAMMSettleLib`). What still posts custody into a fee venue under a fee: the operator's emergency
/// `TopUp` at one that owes (`FLAMMMaintainLib.emergency`); the collateral maintainer's post back to the pin
/// (`FLAMMTopUpLib.maintainCollateral`), which the pin and the pair's venue-oracle band size: switched on
/// (`setOracleBand`, at once for the operator and the guardian) the band prices that post at the venue's
/// oracle where that is lower and custody can still bring the venue under its threshold there, so it posts
/// more; and an entry's restoring leg (`FLAMMFlowLib.proRata`). An entry's pro-rata post and borrow also reach
/// an owing fee venue, and an exit of those shares is paid from custody; a custody-blind refill's borrow at a
/// fee venue that needs no new post lands too.
function setDials(uint8 p, uint64 phiWad, uint64 ltvWad) public keeperOrCurator nonReentrant {
FLAMMStore.S storage $ = FLAMMStore.s();
FLAMMStore.checkPair($, p);
FLAMMStore.PairCfg storage pc = $.pairs[p];
if ($.features & FLAMMStore.LOSS_MARKS != 0) {
// a reading of the loss marks, witnessed where a plain key's own transaction calls and one is due
FLAMMKeptLib.recordLossMarks();
// The collateral maintainer, which anyone calls, posts custody at a venue back to its pair's pin: a pin
// lowered while a venue it would post at reports a loss on its collateral, or takes a redemption fee on
// it, would size that post, and NAV fall by the loss's or the fee's share of it. So no lowering there,
// but under a lender's cut that stands over the pin (a threshold under the pin plus the gap, as the
// cooldown's exception reads it), and then no lower than the gap under that threshold; none where the
// threshold reads zero, as a lender's frozen or unreadable reserve answers, which would let the pin fall
// to its floor.
if (ltvWad < pc.ltvWad && FLAMMKeptLib.lossAtPair(p)) {
IMMRouter r = $.router;
(uint256 lltv, uint256 gap) = (r.minLltv(address(this), p), r.pair(address(this), p).safetyGapWad);
if (gap < FLAMMStore.MIN_DUST_GAP_WAD) gap = FLAMMStore.MIN_DUST_GAP_WAD;
if (lltv == 0 || lltv >= uint256(pc.ltvWad) + gap || uint256(ltvWad) + gap < lltv) {
revert VenueReportsLoss();
}
}
}
// a credit inside the envelope stored at most at what a fill inside the pair's band guarantees an input is
// worth, as the band stands, and never below the envelope's floor
uint256 cap = Math.max(FLAMMStore.creditCap($, pc.coll, pc.debt), pc.phiMinWad);
if (phiWad > cap && phiWad <= pc.phiMaxWad) phiWad = uint64(cap);
FLAMMGateLib.validateDialMove($, p, phiWad, ltvWad);
(pc.phiWad, pc.ltvWad, pc.lastDialMoveTs) = (phiWad, ltvWad, uint48(block.timestamp));
$.router.setPin(p, ltvWad);
emit DialsSet(p, phiWad, ltvWad, msg.sender);
}
// ------------------------------------------------------------------ the committed ceilings
/// @notice The committed ceilings: the widest swap band any token may take and the highest fee cap, under which the
/// curator moves each at once (`setTokenConfig`, `setFeeBounds`); a pool is born with its widest band and
/// its cap as its ceilings. A cut, or the ceilings as they stand, applies at once and clears a scheduled
/// raise; a raise (either ceiling higher) is scheduled for `governanceDelaySec`, and one of the band's for
/// at least `FLAMMStore.MIN_BAND_DELAY_SEC`, replacing one already scheduled, and the identical call
/// applies it once due; a due raise does not lapse. The guardian's only form is the ceilings as they stand,
/// which cancels a scheduled raise. The band's ceiling may be `FLAMMStore.NO_BAND_CEILING`, wider than any
/// band: the only one under which `setMarketBand` drops the band, and the one a pool born with none has.
/// @dev The widest swap band any token may take, in (0, MAX] or
/// `FLAMMStore.NO_BAND_CEILING`, which also lets the market band go, and the highest fee cap. A cut, or the
/// ceilings as they stand, applies at once and clears a scheduled raise; a raise (either ceiling higher) is
/// scheduled for `governanceDelaySec`, one of the band's for at least `FLAMMStore.MIN_BAND_DELAY_SEC`,
/// replacing one already scheduled, and the identical call applies it once due. What applies must hold the
/// fee cap and every band standing (`CeilingBreached`), a pool with no band only under the ceiling that
/// admits none. `guardian`: the caller is the guardian, whose only form is the ceilings as they stand.
function setBandAndFeeCeilings(uint64 bandWad, uint64 feeCapWad) public nonReentrant {
FLAMMStore.S storage $ = FLAMMStore.s();
bool guardian = FLAMMStore.curatorOrGuardian($);
if (
bandWad == 0 || (bandWad > FLAMMStore.MAX_SWAP_PRICE_BAND_WAD && bandWad != FLAMMStore.NO_BAND_CEILING)
|| feeCapWad > WAD
) revert InvalidConfig();
(uint64 band, uint64 cap) = ($.bandCeilingWad, $.feeCapCeilingWad);
if (guardian && (bandWad != band || feeCapWad != cap)) revert NotCurator();
if (bandWad > band || feeCapWad > cap) {
if (bandWad != $.pendingBandCeilingWad || feeCapWad != $.pendingFeeCapCeilingWad) {
uint256 delay = $.governanceDelaySec;
if (bandWad > band && delay < FLAMMStore.MIN_BAND_DELAY_SEC) delay = FLAMMStore.MIN_BAND_DELAY_SEC;
uint48 due = uint48(block.timestamp + delay);
($.pendingBandCeilingWad, $.pendingFeeCapCeilingWad, $.ceilingsExecutableAt) = (bandWad, feeCapWad, due);
emit CeilingsScheduled(bandWad, feeCapWad, due);
return;
}
if (block.timestamp < $.ceilingsExecutableAt) revert HookSetNotReady();
}
// No band is the widest: only the ceiling that admits none holds a pool without one.
if ($.feeCapWad > feeCapWad || ($.noBand && bandWad != FLAMMStore.NO_BAND_CEILING)) revert CeilingBreached();
uint256 n = $.tokenCount;
for (uint256 t; t < n; ++t) {
if ($.tokens[t].swapPriceBandWad > bandWad) revert CeilingBreached();
}
($.bandCeilingWad, $.feeCapCeilingWad) = (bandWad, feeCapWad);
($.pendingBandCeilingWad, $.pendingFeeCapCeilingWad, $.ceilingsExecutableAt) = (0, 0, 0);
emit CeilingsSet(bandWad, feeCapWad, msg.sender);
}
// ------------------------------------------------------------------ the trade masks
/// @notice The curator's trade mask, as `tradablePairs` lays it out; its closings apply at once, always. One that
/// opens no pair applies whole and clears a scheduled opening; one that opens a pair closes what it closes
/// now and waits `governanceDelaySec` for the rest, replacing one already scheduled, and anyone applies it
/// then ({executeTradePairs}). The guardian may only close. A closed pair stops its swaps at once; credit
/// pairs (`FLAMMAdmitLib.addPair`) are apart.
/// @dev The curator's trade mask, whose closings apply at once, always. One that opens no
/// pair applies at once whole and clears a scheduled opening; one that opens a pair closes what it closes
/// now and is scheduled for `governanceDelaySec`, replacing one already scheduled, and applies whole once
/// due ({executeTradePairs}). `guardian`: the caller is the guardian, who may only close.
function setTradePairs(uint256 mask) public nonReentrant {
FLAMMStore.S storage $ = FLAMMStore.s();
bool guardian = FLAMMStore.curatorOrGuardian($);
uint256 cur = $.tradePairs;
uint256 kept = $.swapBits & FLAMMStore.SWAP_FENCE != 0 ? $.fenceTrades : 0;
if (mask & ~(cur | kept) == 0) return FLAMMAdmitLib.setTradeMask($, mask);
if (guardian) revert GuardianMayOnlyTighten();
if (cur & ~mask != 0) {
$.tradePairs = cur & mask;
FLAMMAdmitLib.syncSwapBits($, $.hookPairs, cur & mask);
emit TradePairsSet(cur & mask, msg.sender);
}
if (kept & ~mask != 0) $.fenceTrades = kept & mask;
uint48 due = uint48(block.timestamp + $.governanceDelaySec);
($.pendingTradePairs, $.tradePairsExecutableAt) = (mask, due);
emit TradePairsScheduled(mask, due);
}
/// @notice Applies the curator's scheduled trade mask once due; permissionless.
/// @dev Applies the scheduled mask once due; anyone.
function executeTradePairs() public nonReentrant {
FLAMMStore.S storage $ = FLAMMStore.s();
uint48 due = $.tradePairsExecutableAt;
if (due == 0) revert NotScheduled();
if (block.timestamp < due) revert HookSetNotReady();
FLAMMAdmitLib.setTradeMask($, $.pendingTradePairs);
}
/// @notice Drops the curator's scheduled trade mask; the curator's or the guardian's.
/// @dev Drops the scheduled mask; the curator's or the guardian's.
function cancelTradePairs() public curatorOrGuardian nonReentrant {
FLAMMStore.S storage $ = FLAMMStore.s();
if ($.tradePairsExecutableAt == 0) revert NotScheduled();
($.pendingTradePairs, $.tradePairsExecutableAt) = (0, 0);
emit TradePairsCancelled(msg.sender);
}
/// @dev The collateral reserve's setter, which keys a cheap-lane pool's delayed rule in the pending table
/// (`FLAMMLane.capDue`).
bytes4 internal constant SET_COLLATERAL_RESERVE = bytes4(keccak256("setCollateralReserve(uint8,uint16,uint128)"));
// ------------------------------------------------------------------ collateral reserves
/// @notice Token `t`'s collateral reserve rule, for a lender that pays on collateral: while `reserve` is set, a
/// release of `t` refills its custody only up to it, once custody is a tenth of it short, so collateral
/// above the posting law stays posted wherever it is. The venue must be live, its collateral `t` and
/// accruing (`CAP_ACCRUING_COLLATERAL`), and it retires only once the rule is off. Zero is the rule off;
/// the guardian may only switch it off, and on a pool whose cheap lane is on the curator's rule waits the
/// pool's delay (`FLAMMLane.capDue`), which switching it off drops.
/// @dev Token `t`'s collateral reserve rule: while `reserve` is set, a release of `t` refills its custody only up
/// to it and leaves the rest posted. The rule names venue `venueId`, whose collateral must be `t` and accrue
/// (`CAP_ACCRUING_COLLATERAL`): keeping it posted pays nothing otherwise. Switching the rule off returns the
/// idle collateral from the lender at the next due release, so it is the guardian's only move.
function setCollateralReserve(uint8 t, uint16 venueId, uint128 reserve) public nonReentrant {
FLAMMStore.S storage $ = FLAMMStore.s();
bool guardian = FLAMMStore.curatorOrGuardian($);
FLAMMStore.checkToken($, t);
if (reserve == 0) {
venueId = 0;
} else {
if (guardian) revert GuardianMayOnlyTighten();
IMMRouter.VenueView memory v = $.router.venue(address(this), venueId);
if (v.status & VENUE_RETIRED != 0) revert IMMRouter.VenueIsRetired();
if (v.status != 0) revert IMMRouter.VenueIsFenced();
if (v.coll != t || IFinancingAccount(v.account).capabilities() & CAP_ACCRUING_COLLATERAL == 0) {
revert InvalidConfig();
}
}
// a rule set is a loosening: on a pool whose cheap lane is on the curator's waits the pool's delay, and the
// rule off applies at once and drops it
if (FLAMMLane.capDue($, reserve == 0, abi.encode(SET_COLLATERAL_RESERVE, t, venueId, reserve)) != 0) return;
$.reserves[t] = FLAMMStore.CollateralReserve(reserve, venueId);
bool on;
uint256 n = $.tokenCount;
for (uint256 i; i < n && !on; ++i) {
on = $.reserves[i].reserve != 0;
}
uint8 bits = $.poolBits & ~FLAMMStore.POOL_RESERVE_ON;
$.poolBits = on ? bits | FLAMMStore.POOL_RESERVE_ON : bits;
emit CollateralReserveSet(t, venueId, reserve);
}
}
Compiler settingsShow
{
"viaIR": true,
"metadata": {
"appendCBOR": true,
"bytecodeHash": "ipfs",
"useLiteralContent": false
},
"libraries": {
"src/core/mm/MMRouterLib.sol": {
"MMRouterLib": "0xA4749766934833DfBeaF4Fc0d79c150A1Dd2B4E5"
},
"src/core/flamm/FLAMMLane.sol": {
"FLAMMLane": "0x0988077AB06F1efd8cFa3f08FC60CAf3e6d22e98"
},
"src/core/flamm/FLAMMRoute.sol": {
"FLAMMRoute": "0x312ee92ecd113F925dD513d450b062C8740fDaA9"
},
"src/periphery/FLAMMMaxima.sol": {
"FLAMMMaxima": "0x4A997343D91c981BF63274fc222AA96D32d6259c"
},
"src/core/flamm/FLAMMLawLib.sol": {
"FLAMMLawLib": "0x5D473B15E032756Cd81fc66B8F1e9BE2f427cc62"
},
"src/core/flamm/FLAMMOpsLib.sol": {
"FLAMMOpsLib": "0x0BFe60fB1f5223F1A2b7B02Ef18f5C33fb043753"
},
"src/core/mm/AaveV3ReadsLib.sol": {
"AaveV3ReadsLib": "0xD53F6170226A74D453e84414Ffc2FFcE5ded5983"
},
"src/core/flamm/FLAMMFlowLib.sol": {
"FLAMMFlowLib": "0x2577D707D41209489b2EF53101a4f6baDd4E3473"
},
"src/core/flamm/FLAMMGateLib.sol": {
"FLAMMGateLib": "0xF0BE115A2D6F27274F2e9EE50B89Ed42db2B9555"
},
"src/core/flamm/FLAMMKeptLib.sol": {
"FLAMMKeptLib": "0x7a11899232dd9F17c28bF062Ec2ee2267158517b"
},
"src/core/mm/CTokenMarketLib.sol": {
"CTokenMarketLib": "0x18c53F2aCAbcDEEdb575A136f49fa4C43EB2071c"
},
"src/core/flamm/FLAMMAdmitLib.sol": {
"FLAMMAdmitLib": "0xA6dBD8cD5Cd10F8a5857cbeD54a28405ffbDcBCb"
},
"src/core/flamm/FLAMMBlindLib.sol": {
"FLAMMBlindLib": "0x0b8d436F1a7AE25C5d16955ed4CDa781E42e7E5C"
},
"src/core/flamm/FLAMMClaimLib.sol": {
"FLAMMClaimLib": "0x02b4354a56630ab165A880B1198a603E62731cCE"
},
"src/core/flamm/FLAMMFenceLib.sol": {
"FLAMMFenceLib": "0xA16ddA83f47a42F875f141b6954595D584a201e8"
},
"src/core/flamm/FLAMMFloatLib.sol": {
"FLAMMFloatLib": "0x539EfC2b17cF0fdF254AAaB925b3A7c360A79737"
},
"src/core/flamm/FLAMMQuoteLib.sol": {
"FLAMMQuoteLib": "0xa4D34f4882a529574840881e755BCFae2bd5ce2e"
},
"src/core/flamm/FLAMMTopUpLib.sol": {
"FLAMMTopUpLib": "0x7C55a535Ce298b1e5e6d00F645088F777ad233DF"
},
"src/core/mm/CTokenRewardsLib.sol": {
"CTokenRewardsLib": "0xcda63d7eCCF838F2732Bff676706BDE5abA4DcF7"
},
"src/core/mm/MMRouterAdminLib.sol": {
"MMRouterAdminLib": "0x8423744b3F304ED0B43043d7ad4E7d8A247aDc96"
},
"src/core/flamm/FLAMMPolicyLib.sol": {
"FLAMMPolicyLib": "0xa6B495B2BdcDcf4F327844d9aaA0eD4C550c67F9"
},
"src/core/flamm/FLAMMSettleLib.sol": {
"FLAMMSettleLib": "0xB4890a27205505BDAA05717B6c3aB38b2dd3C7Cb"
},
"src/core/flamm/FLAMMSharedLib.sol": {
"FLAMMSharedLib": "0xFaAEd38962aEb6c282Ac36E0cdE9313AbA2511ba"
},
"src/periphery/FLAMMExitMaxima.sol": {
"FLAMMExitMaxima": "0x480f51866554e92649c9d3502bA31AA4234e0a81"
},
"src/hooks/everlong/LeverageLib.sol": {
"LeverageLib": "0x1B1D1C42d26c169dB59D8681d0FD4C9a2840Ad11"
},
"src/core/flamm/FLAMMMaintainLib.sol": {
"FLAMMMaintainLib": "0x94998f13fc5d5D2271c90b835c6a805dad409cC2"
},
"src/core/flamm/FLAMMPairQuoteLib.sol": {
"FLAMMPairQuoteLib": "0x077523D1427aE408105fe8592F907ECDa0D94cbE"
},
"src/hooks/everlong/EverlongOpsLib.sol": {
"EverlongOpsLib": "0xAbe4447C954E3C7a405f8E75116BF9f5787426F7"
}
},
"optimizer": {
"runs": 100,
"enabled": true
},
"viaSSACFG": false,
"evmVersion": "cancun",
"remappings": [
"@openzeppelin/contracts/=lib/openzeppelin-contracts-compat/contracts/",
"@openzeppelin/contracts-upgradeable/=lib/openzeppelin-contracts-upgradeable-compat/contracts/",
"solady/=lib/solady/src/",
"forge-std/=lib/forge-std/src/"
],
"experimental": false
}Source code and metadata: Sourcify.
The source code belongs to the authors of the contract.