📄Security Statement & Contract Address
NovaSwap shares the same security features as Uniswap V3. By incorporating Uniswap V3's robust and thoroughly tested secure core code at the smart contract layer, NovaSwap ensures the mitigation of smart contract vulnerabilities and the protection of user funds.
As zkLink Nova utilizes the zkEVM of ZK Stack, we have adopted the successful Uniswap DAO proposal into deploying Uniswap V3. This contract has been audited by ABDK and has been successfully adapted into the zkEVM without affecting the core code and security.
NovaSwap's changes on the basis of the proposal:
NovaSwap has only modified the chain information and some token addresses to make it compatible with the zkLink Nova network:
zkSync Era's changes on the basis of UniSwap V3:
Uniswap V3 zkSync Era contracts changes
v3-periphery/contracts/libraries/PoolAddress.sol:POOL_INIT_CODE_HASH 32. Hardcoded constant
POOL_INIT_CODE_HASH
was changed due to the different bytecode of compiled contracts on zkSync Era. It was also adapted for the 1.1.1 and 1.3.0 versionsv3-periphery/contracts/libraries/PoolAddress.sol:computeAddress 13. The function was changed from the calculation of EVM address derivation to the zkEVM address derivation. It was also adapted for the 1.1.1 and 1.3.0 versions
swap-router-contracts/contracts/libraries/UniswapV2Library.sol:pairFor 5. The function was changed from the calculation of EVM address derivation to the zkEVM address derivation. It should not affect anything, as V2 is unsupported on zksync.
universal-router/contracts/modules/uniswap/v2/UniswapV2Library.sol:pairForPreSorted 6. The function was changed from the calculation of EVM address derivation to the zkEVM address derivation. It should not affect anything, as V2 is unsupported on zksync.
universal-router/contracts/modules/uniswap/v3/V3SwapRouter.sol:computePoolAddress 9. The function was changed from the calculation of EVM address derivation to the zkEVM address derivation.
Some import paths in permit2 contracts 10 were changed due to the transition from Foundry to Hardhat. It will not affect the bytecode.
Uniswap V3 zkSync Era deploy script changes
All the contracts repositories were forked, the build process was changed for zkSync Era, and some contracts were changed due to different address derivation.
zkSync Era doesn’t support runtime library linkage yet, so the script was migrated to the
hardhat
. To theDEPLOY_NFT_POSITION_DESCRIPTOR_V1_3_0
step was added compilation to linkNFTDescriptor
library.Added factory dependencies to the deployment process. The script checks that for contracts any factory dependencies were not missed, for libraries, factory dependencies should always be empty.
index.ts
file logic was wrapped in the function, because nowhardhat
is the entry point and it calls this function.Types from the
ethers
were replaced with the types from thezksync-web3
.
The contract address of NovaSwap
UniswapV3Factory
NonfungibleTokenPositionDescriptor
TransparentUpgradeableProxy
NonfungiblePositionManager
Last updated