-
Notifications
You must be signed in to change notification settings - Fork 5.3k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
ERC3156 - Flash Loans #3156
ERC3156 - Flash Loans #3156
Conversation
EIPS/eip-flash-loans.md
Outdated
|
||
## Simple Summary | ||
|
||
Flash loans allow smart contracts to lend an amount of tokens without a requirement for collateral, with the condition that they must be returned within the same transaction. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The simple summary should generally one sentence with no motivation.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please check again, thanks.
EIPS/eip-flash-loans.md
Outdated
|
||
The aim of this ERC is to provide a standard interfaces and processes for flash lenders and borrowers, allowing for flash loan integration without a need to consider each particular implementation. | ||
|
||
## Abstract |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The abstract should be a technical overview of the EIP. I don't recommend it for an ERC.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please check again, thanks.
Standardizing flashloans would be great! One thing this proposal does not take into accounts is contracts which hold multiple assets like PieDAO pies. I propose to add an extra param to the flashloan function to signal which asset the receiver is expecting like this:
Flash minting an asset could be done by passing the address of the contract itself to the I've did a POC implementation a while back and the interface looks pretty much the same: https://github.com/pie-dao/ExperiPie/blob/feature/flash-loans/contracts/facets/FlashLoan/FlashLoanFacet.sol |
@MickdeGraaf would it be possible to use the |
Not using the In most circumstances I would expect the data to only be actually used by flashLoanBorrower and not the lender itself. Additionally it would be nice to have some getters allowing me to get a quote from a contract on how much fee I would have to pay and if there is sufficient liquidity for my flashloan. |
So, the intent of the
This is a great idea! |
Makes sense. I do think however that a very large portion of contracts is a token itself which holds one or more other tokens. In these cases the |
Hi @MickdeGraaf, thanks a lot for your suggestion. I think that for projects that hold and lend multiple assets an architecture like Uniswap would work with proposed standard. In Uniswap you go to a given Pair to exchange two tokens. Using this standard you would go to a given FlashLender (possibly built with a factory) to obtain a flash loan of a given token. You could have multiple receivers, or use the I don't dislike your suggestion, but I think there is value in simpler interfaces as long as we are not significantly limited by them. |
@albertocuestacanada @MickdeGraaf please migrate your conversation to https://ethereum-magicians.org/t/flash-loan-eip-erc-3156-early-draft/4993 |
* initial draft * typo * reorganized summary, abstract and motivation * renamed and added reference implementations * updated tests and reference implementation
Flash loans allow smart contracts to lend an amount of tokens without a requirement for collateral, with the condition that they must be returned within the same transaction.
The aim of this ERC is to provide a standard interfaces and processes for flash lenders and borrowers, allowing for flash loan integration without a need to consider each particular implementation.