Contract 0x733182852d43503Daa6d085248Fd9F096d5DCFc9

 
 
Txn Hash
Method
Block
From
To
Value [Txn Fee]
0xc83ec12ea6d1f08d92e27ed9b2ae218d4e340a6e8000ade72dc93b5da0c721d1Migrate With Dep...204881142021-10-22 13:03:48593 days 2 hrs ago0xc4417ee91ec12a94cf8cbe5e8f19e7db84b8df4c IN  0x733182852d43503daa6d085248fd9f096d5dcfc90 MATIC0.013844730
0x59a55ce3a8674a6a8254bdb23a4ef484746773148101fd40dd38856e70246729Migrate With Dep...197340802021-10-01 22:04:13613 days 17 hrs ago0xf56a0697d193cf6d7bf80d07d158211e1b0fda8c IN  0x733182852d43503daa6d085248fd9f096d5dcfc90 MATIC0.00568923612
0x784fa8d17d4746d55c72ccd1be6dd59919a0e3a4511a46f88d104a844c7e93fdMigrate With Dep...185312812021-08-29 21:06:56646 days 18 hrs ago0x6c4f72d0860f94ab3122923b6c05733ccf72d55c IN  0x733182852d43503daa6d085248fd9f096d5dcfc90 MATIC0.001954083964.44
0x7739958e2865341ec0e3fe153c7a761c123219eee42b98fbadc81ba6e7b24323Migrate With Dep...183005582021-08-23 9:39:28653 days 5 hrs ago0x742bc3e616d3c45075e248f57418501e38533745 IN  0x733182852d43503daa6d085248fd9f096d5dcfc90 MATIC0.0039732307178.690184833
0xcb8b9f43f871a8b7eed3751b424b5e6f77744e2d43d99a85bd88abbaffeff443Migrate182266412021-08-21 9:12:23655 days 6 hrs ago0xe93b89fef7cbce1593bc6b504308666db0605996 IN  0x733182852d43503daa6d085248fd9f096d5dcfc90 MATIC0.0003674311451.256742001
0x96398620b74e4ce5ac06515865705c443aa5a6f25c4931c50aec9d9b6ed3f5cfMigrate With Dep...181451802021-08-19 4:43:30657 days 10 hrs ago0xc1dd00933bff0eee86c610b3379ba21ed5791b5f IN  0x733182852d43503daa6d085248fd9f096d5dcfc90 MATIC0.01527657709333.580282317
0x748ff29a462f96a5710775d7fb8d2089370d0cf64105bfd87210cf11fa5b9836Migrate180869752021-08-17 15:11:51659 days 22 mins ago0x59f52c31a2f06e66bc6694f52ccdb0d87f96c991 IN  0x733182852d43503daa6d085248fd9f096d5dcfc90 MATIC0.00031281691.1
0x7d6b5b923d9cabc1f24a3481b7c0f72b0f85d63afaa4b15c3b44a73d157b6c0bMigrate With Dep...180647712021-08-17 0:54:56659 days 14 hrs ago0x7f79e72e21de135867526a4838d1a793f2796ebf IN  0x733182852d43503daa6d085248fd9f096d5dcfc90 MATIC0.0022006055
0x7b85e312a7525cd80b0fae89ae9c6c977d12eef65f2d1245b396f25b92d8d2c7Migrate180605982021-08-16 22:02:57659 days 17 hrs ago0xe93b89fef7cbce1593bc6b504308666db0605996 IN  0x733182852d43503daa6d085248fd9f096d5dcfc90 MATIC0.000327344551.11
0xa45bb4f8d38d0f55922cb152494f183371a9c5a64a47106a7f89aee7cfa1f6e4Migrate With Dep...179482302021-08-13 19:19:12662 days 20 hrs ago0xdb6958f73aa1cbfbe26eb4c104038594a4602ef6 IN  0x733182852d43503daa6d085248fd9f096d5dcfc90 MATIC0.00096016412.1
0x2b553d5182ca27e3a94a5ef158dd1eb3a5a1317f1ff1a201231b3c3f23452183Migrate177631392021-08-08 17:24:04667 days 22 hrs ago0x7a869e79b3772fd4d1bde39cba3d00e22e9639ca IN  0x733182852d43503daa6d085248fd9f096d5dcfc90 MATIC0.0003289714031.110111
0xcdb26130bc96e9d18a75b35cc110b874b6cb1db9f420decd1b7608d316211eb2Migrate With Dep...177182642021-08-07 12:30:42669 days 3 hrs ago0xe99d360a3f00ce3e27713b643c508b04489843fb IN  0x733182852d43503daa6d085248fd9f096d5dcfc90 MATIC0.00908424123
0xa22cce0b9768bb13c415849f751b011e4c1f618f4d2b9ae2caccc883af6d863dMigrate176878962021-08-06 16:57:36669 days 22 hrs ago0x18be2c52b52bdfb3131c8cc7c1306d9ca4c291d5 IN  0x733182852d43503daa6d085248fd9f096d5dcfc90 MATIC0.000344646751.05
0x47b1b8c092d22ecdc5e19dbb0e377ed49791c01854d38209d205ec3c37068e1bMigrate With Dep...176777102021-08-06 10:29:04670 days 5 hrs ago0xc770240526d75bd0b5662d7b8d8aed9cba243d5f IN  0x733182852d43503daa6d085248fd9f096d5dcfc90 MATIC0.0022062155
0x52ea6e2a15eb00fb48cd0ca3574f60033641348df4442c1f4c8ce371da33551dMigrate With Dep...176432732021-08-05 9:47:05671 days 5 hrs ago0x6fbb0c963bd514ec00b71b60f45bfd200f86478f IN  0x733182852d43503daa6d085248fd9f096d5dcfc90 MATIC0.00052824721.2
0xe036ede015d3d65898678cd46fecb957b4ad20e7f9851764b374e6123cbb186fMigrate With Dep...176421212021-08-05 9:04:41671 days 6 hrs ago0x48037e74c97fcfa703f2e83595bee7ca20115f8c IN  0x733182852d43503daa6d085248fd9f096d5dcfc90 MATIC0.0104814746424.36
0xd43b17e932cc97c618e42e0198cf92add57e926f4e081a9d94262487c49b7b51Migrate With Dep...175620012021-08-03 5:55:02673 days 9 hrs ago0x8363dd05503f170276e136a6a27d4f06c84c16a9 IN  0x733182852d43503daa6d085248fd9f096d5dcfc90 MATIC0.0045526410
0x258547063ffb8580134f9b76d184529bfcd3dde5dd3054c7f98dd392c688c4e4Migrate With Dep...175372122021-08-02 14:44:51674 days 49 mins ago0xd807dd8d987bf7ecfc9c0df6cd81ddd0c323dd7b IN  0x733182852d43503daa6d085248fd9f096d5dcfc90 MATIC0.0011413534722.604913963
0x2ec4b791cc2ae27d8fcf6dd7abe84cce0be85317437d3a9072526f0c667c1526Migrate With Dep...175294552021-08-02 9:16:59674 days 6 hrs ago0x177df1fcf176931d36dcbb92791fad12b7d77f1b IN  0x733182852d43503daa6d085248fd9f096d5dcfc90 MATIC0.0026420346
0xca1fbc9ca66363f8fab2fc96c2b2fbc1d2c354ff369605a1c9d296e3e98a162dMigrate174858662021-08-01 6:00:11675 days 9 hrs ago0xeda687a18d49fdcddfae38475cc4f3ce979ac133 IN  0x733182852d43503daa6d085248fd9f096d5dcfc90 MATIC0.001570921525.32
0x5f074bd006e3429c776f6d880999fdeb9d9fa11f48ef123ca390c4e1885249e3Migrate With Dep...174354642021-07-30 19:47:32676 days 19 hrs ago0xeda687a18d49fdcddfae38475cc4f3ce979ac133 IN  0x733182852d43503daa6d085248fd9f096d5dcfc90 MATIC0.003227515027.605588216
0x4da1a8c00d4cdbc74a5bdec2dd32c416b1ae13bbd501242a4e0090b4bfea3fb8Migrate With Dep...174309362021-07-30 16:52:28676 days 22 hrs ago0x6bdf6d03328e04cf4e5079ea347e0c413afcdf63 IN  0x733182852d43503daa6d085248fd9f096d5dcfc90 MATIC0.0021114255
0x0d4e0306d778dff1421b6d39d403a14f0591e398781dac5f15090dec903fc88fMigrate With Dep...174308242021-07-30 16:48:36676 days 22 hrs ago0xca4025f63cec0b2b19f251bee7f90b6e79de7ff0 IN  0x733182852d43503daa6d085248fd9f096d5dcfc90 MATIC0.0010311239772.2644
0xa474e81e57581f068f00135d66f49e6d777bc066cab3139cfaf938a1cf21a6ddMigrate With Dep...174274592021-07-30 14:42:09677 days 52 mins ago0x42238feb30ddb3991c57ae74af2f05f26cf41139 IN  0x733182852d43503daa6d085248fd9f096d5dcfc90 MATIC0.011184925
0xe0238b8e275059a30cff02cbaea045fcb073e1c0d5a97b0480a694889ef49222Migrate With Dep...174273142021-07-30 14:37:07677 days 57 mins ago0x9f5f83e27b542814325c6a0bad269454bd36de7e IN  0x733182852d43503daa6d085248fd9f096d5dcfc90 MATIC0.0103158287725.09
[ Download CSV Export 
Latest 25 internal transaction
Parent Txn Hash Block From To Value
0xc83ec12ea6d1f08d92e27ed9b2ae218d4e340a6e8000ade72dc93b5da0c721d1204881142021-10-22 13:03:48593 days 2 hrs ago 0x733182852d43503daa6d085248fd9f096d5dcfc9 Polygon: WMATIC Token0.031305638988213386 MATIC
0xc83ec12ea6d1f08d92e27ed9b2ae218d4e340a6e8000ade72dc93b5da0c721d1204881142021-10-22 13:03:48593 days 2 hrs ago 0x4c28f48448720e9000907bc2611f73022fdce1fa 0x733182852d43503daa6d085248fd9f096d5dcfc90.031305638988213386 MATIC
0x59a55ce3a8674a6a8254bdb23a4ef484746773148101fd40dd38856e70246729197340802021-10-01 22:04:13613 days 17 hrs ago 0x733182852d43503daa6d085248fd9f096d5dcfc9 Polygon: WMATIC Token1,021.35366680113822744 MATIC
0x59a55ce3a8674a6a8254bdb23a4ef484746773148101fd40dd38856e70246729197340802021-10-01 22:04:13613 days 17 hrs ago 0x4c28f48448720e9000907bc2611f73022fdce1fa 0x733182852d43503daa6d085248fd9f096d5dcfc91,021.35366680113822744 MATIC
0x784fa8d17d4746d55c72ccd1be6dd59919a0e3a4511a46f88d104a844c7e93fd185312812021-08-29 21:06:56646 days 18 hrs ago 0x733182852d43503daa6d085248fd9f096d5dcfc9 Polygon: WMATIC Token0.510218316793780119 MATIC
0x784fa8d17d4746d55c72ccd1be6dd59919a0e3a4511a46f88d104a844c7e93fd185312812021-08-29 21:06:56646 days 18 hrs ago 0x4c28f48448720e9000907bc2611f73022fdce1fa 0x733182852d43503daa6d085248fd9f096d5dcfc90.510218316793780119 MATIC
0x7739958e2865341ec0e3fe153c7a761c123219eee42b98fbadc81ba6e7b24323183005582021-08-23 9:39:28653 days 5 hrs ago 0x733182852d43503daa6d085248fd9f096d5dcfc9 Polygon: WMATIC Token39.892943711761293597 MATIC
0x7739958e2865341ec0e3fe153c7a761c123219eee42b98fbadc81ba6e7b24323183005582021-08-23 9:39:28653 days 5 hrs ago 0x4c28f48448720e9000907bc2611f73022fdce1fa 0x733182852d43503daa6d085248fd9f096d5dcfc939.892943711761293597 MATIC
0x96398620b74e4ce5ac06515865705c443aa5a6f25c4931c50aec9d9b6ed3f5cf181451802021-08-19 4:43:30657 days 10 hrs ago 0x733182852d43503daa6d085248fd9f096d5dcfc9 Polygon: WMATIC Token18.875957568081993011 MATIC
0x96398620b74e4ce5ac06515865705c443aa5a6f25c4931c50aec9d9b6ed3f5cf181451802021-08-19 4:43:30657 days 10 hrs ago 0x4c28f48448720e9000907bc2611f73022fdce1fa 0x733182852d43503daa6d085248fd9f096d5dcfc918.875957568081993011 MATIC
0x7d6b5b923d9cabc1f24a3481b7c0f72b0f85d63afaa4b15c3b44a73d157b6c0b180647712021-08-17 0:54:56659 days 14 hrs ago 0x733182852d43503daa6d085248fd9f096d5dcfc9 Polygon: WMATIC Token89.420741080326088206 MATIC
0x7d6b5b923d9cabc1f24a3481b7c0f72b0f85d63afaa4b15c3b44a73d157b6c0b180647712021-08-17 0:54:56659 days 14 hrs ago 0x4c28f48448720e9000907bc2611f73022fdce1fa 0x733182852d43503daa6d085248fd9f096d5dcfc989.420741080326088206 MATIC
0xa45bb4f8d38d0f55922cb152494f183371a9c5a64a47106a7f89aee7cfa1f6e4179482302021-08-13 19:19:12662 days 20 hrs ago 0x733182852d43503daa6d085248fd9f096d5dcfc9 Polygon: WMATIC Token33.068159172542804788 MATIC
0xa45bb4f8d38d0f55922cb152494f183371a9c5a64a47106a7f89aee7cfa1f6e4179482302021-08-13 19:19:12662 days 20 hrs ago 0x4c28f48448720e9000907bc2611f73022fdce1fa 0x733182852d43503daa6d085248fd9f096d5dcfc933.068159172542804788 MATIC
0x2b553d5182ca27e3a94a5ef158dd1eb3a5a1317f1ff1a201231b3c3f23452183177631392021-08-08 17:24:04667 days 22 hrs ago 0x733182852d43503daa6d085248fd9f096d5dcfc9 Polygon: WMATIC Token863.198987060203174375 MATIC
0x2b553d5182ca27e3a94a5ef158dd1eb3a5a1317f1ff1a201231b3c3f23452183177631392021-08-08 17:24:04667 days 22 hrs ago 0x4c28f48448720e9000907bc2611f73022fdce1fa 0x733182852d43503daa6d085248fd9f096d5dcfc9863.198987060203174375 MATIC
0xcdb26130bc96e9d18a75b35cc110b874b6cb1db9f420decd1b7608d316211eb2177182642021-08-07 12:30:42669 days 3 hrs ago 0x733182852d43503daa6d085248fd9f096d5dcfc9 Polygon: WMATIC Token1.143759519305761101 MATIC
0xcdb26130bc96e9d18a75b35cc110b874b6cb1db9f420decd1b7608d316211eb2177182642021-08-07 12:30:42669 days 3 hrs ago 0x4c28f48448720e9000907bc2611f73022fdce1fa 0x733182852d43503daa6d085248fd9f096d5dcfc91.143759519305761101 MATIC
0xa22cce0b9768bb13c415849f751b011e4c1f618f4d2b9ae2caccc883af6d863d176878962021-08-06 16:57:36669 days 22 hrs ago 0x733182852d43503daa6d085248fd9f096d5dcfc9 Polygon: WMATIC Token0.484611859119746181 MATIC
0xa22cce0b9768bb13c415849f751b011e4c1f618f4d2b9ae2caccc883af6d863d176878962021-08-06 16:57:36669 days 22 hrs ago 0x4c28f48448720e9000907bc2611f73022fdce1fa 0x733182852d43503daa6d085248fd9f096d5dcfc90.484611859119746181 MATIC
0x47b1b8c092d22ecdc5e19dbb0e377ed49791c01854d38209d205ec3c37068e1b176777102021-08-06 10:29:04670 days 5 hrs ago 0x733182852d43503daa6d085248fd9f096d5dcfc9 Polygon: WMATIC Token220.276934255780833842 MATIC
0x47b1b8c092d22ecdc5e19dbb0e377ed49791c01854d38209d205ec3c37068e1b176777102021-08-06 10:29:04670 days 5 hrs ago 0x4c28f48448720e9000907bc2611f73022fdce1fa 0x733182852d43503daa6d085248fd9f096d5dcfc9220.276934255780833842 MATIC
0x52ea6e2a15eb00fb48cd0ca3574f60033641348df4442c1f4c8ce371da33551d176432732021-08-05 9:47:05671 days 5 hrs ago 0x733182852d43503daa6d085248fd9f096d5dcfc9 Polygon: WMATIC Token0.018030722705176345 MATIC
0x52ea6e2a15eb00fb48cd0ca3574f60033641348df4442c1f4c8ce371da33551d176432732021-08-05 9:47:05671 days 5 hrs ago 0x4c28f48448720e9000907bc2611f73022fdce1fa 0x733182852d43503daa6d085248fd9f096d5dcfc90.018030722705176345 MATIC
0xe036ede015d3d65898678cd46fecb957b4ad20e7f9851764b374e6123cbb186f176421212021-08-05 9:04:41671 days 6 hrs ago 0x733182852d43503daa6d085248fd9f096d5dcfc9 Polygon: WMATIC Token743.71636423880688429 MATIC
[ Download CSV Export 
Loading

Contract Source Code Verified (Exact Match)

Contract Name:
PolydexMigratorDFYN

Compiler Version
v0.7.6+commit.7338295f

Optimization Enabled:
Yes with 200 runs

Other Settings:
default evmVersion
File 1 of 13 : PolydexMigratorDFYN.sol
// SPDX-License-Identifier: MIT

pragma solidity =0.7.6;

import "@openzeppelin/contracts/token/ERC20/IERC20.sol";
import "@openzeppelin/contracts/token/ERC20/SafeERC20.sol";
import "../interfaces/IPolydexPair.sol";
import "../interfaces/IPolydexRouter.sol";
import "../interfaces/IPolydexFactory.sol";
import "../libraries/PolydexLibrary.sol";
import "../interfaces/IFarm.sol";
import '../interfaces/IWETH.sol';
import "../interfaces/IStakingPool.sol";

// Migrator helps you migrate your existing LP tokens to Polydex LP ones
contract PolydexMigratorDFYN {
using SafeERC20 for IERC20;

    IPolydexRouter public oldRouter;
    IPolydexRouter public router;
    address public WETH;
    address public dfynWeth;


    constructor(IPolydexRouter _oldRouter, IPolydexRouter _router, address _WETH, address _dfynWeth) {
        oldRouter = _oldRouter;
        router = _router;
        dfynWeth = _dfynWeth;
        WETH = _WETH;
    }

    receive() external payable {
        assert(msg.sender == dfynWeth || msg.sender == WETH); // only accept ETH via fallback from the WETH and dfynWETH contract
    }

    function migrateWithPermit(
        address tokenA,
        address tokenB,
        uint256 liquidity,
        uint256 amountAMin,
        uint256 amountBMin,
        uint256 deadline,
        uint8 v,
        bytes32 r,
        bytes32 s
    ) public {
        IPolydexPair pair = IPolydexPair(pairForOldRouter(tokenA, tokenB));
        pair.permit(msg.sender, address(this), liquidity, deadline, v, r, s);

        migrate(tokenA, tokenB, liquidity, amountAMin, amountBMin, deadline);
    }

    // msg.sender should have approved 'liquidity' amount of LP token of 'tokenA' and 'tokenB'
    function migrate(
        address tokenA,
        address tokenB,
        uint256 liquidity,
        uint256 amountAMin,
        uint256 amountBMin,
        uint256 deadline
    ) public {
        require(deadline >= block.timestamp, 'Swap: EXPIRED');
        address TokenA = tokenA;
        address TokenB = tokenB;
        // Remove liquidity from the old router with permit
        (uint256 amountA, uint256 amountB) = removeLiquidity(
            tokenA,
            tokenB,
            liquidity,
            amountAMin,
            amountBMin
        );

        if( tokenA == dfynWeth){
          IWETH(dfynWeth).withdraw(amountA);
          IWETH(WETH).deposit{value: amountA}();
          TokenA = WETH;
        }

        if( tokenB == dfynWeth){
          IWETH(dfynWeth).withdraw(amountB);
          IWETH(WETH).deposit{value: amountB}();
          TokenB = WETH;
        }

        // Add liquidity to the new router
        (uint256 pooledAmountA, uint256 pooledAmountB) = addLiquidity(TokenA, TokenB, amountA, amountB);

        // Send remaining tokens to msg.sender
        if (amountA > pooledAmountA) {
            IERC20(TokenA).safeTransfer(msg.sender, amountA - pooledAmountA);
        }
        if (amountB > pooledAmountB) {
            IERC20(TokenB).safeTransfer(msg.sender, amountB - pooledAmountB);
        }
    }

    function migrateWithDeposit(
        address tokenA,
        address tokenB,
        uint256 liquidity,
        uint256 amountAMin,
        uint256 amountBMin,
        uint256 deadline,
        address _Farm,
        uint256 pid
    ) public {
        require(deadline >= block.timestamp, 'Swap: EXPIRED');
        address TokenA = tokenA;
        address TokenB = tokenB;
        // Remove liquidity from the old router with permit
        (uint256 amountA, uint256 amountB) = removeLiquidity(
            tokenA,
            tokenB,
            liquidity,
            amountAMin,
            amountBMin
        );

        if( tokenA == dfynWeth){
          IWETH(dfynWeth).withdraw(amountA);
          IWETH(WETH).deposit{value: amountA}();
          TokenA = WETH;
        }

        if( tokenB == dfynWeth){
          IWETH(dfynWeth).withdraw(amountB);
          IWETH(WETH).deposit{value: amountB}();
          TokenB = WETH;
        }

        // Add liquidity to the new router
        (uint256 pooledAmountA, uint256 pooledAmountB) = addLiquidityWithDeposit(TokenA, TokenB, amountA, amountB, pid, _Farm);


        // Send remaining tokens to msg.sender
        if (amountA > pooledAmountA) {
            IERC20(TokenA).safeTransfer(msg.sender, amountA - pooledAmountA);
        }
        if (amountB > pooledAmountB) {
            IERC20(TokenB).safeTransfer(msg.sender, amountB - pooledAmountB);
        }
    }

    function removeLiquidity(
        address tokenA,
        address tokenB,
        uint256 liquidity,
        uint256 amountAMin,
        uint256 amountBMin
    ) internal returns (uint256 amountA, uint256 amountB) {
        IPolydexPair pair = IPolydexPair(pairForOldRouter(tokenA, tokenB));
        pair.transferFrom(msg.sender, address(pair), liquidity);
        (uint256 amount0, uint256 amount1) = pair.burn(address(this));
        (address token0,) = PolydexLibrary.sortTokens(tokenA, tokenB);
        (amountA, amountB) = tokenA == token0 ? (amount0, amount1) : (amount1, amount0);
        require(amountA >= amountAMin, 'PolyDexMigrator: INSUFFICIENT_A_AMOUNT');
        require(amountB >= amountBMin, 'PolyDexMigrator: INSUFFICIENT_B_AMOUNT');
    }

    // calculates the CREATE2 address for a pair without making any external calls
    function pairForOldRouter(address tokenA, address tokenB) internal view returns (address pair) {
        (address token0, address token1) = PolydexLibrary.sortTokens(tokenA, tokenB);
        pair = address(uint(keccak256(abi.encodePacked(
                hex'ff',
                oldRouter.factory(),
                keccak256(abi.encodePacked(token0, token1)),
                // Init code hash. It would be specific each exchange(different for quickswap, dfyn, etc).
                // So when deploying Migrator, change it.
                hex'f187ed688403aa4f7acfada758d8d53698753b998a3071b06f1b777f4330eaf3' // dfyn init code hash
            ))));
    }

    function addLiquidity(
        address tokenA,
        address tokenB,
        uint256 amountADesired,
        uint256 amountBDesired
    ) internal returns (uint amountA, uint amountB) {
        (amountA, amountB) = _addLiquidity(tokenA, tokenB, amountADesired, amountBDesired);
        address pair = PolydexLibrary.pairFor(router.factory(), tokenA, tokenB);
        IERC20(tokenA).safeTransfer(pair, amountA);
        IERC20(tokenB).safeTransfer(pair, amountB);
        IPolydexPair(pair).mint(msg.sender);
    }

    function addLiquidityWithDeposit(
        address tokenA,
        address tokenB,
        uint256 amountADesired,
        uint256 amountBDesired,
        uint256 pid,
        address _Farm
    ) internal returns (uint amountA, uint amountB) {
        (amountA, amountB) = _addLiquidity(tokenA, tokenB, amountADesired, amountBDesired);
        address pair = PolydexLibrary.pairFor(router.factory(), tokenA, tokenB);
        IERC20(tokenA).safeTransfer(pair, amountA);
        IERC20(tokenB).safeTransfer(pair, amountB);
        uint256 liquidity = IPolydexPair(pair).mint(address(this));
        IPolydexPair(pair).approve(_Farm,liquidity);
        if(pid == uint256(-1)){
            IStakingPool(_Farm).depositFor(liquidity, msg.sender);
        }else{
            IFarm(_Farm).depositFor(pid, liquidity, msg.sender);
        }
    }


    function _addLiquidity(
        address tokenA,
        address tokenB,
        uint256 amountADesired,
        uint256 amountBDesired
    ) internal returns (uint256 amountA, uint256 amountB) {
        // create the pair if it doesn't exist yet
        IPolydexFactory factory = IPolydexFactory(router.factory());
        if (factory.getPair(tokenA, tokenB) == address(0)) {
            factory.createPair(tokenA, tokenB);
        }
        (uint256 reserveA, uint256 reserveB) = PolydexLibrary.getReserves(address(factory), tokenA, tokenB);
        if (reserveA == 0 && reserveB == 0) {
            (amountA, amountB) = (amountADesired, amountBDesired);
        } else {
            uint256 amountBOptimal = PolydexLibrary.quote(amountADesired, reserveA, reserveB);
            if (amountBOptimal <= amountBDesired) {
                (amountA, amountB) = (amountADesired, amountBOptimal);
            } else {
                uint256 amountAOptimal = PolydexLibrary.quote(amountBDesired, reserveB, reserveA);
                assert(amountAOptimal <= amountADesired);
                (amountA, amountB) = (amountAOptimal, amountBDesired);
            }
        }
    }
}

File 2 of 13 : IERC20.sol
// SPDX-License-Identifier: MIT

pragma solidity >=0.6.0 <0.8.0;

/**
 * @dev Interface of the ERC20 standard as defined in the EIP.
 */
interface IERC20 {
    /**
     * @dev Returns the amount of tokens in existence.
     */
    function totalSupply() external view returns (uint256);

    /**
     * @dev Returns the amount of tokens owned by `account`.
     */
    function balanceOf(address account) external view returns (uint256);

    /**
     * @dev Moves `amount` tokens from the caller's account to `recipient`.
     *
     * Returns a boolean value indicating whether the operation succeeded.
     *
     * Emits a {Transfer} event.
     */
    function transfer(address recipient, uint256 amount) external returns (bool);

    /**
     * @dev Returns the remaining number of tokens that `spender` will be
     * allowed to spend on behalf of `owner` through {transferFrom}. This is
     * zero by default.
     *
     * This value changes when {approve} or {transferFrom} are called.
     */
    function allowance(address owner, address spender) external view returns (uint256);

    /**
     * @dev Sets `amount` as the allowance of `spender` over the caller's tokens.
     *
     * Returns a boolean value indicating whether the operation succeeded.
     *
     * IMPORTANT: Beware that changing an allowance with this method brings the risk
     * that someone may use both the old and the new allowance by unfortunate
     * transaction ordering. One possible solution to mitigate this race
     * condition is to first reduce the spender's allowance to 0 and set the
     * desired value afterwards:
     * https://github.com/ethereum/EIPs/issues/20#issuecomment-263524729
     *
     * Emits an {Approval} event.
     */
    function approve(address spender, uint256 amount) external returns (bool);

    /**
     * @dev Moves `amount` tokens from `sender` to `recipient` using the
     * allowance mechanism. `amount` is then deducted from the caller's
     * allowance.
     *
     * Returns a boolean value indicating whether the operation succeeded.
     *
     * Emits a {Transfer} event.
     */
    function transferFrom(address sender, address recipient, uint256 amount) external returns (bool);

    /**
     * @dev Emitted when `value` tokens are moved from one account (`from`) to
     * another (`to`).
     *
     * Note that `value` may be zero.
     */
    event Transfer(address indexed from, address indexed to, uint256 value);

    /**
     * @dev Emitted when the allowance of a `spender` for an `owner` is set by
     * a call to {approve}. `value` is the new allowance.
     */
    event Approval(address indexed owner, address indexed spender, uint256 value);
}

File 3 of 13 : SafeERC20.sol
// SPDX-License-Identifier: MIT

pragma solidity >=0.6.0 <0.8.0;

import "./IERC20.sol";
import "../../math/SafeMath.sol";
import "../../utils/Address.sol";

/**
 * @title SafeERC20
 * @dev Wrappers around ERC20 operations that throw on failure (when the token
 * contract returns false). Tokens that return no value (and instead revert or
 * throw on failure) are also supported, non-reverting calls are assumed to be
 * successful.
 * To use this library you can add a `using SafeERC20 for IERC20;` statement to your contract,
 * which allows you to call the safe operations as `token.safeTransfer(...)`, etc.
 */
library SafeERC20 {
    using SafeMath for uint256;
    using Address for address;

    function safeTransfer(IERC20 token, address to, uint256 value) internal {
        _callOptionalReturn(token, abi.encodeWithSelector(token.transfer.selector, to, value));
    }

    function safeTransferFrom(IERC20 token, address from, address to, uint256 value) internal {
        _callOptionalReturn(token, abi.encodeWithSelector(token.transferFrom.selector, from, to, value));
    }

    /**
     * @dev Deprecated. This function has issues similar to the ones found in
     * {IERC20-approve}, and its usage is discouraged.
     *
     * Whenever possible, use {safeIncreaseAllowance} and
     * {safeDecreaseAllowance} instead.
     */
    function safeApprove(IERC20 token, address spender, uint256 value) internal {
        // safeApprove should only be called when setting an initial allowance,
        // or when resetting it to zero. To increase and decrease it, use
        // 'safeIncreaseAllowance' and 'safeDecreaseAllowance'
        // solhint-disable-next-line max-line-length
        require((value == 0) || (token.allowance(address(this), spender) == 0),
            "SafeERC20: approve from non-zero to non-zero allowance"
        );
        _callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, value));
    }

    function safeIncreaseAllowance(IERC20 token, address spender, uint256 value) internal {
        uint256 newAllowance = token.allowance(address(this), spender).add(value);
        _callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, newAllowance));
    }

    function safeDecreaseAllowance(IERC20 token, address spender, uint256 value) internal {
        uint256 newAllowance = token.allowance(address(this), spender).sub(value, "SafeERC20: decreased allowance below zero");
        _callOptionalReturn(token, abi.encodeWithSelector(token.approve.selector, spender, newAllowance));
    }

    /**
     * @dev Imitates a Solidity high-level call (i.e. a regular function call to a contract), relaxing the requirement
     * on the return value: the return value is optional (but if data is returned, it must not be false).
     * @param token The token targeted by the call.
     * @param data The call data (encoded using abi.encode or one of its variants).
     */
    function _callOptionalReturn(IERC20 token, bytes memory data) private {
        // We need to perform a low level call here, to bypass Solidity's return data size checking mechanism, since
        // we're implementing it ourselves. We use {Address.functionCall} to perform this call, which verifies that
        // the target address contains contract code and also asserts for success in the low-level call.

        bytes memory returndata = address(token).functionCall(data, "SafeERC20: low-level call failed");
        if (returndata.length > 0) { // Return data is optional
            // solhint-disable-next-line max-line-length
            require(abi.decode(returndata, (bool)), "SafeERC20: ERC20 operation did not succeed");
        }
    }
}

