From 2144e9b1e5cfd5978b79540ef89f3d8604884c30 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Muhammed=20Emin=20Ta=C5=9F?= Date: Mon, 4 Dec 2023 16:04:20 +0000 Subject: [PATCH] =?UTF-8?q?uniswap-v3-flash-swap=20=C3=A7evirisi=20tamamla?= =?UTF-8?q?nd=C4=B1?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../UniswapV3FlashSwap.sol | 6 ++--- .../UniswapV3FlashSwapTest.sol | 4 +-- .../defi/uniswap-v3-flash-swap/index.html.ts | 26 +++++++++---------- src/pages/defi/uniswap-v3-flash-swap/index.md | 16 ++++++------ 4 files changed, 26 insertions(+), 26 deletions(-) diff --git a/src/pages/defi/uniswap-v3-flash-swap/UniswapV3FlashSwap.sol b/src/pages/defi/uniswap-v3-flash-swap/UniswapV3FlashSwap.sol index b442f3b56..d547ac5db 100644 --- a/src/pages/defi/uniswap-v3-flash-swap/UniswapV3FlashSwap.sol +++ b/src/pages/defi/uniswap-v3-flash-swap/UniswapV3FlashSwap.sol @@ -9,9 +9,9 @@ contract UniswapV3FlashSwap { uint160 internal constant MAX_SQRT_RATIO = 1461446703485210103287273052203988822378723970342; - // Example WETH/USDC - // Sell WETH high -> Buy WETH low -> WETH profit - // WETH in -> USDC out -> USDC in -> WETH out -> WETH profit + // WETH/USDC örneği + // Yüksekten WETH sat -> Düşükten WETH al -> WETH'den kar et + // WETH içeri -> USDC dışarı -> USDC içeri -> WETH dışarı -> WETH'den kar et function flashSwap( address pool0, uint24 fee1, diff --git a/src/pages/defi/uniswap-v3-flash-swap/UniswapV3FlashSwapTest.sol b/src/pages/defi/uniswap-v3-flash-swap/UniswapV3FlashSwapTest.sol index 7460fd413..9ea12933f 100644 --- a/src/pages/defi/uniswap-v3-flash-swap/UniswapV3FlashSwapTest.sol +++ b/src/pages/defi/uniswap-v3-flash-swap/UniswapV3FlashSwapTest.sol @@ -17,13 +17,13 @@ contract UniswapV3FlashSwapTest is Test { function setUp() public {} function testFlashSwap() public { - // USDC / WETH pool + // USDC / WETH havuzu address pool0 = 0x8ad599c3A0ff1De082011EFDDc58f1908eb6e6D8; uint24 fee0 = 3000; address pool1 = 0x88e6A0c2dDD26FEEb64F039a2c41296FcB3f5640; uint24 fee1 = 500; - // Approve WETH fee + // WETH fee için harcama izni ver uint wethMaxFee = 1e18; weth.deposit{value: wethMaxFee}(); weth.approve(address(uni), wethMaxFee); diff --git a/src/pages/defi/uniswap-v3-flash-swap/index.html.ts b/src/pages/defi/uniswap-v3-flash-swap/index.html.ts index 05ae2aaca..61c88febe 100644 --- a/src/pages/defi/uniswap-v3-flash-swap/index.html.ts +++ b/src/pages/defi/uniswap-v3-flash-swap/index.html.ts @@ -1,7 +1,7 @@ // metadata export const version = "0.8.20" -export const title = "Uniswap V3 Flash Swap Arbitrage" -export const description = "Uniswap V3 Flash Swap Arbitrage" +export const title = "Uniswap V3 Flash Swap Arbitraj" +export const description = "Uniswap V3 Flash Swap Arbitraj" export const keywords = ["defi", "uniswap", "v3", "swap", "arbitrage", "amm"] @@ -16,7 +16,7 @@ export const codes = [ }, ] -const html = `

Uniswap V3 Flash Swap Arbitrage Example

+const html = `

Uniswap V3 Flash Swap Arbitraj Örneği

// SPDX-License-Identifier: MIT
 pragma solidity ^0.8.20;
 
@@ -28,9 +28,9 @@ const html = `

Uniswap V3 Flash Swap Arbitrage Example

uint160 internal constant MAX_SQRT_RATIO = 1461446703485210103287273052203988822378723970342; - // Example WETH/USDC - // Sell WETH high -> Buy WETH low -> WETH profit - // WETH in -> USDC out -> USDC in -> WETH out -> WETH profit + // WETH/USDC örneği + // Yüksekten WETH sat -> Düşükten WETH al -> WETH'den kar et + // WETH içeri -> USDC dışarı -> USDC içeri -> WETH dışarı -> WETH'den kar et function flashSwap( address pool0, uint24 fee1, @@ -175,9 +175,9 @@ const html = `

Uniswap V3 Flash Swap Arbitrage Example

function withdraw(uint amount) external; } -

