Quantum Audit Logo

Is Ribbita by Virtuals Safe?

On-chain security analysis — is it a scam or legit?

Ribbita by Virtuals TIBBIR
0xa4a2…6e00
Base Not verifiedLast checked 3d ago 1 audit on record
Executive SummaryAI Copilot

The AgentToken contract is an upgradeable ERC20-like token with integrated tax mechanisms, liquidity management via Uniswap V2, and a custom access control model involving a factory contract. The contract utilizes OpenZeppelin's upgradeable patterns and libraries, contributing to a robust foundation. However, significant centralization risks associated with the factory address's extensive control and potential economic vulnerabilities related to tax parameters and Uniswap V2 price reliance have been identified, leading to an overall 'High' risk level.

1 High2 Medium1 Low2 Informational
Volume 24h
$764.0K
Liquidity
$3.30M
Price
$0.2404
Token Age
1y
Top 10 Holders
17.0%

Security Findings

High

Centralization Risk via Factory Address

H-01The `_factory` address, set during initialization, is granted extensive administrative control through the `onlyOwnerOrFactory` modifier. This includes the ability to add/remove liquidity pools, manage valid callers, and set critical tax parameters. If the factory contract is compromised or poorly secured (e.g., a single EOA), it could lead to a complete compromise of the token's configurable parameters, allowing an attacker to manipulate taxes, liquidity, or block legitimate callers.
IssueThe `_factory` address, set during initialization, is granted extensive administrative control through the `onlyOwnerOrFactory` modifier. This includes the ability to add/remove liquidity pools, manage valid callers, and set critical tax parameters. If the factory contract is compromised or poorly secured (e.g., a single EOA), it could lead to a complete compromise of the token's configurable parameters, allowing an attacker to manipulate taxes, liquidity, or block legitimate callers.
FixImplement robust security measures for the `_factory` address. Consider using a multi-signature wallet or a well-audited governance contract for the factory to distribute control and reduce the risk of a single point of failure. Clearly document the responsibilities and security requirements for the factory address.
StatusUnresolved
Medium

Potential for High Tax Rates

M-01The `projectBuyTaxBasisPoints` and `projectSellTaxBasisPoints` can be set by the owner or factory. While `MAX_SWAP_THRESHOLD_MULTIPLE` is defined, the provided code snippet does not show any explicit upper bounds or validation checks on the tax basis points themselves. Without such limits, an authorized entity could set excessively high tax rates, effectively rendering the token illiquid or unusable, leading to a loss of user funds or project failure.
IssueThe `projectBuyTaxBasisPoints` and `projectSellTaxBasisPoints` can be set by the owner or factory. While `MAX_SWAP_THRESHOLD_MULTIPLE` is defined, the provided code snippet does not show any explicit upper bounds or validation checks on the tax basis points themselves. Without such limits, an authorized entity could set excessively high tax rates, effectively rendering the token illiquid or unusable, leading to a loss of user funds or project failure.
FixImplement explicit upper limits for `projectBuyTaxBasisPoints` and `projectSellTaxBasisPoints` to prevent economically destructive configurations. These limits should be carefully chosen to maintain token utility and liquidity, and ideally, any changes to these limits should be subject to a time-lock or governance vote.
StatusUnresolved
Medium

Reliance on Uniswap V2 Price for Tax Swaps

M-02The contract relies on Uniswap V2 for price discovery when performing tax swaps (implied by `_uniswapRouter` and `swapThresholdBasisPoints`). Uniswap V2's spot price is susceptible to manipulation, especially for low-liquidity pairs, through flash loans or large trades. If the `pairToken` is easily manipulable, the automated tax swap mechanism could be exploited to execute swaps at unfavorable rates, leading to value loss for the protocol or its users.
IssueThe contract relies on Uniswap V2 for price discovery when performing tax swaps (implied by `_uniswapRouter` and `swapThresholdBasisPoints`). Uniswap V2's spot price is susceptible to manipulation, especially for low-liquidity pairs, through flash loans or large trades. If the `pairToken` is easily manipulable, the automated tax swap mechanism could be exploited to execute swaps at unfavorable rates, leading to value loss for the protocol or its users.
FixFor critical operations involving price-sensitive logic, consider integrating more robust and decentralized oracle solutions (e.g., Chainlink) or implementing a time-weighted average price (TWAP) mechanism from Uniswap V2 to mitigate flash loan and price manipulation risks. Ensure sufficient liquidity for the token's pair on Uniswap V2.
StatusUnresolved
Low

Unused `CALL_GAS_LIMIT` Constant

L-01The constant `CALL_GAS_LIMIT` is defined within the contract but is not utilized in the provided code snippet. While not a direct vulnerability, unused code can increase contract size, potentially leading to higher deployment costs, and may indicate incomplete or abandoned functionality.
IssueThe constant `CALL_GAS_LIMIT` is defined within the contract but is not utilized in the provided code snippet. While not a direct vulnerability, unused code can increase contract size, potentially leading to higher deployment costs, and may indicate incomplete or abandoned functionality.
FixReview the purpose of `CALL_GAS_LIMIT`. If it is intended for future functionality, ensure its value is appropriate for the intended external calls. If it is no longer needed, consider removing it to optimize contract size and clarity.
StatusUnresolved
Info

`_autoSwapInProgress` Reentrancy Guard