File 4 of 13 : IPolydexPair.sol
// SPDX-License-Identifier: MIT

pragma solidity >=0.6.0 <0.8.0;

interface IPolydexPair {
    event Approval(address indexed owner, address indexed spender, uint value);
    event Transfer(address indexed from, address indexed to, uint value);

    function name() external pure returns (string memory);
    function symbol() external pure returns (string memory);
    function decimals() external pure returns (uint8);
    function totalSupply() external view returns (uint);
    function balanceOf(address owner) external view returns (uint);
    function allowance(address owner, address spender) external view returns (uint);

    function approve(address spender, uint value) external returns (bool);
    function transfer(address to, uint value) external returns (bool);
    function transferFrom(address from, address to, uint value) external returns (bool);

    function DOMAIN_SEPARATOR() external view returns (bytes32);
    function PERMIT_TYPEHASH() external pure returns (bytes32);
    function nonces(address owner) external view returns (uint);

    function permit(address owner, address spender, uint value, uint deadline, uint8 v, bytes32 r, bytes32 s) external;

    event Mint(address indexed sender, uint amount0, uint amount1);
    event Burn(address indexed sender, uint amount0, uint amount1, address indexed to);
    event Swap(
        address indexed sender,
        uint amount0In,
        uint amount1In,
        uint amount0Out,
        uint amount1Out,
        address indexed to
    );
    event Sync(uint112 reserve0, uint112 reserve1);

