QA Report #110
Labels
bug
Something isn't working
disagree with severity
Sponsor confirms validity, but disagrees with warden’s risk assessment (sponsor explain in comments)
QA (Quality Assurance)
Assets are not at risk. State handling, function incorrect as to spec, issues with clarity, syntax
QA Report
Non-Critical Findings
Contract implementations should inherit their interface
Description
It's best practice for a contract to inherit from it's interface. This improves the contract's clarity and makes sure the contract implementation complies with the defined interface.
Findings
LongShortToken.sol:
Recommended mitigation steps
Inherit from the missing interface or contract.
Use scientific notation
1e10
instead of using many zerosDescription
For better readability and to prevent any issues, use the scientific notation
1e10
instead of e.g. 1000000Findings
Collateral.FEE_DENOMINATOR:
1000000
-> use1e6
PrePOMarket.FEE_DENOMINATOR:
1000000
-> use1e6
Boolean constants can be used directly and do not need to be compare to
true
orfalse
Description
Boolean constants can be used directly and do not need to be compare to true or false.
Findings
Collateral.deposit()
Recommended mitigation steps
Remove the equality to the boolean constant.
Remove empty blocks of code
Description
Code contains empty block. See https://protofire.github.io/solhint/docs/rules/best-practises/no-empty-blocks.html
Findings
AccountAccessController.constructor()
Recommended mitigation steps
Remove empty code block
Use interface
ICollateral
instead ofIERC20
Description
Use more specific interface
ICollateral
instead of the general interfaceIERC20
for code clarity.Findings
PrePOMarket._collateral
PrePOMarket.constructor()
Recommended mitigation steps
Change variable type
IERC20
toICollateral
:and
Low Risk
Wrong calculation of shares mentioned in comment of
Collateral.deposit()
Description
In the comments, right next to the actual implementation of the calculation of shares, the formula is wrong. The implementation itself is correct.
Wrong calculation:
Correct calculation:
Findings
Collateral.deposit()
Recommended mitigation steps
Fix comment to prevent confusion with actual implementation.
Zero-address checks are missing
Description
Zero-address checks are a best-practice for input validation of critical address parameters. While the codebase applies this to most most cases, there are many places where this is missing in constructors and setters.
Impact: Accidental use of zero-addresses may result in exceptions, burn fees/tokens or force redeployment of contracts.
Findings
Collateral.initialize()#_newTreasury
Recommended mitigation steps
Add zero-address checks, e.g.:
Parameter order of
PrePOMarketFactory.createMarket()
is different than defined in interfaceIPrePOMarketFactory.createMarket()
Description
The order of parameters in the contract implementation
PrePOMarketFactory
is different than how parameters are defined in the interface.Findings
PrePOMarketFactory.createMarket()
Recommended mitigation steps
Either change the order of parameters in the interface
IPrePOMarketFactory
to match the implementation or update the implementation.IPrePOMarketFactory.createMarket()
PrePOMarketFactory.createMarket()
The text was updated successfully, but these errors were encountered: