unnecessary double totalLiquidity()
call in function availableBalance
#121
Labels
bug
Something isn't working
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
Tomio
Vulnerability details
Impact
by saving
totalLiquidity()
to memory can save more gas instead of doing double function callProof of Concept
Before: https://github.com/code-423n4/2022-01-insure/blob/main/contracts/PoolTemplate.sol#L829
// gas cost 23862
After:
// gas cost 23840
Tools Used
Remix
The text was updated successfully, but these errors were encountered: