Introduction
We express our gratitude to the Paribus team for the collaborative engagement that enabled the execution of this Smart Contract Security Assessment.
Paribus is a cross-chain borrowing and lending protocol for NFTs, liquidity positions, and synthetic assets, powered by the Cardano blockchain.
title | content |
---|---|
Platform | EVM |
Language | Solidity |
Tags | Lending Platform |
Timeline | 20/04/2022 - 24/05/2022 |
Methodology | https://hackenio.cc/sc_methodology→ |
Review Scope | |
---|---|
Repository | https://github.com/Paribus/paribus-protocol→ |
Commit | d6e83354692f6fd0e6b988ed06ae676c921d58a3 |
Review Scope
- Commit
- d6e83354692f6fd0e6b988ed06ae676c921d58a3
Audit Summary
10/10
10/10
7/10
5/10
The system users should acknowledge all the risks summed up in the risks section of the report
Document Information
This report may contain confidential information about IT systems and the intellectual property of the Customer, as well as information about potential vulnerabilities and methods of their exploitation.
The report can be disclosed publicly after prior consent by another Party. Any subsequent publication of this report shall be without mandatory consent.
Document | |
---|---|
Name | Smart Contract Code Review and Security Analysis Report for Paribus |
Audited By | Hacken |
Website | https://paribus.io/→ |
Changelog | 09/05/2022 - Initial Review |
24/05/2022 - Second Review |
Document
- Name
- Smart Contract Code Review and Security Analysis Report for Paribus
- Audited By
- Hacken
- Website
- https://paribus.io/→
- Changelog
- 09/05/2022 - Initial Review
- 24/05/2022 - Second Review
System Overview
The Paribus Protocol is an Ethereum smart contract for supplying or borrowing assets. Through the pToken contracts, accounts on the blockchain supply capital (Ether or ERC-20 tokens) to receive pTokens or borrow assets from the protocol (holding other assets as collateral). The Paribus pToken contracts track these balances and algorithmically set interest rates for borrowers. The core contracts in the Paribus Protocol:
PToken, PErc20 and PEther — the Paribus pTokens, self-contained borrowing and lending contracts. PToken contains the core logic, and PErc20 and PEther add public interfaces for Erc20 tokens and Ether, respectively. Each PToken is assigned an interest rate and risk model, and allows accounts to mint (supply capital), redeem (withdraw capital), borrow and repay a borrow. Each PToken is an ERC-20 compliant token where balances represent ownership of the market.
Comptroller — the risk model contract, which validates permissible user actions and disallows actions if they do not fit certain risk parameters. For instance, the Comptroller enforces that each borrowing user must maintain a sufficient collateral balance across all pTokens.
Paribus (PBX) — the Paribus Governance Token.
InterestRateModel — contracts which define interest rate models. These models algorithmically determine interest rates based on the current utilization of a given market (that is, how much of the supplied assets are liquid versus borrowed).
WhitePaperInterestRateModel — initial interest rate model, as defined in the Whitepaper. This contract accepts a base rate and slope parameter in its constructor.
Executive Summary
Documentation quality
The total Documentation quality score is 5 out of 10.
Customer provided superficial functional and technical requirements.
Code quality
The total Code quality score is 7 out of 10.
Commented code.
TODO comments.
Unit tests were provided.
Architecture quality
The architecture quality score is 10 out of 10.
Follows best practices.
Security score
Upon auditing, the code was found to contain 0 critical, 0 high, 2 medium, and 0 low severity issues. Out of these, 1 issues have been addressed and resolved, leading to a Security score of 10 out of 10.
All identified issues are detailed in the “Findings” section of this report.
Summary
The comprehensive audit of the customer's smart contract yields an overall score of 9.2. This score reflects the combined evaluation of documentation, code quality, test coverage, and security aspects of the project.
Findings
Code ― | Title | Status | Severity | |
---|---|---|---|---|
F-2022-1878 | The code does not consider all cases | fixed | Medium | |
F-2022-1877 | Unfinished code | unfixed | Medium |
Identify vulnerabilities in your smart contracts.
Appendix 1. Severity Definitions
When auditing smart contracts, Hacken is using a risk-based approach that considers Likelihood, Impact, Exploitability and Complexity metrics to evaluate findings and score severities.
Reference on how risk scoring is done is available through the repository in our Github organization:
Severity | Description |
---|---|
Critical | Critical vulnerabilities are usually straightforward to exploit and can lead to the loss of user funds or contract state manipulation. |
High | High vulnerabilities are usually harder to exploit, requiring specific conditions, or have a more limited scope, but can still lead to the loss of user funds or contract state manipulation. |
Medium | Medium vulnerabilities are usually limited to state manipulations and, in most cases, cannot lead to asset loss. Contradictions and requirements violations. Major deviations from best practices are also in this category. |
Low | Major deviations from best practices or major Gas inefficiency. These issues will not have a significant impact on code execution, do not affect security score but can affect code quality score. |
Severity
- Critical
Description
- Critical vulnerabilities are usually straightforward to exploit and can lead to the loss of user funds or contract state manipulation.
Severity
- High
Description
- High vulnerabilities are usually harder to exploit, requiring specific conditions, or have a more limited scope, but can still lead to the loss of user funds or contract state manipulation.
Severity
- Medium
Description
- Medium vulnerabilities are usually limited to state manipulations and, in most cases, cannot lead to asset loss. Contradictions and requirements violations. Major deviations from best practices are also in this category.
Severity
- Low
Description
- Major deviations from best practices or major Gas inefficiency. These issues will not have a significant impact on code execution, do not affect security score but can affect code quality score.
Appendix 2. Scope
The scope of the project includes the following smart contracts from the provided repository:
Scope Details | |
---|---|
Repository | https://github.com/Paribus/paribus-protocol→ |
Commit | d6e83354692f6fd0e6b988ed06ae676c921d58a3 |
Whitepaper | Not provided |
Requirements | Partially provided→ |
Technical Requirements | Provided→ |
Scope Details
- Commit
- d6e83354692f6fd0e6b988ed06ae676c921d58a3
- Whitepaper
- Not provided
- Requirements
- Partially provided→
- Technical Requirements
- Provided→
Contracts in Scope
contracts/CompoundLens.sol
contracts/Comptroller.sol
contracts/ComptrollerStorage.sol
contracts/ErrorReporter.sol
contracts/Governance/PBXToken.sol
contracts/InterestRateModels/BaseJumpRateModelV2.sol
contracts/InterestRateModels/DAIInterestRateModelV3.sol
contracts/InterestRateModels/InterestRateModel.sol
contracts/InterestRateModels/JumpRateModel.sol
contracts/InterestRateModels/JumpRateModelV2.sol
contracts/InterestRateModels/LegacyInterestRateModel.sol
contracts/InterestRateModels/LegacyJumpRateModelV2.sol
contracts/InterestRateModels/WhitePaperInterestRateModel.sol
contracts/Interfaces/ComptrollerInterface.sol
contracts/Interfaces/EIP20Interface.sol
contracts/Interfaces/EIP20NonStandardInterface.sol
contracts/Interfaces/IUniswapV2Factory.sol
contracts/Interfaces/IUniswapV2Router.sol