This standard is an extension of the existing flashloan standard (EIP-3156) to support ERC-721 NFT flashloans. It proposes a way for flashloan providers to lend NFTs to contracts, with the condition that the loan is repaid in the same transaction along with some fee.
The current flashloan standard, EIP-3156, only supports ERC-20 tokens. ERC-721 tokens are sufficiently different from ERC-20 tokens that they require an extension of this existing standard to support them.
I tried quite hard to make this EIP have as minimal additional requirements from EIP-3156 as possible. There are only 2 methods:
interface IERC6682 {
/// @dev The address of the token used to pay flash loan fees.
function flashFeeToken() external view returns (address);
/// @dev Whether or not the NFT is available for a flash loan.
/// @param token The address of the NFT contract.
/// @param tokenId The ID of the NFT.
function availableForFlashLoan(address token, uint256 tokenId) external view returns (bool);
}
Here is the link to the EIP:
Iāve also created an example implementation here (in addition to the reference implementation in the spec): GitHub - outdoteth/ERC-6682-example: Example implementation of NFT flashloans