Dev48
Language
  • About
  • Services
  • Industries
  • Technologies
  • Articles
  • Contacts
Book a call
    Home/Articles/Brickken protocol v2 audit
Dev48
info@dev48.org+375 29 320-40-96WhatsApp@isky_by

© 2026 · All rights reserved.

Brickken Protocol v2 Audit

Source: OpenZeppelin•December 1, 2026 at 02:12 PM

Brickken Protocol v2 Audit

OpenZeppelin's security review of Brickken Protocol v2, shared contracts to tokenize real-world assets, sell them via escrow and pay holders. 29 issues found.

FindingsTotal issues: 29 (18 resolved, 1 partially resolved)Critical: 0 (0 resolved) · High: 0 (0 resolved) · Medium: 5 (4 resolved, 1 partially resolved) · Low: 12 (6 resolved)

Notes & Additional Information12 notes raised (8 resolved)

Client Reported Issues0 reported issues (0 resolved)

Scope

OpenZeppelin audited the brickken/brickken-protocol-v2 repository at commit 8394e34.

In scope were the following files:

Update: The fixes mentioned in this report were merged at commit 7c23f70, tagged as v2.0.5, which represents the final state of the audited codebase. On top of the fixes, this commit only introduces changes to code comments and formatting in the in-scope files.

System Overview

Brickken Protocol v2 is a set of smart contracts for tokenizing real-world assets. It lets Brickken clients (issuers and borrowers) create compliance-controlled security tokens, raise money by selling them, and then pay token holders back. Equity tokens (STO) receive dividends, while debt tokens (DTO) receive capital plus interest. Each raise or payment uses a single ERC-20 payment token (e.g., USDC), and the protocol does not rely on price oracles.

Unlike the previous version, which deployed separate contracts for each issuer, v2 uses one shared set of upgradeable (UUPS) contracts for all clients. Clients are kept apart by token-scoped roles: a role granted for one token gives no power over another token. The security tokens themselves are not upgradeable, and a new one is deployed for every tokenization.

The system is made up of the following components:

  • Factory: FactoryManager is the entry point for creating a tokenization. It checks a fee report signed by Brickken, charges the tokenization fee to the Brickken vault, and deploys the new token through a registered deployer contract.
  • Security Tokens: ERC7943 is an ERC-20 token with send and receive whitelists, frozen amounts, forced transfers, and an optional supply cap. STO7943 and DTO7943 extend it with balance checkpoints (used to compute payouts), gasless approvals and transfers, and an on-chain document registry. Simpler StableERC20 and BasicERC20 tokens can also be deployed.
  • Universal Escrow: UniversalEscrowUpgradeable runs the primary sale. Issuers open issuances with a soft cap, a hard cap, a price, and a time window. Investors deposit payment tokens on-chain, and the Brickken backend can also book off-chain purchases (such as bank transfers). If the raise succeeds, the escrow mints all allocations to itself, pays the issuer after deducting the success fee, and lets each investor claim their tokens. If the raise fails or is cancelled, investors get their deposits back.
  • Payment Handler: PaymentHandler is used after the sale. Issuers fund dividends (STO) and borrowers fund debt repayments (DTO), and each holder can claim a share based on their token balance at the time the payment was added. Anyone can trigger a claim on behalf of a holder, but the funds always go to the holder. For DTOs, the total debt is fixed by a one-time price that the Brickken backend signs and that the borrower submits. A holder's DTO balance is burned once the debt is fully repaid and claimed.
  • Fee Manager: FeeManager stores the success fee rate for each token and splits each fee between Brickken recipients and optional partner recipients. It does not hold funds, as it sends each share directly to the recipients.

The main lifecycle of a tokenization is as follows: the token is created through the factory, it is sold through the escrow, investors redeem their tokens (or are refunded), and the issuer later distributes dividends, or the borrower repays the debt, through the payment handler.

