Build on vibe.market’s smart contracts to create your own integrations, trading bots, or applications.
Smart Contract Addresses
All vibe.market contracts are deployed on Base. Each booster pack collection has its own contract addresses for the NFT (BoosterDropV2) and token (BoosterTokenV2).
Contract Interfaces View the complete smart contract interfaces
Common Use Cases
1. Buying Booster Packs
Purchase booster packs programmatically and earn referral fees.
// Using ethers.js v6
import { ethers } from "ethers" ;
// Connect to provider
const provider = new ethers . JsonRpcProvider ( "https://base.llamarpc.com" );
const signer = new ethers . Wallet ( PRIVATE_KEY , provider );
// BoosterDropV2 contract
const boosterDrop = new ethers . Contract (
BOOSTER_DROP_ADDRESS ,
IBoosterDropV2_ABI ,
signer
);
// Get mint price for 5 packs
const mintPrice = await boosterDrop . getMintPrice ( 5 );
// Mint packs with referral (you earn fees!)
await boosterDrop . mint (
5 , // amount of packs
signer . address , // recipient
YOUR_ADDRESS , // referrer (earn 1% of fees)
YOUR_ADDRESS , // originReferrer (earn additional 1% of fees)
{ value: mintPrice } // ETH payment
);
2. Selling Tickets (Tokens)
Sell memecoin tokens back to the bonding curve or Uniswap pool.
// BoosterTokenV2 contract
const boosterToken = new ethers . Contract (
BOOSTER_TOKEN_ADDRESS ,
IBoosterTokenV2_ABI ,
signer
);
// Check current market type
const marketType = await boosterToken . marketType ();
// 0 = BONDING_CURVE, 1 = UNISWAP_POOL
// Get sell quote for 100,000 tokens
const tokenAmount = ethers . parseUnits ( "100000" , 18 );
const ethReceived = await boosterToken . getTokenSellQuote ( tokenAmount );
// Sell tokens with slippage protection
const minPayout = ( ethReceived * 98 n ) / 100 n ; // 2% slippage
await boosterToken . sell (
tokenAmount ,
signer . address , // recipient of ETH
minPayout , // minimum ETH to accept
YOUR_ADDRESS , // referrer
YOUR_ADDRESS // originReferrer
);
3. Selling Opened NFTs for Token Offers
Sell opened booster pack NFTs back to the contract for their token offer based on rarity.
// First, open the pack to reveal rarity
const tokenIds = [ 1 , 2 , 3 ]; // Your unopened pack token IDs
await boosterDrop . openPacks ( tokenIds );
// Then sell the opened pack for its token offer
await boosterDrop . sellAndClaimOffer ( tokenIds [ 0 ]);
// Or batch sell multiple opened packs
await boosterDrop . sellAndClaimOfferBatch ( tokenIds );
4. Integrating with Your Game or App
Use vibe.market NFTs as game assets or collectibles.
// Listen for user's pack transfers to track ownership
const filter = boosterDrop . filters . BoosterDropTransfer ( null , userAddress );
const events = await boosterDrop . queryFilter ( filter );
// Build collection from transfer events
const ownedTokens = new Set ();
for ( const event of events ) {
ownedTokens . add ( event . args . tokenId );
}
// Check ownership and rarity for specific tokens
const tokenId = 123 ;
const owner = await boosterDrop . ownerOf ( tokenId );
if ( owner === userAddress ) {
const rarity = await boosterDrop . getRarity ( tokenId );
const rarityNames = [ "" , "Common" , "Rare" , "Epic" , "Legendary" ];
console . log ( `User owns ${ rarityNames [ rarity ] } card # ${ tokenId } ` );
// Grant in-game benefits based on rarity
if ( rarity === 4 ) {
// Legendary
// Grant special abilities or bonuses
}
}
Important Considerations
Gas Optimization : Batch operations when possible (e.g., opening multiple packs at once)
Slippage Protection : Always use minPayoutSize
when selling tokens
Referral System : Include referral addresses to earn 1-2% of trading fees
Market State : Check if market is on bonding curve or Uniswap before trading
Entropy Fees : Opening packs requires a small ETH fee for Pyth Network randomness
Next Steps