sherlock-audit / 2022-10-rage-trade-judging

1 stars 0 forks source link

zimu - Compatibility issue: import different version of contracts from Uniswap #53

Closed github-actions[bot] closed 1 year ago

github-actions[bot] commented 1 year ago

zimu

low

Compatibility issue: import different version of contracts from Uniswap

Summary

The project import both uniswap/v3-core and uniswap/v3-core-0.8-support. It is better to unify these two versions in project to avoid possible compatible problem.

Vulnerability Detail

@uniswap/v3-core-0.8-support/contracts/libraries/FullMath.sol is imported in some files, like dn-gmx-vaults/contracts/libraries/FeeSplitStrategy.sol and dn-gmx-vaults/contracts/vaults/DnGmxSeniorVault.sol. While some other .sol files import @uniswap/v3-core/contracts/interfaces/callback/IUniswapV3SwapCallback.sol.

Impact

It may encounter compatible problem.

Code Snippet

The files import v3-core-0.8-support https://github.com/sherlock-audit/2022-10-rage-trade/blob/main/dn-gmx-vaults/contracts/libraries/FeeSplitStrategy.sol#L1 https://github.com/sherlock-audit/2022-10-rage-trade/blob/main/dn-gmx-vaults/contracts/vaults/DnGmxSeniorVault.sol#L1 https://github.com/sherlock-audit/2022-10-rage-trade/blob/main/dn-gmx-vaults/contracts/periphery/WithdrawPeriphery.soll#L1 https://github.com/sherlock-audit/2022-10-rage-trade/blob/main/dn-gmx-vaults/contracts/vaults/DnGmxBatchingManager.sol#L1 https://github.com/sherlock-audit/2022-10-rage-trade/blob/main/dn-gmx-vaults/contracts/vaults/DnGmxSeniorVault.sol#L1

The files import v3-core through import { ISwapRouter } from '@uniswap/v3-periphery/contracts/interfaces/ISwapRouter.sol' https://github.com/sherlock-audit/2022-10-rage-trade/blob/main/dn-gmx-vaults/contracts/vaults/DnGmxJuniorVault.sol#L1 https://github.com/sherlock-audit/2022-10-rage-trade/blob/main/dn-gmx-vaults/contracts/mocks/SwapRouterMock.sol#L1 https://github.com/sherlock-audit/2022-10-rage-trade/blob/main/dn-gmx-vaults/contracts/mocks/DnGmxJuniorVaultMock.sol#L1 https://github.com/sherlock-audit/2022-10-rage-trade/blob/main/dn-gmx-vaults/contracts/interfaces/IDnGmxJuniorVault.sol#L1 https://github.com/sherlock-audit/2022-10-rage-trade/blob/main/dn-gmx-vaults/contracts/libraries/DnGmxJuniorVaultManager.sol#L1

Tool used

Manual Review

Recommendation

Unify these two versions in project to avoid possible compatible problem.