# Uniswap + Sushiswap Half-Half Router ## Tasks Write a router smart contract that allows users to swap exact tokens to another tokens. The router splits the input about into two parts: first half goes to Uniswap v2 and the remaining to Sushiswap. See code template below. You can use any dev enrivonment, such as Truffle, Brownie, Hardhat, etc - your choice. We don't require unit tests but you should be able to show that the code works on mainnet fork. Your contract does not need to work with tokens that violate ERC20 specification (such as rebase tokens or fee-on-transfer tokens). ## Test cases 0. take 1M DAI from anywhere. Maybe steal (force transfer) from binance 0xF977814e90dA44bFA03b6295A0616a897441aceC (on mainnet fork) 1. read DAI balance of uniswap and sushiswaap pair DAI-WETH 2. swap 1000 DAI->weth->USDT with min amount out = 1500 -> should revert. be careful of token decimals! 3. swap 1000 DAI->weth->USDT with min amount out = 900 -> should be ok 4. you should see output amounts = [1000, what ever eth worth about \$1000, almost 1000] 5. you should have almost 1000 USDT and 1000 less DAI 6. DAI balance of uniswap pair DAI-WETH should increase by 500 7. DAI balance of sushiswap pair DAI-WETH should increase by 500 8. repeat the same process again from 1-6. should still work with less amout of USDT received. ## Code template ```solidity pragma solidity 0.8.3; contract HalfHalfRouter { // TODO constructor(address _univ2Router, address _sushiRouter) { // TODO } function swapExactTokensForTokens( uint amountIn, uint amountOutMin, address[] calldata path, address to, uint deadline ) external returns (uint[] memory amounts) { // TODO } } ```