#41688 [SC-Insight] Code can be optimized to to save a significant amount of gas.
Submitted on Mar 17th 2025 at 15:22:03 UTC by @p3nc1l for Audit Comp | Yeet
Report ID: #41688
Report Type: Smart Contract
Report severity: Insight
Target: https://github.com/immunefi-team/audit-comp-yeet/blob/main/src/Reward.sol
Impacts:
Description
Brief/Intro
The Reward
contract uses IERC20
type to distribute ERC20
token as rewards , but the way IERC20
is defined is unoptimized , as the IERC20
type doesn't get get re-initialized, it must have been declared as immutable
.
Vulnerability Details
look at line
now when ever claim()
function from gets called this token
variable triggered twice , which causes around 2*2100=4200
more gas consumption for the transaction.
Impact Details
The caller has to pay more gas for the same operation which could be done using less gas.
References
Add any relevant links to documentation or code
Proof of Concept
Proof of Concept
Was this helpful?