MidnightWithdrawableCallback
Git Source - Generated with forge doc
Inherits: IMidnightWithdrawableCallback
Title: MidnightWithdrawableCallback
Callback that funds a standing par BUY offer from a Midnight market's withdrawable, so lenders can exit and borrowers can borrow at 0% up to that amount.
Is the offer's maker, ratifier and callback, so anyone can build and take the offer without a signature.
Withdraws units from the market and lets Morpho Midnight pull them through a standing max approval of the loan token. Fills revert above withdrawable(id). Router actions should use MidnightWithdrawableClamp.
Takers need no authorization or approval for this contract. It authorizes only itself on Morpho Midnight, to pass take's maker-to-ratifier check.
Lender fills pay Midnight's settlement fee, which a direct Morpho Midnight withdraw avoids. The callback path is for flows that can only take offers, such as router batches.
Constants
MORPHO_MIDNIGHT
IMidnight public immutable MORPHO_MIDNIGHT
Functions
constructor
constructor(address morphoMidnight) ;
isRatified
function isRatified(
Offer memory offer,
bytes memory,
/* ratifierData */
address /* taker */
)
external
view
override
returns (bytes32);
onBuy
function onBuy(
bytes32,
/* marketId */
Market memory market,
uint256 buyerAssets,
uint256 units,
uint256,
/* pendingFeeIncrease */
address buyer,
bytes memory /* data */
) external override returns (bytes32);