Skip to content

Latest commit

 

History

History
35 lines (21 loc) · 1.92 KB

File metadata and controls

35 lines (21 loc) · 1.92 KB

Use short-circuit boolean evaluation in if guard

Expressions that are part of an if guard are evaluated before the statement, causing unnecessary gas costs in cases where not all conditions need to be evaluated to select the branch.

Occurrences: 2

https://github.com/code-423n4/2022-12-gogopool/blob/main/contracts/contract/BaseAbstract.sol#L44

https://github.com/code-423n4/2022-12-gogopool/blob/main/contracts/contract/BaseAbstract.sol#L55

Store locally value of rewardsPool.getRewardsCycleCount() in ClaimNodeOp contract

The function rewardsPool.getRewardsCycleCount() is called 3 times in lines 61, 65 and 68. Store locally the result of the first call and reuse this later.

https://github.com/code-423n4/2022-12-gogopool/blob/main/contracts/contract/ClaimNodeOp.sol#L61

Usage of safe unchecked math