Security Model and Trust Assumptions

The contracts enforce role checks, signatures, and accounting. They do not verify off-chain facts such as bank payments, the legal eligibility of investors, or the value of the tokenized asset. Since the main contracts are shared by all clients, a single faulty upgrade or misconfiguration can affect every client at once. The tokens are not upgradeable, so an upgrade of a shared contract cannot change their code or their role assignments. However, it can still use the roles granted to the shared contracts on each token, such as minting by the escrow and burning DTO balances by the payment handler, until those roles are revoked.

During the audit, the following trust assumptions were identified:

  • All payment tokens are allowlisted by Brickken and behave like standard ERC-20 tokens with stable decimals (such as USDC, USDT, or DAI). Tokens that take a fee on incoming transfers are supported, but rebasing tokens and tokens with transfer hooks are not.
  • The tokens checked by the escrow and the payment handler are the intended factory-deployed tokens, since admission depends on role grants and not on the factory registry.
  • Signers build the correct EIP-712 messages and track nonces, which are sequential for each signer and each type of message.
  • The total supply of a DTO does not change once the first debt repayment has been made.
  • Upgrades keep the existing storage layout, and proxies are initialized with the intended roles at deployment.
  • Block timestamps are reliable enough to order checkpoints and to enforce issuance windows.

Privileged Roles

The following roles were identified in the codebase:

  • Brickken Admin (DEFAULT_ADMIN_ROLE): Holds the admin role on every shared contract and on every deployed security token. It can upgrade the shared contracts without a timelock, through a multisig account, change the fee vault and the registered deployers, pause and cancel issuances, withdraw any ERC-20 balance from the escrow (including live deposits), change the issuer of a token, and choose which address can burn DTO balances. This role is fully trusted.
  • Brickken Backend (ESCROW_MANAGER_ROLE, PAYMENT_ADMIN_ROLE, FEE_MANAGER_ADMIN_ROLE, DEBT_PRICE_REPORTER_ROLE, and FACTORY_OFFCHAIN_REPORTER_ROLE): Allowlists payment tokens, books off-chain purchases in the escrow without any on-chain payment, signs issuances and payment authorizations, grants token-scoped roles on the shared contracts, sets the success fee rates and Brickken recipients (with immediate effect on live raises), signs the one-time DTO price, and signs tokenization fee reports. These roles are trusted to book only genuine off-chain payments, to set correct fees and prices, and to admit only suitable tokens.
  • Issuer or Borrower: Controls its own token (minting, burning, whitelisting, freezing, and forced transfers) and runs its own raises and payments through token-scoped roles in the escrow and the payment handler. The issuer is trusted to manage its own token within these powers, but it is not trusted with investor funds, allocations, or claims beyond them, and it must not be able to affect other clients' tokens.
  • Partner: Sets the list of partner recipients that receive part of the success fee for a specific token. It is trusted only for its own token's fee split.

Investors, token holders, fee payers, and any external caller of the permissionless functions (such as buying, redeeming, claiming, or fee distribution) are untrusted.

Update: The fixes changed some of the roles described above. The admin of each new token is no longer the Brickken Admin. Instead, it is the admin address set in the tokenization config, which the Brickken backend approves as part of the signed tokenization report. This token admin can change the issuer or borrower of its token, choose which address can burn DTO balances, and grant itself the other roles of the token. In addition, the Brickken backend can now enable or disable the final burn of each DTO, and its signed DTO price report also fixes the token in which the debt must be repaid.

Medium Severity

Anyone Can Burn the Unredeemed DTO Allocations Held by the Escrow

When a DTO7943 issuance succeeds, _withdraw pre-mints the full allocation to the UniversalEscrow, and participants later pull their tokens through getTokens. The escrow is thus a whitelisted holder of every unredeemed allocation, and nothing requires all allocations to be redeemed before repayments start.

