QA Report #166
Labels
bug
Something isn't working
edited-by-warden
QA (Quality Assurance)
Assets are not at risk. State handling, function incorrect as to spec, issues with clarity, syntax
valid
QA Report
Coding style improvements
On line Project.sol:579 change
_costToAllocate
variable name to_allocationBudget
since that better reflects that it's the amount the could be used to allocate tasks.unnecessary cast to
uint256
on Project.sol:200.Documentation improvements
Community.sol:849 "Burn" -> "Mint"
Project.sol:379
If balance is present then it to the builder
. Add word: "transfer" or "send"L-01: For a given project, don't allow
lendToProject
to be called less than 1 day since last call.It is extremely unlikely that a lender would work against their own interests but if they were to repeatedly call
lendToProject
within 1 day then this would lead to unfavourable interest calculations.If we assume that
lastTimestamp
for the project is less than 86400 seconds ago then:claimInterest
would not claim any interestrepayLender
zero interest would also be calculated whenclaimInterest
was called inside the call.This is because
claimInterest
callsreturnToLender
which will then cause_interestEarned
to be set to0
. When_interestEarned
is zero the state of_communityProject
is not updated.This situation is extremely unlikely which is why I have classified this as Low Risk. However, to prevent user error perhaps the
lendToProject
should revert iflastTimestamp
is less than 1 day ago.L-02: No functionality to change contractor
From time to time it might be necessary to fire a contractor or sub-contractor. There does not appear to be any functionality for this.
L-03: No time-locks on admin "setter" functions
Various "setter" functions in
HomeFi
don't have any time locks enabled on them. Consider using the time-lock pattern for those functions that could introduce an admin rug-pull risk.N-01:
allocateFunds
may need to be called afterProject.lendToProject
Function
allocateFunds
can fail to complete as it can only allocate_maxLoop == 50
tasks at a time. The builder needs to be aware that they need to callallocateFunds
multiple times until anIncompleteAllocation
event is not emitted.It might be a good idea to have two events that distinguish between the two reasons that events are not allocated.
_maxLoop
tasks allocatedThe text was updated successfully, but these errors were encountered: