From 8713b2814108ec7b0358d745dc4d3a450457c6a9 Mon Sep 17 00:00:00 2001 From: Akshit Choudhary Date: Mon, 13 Jul 2020 13:42:25 +0530 Subject: [PATCH] Update 05-using-flash-swaps.md --- .../v2/06-smart-contract-integration/05-using-flash-swaps.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/pages/docs/v2/06-smart-contract-integration/05-using-flash-swaps.md b/src/pages/docs/v2/06-smart-contract-integration/05-using-flash-swaps.md index 965ed7d7..bc7c4a85 100644 --- a/src/pages/docs/v2/06-smart-contract-integration/05-using-flash-swaps.md +++ b/src/pages/docs/v2/06-smart-contract-integration/05-using-flash-swaps.md @@ -21,7 +21,7 @@ To differentiate between the "typical" trading case and the flash swap case, pai function uniswapV2Call(address sender, uint amount0, uint amount1, bytes calldata data); ``` -The logic behind this identification strategy is simple: the vast majority of valid flash swap use cases involve interactions with external protocols. The best way to pass information dictating how these interactions happen (function arguments, safety parameters, addresses, etc.) is via the `data` parameter. It's expected that `data` will be `abi.decode`d from within `uniswapV2Call`. In the rare case where no data is required, callers should ensure that `data.length` equals 1 (i.e. encode a single junk byte as `bytes`), and then ignore this argument in `uniswapV2Call`. +The logic behind this identification strategy is simple: the vast majority of valid flash swap use cases involve interactions with external protocols. The best way to pass information dictating how these interactions happen (function arguments, safety parameters, addresses, etc.) is via the `data` parameter. It's expected that `data` will be `abi.decode` from within `uniswapV2Call`. In the rare case where no data is required, callers should ensure that `data.length` equals 1 (i.e. encode a single junk byte as `bytes`), and then ignore this argument in `uniswapV2Call`. Pairs call `uniswapV2Call` with the `sender` argument set to the `msg.sender` of the `swap`. `amount0` and `amount1` are simply `amount0Out` and `amount1Out`.