Due to missing gap in Stablecoinhandler contract. Contract cannot be upgraded properly in future versions.
AmirX still can be upgradable using the last storage of the contract but we can't upgrade Stablecoinhandler and reflect those changes to AmirX contract. If we make any change on Stablecoinhandler, it will cause storage collusion due to improper handling.
Impact
Medium - Protocol can't upgrade Stablecoinhandler because in AmirX the state variables of the Stablecoinhandler is stored at the top of the AmirX contract and then the state variables of AmirX comes in the storage.
In conclusion, any change on Stablecoinhandler will overwrite to AmirX storage variables and the data will corrupted.
Mitigation
Add simple __gap at the end of the state variable definitions of Stablecoinhandler
TessKimy
Medium
Missing gap on upgradable contract
Summary
Missing gap on upgradable contract
Root Cause
Due to missing gap in Stablecoinhandler contract. Contract cannot be upgraded properly in future versions.
AmirX still can be upgradable using the last storage of the contract but we can't upgrade Stablecoinhandler and reflect those changes to AmirX contract. If we make any change on Stablecoinhandler, it will cause storage collusion due to improper handling.
Impact
Medium - Protocol can't upgrade Stablecoinhandler because in AmirX the state variables of the Stablecoinhandler is stored at the top of the AmirX contract and then the state variables of AmirX comes in the storage.
In conclusion, any change on Stablecoinhandler will overwrite to AmirX storage variables and the data will corrupted.
Mitigation
Add simple
__gap
at the end of the state variable definitions of Stablecoinhandler