QA Report #281
Labels
bug
Something isn't working
QA - High quality report
QA (Quality Assurance)
Assets are not at risk. State handling, function incorrect as to spec, issues with clarity, syntax
Summary of Findings for Low / Non-Critical issues
LOW
NON-CRITICAL
Details L-01
Title : wrong error message string in function createVault()
Function : createVault() in Cally.sol
line 169 require(dutchAuctionReserveStrike < strikeOptions[dutchAuctionStartingStrikeIndex], "Reserve strike too small");
Impact
If the current error message is followed, user will never be able to successfully createVault()
Recommended Mitigation Steps
Correct error message string
Details L-02
Title : function vaults() can return misleading information
VaultId are odd in number; if a valultId of event number is given, the function valuts() will return misleading information.
Function valuts() in Cally.sol
Recommended Mitigation Steps
Check if the valutID parameter is of vault type, by adding a require statement
Details L-03
Title : initiateWithdraw() should not be callable , if option already exercised
If the option is already exercised, the vault owner should not be allowed to call the initiateWithdraw() function.
Recommended Mitigation Steps
Add a require statement in the function initiateWithdraw()
Details L-04
Title : ambiguous error message in createVault() for durationDays
If a value of 0 is given for durationDays in the createVault() function, the transaction will revert with an ambigous message "durationDays too small"
It can better stated as given below
Recommended Mitigation Steps
Error message string can be changed as below.
Details L-05
Title : the available values in premiumOptions[] & strikeOptions[] are too restrictive
To reduce gas and storage, the protocol has currently designed to store the index of the premiumOptions[] & strikeOptions[] in the Vault structure.
Impact
This is too restrictive and may not be future proof.
Recommended Mitigation Steps
One suggestion is to add another member unit8 premiumMultiplier (with default value of 1) in the Vault struct, and users can have combination of values of the
premiumMultiplier and premiumIndex to define more range of premium values if required.
Same suggestion applies for adding a multiplier for the strikeOptions[]
Details L-06
Title : No event is raised when feeRate is changed
Impact
When feeRate is changed at setFee(Cally.sol), no event is raised. It would be important to raise this event for any external integration with this system.
Proof of Concept
Contract : Cally.sol
Function : setFee
Recommended Mitigation Steps
event definition
event emit at setFee function
Details L-07
Title : No event is raised when vault beneficiary is changed
Impact
When beneficiary is changed at setVaultBeneficiary(Cally.sol), no event is raised. It would be important to raise this event for any external integration with this system.
Proof of Concept
Contract : Cally.sol
Function : setVaultBeneficiary
Recommended Mitigation Steps
event definition
event emit at setVaultBeneficiary function
Details NC-01
Title : consistency in fetching vault values
In Cally.sol, function buyOption the following is the order of lines.
line 208 require(vaultId % 2 != 0, "Not vault type");
line 211 Vault memory vault = _vaults[vaultId];
This can be made consistent with other functions by changing the order.
Vault memory vault = _vaults[vaultId];
require(vaultId % 2 != 0, "Not vault type");
Details NC-02
Title : valutIndex = 1 is never used
The value of vaultIndex = 1 is never assigned to any vault.
This can be changed to as below, so that vaultID = 1 is also used
The text was updated successfully, but these errors were encountered: