Summary:
This report highlights the low-severity findings in the StrategyMainnet.sol
contract. While these issues may not pose immediate risks, addressing them will improve the contract’s overall security, transparency, and operational efficiency. The findings primarily include missing event emissions for important operations and missing validation checks, which can lead to inefficiencies and challenges in off-chain monitoring. Each issue is accompanied by a recommended fix to improve the contract's robustness and maintain best practices.
addRoute
FunctionDescription: The addRoute
function lacks event emissions for route additions, impacting traceability.
Affected Code: #L56-L66
Recommendation: Add an event to log route additions.
_deployFunds
FunctionDescription: The _deployFunds
function does not check if _amount
is greater than zero, leading to unnecessary gas usage.
Affected Code:#L81-L83
Recommendation: Add a require statement to validate _amount
.
_deployFunds
FunctionDescription: The _deployFunds
function interacts with the transmuter but lacks an event emission after fund deployment, making it difficult to track off-chain.
Affected Code:#L81-L83
Recommendation: Emit an event like FundsDeployed(uint256 amount)
.
claimAndSwap
FunctionDescription: The claimAndSwap
function lacks event emissions for claim and swap operations, impacting transparency and traceability.
Affected Code:#L93-L114
Recommendation: Add an event like ClaimedAndSwapped(uint256 amountClaim, uint256 minOut)
.
_freeFunds
FunctionDescription: The _freeFunds
function lacks an event when freeing funds, making it harder to track off-chain.
Affected Code:#L137-L144
Recommendation: Emit an event like FundsFreed(uint256 amount)
.
require
Check for _amount
in _freeFunds
FunctionDescription: The _freeFunds
function does not validate that _amount
is greater than zero, leading to unnecessary gas usage.
Affected Code:#L137-L144
Recommendation: Add a require
statement to validate _amount
.
_harvestAndReport
FunctionDescription: The _harvestAndReport
function lacks event emissions for harvesting actions and reporting total assets, making it harder to track performance.
Affected Code:#L173-L193
Recommendation: Emit an event like HarvestedAndReported(uint256 totalAssets)
.
availableWithdrawLimit
FunctionDescription: The availableWithdrawLimit
function calculates the available withdrawal limit but does not emit an event, impacting transparency.
Affected Code:#L-L
Recommendation: Emit an event like WithdrawLimitUpdated(address owner, uint256 availableLimit)
.
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.