Skip to main content
This page is the reference for the Bags contracts on Robinhood Chain. For step-by-step usage, see the Launch, Trade, Read State, and Claim Fees guides.

Addresses

Protocol singletons and shared infrastructure on Robinhood Chain mainnet (chain ID 4663): BagsBondingCurve and BagsFeeShare are per-token beacon proxies and BagsToken a per-token EIP-1167 clone — resolve them via the TokenCreated event, factory.curveForToken / factory.feeShareForToken, or BagsLens.getTokenState.

Proxy Topology

Always integrate against the proxy addresses above — they are stable across upgrades. For upgrade monitoring (indexers should watch Upgraded events on all four):

ABI Downloads

The full ABIs (including custom error definitions used for revert decoding) are published in the robinhood-abi-v2 directory of the public bagsfm/bags-idl repository:
Import the full ABIs so your EVM library can decode custom errors (e.g. BagsBondingCurve_SlippageExceeded) into readable messages instead of raw revert data.

BagsFactory

Launch entry point and on-chain registry.

Functions

Events

Key errors

BagsFactory_InsufficientCreationFee(required, sent), BagsFactory_InvalidClaimers, BagsFactory_NoClaimers, BagsFactory_InvalidPartnerFeeBps(partnerFeeBps), BagsFactory_InvalidGraduationThreshold(threshold), BagsFactory_NoBuyValue, BagsFactory_BuyFailed(curve, value), BagsFactory_RefundFailed(to, amount), BagsFactory_FeeTransferFailed(to, amount).

BagsBondingCurve

Per-token pre-migration AMM (virtual x * y = k). Resolve its address per token.

Functions

Events

Key errors

BagsBondingCurve_SlippageExceeded(minExpected, actualOut), BagsBondingCurve_AlreadyMigrated, BagsBondingCurve_NotInitialized, BagsBondingCurve_ThresholdNotReached(have, need), BagsBondingCurve_NoQuoteSent, BagsBondingCurve_ZeroInputAmount, BagsBondingCurve_InvalidRecipient, EnforcedPause.

BagsFeeShare

Per-token fee ledger (accrues in WETH): the creator half for the claimers, plus the partner’s cut of the protocol half. Resolve its address per token.

Functions

Events

Key errors

BagsFeeShare_NothingToClaim, BagsFeeShare_NotAuthorized(caller), BagsFeeShare_BpsSumInvalid(sum), BagsFeeShare_DuplicateClaimer(claimer), BagsFeeShare_TooManyClaimers(length, max), BagsFeeShare_PartnerIsClaimer, BagsFeeShare_ClaimerHasUnpaid(claimer), BagsFeeShare_NoPartner.

BagsLens

Stateless read aggregator. Preferred entry point for reads.

Functions

TokenState struct

BagsToken

Per-token ERC-20 with a fixed 1e9 supply (18 decimals). Standard ERC-20 surface (name, symbol, decimals, totalSupply, balanceOf, approve, allowance, transfer, transferFrom) plus:

BagsV4Hook

Singleton Uniswap v4 hook shared by all Bags pools. It takes the 2% fee on the WETH leg of post-migration swaps, locks liquidity, and routes creator fees to each token’s fee-share.

Functions

Events

Key errors

BagsV4Hook_ExactOutputWETHSpecifiedUnsupported (exact-out WETH is rejected by design), BagsV4Hook_LiquidityLocked, BagsV4Hook_PoolNotRegistered(poolId), BagsV4Hook_AlreadyRegistered(poolId), BagsV4Hook_NotFactory(caller), BagsV4Hook_PoolMissingWETH.

BagsVault

Platform treasury holding native ETH (the vault portion of the protocol fee half and the launch fee). Owner-controlled withdrawals; no integrator-facing calls.
Events: Received(from, amount), Withdrawn(to, amount), TokenWithdrawn(token, to, amount), Upgraded(implementation).

BagsBeacon

Two instances (curve + fee-share) each hold the implementation address for all their beacon proxies. Integrators only need these for upgrade monitoring — a single upgradeTo retargets every live launch at once.
Event: Upgraded(address indexed implementation).

Periphery ABIs

The Uniswap-style infrastructure is not part of the Bags ABI export. These are the minimal fragments used by the Trade Tokens and Read State guides.

UniversalRouter (modified fork)

Only execute is called directly. The v4 swap struct carries an extra uint256 minHopPriceX36 field vs vanilla Uniswap (set it to 0), so encode the calldata manually.
The v4 swap params tuple (encoded manually for SWAP_EXACT_IN_SINGLE):
Command / action bytes: command V4_SWAP = 0x10; actions SWAP_EXACT_IN_SINGLE = 0x06, SETTLE_ALL = 0x0c, TAKE_ALL = 0x0f.

Permit2

V4Quoter (call via eth_call / simulate, not on-chain)

quoteExactInputSingle is nonpayable, not view — it must be simulated via eth_call (viem’s simulateContract), never called as a plain read. The Trade Tokens guide does this. Output already includes the 2% hook fee — apply slippage only.

StateView

WETH (aeWETH proxy)

WETH9-compatible interface. Never rely on its bytecode/codehash — it’s an upgradeable proxy.

Pool key parameters

Bags pools use these exact values — they must match the factory or derived pool IDs will be wrong: poolId = keccak256(abi.encode(currency0, currency1, fee, tickSpacing, hooks)). Prefer the on-chain poolId from TokenCreated or BagsLens.getTokenState.