Platform: Code4rena
Start Date: 29/07/2021
Pot Size: $20,000 USDC
Total HM: 8
Participants: 12
Period: 3 days
Judge: LSDan
Total Solo HM: 2
Id: 24
League: ETH
Rank: 12/12
Findings: 1
Award: $26.40
🌟 Selected for report: 1
🚀 Solo Findings: 0
🌟 Selected for report: maplesyrup
26.3992 USDC - $26.40
maplesyrup
This is a gas optimization, does not affect the contract negatively, only optimizes it.
According to Slither Analyzer documentation (https://github.com/crytic/slither/wiki/Detector-Documentation#public-function-that-could-be-declared-external), functions that are never called within the contract should be declared as external to save gas for the contract.
In this case, there were only 2 functions in the contract that were found that should be declared as external for further gas optimization.
Code Snippet:
function approveMax() public {...} <---- should be declared external
(contracts/yield-source/MStableYieldSource.sol, lines #61-65)
function depositToken() public view override returns (address underlyingMasset) {...} <---- should be declared external
(contracts/yield-source/MStableYieldSource.sol, lines #69-71)
Console output:
INFO:Detectors: approveMax() should be declared external: - MStableYieldSource.approveMax() (contracts/yield-source/MStableYieldSource.sol#61-65) depositToken() should be declared external: - MStableYieldSource.depositToken() (contracts/yield-source/MStableYieldSource.sol#69-71) Reference: https://github.com/crytic/slither/wiki/Detector-Documentation#public-function-that-could-be-declared-external
PoolTogether Contracts Solidity (v 0.7.4) Hardhat (v 2.5.0) Yarn (v 1.22.10) Slither Analyzer (v 0.8.0)
#0 - PierrickGT
2021-08-13T16:03:21Z