function totalSupply() external view returns (uint256 total) {
// loop over all plugins and sum up totalClaimable
for (uint256 i = 0; i < nPlugins; i++) {
total += IPlugin(plugins[i]).totalClaimable();
}
// totalSupply is the total claimable from all plugins plus the total amount staked
total + _totalStaked;
}
And do the same update in other similar functions in the StakingModule and other places.
Met
informational
[gas] not using the return variable
Summary
Local variable is returned, wasting gas.
Vulnerability Detail
In StakingModule::totalSupply() the return variable is not used and a local variable is returned instead, which wastes gas.
Note: This applies to multiple methods in the StakingModule and other places too.
Impact
Code Snippet
https://github.com/sherlock-audit/2022-11-telcoin/blob/main/contracts/StakingModule.sol#L79-L89
Tool used
Manual Review
Recommendation
Change to
And do the same update in other similar functions in the StakingModule and other places.