code-423n4 / 2021-07-sherlock-findings

0 stars 0 forks source link

Unused functions and storage cost gas. #120

Open code423n4 opened 3 years ago

code423n4 commented 3 years ago

Handle

tensors

Vulnerability details

Impact

Unused functions and storage shouldn't be declared. They use extra gas.

Proof of Concept

Gov.sol- L162 https://github.com/code-423n4/2021-07-sherlock/blob/d9c610d2c3e98a412164160a787566818debeae4/contracts/facets/Gov.sol#L161

Recommended Mitigation Steps

If the code is to be updated later, use a proxy instead so that extra gas cost is only applied when needed.

Evert0x commented 3 years ago

Ack, but if we need the variable later, it is nice if it is already initialized.