generated from PaulRBerg/foundry-template
-
Notifications
You must be signed in to change notification settings - Fork 3
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
Bringing in the spec and the interface #40
Merged
Merged
Changes from all commits
Commits
Show all changes
19 commits
Select commit
Hold shift + click to select a range
8e2b141
draft: Gnosis Safe Flash Loans
822dc8c
always be linting
7c51f89
Fix comments
6fc1453
Not sure what's wrong with the transfer
49e6de0
tests complete
8aae47e
Better README
e413d0a
lint me, my friend, lint me, again
d6daecb
Moved tests to mainnet
54ae085
setLendingDataAll
0c06c38
Now with a clone factory
8900c8a
LINT LINT LINT
a7f5108
added indexed to events
fa88a93
Removed code duplication and unnecessary storage
494e31d
Missing natspec
c1480dd
Friendlier UX
69a0bc6
BRinging in the spec and the interface
3cbb87d
lint
c7a8c2b
Merge branch 'main' into unify-repos
alcueca d41b652
solc >= 0.8.19
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Submodule erc7399
deleted from
501ffd
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,44 @@ | ||
// SPDX-License-Identifier: CC0 | ||
pragma solidity >=0.8.19; | ||
|
||
/// @dev Specification for flash lenders compatible with ERC-7399 | ||
interface IERC7399 { | ||
/// @dev The amount of currency available to be lent. | ||
/// @param asset The loan currency. | ||
/// @return The amount of `asset` that can be borrowed. | ||
function maxFlashLoan(address asset) external view returns (uint256); | ||
|
||
/// @dev The fee to be charged for a given loan. | ||
/// @param asset The loan currency. | ||
/// @param amount The amount of assets lent. | ||
/// @return The amount of `asset` to be charged for the loan, on top of the returned principal. | ||
function flashFee(address asset, uint256 amount) external view returns (uint256); | ||
|
||
/// @dev Initiate a flash loan. | ||
/// @param loanReceiver The address receiving the flash loan | ||
/// @param asset The asset to be loaned | ||
/// @param amount The amount to loaned | ||
/// @param data The ABI encoded user data | ||
/// @param callback The address and signature of the callback function | ||
/// @return result ABI encoded result of the callback | ||
function flash( | ||
address loanReceiver, | ||
address asset, | ||
uint256 amount, | ||
bytes calldata data, | ||
/// @dev callback. This is a combination of the callback receiver address, and the signature of callback | ||
/// function. It is encoded packed as 20 bytes + 4 bytes. | ||
/// @dev the return of the callback function is not encoded in the parameter, but must be `returns (bytes | ||
/// memory)` for compliance with the standard. | ||
/// @param initiator The address that called this function | ||
/// @param paymentReceiver The address that needs to receive the amount plus fee at the end of the callback | ||
/// @param asset The asset to be loaned | ||
/// @param amount The amount to loaned | ||
/// @param fee The fee to be paid | ||
/// @param data The ABI encoded data to be passed to the callback | ||
/// @return result ABI encoded result of the callback | ||
function(address, address, address, uint256, uint256, bytes memory) external returns (bytes memory) callback | ||
) | ||
external | ||
returns (bytes memory); | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
should we add the vyper compatible function?
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.
If you want, be my guest.