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

2 stars 0 forks source link

Gas: `PoolTemplate:initialize()::_conditions` should be a fixed array of size 2 #345

Open code423n4 opened 2 years ago

code423n4 commented 2 years ago

Handle

Dravee

Vulnerability details

Impact

Fixed arrays are less expensive than dynamic arrays and would implicitely add the array.length check

Proof of Concept

https://github.com/code-423n4/2022-01-insure/blob/main/contracts/PoolTemplate.sol#L180

Tools Used

VS Code

Recommended Mitigation Steps

Make _conditions a fixed array of size 2

oishun1112 commented 2 years ago

true, but we keep the current implementation to leave some rooms for future upgrade. This is only one time function at deploy, so not going to be a problem in terms of user experience.