code-423n4 / 2022-01-insure-findings

2 stars 0 forks source link

Gas: `incident.payoutNumerator` is used only once. It shouldn't be stored in a variable. #349

Open code423n4 opened 2 years ago

code423n4 commented 2 years ago

Handle

Dravee

Vulnerability details

Impact

Increased gas cost (1 MSTORE and 1 MLOAD)

Proof of Concept

https://github.com/code-423n4/2022-01-insure/blob/main/contracts/PoolTemplate.sol#L552 There's no readability or gas gain from copying incident.payoutNumerator to a variable as it's used only once in the method.

Tools Used

VS Code

Recommended Mitigation Steps

Do not store this data in a variable