Verified contractPartialUNLICENSED
LotusSwapRouterRegistry
Address0xc88e7b34c139e9cb7b59fd26bd96f4cb9fb7a878
- Balance
0 ETH
- Transactions
2
- Compiler
solc 0.8.28
- Same code
Only this contract
Details
- Compiler
- solc 0.8.28+commit.7893614a
- Language
- solidity
- Optimization
- Yes, 200 runs
- EVM version
- cancun
- Via IR
- yes
- License
- UNLICENSED
- Match
- Partialcreation code: yes, runtime code: yes
- Verified on Sourcify
- Created in block
- 26,436,559
- Creation transaction
- 0x6fd741263d…dfd432b4a3
6 files
src/bundler3/LotusSwapRouterRegistry.sol
// SPDX-License-Identifier: UNLICENSED
pragma solidity ^0.8.28;
import {Ownable} from "solady/src/auth/Ownable.sol";
import {LotusErrorsLib} from "../libraries/LotusErrorsLib.sol";
import {ILotusSwapRouterRegistry} from "./interfaces/ILotusSwapRouterRegistry.sol";
/// @title LotusSwapRouterRegistry
/// @notice Owner-managed whitelist of swap routers callable by the swap adapter.
/// @dev 1inch has no on-chain router registry, so target validation lives here. Whitelisting a router
/// exposes only funds in flight through the swap adapter, never standing user approvals.
contract LotusSwapRouterRegistry is ILotusSwapRouterRegistry, Ownable {
/* STORAGE */
/// @inheritdoc ILotusSwapRouterRegistry
mapping(address => bool) public override isWhitelistedRouter;
/* CONSTRUCTOR */
/// @param _owner The owner of the registry (typically Lotus multisig).
constructor(address _owner) {
_initializeOwner(_owner);
}
/* OWNER FUNCTIONS */
/// @inheritdoc ILotusSwapRouterRegistry
function setRouter(address router, bool whitelisted) external onlyOwner {
if (router == address(0)) revert LotusErrorsLib.ZeroAddress();
isWhitelistedRouter[router] = whitelisted;
emit RouterSet(router, whitelisted);
}
}
lib/solady/src/auth/Ownable.sol
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.4;
/// @notice Simple single owner authorization mixin.
/// @author Solady (https://github.com/vectorized/solady/blob/main/src/auth/Ownable.sol)
///
/// @dev Note:
/// This implementation does NOT auto-initialize the owner to `msg.sender`.
/// You MUST call the `_initializeOwner` in the constructor / initializer.
///
/// While the ownable portion follows
/// [EIP-173](https://eips.ethereum.org/EIPS/eip-173) for compatibility,
/// the nomenclature for the 2-step ownership handover may be unique to this codebase.
abstract contract Ownable {
/*´:°•.°+.*•´.*:˚.°*.˚•´.°:°•.°•.*•´.*:˚.°*.˚•´.°:°•.°+.*•´.*:*/
/* CUSTOM ERRORS */
/*.•°:°.´+˚.*°.˚:*.´•*.+°.•°:´*.´•*.•°.•°:°.´:•˚°.*°.˚:*.´+°.•*/
/// @dev The caller is not authorized to call the function.
error Unauthorized();
/// @dev The `newOwner` cannot be the zero address.
error NewOwnerIsZeroAddress();
/// @dev The `pendingOwner` does not have a valid handover request.
error NoHandoverRequest();
/// @dev Cannot double-initialize.
error AlreadyInitialized();
/*´:°•.°+.*•´.*:˚.°*.˚•´.°:°•.°•.*•´.*:˚.°*.˚•´.°:°•.°+.*•´.*:*/
/* EVENTS */
/*.•°:°.´+˚.*°.˚:*.´•*.+°.•°:´*.´•*.•°.•°:°.´:•˚°.*°.˚:*.´+°.•*/
/// @dev The ownership is transferred from `oldOwner` to `newOwner`.
/// This event is intentionally kept the same as OpenZeppelin's Ownable to be
/// compatible with indexers and [EIP-173](https://eips.ethereum.org/EIPS/eip-173),
/// despite it not being as lightweight as a single argument event.
event OwnershipTransferred(address indexed oldOwner, address indexed newOwner);
/// @dev An ownership handover to `pendingOwner` has been requested.
event OwnershipHandoverRequested(address indexed pendingOwner);
/// @dev The ownership handover to `pendingOwner` has been canceled.
event OwnershipHandoverCanceled(address indexed pendingOwner);
/// @dev `keccak256(bytes("OwnershipTransferred(address,address)"))`.
uint256 private constant _OWNERSHIP_TRANSFERRED_EVENT_SIGNATURE =
0x8be0079c531659141344cd1fd0a4f28419497f9722a3daafe3b4186f6b6457e0;
/// @dev `keccak256(bytes("OwnershipHandoverRequested(address)"))`.
uint256 private constant _OWNERSHIP_HANDOVER_REQUESTED_EVENT_SIGNATURE =
0xdbf36a107da19e49527a7176a1babf963b4b0ff8cde35ee35d6cd8f1f9ac7e1d;
/// @dev `keccak256(bytes("OwnershipHandoverCanceled(address)"))`.
uint256 private constant _OWNERSHIP_HANDOVER_CANCELED_EVENT_SIGNATURE =
0xfa7b8eab7da67f412cc9575ed43464468f9bfbae89d1675917346ca6d8fe3c92;
/*´:°•.°+.*•´.*:˚.°*.˚•´.°:°•.°•.*•´.*:˚.°*.˚•´.°:°•.°+.*•´.*:*/
/* STORAGE */
/*.•°:°.´+˚.*°.˚:*.´•*.+°.•°:´*.´•*.•°.•°:°.´:•˚°.*°.˚:*.´+°.•*/
/// @dev The owner slot is given by:
/// `bytes32(~uint256(uint32(bytes4(keccak256("_OWNER_SLOT_NOT")))))`.
/// It is intentionally chosen to be a high value
/// to avoid collision with lower slots.
/// The choice of manual storage layout is to enable compatibility
/// with both regular and upgradeable contracts.
bytes32 internal constant _OWNER_SLOT =
0xffffffffffffffffffffffffffffffffffffffffffffffffffffffff74873927;
/// The ownership handover slot of `newOwner` is given by:
/// ```
/// mstore(0x00, or(shl(96, user), _HANDOVER_SLOT_SEED))
/// let handoverSlot := keccak256(0x00, 0x20)
/// ```
/// It stores the expiry timestamp of the two-step ownership handover.
uint256 private constant _HANDOVER_SLOT_SEED = 0x389a75e1;
/*´:°•.°+.*•´.*:˚.°*.˚•´.°:°•.°•.*•´.*:˚.°*.˚•´.°:°•.°+.*•´.*:*/
/* INTERNAL FUNCTIONS */
/*.•°:°.´+˚.*°.˚:*.´•*.+°.•°:´*.´•*.•°.•°:°.´:•˚°.*°.˚:*.´+°.•*/
/// @dev Override to return true to make `_initializeOwner` prevent double-initialization.
function _guardInitializeOwner() internal pure virtual returns (bool guard) {}
/// @dev Initializes the owner directly without authorization guard.
/// This function must be called upon initialization,
/// regardless of whether the contract is upgradeable or not.
/// This is to enable generalization to both regular and upgradeable contracts,
/// and to save gas in case the initial owner is not the caller.
/// For performance reasons, this function will not check if there
/// is an existing owner.
function _initializeOwner(address newOwner) internal virtual {
if (_guardInitializeOwner()) {
/// @solidity memory-safe-assembly
assembly {
let ownerSlot := _OWNER_SLOT
if sload(ownerSlot) {
mstore(0x00, 0x0dc149f0) // `AlreadyInitialized()`.
revert(0x1c, 0x04)
}
// Clean the upper 96 bits.
newOwner := shr(96, shl(96, newOwner))
// Store the new value.
sstore(ownerSlot, or(newOwner, shl(255, iszero(newOwner))))
// Emit the {OwnershipTransferred} event.
log3(0, 0, _OWNERSHIP_TRANSFERRED_EVENT_SIGNATURE, 0, newOwner)
}
} else {
/// @solidity memory-safe-assembly
assembly {
// Clean the upper 96 bits.
newOwner := shr(96, shl(96, newOwner))
// Store the new value.
sstore(_OWNER_SLOT, newOwner)
// Emit the {OwnershipTransferred} event.
log3(0, 0, _OWNERSHIP_TRANSFERRED_EVENT_SIGNATURE, 0, newOwner)
}
}
}
/// @dev Sets the owner directly without authorization guard.
function _setOwner(address newOwner) internal virtual {
if (_guardInitializeOwner()) {
/// @solidity memory-safe-assembly
assembly {
let ownerSlot := _OWNER_SLOT
// Clean the upper 96 bits.
newOwner := shr(96, shl(96, newOwner))
// Emit the {OwnershipTransferred} event.
log3(0, 0, _OWNERSHIP_TRANSFERRED_EVENT_SIGNATURE, sload(ownerSlot), newOwner)
// Store the new value.
sstore(ownerSlot, or(newOwner, shl(255, iszero(newOwner))))
}
} else {
/// @solidity memory-safe-assembly
assembly {
let ownerSlot := _OWNER_SLOT
// Clean the upper 96 bits.
newOwner := shr(96, shl(96, newOwner))
// Emit the {OwnershipTransferred} event.
log3(0, 0, _OWNERSHIP_TRANSFERRED_EVENT_SIGNATURE, sload(ownerSlot), newOwner)
// Store the new value.
sstore(ownerSlot, newOwner)
}
}
}
/// @dev Throws if the sender is not the owner.
function _checkOwner() internal view virtual {
/// @solidity memory-safe-assembly
assembly {
// If the caller is not the stored owner, revert.
if iszero(eq(caller(), sload(_OWNER_SLOT))) {
mstore(0x00, 0x82b42900) // `Unauthorized()`.
revert(0x1c, 0x04)
}
}
}
/// @dev Returns how long a two-step ownership handover is valid for in seconds.
/// Override to return a different value if needed.
/// Made internal to conserve bytecode. Wrap it in a public function if needed.
function _ownershipHandoverValidFor() internal view virtual returns (uint64) {
return 48 * 3600;
}
/*´:°•.°+.*•´.*:˚.°*.˚•´.°:°•.°•.*•´.*:˚.°*.˚•´.°:°•.°+.*•´.*:*/
/* PUBLIC UPDATE FUNCTIONS */
/*.•°:°.´+˚.*°.˚:*.´•*.+°.•°:´*.´•*.•°.•°:°.´:•˚°.*°.˚:*.´+°.•*/
/// @dev Allows the owner to transfer the ownership to `newOwner`.
function transferOwnership(address newOwner) public payable virtual onlyOwner {
/// @solidity memory-safe-assembly
assembly {
if iszero(shl(96, newOwner)) {
mstore(0x00, 0x7448fbae) // `NewOwnerIsZeroAddress()`.
revert(0x1c, 0x04)
}
}
_setOwner(newOwner);
}
/// @dev Allows the owner to renounce their ownership.
function renounceOwnership() public payable virtual onlyOwner {
_setOwner(address(0));
}
/// @dev Request a two-step ownership handover to the caller.
/// The request will automatically expire in 48 hours (172800 seconds) by default.
function requestOwnershipHandover() public payable virtual {
unchecked {
uint256 expires = block.timestamp + _ownershipHandoverValidFor();
/// @solidity memory-safe-assembly
assembly {
// Compute and set the handover slot to `expires`.
mstore(0x0c, _HANDOVER_SLOT_SEED)
mstore(0x00, caller())
sstore(keccak256(0x0c, 0x20), expires)
// Emit the {OwnershipHandoverRequested} event.
log2(0, 0, _OWNERSHIP_HANDOVER_REQUESTED_EVENT_SIGNATURE, caller())
}
}
}
/// @dev Cancels the two-step ownership handover to the caller, if any.
function cancelOwnershipHandover() public payable virtual {
/// @solidity memory-safe-assembly
assembly {
// Compute and set the handover slot to 0.
mstore(0x0c, _HANDOVER_SLOT_SEED)
mstore(0x00, caller())
sstore(keccak256(0x0c, 0x20), 0)
// Emit the {OwnershipHandoverCanceled} event.
log2(0, 0, _OWNERSHIP_HANDOVER_CANCELED_EVENT_SIGNATURE, caller())
}
}
/// @dev Allows the owner to complete the two-step ownership handover to `pendingOwner`.
/// Reverts if there is no existing ownership handover requested by `pendingOwner`.
function completeOwnershipHandover(address pendingOwner) public payable virtual onlyOwner {
/// @solidity memory-safe-assembly
assembly {
// Compute and set the handover slot to 0.
mstore(0x0c, _HANDOVER_SLOT_SEED)
mstore(0x00, pendingOwner)
let handoverSlot := keccak256(0x0c, 0x20)
// If the handover does not exist, or has expired.
if gt(timestamp(), sload(handoverSlot)) {
mstore(0x00, 0x6f5e8818) // `NoHandoverRequest()`.
revert(0x1c, 0x04)
}
// Set the handover slot to 0.
sstore(handoverSlot, 0)
}
_setOwner(pendingOwner);
}
/*´:°•.°+.*•´.*:˚.°*.˚•´.°:°•.°•.*•´.*:˚.°*.˚•´.°:°•.°+.*•´.*:*/
/* PUBLIC READ FUNCTIONS */
/*.•°:°.´+˚.*°.˚:*.´•*.+°.•°:´*.´•*.•°.•°:°.´:•˚°.*°.˚:*.´+°.•*/
/// @dev Returns the owner of the contract.
function owner() public view virtual returns (address result) {
/// @solidity memory-safe-assembly
assembly {
result := sload(_OWNER_SLOT)
}
}
/// @dev Returns the expiry timestamp for the two-step ownership handover to `pendingOwner`.
function ownershipHandoverExpiresAt(address pendingOwner)
public
view
virtual
returns (uint256 result)
{
/// @solidity memory-safe-assembly
assembly {
// Compute the handover slot.
mstore(0x0c, _HANDOVER_SLOT_SEED)
mstore(0x00, pendingOwner)
// Load the handover slot.
result := sload(keccak256(0x0c, 0x20))
}
}
/*´:°•.°+.*•´.*:˚.°*.˚•´.°:°•.°•.*•´.*:˚.°*.˚•´.°:°•.°+.*•´.*:*/
/* MODIFIERS */
/*.•°:°.´+˚.*°.˚:*.´•*.+°.•°:´*.´•*.•°.•°:°.´:•˚°.*°.˚:*.´+°.•*/
/// @dev Marks a function as only callable by the owner.
modifier onlyOwner() virtual {
_checkOwner();
_;
}
}
src/bundler3/interfaces/ILotusSwapRouterRegistry.sol
// SPDX-License-Identifier: UNLICENSED
pragma solidity ^0.8.28;
/// @title ILotusSwapRouterRegistry
/// @notice Interface for the owner-managed swap router whitelist.
interface ILotusSwapRouterRegistry {
/// @notice Emitted when a router's whitelist status changes.
/// @param router The router address.
/// @param whitelisted The new whitelist status.
event RouterSet(address indexed router, bool whitelisted);
/// @notice Returns whether `router` is an allowed swap target.
function isWhitelistedRouter(address router) external view returns (bool);
/// @notice Sets the whitelist status of a router.
/// @param router The router address.
/// @param whitelisted The new whitelist status.
function setRouter(address router, bool whitelisted) external;
}
src/interfaces/ILotus.sol
// SPDX-License-Identifier: UNLICENSED
pragma solidity ^0.8.28;
import {IRiskEngine} from "./IRiskEngine.sol";
type Id is bytes32;
/// @notice Core market parameters shared across all tranches.
struct MarketParams {
/// @notice Loan token shared across all tranches.
address loanToken;
/// @notice Risk engine for the market, shared across all tranches.
address riskEngine;
/// @notice Liquidation module for the market, shared across all tranches.
address liquidationModule;
/// @notice keccak256 hash of abi-encoded TrancheConfig array.
bytes32 trancheConfigsHash;
}
/// @notice Per-tranche configuration stored separately from core params.
struct TrancheConfig {
/// @notice Collateral token accepted by this tranche.
address collateralToken;
/// @notice Oracle used to price this tranche's collateral token.
address oracle;
/// @notice Liquidation loan-to-value threshold for this tranche, in wad.
uint128 lltv;
}
/// @notice Per-tranche user position state.
/// @dev Warning: The `supplyShares` for the protocol `feeRecipient` is accurate as of the last interest accrual.
struct Position {
/// @notice Supply shares for this tranche.
uint256 supplyShares;
/// @notice Borrow shares for this tranche.
uint128 borrowShares;
/// @notice Collateral amount for this tranche.
uint128 collateral;
}
/// @notice Aggregate accounting state for one market tranche.
/// @dev Warning: The `supplyAssets` and `borrowAssets` are accurate as of the last interest accrual.
/// @dev Warning: The `supplyShares` does not include supply shares to be issued to the `feeRecipient` during the next
/// interest accrual.
struct Tranche {
/// @notice Total amount of assets supplied at this tranche.
uint128 supplyAssets;
/// @notice Total supply shares for this tranche.
uint128 supplyShares;
/// @notice Total borrow assets for only the current tranche.
uint128 borrowAssets;
/// @notice Total borrow shares for only the current tranche.
uint128 borrowShares;
/// @notice Interest that has not yet been distributed to suppliers.
uint128 undistributedInterest;
/// @notice Protocol fee taken from interest accrued at this tranche.
uint64 fee;
/// @notice Last timestamp when interest was accrued for this tranche.
uint64 lastUpdate;
}
/// @notice EIP-712 authorization payload.
struct Authorization {
/// @notice Account granting or revoking authorization.
address authorizer;
/// @notice Account receiving or losing authorization.
address authorized;
/// @notice Whether authorization is granted or revoked.
bool isAuthorized;
/// @notice Authorizer nonce consumed by this payload.
uint256 nonce;
/// @notice Timestamp after which the signature is invalid.
uint256 deadline;
}
/// @notice ECDSA signature fields for EIP-712 authorization payloads.
struct Signature {
/// @notice ECDSA recovery id.
uint8 v;
/// @notice ECDSA r value.
bytes32 r;
/// @notice ECDSA s value.
bytes32 s;
}
/// @title ILotus
/// @notice Interface for the Lotus core lending protocol.
interface ILotus {
/// @return domainSeparator The EIP-712 domain separator for Lotus.
function DOMAIN_SEPARATOR() external view returns (bytes32 domainSeparator);
/* OWNER FUNCTIONS */
/// @notice The Lotus admin.
/// @dev Has the authority to set the `owner` and `feeRecipient`.
/// @dev Has the authority to set the `fee` on tranches.
/// @dev Has the authority to set per-token `flashLoanFee`s.
/// @dev Has the authority to enable new risk engines, LLTVs, and liquidation modules.
/// @return lotusOwner The current owner address.
function owner() external view returns (address lotusOwner);
/// @notice The Lotus fee recipient for all markets, tranches, and flash loans.
/// @dev The `feeRecipient` receives tranche fees during interest accrual via supply shares.
/// @return recipient The protocol fee recipient.
function feeRecipient() external view returns (address recipient);
/// @notice The Lotus flash loan fee for `token`, in WAD.
/// @param token The token to quote the configured flash loan fee for.
/// @return fee The flash loan fee rate applied to `token`.
function flashLoanFee(address token) external view returns (uint64 fee);
/// @notice Sets the Lotus admin.
/// @param newOwner The new Lotus admin.
function setOwner(address newOwner) external;
/// @notice Sets the protocol interest fee for a specific tranche in a market.
/// @param marketParams The market parameters.
/// @param trancheIndex The index of the tranche to set the fee for.
/// @param newFee The new fee to set.
/// @param riskEngineData The risk engine data to pass during interest accrual.
function setFee(
MarketParams memory marketParams,
uint256 trancheIndex,
uint64 newFee,
bytes calldata riskEngineData
) external;
/// @notice Sets the Lotus fee recipient.
/// @param newFeeRecipient The new Lotus fee recipient.
function setFeeRecipient(address newFeeRecipient) external;
/// @notice Sets the Lotus flash loan fee for `token`.
/// @param token The token to configure the flash loan fee for.
/// @param newFee The new flash loan fee, in WAD.
function setFlashLoanFee(address token, uint64 newFee) external;
/// @notice Enables `riskEngine` for Lotus markets.
/// @param riskEngine The risk engine to enable.
function enableRiskEngine(address riskEngine) external;
/// @notice Enables `lltv` for Lotus markets.
/// @param lltv The LLTV to enable.
function enableLltv(uint128 lltv) external;
/// @notice Enables `liquidationModule` for Lotus markets.
/// @param liquidationModule The liquidation module to enable.
function enableLiquidationModule(address liquidationModule) external;
/// @notice Enables a module manager who can enable risk engines and liquidation modules.
/// @param manager The module manager address.
function enableModuleManager(address manager) external;
/// @notice Disables a module manager.
/// @param manager The module manager address.
function disableModuleManager(address manager) external;
/// @notice Sets or clears the market hook configuration.
/// @param marketParams The market parameters (used to derive market id).
/// @param hook The hook contract address (zero address to disable hooks).
/// @param permissions The permissions bitmap indicating which hooks are implemented.
function setMarketHook(MarketParams memory marketParams, address hook, uint256 permissions) external;
/* PAUSE */
/// @notice Pauses or unpauses state-changing operations. Owner only.
/// @dev When `global` is true, applies to every market across the protocol and `marketParams`
/// is ignored. When `global` is false, applies to the single market identified by
/// `marketParams`; forbidden while globally paused. Unpausing (in either scope) records the
/// moment so the lazy per-market sync skips interest accrual over the pause window.
/// Interest from the last pre-pause interaction up to the pause is not captured by the lazy
/// sync. Operators who need that interest realized must call `accrueInterest` before pausing;
/// it cannot be recovered during a pause, because accrual reverts while paused, or after
/// unpause, because the sync skips directly to the unpause timestamp. This preserves
/// emergency-pause availability when accrual itself depends on a broken oracle or risk engine
/// and could revert.
/// @param marketParams The market parameters (ignored when `global` is true).
/// @param global Whether to set the global-pause flag (true) or the per-market flag (false).
/// @param paused The new pause state.
function setPaused(MarketParams memory marketParams, bool global, bool paused) external;
/* MARKET CREATION */
/// @notice Creates a new Lotus market.
/// @dev Lotus settlement assumes exact token receipt on inbound transfers.
/// @dev Do not configure fee-on-transfer or other transfer-shortfall loan or collateral tokens.
/// @dev `marketParams.trancheConfigsHash` is recomputed from `tranches`, returned, and used as input into the
/// market id calculation; any caller-supplied value is ignored.
/// @param marketParams The core market parameters (loan token, risk engine, liquidation module).
/// @param tranches The per-tranche configuration array.
/// @param riskEngineParams The parameters for the risk engine.
/// @param liquidationParams The parameters for the liquidation module.
/// @return id The id of the created market (derived from the recomputed `marketParams`).
/// @return trancheConfigsHash The tranche config hash recomputed from `tranches`.
function createMarket(
MarketParams memory marketParams,
TrancheConfig[] memory tranches,
bytes calldata riskEngineParams,
bytes calldata liquidationParams
) external returns (Id id, bytes32 trancheConfigsHash);
/* LENDER FUNCTIONS */
/// @notice Supplies assets to a specific tranche in the market.
/// @param marketParams The market parameters.
/// @param trancheIndex The index of the tranche to supply to.
/// @param assets The amount of assets to supply (use 0 if supplying by shares).
/// @param shares The amount of shares to supply (use 0 if supplying by assets).
/// @param onBehalf The address to supply on behalf of.
/// @param data Arbitrary data to pass to the callback (if any).
/// @param riskEngineData The risk engine data to pass during interest accrual.
/// @return suppliedAssets The actual amount of assets supplied.
/// @return suppliedShares The actual amount of shares supplied.
function supply(
MarketParams memory marketParams,
uint256 trancheIndex,
uint256 assets,
uint256 shares,
address onBehalf,
bytes calldata data,
bytes calldata riskEngineData
) external returns (uint256 suppliedAssets, uint256 suppliedShares);
/// @notice Withdraws assets from a specific tranche in the market.
/// @param marketParams The market parameters.
/// @param trancheIndex The index of the tranche to withdraw from.
/// @param assets The amount of assets to withdraw (use 0 if withdrawing by shares).
/// @param shares The amount of shares to withdraw (use 0 if withdrawing by assets).
/// @param onBehalf The address to withdraw on behalf of.
/// @param receiver The address to send the withdrawn assets to.
/// @param shouldAccrueInterest Whether to accrue interest before withdrawing. Setting to false
/// saves gas when the caller knows interest was recently accrued (e.g., in the same block).
/// Withdrawing on stale data may undervalue shares; the caller accepts this tradeoff.
/// @param riskEngineData The risk engine data to pass during interest accrual.
/// @return withdrawnAssets The actual amount of assets withdrawn.
/// @return withdrawnShares The actual amount of shares withdrawn.
function withdraw(
MarketParams memory marketParams,
uint256 trancheIndex,
uint256 assets,
uint256 shares,
address onBehalf,
address receiver,
bool shouldAccrueInterest,
bytes calldata riskEngineData
) external returns (uint256 withdrawnAssets, uint256 withdrawnShares);
/* BORROWER FUNCTIONS */
/// @notice Borrows assets from a specific tranche in the market.
/// @param marketParams The market parameters.
/// @param trancheIndex The index of the tranche to borrow from.
/// @param assets The amount of assets to borrow (use 0 if borrowing by shares).
/// @param shares The amount of shares to borrow (use 0 if borrowing by assets).
/// @param onBehalf The address to borrow on behalf of.
/// @param receiver The address to send the borrowed assets to.
/// @param riskEngineData The risk engine data to pass during interest accrual.
/// @return borrowedAssets The actual amount of assets borrowed.
/// @return borrowedShares The actual amount of shares borrowed.
function borrow(
MarketParams memory marketParams,
uint256 trancheIndex,
uint256 assets,
uint256 shares,
address onBehalf,
address receiver,
bytes calldata riskEngineData
) external returns (uint256 borrowedAssets, uint256 borrowedShares);
/// @notice Repays borrowed assets for a specific tranche in the market with callback support.
/// @param marketParams The market parameters.
/// @param trancheIndex The index of the tranche to repay to.
/// @param assets The amount of assets to repay (use 0 if repaying by shares).
/// @param shares The amount of shares to repay (use 0 if repaying by assets).
/// @param onBehalf The address to repay on behalf of.
/// @param data Arbitrary data to pass to the callback (if any).
/// @param riskEngineData The risk engine data to pass during interest accrual.
/// @return repaidAssets The actual amount of assets repaid.
/// @return repaidShares The actual amount of shares repaid.
function repay(
MarketParams memory marketParams,
uint256 trancheIndex,
uint256 assets,
uint256 shares,
address onBehalf,
bytes calldata data,
bytes calldata riskEngineData
) external returns (uint256 repaidAssets, uint256 repaidShares);
/// @notice Supplies collateral to a specific tranche in the market with callback support.
/// @param marketParams The market parameters.
/// @param trancheIndex The index of the tranche to supply collateral to.
/// @param assets The amount of collateral assets to supply.
/// @param onBehalf The address to supply collateral on behalf of.
/// @param data Arbitrary data to pass to the callback (if any).
function supplyCollateral(
MarketParams memory marketParams,
uint256 trancheIndex,
uint256 assets,
address onBehalf,
bytes calldata data
) external;
/// @notice Withdraws collateral from a specific tranche in the market.
/// @param marketParams The market parameters.
/// @param trancheIndex The index of the tranche to withdraw collateral from.
/// @param assets The amount of collateral assets to withdraw.
/// @param onBehalf The address to withdraw collateral on behalf of.
/// @param receiver The address to send the withdrawn collateral to.
/// @param riskEngineData The risk engine data to pass during interest accrual.
function withdrawCollateral(
MarketParams memory marketParams,
uint256 trancheIndex,
uint256 assets,
address onBehalf,
address receiver,
bytes calldata riskEngineData
) external;
/* LIQUIDATION */
/// @notice Liquidates a borrower's position.
/// @dev The returned `repaidAssets` is computed with rounding up to favor protocol safety.
/// @param marketParams The market parameters.
/// @param trancheIndex The tranche index of the position to liquidate.
/// @param borrower The address of the borrower to liquidate.
/// @param riskEngineData risk engine-specific data.
/// @param callbackData Optional data forwarded to the liquidator callback.
/// @param lmData Opaque liquidation-module data interpreted by the selected module.
/// @return seizedAssets The collateral assets seized.
/// @return repaidAssets The loan assets repaid by the liquidator.
function liquidate(
MarketParams memory marketParams,
uint256 trancheIndex,
address borrower,
bytes calldata riskEngineData,
bytes calldata callbackData,
bytes calldata lmData
) external returns (uint256 seizedAssets, uint256 repaidAssets);
/* INTEREST MANAGEMENT */
/// @notice Accrues interest for all tranches in a market.
/// @param marketParams The market parameters.
/// @param riskEngineData The risk engine data to pass during interest accrual.
function accrueInterest(MarketParams memory marketParams, bytes calldata riskEngineData) external;
/* FLASH LOANS */
/// @notice Returns the fee owed for borrowing `assets` of `token`.
/// @param token The token to quote.
/// @param assets The amount to flash loan.
/// @return fee The flash loan fee owed on top of `assets`.
function flashFee(address token, uint256 assets) external view returns (uint256 fee);
/// @notice Executes a flash loan.
/// @param token The address of the token to flash loan.
/// @param assets The amount of assets to flash loan.
/// @param data Arbitrary data to pass to the callback.
function flashLoan(address token, uint256 assets, bytes calldata data) external;
/* AUTHORIZATION */
/// @notice Returns true if `authorized` can modify `authorizer`'s position on all markets/tranches.
/// @param authorizer The account delegating permissions.
/// @param authorized The account receiving delegated permissions.
/// @return isAuthorized_ Whether `authorized` is currently approved.
function isAuthorized(address authorizer, address authorized) external view returns (bool isAuthorized_);
/// @notice The `authorizer`'s current nonce.
/// @dev To prevent replay attacks with EIP-712 signatures.
/// @param authorizer The account whose nonce is queried.
/// @return currentNonce The current authorization nonce.
function nonce(address authorizer) external view returns (uint256 currentNonce);
/// @notice Sets `authorized` authorization to act on behalf of `msg.sender`.
/// @param authorized The authorized address.
/// @param newIsAuthorized The new authorization status.
function setAuthorization(address authorized, bool newIsAuthorized) external;
/// @notice Sets authorization via signature.
/// @param authorization The authorization struct.
/// @param signature The signature struct.
function setAuthorizationWithSig(Authorization memory authorization, Signature calldata signature) external;
/* VIEW FUNCTIONS */
/// @notice Returns true if `riskEngine` is enabled for Lotus markets.
/// @param riskEngine The risk engine to check.
/// @return isEnabled Whether `riskEngine` is enabled.
function isRiskEngineEnabled(address riskEngine) external view returns (bool isEnabled);
/// @notice Returns true if `lltv` is enabled for Lotus markets.
/// @param lltv The LLTV to check.
/// @return isEnabled Whether `lltv` is enabled.
function isLltvEnabled(uint256 lltv) external view returns (bool isEnabled);
/// @notice Returns true if `liquidationModule` is enabled for Lotus markets.
/// @param liquidationModule The liquidation module to check.
/// @return isEnabled Whether `liquidationModule` is enabled.
function isLiquidationModuleEnabled(address liquidationModule) external view returns (bool isEnabled);
/// @notice Returns true if `manager` is a module manager.
/// @param manager The address to check.
/// @return Whether `manager` is a module manager.
function isModuleManager(address manager) external view returns (bool);
/// @notice Returns the last interest accrual time for a market.
/// @param id The market id.
/// @param trancheIndex The tranche index.
/// @return timestamp The unix timestamp of last accrual for the tranche.
function lastUpdate(Id id, uint256 trancheIndex) external view returns (uint64 timestamp);
/// @notice Returns the market parameters for a given market id.
/// @param id The market id.
/// @return The MarketParams struct for the market.
function getMarketParams(Id id) external view returns (MarketParams memory);
/// @notice Returns the tranche config for a given market id and tranche index.
/// @param id The market id.
/// @param trancheIndex The tranche index.
/// @return The TrancheConfig struct for the tranche.
function getTrancheConfig(Id id, uint256 trancheIndex) external view returns (TrancheConfig memory);
/// @notice Returns all tranche configs for a given market id.
/// @param id The market id.
/// @return An array of TrancheConfig structs for the market.
function getTrancheConfigs(Id id) external view returns (TrancheConfig[] memory);
/// @notice Returns the tranches for a given market id.
/// @param id The market id.
/// @return An array of Tranche structs for the market.
function getMarketTranches(Id id) external view returns (Tranche[] memory);
/// @notice Returns a single tranche for a given market id and tranche index.
/// @param id The market id.
/// @param trancheIndex The tranche index.
/// @return The Tranche struct for the tranche.
function getMarketTranche(Id id, uint256 trancheIndex) external view returns (Tranche memory);
/// @notice Returns the number of tranches for a given market id.
/// @param id The market id.
/// @return The number of tranches in the market.
function getNumMarketTranches(Id id) external view returns (uint256);
/// @notice Returns the effective pause state for a market, as the interest-accrual gate sees it.
/// @dev Lets off-chain valuation mirror accrual: when `paused`, no interest accrues over the
/// pause window; when `unpausedAt > syncedAt`, the next accrual restarts each tranche from
/// `unpausedAt` rather than its stale pre-pause `lastUpdate`.
/// @param id The market id.
/// @return paused Whether the protocol or this market is currently paused.
/// @return unpausedAt The most recent unpause timestamp relevant to this market (global or per-market).
/// @return syncedAt The unpause timestamp already synchronized into this market's tranche `lastUpdate` values.
function getMarketPauseState(Id id) external view returns (bool paused, uint64 unpausedAt, uint64 syncedAt);
/// @notice Returns the risk engine for a given market id.
/// @param id The market id.
/// @return The IRiskEngine contract for the market.
function getMarketRiskEngine(Id id) external view returns (IRiskEngine);
/// @notice Returns a user's position in a specific market tranche.
/// @param id The market id.
/// @param user The address of the user.
/// @param trancheIndex The tranche index.
/// @return The Position struct for the user in the tranche.
function getPosition(Id id, address user, uint256 trancheIndex) external view returns (Position memory);
/// @notice Returns all tranche positions for a user in a given market.
/// @param id The market id.
/// @param user The address of the user.
/// @return An array of Position structs indexed by tranche.
function getPositions(Id id, address user) external view returns (Position[] memory);
/// @notice Returns the current borrowed assets and max borrowable assets for a borrower in a market tranche.
/// @dev Accurate as of the last interest accrual.
/// @dev Use `accrueInterest` first (or a lens helper) when post-accrual values are required.
/// @param marketParams The market parameters.
/// @param trancheIndex The tranche index.
/// @param borrower The borrower account.
/// @return borrowed The current borrowed assets in the tranche.
/// @return maxBorrow The current max borrowable assets in the tranche.
function getMaxBorrowAndBorrowed(MarketParams memory marketParams, uint256 trancheIndex, address borrower)
external
view
returns (uint256 borrowed, uint256 maxBorrow);
/// @notice Computes junior supply for a given market and tranche.
/// @dev Accurate as of the last interest accrual.
/// @param id The market whose junior supply is computed.
/// @param trancheIndex The tranche whose junior supply is computed.
/// @return The junior supply amount.
function getJrSupply(Id id, uint256 trancheIndex) external view returns (uint256);
/// @notice Returns risk engine-effective free supply available for withdraw or borrow.
/// @dev Bounded by Lotus's current waterfall-backed physical ceiling and then refined by the market risk engine.
/// @param id The market whose free supply is returned.
/// @param trancheIndex The tranche whose free supply is returned.
/// @return The free supply amount.
function getFreeSupply(Id id, uint256 trancheIndex) external view returns (uint256);
/// @notice Returns risk engine-effective free supply available for withdraw or borrow.
/// @dev Bounded by Lotus's current waterfall-backed physical ceiling and then refined by the market risk engine.
/// @param id The market whose free supply is returned.
/// @param trancheIndex The tranche whose free supply is returned.
/// @param riskEngineData Custom data to be passed to the risk engine implementation.
/// @return The free supply amount.
function getFreeSupply(Id id, uint256 trancheIndex, bytes calldata riskEngineData) external view returns (uint256);
/// @notice Computes junior net supply for all tranches in a market.
/// @dev Accurate as of the last interest accrual.
/// @param id The market id.
/// @return An array of junior net supply amounts for each tranche.
function getJrNetSupply(Id id) external view returns (uint256[] memory);
/// @notice Returns the market hook configuration (if any) for a given market id.
/// @param id The market id.
/// @return hook The hook contract address (zero address if disabled).
/// @return permissions The hook permissions bitmap.
function getMarketHookConfig(Id id) external view returns (address hook, uint256 permissions);
}
src/interfaces/IRiskEngine.sol
// SPDX-License-Identifier: UNLICENSED
pragma solidity ^0.8.28;
import {Id, Tranche} from "./ILotus.sol";
/// @notice Trusted single-tranche context precomputed by Lotus for borrow-only accrual.
struct BorrowAccrualContext {
/// @notice Lotus's trusted physical waterfall-backed cap at `trancheIndex` under the current snapshot.
uint256 freeSupplyCap;
/// @notice Junior supply backing the tranche, available to engines that derive borrow-side state from it.
uint256 jrSupply;
}
/// @notice Per-tranche accrual delta returned by cascade accrual.
struct AccrualDelta {
/// @notice Interest added to `borrowAssets`.
uint256 borrowInterest;
/// @notice Interest added to `supplyAssets`.
uint256 supplyInterest;
}
/// @notice Per-tranche bad debt reductions returned by the risk engine.
struct BadDebtDeltas {
/// @notice Full-length array of supply asset reductions.
uint256[] supplyReductions;
}
/// @title IRiskEngine
/// @notice The Risk Engine interface expected by Lotus protocol.
interface IRiskEngine {
/// @notice Initializes the risk engine for a Lotus market.
/// @param id The market id.
/// @param riskEngineParams ABI-encoded params expected by the risk engine implementation.
function initialize(Id id, bytes calldata riskEngineParams) external;
/// @notice Accrues interest across tranches 0..accrueUpTo-1 with cascading distribution.
/// @dev May update internal risk engine state (e.g. adaptive rates).
/// @param id The market id.
/// @param tranches The current tranche state array.
/// @param accrueUpTo Exclusive upper bound of tranches to accrue.
/// @param riskEngineData Custom data to be passed to the risk engine implementation.
/// @return deltas The per-tranche accrual deltas.
/// @return freeSupply The risk-engine-effective withdraw/borrow liquidity across accrued tranches,
/// bounded by Lotus's trusted physical `freeSupplyCap`.
function accrueInterest(Id id, Tranche[] calldata tranches, uint256 accrueUpTo, bytes calldata riskEngineData)
external
returns (AccrualDelta[] memory deltas, uint256 freeSupply);
/// @notice Accrues borrow interest for a single tranche only (no cascade).
/// @dev Returns borrow interest and effective free supply. May update internal risk engine state.
/// @param id The market id.
/// @param tranches The current tranche state array.
/// @param trancheIndex The index of the tranche to accrue.
/// @param context Trusted Lotus-computed context for the tranche's borrow-only accrual.
/// @param riskEngineData Custom data to be passed to the risk engine implementation.
/// @return borrowInterest The borrow interest for the tranche.
/// @return freeSupply The risk-engine-effective withdraw/borrow liquidity at the tranche,
/// bounded by Lotus's trusted physical `freeSupplyCap`.
function accrueBorrowInterest(
Id id,
Tranche[] calldata tranches,
uint256 trancheIndex,
BorrowAccrualContext calldata context,
bytes calldata riskEngineData
) external returns (uint256 borrowInterest, uint256 freeSupply);
/// @notice Returns the effective free supply at a tranche without accruing interest.
/// @param id The market id.
/// @param tranches The current tranche state array.
/// @param trancheIndex The tranche index to query.
/// @param riskEngineData Custom data to be passed to the risk engine implementation.
/// @return freeSupply The risk-engine-effective withdraw/borrow liquidity at the tranche,
/// bounded by Lotus's trusted physical `freeSupplyCap`.
function getFreeSupply(Id id, Tranche[] calldata tranches, uint256 trancheIndex, bytes calldata riskEngineData)
external
view
returns (uint256 freeSupply);
/// @notice Distributes bad debt losses across tranches from originIndex upward.
/// @param id The market id.
/// @param tranches The current tranche state array.
/// @param originTrancheIndex The tranche index where bad debt originated.
/// @param badDebtAssets The amount of bad debt to distribute.
/// @return deltas The per-tranche supply reductions after bad debt distribution.
function distributeBadDebt(Id id, Tranche[] calldata tranches, uint256 originTrancheIndex, uint256 badDebtAssets)
external
pure
returns (BadDebtDeltas memory deltas);
/// @notice View-only preview of accrueInterest for off-chain estimation.
/// @param id The market id.
/// @param tranches The current tranche state array.
/// @param accrueUpTo Exclusive upper bound of tranches to accrue.
/// @param riskEngineData Custom data to be passed to the risk engine implementation.
/// @return deltas The preview per-tranche accrual deltas.
/// @return freeSupply The risk-engine-effective withdraw/borrow liquidity across accrued tranches,
/// bounded by Lotus's trusted physical `freeSupplyCap`.
function previewAccrueInterest(
Id id,
Tranche[] calldata tranches,
uint256 accrueUpTo,
bytes calldata riskEngineData
) external view returns (AccrualDelta[] memory deltas, uint256 freeSupply);
}
src/libraries/LotusErrorsLib.sol
// SPDX-License-Identifier: UNLICENSED
pragma solidity ^0.8.28;
import {Id} from "../interfaces/ILotus.sol";
/// @title LotusErrorsLib
/// @notice Library for Lotus errors.
library LotusErrorsLib {
/* GENERAL ERRORS */
/// @notice Zero address provided for a required argument.
error ZeroAddress();
/// @notice Non-zero value is required but zero is provided.
error ZeroValue();
/// @notice Mutually dependent inputs are inconsistent.
error InconsistentInput();
/// @notice Caller is not the owner.
error NotOwner();
/// @notice Caller is neither the owner nor a module manager.
error NotOwnerOrModuleManager();
/* ASSET AMOUNT ERRORS */
/// @notice Withdrawal resolves to zero assets.
error InvalidZeroAssetWithdrawal();
/// @notice Borrow resolves to zero assets.
error InvalidZeroAssetBorrow();
/// @notice Supply resolves to zero shares.
error InvalidZeroShareSupply();
/// @notice Repay resolves to zero shares.
error InvalidZeroShareRepay();
/* OWNER ERRORS */
/// @notice Owner is already set to the requested address.
/// @param owner The owner that is already set.
error OwnerAlreadySet(address owner);
/// @notice Fee is already set to the requested value.
/// @param id The market whose fee is already set.
/// @param trancheIndex The tranche whose fee is already set.
/// @param fee The fee that is already set.
error FeeAlreadySet(Id id, uint256 trancheIndex, uint64 fee);
/// @notice Fee exceeds protocol bounds.
/// @param fee The invalid fee value.
error InvalidFee(uint64 fee);
/// @notice Fee recipient is already set to the requested address.
/// @param feeRecipient The fee recipient that is already set.
error FeeRecipientAlreadySet(address feeRecipient);
/// @notice Token flash-loan fee is already set to the requested value.
/// @param token The token whose flash loan fee is already set.
/// @param fee The flash loan fee that is already set.
error FlashLoanFeeAlreadySet(address token, uint64 fee);
/// @notice Risk engine is already enabled.
/// @param riskEngine The risk engine that is already enabled.
error RiskEngineAlreadyEnabled(address riskEngine);
/// @notice LLTV is outside valid bounds.
/// @param lltv The invalid LLTV value.
error InvalidLltv(uint256 lltv);
/// @notice LLTV is already enabled.
/// @param lltv The LLTV that is already enabled.
error LltvAlreadyEnabled(uint256 lltv);
/* MARKET LIFECYCLE ERRORS */
/// @notice Market already exists.
/// @param id The market id that already exists.
error MarketAlreadyExists(Id id);
/// @notice Market has not been created.
/// @param id The market id that does not exist.
error MarketNotCreated(Id id);
/// @notice Market references a risk engine that is not enabled.
/// @param riskEngine The risk engine that is not enabled.
error RiskEngineNotEnabled(address riskEngine);
/// @notice Market references an LLTV that is not enabled.
/// @param lltv The LLTV that is not enabled.
error LltvNotEnabled(uint256 lltv);
/// @notice Tranche index is out of bounds.
/// @param trancheIndex The tranche index that is out of bounds.
error InvalidTrancheIndex(uint256 trancheIndex);
/* LIQUIDITY ERRORS */
/// @notice Available liquidity is insufficient for an operation.
/// @param assets The amount of assets that is not available.
error InsufficientLiquidity(uint256 assets);
/// @notice Operation makes the position unhealthy.
/// @param assets The operation amount that caused the unhealthy state.
error UnhealthyAfter(uint256 assets);
/// @notice Liquidation is attempted on a non-underwater borrower.
/// @param borrower The borrower that is not underwater.
error NotUnderwater(address borrower);
/// @notice `repaidShares` exceeds the borrower's debt shares.
/// @param repaidShares The amount of shares attempting to be repaid.
/// @param borrowerShares The borrower's actual borrow shares.
error ExcessiveRepay(uint256 repaidShares, uint256 borrowerShares);
/// @notice Flash loan callback returned an unexpected selector.
/// @param expected The selector expected from the callback.
/// @param received The selector actually returned by the callback.
error InvalidFlashLoanCallbackResponse(bytes4 expected, bytes4 received);
/// @notice `seizedAssets` exceeds the borrower's collateral.
/// @param seizedAssets The amount of assets attempting to be seized.
/// @param borrowerCollateral The borrower's actual collateral.
error ExcessiveSeizure(uint256 seizedAssets, uint256 borrowerCollateral);
/* AUTHORIZATION ERRORS */
/// @notice Caller is not authorized for the operation.
error Unauthorized();
/// @notice Authorization is already set to the requested value.
error AuthorizationAlreadySet();
/// @notice Signature deadline has passed.
error SignatureExpired();
/// @notice Signature nonce is invalid.
error InvalidNonce();
/// @notice Signature recovery or signer validation failed.
error InvalidSignature();
/* LIQUIDATION MODULE ERRORS */
/// @notice Caller is not Lotus.
error NotLotus();
/// @notice Liquidation module is already enabled.
/// @param module The liquidation module that is already enabled.
error LiquidationModuleAlreadyEnabled(address module);
/// @notice Liquidation module is not enabled.
/// @param module The liquidation module that is not enabled.
error LiquidationModuleNotEnabled(address module);
/// @notice Module manager is already enabled.
/// @param manager The module manager that is already enabled.
error ModuleManagerAlreadyEnabled(address manager);
/// @notice Oracle collateral price is zero.
error InvalidCollateralPrice();
/* DELTA VALIDATION ERRORS */
/// @notice Risk engine delta array length does not match Lotus expectations.
error DeltaLengthMismatch();
/// @notice Risk engine reports borrow interest above Lotus's maximum allowed envelope.
error BorrowInterestTooHigh();
/// @notice Risk engine reports non-zero borrow interest when no interest can accrue.
error UnexpectedBorrowInterest();
/// @notice Risk engine reports free supply above Lotus's waterfall-backed liquidity cap.
error FreeSupplyExceedsPhysical();
/// @notice Risk engine over-distributes cascading interest to suppliers.
error InterestDirectionViolation();
/// @notice Full accrual leaves unexpected interest undistributed.
error UnexpectedCarryForward();
/// @notice Bad debt reductions flow below the origin tranche.
error BadDebtDirectionViolation();
/// @notice Bad debt reduction exceeds a tranche's supply assets.
error ExcessiveBadDebtReduction();
/// @notice Bad debt reductions do not exactly match realized bad debt.
error BadDebtTotalMismatch();
/// @notice Lotus is reentered during the guarded risk engine external call window.
error RiskEngineCallReentrancy();
/* PAUSE ERRORS */
/// @notice Operation attempted while the protocol is globally paused.
error ProtocolPaused();
/// @notice Operation attempted on a paused market.
/// @param id The paused market id.
error MarketIsPaused(Id id);
/// @notice Protocol is already paused.
error AlreadyPaused();
/// @notice Protocol is not paused.
error NotPaused();
}
Compiler settingsShow
{
"viaIR": true,
"metadata": {
"appendCBOR": true,
"bytecodeHash": "ipfs",
"useLiteralContent": false
},
"optimizer": {
"runs": 200,
"enabled": true
},
"evmVersion": "cancun",
"remappings": [
"@openzeppelin/contracts-upgradeable/=lib/openzeppelin-contracts-upgradeable/contracts/",
"@openzeppelin/contracts/=lib/openzeppelin-contracts/contracts/",
"solady/=lib/solady/",
"bundler3/=lib/bundler3/src/",
"ds-test/=lib/openzeppelin-contracts-upgradeable/lib/forge-std/lib/ds-test/src/",
"erc4626-tests/=lib/openzeppelin-contracts-upgradeable/lib/erc4626-tests/",
"forge-std/=lib/forge-std/src/",
"openzeppelin-contracts-upgradeable/=lib/openzeppelin-contracts-upgradeable/",
"openzeppelin-contracts/=lib/openzeppelin-contracts/",
"prb-math/=lib/prb-math/src/"
]
}Source code and metadata: Sourcify.
The source code belongs to the authors of the contract.