Overview

The Pike team engaged Fuzzland to conduct a thorough security audit of their nuts-monorepo project. The primary objective was to identify and mitigate potential security vulnerabilities, risks, and coding issues to enhance the project's robustness and reliability. Fuzzland conducted this assessment over nine person-days, involving three engineers who reviewed the code over a span of 3 days. Employing a multifaceted approach that included static analysis, fuzz testing, formal verification, and manual code review, the Fuzzland team has identified six issues.

Scope

Project Name nuts-monorepo
Language TypeScript
GitHub Repo
Commit
Fix Commit

Disclaimer

The audit does not ensure that it has identified every security issue in the smart contracts, and it should not be seen as a confirmation that there are no more vulnerabilities. The audit is not exhaustive, and we recommend further independent audits and setting up a public bug bounty program for enhanced security verification of the smart contracts. Additionally, this report should not be interpreted as personal financial advice or recommendations.

Auditing Process

Vulnerability Severity

We divide severity into three distinct levels: high, medium, low. This classification helps prioritize the issues identified during the audit based on their potential impact and urgency.

Below is a summary of the vulnerabilities with their current status, highlighting the number of issues identified in each severity category and their resolution progress.

Number Resolved
High Severity Issues 1 0
Medium Severity Issues 3 0
Low Severity Issues 2 0

Findings

[High] Miscalculation may cause missed liquidations

In apps/liquidation-bot/src/handlers/liquidationHandler.ts, the calculation of liquidationBotBalance used this.liquidationBotBalances[underlyingBorrowToken] minus repayAmount. However, when determining whether liquidation is possible, the value of whether botHasBalanceToRepay is greater than repayAmount is used. This is equivalent to requiring this.liquidationBotBalances[underlyingBorrowToken] ≥ 2 * repayAmount. This excessively high requirement for liquidationBotBalance may cause a missed liquidation that should have been completed.