Reach out for an audit or to learn more about Macro
or Message on Telegram

Pool Fans A-1

Security Audit

October 29, 2025

Version 1.0.0

Presented by 0xMacro

Table of Contents

Introduction

This document includes the results of the security audit for Pool Fans's smart contract code as found in the section titled ‘Source Code’. The security audit was performed by the Macro security team from October 15, 2025 to October 21, 2025.

The purpose of this audit is to review the source code of certain Pool Fans Solidity contracts, and provide feedback on the design, architecture, and quality of the source code with an emphasis on validating the correctness and security of the software in its entirety.

Disclaimer: While Macro’s review is comprehensive and has surfaced some changes that should be made to the source code, this audit should not solely be relied upon for security, as no single audit is guaranteed to catch all possible bugs.

Overall Assessment

The following is an aggregation of issues found by the Macro Audit team:

Severity Count Acknowledged Won't Do Addressed
High 1 - - 1
Medium 2 - - 2
Low 2 - - 2
Code Quality 4 - - 4
Informational 1 - - -

Pool Fans was quick to respond to these issues.

Specification

Our understanding of the specification was based on the following sources:

Source Code

The following source code was reviewed during the audit:

Specifically, we audited the following contracts within the repository with focus on the following changes:

Source Code SHA256
contracts/access/AccessControlled.sol

369a93055b18b2f0689017b17dc527a8f4865e15e00f5fbd1ca51c1ef1bee565

contracts/interfaces/IClankerTokenizerV3_1_0.sol

c96bf90c132996c82e7617f8f9ac27a44a67b7d7008600a534265483313495d6

contracts/interfaces/tokenizers/IClankerTokenizerV3_1_0.sol

c96bf90c132996c82e7617f8f9ac27a44a67b7d7008600a534265483313495d6

contracts/revenue/registry/RevenueShareRegistry.sol

f4263322c1bc46c1b0e4172639b584fabbaf6234d37508a1c94261ed58a38b6d

contracts/revenue/tokenizers/BaseTokenizer.sol

bf93192a7f64136209fd78792c6f284eaceb88bd87626da15496e91633a09081

contracts/revenue/tokenizers/v3.1.0/ClankerTokenizerV3_1_0.sol

175bb7cca6117717ec8dd0ce8db93fa4da0ccea62424a4ee664d5e52202d6215

contracts/revenue/tokenizers/v4/ClankerV4Tokenizer.sol

d6d8499f35185f0ab5d0e1099459a838d026e5dbc9e7d9860f62e4409e9f7808

contracts/revenue/vaults/BaseRevenueShareVault.sol

f6dde38453c275380dbaf11c223fccc8715b55201d93d1702af254456402d931

contracts/revenue/vaults/v3.1.0/RevenueSharesVaultV3_1_0.sol

b5c83fd5dc31f8f4784dc15cc4b0005126856b324df34c33cfe9552ec81ee9ae

contracts/revenue/vaults/v4/RevenueSharesVaultV4..sol

11b8854300d27af594d18a3313d78c4ef1d6de889b0272114142675be659bf47

Note: This document contains an audit solely of the Solidity contracts listed above. Specifically, the audit pertains only to the contracts themselves, and does not pertain to any other programs or scripts, including deployment scripts.

Issue Descriptions and Recommendations

Click on an issue to jump to it, or scroll down to see them all.

Security Level Reference

We quantify issues in three parts:

  1. The high/medium/low/spec-breaking impact of the issue:
    • How bad things can get (for a vulnerability)
    • The significance of an improvement (for a code quality issue)
    • The amount of gas saved (for a gas optimization)
  2. The high/medium/low likelihood of the issue:
    • How likely is the issue to occur (for a vulnerability)
  3. The overall critical/high/medium/low severity of the issue.

This third part – the severity level – is a summary of how much consideration the client should give to fixing the issue. We assign severity according to the table of guidelines below:

Severity Description
(C-x)
Critical

We recommend the client must fix the issue, no matter what, because not fixing would mean significant funds/assets WILL be lost.

(H-x)
High

We recommend the client must address the issue, no matter what, because not fixing would be very bad, or some funds/assets will be lost, or the code’s behavior is against the provided spec.

(M-x)
Medium

We recommend the client to seriously consider fixing the issue, as the implications of not fixing the issue are severe enough to impact the project significantly, albiet not in an existential manner.

(L-x)
Low

The risk is small, unlikely, or may not relevant to the project in a meaningful way.

Whether or not the project wants to develop a fix is up to the goals and needs of the project.

(Q-x)
Code Quality

The issue identified does not pose any obvious risk, but fixing could improve overall code quality, on-chain composability, developer ergonomics, or even certain aspects of protocol design.

(I-x)
Informational

Warnings and things to keep in mind when operating the protocol. No immediate action required.

(G-x)
Gas Optimizations

The presented optimization suggestion would save an amount of gas significant enough, in our opinion, to be worth the development cost of implementing it.

Issue Details

H-1

Incorrect baselineBalance update allows revenue distribution to be manipulated

Topic
Spec
Status
Impact
High
Likelihood
High

In the BaseRevenueShareVault, revenue accounting is implemented across several internal functions which includes distributeRevenue(), executeClaim(), updateRewards() and calculateUnclaimedRewards().

The accrued revenue that needs to be distributed and that has accumulated after previous execution, is tracked with the help of two variables, currentBalance and baselineBalance for the token. baselineBalance is immediately updated to the currentBalance value after calculating and updating incremental revenue per share.

// In the _distributeRevenue()
uint256 currentBalance = IERC20(token).balanceOf(address(this));
uint256 delta = currentBalance - baselineBalance[token];
if (delta > 0) {
    cumulativeRewardPerShare[token] += (delta * SCALE) / supply;
    baselineBalance[token] = currentBalance;
    emit RevenueDistributed(token, delta);
}

In order to correctly track new revenue, baselineBalance also needs to be continuously updated whenever token balance is claimed by users and tokens are transferred out of the vault. This is done in executeClaim() function.

address token = rewardTokens[i];
uint256 reward = unclaimedRewards[user][token];
if (reward > 0) {
    unclaimedRewards[user][token] = 0;
    IERC20(token).safeTransfer(user, reward);
    baselineBalance[token] -= reward;
    emit RewardsClaimed(user, token, reward);
}

However, in an edge case when user address is the address of the vault itself, system invariants are broken. In this case when vault has shares (obtained by accident or transferred to the vault by malicious attacker) and claim is made for the vault, baselineBalance of the token is reduced even though current balance does not change. Malicious attacker may manipulate reward distribution by calling distributeRevenue() in the loop (together with the executeClaim(vault)) in order to inflate cumulativeRewardPerShare[token] value. This would allow him to claim reward assets from all users of the vault.

Remediations to consider

  • Disallow claiming to the vault in executeClaim() or in child claimRewards() , or
  • Compute actual sent via balance-before/after and decrement  baselineBalance[token] by actual sent only.
M-1

Stale fee preference can cause tokenization in incorrect vault

Topic
Spec
Status
Impact
Medium
Likelihood
Low

In the ClankerV4Tokenizer, admin can update fee preference after calling the initTokenization() and before finalizeTokenization(). Admin can achieve this by calling updateFeePreference() on the ClankerLpLockerFeeConversion contract.

In the finalizeTokenization() implementation, pending vault associated with the now stale fee preference will be used even though it is incorrect. Reward admin’s shares will be minted in a different vault than the expected according to the last fee preference.

Remediations to consider

  • Take into account up to date value of fee preference at the time of finalizeTokenization() invocation, or
  • Refactor implementation so that tokenization process is done in a single step.
M-2

Two step tokenization can lead to permanently incomplete state

Topic
Spec
Status
Impact
High
Likelihood
Low

In the ClankerTokenizerV3_1_0 and ClankerV4Tokenizer , tokenization process is three step process. First step deploys or retrieves address of the appropriate vault in which future shares would be minted. Second step (done out of channel) requires from the admin of the rewards, to call corresponding Clanker contract to delegate permission to the new vault. Third and final step is for the reward recipient to invoke tokenization finalization on Tokenizer contract.

However, this three step tokenization process for both 3.1 and 4.0 versions of tokenizer, comes with significant risk. The risk is that process may lead to permanently incomplete state in case the finalization cannot be successfully processed, after admin has already transferred his permission to the new vault. For example, this may happen in case reward receiver is a contract which does not have functionality and therefore cannot call finalizeTokenization().

Remediations to consider

  • Consider updating implementation to a two step process where reward admin transfers admin permission to tokenizer instead of vault, and then tokenizer performs all or nothing tokenization procedure, which if successful permanently grants admin and recipient rights to the new vault, otherwise allows original admin to transfer back to himself permission rights.
L-1

getAdminShareBps() may return incorrect value

Topic
Spec
Status
Impact
Low
Likelihood
Medium

In the ClankerV4Tokenizer contract, getAdminShareBps() is implemented in the following way returning rewardBps of the first entry where admin address matches in the array of rewardAdmins.

function getAdminShareBps(
    address clanker,
    address admin
) external view returns (uint256) {
    IClankerLpLockerFeeConversion.TokenRewardInfo
        memory tokenRewardInfo = _getTokenRewardsData(clanker);
    uint256 len = tokenRewardInfo.rewardAdmins.length;

    for (uint256 i = 0; i < len; i++) {
        if (tokenRewardInfo.rewardAdmins[i] == admin) {
            return tokenRewardInfo.rewardBps[i];
        }
    }
    return 0;
}

However, duplicate entries are possible in rewardAdmins array. As a result, output of the function will not be correct in cases when specific admin is present multiple times in the rewardAdmins array.

Remediations to consider:

  • Update implementation to take into account multiple entries with the same admin value.
L-2

Deflation/rebase or external balance decrease may corrupt contract accounting

Topic
Spec
Status
Impact
High
Likelihood
Low

In the BaseRevenueShareVault, distributeRevenue() function is implemented in a way which may lead to contract becoming corrupted if deflation/rebase or external balance decrease can happen for the registered token.

function _distributeRevenue() internal virtual {
    uint256 supply = totalSupply();

    // Skip distribution if no shares minted yet (prevents division by zero)
    // Note: Prevents dos attack since vault address uses create2 pattern, that allows to send tokens before tokenize
    if (supply == 0) {
        return;
    }
    uint256 len = rewardTokens.length;
    for (uint256 i = 0; i < len; i++) {
        address token = rewardTokens[i];
        uint256 currentBalance = IERC20(token).balanceOf(address(this));
        uint256 delta = currentBalance - baselineBalance[token];
        if (delta > 0) {
            cumulativeRewardPerShare[token] += (delta * SCALE) / supply;
            baselineBalance[token] = currentBalance;
            emit RevenueDistributed(token, delta);
        }
    }
}

If a reward token is deflationary, rebases downward, or otherwise reduces the vault’s balanceOf without the vault explicitly updating baselineBalance[token] first, currentBalance - baselineBalance[token] underflows and reverts. This breaks distribution/updates and can permanently block future accrual/transfers.

Remediations to consider

  • Make delta computation clamp to zero and realign the baseline on decreases, e.g., if currentBalance <= baseline, set baseline = currentBalance and continue without reward distribution. This gracefully handles deflation/rebase and maintains accounting invariants.
Q-1

Use DEFAULT_ADMIN_ROLE named constant

Topic
Best practices
Status
Quality Impact
Low

Both BaseRevenueShareVault and BaseTokenizer contracts implement onlyAdmin modifer which refers to admin role by using hardcoded constant value of 0.

modifier onlyAdmin() {
    if (!AccessControl(address(registry)).hasRole(bytes32(0), msg.sender))
        revert OnlyAdmin();
    _;
}

Since AccessControl is already imported in both contracts, consider using DEFAULT_ADMIN_ROLE constant instead of literal value 0.

Q-2

BaseTokenizer defines owner which is not used

Topic
Best practices
Status
Quality Impact
Low
// In BaseTokenizer.sol

/// @notice Contract owner
address public immutable owner;

...
constructor(address _registry, address _lpLocker) {
    registry = IRevenueShareRegistry(_registry);
    lpLocker = _lpLocker;
    owner = msg.sender;
}

Consider removing owner variable definition and its initialization unless it is necessary.

Q-3

Unnecessary code can be removed

Topic
Best practices
Status
Quality Impact
Low
  1. The following errors are declared in ClankerTokenizerV3_1_0 and ClankerV4Tokenizer but never used:
    • VaultAddressMismatch
    • AlreadyTokenized
  2. The following errors are declared in ClankerTokenizerV3_1_0 but never used:
    • InvalidParticipantType
    • LockerNotSupported
    • InvalidFeePreference
  3. The following errors are declared in ClankerV4Tokenizer but never used:
    • VaultAlreadyExists
    • NotRewardAdmin
    • InvalidAdminCount
    • InvalidRecipientCount
    • RecipientNotVault
  4. The following event is declared in RevenueSharesVaultV3_1_0 but never used:
    • FeesCollected
Q-4

Add mechanism to recover incorrectly transferred admin

Topic
Best practices
Status
Quality Impact
Medium

As a part of 2 step tokenization process, users are required to transfer admin rights to specific address of the corresponding RevenueSharesVaultV3_1_0 or RevenueSharesVaultV4 instance.

However, if in this process mistake is made there is no mechanism in the current implementation to recover admin rights.

Consider, implementing feature similar to the currently present rescueFunds() for recovering incorrectly assigned revenue admin while preventing revenue admin transfers for operational vaults where tokenization has been previously completed.

I-1

Tokens with exotic ERC20 behavior are not supported

Topic
Spec
Impact
Informational

Tokens that have not common mechanics are not supported.

  • Fee on transfer tokens - can cause incorrect reward distribution
  • Deflationary tokens - can brick reward distribution

Disclaimer

Macro makes no warranties, either express, implied, statutory, or otherwise, with respect to the services or deliverables provided in this report, and Macro specifically disclaims all implied warranties of merchantability, fitness for a particular purpose, noninfringement and those arising from a course of dealing, usage or trade with respect thereto, and all such warranties are hereby excluded to the fullest extent permitted by law.

Macro will not be liable for any lost profits, business, contracts, revenue, goodwill, production, anticipated savings, loss of data, or costs of procurement of substitute goods or services or for any claim or demand by any other party. In no event will Macro be liable for consequential, incidental, special, indirect, or exemplary damages arising out of this agreement or any work statement, however caused and (to the fullest extent permitted by law) under any theory of liability (including negligence), even if Macro has been advised of the possibility of such damages.

The scope of this report and review is limited to a review of only the code presented by the Pool Fans team and only the source code Macro notes as being within the scope of Macro’s review within this report. This report does not include an audit of the deployment scripts used to deploy the Solidity contracts in the repository corresponding to this audit. Specifically, for the avoidance of doubt, this report does not constitute investment advice, is not intended to be relied upon as investment advice, is not an endorsement of this project or team, and it is not a guarantee as to the absolute security of the project. In this report you may through hypertext or other computer links, gain access to websites operated by persons other than Macro. Such hyperlinks are provided for your reference and convenience only, and are the exclusive responsibility of such websites’ owners. You agree that Macro is not responsible for the content or operation of such websites, and that Macro shall have no liability to your or any other person or entity for the use of third party websites. Macro assumes no responsibility for the use of third party software and shall have no liability whatsoever to any person or entity for the accuracy or completeness of any outcome generated by such software.