Download audit report
This document presents the results of a security review conducted by Nethermind Security for Royco Boosts. The review focused on a new Action Verifier (AV) introduced to Royco using the Incentra campaigns and minor changes in IncentiveLocker contract.
The audit comprises 598 lines of Solidity code. The audit was performed using (a) manual analysis of the codebase, (b) automated analysis tools, and (c) creation of test cases.
| Audit assessment | |
| Audit Type | Security Review |
| Initial Report | June 10, 2025 |
| Final Report | June 11, 2025 |
| Repository | royco-boosts |
| Initial Commit | 69d6fc08f3 |
| Final Commit | 88260f360e |
| Documentation | Royco Incentra Docs and README |
| Documentation Assessment | High |
| Test Suite Assessment | Medium |
Findings by severity
| # | Contract | LoC | Comments | Ratio | Blank | Total |
| 1 | src/core/IncentiveLocker.sol | 399 | 257 | 64.4% | 93 | 749 |
| 2 | src/core/base/PointsRegistry.sol | 82 | 93 | 113.4% | 27 | 202 |
| 3 | src/core/action-verifiers/base/ActionVerifierBase.sol | 13 | 11 | 84.6% | 5 | 29 |
| 4 | src/core/action-verifiers/brevis/IncentraAV.sol | 104 | 50 | 48.1% | 18 | 172 |
| Total | 598 | 411 | 68.7% | 143 | 1152 |
For a comprehensive understanding of the entire Royco Boosts system, please refer to the official audit report: NM0485-FINAL_ROYCO_BOOSTS. This section focuses exclusively on the newly integrated Action Verifier (AV) utilizing Incentra Campaigns and the corresponding minor adjustments to the IncentiveLocker contract.
When a Royco Boosts campaign is created that leverages the Incentra Action Verifier, the IncentiveLocker contract initiates the campaign creation process by calling processIncentiveCampaignCreation(...) within the IncentraAV. A critical aspect of this integration is that when an Incentive Provider (IP) passes the corresponding Incentra Campaign address during campaign creation in Royco Boosts, the IncentraAV includes a check to ensure that the externalPayoutAddress in the associated Incentra Campaign is indeed set to the IncentraAV itself. This design ensures that the IncentraAV directly manages reward distribution, rather than the Incentra Campaign.
It's important to note that incentives cannot be added to a campaign after its initial creation when utilizing the IncentraAV.
The IncentraAV supports two primary types of Incentra Campaigns, accommodating various reward proof submission mechanisms:
Incentra Campaigns provide a mechanism for Incentive Providers (IPs) to remove unclaimed incentives after a campaign concludes. This removal typically becomes available after a default period of 180 days. Therefore, it is crucial for Action Providers (APs) to claim their deserved rewards before this incentive removal window expires.
The IncentiveLocker contract has been updated with two key enhancements:
IncentiveLocker now supports Co-Incentive Providers (Co-IPs) in the process of removing incentives. However, it is the responsibility of the integrated Action Verifiers to revert the transaction if they do not permit such an action by a Co-IP.The 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.
CROSS_CHAIN rewards campaign can never be created| File | Fix commit | Type | Status |
src/core/action-verifiers/brevis/IncentraAV.sol | 055c33c | Medium | Fixed |
Incentra incentives support two types of campaigns: SAME_CHAIN and CROSS_CHAIN, depending on where the rewards are submitted. When a new incentive campaign is created, the processIncentiveCampaignCreation hook is invoked. This hook verifies that the externalPayoutAddress in the Incentra campaign is set to the IncentraAV contract address:
function processIncentiveCampaignCreation(
bytes32 _incentiveCampaignId,
address[] memory _incentivesOffered,
uint256[] memory _incentiveAmountsOffered,
bytes memory _actionParams,
address /*_ip*/
)
external
onlyIncentiveLocker
{
// Decode the campaign params
ActionParams memory params = abi.decode(_actionParams, (ActionParams));
// ...
// Check that the AV can process claims and refunds for this campaign
require(IIncentraCampaign(params.incentraCampaign).externalPayoutAddress() == address(this), IncentraPayoutAddressMustBeAV());
// ...
}However, only campaigns of type SAME_CHAIN in the Brevis contracts expose the public externalPayoutAddress function. For CROSS_CHAIN campaigns, the external payout address is instead encoded in side the config struct and not accessible via the same interface. This misalignment causes the processIncentiveCampaignCreation function to revert for every CROSS_CHAIN campaign, effectively making it impossible to create such campaigns.
Recommendation
Consider handling the retrieval of externalPayoutAddress differently for campaigns of type CROSS_CHAIN.
Resolution
Fixed on Incentra contracts: 055c33c
| File | Fix commit | Type | Status |
src/core/base/PointsRegistry.sol | PR #12 | Info | Fixed |
The claimIncentives(...) function in the IncentiveLocker contract allows an Action Provider (AP) to claim rewards from an incentive campaign. These rewards can be standard ERC20 tokens or non-transferable points from a Points Program. The contract iterates through all owed incentives and distributes them.
The _pushIncentivesAndAccountFees(...) function uses the isPointsProgram(incentive) check to distinguish between an ERC20 token and a Points Program. If this returns true, it calls the internal _award(...) function. If it returns false, it assumes the incentive is an ERC20 token and performs a safeTransfer(...).
function _pushIncentivesAndAccountFees(
address incentive,
address ap,
// ...
) internal {
// @audit Checks if the incentive is a Points Program.
if (isPointsProgram(incentive)) {
// ...
_award(incentive, ap, incentiveAmount);
} else {
// ...
// @audit If isPointsProgram returns false, it assumes `incentive` is an ERC20.
ERC20(incentive).safeTransfer(ap, incentiveAmount);
}
}The isPointsProgram(...) function, inherited from PointsRegistry, determines a program's existence by checking if it has a non-zero owner address.
function isPointsProgram(address _pointsId) public view returns (bool exists) {
// @audit-issue Existence is tied to the owner not being the zero address.
exists = pointsIdToProgram[_pointsId].owner != address(0);
}The vulnerability arises because the transferPointsProgramOwnership(...) function in the PointsRegistry contract lacks a check to prevent transferring ownership to the zero address.
function transferPointsProgramOwnership(address _pointsId, address _newOwner) external {
PointsProgram storage pointsProgram = pointsIdToProgram[_pointsId];
require(pointsProgram.owner == msg.sender, OnlyPointsProgramOwner());
// @audit-issue The `_newOwner` can be `address(0)`, effectively disabling the program.
pointsProgram.owner = _newOwner;
emit PointsProgramOwnershipTransferred(_pointsId, _newOwner);
}A malicious Incentive Provider (IP) can exploit this to mount a denial-of-service attack. An IP can create a campaign offering a legitimate ERC20 token and a Points Program they own as incentives. After an AP becomes eligible for rewards, but before they claim them, the IP can call transferPointsProgramOwnership(...) and set the new owner of their Points Program to address(0).
The transaction will revert when the AP attempts to claim their rewards via claimIncentives(...). The isPointsProgram(...) check will return false for the Points Program incentive, causing the contract to incorrectly treat its address as an ERC20 token and call safeTransfer(...) on it. This call will fail, reverting the entire transaction and preventing the AP from claiming any of their rewards, including the legitimate ERC20 tokens.
Recommendation
Consider adding a validation check in the transferPointsProgramOwnership(...) function to prevent transferring ownership of a Points Program to the zero address. Alternatively, the isPointsProgram(...) check could be modified to rely on an existing program property, which can't be a zero value or a dedicated isCreated flag, rather than the mutable owner address.
| File | Fix commit | Type | Status |
src/core/IncentiveLocker.sol | PR #12 | Info | Fixed |
The removeIncentives(...) function allows an Incentive Provider (IP) or a Co-Incentive Provider (Co-IP) to remove incentives from an existing campaign. The function iterates through a provided list of incentives and their corresponding amounts to remove.
The issue's core lies in the fact that the function does not validate whether the incentive being removed is part of the campaign. If an IP provides a non-existent incentive address along with a _incentiveAmountsToRemove of 0, the logic proceeds as if it's a valid operation. Specifically, the ics.incentiveToAmountOffered[incentive] for a non-existent incentive is 0, and subtracting the provided 0 amount results in 0. This incorrectly triggers the condition ics.incentiveToAmountOffered[incentive] == 0, leading to a call to the internal _removeIncentiveFromCampaign(...) function.
function removeIncentives(
bytes32 _incentiveCampaignId,
address[] memory _incentivesToRemove,
uint256[] memory _incentiveAmountsToRemove,
bytes memory _removalParams,
address _recipient
) public nonReentrant {
// ...
for (uint256 i = 0; i < numIncentives; ++i) {
address incentive = _incentivesToRemove[i];
// ...
uint256 incentiveAmountRemoved = _incentiveAmountsToRemove[i];
if (incentiveAmountRemoved >= ics.incentiveToAmountRemaining[incentive]) {
// ...
} else {
// ...
}
ics.incentiveToAmountOffered[incentive] -= incentiveAmountRemoved;
// @audit If a non-existent incentive and a zero amount are passed, ics.incentiveToAmountOffered[incentive] will be 0.
if (ics.incentiveToAmountOffered[incentive] == 0) {
// @audit-issue This function is called with a non-existent incentive.
_removeIncentiveFromCampaign(ics, incentive);
}
// ...
}
// ...
}The _removeIncentiveFromCampaign(...) function is then called with this non-existent incentive. Inside this function, it attempts to find the provided incentive in the _ics.incentivesOffered array. Since the incentive does not exist, the loop to find its index will complete without finding a match. The function then unconditionally calls _ics.incentivesOffered.pop(), which removes the *last* incentive from the array, regardless of what it is.
function _removeIncentiveFromCampaign(ICS storage _ics, address _incentive) internal {
uint256 lastIndex = _ics.incentivesOffered.length - 1;
uint256 index = 0;
// @audit This loop will not find the non-existent _incentive.
for (index; index < lastIndex; ++index) {
if (_ics.incentivesOffered[index] == _incentive) break;
}
if (index != lastIndex) {
// ...
}
// @audit-issue The last element is popped, even if _incentive was not found.
_ics.incentivesOffered.pop();
}Recommendation
Consider ensuring that an incentive exists within the campaign before attempting to process its removal.
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 Royco team has provided a comprehensive walkthrough of the project in the kick-off call, and the Royco Incentra Docs and README includes a detailed explanation of the intended functionalities. Moreover, the team addressed all questions and concerns raised by the Nethermind Security team, providing valuable insights and a comprehensive understanding of the project's technical aspects.
| 8Tests 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