Last active
January 21, 2023 15:53
-
-
Save az0mb13/751a2755c26244857c25d0fdbf58d1e1 to your computer and use it in GitHub Desktop.
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
contract FlashLoanReceiver { | |
... | |
function receiveEther(uint256 fee) public payable { | |
require(msg.sender == pool, "Sender must be pool"); | |
uint256 amountToBeRepaid = msg.value + fee; | |
require(address(this).balance >= amountToBeRepaid, "Cannot borrow that much"); | |
_executeActionDuringFlashLoan(); | |
// Return funds to pool | |
pool.sendValue(amountToBeRepaid); | |
} | |
function _executeActionDuringFlashLoan() internal { } | |
... | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment