Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

QA Report #145

Open
code423n4 opened this issue Aug 5, 2022 · 0 comments
Open

QA Report #145

code423n4 opened this issue Aug 5, 2022 · 0 comments
Labels
bug Something isn't working QA (Quality Assurance) Assets are not at risk. State handling, function incorrect as to spec, issues with clarity, syntax valid

Comments

@code423n4
Copy link
Contributor

Summary

Low Risk Issues

Issue Instances
1 Too many similar modifier 6

Total: 6 instances over 1 issues

Low Risk Issues

1. Too many similar modifier

There are 5 same functional noZero modifiers in five contracts( HomeFiProxy.solHomeFi.sol, ProjectFactory.sol, DebtToken.sol, Disputes.sol, Community.sol). Then there are two places in the project.sol where the noZero address is determined, but the modifier is not used.

With so many duplicate codes spread across different codes, this brings a potential risk for the contract. For example, instance # 5 is missing a comment compared to the other 4 codes. Although this comment does not affect the contract, it poses a high-level risk if you will change the business logic in the future.

There are 6 instances of this issue:

File: contracts/HomeFi.sol #1

77: modifier nonZero(address _address) {
78:    require(_address != address(0), "HomeFi::0 address");
79:     _;
80: }

https://github.com/code-423n4/2022-08-rigor/blob/5ab7ea84a1516cb726421ef690af5bc41029f88f/contracts/HomeFi.sol#L77-L80

File: contracts/ProjectFactory.sol #2

34:    modifier nonZero(address _address) {
35:       // Ensure an address is not the zero address (0x00)
36:        require(_address != address(0), "PF::0 address");
37:       _;
38:    }

https://github.com/code-423n4/2022-08-rigor/blob/5ab7ea84a1516cb726421ef690af5bc41029f88f/contracts/ProjectFactory.sol#L34-L38

File: contracts/Disputes.sol #3

37:    modifier nonZero(address _address) {
38:       // Ensure an address is not the zero address (0x00)
39:        require(_address != address(0), "Disputes::0 address");
40:       _;
41:    }

https://github.com/code-423n4/2022-08-rigor/blob/5ab7ea84a1516cb726421ef690af5bc41029f88f/contracts/Disputes.sol#L37-L41

File: contracts/Community.sol #4

67:    modifier nonZero(address _address) {
68:       // Ensure an address is not the zero address (0x00)
69:        require(_address != address(0), "Community::0 address");
70:       _;
71:    }

https://github.com/code-423n4/2022-08-rigor/blob/5ab7ea84a1516cb726421ef690af5bc41029f88f/contracts/Community.sol#L67-L71

File: contracts/HomeFiProxy.sol #5

40:    modifier nonZero(address _address) {
41:        require(_address != address(0), "Proxy::0 address");
42:       _;
43:    }

https://github.com/code-423n4/2022-08-rigor/blob/5ab7ea84a1516cb726421ef690af5bc41029f88f/contracts/HomeFiProxy.sol#L40-L43

The noZero address is determined, but the modifier is not used.

File: contracts/Project.sol #6

L135:   require(_contractor != address(0), "Project::0 address");

L153:   require(contractor != address(0), "Project::0 address");

https://github.com/code-423n4/2022-08-rigor/blob/5ab7ea84a1516cb726421ef690af5bc41029f88f/contracts/Project.sol#L135

https://github.com/code-423n4/2022-08-rigor/blob/5ab7ea84a1516cb726421ef690af5bc41029f88f/contracts/Project.sol#L153

@code423n4 code423n4 added bug Something isn't working QA (Quality Assurance) Assets are not at risk. State handling, function incorrect as to spec, issues with clarity, syntax labels Aug 5, 2022
code423n4 added a commit that referenced this issue Aug 5, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working QA (Quality Assurance) Assets are not at risk. State handling, function incorrect as to spec, issues with clarity, syntax valid
Projects
None yet
Development

No branches or pull requests

2 participants