Borrowing from XycLoans
Selecting the right pool
Writing the Receiver contract
Invoking the flash loan pool
pub trait FlashLoanModErc3156 {
/// The entry point for executing a flash loan, the initiator (or borrower) provides:
/// `receiver_id: Address` The address of the receiver contract which contains the borrowing logic.
/// `amount` Amount of `token_id` to borrow (`token_id` is set when the contract is initialized).
fn borrow_erc(e: Env, initiator: Address, receiver_id: Address, amount: i128) -> Result<(), Error>;
}
pub trait FlashLoan {
/// The entry point for executing a flash loan, the initiator (or borrower) provides:
/// `receiver_id: Address` The address of the receiver contract which contains the borrowing logic.
/// `amount` Amount of `token_id` to borrow (`token_id` is set when the contract is initialized).
fn borrow(e: Env, receiver_id: Address, amount: i128) -> Result<(), Error>;
}Understanding Errors
Last updated