Test with Foundry

+

Foundry ile Test Et

    -
  1. Copy and paste this into test folder in your foundry project
  2. +
  3. Bu kodu kopyalayıp projenizin test klasörüne kaydedin
// SPDX-License-Identifier: MIT
 pragma solidity ^0.8.20;
@@ -198,13 +198,13 @@ const html = `

Uniswap V3 Flash Swap Arbitrage Example

function setUp() public {} function testFlashSwap() public { - // USDC / WETH pool + // USDC / WETH havuzu address pool0 = 0x8ad599c3A0ff1De082011EFDDc58f1908eb6e6D8; uint24 fee0 = 3000; address pool1 = 0x88e6A0c2dDD26FEEb64F039a2c41296FcB3f5640; uint24 fee1 = 500; - // Approve WETH fee + // WETH fee için harcama izni ver uint wethMaxFee = 1e18; weth.deposit{value: wethMaxFee}(); weth.approve(address(uni), wethMaxFee); @@ -221,13 +221,13 @@ const html = `

Uniswap V3 Flash Swap Arbitrage Example

} }
    -
  1. Execute the following commands to run the test
  2. +
  3. Testi başlatmak için aşağıdaki komutları çalıştırın
FORK_URL=https://eth-mainnet.g.alchemy.com/v2/613t3mfjTevdrCwDl28CVvuk6wSIxRPi
 forge test -vv --gas-report --fork-url $FORK_URL --match-path test/UniswapV3FlashSwapTest.test.sol
-

Links

+

Linkler

Foundry

-

Uniswap V3 Foundry example

+

Uniswap V3 Foundry örneği

` export default html diff --git a/src/pages/defi/uniswap-v3-flash-swap/index.md b/src/pages/defi/uniswap-v3-flash-swap/index.md index dd931962f..68daa7517 100644 --- a/src/pages/defi/uniswap-v3-flash-swap/index.md +++ b/src/pages/defi/uniswap-v3-flash-swap/index.md @@ -1,33 +1,33 @@ --- -title: Uniswap V3 Flash Swap Arbitrage +title: Uniswap V3 Flash Swap Arbitraj version: 0.8.20 -description: Uniswap V3 Flash Swap Arbitrage +description: Uniswap V3 Flash Swap Arbitraj keywords: [defi, uniswap, v3, swap, arbitrage, amm] --- -### Uniswap V3 Flash Swap Arbitrage Example +### Uniswap V3 Flash Swap Arbitraj Örneği ```solidity {{{UniswapV3FlashSwap}}} ``` -### Test with Foundry +### Foundry ile Test Et -1. Copy and paste this into `test` folder in your foundry project +1. Bu kodu kopyalayıp projenizin `test` klasörüne kaydedin ```solidity {{{UniswapV3FlashSwapTest}}} ``` -2. Execute the following commands to run the test +2. Testi başlatmak için aşağıdaki komutları çalıştırın ```shell FORK_URL=https://eth-mainnet.g.alchemy.com/v2/613t3mfjTevdrCwDl28CVvuk6wSIxRPi forge test -vv --gas-report --fork-url $FORK_URL --match-path test/UniswapV3FlashSwapTest.test.sol ``` -### Links +### Linkler Foundry -Uniswap V3 Foundry example +Uniswap V3 Foundry örneği