Royco
Action Verifier

Scope was a new Action Verifier for Incentiva campaigns and minor changes to the IncentiveLocker contract.
report id
0558
category
Token & RWA
language
Solidity
final report
June 11, 2025
lines of code
598
Content

Download audit report

1

Executive Summary

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 TypeSecurity Review
Initial ReportJune 10, 2025
Final ReportJune 11, 2025
Repositoryroyco-boosts
Initial Commit69d6fc08f3
Final Commit88260f360e
DocumentationRoyco Incentra Docs and README
Documentation AssessmentHigh
Test Suite AssessmentMedium
Total findings
3
Fixed
3
Acknowledged
0
Mitigated
0
Unresolved
0

Findings by severity

  • Critical0
  • High0
  • Medium1
  • Low0
  • Informational2
  • Best Practices0

2

Audited Files

#ContractLoCCommentsRatioBlankTotal
1src/core/IncentiveLocker.sol39925764.4%93749
2src/core/base/PointsRegistry.sol8293113.4%27202
3src/core/action-verifiers/base/ActionVerifierBase.sol131184.6%529
4src/core/action-verifiers/brevis/IncentraAV.sol1045048.1%18172
Total59841168.7%1431152

4

System Overview

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.

4.1 Incentra Action Verifier (AV) Integration

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.

4.2 Incentra Campaign Types

The IncentraAV supports two primary types of Incentra Campaigns, accommodating various reward proof submission mechanisms:

  • Same Chain: In this configuration, reward proofs are submitted and processed on the same blockchain. Consequently, claiming rewards does not require the submission of Merkle proofs.
  • Cross Chain: For scenarios where reward proofs are submitted on a different blockchain (typically a more cost-efficient chain), claiming rewards necessitates the provision of Merkle proofs.

4.3 Incentive Removal and Claiming

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.

4.4 IncentiveLocker Enhancements

The IncentiveLocker contract has been updated with two key enhancements:

  • Maximum Incentive Cap: A new restriction has been implemented, limiting the maximum amount of incentives that a particular campaign can hold.
  • Co-IP Incentive Removal: The 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.

5

Risk Rating Methodology

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:

  1. High: the issue is trivial to exploit and has no specific conditions that need to be met;
  2. Medium: the issue is moderately complex and may have some conditions that need to be met;
  3. Low: the issue is very complex and requires very specific conditions to be met.

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:

  1. High: the issue can cause significant damage, such as loss of funds or the protocol entering an unrecoverable state;
  2. Medium: the issue can cause moderate damage, such as impacts that only affect a small group of users or only a particular part of the protocol;
  3. Low: the issue can cause little to no damage, such as bugs that are easily recoverable or cause unexpected interactions that cause minor inconveniences.

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 / LikelihoodLowMediumHigh
HighMediumHighCritical
MediumLowMediumHigh
LowInfo / Best PracticesLowMedium
UndeterminedUndeterminedUndeterminedUndetermined

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.

  1. Informational findings do not pose any risk to the application, but they carry some information that the audit team intends to pass to the client formally;
  2. Best Practice findings are used when some piece of code does not conform with smart contract development best practices;
  3. Undetermined findings are used when we cannot predict the impact or likelihood of the issue.

6

Issues

6.1 Incentra incentives with CROSS_CHAIN rewards campaign can never be created

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

6.2 Malicious Incentive Provider can block reward claims by transferring Points Program ownership to the zero address

FileFix commitTypeStatus
src/core/base/PointsRegistry.solPR #12InfoFixed

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.

6.3 Passing a non-existent incentive with zero amount incorrectly removes the last incentive

FileFix commitTypeStatus
src/core/IncentiveLocker.solPR #12InfoFixed

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.

7

Documentation Evaluation

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:

  • Technical whitepaper: A technical whitepaper is a comprehensive document describing the smart contract’s design and technical details. It includes information about the purpose of the contract, its architecture, its components, and how they interact with each other;
  • User manual: A user manual is a document that provides information about how to use the smart contract. It includes step-by-step instructions on how to perform various tasks and explains the different features and functionalities of the contract;
  • Code documentation: Code documentation is a document that provides details about the code of the smart contract. It includes information about the functions, variables, and classes used in the code, as well as explanations of how they work;
  • API documentation: API documentation is a document that provides information about the API (Application Programming Interface) of the smart contract. It includes details about the methods, parameters, and responses that can be used to interact with the contract;
  • Testing documentation: Testing documentation is a document that provides information about how the smart contract was tested. It includes details about the test cases that were used, the results of the tests, and any issues that were identified during testing;
  • Audit documentation: Audit documentation includes reports, notes, and other materials related to the security audit of the smart contract. This type of documentation is critical in ensuring that the smart contract is secure and free from vulnerabilities.

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.

8

Remarks & Test Suite

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.

Test suite
8Tests passed0Failed

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.