QA Report #268
Labels
bug
Something isn't working
QA (Quality Assurance)
Assets are not at risk. State handling, function incorrect as to spec, issues with clarity, syntax
QA Report
Table of Contents
summary
Events emitted early
PROBLEM
It is not recommended to emit events before the end of the computations, as the function might revert based on conditions ahead of the event emission
SEVERITY
Low
PROOF OF CONCEPT
Instances include:
Cally.sol
TOOLS USED
Manual Analysis
MITIGATION
Place the event emission in the last position in the function.
Event should be emitted in setters
PROBLEM
Setters should emit an event so that Dapps can detect important changes to storage
SEVERITY
Low
PROOF OF CONCEPT
Instances include:
Cally.sol
TOOLS USED
Manual Analysis
MITIGATION
Emit an event in all setters.
Function missing comments
PROBLEM
Some functions are missing comments.
SEVERITY
Non-Critical
PROOF OF CONCEPT
Instances include:
Cally.sol
CallyNft.sol
TOOLS USED
Manual Analysis
MITIGATION
Add comments to these functions
Related data should be grouped in struct
PROBLEM
When there are mappings that use the same key value, having separate fields is error prone, for instance in case of deletion or with future new fields.
SEVERITY
Non-Critical
PROOF OF CONCEPT
Instances include:
Cally.sol
TOOLS USED
Manual Analysis
MITIGATION
Group the related data in a struct and use one mapping. For instance, for the
Cally.sol
mappings, the mitigation could be:And it would be used as a state variable:
nonReentrant modifier unused
PROBLEM
Some external functions calling the ERC20 methods
safeTransfer
orsafeTransferFrom
do not have the nonReentrant modifier and are hence unprotected to reentrancy (besides the gas limit on the methods). No funds are directly at loss but it is best practice to avoid reentrancy altogether.SEVERITY
Low
PROOF OF CONCEPT
Instances include:
Cally.sol
TOOLS USED
Manual Analysis
MITIGATION
Use the
nonReentrant
modifier on these functions.High
feeRate
can break core protocol functionPROBLEM
There is no maximum input value on
setFee()
inCally.sol
. But if the owner sets it to a uint greater than 1e18, the users will not be able to callexercice()
as the function will revert, breaking the protocol's functionality.SEVERITY
Low
PROOF OF CONCEPT
Instances include:
Cally.sol
If feeRate is set so that
ethBalance[getVaultBeneficiary(vaultId)]
+ msg.value < fee, and the following statement will revertTOOLS USED
Manual Analysis
MITIGATION
Add a check in
setFee
to ensure the new fee rate is less than a maximummaxFeeRate
. Its value depends on different factors, but considering it determines how much ETH a vault creator is receiving from a strike, it should be reasonably low (ie less than 0.5 * 1e18)Unchecked inputs
PROBLEM
Setters should check the input value - ie make revert if it is the zero address. Here, if the vault beneficiary is set as the zero address, all the strike ETH associated with the vault will be locked.
SEVERITY
Low
PROOF OF CONCEPT
Instances include:
Cally.sol
TOOLS USED
Manual Analysis
MITIGATION
Add a zero address check
The text was updated successfully, but these errors were encountered: