|
|
|
|
|
by karpierz
1527 days ago
|
|
The transaction is basically a function call like this: flash_loan(int amount_borrowed, func arbitrary_trades) 1. give LOANEE_ADDRESS amount_borrowed 2. call arbitrary_trades() 3. give LOANER_ADDRESS (amount_borrowed + interest) When 2. is executed, the loanee has the money. When 3. is complete, the loaner has the money back. If the loanee doesn't have the money to give, 3rd step fails. And since its atomic, the whole transaction fails. |
|