Open code423n4 opened 2 years ago
this can be bumped to medium severity:
Unbounded payment is prone to user errors: https://github.com/code-423n4/2022-05-cally-findings/issues/84
high quality report
Per the C4 guidance "part of auditing is demonstrating proper theory of how an issue could be exploited" and that does not seem to be explored here as it was in the primary report.
QA Report
vaultIndex
inexplicably starts from3
It does not make sense that the vault index starts from
3
. If it was intended that the indexing starts from1
, you can simply move the incrementation one line below.NewVault
event does not mention token typeToken type might be something useful for off-chain indexers and the user frontend.
Important state change does not emit event
Changing the protocol fee should emit an event because that is an important state variable.
Too few elements in
premiumOptions
andstrikeOptions
The range in
premiumOptions
andstrikeOptions
can be limiting. For example 0.01 ETH can be considered too high for a premium if ETH price increases by a lot. Also, there may be other EVM chains where the predefined options do not make sense for their prices.I suggested in my gas report to make these arrays fixed length. If you decide to go with that approach, I suggeset increasing the element count by hardcoding into the contract to offer a higher range and option of prices.
If you do not plan to make the arrays fixed length, then the protocol owners can benefit from the ability to add more options by push functions as demonstrated below.
Unbounded payment is prone to user errors
buyOption()
allows unbounded payments. Allowing unbounded payment can result in user mistakes. It makes more sense here to require equality to not allow such mistakes.