aavegotchi-baazaarView, add, and execute Aavegotchi Baazaar listings on Base mainnet (8453). Buy with GHST directly or buy with USDC using swapAndBuy*. Safety-first: dryRun de...
Install via ClawdBot CLI:
clawdbot install cinnabarhorse/aavegotchi-baazaardryRun=true (DRY_RUN=1). Never broadcast unless explicitly instructed to do so.cast send:cast call and show a transaction summary (method, args, chain id, from, rpc URL).DRY_RUN=0 and BROADCAST_CONFIRM=CONFIRM_SEND are both set.~/.foundry/bin/cast chain-id --rpc-url "${BASE_MAINNET_RPC:-https://mainnet.base.org}" must be 8453.~/.foundry/bin/cast wallet address --private-key "$PRIVATE_KEY" must equal $FROM_ADDRESS.$PRIVATE_KEY.$PRIVATE_KEY from environment.This skill includes shell commands. Treat any value you copy from a user or an external source (subgraph responses, chat messages, etc.) as untrusted.
Rules:
eval, bash -c, sh -c).0x + 40 hex chars."" to avoid accidental shell interpolation. Replace them with literal values after you validate them.Allowlisted command templates:
~/.foundry/bin/cast chain-id|wallet address|call|send ... using fixed ABI signatures from this skill.curl -s "$SUBGRAPH_URL" -H 'content-type: application/json' --data '...static GraphQL query...'.curl -s "$COINGECKO_SIMPLE_PRICE_URL" for GHST/USD only.python3 inline snippets from this skill/references for validation and deterministic math only.eval, bash -c, sh -c, backticks, and $(...) with untrusted input.Quick validators (replace the placeholder values):
python3 - <<'PY'
import re
listing_id = "<LISTING_ID>" # digits only
token_contract = "<TOKEN_CONTRACT_ADDRESS>" # 0x + 40 hex chars
price_in_wei = "<PRICE_IN_WEI>" # digits only
if not re.fullmatch(r"[0-9]+", listing_id):
raise SystemExit("LISTING_ID must be base-10 digits only")
if not re.fullmatch(r"0x[a-fA-F0-9]{40}", token_contract):
raise SystemExit("TOKEN_CONTRACT_ADDRESS must be a 0x + 40-hex address")
if not re.fullmatch(r"[0-9]+", price_in_wei):
raise SystemExit("PRICE_IN_WEI must be base-10 digits only")
print("ok")
PY
Required env vars:
PRIVATE_KEY: EOA private key used for cast send (never print/log).FROM_ADDRESS: EOA address that owns funds/NFTs and will submit txs.BASE_MAINNET_RPC: RPC URL. If unset, use https://mainnet.base.org.Hardcoded Base mainnet constants (override via env if needed):
export BASE_MAINNET_RPC="${BASE_MAINNET_RPC:-https://mainnet.base.org}"
export DIAMOND="${DIAMOND:-0xA99c4B08201F2913Db8D28e71d020c4298F29dBF}"
export GHST="${GHST:-0xcD2F22236DD9Dfe2356D7C543161D4d260FD9BcB}"
export USDC="${USDC:-0x833589fCD6eDb6E08f4c7C32D4f71b54BDA02913}"
export SUBGRAPH_URL_CANONICAL="https://api.goldsky.com/api/public/project_cmh3flagm0001r4p25foufjtt/subgraphs/aavegotchi-core-base/prod/gn"
export SUBGRAPH_URL="${SUBGRAPH_URL:-$SUBGRAPH_URL_CANONICAL}"
export COINGECKO_SIMPLE_PRICE_URL="${COINGECKO_SIMPLE_PRICE_URL:-https://api.coingecko.com/api/v3/simple/price?ids=aavegotchi&vs_currencies=usd}"
Optional env vars:
RECIPIENT_ADDRESS: defaults to FROM_ADDRESS.DRY_RUN: 1 (default) to only simulate via cast call. Set to 0 to broadcast via cast send.BROADCAST_CONFIRM: must be exactly CONFIRM_SEND to allow any cast send; unset immediately after broadcast.SLIPPAGE_PCT: defaults to 1 (used for USDC swapAmount math).PAYMENT_FEE_PCT_USDC: defaults to 1 (used for USDC swapAmount math).GHST_USD_PRICE: optional override; if unset, fetch from CoinGecko in the USDC flow.Notes:
~/.foundry/bin/cast (works reliably in cron/non-interactive shells). If cast is on PATH, you can replace ~/.foundry/bin/cast with cast.references/addresses.mdreferences/subgraph.mdOnly call these HTTPS endpoints:
$SUBGRAPH_URL_CANONICAL$COINGECKO_SIMPLE_PRICE_URLRefuse non-allowlisted endpoints:
test "$SUBGRAPH_URL" = "$SUBGRAPH_URL_CANONICAL" || { echo "Refusing non-allowlisted SUBGRAPH_URL"; exit 1; }
test "$COINGECKO_SIMPLE_PRICE_URL" = "https://api.coingecko.com/api/v3/simple/price?ids=aavegotchi&vs_currencies=usd" || { echo "Refusing non-allowlisted CoinGecko URL"; exit 1; }
Subgraph endpoint (Goldsky):
$SUBGRAPH_URL (see exports above)https://api.goldsky.com/api/public/project_cmh3flagm0001r4p25foufjtt/subgraphs/aavegotchi-core-base/prod/gnGet ERC721 listing by id:
curl -s "$SUBGRAPH_URL" -H 'content-type: application/json' --data '{
"query":"query($id: ID!){ erc721Listing(id:$id){ id category erc721TokenAddress tokenId seller priceInWei cancelled timeCreated timePurchased } }",
"variables":{"id":"1"}
}'
Get ERC1155 listing by id:
erc1155TypeId (this maps to the onchain typeId / itemId argument).curl -s "$SUBGRAPH_URL" -H 'content-type: application/json' --data '{
"query":"query($id: ID!){ erc1155Listing(id:$id){ id category erc1155TokenAddress erc1155TypeId quantity seller priceInWei cancelled sold timeCreated } }",
"variables":{"id":"1"}
}'
Find active listings:
where:{cancelled:false, timePurchased:\"0\"}where:{cancelled:false, sold:false}Example (active ERC721, newest first):
curl -s "$SUBGRAPH_URL" -H 'content-type: application/json' --data '{
"query":"query{ erc721Listings(first:20, orderBy:timeCreated, orderDirection:desc, where:{cancelled:false, timePurchased:\"0\"}){ id erc721TokenAddress tokenId priceInWei seller timeCreated } }"
}'
Example (active ERC1155, newest first):
curl -s "$SUBGRAPH_URL" -H 'content-type: application/json' --data '{
"query":"query{ erc1155Listings(first:20, orderBy:timeCreated, orderDirection:desc, where:{cancelled:false, sold:false}){ id erc1155TokenAddress erc1155TypeId quantity priceInWei seller timeCreated } }"
}'
Onchain methods (Diamond):
executeERC721ListingToRecipient(uint256 listingId,address contractAddress,uint256 priceInWei,uint256 tokenId,address recipient)executeERC1155ListingToRecipient(uint256 listingId,address contractAddress,uint256 itemId,uint256 quantity,uint256 priceInWei,address recipient)Total cost:
totalCostGhstWei = priceInWeitotalCostGhstWei = priceInWei * quantity (but you still pass quantity and priceInWei separately to the method)Before buying:
references/recipes.md).Dry-run (simulate) ERC721 buy:
~/.foundry/bin/cast call "$DIAMOND" \
'executeERC721ListingToRecipient(uint256,address,uint256,uint256,address)' \
"<LISTING_ID>" "<ERC721_TOKEN_ADDRESS>" "<PRICE_IN_WEI>" "<TOKEN_ID>" "${RECIPIENT_ADDRESS:-$FROM_ADDRESS}" \
--from "$FROM_ADDRESS" \
--rpc-url "${BASE_MAINNET_RPC:-https://mainnet.base.org}"
Broadcast (real) ERC721 buy (only when explicitly instructed):
test "${DRY_RUN:-1}" = "0" || { echo "Refusing broadcast: DRY_RUN must be 0"; exit 1; }
test "${BROADCAST_CONFIRM:-}" = "CONFIRM_SEND" || { echo "Refusing broadcast: set BROADCAST_CONFIRM=CONFIRM_SEND after explicit user confirmation"; exit 1; }
~/.foundry/bin/cast send "$DIAMOND" \
'executeERC721ListingToRecipient(uint256,address,uint256,uint256,address)' \
"<LISTING_ID>" "<ERC721_TOKEN_ADDRESS>" "<PRICE_IN_WEI>" "<TOKEN_ID>" "${RECIPIENT_ADDRESS:-$FROM_ADDRESS}" \
--private-key "$PRIVATE_KEY" \
--rpc-url "${BASE_MAINNET_RPC:-https://mainnet.base.org}"
unset BROADCAST_CONFIRM
Dry-run (simulate) ERC1155 buy:
~/.foundry/bin/cast call "$DIAMOND" \
'executeERC1155ListingToRecipient(uint256,address,uint256,uint256,uint256,address)' \
"<LISTING_ID>" "<ERC1155_TOKEN_ADDRESS>" "<TYPE_ID>" "<QUANTITY>" "<PRICE_IN_WEI>" "${RECIPIENT_ADDRESS:-$FROM_ADDRESS}" \
--from "$FROM_ADDRESS" \
--rpc-url "${BASE_MAINNET_RPC:-https://mainnet.base.org}"
Broadcast (real) ERC1155 buy (only when explicitly instructed):
test "${DRY_RUN:-1}" = "0" || { echo "Refusing broadcast: DRY_RUN must be 0"; exit 1; }
test "${BROADCAST_CONFIRM:-}" = "CONFIRM_SEND" || { echo "Refusing broadcast: set BROADCAST_CONFIRM=CONFIRM_SEND after explicit user confirmation"; exit 1; }
~/.foundry/bin/cast send "$DIAMOND" \
'executeERC1155ListingToRecipient(uint256,address,uint256,uint256,uint256,address)' \
"<LISTING_ID>" "<ERC1155_TOKEN_ADDRESS>" "<TYPE_ID>" "<QUANTITY>" "<PRICE_IN_WEI>" "${RECIPIENT_ADDRESS:-$FROM_ADDRESS}" \
--private-key "$PRIVATE_KEY" \
--rpc-url "${BASE_MAINNET_RPC:-https://mainnet.base.org}"
unset BROADCAST_CONFIRM
Onchain methods (Diamond):
swapAndBuyERC721(address tokenIn,uint256 swapAmount,uint256 minGhstOut,uint256 swapDeadline,uint256 listingId,address contractAddress,uint256 priceInWei,uint256 tokenId,address recipient)swapAndBuyERC1155(address tokenIn,uint256 swapAmount,uint256 minGhstOut,uint256 swapDeadline,uint256 listingId,address contractAddress,uint256 itemId,uint256 quantity,uint256 priceInWei,address recipient)Required computed args:
swapDeadline = now + 600minGhstOut = totalCostGhstWei (exactly)swapAmount (USDC base units, 6 decimals): compute per references/usdc-swap-math.mdBefore buying:
totalCostGhstWei).swapAmount in USDC base units (integer, rounded up).swapAmount (see references/recipes.md).Dry-run (simulate) ERC721 USDC swap+buy:
~/.foundry/bin/cast call "$DIAMOND" \
'swapAndBuyERC721(address,uint256,uint256,uint256,uint256,address,uint256,uint256,address)' \
"$USDC" "<SWAP_AMOUNT_USDC_6DP>" "<MIN_GHST_OUT_GHST_WEI>" "<SWAP_DEADLINE_UNIX>" "<LISTING_ID>" "<ERC721_TOKEN_ADDRESS>" "<PRICE_IN_WEI>" "<TOKEN_ID>" "${RECIPIENT_ADDRESS:-$FROM_ADDRESS}" \
--from "$FROM_ADDRESS" \
--rpc-url "${BASE_MAINNET_RPC:-https://mainnet.base.org}"
Dry-run (simulate) ERC1155 USDC swap+buy:
~/.foundry/bin/cast call "$DIAMOND" \
'swapAndBuyERC1155(address,uint256,uint256,uint256,uint256,address,uint256,uint256,uint256,address)' \
"$USDC" "<SWAP_AMOUNT_USDC_6DP>" "<MIN_GHST_OUT_GHST_WEI>" "<SWAP_DEADLINE_UNIX>" "<LISTING_ID>" "<ERC1155_TOKEN_ADDRESS>" "<TYPE_ID>" "<QUANTITY>" "<PRICE_IN_WEI>" "${RECIPIENT_ADDRESS:-$FROM_ADDRESS}" \
--from "$FROM_ADDRESS" \
--rpc-url "${BASE_MAINNET_RPC:-https://mainnet.base.org}"
Broadcast (real) ERC721 swap+buy (only when explicitly instructed):
test "${DRY_RUN:-1}" = "0" || { echo "Refusing broadcast: DRY_RUN must be 0"; exit 1; }
test "${BROADCAST_CONFIRM:-}" = "CONFIRM_SEND" || { echo "Refusing broadcast: set BROADCAST_CONFIRM=CONFIRM_SEND after explicit user confirmation"; exit 1; }
~/.foundry/bin/cast send "$DIAMOND" \
'swapAndBuyERC721(address,uint256,uint256,uint256,uint256,address,uint256,uint256,address)' \
"$USDC" "<SWAP_AMOUNT_USDC_6DP>" "<MIN_GHST_OUT_GHST_WEI>" "<SWAP_DEADLINE_UNIX>" "<LISTING_ID>" "<ERC721_TOKEN_ADDRESS>" "<PRICE_IN_WEI>" "<TOKEN_ID>" "${RECIPIENT_ADDRESS:-$FROM_ADDRESS}" \
--private-key "$PRIVATE_KEY" \
--rpc-url "${BASE_MAINNET_RPC:-https://mainnet.base.org}"
unset BROADCAST_CONFIRM
Broadcast (real) ERC1155 swap+buy (only when explicitly instructed):
test "${DRY_RUN:-1}" = "0" || { echo "Refusing broadcast: DRY_RUN must be 0"; exit 1; }
test "${BROADCAST_CONFIRM:-}" = "CONFIRM_SEND" || { echo "Refusing broadcast: set BROADCAST_CONFIRM=CONFIRM_SEND after explicit user confirmation"; exit 1; }
~/.foundry/bin/cast send "$DIAMOND" \
'swapAndBuyERC1155(address,uint256,uint256,uint256,uint256,address,uint256,uint256,uint256,address)' \
"$USDC" "<SWAP_AMOUNT_USDC_6DP>" "<MIN_GHST_OUT_GHST_WEI>" "<SWAP_DEADLINE_UNIX>" "<LISTING_ID>" "<ERC1155_TOKEN_ADDRESS>" "<TYPE_ID>" "<QUANTITY>" "<PRICE_IN_WEI>" "${RECIPIENT_ADDRESS:-$FROM_ADDRESS}" \
--private-key "$PRIVATE_KEY" \
--rpc-url "${BASE_MAINNET_RPC:-https://mainnet.base.org}"
unset BROADCAST_CONFIRM
Onchain methods (Diamond):
getListingFeeInWei()(uint256)addERC721Listing(address erc721TokenAddress,uint256 tokenId,uint256 category,uint256 priceInWei)setERC1155Listing(address erc1155TokenAddress,uint256 typeId,uint256 quantity,uint256 category,uint256 priceInWei)Steps:
~/.foundry/bin/cast call "$DIAMOND" 'getListingFeeInWei()(uint256)' --rpc-url "${BASE_MAINNET_RPC:-https://mainnet.base.org}"setApprovalForAll($DIAMOND,true) (ERC721/1155) before listing.cast call when dryRun=true, broadcast with cast send only when explicitly instructed).seller=$FROM_ADDRESS ordered by timeCreated desc and confirm it matches token/typeId.ERC721 list (simulate):
~/.foundry/bin/cast call "$DIAMOND" \
'addERC721Listing(address,uint256,uint256,uint256)' \
"<ERC721_TOKEN_ADDRESS>" "<TOKEN_ID>" "<CATEGORY>" "<PRICE_IN_WEI>" \
--from "$FROM_ADDRESS" \
--rpc-url "${BASE_MAINNET_RPC:-https://mainnet.base.org}"
ERC1155 list (simulate):
~/.foundry/bin/cast call "$DIAMOND" \
'setERC1155Listing(address,uint256,uint256,uint256,uint256)' \
"<ERC1155_TOKEN_ADDRESS>" "<TYPE_ID>" "<QUANTITY>" "<CATEGORY>" "<PRICE_IN_WEI>" \
--from "$FROM_ADDRESS" \
--rpc-url "${BASE_MAINNET_RPC:-https://mainnet.base.org}"
Diamond: Function does not exist: wrong contract address or wrong function signature (or wrong chain).ERC1155Marketplace: not enough GHST: insufficient balance or allowance (or computed totalCostGhstWei is wrong).ERC1155Marketplace: Not approved / approval errors: missing setApprovalForAll for listing, or missing ERC20 approve for buying.LibTokenSwap: swapAmount must be > 0): bad swapAmount math or missing inputs.Generated Mar 1, 2026
A marketplace wants to integrate Aavegotchi NFT listings directly into their platform, allowing users to view and purchase Aavegotchis without leaving the site. This skill enables seamless fetching of listings from the Baazaar subgraph and executing purchases via smart contracts, ensuring real-time data and secure transactions. It supports both GHST and USDC payments, catering to diverse user preferences.
A DeFi portfolio tracker incorporates this skill to allow users to manage their Aavegotchi assets alongside other holdings. Users can monitor Baazaar listings, simulate purchases to assess costs, and execute trades directly from the tracker interface. The dry-run feature ensures safety by preventing accidental broadcasts, while integration with Base mainnet provides fast and low-cost transactions.
A gaming guild uses this skill to automate the acquisition of Aavegotchis for their members, such as buying NFTs in bulk for scholarship programs or asset lending. By scripting purchases with GHST or USDC, the guild can efficiently manage inventory and optimize costs through slippage and fee settings. The safety rules prevent unauthorized transactions, protecting guild funds.
A payment gateway integrates this skill to offer Aavegotchi purchases as a service, enabling merchants to accept GHST or USDC for digital goods. Customers can buy NFTs directly through the gateway, with the skill handling subgraph queries and contract interactions. The mandatory confirmation gates and environment variable checks ensure compliance and security in high-volume transactions.
Developers build automated bots or tools that leverage this skill for arbitrage opportunities or market analysis on the Aavegotchi Baazaar. The skill's ability to refetch listings before transactions ensures data accuracy, while the allowlisted command templates prevent RCE risks. It supports custom RPCs and slippage settings for optimized trading strategies.
Offer a subscription-based service where users access a web interface or API to interact with the Aavegotchi Baazaar, using this skill as the backend. Revenue comes from monthly fees or transaction-based commissions, with features like portfolio tracking and automated purchases. The skill's safety-first approach builds trust, attracting users who value secure NFT trading.
License this skill as a white-label product for other platforms, such as NFT marketplaces or DeFi apps, to integrate Aavegotchi functionality without developing from scratch. Revenue is generated through licensing fees or revenue-sharing agreements. The modular design and environment variable configuration allow easy customization for different use cases.
Provide consulting services to help businesses integrate this skill into their existing systems, such as setting up environment variables, configuring safety rules, and optimizing transaction flows. Revenue comes from hourly rates or project-based fees. The skill's detailed documentation and safety features reduce implementation risks, making it attractive for enterprises.
💬 Integration Tip
Ensure all required environment variables like PRIVATE_KEY and BASE_MAINNET_RPC are securely configured before use, and always test with DRY_RUN=1 to simulate transactions first, avoiding unintended broadcasts.
Connect Claude to Clawdbot instantly and keep it connected 24/7. Run after setup to link your subscription, then auto-refreshes tokens forever.
ERC-8004 Trustless Agents - Register, discover, and build reputation for AI agents on Ethereum. Use when registering agents on-chain, querying agent registries, giving/receiving reputation feedback, or interacting with the AI agent trust layer.
Autonomous crypto trading on Base via Bankr. Use for trading tokens, monitoring launches, executing strategies, or managing a trading portfolio. Triggers on "trade", "buy", "sell", "launch", "snipe", "profit", "PnL", "portfolio balance", or any crypto trading task on Base.
Deploy ERC20 tokens on Base using Clanker SDK. Create tokens with built-in Uniswap V4 liquidity pools. Supports Base mainnet and Sepolia testnet. Requires PRIVATE_KEY in config.
Query DeFi portfolio data across 50+ chains via Zapper's GraphQL API. Use when the user wants to check wallet balances, DeFi positions, NFT holdings, token prices, or transaction history. Supports Base, Ethereum, Polygon, Arbitrum, Optimism, and more. Requires ZAPPER_API_KEY.
Interact with Solana blockchain via Helius APIs. Create/manage wallets, check balances (SOL + tokens), send transactions, swap tokens via Jupiter, and monitor addresses. Use for any Solana blockchain operation, crypto wallet management, token transfers, DeFi swaps, or portfolio tracking.