Skip to content
Discussion options

You must be logged in to vote

Why do we have to transfer fee amount to the this contract: // 6. Get flash swap fee from caller IERC20(token).transferFrom(caller, address(this), fee);

We have to transfer the fee from caller because they are the one that processed the flash swap and they are responsible for any fee attached to the swap fee process.

when the fee is included in repaying to pair contract the amount that we borrowed + fee in this last line:
IERC20(token).transfer(address(pair), amountToRepay);

I don't understand this question

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by fbabovic23
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants