# Final Test

Now that we have checked in most of the cases each contract individually. We are going to perform a test in order to assure that our DEX, XdYe works as expected before deploying Smart Contracts to Volta TestNet.

In here we are going to give a small brief of the tested critical aspects.

* We `mint` XdYe to ADD\[2]
* We `transfer` TKA & TKB to ADD\[2] from ADD\[0]
* We `transfer` XdYe to ADD\[3]
* We `approve` Router Contract to be able to manipulate TKA, TKB & XdYe from ADD\[2]
* We `addLiquidityETH` on pairs:
  * ETH - TKA
  * ETH - XDYE
  * ETH - TKB
* We check `getReserve` for the created Pairs
* We perform a `swapETHForExactTokens` for Pair *(ETH - TKA)* from ADD\[3]
* We check `getReserve` for the Pair in which we have performed the swap
* We perform a `swapETHForExactTokens` for Pair *(ETH - XDYE)* from ADD\[6]
* We check `getReserve` for the Pair in which we have performed the swap
* We `approve` XdYeBar Contract to manipulate XdYe Tokens from ADD\[3]
* We `enter` all XdYe Token balance that ADD\[3] has
* We check that ADD\[3] XdYe Token balance is now 0
* We `approve` Router Contract to be able to manipulate TKA from ADD\[3]
* We `swapTokensForExactTokens` for Pair *(TKA-TKB)* from ADD\[3], those tokens ADD\[3] has from previous ETH --> TKA swap
* We check ADD\[3] balances before & after the trade/swap
* We `approve` Router to be able to manipulate LP from ADD\[2] so it can remove ETH-TKA LPs
* We `removeLiquidityETH` for Pair *(ETH -* *TKA),* just 50% of it
* We check LP balance of ADD\[2] so we can assure the remove function has succeed
* We `approve` Router to be able to manipulate LP from ADD\[2] so it can remove ETH-XDYE LPs
* We `removeLiquidityETH` for Pair *(ETH -* *XDYE),* just 50% of it
* We check LP balance of ADD\[2] so we can assure the remove function has succeed
* We `approve` Router to be able to manipulate LP from ADD\[2] so it can remove TKA-TKB LPs
* We `removeLiquidity` for Pair *(TKA -* *TKB),* just 50% of it
* We check LP balance of ADD\[2] so we can assure the remove function has succeed
* Now LPs have been generated and transferred to XdYe Maker
* We `convert` WETH - TKA in XdYeMaker Contract
* We `convert` WETH - XdYe in XdYeMaker Contract
* We `convert` WETH - TKB in XdYeMaker Contract
* We `leave` all XdYe Token from XdYeBar Contract from ADD\[3]
* We check the XdYe Token balance of ADD\[3] after leaving XdYeBar
* Finally we check all addresses that have been used for the test and see if balances match the expected amount after all the system has been proven.

The script used for testing all XdYe capabilities: *(1)*&#x20;

{% embed url="<https://github.com/rogerCapone/XdYe_Tests/blob/main/FinalTest_checkEverythingIsWorkingOnXdYe.js>" %}
Script for testing XdYe Platform has the expected behaviour
{% endembed %}
