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

2 stars 0 forks source link

Multiple has ==true comparison in require statement #318

Closed code423n4 closed 2 years ago

code423n4 commented 2 years ago

Handle

defsec

Vulnerability details

Impact

The contract has an unnecessary ==true comparison in its require statement. Since require already checks if the condition is true, there is no need for it to be compared.

Proof of Concept

  1. Navigate the following contract lines.
https://github.com/code-423n4/2022-01-insure/blob/19d1a7819fe7ce795e6d4814e7ddf8b8e1323df3/contracts/PoolTemplate.sol#L612

https://github.com/code-423n4/2022-01-insure/blob/19d1a7819fe7ce795e6d4814e7ddf8b8e1323df3/contracts/Factory.sol#L122

https://github.com/code-423n4/2022-01-insure/blob/19d1a7819fe7ce795e6d4814e7ddf8b8e1323df3/contracts/Factory.sol#L142

https://github.com/code-423n4/2022-01-insure/blob/19d1a7819fe7ce795e6d4814e7ddf8b8e1323df3/contracts/Factory.sol#L166

Tools Used

Code Review

Recommended Mitigation Steps

Removing == true saves a tiny amount of gas.

oishun1112 commented 2 years ago

https://github.com/code-423n4/2022-01-insure-findings/issues/194