# Contract scan report

> **Automated scan, not an audit. Findings may be false positives; absence of findings does not mean the code is safe.**

- Scan id: `b92994df-c714-44f4-855a-2605d6d639bd`
- Status: **ok**
- Contract: `0x7a250d5630B4cF539739dF2C5dAcb4c659F2488D` on ethereum (UniswapV2Router02.sol:UniswapV2Router02)
- Input: address, 1 file(s), 701 nSLOC, sha256 `afe8b09aa8fcad28...`
- Compiler: solc 0.6.6
- Duration: 2.1 s

## Summary

| High | Medium | Low | Info |
|---|---|---|---|
| 0 | 0 | 6 | 0 |

## Findings

### F-001 [LOW] Unused return

`unused-return` (slither) · confidence medium · `UniswapV2Router02.sol:258`

```solidity
            IUniswapV2Factory(factory).createPair(tokenA, tokenB);
```

UniswapV2Router02._addLiquidity(address,address,uint256,uint256,uint256,uint256) (UniswapV2Router02.sol#248-275) ignores return value by IUniswapV2Factory(factory).createPair(tokenA,tokenB) (UniswapV2Router02.sol#258)

**Why it matters:** The return value of an external call is not stored in a local or state variable.

**Fix:** Ensure that all the return values of the function calls are used.

### F-002 [LOW] Calls inside a loop

`calls-loop` (slither) · confidence medium · `UniswapV2Router02.sol:434`

```solidity
            IUniswapV2Pair(UniswapV2Library.pairFor(factory, input, output)).swap(
                amount0Out, amount1Out, to, new bytes(0)
            );
```

UniswapV2Router02._swap(uint256[],address[],address) (UniswapV2Router02.sol#427-438) has external calls inside a loop: IUniswapV2Pair(UniswapV2Library.pairFor(factory,input,output)).swap(amount0Out,amount1Out,to,new bytes(0)) (UniswapV2Router02.sol#434-436)
	Calls stack containing the loop:
		UniswapV2Router02.swapETHForExactTokens(uint256,address[],address,uint256)

**Why it matters:** Calls inside a loop might lead to a denial-of-service attack.

**Fix:** Favor [pull over push](https://consensysdiligence.github.io/smart-contract-best-practices/development-recommendations/general/external-calls/#favor-pull-over-push-for-external-calls) strategy for external calls.

### F-003 [LOW] Calls inside a loop

`calls-loop` (slither) · confidence medium · `UniswapV2Router02.sol:544`

```solidity
            (uint reserve0, uint reserve1,) = pair.getReserves();
```

UniswapV2Router02._swapSupportingFeeOnTransferTokens(address[],address) (UniswapV2Router02.sol#536-553) has external calls inside a loop: (reserve0,reserve1,None) = pair.getReserves() (UniswapV2Router02.sol#544)
	Calls stack containing the loop:
		UniswapV2Router02.swapExactETHForTokensSupportingFeeOnTransferTokens(uint256,address[],address,uint256)

**Why it matters:** Calls inside a loop might lead to a denial-of-service attack.

**Fix:** Favor [pull over push](https://consensysdiligence.github.io/smart-contract-best-practices/development-recommendations/general/external-calls/#favor-pull-over-push-for-external-calls) strategy for external calls.

### F-004 [LOW] Calls inside a loop

`calls-loop` (slither) · confidence medium · `UniswapV2Router02.sol:546`

```solidity
            amountInput = IERC20(input).balanceOf(address(pair)).sub(reserveInput);
```

UniswapV2Router02._swapSupportingFeeOnTransferTokens(address[],address) (UniswapV2Router02.sol#536-553) has external calls inside a loop: amountInput = IERC20(input).balanceOf(address(pair)).sub(reserveInput) (UniswapV2Router02.sol#546)
	Calls stack containing the loop:
		UniswapV2Router02.swapExactETHForTokensSupportingFeeOnTransferTokens(uint256,address[],address,uint256)

**Why it matters:** Calls inside a loop might lead to a denial-of-service attack.

**Fix:** Favor [pull over push](https://consensysdiligence.github.io/smart-contract-best-practices/development-recommendations/general/external-calls/#favor-pull-over-push-for-external-calls) strategy for external calls.

### F-005 [LOW] Calls inside a loop

`calls-loop` (slither) · confidence medium · `UniswapV2Router02.sol:551`

```solidity
            pair.swap(amount0Out, amount1Out, to, new bytes(0));
```

UniswapV2Router02._swapSupportingFeeOnTransferTokens(address[],address) (UniswapV2Router02.sol#536-553) has external calls inside a loop: pair.swap(amount0Out,amount1Out,to,new bytes(0)) (UniswapV2Router02.sol#551)
	Calls stack containing the loop:
		UniswapV2Router02.swapExactETHForTokensSupportingFeeOnTransferTokens(uint256,address[],address,uint256)

**Why it matters:** Calls inside a loop might lead to a denial-of-service attack.

**Fix:** Favor [pull over push](https://consensysdiligence.github.io/smart-contract-best-practices/development-recommendations/general/external-calls/#favor-pull-over-push-for-external-calls) strategy for external calls.

### F-006 [LOW] Reentrancy vulnerabilities

`reentrancy-balance` (slither) · confidence medium · `UniswapV2Router02.sol:565`

```solidity
        _swapSupportingFeeOnTransferTokens(path, to);
```

Reentrancy in UniswapV2Router02.swapExactTokensForTokensSupportingFeeOnTransferTokens(uint256,uint256,address[],address,uint256) (UniswapV2Router02.sol#554-570):
	External call allowing reentrancy:
	- _swapSupportingFeeOnTransferTokens(path,to) (UniswapV2Router02.sol#565)
		- pair.swap(amount0Out,amount1Out,to,new bytes(0)) (UniswapV2Router02.sol#551)
	Balance read before the call:
	- balanceBefore = IERC20(path[path.length - 1]).balanceOf(to) (UniswapV2Router02.sol#564)
	Possible stale balance used after the call in a condition:
	- require(bool,string)(IERC20(path[path.length - 1]).balanceOf(to).sub(balanceBefore) &gt;= amountOutMin,UniswapV2Router: INSUFFICIENT_OUTPUT_AMOUNT) (UniswapV2Router02.sol#566-569)
		- stale variable `TMP_209`

**Why it matters:** 
Detects reentrancy vulnerabilities where a balance is saved (e.g., `balanceOf`) before an external call,
and the same balance is checked again after the call. An attacker could manipulate the balance during the reentrant call,
causing the post-call check to use an outdated value.

**Fix:** Use `transferFrom` to transfer funds of a standard ERC20 token, or use reentrancy guards to prevent reentering the function.