I-01The contract utilizes a private boolean flag `_autoSwapInProgress` which is set to `true` during initialization and `false` after initial liquidity is added. This pattern is commonly used as a reentrancy guard to prevent reentrant calls during critical, multi-step operations, likely related to the automated tax swap mechanism (not fully shown in the snippet). This is a good security practice.
IssueThe contract utilizes a private boolean flag `_autoSwapInProgress` which is set to `true` during initialization and `false` after initial liquidity is added. This pattern is commonly used as a reentrancy guard to prevent reentrant calls during critical, multi-step operations, likely related to the automated tax swap mechanism (not fully shown in the snippet). This is a good security practice.
FixEnsure that all functions that modify or depend on the state protected by `_autoSwapInProgress` correctly set and reset the flag to maintain its effectiveness as a reentrancy guard.
StatusUnresolved
Info

Use of `EnumerableSet` for Dynamic Sets

I-02The contract effectively uses OpenZeppelin's `EnumerableSet` for managing dynamic collections of addresses (`_liquidityPools`) and bytes32 hashes (`_validCallerCodeHashes`). This library provides efficient and secure ways to store and retrieve unique elements, which is a good practice for managing whitelists or lists of external contracts.
IssueThe contract effectively uses OpenZeppelin's `EnumerableSet` for managing dynamic collections of addresses (`_liquidityPools`) and bytes32 hashes (`_validCallerCodeHashes`). This library provides efficient and secure ways to store and retrieve unique elements, which is a good practice for managing whitelists or lists of external contracts.
FixContinue to leverage `EnumerableSet` for managing dynamic sets where efficient iteration and membership checks are required. Ensure that access control for adding and removing elements from these sets remains robust.
StatusUnresolved

Category Ratings

TechnicalLow8/10

The contract demonstrates good architectural practices by leveraging OpenZeppelin's upgradeable contracts and using custom error types (7.1 Architecture, 7.2 Code Security). The `_autoSwapInProgress` flag serves as an effective reentrancy guard for critical operations, enhancing code security. However, the reliance on the `_factory` address for extensive administrative control introduces a significant centralization risk, as a compromise of this address could lead to unauthorized modifications of token parameters (7.3 Access Control). Additionally, the contract's internal logic for tax swaps depends on Uniswap V2 pricing, which is susceptible to manipulation, especially for low-liquidity pairs (7.6 External).

GovernanceHigh2/10

The contract's economic model includes configurable buy and sell taxes, which can be adjusted by the owner or factory (7.4 Economic). While this offers flexibility, the absence of explicit upper bounds on these tax rates in the provided snippet could allow for economically destructive configurations, potentially rendering the token illiquid. The `onlyOwnerOrFactory` modifier grants substantial power to the factory address, which is set during initialization, creating a centralized point of control over critical economic and operational parameters (7.5 Governance, 7.8 Operations). The `projectTaxRecipient` and `vault` addresses are also critical operational points that require robust security measures.

UpgradesHigh1/10

The contract correctly implements the UUPS proxy pattern by inheriting from `Initializable` and calling `_disableInitializers()` in the constructor, along with using the `initializer` modifier for setup functions (7.7 Upgrades). Storage variables are declared appropriately, with private variables like `_autoSwapInProgress` ensuring upgrade safety by preventing accidental overwrites in derived contracts. The use of OpenZeppelin's upgradeable versions of `Context` and `Ownable2Step` further strengthens the upgradeability architecture.

Security Checklist

Contract VerifiedPass
Ownership RenouncedFail
No Mint FunctionPass
Liquidity LockedFail
Not a ProxyFail

Proxy Upgrade Controls

Proxy TypeEtherscan Detected Custom
ImplementationVerified source
Upgrades (30d)0 · stable

Holder Composition

16.0% in wallets0.9% in contracts
Effective Concentration16.4%

Share held by contracts — treasury, vesting, bridge or staking — is discounted against share held by wallets when the score is computed: a contract cannot decide to sell the way an anonymous holder can, though it can still be drained or voted to sell. Effective concentration is the figure the risk score is actually calculated from.

Liquidity Depth

Show 4 more pairsShow less

One more pair holds $21 and is not listed.

The risk score reads depth across every pair. The volume figure and the volume-to-liquidity ratio elsewhere on this page describe only the pair this audit analysed, so the two are not directly comparable.

LP Distribution

Top-1 Unlocked Holder98.9%
Top-3 Unlocked100.0%

Key Addresses

Deployer
0xdb2e…c398
Unlocked LP Held By
0x4188…eb4a0x92d0…e5150x6313…1a60

No privileged address appears among these holders: the unlocked liquidity sits with independent providers, not with the deployer.

What Raised This Score

  • Ownership NOT renounced — owner is an EOA (single private key)
  • Proxy contract (upgradeable — admin can replace logic)
  • Non-standard proxy storage (Etherscan-confirmed)
  • Liquidity not locked, but no owner/deployer address holds LP — market-depth risk, not rug risk
  • LP top1 unlocked holder = 98.9% (independent LP — depth risk, pool = 86% of DEX liquidity)
  • LP top3 unlocked holders = 100.0% (independent LP — depth risk, pool = 86% of DEX liquidity)
  • 1 High finding(s) from audit
  • 2 Medium finding(s) from audit
  • 1 Low finding(s) from audit

Each factor is an on-chain fact recorded at the time of this analysis. The score is computed from them by a deterministic function, so the same contract returns the same score for anyone who runs the audit. How scores are computed

Related Audits

PromptHigh RiskEURCHigh RiskCoinbase Wrapped XRP (CBXRP)High RiskCoinbase Wrapped BTC (CBBTC)High RiskZestHigh RiskDotHigh Risk

Would You Like a More Detailed Audit of Ribbita by Virtuals?

Our AI-powered scanner gives you a deeper, real-time smart contract analysis — free, with every scoring factor shown.

Get Detailed Audit