code-423n4 / 2021-10-tempus-findings

0 stars 0 forks source link

Gas: Don't store cToken twice #26

Open code423n4 opened 2 years ago

code423n4 commented 2 years ago

Handle

cmichel

Vulnerability details

In CompoundTempusPool, the cToken and the base class' yieldBearingToken storage fields are the same. Remove the cToken field and the assignment in the constructor to save gas.

mijovic commented 2 years ago

None of this is storage variable, both are immutables. However, they are duplicated and we should remove the one from CompoundTempusPool

Fixed in https://github.com/tempus-finance/tempus-protocol/pull/375