jb-decode

0
0
Source

Decode and analyze Juicebox V5 transaction calldata. Explain what a transaction does, decode function parameters, and analyze historical transactions using cast or ethers.js.

Install

mkdir -p .claude/skills/jb-decode && curl -L -o skill.zip "https://mcp.directory/api/skills/download/6767" && unzip -o skill.zip -d .claude/skills/jb-decode && rm skill.zip

Installs to .claude/skills/jb-decode

About this skill

Juicebox V5 Transaction Decoder

Decode and analyze Juicebox V5 transaction calldata.

Common Function Selectors

JBMultiTerminal

pay(uint256,address,uint256,address,uint256,string,bytes)
  Selector: 0x...
  - Pay into a project

cashOutTokensOf(address,uint256,uint256,address,uint256,address,bytes)
  Selector: 0x...
  - Cash out tokens for funds

sendPayoutsOf(uint256,address,uint256,uint256,uint256)
  Selector: 0x...
  - Distribute payouts to splits

useAllowanceOf(uint256,address,uint256,uint256,uint256,address,address,string)
  Selector: 0x...
  - Use surplus allowance

JBController

launchProjectFor(address,string,(uint256,uint256,uint256,uint256,address,(uint256,uint256,uint256,bool,bool,bool,bool,bool,bool,bool,bool,bool,bool,bool,bool,bool,bool,address,uint256),(uint256,(bool,uint256,uint256,address,uint256,address)[])[],(address,address,(uint256,uint32)[],(uint256,uint32)[])[])[],(address,(address,uint8,uint32)[])[],string)
  - Launch a new project

queueRulesetsOf(uint256,(uint256,uint256,uint256,uint256,address,(uint256,uint256,uint256,bool,bool,bool,bool,bool,bool,bool,bool,bool,bool,bool,bool,bool,bool,address,uint256),(uint256,(bool,uint256,uint256,address,uint256,address)[])[],(address,address,(uint256,uint32)[],(uint256,uint32)[])[])[],string)
  - Queue new rulesets

mintTokensOf(uint256,uint256,address,string,bool)
  - Mint tokens

burnTokensOf(address,uint256,uint256,string)
  - Burn tokens

Decoding with Cast

Decode Calldata

# Get the function signature
cast 4byte <first-4-bytes-of-calldata>

# Decode full calldata (need ABI)
cast calldata-decode "pay(uint256,address,uint256,address,uint256,string,bytes)" <calldata>

Decode Transaction

# Get transaction details
cast tx <txhash> --rpc-url $RPC_URL

# Decode the input
cast tx <txhash> --rpc-url $RPC_URL | grep input

Example: Decode a Pay Transaction

# Assuming calldata starts with pay() selector
cast calldata-decode \
    "pay(uint256,address,uint256,address,uint256,string,bytes)" \
    "0x..." \
    # Returns:
    # projectId: 123
    # token: 0x0000...0000 (native)
    # amount: 1000000000000000000
    # beneficiary: 0x...
    # minReturnedTokens: 0
    # memo: "Supporting the project"
    # metadata: 0x...

Decoding with ethers.js

Setup

import { ethers } from 'ethers';

// Terminal ABI fragment
const TERMINAL_ABI = [
    'function pay(uint256 projectId, address token, uint256 amount, address beneficiary, uint256 minReturnedTokens, string memo, bytes metadata) payable returns (uint256)',
    'function cashOutTokensOf(address holder, uint256 projectId, uint256 cashOutCount, address tokenToReclaim, uint256 minTokensReclaimed, address beneficiary, bytes metadata) returns (uint256)',
    'function sendPayoutsOf(uint256 projectId, address token, uint256 amount, uint256 currency, uint256 minTokensPaidOut) returns (uint256)',
];

const iface = new ethers.Interface(TERMINAL_ABI);

Decode Calldata

function decodeCalldata(calldata: string) {
    try {
        const decoded = iface.parseTransaction({ data: calldata });
        return {
            name: decoded.name,
            args: decoded.args,
            signature: decoded.signature,
        };
    } catch (e) {
        return null;
    }
}

Decode Transaction from Hash

async function decodeTransaction(txHash: string) {
    const provider = new ethers.JsonRpcProvider(process.env.RPC_URL);
    const tx = await provider.getTransaction(txHash);

    if (!tx) throw new Error('Transaction not found');

    const decoded = iface.parseTransaction({ data: tx.data });

    return {
        from: tx.from,
        to: tx.to,
        value: ethers.formatEther(tx.value),
        function: decoded?.name,
        args: decoded?.args,
    };
}

Transaction Analysis Examples

Pay Transaction

Function: pay(uint256,address,uint256,address,uint256,string,bytes)
Parameters:
  projectId: 123          → Paying into project #123
  token: 0x000...000      → Using native currency (ETH)
  amount: 1e18            → Paying 1 ETH
  beneficiary: 0xABC...   → Tokens go to this address
  minReturnedTokens: 0    → No minimum (accepts any amount)
  memo: "Great project!"  → Payment memo
  metadata: 0x...         → Optional hook metadata

Effect: Sends 1 ETH to project #123, mints tokens to 0xABC...

Cash Out Transaction

Function: cashOutTokensOf(...)
Parameters:
  holder: 0xABC...        → Token holder cashing out
  projectId: 123          → From project #123
  cashOutCount: 1000e18   → Cashing out 1000 tokens
  tokenToReclaim: 0x0...  → Reclaiming ETH
  minTokensReclaimed: 0   → No minimum
  beneficiary: 0xABC...   → ETH goes here
  metadata: 0x...         → Optional hook metadata

Effect: Burns 1000 tokens, sends proportional ETH to 0xABC...

Queue Rulesets Transaction

Function: queueRulesetsOf(...)
Parameters:
  projectId: 123
  rulesetConfigs: [...]   → New ruleset configurations
  memo: "Update params"

Effect: Queues new ruleset(s) that activate when current ends

Decoding Hook Metadata

Hook metadata is ABI-encoded. Common patterns:

Buyback Hook Metadata

// Encode
bytes memory metadata = abi.encode(amountToSwapWith, minimumSwapAmountOut);

// Decode
(uint256 amountToSwapWith, uint256 minimumSwapAmountOut) = abi.decode(metadata, (uint256, uint256));

721 Hook Metadata

// Encode tier IDs to mint
bytes memory metadata = abi.encode(tierIds);

// Decode
uint256[] memory tierIds = abi.decode(metadata, (uint256[]));

Generation Guidelines

  1. Identify the contract from the to address
  2. Extract function selector (first 4 bytes)
  3. Decode parameters using the appropriate ABI
  4. Explain the effect in plain language
  5. Decode nested metadata if present

Example Prompts

  • "What does this transaction do? 0x..."
  • "Decode this calldata for JBMultiTerminal"
  • "Explain what happened in transaction 0xabc..."
  • "What parameters were used in this pay() call?"

seedream-image-gen

openclaw

Generate images via Seedream API (doubao-seedream models). Synchronous generation.

2359

ffmpeg-cli

openclaw

Comprehensive video/audio processing with FFmpeg. Use for: (1) Video transcoding and format conversion, (2) Cutting and merging clips, (3) Audio extraction and manipulation, (4) Thumbnail and GIF generation, (5) Resolution scaling and quality adjustment, (6) Adding subtitles or watermarks, (7) Speed adjustment (slow/fast motion), (8) Color correction and filters.

6723

context-optimizer

openclaw

Advanced context management with auto-compaction and dynamic context optimization for DeepSeek's 64k context window. Features intelligent compaction (merging, summarizing, extracting), query-aware relevance scoring, and hierarchical memory system with context archive. Logs optimization events to chat.

3722

a-stock-analysis

openclaw

A股实时行情与分时量能分析。获取沪深股票实时价格、涨跌、成交量,分析分时量能分布(早盘/尾盘放量)、主力动向(抢筹/出货信号)、涨停封单。支持持仓管理和盈亏分析。Use when: (1) 查询A股实时行情, (2) 分析主力资金动向, (3) 查看分时成交量分布, (4) 管理股票持仓, (5) 分析持仓盈亏。

9221

himalaya

openclaw

CLI to manage emails via IMAP/SMTP. Use `himalaya` to list, read, write, reply, forward, search, and organize emails from the terminal. Supports multiple accounts and message composition with MML (MIME Meta Language).

7921

garmin-connect

openclaw

Syncs daily health and fitness data from Garmin Connect into markdown files. Provides sleep, activity, heart rate, stress, body battery, HRV, SpO2, and weight data.

7321

You might also like

flutter-development

aj-geddes

Build beautiful cross-platform mobile apps with Flutter and Dart. Covers widgets, state management with Provider/BLoC, navigation, API integration, and material design.

644969

drawio-diagrams-enhanced

jgtolentino

Create professional draw.io (diagrams.net) diagrams in XML format (.drawio files) with integrated PMP/PMBOK methodologies, extensive visual asset libraries, and industry-standard professional templates. Use this skill when users ask to create flowcharts, swimlane diagrams, cross-functional flowcharts, org charts, network diagrams, UML diagrams, BPMN, project management diagrams (WBS, Gantt, PERT, RACI), risk matrices, stakeholder maps, or any other visual diagram in draw.io format. This skill includes access to custom shape libraries for icons, clipart, and professional symbols.

593705

ui-ux-pro-max

nextlevelbuilder

"UI/UX design intelligence. 50 styles, 21 palettes, 50 font pairings, 20 charts, 8 stacks (React, Next.js, Vue, Svelte, SwiftUI, React Native, Flutter, Tailwind). Actions: plan, build, create, design, implement, review, fix, improve, optimize, enhance, refactor, check UI/UX code. Projects: website, landing page, dashboard, admin panel, e-commerce, SaaS, portfolio, blog, mobile app, .html, .tsx, .vue, .svelte. Elements: button, modal, navbar, sidebar, card, table, form, chart. Styles: glassmorphism, claymorphism, minimalism, brutalism, neumorphism, bento grid, dark mode, responsive, skeuomorphism, flat design. Topics: color palette, accessibility, animation, layout, typography, font pairing, spacing, hover, shadow, gradient."

319400

godot

bfollington

This skill should be used when working on Godot Engine projects. It provides specialized knowledge of Godot's file formats (.gd, .tscn, .tres), architecture patterns (component-based, signal-driven, resource-based), common pitfalls, validation tools, code templates, and CLI workflows. The `godot` command is available for running the game, validating scripts, importing resources, and exporting builds. Use this skill for tasks involving Godot game development, debugging scene/resource files, implementing game systems, or creating new Godot components.

341398

nano-banana-pro

garg-aayush

Generate and edit images using Google's Nano Banana Pro (Gemini 3 Pro Image) API. Use when the user asks to generate, create, edit, modify, change, alter, or update images. Also use when user references an existing image file and asks to modify it in any way (e.g., "modify this image", "change the background", "replace X with Y"). Supports both text-to-image generation and image-to-image editing with configurable resolution (1K default, 2K, or 4K for high resolution). DO NOT read the image file first - use this skill directly with the --input-image parameter.

454339

fastapi-templates

wshobson

Create production-ready FastAPI projects with async patterns, dependency injection, and comprehensive error handling. Use when building new FastAPI applications or setting up backend API projects.

304231

Stay ahead of the MCP ecosystem

Get weekly updates on new skills and servers.