Skip to content

Instantly share code, notes, and snippets.

@az0mb13
Last active January 21, 2023 15:53
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
Star You must be signed in to star a gist
Embed
What would you like to do?
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