Submitted by minhquanym, also found by berndartmueller, Chom, and scaraven
Project.sol#L710
In Project contract, the lendToProject() function might not be available to be called if there are a lot of Task in tasks[] list of project. It means that the project cannot be funded by either builder or community owner.
This can happen because lendToProject() used projectCost() function. And the loop in projectCost() did not have a mechanism to stop, its only based on the length taskCount, and may take all the gas limit. If the gas limit is reached, this transaction will fail or revert.
Same issue with toggleLendingNeeded() function which also call projectCost() function.
Function projectCost() did not have a mechanism to stop, only based on the taskCount.
There is no limit for builder when add task.
And function lendToProject() used projectCost() to check the new total lent value
Consider keeping value of projectCost() in a storage variable and update it when a task is added or updated accordingly.
parv3213 (Rigor) confirmed
Jack the Pug (judge) decreased severity to Medium
