Docs
$RETURNOpen app
Get startedBorrowLendSafetyDevelopers
Developers
Developers
Developer overviewDeployments

Guides

Sign and fill ordersSettle loans

Reference

FunctionsEvents and errorsLimits and roundingABI

Events and errors

Open in Claude

Every event the Return contract emits, and what each custom error means.

Events

EventEmitted when
Opened(bytes32 indexed id, address indexed borrower, address indexed lender, Loan loan, uint40 maturity)A fill opens a loan. Contains the full terms needed for every later call.
Posted(bytes32 indexed id, address indexed maker, address indexed loanToken, Order order, bytes signature)A maker lists a public order. Contains everything needed to fill it.
Repaid(bytes32 indexed id, address indexed payer, bool noteHolderPaid, bool collateralReleased, uint40 timestamp)A loan is paid back.
RepaymentCollected(bytes32 indexed id, address indexed noteHolder, uint40 timestamp)A held repayment is delivered.
CollateralReclaimed(bytes32 indexed id, address indexed borrower, uint40 timestamp)The borrower takes collateral back after a third-party repayment.
Foreclosed(bytes32 indexed id, address indexed noteHolder, uint40 timestamp)Collateral is claimed after the deadline.
OrderCancelled(bytes32 indexed id, address indexed maker)A maker cancels one order.
CounterIncremented(address indexed maker, uint256 counter)A maker cancels all older orders.
RepaymentWindowExtended(address indexed token, uint40 until)We declare an incident extension, for loans funded before it.
AssetConfigured, NewLoansPauseSet, TreasurySet, SurplusWithdrawnWe change the market's configuration.
Transfer, Approval, ApprovalForAllStandard ERC721 note events.
OwnershipTransferred, OwnershipHandoverRequested, OwnershipHandoverCanceledOwnership changes.

Errors

ErrorMeaning
InvalidTerms()The order or amount breaks a rule: zero principal or duration, repayment not above principal, expired, wrong taker, amount below minFill or above what is left, a remainder below minFill, a minimum part that would produce zero collateral, zero interest or no proceeds after the fee, or post on a wallet-restricted order.
InvalidSignature()The signature does not match the maker and terms.
OrderUnavailable()The order is cancelled, fully filled, or signed with a counter other than the maker's current one. Also cancel on an order that is already cancelled or fully filled.
AssetNotAllowed()A token is not admitted, or collateral and loan token are the same.
NewLoansPaused()New fills are paused.
NotActive()repay on a loan that does not exist or is already settled.
GracePeriodExpired()repay after the repayment deadline.
NotInDefault()foreclose before the deadline, on a paid-back loan, or on unknown terms.
ClaimUnavailable()reclaimCollateral or collectRepayment when nothing is claimable, or reclaimCollateral by someone other than the borrower.
InexactTransfer()A token moved a different amount than requested, or its balanceOf cannot be read.
AssetShortfall()Any call that moves held funds of a token (fill, repay, reclaimCollateral, foreclose, collectRepayment, withdrawSurplus) while the contract holds less of that token than it owes, for example after an issuer burn.
InsufficientGas()repay sent with a gas limit too low to forward REPAYMENT_GAS (500,000) to the payment. Retry with a higher limit; gas estimation finds one.
Unauthorized()The caller is not allowed: post or cancel by a non-maker, or an owner function by a non-owner.
InvalidConfiguration()An owner call with invalid parameters, a disabled ownership function, or a note transfer to the market contract itself.
NativeCurrencyNotAccepted()ETH sent where none is accepted.
ERC721 errorsTokenDoesNotExist, NotOwnerNorApproved, TransferToZeroAddress, and the other standard Solady ERC721 errors.

Last updated 22 October 2026

Functions

Every function in the Return market contract: what it does, who may call it, and when.

Limits and rounding

The hard limits on order terms, and exactly how partial fills split collateral, interest and fees.

On this page

EventsErrors