Download audit report
This document presents the security review performed by Nethermind Security for the smart contracts of Token Fleet. Token Fleet is a blockchain-powered platform that allows users to invest in cars through fractional ownership.
By owning tokens, users gain access to a diverse fleet of cars, earning a share of the rental profits and eventual sale proceeds. This allows users to tap into the car rental market without the complexities of full ownership.
This security review focuses exclusively on the smart contracts listed in Section 2 (Audited Files). The audited code comprises of 769 lines of code written in the Solidity language, and the audit was performed using (a) manual analysis of the code base and (b) creation of test cases.
| Audit assessment | |
| Audit Type | Security Review |
| Response from Client | Regular responses during audit engagement |
| Final Report | April 7, 2025 |
| Repository | Token Fleet |
| Commit (Audit) | c036ac4614 |
| Commit (Final) | 4d82b7891d |
| Documentation Assessment | High |
| Test Suite Assessment | High |
Findings by severity
| # | Contract | LoC | Comments | Ratio | Blank | Total |
| 1 | PortfolioRegistry.sol | 161 | 24 | 14.9% | 36 | 221 |
| 2 | Deal.sol | 352 | 94 | 26.7% | 104 | 550 |
| 3 | InsuranceVault.sol | 7 | 1 | 14.3% | 2 | 10 |
| 4 | Portfolio.sol | 81 | 24 | 29.6% | 21 | 126 |
| 5 | DealManager.sol | 168 | 37 | 22.0% | 43 | 248 |
| Total | 769 | 180 | 23.4% | 206 | 1155 |
| # | Finding | Severity | Update |
| 1 | Deal::cancel uses totalSupply instead of totalAssets to verify fundraising target | High | Fixed |
| 2 | Inconsistent update of lastUpdate | Medium | Fixed |
| 3 | Referral tokens can be permanently locked for portfolio owners without referrers | Medium | Acknowledged |
| 4 | Deal::closeDeal does not check dealDealine | Low | Acknowledged |
| 5 | Portfolio contract does not expose approve function for asset transfers to Deal contract | Low | Acknowledged |

The Admin Flow is designed for administrators who oversee the creation and management of Deals.
createDeal function in the DealManager contract. Each deal has specific parameters, such as a fundraising target, deadlines, fees, and insurance requirements.cancelDeal.closeDeal, transferring the raised funds to the designated dealer and allocating insurance funds to a vault.addIncome, which distributes profits to investors after deducting fees. If additional insurance funds are required, admins can withdraw them using getInsurance.finalizeDeal, ensuring all remaining funds are distributed appropriately.Admins also have the ability to upgrade contract implementations at any time.