    function MINIMUM_LIQUIDITY() external pure returns (uint);
    function factory() external view returns (address);
    function token0() external view returns (address);
    function token1() external view returns (address);
    function getReserves() external view returns (uint112 reserve0, uint112 reserve1, uint32 blockTimestampLast);
    function price0CumulativeLast() external view returns (uint);
    function price1CumulativeLast() external view returns (uint);
    function kLast() external view returns (uint);

    function mint(address to) external returns (uint liquidity);
    function burn(address to) external returns (uint amount0, uint amount1);
    function swap(uint amount0Out, uint amount1Out, address to, bytes calldata data) external;
    function skim(address to) external;
    function sync() external;

    function initialize(address, address) external;
}

File 5 of 13 : IPolydexRouter.sol
// SPDX-License-Identifier: MIT

pragma solidity >=0.6.0 <0.8.0;

interface IPolydexRouter {
    function factory() external view returns (address);
    function WETH() external view returns (address);

    function addLiquidity(
        address tokenA,
        address tokenB,
        uint amountADesired,
        uint amountBDesired,
        uint amountAMin,
        uint amountBMin,
        address to,
        uint deadline
    ) external returns (uint amountA, uint amountB, uint liquidity);
    function addLiquidityETH(
        address token,
        uint amountTokenDesired,
        uint amountTokenMin,
        uint amountETHMin,
        address to,
        uint deadline
    ) external payable returns (uint amountToken, uint amountETH, uint liquidity);
    function removeLiquidity(
        address tokenA,
        address tokenB,
        uint liquidity,
        uint amountAMin,
        uint amountBMin,
        address to,
        uint deadline
    ) external returns (uint amountA, uint amountB);
    function removeLiquidityETH(
        address token,
        uint liquidity,
        uint amountTokenMin,
        uint amountETHMin,
        address to,
        uint deadline
    ) external returns (uint amountToken, uint amountETH);
    function removeLiquidityWithPermit(
        address tokenA,
        address tokenB,
        uint liquidity,
        uint amountAMin,
        uint amountBMin,
        address to,
        uint deadline,
        bool approveMax, uint8 v, bytes32 r, bytes32 s
    ) external returns (uint amountA, uint amountB);
    function removeLiquidityETHWithPermit(
        address token,
        uint liquidity,
        uint amountTokenMin,
        uint amountETHMin,
        address to,
        uint deadline,
        bool approveMax, uint8 v, bytes32 r, bytes32 s
    ) external returns (uint amountToken, uint amountETH);
    function removeLiquidityETHSupportingFeeOnTransferTokens(
        address token,
        uint liquidity,
        uint amountTokenMin,
        uint amountETHMin,
        address to,
        uint deadline
    ) external returns (uint amountETH);
    function removeLiquidityETHWithPermitSupportingFeeOnTransferTokens(
        address token,
        uint liquidity,
        uint amountTokenMin,
        uint amountETHMin,
        address to,
        uint deadline,
        bool approveMax, uint8 v, bytes32 r, bytes32 s
    ) external returns (uint amountETH);
    function swapExactTokensForTokens(
        uint amountIn,
        uint amountOutMin,
        address[] calldata path,
        address to,
        uint deadline
    ) external returns (uint[] memory amounts);
    function swapTokensForExactTokens(
        uint amountOut,
        uint amountInMax,
        address[] calldata path,
        address to,
        uint deadline
    ) external returns (uint[] memory amounts);
    function swapExactETHForTokens(uint amountOutMin, address[] calldata path, address to, uint deadline)
        external
        payable
        returns (uint[] memory amounts);
    function swapTokensForExactETH(uint amountOut, uint amountInMax, address[] calldata path, address to, uint deadline)
        external
        returns (uint[] memory amounts);
    function swapExactTokensForETH(uint amountIn, uint amountOutMin, address[] calldata path, address to, uint deadline)
        external
        returns (uint[] memory amounts);
    function swapETHForExactTokens(uint amountOut, address[] calldata path, address to, uint deadline)
        external
        payable
        returns (uint[] memory amounts);
    function swapExactTokensForTokensSupportingFeeOnTransferTokens(
        uint amountIn,
        uint amountOutMin,
        address[] calldata path,
        address to,
        uint deadline
    ) external;
    function swapExactETHForTokensSupportingFeeOnTransferTokens(
        uint amountOutMin,
        address[] calldata path,
        address to,
        uint deadline
    ) external payable;
    function swapExactTokensForETHSupportingFeeOnTransferTokens(
        uint amountIn,
        uint amountOutMin,
        address[] calldata path,
        address to,
        uint deadline
    ) external;

