PrizeSplit.sol#_totalPrizeSplitPercentageAmount()
Avoid unnecessary copy from storage to memory can save gas
#40
Labels
bug
Warden finding
G (Gas Optimization)
resolved
Finding has been patched by sponsor (sponsor pls link to PR containing fix)
sponsor confirmed
Sponsor agrees this is a problem and intends to fix it (OK to use w/ "disagree with severity")
Handle
WatchPug
Vulnerability details
https://github.com/pooltogether/v4-core/blob/055335bf9b09e3f4bbe11a788710dd04d827bf37/contracts/prize-strategy/PrizeSplit.sol#L135-L136
Only
percentage
of thePrizeSplitConfig
struct is accessed, however, the current implementation created a memory variable that will load_prizeSplits[index]
and copy to memory, this is unnecessary and gas inefficient.Recommendation
Change to:
The text was updated successfully, but these errors were encountered: