ERCs
ERC-3156 — Flash Loans
Standard flash-loan interfaces: a lender exposes the borrow API, a borrower implements the callback. Loans must be repaid in the same transaction.
import { flash_loan, max_flash_loan, flash_fee } from "@ethernauta/erc/3156/flash_lender";
import { on_flash_loan } from "@ethernauta/erc/3156/flash_borrower"; Surface
Flash lender (@ethernauta/erc/3156/flash_lender)
| Method | Shape | Purpose |
|---|---|---|
max_flash_loan({ token }) | Callable<Uint256> | Maximum loanable amount. |
flash_fee({ token, amount }) | Callable<Uint256> | Fee for a given amount. |
flash_loan({ receiver, token, amount, data }) | Signable<Hash32> | Borrow and call back. |
Flash borrower (@ethernauta/erc/3156/flash_borrower)
| Method | Shape | Purpose |
|---|---|---|
on_flash_loan({ initiator, token, amount, fee, data }) | callback | Implement on your borrower contract. |
See also
- ERC-20 — the token being loaned.