From 9b4b46c16c71825be87c714cbc9e1b174978dc0b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Muhammed=20Emin=20Ta=C5=9F?= Date: Sat, 2 Dec 2023 14:13:42 +0000 Subject: [PATCH] =?UTF-8?q?uniswap-v2-add-remove-liquidity=20=C3=A7evirisi?= =?UTF-8?q?=20tamamland=C4=B1?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../UniswapV2LiquidityTest.sol | 22 +++++----- .../index.html.ts | 42 +++++++++---------- .../uniswap-v2-add-remove-liquidity/index.md | 8 ++-- 3 files changed, 36 insertions(+), 36 deletions(-) diff --git a/src/pages/defi/uniswap-v2-add-remove-liquidity/UniswapV2LiquidityTest.sol b/src/pages/defi/uniswap-v2-add-remove-liquidity/UniswapV2LiquidityTest.sol index 54ac5242b..943ba3015 100644 --- a/src/pages/defi/uniswap-v2-add-remove-liquidity/UniswapV2LiquidityTest.sol +++ b/src/pages/defi/uniswap-v2-add-remove-liquidity/UniswapV2LiquidityTest.sol @@ -13,15 +13,15 @@ IERC20 constant PAIR = IERC20(0x0d4a11d5EEaaC28EC3F61d100daF4d40471f1852); contract UniswapV2AddLiquidityTest is Test { UniswapV2AddLiquidity private uni = new UniswapV2AddLiquidity(); - // Add WETH/USDT Liquidity to Uniswap + // Uniswap'a WETH/USDT likiditesi ekle function testAddLiquidity() public { - // Deal test USDT and WETH to this contract + // USDT ve WETH bakiyesini kontrol et deal(address(USDT), address(this), 1e6 * 1e6); assertEq(USDT.balanceOf(address(this)), 1e6 * 1e6, "USDT balance incorrect"); deal(address(WETH), address(this), 1e6 * 1e18); assertEq(WETH.balanceOf(address(this)), 1e6 * 1e18, "WETH balance incorrect"); - // Approve uni for transferring + // Uniswap'a harcama izni ver safeApprove(WETH, address(uni), 1e64); safeApprove(USDT, address(uni), 1e64); @@ -30,9 +30,9 @@ contract UniswapV2AddLiquidityTest is Test { assertGt(PAIR.balanceOf(address(uni)), 0, "pair balance 0"); } - // Remove WETH/USDT Liquidity from Uniswap + // Uniswap'tan WETH/USDT likiditesini kaldır function testRemoveLiquidity() public { - // Deal LP tokens to uni + // LP tokenları için bakiye kontrolü deal(address(PAIR), address(uni), 1e10); assertEq(PAIR.balanceOf(address(uni)), 1e10, "LP tokens balance = 0"); assertEq(USDT.balanceOf(address(uni)), 0, "USDT balance non-zero"); @@ -46,9 +46,9 @@ contract UniswapV2AddLiquidityTest is Test { } /** - * @dev The transferFrom function may or may not return a bool. - * The ERC-20 spec returns a bool, but some tokens don't follow the spec. - * Need to check if data is empty or true. + * @dev transferFrom fonksiyonu boolean bir değer dönmeyebilir. + * ERC-20'ler boolean değer dönüyor fakat bazı tokenlar buna uymayabilir. + * Verinin boş mu yoksa True mu oldğunu kontrol etmemiz gerekiyor. */ function safeTransferFrom( IERC20 token, @@ -66,9 +66,9 @@ contract UniswapV2AddLiquidityTest is Test { } /** - * @dev The approve function may or may not return a bool. - * The ERC-20 spec returns a bool, but some tokens don't follow the spec. - * Need to check if data is empty or true. + * @dev approve fonksiyonu boolean bir değer dönmeyebilir. + * ERC-20'ler boolean değer dönüyor fakat bazı tokenlar buna uymayabilir. + * Verinin boş mu yoksa True mu oldğunu kontrol etmemiz gerekiyor. */ function safeApprove(IERC20 token, address spender, uint amount) internal { (bool success, bytes memory returnData) = address(token).call( diff --git a/src/pages/defi/uniswap-v2-add-remove-liquidity/index.html.ts b/src/pages/defi/uniswap-v2-add-remove-liquidity/index.html.ts index faf760d31..ef115d186 100644 --- a/src/pages/defi/uniswap-v2-add-remove-liquidity/index.html.ts +++ b/src/pages/defi/uniswap-v2-add-remove-liquidity/index.html.ts @@ -1,7 +1,7 @@ // metadata export const version = "0.8.20" -export const title = "Uniswap V2 Add Remove Liquidity" -export const description = "Uniswap V2 add remove liquidity" +export const title = "Uniswap V2 likidite ekleme ve çıkartma" +export const description = "Uniswap V2 likidite ekleme ve çıkartma" export const keywords = ["defi", "uniswap", "v2", "add", "remove", "liquidity", "amm"] @@ -16,7 +16,7 @@ export const codes = [ }, ] -const html = `

Add / Remove Liquidity

+const html = `

Likidite Ekleme / Çıkartma

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

Add / Remove Liquidity

} /** - * @dev The transferFrom function may or may not return a bool. - * The ERC-20 spec returns a bool, but some tokens don't follow the spec. - * Need to check if data is empty or true. + * @dev transferFrom fonksiyonu boolean bir değer dönmeyebilir. + * ERC-20'ler boolean değer dönüyor fakat bazı tokenlar buna uymayabilir. + * Verinin boş mu yoksa True mu oldğunu kontrol etmemiz gerekiyor. */ function safeTransferFrom( IERC20 token, @@ -89,9 +89,9 @@ const html = `

Add / Remove Liquidity

} /** - * @dev The approve function may or may not return a bool. - * The ERC-20 spec returns a bool, but some tokens don't follow the spec. - * Need to check if data is empty or true. + * @dev approve fonksiyonu boolean bir değer dönmeyebilir. + * ERC-20'ler boolean değer dönüyor fakat bazı tokenlar buna uymayabilir. + * Verinin boş mu yoksa True mu oldğunu kontrol etmemiz gerekiyor. */ function safeApprove(IERC20 token, address spender, uint amount) internal { (bool success, bytes memory returnData) = address(token).call( @@ -148,7 +148,7 @@ const html = `

Add / Remove Liquidity

uint amount
) external returns (bool)
; } -

Test with Foundry

+

Foundry ile Test Et

forge test --fork-url <ethereum-mainnet-rpc>

// SPDX-License-Identifier: MIT
 pragma solidity ^0.8.20;
@@ -165,15 +165,15 @@ IERC20 constant PAIR contract UniswapV2AddLiquidityTest is Test {
     UniswapV2AddLiquidity private uni = new UniswapV2AddLiquidity();
 
-    //  Add WETH/USDT Liquidity to Uniswap
+    //  Uniswap'a WETH/USDT likiditesi ekle
     function testAddLiquidity() public {
-        // Deal test USDT and WETH to this contract
+        // USDT ve WETH bakiyesini kontrol et
         deal(address(USDT), address(this), 1e6 * 1e6);
         assertEq(USDT.balanceOf(address(this)), 1e6 * 1e6, "USDT balance incorrect");
         deal(address(WETH), address(this), 1e6 * 1e18);
         assertEq(WETH.balanceOf(address(this)), 1e6 * 1e18, "WETH balance incorrect");
 
-        // Approve uni for transferring
+        // Uniswap'a harcama izni ver
         safeApprove(WETH, address(uni), 1e64);
         safeApprove(USDT, address(uni), 1e64);
 
@@ -182,9 +182,9 @@ IERC20 constant PAIR address(uni)), 0, "pair balance 0");
     }
 
-    // Remove WETH/USDT Liquidity from Uniswap
+    // Uniswap'tan WETH/USDT likiditesini kaldır
     function testRemoveLiquidity() public {
-        // Deal LP tokens to uni
+        // LP tokenları için bakiye kontrolü
         deal(address(PAIR), address(uni), 1e10);
         assertEq(PAIR.balanceOf(address(uni)), 1e10, "LP tokens balance = 0");
         assertEq(USDT.balanceOf(address(uni)), 0, "USDT balance non-zero");
@@ -198,9 +198,9 @@ IERC20 constant PAIR /**
-     * @dev The transferFrom function may or may not return a bool.
-     * The ERC-20 spec returns a bool, but some tokens don't follow the spec.
-     * Need to check if data is empty or true.
+     * @dev transferFrom fonksiyonu boolean bir değer dönmeyebilir.
+     * ERC-20'ler boolean değer dönüyor fakat bazı tokenlar buna uymayabilir.
+     * Verinin boş mu yoksa True mu oldğunu kontrol etmemiz gerekiyor.
      */
     function safeTransferFrom(
         IERC20 token,
@@ -218,9 +218,9 @@ IERC20 constant PAIR /**
-     * @dev The approve function may or may not return a bool.
-     * The ERC-20 spec returns a bool, but some tokens don't follow the spec.
-     * Need to check if data is empty or true.
+     * @dev approve fonksiyonu boolean bir değer dönmeyebilir.
+     * ERC-20'ler boolean değer dönüyor fakat bazı tokenlar buna uymayabilir.
+     * Verinin boş mu yoksa True mu oldğunu kontrol etmemiz gerekiyor.
      */
     function safeApprove(IERC20 token, address spender, uint amount) internal {
         (bool success, bytes memory returnData) = address(token).call(
diff --git a/src/pages/defi/uniswap-v2-add-remove-liquidity/index.md b/src/pages/defi/uniswap-v2-add-remove-liquidity/index.md
index 6792eac75..8c2c83cb2 100644
--- a/src/pages/defi/uniswap-v2-add-remove-liquidity/index.md
+++ b/src/pages/defi/uniswap-v2-add-remove-liquidity/index.md
@@ -1,17 +1,17 @@
 ---
-title: Uniswap V2 Add Remove Liquidity
+title: Uniswap V2 Likidite Ekleme ve Çıkartma
 version: 0.8.20
-description: Uniswap V2 add remove liquidity
+description: Uniswap V2 likidite ekleme ve çıkartma
 keywords: [defi, uniswap, v2, add, remove, liquidity, amm]
 ---
 
-### Add / Remove Liquidity
+### Likidite Ekleme / Çıkartma
 
 ```solidity
 {{{UniswapV2Liquidity}}}
 ```
 
-### Test with Foundry
+### Foundry ile Test Et
 
 `forge test --fork-url `