The User Flow is tailored for investors who interact with deals through their portfolios.
createPortfolio function in the PortfolioRegistry contract. Each portfolio is represented as an ERC721 token, allowing users to manage multiple portfolios if needed.callDeal, which enables them to invoke any function on a deal, such as depositing funds, claiming rewards, or canceling their participation.rewardReceiver address to receive rewards generated by their interactions with deals.claimRewards, and these rewards can also be used for future depositsThe risk rating methodology used by Nethermind Security follows the principles established by the OWASP Foundation. The severity of each finding is determined by two factors: Likelihood and Impact.
Likelihood measures how likely the finding is to be uncovered and exploited by an attacker. This factor will be one of the following values:
When defining the likelihood of a finding, other factors are also considered. These can include but are not limited to motive, opportunity, exploit accessibility, ease of discovery, and ease of exploit.
Impact is a measure of the damage that may be caused if an attacker exploits the finding. This factor will be one of the following values:
When defining the impact of a finding, other factors are also considered. These can include but are not limited to data and state integrity, loss of availability, financial loss, and reputation damage. After defining the likelihood and impact of an issue, the severity is determined according to the table below.
| Impact / Likelihood | Low | Medium | High |
| High | Medium | High | Critical |
| Medium | Low | Medium | High |
| Low | Info / Best Practices | Low | Medium |
| Undetermined | Undetermined | Undetermined | Undetermined |
To address issues that do not fit a High, Medium or Low severity, Nethermind Security also uses three more finding severities: Informational, Best Practices, and Undetermined.
Deal::cancel uses totalSupply instead of totalAssets to verify fundraising targetEach deal has two deadlines: (a) a fundraising deadline; and, (b) a closing deadline. Users can cancel a deal if either deadline is not met.
function cancel() external {
DealStorage storage $ = _getDealStorage();
_onlyStatus($, STATUS.RAISING_FUNDS);
if (totalSupply() < $.target) {
if (block.timestamp <= $.fundraisingDeadline) {
revert FundraisingDeadlineNotReached();
}
} else {
if (block.timestamp <= $.dealDeadline) {
revert DealDeadlineNotReached();
}
}
$.status = STATUS.CANCELLED;
emit DealCancelled();
}The issue arises in how the target is checked. It incorrectly relies on totalSupply instead of totalAssets. Given that the ratio between the asset and the supply token is not 1:1 and instead linear (for example, a malicious user can intentionally fund the Deal contract with the assets directly through a transfer), the usage of totalSupply is incorrect.
Recommendation
Modify the mentioned check to use totalAssets() instead of totalSupply():
function cancel() external {
DealStorage storage $ = _getDealStorage();
_onlyStatus($, STATUS.RAISING_FUNDS);
- if (totalSupply() < $.target) {
+ if (totalAssets() < $.target) {
if (block.timestamp <= $.fundraisingDeadline) {
revert FundraisingDeadlineNotReached();
}
} else {
if (block.timestamp <= $.dealDeadline) {
revert DealDeadlineNotReached();
}
}
$.status = STATUS.CANCELLED;
emit DealCancelled();
}Resolution
Fixed in commit 2d447e0
lastUpdate| File | Fix commit | Type | Status |
Deal.sol | — | Medium | Fixed |
Users who deposit funds into deals are entitled to proportional rewards. They claim these rewards by calling Deal::claim, which updates lastUpdate[user] to ensure the claimed portion is excluded from future claims:
function _claim(DealStorage storage $, address user, address receiver) internal returns (uint256) {
uint256 assets = reward(user);
==> $.lastUpdate[user] = $.totalIncome;
if (assets > 0) {
USDC.safeTransfer(receiver, assets);
}
emit Claimed(user, receiver, assets);
return assets;
}
function reward(address user) public view returns (uint256) {
DealStorage storage $ = _getDealStorage();
uint256 shares = balanceOf(user);
return Math.mulDiv(shares, $.totalIncome - $.lastUpdate[user], totalSupply(), Math.Rounding.Floor);
}However, a rounding issue can cause the claimable assets to be zero, despite updating lastUpdate[user]. This results in the system marking the user as having claimed their income when they actually received nothing.
Consider the following example:
5M USDC, and the total supply is approximately 3M shares;1.6K USDC, receiving 1K shares;2.5K USDC is added to the deal contract as income;claim to receive his share of the income. The reward function computes: 1K×2.5K / 3M = 0;assets is 0, Bob receives no rewards, but lastUpdate[user] is still updated, preventing him from claiming his rightful share in future distributions;Recommendation
Update lastUpdate[user] only when the calculated rewards are greater than zero:
function _claim(DealStorage storage $, address user, address receiver) internal returns (uint256) {
uint256 assets = reward(user);
- $.lastUpdate[user] = $.totalIncome;
if (assets > 0) {
+ $.lastUpdate[user] = $.totalIncome;
USDC.safeTransfer(receiver, assets);
}
emit Claimed(user, receiver, assets);
return assets;
}Resolution
Fixed in commits 4b322a8 and 4d82b78
| File | Fix commit | Type | Status |
DealManager.sol | — | Medium | Acknowledged |
When raising funds for a deal via Deal::deposit, the DealManager::registerDeposit function is invoked. This function tracks the deposited amount for each deal to account for referral rewards:
function registerDeposit(uint256 assets, address receiver) external {
DealManagerStorage storage $ = _getDealManagerStorage();
PortfolioRegistry registry = PortfolioRegistry($.portfolioRegistry);
address owner = registry.onlyWhitelistedPortfolio(uint256(uint160(receiver)));
==> address referrer = registry.referrer(owner);
$.deals[msg.sender].deposits += assets;
==> $.deals[msg.sender].referralDeposits[referrer] += assets;
}Later, users can call claimReferralRewards to claim their referral rewards, which are distributed proportionally:
function _referralRewards(DealManagerStorage storage $, address deal, address user)
internal
view
returns (uint256)
{
DealData storage dealData = $.deals[deal];
return Math.mulDiv(
dealData.referralDeposits[user],
dealData.rewards - dealData.lastRewardClaim[user],
dealData.deposits,
Math.Rounding.Floor
);
}However, some portfolio owners may not have a referrer, causing registry.referrer(owner); to return the zero address. In such cases, referral rewards are permanently locked to the zero address.
Recommendation
Modify registerDeposit to update referralDeposits only when a valid referrer exists:
function registerDeposit(uint256 assets, address receiver) external {
DealManagerStorage storage $ = _getDealManagerStorage();
PortfolioRegistry registry = PortfolioRegistry($.portfolioRegistry);
address owner = registry.onlyWhitelistedPortfolio(uint256(uint160(receiver)));
address referrer = registry.referrer(owner);
$.deals[msg.sender].deposits += assets;
- $.deals[msg.sender].referralDeposits[referrer] += assets;
+ if (referrer != address(0)) $.deals[msg.sender].referralDeposits[referrer] += assets;
}Resolution
At the moment, all users need to have a referrer when they get whitelisted, but there is no check enforcing that the referrer is not 0x0. However, only the owner or the whitelistSigner can make that mistake, and we treat them as trustworthy.
Deal::closeDeal does not check dealDealine| File | Fix commit | Type | Status |
Deal.sol | — | Low | Acknowledged |
Each deal has two deadlines: (a) a fundraising deadline and (b) a closing deadline. Users can cancel a deal if either deadline is not met. After successful fundraising, the deal manager calls Deal::closeDeal to transition the deal to the next phase. However, the function does not check whether the dealDeadline has already passed:
function closeDeal(address dealer) external {
DealStorage storage $ = _getDealStorage();
_onlyDealManagerOwner($, _msgSender());
_onlyStatus($, STATUS.RAISING_FUNDS);
_nonZero(dealer);
if (totalAssets() < $.target) {
revert TargetNotMet();
}
uint256 treasuryFee = $.treasuryFee;
uint256 insuranceAmount = $.insurance;
uint256 dealAssets = totalAssets() - insuranceAmount - treasuryFee;
// Start deal
$.status = STATUS.IN_PROGRESS;
USDC.approve(address($.dealManager), treasuryFee);
$.dealManager.processFee(treasuryFee);
USDC.safeTransfer(dealer, dealAssets);
USDC.safeTransfer(address($.insuranceVault), $.insurance);
emit DealClosed(dealer);
}While the cancelDeal function allows users to cancel an expired deal and we expect them to cancel deals closely after their deadline, the closeDeal function should still validate the dealDeadline to prevent unintended deal progression past the allowed timeframe.
Recommendation
Add a check in closeDeal to check for the deal’s deadline
Resolution
Deadlines are meant as a mechanism for users to recover their assets if there are delays in executions. Given that, if there are delays and no one cancels, we are fine with closing the deal anyway, as it just means users did not want to cancel. Deadline is a safety mechanism for the user, not for the deal breaker for our processes.
Portfolio contract does not expose approve function for asset transfers to Deal contract| File | Fix commit | Type | Status |
Portfolio.sol | — | Low | Acknowledged |
Users are meant to interact with deal contracts through their portfolios. For instance, portfolios can interact with the Deal contract to deposit the underlying assets. However, the issue is that depositing/minting assets on the Deal contract requires transfer approval of the asset, and the Portfolio contract does not expose an approve function to grant spending allowances to the Deal contract, which leads to transactions reverts. The current implementation of callDeal allows a workaround of this as it performs low-level calls to any address and not necessarily the Deal contract, in which the portfolio owners can leverage this function to interact with the underlying asset to approve for the deal contract.
function _call(address deal, bytes calldata data, address rewardsReceiver) internal returns (bytes memory) {
(bool success, bytes memory result) = address(deal).call(data);
if (!success) {
assembly {
revert(add(0x20, mload(0)), mload(0))
}
}
_claimRewards(rewardsReceiver);
return result;
}However, this is not the intended behavior of the function.
Recommendation
Consider exposing a function to approve a token to be spent by a deal address
Resolution
It may be a nice-to-have, but a workaround exists using callDeal, and we may stick with this approach.
Software documentation refers to the written or visual information that describes the functionality, architecture, design, and implementation of software. It provides a comprehensive overview of the software system and helps users, developers, and stakeholders understand how the software works, how to use it, and how to maintain it. Software documentation can take different forms, such as user manuals, system manuals, technical specifications, requirements documents, design documents, and code comments. Software documentation is critical in software development, enabling effective communication between developers, testers, users, and other stakeholders. It helps to ensure that everyone involved in the development process has a shared understanding of the software system and its functionality. Moreover, software documentation can improve software maintenance by providing a clear and complete understanding of the software system, making it easier for developers to maintain, modify, and update the software over time. Smart contracts can use various types of software documentation. Some of the most common types include:
These types of documentation are essential for smart contract development and maintenance. They help ensure that the contract is properly designed, implemented, and tested, and they provide a reference for developers who need to modify or maintain the contract in the future.
The Token Fleet team was actively present in regular calls, effectively addressing concerns and questions raised by the Nethermind Security team. The codebase included natspec and protocol description that were insightful for the Nethermind Security team to understand the codebase.
| 67Tests passed | 0Failed |
The complete test output is in the full report.
As auditors, we recommend that any changes or updates made to the audited codebase undergo a re-audit or security review to address potential vulnerabilities or risks introduced by the modifications. By conducting a re-audit or security review of the modified codebase, you can significantly enhance the overall security of your system and reduce the likelihood of exploitation. However, we do not possess the authority or right to impose obligations or restrictions on our clients regarding codebase updates, modifications, or subsequent audits. Accordingly, the decision to seek a re-audit or security review lies solely with you.
This report is based on the scope of materials and documentation provided by you to Nethermind in order that Nethermind could conduct the security review outlined in 1. Executive Summary and 2. Audited Files. The results set out in this report may not be complete nor inclusive of all vulnerabilities. Nethermind has provided the review and this report on an as-is, where-is, and as-available basis. You agree that your access and/or use, including but not limited to any associated services, products, protocols, platforms, content, and materials, will be at your sole risk. Blockchain technology remains under development and is subject to unknown risks and flaws. The review does not extend to the compiler layer, or any other areas beyond the programming language, or other programming aspects that could present security risks. This report does not indicate the endorsement of any particular project or team, nor guarantee its security. No third party should rely on this report in any way, including for the purpose of making any decisions to buy or sell a product, service or any other asset. To the fullest extent permitted by law, Nethermind disclaims any liability in connection with this report, its content, and any related services and products and your use thereof, including, without limitation, the implied warranties of merchantability, fitness for a particular purpose, and non-infringement. Nethermind does not warrant, endorse, guarantee, or assume responsibility for any product or service advertised or offered by a third party through the product, any open source or third-party software, code, libraries, materials, or information linked to, called by, referenced by or accessible through the report, its content, and the related services and products, any hyperlinked websites, any websites or mobile applications appearing on any advertising, and Nethermind will not be a party to or in any way be responsible for monitoring any transaction between you and any third-party providers of products or services. As with the purchase or use of a product or service through any medium or in any environment, you should use your best judgment and exercise caution where appropriate. FOR AVOIDANCE OF DOUBT, THE REPORT, ITS CONTENT, ACCESS, AND/OR USAGE THEREOF, INCLUDING ANY ASSOCIATED SERVICES OR MATERIALS, SHALL NOT BE CONSIDERED OR RELIED UPON AS ANY FORM OF FINANCIAL, INVESTMENT, TAX, LEGAL, REGULATORY, OR OTHER ADVICE.
The Leading Engineers of Blockchain Infrastructure