Closed code423n4 closed 1 year ago
seems invalid
RoeRouter(roeRouter).pools(poolId) should already contain the infomation
Keref marked the issue as sponsor disputed
Ticks are already added in the correct order so that it doesn't need to be checked afterwards
gzeon-c4 marked the issue as unsatisfactory: Invalid
Lines of code
https://github.com/code-423n4/2023-08-goodentry/blob/main/contracts/GeVault.sol#L64 https://github.com/code-423n4/2023-08-goodentry/blob/main/contracts/GeVault.sol#L124-L127 https://github.com/code-423n4/2023-08-goodentry/blob/main/contracts/GeVault.sol#L145-L148 https://github.com/code-423n4/2023-08-goodentry/blob/main/contracts/GeVault.sol#L337-L363
Vulnerability details
Impact
When GeVault is initialized, it has an option to set
baseTokenIsToken0
to decide how ticks are ordered. However, inside rebalance process it never check thebaseTokenIsToken0
and can make rebalance process broken.Proof of Concept
When first created, GeVault creator need to set
baseTokenIsToken0
inside constructor value :https://github.com/code-423n4/2023-08-goodentry/blob/main/contracts/GeVault.sol#L67-L94
This
baseTokenIsToken0
will decide how owner order the added ticks whenpushTick
orshiftTick
is called :https://github.com/code-423n4/2023-08-goodentry/blob/main/contracts/GeVault.sol#L116-L132
https://github.com/code-423n4/2023-08-goodentry/blob/main/contracts/GeVault.sol#L137-L161
However, when
rebalance
process is performed anddeployAssets
is called, the distribution never considered thebaseTokenIsToken0
.https://github.com/code-423n4/2023-08-goodentry/blob/main/contracts/GeVault.sol#L337-L363
This could cause rebalance process have opposite effect.
Tools Used
Manual review
Recommended Mitigation Steps
Adjust
rebalance
anddeployAssets
call based onbaseTokenIsToken0
value.Assessed type
Context