    function quote(uint amountA, uint reserveA, uint reserveB) external pure returns (uint amountB);
    function getAmountOut(uint amountIn, uint reserveIn, uint reserveOut) external pure returns (uint amountOut);
    function getAmountIn(uint amountOut, uint reserveIn, uint reserveOut) external pure returns (uint amountIn);
    function getAmountsOut(uint amountIn, address[] calldata path) external view returns (uint[] memory amounts);
    function getAmountsIn(uint amountOut, address[] calldata path) external view returns (uint[] memory amounts);
}

File 6 of 13 : IPolydexFactory.sol
// SPDX-License-Identifier: MIT

pragma solidity >=0.6.0 <0.8.0;

interface IPolydexFactory {
    event PairCreated(address indexed token0, address indexed token1, address pair, uint);

    function feeTo() external view returns (address);
    function feeToSetter() external view returns (address);
    function migrator() external view returns (address);

    function getPair(address tokenA, address tokenB) external view returns (address pair);
    function allPairs(uint) external view returns (address pair);
    function allPairsLength() external view returns (uint);

    function createPair(address tokenA, address tokenB) external returns (address pair);

    function setFeeTo(address) external;
    function setFeeToSetter(address) external;
    function setMigrator(address) external;
}

File 7 of 13 : PolydexLibrary.sol
// SPDX-License-Identifier: MIT

pragma solidity >=0.6.0 <0.8.0;

import '../interfaces/IPolydexPair.sol';

import "./SafeMath.sol";

library PolydexLibrary {
    using SafeMathPolydex for uint;

    // returns sorted token addresses, used to handle return values from pairs sorted in this order
    function sortTokens(address tokenA, address tokenB) internal pure returns (address token0, address token1) {
        require(tokenA != tokenB, 'PolydexLibrary: IDENTICAL_ADDRESSES');
        (token0, token1) = tokenA < tokenB ? (tokenA, tokenB) : (tokenB, tokenA);
        require(token0 != address(0), 'PolydexLibrary: ZERO_ADDRESS');
    }

    // calculates the CREATE2 address for a pair without making any external calls
    function pairFor(address factory, address tokenA, address tokenB) internal pure returns (address pair) {
        (address token0, address token1) = sortTokens(tokenA, tokenB);
        pair = address(uint(keccak256(abi.encodePacked(
                hex'ff',
                factory,
                keccak256(abi.encodePacked(token0, token1)),
                hex'8cb41b27c88f8934c0773207afb757d84c4baa607990ad4a30505e42438d999a' // init code hash
            ))));
    }

    // fetches and sorts the reserves for a pair
    function getReserves(address factory, address tokenA, address tokenB) internal view returns (uint reserveA, uint reserveB) {
        (address token0,) = sortTokens(tokenA, tokenB);
        (uint reserve0, uint reserve1,) = IPolydexPair(pairFor(factory, tokenA, tokenB)).getReserves();
        (reserveA, reserveB) = tokenA == token0 ? (reserve0, reserve1) : (reserve1, reserve0);
    }

    // given some amount of an asset and pair reserves, returns an equivalent amount of the other asset
    function quote(uint amountA, uint reserveA, uint reserveB) internal pure returns (uint amountB) {
        require(amountA > 0, 'PolydexLibrary: INSUFFICIENT_AMOUNT');
        require(reserveA > 0 && reserveB > 0, 'PolydexLibrary: INSUFFICIENT_LIQUIDITY');
        amountB = amountA.mul(reserveB) / reserveA;
    }

    // given an input amount of an asset and pair reserves, returns the maximum output amount of the other asset
    function getAmountOut(uint amountIn, uint reserveIn, uint reserveOut) internal pure returns (uint amountOut) {
        require(amountIn > 0, 'PolydexLibrary: INSUFFICIENT_INPUT_AMOUNT');
        require(reserveIn > 0 && reserveOut > 0, 'PolydexLibrary: INSUFFICIENT_LIQUIDITY');
        uint amountInWithFee = amountIn.mul(997);
        uint numerator = amountInWithFee.mul(reserveOut);
        uint denominator = reserveIn.mul(1000).add(amountInWithFee);
        amountOut = numerator / denominator;
    }

    // given an output amount of an asset and pair reserves, returns a required input amount of the other asset
    function getAmountIn(uint amountOut, uint reserveIn, uint reserveOut) internal pure returns (uint amountIn) {
        require(amountOut > 0, 'PolydexLibrary: INSUFFICIENT_OUTPUT_AMOUNT');
        require(reserveIn > 0 && reserveOut > 0, 'PolydexLibrary: INSUFFICIENT_LIQUIDITY');
        uint numerator = reserveIn.mul(amountOut).mul(1000);
        uint denominator = reserveOut.sub(amountOut).mul(997);
        amountIn = (numerator / denominator).add(1);
    }

    // performs chained getAmountOut calculations on any number of pairs
    function getAmountsOut(address factory, uint amountIn, address[] memory path) internal view returns (uint[] memory amounts) {
        require(path.length >= 2, 'PolydexLibrary: INVALID_PATH');
        amounts = new uint[](path.length);
        amounts[0] = amountIn;
        for (uint i; i < path.length - 1; i++) {
            (uint reserveIn, uint reserveOut) = getReserves(factory, path[i], path[i + 1]);
            amounts[i + 1] = getAmountOut(amounts[i], reserveIn, reserveOut);
        }
    }

    // performs chained getAmountIn calculations on any number of pairs
    function getAmountsIn(address factory, uint amountOut, address[] memory path) internal view returns (uint[] memory amounts) {
        require(path.length >= 2, 'PolydexLibrary: INVALID_PATH');
        amounts = new uint[](path.length);
        amounts[amounts.length - 1] = amountOut;
        for (uint i = path.length - 1; i > 0; i--) {
            (uint reserveIn, uint reserveOut) = getReserves(factory, path[i - 1], path[i]);
            amounts[i - 1] = getAmountIn(amounts[i], reserveIn, reserveOut);
        }
    }
}

File 8 of 13 : IFarm.sol
// SPDX-License-Identifier: MIT
pragma solidity >=0.6.0 <0.8.0;

interface IFarm {
    function depositFor(uint256 pid, uint256 amount, address to) external;
}

File 9 of 13 : IWETH.sol
// SPDX-License-Identifier: MIT

pragma solidity >=0.6.0 <0.8.0;

interface IWETH {
    function deposit() external payable;
    function transfer(address to, uint value) external returns (bool);
    function withdraw(uint) external;
}

File 10 of 13 : IStakingPool.sol
// SPDX-License-Identifier: MIT
pragma solidity >=0.6.0 <0.8.0;

interface IStakingPool {
    function depositFor(uint256 amount, address to) external;
}

File 11 of 13 : SafeMath.sol
// SPDX-License-Identifier: MIT

pragma solidity >=0.6.0 <0.8.0;

/**
 * @dev Wrappers over Solidity's arithmetic operations with added overflow
 * checks.
 *
 * Arithmetic operations in Solidity wrap on overflow. This can easily result
 * in bugs, because programmers usually assume that an overflow raises an
 * error, which is the standard behavior in high level programming languages.
 * `SafeMath` restores this intuition by reverting the transaction when an
 * operation overflows.
 *
 * Using this library instead of the unchecked operations eliminates an entire
 * class of bugs, so it's recommended to use it always.
 */