Since claim is permissionless, anyone can claim on behalf of the escrow. Once the debt is fully repaid, this reaches the final burn, which destroys the escrow's entire balance across every issuance of the token. getTokens then reverts for every remaining participant, and neither forcedTransfer nor re-minting can restore the allocations. The repayments paid to the escrow can only be returned through the unaccounted withdrawExcessToken and off-protocol distribution. Participants who no longer pass canReceive cannot redeem at all, so their allocations are always exposed.

Consider ensuring that DTO allocations held by the escrow on behalf of participants cannot be burned before they are redeemed.

Update: Resolved in pull request #105. The team stated:

“Fixed. The final burn in _claimDebtRepay now runs only after the backend enables it per DTO with toggleFinalBurn(dto, true) PAYMENT_ADMIN_ROLE). It is off by default. The backend enables it once every escrow allocation of the DTO has been delivered through getTokens. Until then, a claim on behalf of the escrow pays out and burns nothing, so unredeemed allocations stay intact. The payment handler has no reference to the escrow, and the toggle avoids a new cross-contract dependency.”

Issuer Can Unilaterally Change Issuance Terms After Deposits Are Accepted

In the UniversalEscrow, a raise that ends below softCap is rolled back and participants recover their deposits. However, the issuer can edit any ACTIVE issuance through patchIssuance, which only enforces internal consistency and blocks soft cap increases after a withdrawal.

The issuer can lower softCap to raisedAmount at any time, during or after the raise, and immediately call partialWithdraw, which only requires raisedAmount >= softCap. Once the funds are withdrawn, adminCancel only refunds pro-rata against the remaining balance. Participants promised a refund below the soft cap end up holding tokens of an undercapitalized issuance instead. Similarly, the issuer can extend endDate indefinitely to withhold refunds on a failed raise, although the admin can remedy this. The issuer can also lower hardCap to the current raisedAmount at any time, as _validateIssuance allows. This immediately satisfies the early finalization condition of finalizeIssuance. Thus, the issuer decides when a raise ends as well as whether it succeeds.

Consider restricting which issuance parameters can be modified once deposits have been accepted or the issuance has ended. This would prevent the issuer from unilaterally changing the terms participants relied upon.

Update: Partially resolved in pull request #80 at commit 2cd2a64. The patchIssuance function now reverts with the IssuanceEnded error once the issuance has ended, and with the new IssuanceTermsLocked error when the startDate or softCap field is changed after any amount has been raised. As a result, the issuer can no longer turn a failed raise into a successful one or reopen an ended raise, and lowering the hardCap field can only trigger early finalization once the soft cap has been met, since the _validateIssuance function keeps the softCap field at or below it. However, the endDate field can still be extended while the issuance is live, so refunds on a failing raise can be postponed indefinitely. The Brickken team accepted this risk, stating that the admin can stop such an issuance through the adminCancel function. The team stated:

“patchIssuance now reverts after endDate, and startDate and softCap are locked once the issuance has deposits. So the issuer can no longer lower softCap to withdraw from a raise that should roll back, and cannot reopen a raise that has ended.”
“endDate stays patchable because issuers need to extend live raises. We accept the risk of delayed refunds on a failed raise, because the admin can stop it with adminCancel. Moving endDate earlier does not hurt depositors, because softCap is locked.”
“Lowering hardCap also stays allowed. _validateIssuance keeps softCap <= hardCap, and softCap is locked. So hardCap can only reach raisedAmount after the raise has already succeeded, and the early finalize only stops new buyers.”

Zero Computed Debt Is Treated as Full Repayment, Allowing Anyone to Burn DTO Balances

Once _isDebtRepaid returns true and a holder has settled every repayment entry, _claimDebtRepay burns the holder's full DTO balance. However, _isDebtRepaid only checks that the computed remaining debt is zero. This is also the case when no debt has been established: while capitalPricePerToken is unset, or when supply * capitalPricePerToken rounds down to zero. If repayments are enabled in this state, the ledger is empty and the cursor check holds as 0 == 0. Any address can then call the permissionless claim to burn the balance of any whitelisted holder without payment. This includes the UniversalEscrow, which holds all unredeemed allocations after an issuance is finalized. Burning its DTO balance causes every subsequent getTokens call to revert.

toggleDebtRepayment does not require the price to be set, and the documented onboarding flow enables repayments right after setPaymentHandler, only requiring the price before the first repayment.

Consider having _isDebtRepaid return true only once a non-zero capital debt has been established, and requiring the capital price to be set before toggleDebtRepayment can enable repayments.

Update: Resolved in pull request #73. The team stated:

“The root cause is fixed in _isDebtRepaid: it now returns true only after a repayment was booked totalDebtRepaid != 0). Without a price set, or when the principal rounds down to zero, any repayment reverts, so the debt can never count as repaid. With that check in place, enabling repayments before the price is set is harmless: claims run on an empty ledger and nothing is burned. We did not add the price check to toggleDebtRepayment, to keep the diff small.”

DTO Debt Can Be Repaid in a Lower-Valued Payment Token

The debt of a DTO7943 is tracked by the PaymentHandler as an abstract 18-decimal value. _getRemainingDebt derives the principal from pinnedCapitalSupply and the signed capitalPricePerToken, which the documentation describes as "the same unit as the escrow's prices". Since each escrow issuance is priced in its own payment token, the debt is implicitly denominated in the currency the DTO was raised in. That currency is not recorded anywhere.

However, the plain addDebtRepayment overload accepts any token on the handler's global allowlist, as checked by _validatePaymentToken, and books the amount received against the debt after only a decimal conversion. One unit of any allowlisted token therefore settles one unit of debt, regardless of its value. A borrower that raised in EURC can thus repay the principal and interest in USDC, at a discount equal to the EUR/USD exchange rate. Once the computed debt reaches zero, repayments are disabled and the final claim, which any address can trigger through claim, burns each holder's entire DTO balance. Holders receive less than the value they are owed, and the position recording the shortfall is destroyed. Since signed distributions and repayments add their payment token to the same global allowlist, any token approved for one client can later be used to settle the debt of every DTO on the handler.

Consider binding each DTO to a single repayment token and rejecting repayments in any other token. The token could be included in the signed DebtPriceReport or recorded at the first repayment. Alternatively, consider maintaining per-asset payment-token allowlists restricted to a single unit of account.

Update: Resolved in pull request #107. The team stated:

“Fixed. The signed DebtPriceReport now includes paymentToken, and setInitialCapitalPrice stores it as the DTO's repayment token. addDebtRepayment reverts with RepaymentTokenMismatch for any other token, so the borrower cannot repay in a lower-valued token. DebtCapitalPriceSet now also emits the payment token.”

Anyone Can Burn the Tokens Sold in a Raise on a Fully Repaid DTO

The DTO debt is computed on the pinnedCapitalSupply fixed at the first repayment, so once it is fully repaid, the remaining debt stays at zero regardless of later mints. Claims remain open, and when a holder's cursor reaches the last entry, _claimDebtRepay burns their whole balance, assuming it was all covered by the repaid principal.

However, the DTO remains mintable after repayment. _newIssuance does not check the DTO's debt state, and the borrower keeps MINTER_ROLE. As a result, the borrower can open a new raise. Once it finalizes, the borrower receives the proceeds and the escrow pre-mints the allocations. Since none of these tokens are covered by the pinned principal, anyone can then call claim(dto, 0, investor) to burn a redeemed investor's balance for nothing. This also burns any tokens a previous holder bought in the new raise. Alternatively, anyone can call claim(dto, 0, escrow) to burn the unredeemed allocations, which makes getTokens revert. Moreover, the repayment toggle closed automatically at the final repayment, and even if it is reopened, _pinCapitalSupply rejects any repayment while the supply differs from the pin. Thus, these investors cannot be repaid on-chain and lose both their tokens and their payment.

Consider treating full repayment as a terminal state for the DTO by preventing new issuances and mints once its debt is repaid. Alternatively, consider limiting the final burn to the balance the holder had at the last repayment entry.

Update: Resolved in pull request #75. The team stated:

“Fixed with the second recommendation. The final burn is capped at min(balanceOf(holder), getPastBalance(holder, lastEntry.timestamp)), the same snapshot the payouts use. An address with no balance at the last entry never loses tokens, and the total burned can never exceed the pinned principal, so nobody can burn a position that the repayments did not cover. Two limits remain, and we accept them: - The cap is per address, because the token is fungible. An address that transfers its covered tokens out after the last entry and then receives new tokens can have up to its snapshot balance burned. Holders who claim before they transfer are not affected. - Tokens minted after the principal pin have no on-chain repayment path. Each DTO supports one repayment cycle (N-04). The backend does not open an escrow issuance for a DTO with a pinned principal, and a new raise uses a new DTO. We did not make full repayment a terminal state in the token, because that adds a dependency from the DTO to the payment handler on every mint.”

Low Severity

OffchainReport Does Not Bind the Deployed TokenizationConfig

FactoryManager.newTokenization requires an OffchainReport signed by a FACTORY_OFFCHAIN_REPORTER_ROLE holder, but the signed payload only covers fee fields. The token is deployed from a separate, unsigned TokenizationConfig, so the issuer or spender can submit any configuration, despite the caller restriction comment claiming to prevent a "swapped config".

For example, a borrower can deploy a DTO7943 with a lower debtInterestRate (or 0), which the PaymentHandler reads from the token when computing the remaining debt. This is mitigated by the rate being visible on-chain and by Brickken having to grant per-token escrow and handler roles.

Consider including the reviewed token parameters in the signed report, or verifying them before granting roles, and correcting the comment.

Update: Resolved in pull request #77. The team stated:

“Fixed. OffchainReport now carries configHash = keccak256(abi.encode(config)), and it is part of the EIP-712 typehash. newTokenization reverts with TokenizationConfigMismatch unless the submitted config hashes to the signed value. The issuer can no longer deploy a config the backend did not approve, for example a DTO with debtInterestRate = 0. The misleading comment about a "swapped config" is fixed: the caller restriction only stops a third party from using someone else's report and fee.”

Inconsistent Receive Whitelist Enforcement on Payment Claims

The PaymentHandler exposes two claim paths. claim can be called by anyone on behalf of a holder and requires the holder to pass canReceive on the asset. In contrast, claimDebtRepayment lets a DTO holder claim for itself without that check. As a result, a DTO holder removed from the receive whitelist can still collect its debt repayments, so the check does not restrict DTO payouts. For STO tokens, claim is the only path. If a holder is removed from the receive whitelist, its dividend share remains reserved in the handler. It cannot be claimed or released until the issuer whitelists the holder again. This lets the issuer withhold already funded dividends from specific holders indefinitely. This is inconsistent with the escrow's stated principle that the whitelist gates the issued token and not the investor's money.

Consider applying a single policy to both claim paths, either by enforcing canReceive in both or by removing it from payouts altogether, and documenting the chosen behavior.

Update: Resolved in pull request #78. The team stated:

“Fixed by removing the canReceive check from claim, so both payout paths follow one policy. The asset whitelist decides who may hold the security token. It does not gate payouts the holder already earned from past balances. A de-whitelisted holder can now claim funded dividends and debt repayments without the issuer whitelisting them again. This supersedes the earlier gate added for C-2026-01998. Docs are updated.”

Blacklisted Spenders Can Still Move Tokens Through Existing Allowances in StableERC20

The StableERC20 contract is documented as a "USDC-style" ERC-20 with a blacklist. However, the blacklist is only enforced in _update on the from and to addresses, while transferFrom and approve are inherited unchanged and never check the spender. As a result, a blacklisted address can keep spending any allowance it holds and can be granted new ones. It can use these allowances to move tokens from other holders to any non-blacklisted recipient. This defeats the purpose of blacklisting a sanctioned or compromised spender, such as an operator holding unlimited approvals. This behavior diverges from USDC, where blacklisted addresses can neither spend nor receive allowances.

Consider extending the blacklist checks to the spender of allowance-based transfers and to the parties of an approval.

Update: Resolved in pull request #79. The team stated:

“Fixed. StableERC20 now overrides _approve to reject a blacklisted owner ERC20InvalidApprover) or spender ERC20InvalidSpender), and _spendAllowance to reject a blacklisted spender. The second override is needed because OpenZeppelin skips _approve when spending an infinite allowance. A blacklisted address can no longer grant, receive or use an allowance, which matches USDC.”

A Payment Token That Rejects a Holder Blocks All of the Holder's Later Payments

The PaymentLedger records STO dividends and DTO repayments for a tokenized asset as a single list of entries, each of which can use a different payment token. It tracks each holder's progress with a single claim cursor. _settleClaims always starts at that cursor and transfers every non-zero share in order, so the whole claim reverts if any transfer fails.

If a payment token blocks transfers to a holder, such as through a USDC-style or StableERC20 blacklist, all their later payments for that asset become unclaimable. This includes payments in other tokens and lasts until the holder is unblocked or the handler is upgraded. For DTOs, this also blocks their final burn, and a token-wide pause affects every holder.

Consider ensuring that a payment that cannot be delivered does not prevent the settlement of unrelated entries.

Update: Resolved in pull request #118. The team stated:

Partial Withdrawals Charge the Fee on Off-Chain Contributions to On-Chain Investors

Update: Acknowledged, not resolved. The team stated:

← All articles

What this article says

More in Web3 & Blockchain

All →
UMA Dispute Router Legacy Oracle Fallback Diff Security Audit
OpenZeppelin

UMA Dispute Router Legacy Oracle Fallback Diff Security Audit

MetaMask launches Social Trading that ranks by skill, not follower count
Infura

MetaMask launches Social Trading that ranks by skill, not follower count

MetaMask Social Trading is here
Infura

MetaMask Social Trading is here

Crypto gas fees in 2026
Infura

Crypto gas fees in 2026

‘KING’ Shah Rukh Khan at House of Instagram: Storytelling Lessons, Creative Risk-taking, and a New Song Release
Meta

‘KING’ Shah Rukh Khan at House of Instagram: Storytelling Lessons, Creative Risk-taking, and a New Song Release

What are tokenized stocks?
Infura

What are tokenized stocks?

More from OpenZeppelin

UMA Dispute Router Legacy Oracle Fallback Diff Security Audit
OpenZeppelin

UMA Dispute Router Legacy Oracle Fallback Diff Security Audit

OpenZeppelin Brings Confidential Balances and Transfers to Stellar
OpenZeppelin

OpenZeppelin Brings Confidential Balances and Transfers to Stellar

OpenZeppelin Partners With Chainlink to Advance Onchain Finance and Extend the Standards Used by the Vast Majority of the Blockchain Industry
OpenZeppelin

OpenZeppelin Partners With Chainlink to Advance Onchain Finance and Extend the Standards Used by the Vast Majority of the Blockchain Industry

Across Counterfactual & Periphery Updates Diff Audit
OpenZeppelin

Across Counterfactual & Periphery Updates Diff Audit

Uniswap Universal Router 2.1 and V4 Periphery Audit
OpenZeppelin

Uniswap Universal Router 2.1 and V4 Periphery Audit

Uniswap Universal Router SwapProxy and Periphery Audit
OpenZeppelin

Uniswap Universal Router SwapProxy and Periphery Audit