sherlock-audit / 2024-05-midas-judging

13 stars 6 forks source link

Inconsistent gap sizes in the contract #191

Closed sherlock-admin4 closed 5 months ago

sherlock-admin4 commented 5 months ago

Inconsistent gap sizes in the contract

Low/Info issue submitted by shaflow01

Summary

The gap size in the contract is inconsistent, which is a style issue.

Vulnerability Detail

In DepositVault and mTBILL, the gap size is 50. But in the RedemptionVault contract, the gap size is 51

Impact

Inconsistent gap rules may cause trouble for subsequent upgrades

Code Snippet

github :https://github.com/sherlock-audit/2024-05-midas/blob/main/midas-contracts/contracts/RedemptionVault.sol#L40 github:https://github.com/sherlock-audit/2024-05-midas/blob/main/midas-contracts/contracts/DepositVault.sol#L60 github:https://github.com/sherlock-audit/2024-05-midas/blob/main/midas-contracts/contracts/mTBILL.sol#L23

Tool used

Manual Review

Recommendation

Specify the contract gap size and consider the occupied slots. For example, if the gap size is set to 50, assuming that Contract A has already used 2 slots, then the gap size is 48. If Contract B has already used 3 slots, then the gap size should be 47

sherlock-admin2 commented 5 months ago

The protocol team fixed this issue in the following PRs/commits: https://github.com/RedDuck-Software/midas-contracts/pull/48

sherlock-admin2 commented 5 months ago

The Lead Senior Watson signed off on the fix.