MixBytes Successfully Deploys Uniswap V2 Protocol on Neon EVM
Neon Labs recently partnered with MixBytes to prove the functionality and performance of Neon EVM via the deployment of Ethereum dApps. The exercise involved the MixBytes team deploying and assessing the Uniswap v2 protocol on both local network and Devnet. The Uniswap v2 protocol, which was originally developed on Ethereum, allows users to exchange tokens without relying on a centralized exchange, helping with asset liquidity and reducing volatility.
Who is MixBytes?
MixBytes is a blockchain solution advisory company that provides a comprehensive suite of services for smart contract development and testing, including security audits and protocol development.
The objective of deploying the Uniswap v2 protocol to Neon EVM was to verify that the level of effort required, and performance, is the same on both Ethereum and Neon. Upon successful deployment, the team also wanted to confirm the expected functionality of the Uniswap v2 protocol and test its performance in production-like scenarios.
MixBytes deployed the Uniswap v2 protocol on local Neon and Solana environments to test functionality and performance. The deployment included Uniswap v2 protocol contracts, required libraries, and testing artifacts. Firstly, the following script was executed:
npx hardhat run ./scripts/deploy.ts
Then, the environment was deployed with this Docker config file by executing the below command:
Additionally, the following network configurations were applied to the hardhat.config.ts file:
The scope of the testing focused on the deployed contracts:
- UniswapV2Factory contract
- UniswapV2Pair contract
- Liquidity Pool (LP) token farming test contracts
MixBytes assessed the liquidity pool creation functionality by deploying two liquidity pools: one liquidity pool containing only native SOL tokens, and the other containing two non-native tokens. Once the liquidity pools were created, the team tested the “swap_with_exact_input” and “swap_with_exact_output” variants.
In regards to LP farming scenarios, the team tested the following common use cases:
- Adding tokens to the two newly created liquidity pools
- Receiving LP tokens after depositing liquidity
- Performing token swaps using the liquidity pools
- Transferring LP tokens to another beneficiary
- Collecting rewards from liquidity pools
The project deliverables can be found on Neon’s GitHub. The contract and token addresses are noted below:
- UniswapV2Factory address: 0x8eA3207A157106B68ECa73638cbacdD6973DaBda
- UniswapV2Router01address: 0x4f8C61909f92c4c8f83E527D8f063F78322b35b7
- UniswapV2Pair contract 1 (tokens 1,2) address: 0xDa0Ed5e2Adda73c6336A1ae9C87A4BbC3Ba46876
- UniswapV2Pair contract 2 (tokens 2,3) address: 0xf285B885f0F113b5fF54354492a6Bac38a6AC188
- Token1 address: 0x72acC5B7306FB3886Dbcea62eB8Cffd83bEE5b9c
- Token2 address: 0x66dE9Ee76b78085ab73386741e20A82c6db09f2B
- Token3 address: 0x8346aD3Ba1476890524eF262a47b589365633E30
The following image highlights the output and status of the testing scenarios at each execution phase.
At the time of testing, all functions of the Uniswap v2 protocol within our testing scope performed as expected on the local Neon network and Devnet. The testing scenarios selected demonstrate the same output in the Hardhat network as in the Neon environment. Overall, the deployment of the Uniswap v2 protocol Solidity code to Neon was seamless and raised no issues. No modifications to the contracts’ source code were required.
For more information on the Uniswap v2 deployment, check out our recent AMA. Now, its your turn to deploy your own smart contracts to Neon EVM. Make sure to let us know what you think. If you run into any issues or need additional guidance, check out our Neon Docs or reach out to a team member on Discord. We know that you’ll create something great!