Skip to content
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

Add EIP: NFT Flashloans #6682

Merged
merged 15 commits into from
Jul 28, 2023
Merged

Add EIP: NFT Flashloans #6682

merged 15 commits into from
Jul 28, 2023

Conversation

outdoteth
Copy link
Contributor

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.

@outdoteth outdoteth requested a review from eth-bot as a code owner March 14, 2023 11:12
@github-actions github-actions bot added s-draft This EIP is a Draft t-erc labels Mar 14, 2023
@eth-bot
Copy link
Collaborator

eth-bot commented Mar 14, 2023

✅ All reviewers have approved.

@eth-bot eth-bot added e-consensus Waiting on editor consensus e-review Waiting on editor to review labels Mar 14, 2023
@github-actions github-actions bot added the w-ci Waiting on CI to pass label Mar 14, 2023
@github-actions github-actions bot added the c-new Creates a brand new proposal label Mar 14, 2023
@github-actions github-actions bot added w-ci Waiting on CI to pass and removed w-ci Waiting on CI to pass labels Mar 14, 2023
jenroos78
jenroos78 previously approved these changes Mar 14, 2023
@abcoathup
Copy link
Contributor

EIP editors assign EIP numbers (as per EIP-1), which is generally the PR number. #6680 is a spam issue, whilst this PR is #6682
I couldn't see where an editor has assigned the number.

EIPS/eip-6680.md Outdated
@@ -0,0 +1,161 @@
---
eip: 6680
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
eip: 6680
eip: 6682

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Updated

@outdoteth outdoteth changed the title Add ERC-6680: NFT Flashloans Add ERC-6682: NFT Flashloans Mar 15, 2023
@github-actions github-actions bot removed the w-ci Waiting on CI to pass label Mar 15, 2023
@github-actions
Copy link

The commit cd88b3a (as a parent of b71a881) contains errors.
Please inspect the Run Summary for details.

@github-actions github-actions bot added the w-ci Waiting on CI to pass label Mar 15, 2023
@outdoteth
Copy link
Contributor Author

@SamWilsn are the rest of the changes ok?

@roughpandaz
Copy link

@outdoteth This is very interesting!
What do you foresee as example use cases?
Who do you think will likely integrate with this?

I would think

  • Access to events, e.g BAYC events, where the borrower, only needs to prove ownership of the asset at the gate. They can take a flash loan a return the NFT as soon as they are inside the event.

Questions:

  • Would people be able to "counter" this by randomly checking the ownership of an NFT to make sure someone is actually the holder?

@jenroos78

This comment was marked as off-topic.

@jenroos78

This comment was marked as off-topic.

@outdoteth
Copy link
Contributor Author

@RongxinZhang I answered a similar question to yours about potential use cases in the eth magicians thread

Copy link
Contributor

@SamWilsn SamWilsn left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You'll also need to address the eipw errors. You can see the annotations on the "Files changed" tab of this PR, or the full output in the logs on the "Checks" tab. Each annotation should have a link explaining the rule and why we enforce them.

We generally don't make exceptions to these rules.

EIPS/eip-6682.md Outdated

The current flashloan standard, [ERC-3156](./eip-3156.md), only supports [ERC-20](./eip-20.md) tokens. ERC-721 tokens are sufficiently different from ERC-20 tokens that they require an extension of this existing standard to support them.

In most cases, the handling of fee payments will be desired to be paid in a seperate currency to the loaned NFTs because NFTs themselves cannot always be fractionalized. Consider the following example where the flashloan provider charges a 0.1 ETH fee on each NFT that is flashloaned; The interface must provide methods that allow the borrower to determine the fee rate on each NFT and also the currency that the fee should be paid in.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This paragraph belongs more in the Rationale section. The Motivation section should justify the existence of the proposal as a whole, while the Rationale section should explain technical choices made within the standard. In this case, supporting a separate currency for fee payment sounds like a technical choice within this standard.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Updated

EIPS/eip-6682.md Outdated

The current flashloan standard, [ERC-3156](./eip-3156.md), only supports [ERC-20](./eip-20.md) tokens. ERC-721 tokens are sufficiently different from ERC-20 tokens that they require an extension of this existing standard to support them.

In most cases, the handling of fee payments will be desired to be paid in a seperate currency to the loaned NFTs because NFTs themselves cannot always be fractionalized. Consider the following example where the flashloan provider charges a 0.1 ETH fee on each NFT that is flashloaned; The interface must provide methods that allow the borrower to determine the fee rate on each NFT and also the currency that the fee should be paid in.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
In most cases, the handling of fee payments will be desired to be paid in a seperate currency to the loaned NFTs because NFTs themselves cannot always be fractionalized. Consider the following example where the flashloan provider charges a 0.1 ETH fee on each NFT that is flashloaned; The interface must provide methods that allow the borrower to determine the fee rate on each NFT and also the currency that the fee should be paid in.
In most cases, the handling of fee payments will be desired to be paid in a separate currency to the loaned NFTs because NFTs themselves cannot always be fractionalized. Consider the following example where the flashloan provider charges a 0.1 ETH fee on each NFT that is flashloaned; The interface must provide methods that allow the borrower to determine the fee rate on each NFT and also the currency that the fee should be paid in.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

updated

EIPS/eip-6682.md Show resolved Hide resolved
EIPS/eip-6682.md Outdated
## Reference Implementation

```solidity
// SPDX-License-Identifier: MIT
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code included inline in the document must be licensed under CC0-1.0. You can remove the comment, put the reference implementation in ../assets/eip-6682/, or:

Suggested change
// SPDX-License-Identifier: MIT
// SPDX-License-Identifier: CC0-1.0

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

updated

EIPS/eip-6682.md Show resolved Hide resolved
EIPS/eip-6682.md Outdated
type: Standards Track
category: ERC
created: 2023-03-12
requires: 721, 3156
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
requires: 721, 3156
requires: 20, 721, 3156

The fees are paid in ERC-20 tokens, so it's a hard requirement.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

updated

@eth-bot eth-bot changed the title Add ERC-6682: NFT Flashloans Add EIP: NFT Flashloans Jul 27, 2023
@github-actions github-actions bot removed the w-ci Waiting on CI to pass label Jul 27, 2023
@eth-bot eth-bot enabled auto-merge (squash) July 28, 2023 00:49
Copy link
Collaborator

@eth-bot eth-bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

All Reviewers Have Approved; Performing Automatic Merge...

@eth-bot eth-bot merged commit fa410f6 into ethereum:master Jul 28, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
c-new Creates a brand new proposal e-consensus Waiting on editor consensus e-review Waiting on editor to review s-draft This EIP is a Draft t-erc
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants