Multiple mappings can be combined into a single mapping of a value type struct.
The three mappings of Staking.sol supplyIndex,balances and claimable can be combined into a struct for example:
struct User{
uint256 supplyIndex;
uint256 balances;
uint256 claimable;
} ---->
mapping(address => User) public userStats.
This saves a storage slot for the mapping.If a function requires two of the values and they both fit in the same storage slot then subsequent reads and writes can also be cheaper.
Saving Gas
Manual Review
Consider combining these three mappings into a single one of value type struct if you find it suitable
The contest is live. Earn rewards by submitting a finding.
This is your time to appeal against judgements on your submissions.
Appeals are being carefully reviewed by our judges.