BaseUpgradeable is using a non-upgradeable dependency #499
Labels
bug
Something isn't working
downgraded by judge
Judge downgraded the risk level of this issue
duplicate-710
edited-by-warden
QA (Quality Assurance)
Assets are not at risk. State handling, function incorrect as to spec, issues with clarity, syntax
Lines of code
https://github.com/code-423n4/2022-12-gogopool/blob/main/contracts/contract/BaseUpgradeable.sol#L9
Vulnerability details
Impact
BaseUpgradeable
is using a non-upgradeable dependency (BaseAbstract) which will eventually break upgradeabilityProof of Concept
Currently, the
BaseUpgradeable
contract inherits theBaseAbstract
contract. TheBaseUpgradeable
contract is meant to be used by a proxy contract which means that all dependencies should be proxy capable as well. The issue forBaseAbstract
lies in the missing_gap
variable. If a state variable is ever added toBaseAbstract
this will result in a storage collision with all other storage slots, in this case it would break the storage inInitializable.sol
andBaseUpgradeable.sol
.This issue is of course also present in
TokenggAVAX.sol
sinceBaseUpgradeable
is there inherited as well.Tools Used
VSCode, remix
Recommended Mitigation Steps
Consider copying the
BaseAbstract
contract, rename it toBaseAbstractUpgradeable
and add a_gap
variable to it.uint256[50] private __gap;
The text was updated successfully, but these errors were encountered: