Detectbox Audit Reports
Kunji Finance Security Audit Report
Overview

OVERVIEW

Audit Summary

A time-boxed independent security assessment of the Kunji Finance Contract was done by Samrat Gupta( @Sm4rty-), Rohan Jha( @rohan16_ ) and Team DetectBox, with a focus on the security aspects of the application's implementation.

We performed the security assessment based on the agreed scope, following our approach and methodology. Based on our scope and our performed activities, our security assessment revealed 6 Medium severity, 8 Low severity, 8 Informational and 4 Gas Optimisation security issues.

Audit Timeline: 30th July'23 - 11th August'23

Code Repository: https://qithub.com/Kunji-Finance/KF-Contract (opens in a new tab)

Review commit hash: 29e4fb07cb3a4eOeba477b8a7504846c2a600adf

Audit Methodology

During our security assessments, we uphold a rigorous approach to maintain high-quality standards. Our methodology encompasses thorough functional testing and meticulous manual code reviews. To ensure comprehensive issue coverage, we employ checklists derived from industry best practices and widely recognized concerns, specifically tailored to Solidity smart contract assessment. Throughout the smart contract audit process, we prioritize the following aspects to uphold excellence:

  • Code Quality: We diligently evaluate the overall quality of the code, aiming to identify any potential vulnerabilities or weaknesses.
  • Best Practices: Our assessments emphasize adherence to established best practices, ensuring that the smart contract follows industry-accepted guidelines and standards.
  • Documentation and Comments: We meticulously review code documentation and comments to ensure they accurately reflect the underlying logic and expected behaviour of the contract.

Auditing smart contracts involves a comprehensive analysis of the code to identify potential vulnerabilities and security risks. To achieve comprehensive coverage, we employ a series of security checklist tables, each addressing specific areas of concern. These include:

  • System / Platform
  • Access Control
  • Storage
  • Gas Issues and Efficiency
  • Code Issues
  • Error Handling and Exception Handling:
  • Transaction Handling
  • Entrypoint Validation
  • Administration and Operator Functions
  • Additional Topics and Test Cases

Vulnerability Summary

Severity classification

SeverityImpact: HighImpact: MediumImpact: Low
Likehood: HighCriticalHighMedium
Likehood: MediumHighMediumLow
Likehood: Low MediumLowLow

Findings Summary

SeverityNo of Issue Found
High0 Issue
Medium6 Issue
Low8 Issue
Informational8 Issue
Gas Optimization4 Issue

Audit Scope

The code under review is composed of multiple smart contracts written in the Solidity language and includes 3580 nLOC- normalized source lines of code (only source-code lines).

FilenLinesnSLOCComplex. Score
contracts/UsersVault.soI709557256
contracts/ContractsFactory.soI305223247
contracts/adapters/Lens.sol890490298
contracts/adapters/gmx/GMXAdapter.sol6668268
contracts/adapters/gmx/interfaces/lGmxPositionManagersol2039
contracts/adapters/gmx/interfaces/lGmxAdapter.sol61521
contracts/adapters/gmx/interfaces/lGmxReader.sol4039
contracts/adapters/gmx/interfaces/lGmxRouter.sol63338
contracts/adapters/gmx/interfaces/lVaultPriceFeed.sol32333
contracts/adapters/gmx/interfaces/lGmxOrderBook.soI62749
contracts/adapters/gmx/interfaces/lGmxVauIt.soI149321
contracts/Observers/GMXObserver.sol11212987
contracts/adapters/uniswap/librariesofBytesLib.sol28765141
contracts/adapters/uniswap/UniswapV3Adapter.sol51234101
contracts/adapters/uniswap/interfaces/lQuoterV2sol35459
contracts/adapters/uniswap/interfaces/lUniswapV3Router.soI1314923
contracts/adapters/uniswap/interfaces/lUniswapV3Factory.sol92713
contracts/adapters/uniswap/interfaces/lNonfungiblePositionManager.sol2311928
contracts/adapters/uniswap/interfaces/IUniswapV3Adapter.sol739
contracts/adapters/uniswap/interfaces/lUniswapV3Pool.sol11637
contracts/TraderWallet.sol507374252
contracts/DynamicValuation.sol19314894
contracts/BaseVault.sol18013380
contracts/interfaces/1BaseVault.sol6315
contracts/interfaces/BDynamicValuation.sol291921
contracts/interfaces/1TraderWallet.sol9563
contracts/interfaces/BObserver.sol635
contracts/interfaces/lAdaptersRegistry.sol635
contracts/interfaces/BAdapter.sol5473
contracts/interfaces/IContractsFactory.sol214977
contracts/interfaces/BLens.sol37173
contracts/interfaces/Errors.sol19331
contracts/interfaces/UsersVault.sol141339
contracts/interfaces/BPlatformAdapter.sol463295
contracts/interfaces/Events.sol3580622361
Totals6235802361

Auditors Involved :

Main Auditor -

Samrat Gupta - https://app.detectbox.io/profile/sm4rty (opens in a new tab)

Detect Warden -

Rohan Jha - https://app.detectbox.io/profile/Rohan16 (opens in a new tab)