code-423n4 / 2022-05-cally-findings

2 stars 0 forks source link

acedently overpaying when buying an option #328

Closed HardlyDifficult closed 2 years ago

HardlyDifficult commented 2 years ago

From MadWookie in #164

File:Cally.sol#224 require(msg.value >= premium, "Incorrect ETH amount sent"); Using == operator is 3 gas cheaper than >=. This also keeps people from acedently overpaying when buying an option.

Summary Implementing each of these would reduce the deploymnt cost from 5,431,682 to 5,387,621 and reduces buyOption from 75,765 to 75,013.

HardlyDifficult commented 2 years ago

Dupe of https://github.com/code-423n4/2022-05-cally-findings/issues/84

JeeberC4 commented 2 years ago

Issue recreated with script that includes all required data.