library SafeMath {
    /**
     * @dev Returns the addition of two unsigned integers, with an overflow flag.
     *
     * _Available since v3.4._
     */
    function tryAdd(uint256 a, uint256 b) internal pure returns (bool, uint256) {
        uint256 c = a + b;
        if (c < a) return (false, 0);
        return (true, c);
    }

    /**
     * @dev Returns the substraction of two unsigned integers, with an overflow flag.
     *
     * _Available since v3.4._
     */
    function trySub(uint256 a, uint256 b) internal pure returns (bool, uint256) {
        if (b > a) return (false, 0);
        return (true, a - b);
    }

    /**
     * @dev Returns the multiplication of two unsigned integers, with an overflow flag.
     *
     * _Available since v3.4._
     */
    function tryMul(uint256 a, uint256 b) internal pure returns (bool, uint256) {
        // Gas optimization: this is cheaper than requiring 'a' not being zero, but the
        // benefit is lost if 'b' is also tested.
        // See: https://github.com/OpenZeppelin/openzeppelin-contracts/pull/522
        if (a == 0) return (true, 0);
        uint256 c = a * b;
        if (c / a != b) return (false, 0);
        return (true, c);
    }

    /**
     * @dev Returns the division of two unsigned integers, with a division by zero flag.
     *
     * _Available since v3.4._
     */
    function tryDiv(uint256 a, uint256 b) internal pure returns (bool, uint256) {
        if (b == 0) return (false, 0);
        return (true, a / b);
    }

    /**
     * @dev Returns the remainder of dividing two unsigned integers, with a division by zero flag.
     *
     * _Available since v3.4._
     */
    function tryMod(uint256 a, uint256 b) internal pure returns (bool, uint256) {
        if (b == 0) return (false, 0);
        return (true, a % b);
    }

    /**
     * @dev Returns the addition of two unsigned integers, reverting on
     * overflow.
     *
     * Counterpart to Solidity's `+` operator.
     *
     * Requirements:
     *
     * - Addition cannot overflow.
     */
    function add(uint256 a, uint256 b) internal pure returns (uint256) {
        uint256 c = a + b;
        require(c >= a, "SafeMath: addition overflow");
        return c;
    }

    /**
     * @dev Returns the subtraction of two unsigned integers, reverting on
     * overflow (when the result is negative).
     *
     * Counterpart to Solidity's `-` operator.
     *
     * Requirements:
     *
     * - Subtraction cannot overflow.
     */
    function sub(uint256 a, uint256 b) internal pure returns (uint256) {
        require(b <= a, "SafeMath: subtraction overflow");
        return a - b;
    }

    /**
     * @dev Returns the multiplication of two unsigned integers, reverting on
     * overflow.
     *
     * Counterpart to Solidity's `*` operator.
     *
     * Requirements:
     *
     * - Multiplication cannot overflow.
     */
    function mul(uint256 a, uint256 b) internal pure returns (uint256) {
        if (a == 0) return 0;
        uint256 c = a * b;
        require(c / a == b, "SafeMath: multiplication overflow");
        return c;
    }

    /**
     * @dev Returns the integer division of two unsigned integers, reverting on
     * division by zero. The result is rounded towards zero.
     *
     * Counterpart to Solidity's `/` operator. Note: this function uses a
     * `revert` opcode (which leaves remaining gas untouched) while Solidity
     * uses an invalid opcode to revert (consuming all remaining gas).
     *
     * Requirements:
     *
     * - The divisor cannot be zero.
     */
    function div(uint256 a, uint256 b) internal pure returns (uint256) {
        require(b > 0, "SafeMath: division by zero");
        return a / b;
    }

    /**
     * @dev Returns the remainder of dividing two unsigned integers. (unsigned integer modulo),
     * reverting when dividing by zero.
     *
     * Counterpart to Solidity's `%` operator. This function uses a `revert`
     * opcode (which leaves remaining gas untouched) while Solidity uses an
     * invalid opcode to revert (consuming all remaining gas).
     *
     * Requirements:
     *
     * - The divisor cannot be zero.
     */
    function mod(uint256 a, uint256 b) internal pure returns (uint256) {
        require(b > 0, "SafeMath: modulo by zero");
        return a % b;
    }

    /**
     * @dev Returns the subtraction of two unsigned integers, reverting with custom message on
     * overflow (when the result is negative).
     *
     * CAUTION: This function is deprecated because it requires allocating memory for the error
     * message unnecessarily. For custom revert reasons use {trySub}.
     *
     * Counterpart to Solidity's `-` operator.
     *
     * Requirements:
     *
     * - Subtraction cannot overflow.
     */
    function sub(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {
        require(b <= a, errorMessage);
        return a - b;
    }

    /**
     * @dev Returns the integer division of two unsigned integers, reverting with custom message on
     * division by zero. The result is rounded towards zero.
     *
     * CAUTION: This function is deprecated because it requires allocating memory for the error
     * message unnecessarily. For custom revert reasons use {tryDiv}.
     *
     * Counterpart to Solidity's `/` operator. Note: this function uses a
     * `revert` opcode (which leaves remaining gas untouched) while Solidity
     * uses an invalid opcode to revert (consuming all remaining gas).
     *
     * Requirements:
     *
     * - The divisor cannot be zero.
     */
    function div(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {
        require(b > 0, errorMessage);
        return a / b;
    }

    /**
     * @dev Returns the remainder of dividing two unsigned integers. (unsigned integer modulo),
     * reverting with custom message when dividing by zero.
     *
     * CAUTION: This function is deprecated because it requires allocating memory for the error
     * message unnecessarily. For custom revert reasons use {tryMod}.
     *
     * Counterpart to Solidity's `%` operator. This function uses a `revert`
     * opcode (which leaves remaining gas untouched) while Solidity uses an
     * invalid opcode to revert (consuming all remaining gas).
     *
     * Requirements:
     *
     * - The divisor cannot be zero.
     */
    function mod(uint256 a, uint256 b, string memory errorMessage) internal pure returns (uint256) {
        require(b > 0, errorMessage);
        return a % b;
    }
}

File 12 of 13 : Address.sol
// SPDX-License-Identifier: MIT

pragma solidity >=0.6.2 <0.8.0;

/**
 * @dev Collection of functions related to the address type
 */
library Address {
    /**
     * @dev Returns true if `account` is a contract.
     *
     * [IMPORTANT]
     * ====
     * It is unsafe to assume that an address for which this function returns
     * false is an externally-owned account (EOA) and not a contract.
     *
     * Among others, `isContract` will return false for the following
     * types of addresses:
     *
     *  - an externally-owned account
     *  - a contract in construction
     *  - an address where a contract will be created
     *  - an address where a contract lived, but was destroyed
     * ====
     */
    function isContract(address account) internal view returns (bool) {
        // This method relies on extcodesize, which returns 0 for contracts in
        // construction, since the code is only stored at the end of the
        // constructor execution.

        uint256 size;
        // solhint-disable-next-line no-inline-assembly
        assembly { size := extcodesize(account) }
        return size > 0;
    }

    /**
     * @dev Replacement for Solidity's `transfer`: sends `amount` wei to
     * `recipient`, forwarding all available gas and reverting on errors.
     *
     * https://eips.ethereum.org/EIPS/eip-1884[EIP1884] increases the gas cost
     * of certain opcodes, possibly making contracts go over the 2300 gas limit
     * imposed by `transfer`, making them unable to receive funds via
     * `transfer`. {sendValue} removes this limitation.
     *
     * https://diligence.consensys.net/posts/2019/09/stop-using-soliditys-transfer-now/[Learn more].
     *
     * IMPORTANT: because control is transferred to `recipient`, care must be
     * taken to not create reentrancy vulnerabilities. Consider using
     * {ReentrancyGuard} or the
     * https://solidity.readthedocs.io/en/v0.5.11/security-considerations.html#use-the-checks-effects-interactions-pattern[checks-effects-interactions pattern].
     */
    function sendValue(address payable recipient, uint256 amount) internal {
        require(address(this).balance >= amount, "Address: insufficient balance");

        // solhint-disable-next-line avoid-low-level-calls, avoid-call-value
        (bool success, ) = recipient.call{ value: amount }("");
        require(success, "Address: unable to send value, recipient may have reverted");
    }

    /**
     * @dev Performs a Solidity function call using a low level `call`. A
     * plain`call` is an unsafe replacement for a function call: use this
     * function instead.
     *
     * If `target` reverts with a revert reason, it is bubbled up by this
     * function (like regular Solidity function calls).
     *
     * Returns the raw returned data. To convert to the expected return value,
     * use https://solidity.readthedocs.io/en/latest/units-and-global-variables.html?highlight=abi.decode#abi-encoding-and-decoding-functions[`abi.decode`].
     *
     * Requirements:
     *
     * - `target` must be a contract.
     * - calling `target` with `data` must not revert.
     *
     * _Available since v3.1._
     */
    function functionCall(address target, bytes memory data) internal returns (bytes memory) {
      return functionCall(target, data, "Address: low-level call failed");
    }

    /**
     * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`], but with
     * `errorMessage` as a fallback revert reason when `target` reverts.
     *
     * _Available since v3.1._
     */
    function functionCall(address target, bytes memory data, string memory errorMessage) internal returns (bytes memory) {
        return functionCallWithValue(target, data, 0, errorMessage);
    }

    /**
     * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],
     * but also transferring `value` wei to `target`.
     *
     * Requirements:
     *
     * - the calling contract must have an ETH balance of at least `value`.
     * - the called Solidity function must be `payable`.
     *
     * _Available since v3.1._
     */
    function functionCallWithValue(address target, bytes memory data, uint256 value) internal returns (bytes memory) {
        return functionCallWithValue(target, data, value, "Address: low-level call with value failed");
    }

    /**
     * @dev Same as {xref-Address-functionCallWithValue-address-bytes-uint256-}[`functionCallWithValue`], but
     * with `errorMessage` as a fallback revert reason when `target` reverts.
     *
     * _Available since v3.1._
     */
    function functionCallWithValue(address target, bytes memory data, uint256 value, string memory errorMessage) internal returns (bytes memory) {
        require(address(this).balance >= value, "Address: insufficient balance for call");
        require(isContract(target), "Address: call to non-contract");

        // solhint-disable-next-line avoid-low-level-calls
        (bool success, bytes memory returndata) = target.call{ value: value }(data);
        return _verifyCallResult(success, returndata, errorMessage);
    }

    /**
     * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],
     * but performing a static call.
     *
     * _Available since v3.3._
     */
    function functionStaticCall(address target, bytes memory data) internal view returns (bytes memory) {
        return functionStaticCall(target, data, "Address: low-level static call failed");
    }

    /**
     * @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`],
     * but performing a static call.
     *
     * _Available since v3.3._
     */
    function functionStaticCall(address target, bytes memory data, string memory errorMessage) internal view returns (bytes memory) {
        require(isContract(target), "Address: static call to non-contract");

        // solhint-disable-next-line avoid-low-level-calls
        (bool success, bytes memory returndata) = target.staticcall(data);
        return _verifyCallResult(success, returndata, errorMessage);
    }

    /**
     * @dev Same as {xref-Address-functionCall-address-bytes-}[`functionCall`],
     * but performing a delegate call.
     *
     * _Available since v3.4._
     */
    function functionDelegateCall(address target, bytes memory data) internal returns (bytes memory) {
        return functionDelegateCall(target, data, "Address: low-level delegate call failed");
    }

    /**
     * @dev Same as {xref-Address-functionCall-address-bytes-string-}[`functionCall`],
     * but performing a delegate call.
     *
     * _Available since v3.4._
     */
    function functionDelegateCall(address target, bytes memory data, string memory errorMessage) internal returns (bytes memory) {
        require(isContract(target), "Address: delegate call to non-contract");

        // solhint-disable-next-line avoid-low-level-calls
        (bool success, bytes memory returndata) = target.delegatecall(data);
        return _verifyCallResult(success, returndata, errorMessage);
    }

    function _verifyCallResult(bool success, bytes memory returndata, string memory errorMessage) private pure returns(bytes memory) {
        if (success) {
            return returndata;
        } else {
            // Look for revert reason and bubble it up if present
            if (returndata.length > 0) {
                // The easiest way to bubble the revert reason is using memory via assembly

                // solhint-disable-next-line no-inline-assembly
                assembly {
                    let returndata_size := mload(returndata)
                    revert(add(32, returndata), returndata_size)
                }
            } else {
                revert(errorMessage);
            }
        }
    }
}

File 13 of 13 : SafeMath.sol
// SPDX-License-Identifier: MIT

pragma solidity =0.7.6;

// a library for performing overflow-safe math, courtesy of DappHub (https://github.com/dapphub/ds-math)

library SafeMathPolydex {
    function add(uint x, uint y) internal pure returns (uint z) {
        require((z = x + y) >= x, 'ds-math-add-overflow');
    }

    function sub(uint x, uint y) internal pure returns (uint z) {
        require((z = x - y) <= x, 'ds-math-sub-underflow');
    }

    function mul(uint x, uint y) internal pure returns (uint z) {
        require(y == 0 || (z = x * y) / y == x, 'ds-math-mul-overflow');
    }
}

Settings
{
  "optimizer": {
    "enabled": true,
    "runs": 200
  },
  "outputSelection": {
    "*": {
      "*": [
        "evm.bytecode",
        "evm.deployedBytecode",
        "abi"
      ]
    }
  },
  "libraries": {}
}

Contract Security Audit

Contract ABI

[{"inputs":[{"internalType":"contract IPolydexRouter","name":"_oldRouter","type":"address"},{"internalType":"contract IPolydexRouter","name":"_router","type":"address"},{"internalType":"address","name":"_WETH","type":"address"},{"internalType":"address","name":"_dfynWeth","type":"address"}],"stateMutability":"nonpayable","type":"constructor"},{"inputs":[],"name":"WETH","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"dfynWeth","outputs":[{"internalType":"address","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[{"internalType":"address","name":"tokenA","type":"address"},{"internalType":"address","name":"tokenB","type":"address"},{"internalType":"uint256","name":"liquidity","type":"uint256"},{"internalType":"uint256","name":"amountAMin","type":"uint256"},{"internalType":"uint256","name":"amountBMin","type":"uint256"},{"internalType":"uint256","name":"deadline","type":"uint256"}],"name":"migrate","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"tokenA","type":"address"},{"internalType":"address","name":"tokenB","type":"address"},{"internalType":"uint256","name":"liquidity","type":"uint256"},{"internalType":"uint256","name":"amountAMin","type":"uint256"},{"internalType":"uint256","name":"amountBMin","type":"uint256"},{"internalType":"uint256","name":"deadline","type":"uint256"},{"internalType":"address","name":"_Farm","type":"address"},{"internalType":"uint256","name":"pid","type":"uint256"}],"name":"migrateWithDeposit","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[{"internalType":"address","name":"tokenA","type":"address"},{"internalType":"address","name":"tokenB","type":"address"},{"internalType":"uint256","name":"liquidity","type":"uint256"},{"internalType":"uint256","name":"amountAMin","type":"uint256"},{"internalType":"uint256","name":"amountBMin","type":"uint256"},{"internalType":"uint256","name":"deadline","type":"uint256"},{"internalType":"uint8","name":"v","type":"uint8"},{"internalType":"bytes32","name":"r","type":"bytes32"},{"internalType":"bytes32","name":"s","type":"bytes32"}],"name":"migrateWithPermit","outputs":[],"stateMutability":"nonpayable","type":"function"},{"inputs":[],"name":"oldRouter","outputs":[{"internalType":"contract IPolydexRouter","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"inputs":[],"name":"router","outputs":[{"internalType":"contract IPolydexRouter","name":"","type":"address"}],"stateMutability":"view","type":"function"},{"stateMutability":"payable","type":"receive"}]

608060405234801561001057600080fd5b50604051611a07380380611a078339818101604052608081101561003357600080fd5b50805160208201516040830151606090930151600080546001600160a01b039485166001600160a01b03199182161790915560018054938516938216939093179092556003805491841691831691909117905560028054929093169116179055611965806100a26000396000f3fe6080604052600436106100745760003560e01c8063964c1f981161004e578063964c1f98146101a8578063aac55b39146101bd578063ad5c464814610212578063f887ea4014610227576100a4565b8063396ac328146100a95780634b05c064146101155780637c0672d714610177576100a4565b366100a4576003546001600160a01b031633148061009c57506002546001600160a01b031633145b6100a257fe5b005b600080fd5b3480156100b557600080fd5b506100a260048036036101208110156100cd57600080fd5b506001600160a01b03813581169160208101359091169060408101359060608101359060808101359060a08101359060ff60c0820135169060e081013590610100013561023c565b34801561012157600080fd5b506100a2600480360361010081101561013957600080fd5b506001600160a01b038135811691602081013582169160408201359160608101359160808201359160a08101359160c0820135169060e001356102f0565b34801561018357600080fd5b5061018c610593565b604080516001600160a01b039092168252519081900360200190f35b3480156101b457600080fd5b5061018c6105a2565b3480156101c957600080fd5b506100a2600480360360c08110156101e057600080fd5b506001600160a01b03813581169160208101359091169060408101359060608101359060808101359060a001356105b1565b34801561021e57600080fd5b5061018c610850565b34801561023357600080fd5b5061018c61085f565b60006102488a8a61086e565b6040805163d505accf60e01b8152336004820152306024820152604481018b90526064810188905260ff8716608482015260a4810186905260c4810185905290519192506001600160a01b0383169163d505accf9160e48082019260009290919082900301818387803b1580156102be57600080fd5b505af11580156102d2573d6000803e3d6000fd5b505050506102e48a8a8a8a8a8a6105b1565b50505050505050505050565b42831015610335576040805162461bcd60e51b815260206004820152600d60248201526c14ddd85c0e8811561412549151609a1b604482015290519081900360640190fd5b878760008061034784848c8c8c6109a4565b60035491935091506001600160a01b038d81169116141561043f5760035460408051632e1a7d4d60e01b81526004810185905290516001600160a01b0390921691632e1a7d4d9160248082019260009290919082900301818387803b1580156103af57600080fd5b505af11580156103c3573d6000803e3d6000fd5b50505050600260009054906101000a90046001600160a01b03166001600160a01b031663d0e30db0836040518263ffffffff1660e01b81526004016000604051808303818588803b15801561041757600080fd5b505af115801561042b573d6000803e3d6000fd5b50506002546001600160a01b031696505050505b6003546001600160a01b038c8116911614156105325760035460408051632e1a7d4d60e01b81526004810184905290516001600160a01b0390921691632e1a7d4d9160248082019260009290919082900301818387803b1580156104a257600080fd5b505af11580156104b6573d6000803e3d6000fd5b50505050600260009054906101000a90046001600160a01b03166001600160a01b031663d0e30db0826040518263ffffffff1660e01b81526004016000604051808303818588803b15801561050a57600080fd5b505af115801561051e573d6000803e3d6000fd5b50506002546001600160a01b031695505050505b600080610543868686868b8d610b7f565b9150915081841115610565576105656001600160a01b03871633848703610e2b565b80831115610583576105836001600160a01b03861633838603610e2b565b5050505050505050505050505050565b6003546001600160a01b031681565b6000546001600160a01b031681565b428110156105f6576040805162461bcd60e51b815260206004820152600d60248201526c14ddd85c0e8811561412549151609a1b604482015290519081900360640190fd5b858560008061060884848a8a8a6109a4565b60035491935091506001600160a01b038b8116911614156107005760035460408051632e1a7d4d60e01b81526004810185905290516001600160a01b0390921691632e1a7d4d9160248082019260009290919082900301818387803b15801561067057600080fd5b505af1158015610684573d6000803e3d6000fd5b50505050600260009054906101000a90046001600160a01b03166001600160a01b031663d0e30db0836040518263ffffffff1660e01b81526004016000604051808303818588803b1580156106d857600080fd5b505af11580156106ec573d6000803e3d6000fd5b50506002546001600160a01b031696505050505b6003546001600160a01b038a8116911614156107f35760035460408051632e1a7d4d60e01b81526004810184905290516001600160a01b0390921691632e1a7d4d9160248082019260009290919082900301818387803b15801561076357600080fd5b505af1158015610777573d6000803e3d6000fd5b50505050600260009054906101000a90046001600160a01b03166001600160a01b031663d0e30db0826040518263ffffffff1660e01b81526004016000604051808303818588803b1580156107cb57600080fd5b505af11580156107df573d6000803e3d6000fd5b50506002546001600160a01b031695505050505b60008061080286868686610e82565b9150915081841115610824576108246001600160a01b03871633848703610e2b565b80831115610842576108426001600160a01b03861633838603610e2b565b505050505050505050505050565b6002546001600160a01b031681565b6001546001600160a01b031681565b600080600061087d8585610fc0565b9150915060008054906101000a90046001600160a01b03166001600160a01b031663c45a01556040518163ffffffff1660e01b815260040160206040518083038186803b1580156108cd57600080fd5b505afa1580156108e1573d6000803e3d6000fd5b505050506040513d60208110156108f757600080fd5b5051604080516bffffffffffffffffffffffff19606095861b811660208381019190915294861b81166034830152825160288184030181526048830184528051908601206001600160f81b031960688401529390951b9094166069850152607d8401919091527ff187ed688403aa4f7acfada758d8d53698753b998a3071b06f1b777f4330eaf3609d808501919091528151808503909101815260bd909301905281519101209392505050565b60008060006109b3888861086e565b604080516323b872dd60e01b81523360048201526001600160a01b03831660248201819052604482018a9052915192935090916323b872dd916064808201926020929091908290030181600087803b158015610a0e57600080fd5b505af1158015610a22573d6000803e3d6000fd5b505050506040513d6020811015610a3857600080fd5b50506040805163226bf2d160e21b8152306004820152815160009283926001600160a01b038616926389afcb449260248084019391929182900301818787803b158015610a8457600080fd5b505af1158015610a98573d6000803e3d6000fd5b505050506040513d6040811015610aae57600080fd5b50805160209091015190925090506000610ac88b8b610fc0565b509050806001600160a01b03168b6001600160a01b031614610aeb578183610aee565b82825b909650945087861015610b325760405162461bcd60e51b815260040180806020018281038252602681526020018061184e6026913960400191505060405180910390fd5b86851015610b715760405162461bcd60e51b81526004018080602001828103825260268152602001806118bd6026913960400191505060405180910390fd5b505050509550959350505050565b600080610b8e8888888861109e565b6001546040805163c45a015560e01b81529051939550919350600092610c12926001600160a01b039092169163c45a0155916004808301926020929190829003018186803b158015610bdf57600080fd5b505afa158015610bf3573d6000803e3d6000fd5b505050506040513d6020811015610c0957600080fd5b50518a8a6112bb565b9050610c286001600160a01b038a168285610e2b565b610c3c6001600160a01b0389168284610e2b565b6000816001600160a01b0316636a627842306040518263ffffffff1660e01b815260040180826001600160a01b03168152602001915050602060405180830381600087803b158015610c8d57600080fd5b505af1158015610ca1573d6000803e3d6000fd5b505050506040513d6020811015610cb757600080fd5b50516040805163095ea7b360e01b81526001600160a01b0388811660048301526024820184905291519293509084169163095ea7b3916044808201926020929091908290030181600087803b158015610d0f57600080fd5b505af1158015610d23573d6000803e3d6000fd5b505050506040513d6020811015610d3957600080fd5b5050600019861415610db057604080516336efd16f60e01b81526004810183905233602482015290516001600160a01b038716916336efd16f91604480830192600092919082900301818387803b158015610d9357600080fd5b505af1158015610da7573d6000803e3d6000fd5b50505050610e1e565b6040805163481086bf60e11b8152600481018890526024810183905233604482015290516001600160a01b038716916390210d7e91606480830192600092919082900301818387803b158015610e0557600080fd5b505af1158015610e19573d6000803e3d6000fd5b505050505b5050965096945050505050565b604080516001600160a01b038416602482015260448082018490528251808303909101815260649091019091526020810180516001600160e01b031663a9059cbb60e01b179052610e7d90849061137b565b505050565b600080610e918686868661109e565b6001546040805163c45a015560e01b81529051939550919350600092610f15926001600160a01b039092169163c45a0155916004808301926020929190829003018186803b158015610ee257600080fd5b505afa158015610ef6573d6000803e3d6000fd5b505050506040513d6020811015610f0c57600080fd5b505188886112bb565b9050610f2b6001600160a01b0388168285610e2b565b610f3f6001600160a01b0387168284610e2b565b604080516335313c2160e11b815233600482015290516001600160a01b03831691636a6278429160248083019260209291908290030181600087803b158015610f8757600080fd5b505af1158015610f9b573d6000803e3d6000fd5b505050506040513d6020811015610fb157600080fd5b50929791965090945050505050565b600080826001600160a01b0316846001600160a01b031614156110145760405162461bcd60e51b81526004018080602001828103825260238152602001806118e36023913960400191505060405180910390fd5b826001600160a01b0316846001600160a01b031610611034578284611037565b83835b90925090506001600160a01b038216611097576040805162461bcd60e51b815260206004820152601c60248201527f506f6c796465784c6962726172793a205a45524f5f4144445245535300000000604482015290519081900360640190fd5b9250929050565b6000806000600160009054906101000a90046001600160a01b03166001600160a01b031663c45a01556040518163ffffffff1660e01b815260040160206040518083038186803b1580156110f157600080fd5b505afa158015611105573d6000803e3d6000fd5b505050506040513d602081101561111b57600080fd5b50516040805163e6a4390560e01b81526001600160a01b038a81166004830152898116602483015291519293506000929184169163e6a4390591604480820192602092909190829003018186803b15801561117557600080fd5b505afa158015611189573d6000803e3d6000fd5b505050506040513d602081101561119f57600080fd5b50516001600160a01b0316141561123d57806001600160a01b031663c9c6539688886040518363ffffffff1660e01b815260040180836001600160a01b03168152602001826001600160a01b0316815260200192505050602060405180830381600087803b15801561121057600080fd5b505af1158015611224573d6000803e3d6000fd5b505050506040513d602081101561123a57600080fd5b50505b60008061124b838a8a61142c565b9150915081600014801561125d575080155b1561126d578694508593506112af565b600061127a8884846114fa565b905086811161128e578795509350836112ad565b600061129b8884866114fa565b9050888111156112a757fe5b95508694505b505b50505094509492505050565b60008060006112ca8585610fc0565b604080516bffffffffffffffffffffffff19606094851b811660208084019190915293851b81166034830152825160288184030181526048830184528051908501206001600160f81b031960688401529a90941b9093166069840152607d8301989098527f8cb41b27c88f8934c0773207afb757d84c4baa607990ad4a30505e42438d999a609d808401919091528851808403909101815260bd909201909752805196019590952095945050505050565b60006113d0826040518060400160405280602081526020017f5361666545524332303a206c6f772d6c6576656c2063616c6c206661696c6564815250856001600160a01b03166115a09092919063ffffffff16565b805190915015610e7d578080602001905160208110156113ef57600080fd5b5051610e7d5760405162461bcd60e51b815260040180806020018281038252602a815260200180611906602a913960400191505060405180910390fd5b600080600061143b8585610fc0565b50905060008061144c8888886112bb565b6001600160a01b0316630902f1ac6040518163ffffffff1660e01b815260040160606040518083038186803b15801561148457600080fd5b505afa158015611498573d6000803e3d6000fd5b505050506040513d60608110156114ae57600080fd5b5080516020909101516dffffffffffffffffffffffffffff91821693501690506001600160a01b03878116908416146114e85780826114eb565b81815b90999098509650505050505050565b600080841161153a5760405162461bcd60e51b81526004018080602001828103825260238152602001806118746023913960400191505060405180910390fd5b60008311801561154a5750600082115b6115855760405162461bcd60e51b81526004018080602001828103825260268152602001806118286026913960400191505060405180910390fd5b8261159085846115b9565b8161159757fe5b04949350505050565b60606115af8484600085611622565b90505b9392505050565b60008115806115d4575050808202828282816115d157fe5b04145b61161c576040805162461bcd60e51b815260206004820152601460248201527364732d6d6174682d6d756c2d6f766572666c6f7760601b604482015290519081900360640190fd5b92915050565b6060824710156116635760405162461bcd60e51b81526004018080602001828103825260268152602001806118976026913960400191505060405180910390fd5b61166c8561177d565b6116bd576040805162461bcd60e51b815260206004820152601d60248201527f416464726573733a2063616c6c20746f206e6f6e2d636f6e7472616374000000604482015290519081900360640190fd5b600080866001600160a01b031685876040518082805190602001908083835b602083106116fb5780518252601f1990920191602091820191016116dc565b6001836020036101000a03801982511681845116808217855250505050505090500191505060006040518083038185875af1925050503d806000811461175d576040519150601f19603f3d011682016040523d82523d6000602084013e611762565b606091505b5091509150611772828286611783565b979650505050505050565b3b151590565b606083156117925750816115b2565b8251156117a25782518084602001fd5b8160405162461bcd60e51b81526004018080602001828103825283818151815260200191508051906020019080838360005b838110156117ec5781810151838201526020016117d4565b50505050905090810190601f1680156118195780820380516001836020036101000a031916815260200191505b509250505060405180910390fdfe506f6c796465784c6962726172793a20494e53554646494349454e545f4c4951554944495459506f6c794465784d69677261746f723a20494e53554646494349454e545f415f414d4f554e54506f6c796465784c6962726172793a20494e53554646494349454e545f414d4f554e54416464726573733a20696e73756666696369656e742062616c616e636520666f722063616c6c506f6c794465784d69677261746f723a20494e53554646494349454e545f425f414d4f554e54506f6c796465784c6962726172793a204944454e544943414c5f4144445245535345535361666545524332303a204552433230206f7065726174696f6e20646964206e6f742073756363656564a2646970667358221220b0cf6590df79de140c52834f5df887c2a89158d86d439c6a6628e0db777b701264736f6c63430007060033000000000000000000000000a102072a4c07f06ec3b4900fdc4c7b80b6c57429000000000000000000000000bd13225f0a45bead8510267b4d6a7c78146be4590000000000000000000000000d500b1d8e8ef31e21c99d1db9a6444d3adf12700000000000000000000000004c28f48448720e9000907bc2611f73022fdce1fa

Constructor Arguments (ABI-Encoded and is the last bytes of the Contract Creation Code above)

000000000000000000000000a102072a4c07f06ec3b4900fdc4c7b80b6c57429000000000000000000000000bd13225f0a45bead8510267b4d6a7c78146be4590000000000000000000000000d500b1d8e8ef31e21c99d1db9a6444d3adf12700000000000000000000000004c28f48448720e9000907bc2611f73022fdce1fa

-----Decoded View---------------
Arg [0] : _oldRouter (address): 0xa102072a4c07f06ec3b4900fdc4c7b80b6c57429
Arg [1] : _router (address): 0xbd13225f0a45bead8510267b4d6a7c78146be459
Arg [2] : _WETH (address): 0x0d500b1d8e8ef31e21c99d1db9a6444d3adf1270
Arg [3] : _dfynWeth (address): 0x4c28f48448720e9000907bc2611f73022fdce1fa

-----Encoded View---------------
4 Constructor Arguments found :
Arg [0] : 000000000000000000000000a102072a4c07f06ec3b4900fdc4c7b80b6c57429
Arg [1] : 000000000000000000000000bd13225f0a45bead8510267b4d6a7c78146be459
Arg [2] : 0000000000000000000000000d500b1d8e8ef31e21c99d1db9a6444d3adf1270
Arg [3] : 0000000000000000000000004c28f48448720e9000907bc2611f73022fdce1fa


Block Transaction Gas Used Reward
Age Block Fee Address BC Fee Address Voting Power Jailed Incoming
Block Uncle Number Difficulty Gas Used Reward
Loading
Loading
Make sure to use the "Vote Down" button for any spammy posts, and the "Vote Up" for interesting conversations.