Rigor Protocol contest - joestakey's results

Community lending and instant payments for new home construction.

General Information

Platform: Code4rena

Start Date: 01/08/2022

Pot Size: $50,000 USDC

Total HM: 26

Participants: 133

Period: 5 days

Judge: Jack the Pug

Total Solo HM: 6

Id: 151

League: ETH

Rigor Protocol

Findings Distribution

Researcher Performance

Rank: 64/133

Findings: 1

Award: $62.71

🌟 Selected for report: 0

🚀 Solo Findings: 0

QA Report

Table of Contents

Low

summary

Can submit a project with no budget

IMPACT

According to the documentation:

Note that you cannot submit a project with no total budget. Therefore it requires at least one task with a budget > 0

It is however possible to call Community.publishProject() for a project with no budget

SEVERITY

Low

PROOF OF CONCEPT

Community.sol

In publishProject(), there is no check that the project in question has a budget or tasks added to it.

TOOLS USED

Manual Analysis

MITIGATION

Add the following line to publishProject():

require(_projectInstance.projectCost() > 0, "Community:project has no total budget");

totalLent mismatch across contracts

PROBLEM

There is a mismatch across contracts between the totalLent variables keeping track of the total amount lent to a project:

  • in Community.sol, _communities[_communityID].projectDetails[_project].totalLent does not take into account Project.totalLent. This does not lead to any loss of funds as there are checks in Project.sol, but this can be misleading for anyone calling Community.projectDetails, as the _communityProject.totalLent return value may not match Project.totalLent, ie the real amount lent to a project.

TOOLS USED

Manual Analysis

MITIGATION

421:         _communities[_communityID]
422:             .projectDetails[_project]
-423:             .totalLent += _amountToProject;
+423:             .totalLent = _projectInstance.totalLent()+ _amountToProject;

Wrong revert condition comment

IMPACT

The comment describing the revert condition of the first check in Project.lendToProject does not exactly match the revert condition

SEVERITY

Low

PROOF OF CONCEPT

For two conditions A and B, there is the equivalence:

!(!A || B) <=> (A && !B)

We can hence rewrite this require statement as:

if (restrictedToAdmin && _sender != homeFi.admin()

which reverts if the community creation is paused and sender is not HomeFi admin.

The former comment is a bit misleading because the or makes it sound as if only the homeFi admin can call createCommunity().

TOOLS USED

Manual Analysis

MITIGATION

-// Revert if community creation is paused or sender is not HomeFi admin
+// Revert if community creation is paused and sender is not HomeFi admin
AuditHub

A portfolio for auditors, a security profile for protocols, a hub for web3 security.

Built bymalatrax © 2024

Auditors

Browse

Contests

Browse

Get in touch

ContactTwitter