Developer Help & Trust Center

Operational playbooks, reconciliation guides, and policy docs

Trust

Audits, invariants, and SLAs

Audit posture, enforced safety properties, pause/drain plan, ownership controls, and support targets.

Pricing

Fees & gas sponsorship

Platform fee structure, minimums, batching coverage, and our Base gas sponsorship policy.

Charge event basics

The BillingModule emits a Charge event every time a customer is billed. Each event includes:

  • account: the customer smart account.
  • merchant: your receiving address.
  • amount: USDC amount in token units.
  • usageId: the unique 32-byte identifier Drip derives per usage event.
  • timestamp: emitted block timestamp.

Event topic (for log filters): 0x47c57412f9a6e6a175c6c8b61cf7256cab2f39c16b0f229b7d6862a5eecefe33

Query on Base with Basescan

  1. Open basescan.org and navigate to your BillingModule contract.
  2. Go to the "Events" tab and filter by the Charge event.
  3. Use the "Filter by Topic" box with topic0 set to 0x47c57412f9a6e6a175c6c8b61cf7256cab2f39c16b0f229b7d6862a5eecefe33 to only see Charge logs.
  4. Download the CSV from Basescan to get txHash, blockNumber, and the usageId field.

Tip: you can also copy the JSON-RPC log filter and run it from your scripts if you prefer code.

Query programmatically

You can pull Charge events directly from a Base RPC using your favorite library. Below is an example with viem:

import { createPublicClient, http } from 'viem';
import { base } from 'viem/chains';

const client = createPublicClient({ chain: base, transport: http(process.env.BASE_RPC_URL!) });

const logs = await client.getLogs({
  address: process.env.BILLING_MODULE_ADDRESS as `0x${string}`,
  fromBlock: 0n,
  event: {
    type: 'event',
    name: 'Charge',
    inputs: [
      { name: 'account', type: 'address', indexed: true },
      { name: 'merchant', type: 'address', indexed: true },
      { name: 'amount', type: 'uint256', indexed: false },
      { name: 'usageId', type: 'bytes32', indexed: true },
      { name: 'timestamp', type: 'uint256', indexed: false },
    ],
  },
});

console.log(logs[0].transactionHash, logs[0].args.usageId);

Reconcile with dashboard exports

The dashboard export (/v1/charges/export?format=csv) includes usageId, txHash, and blockNumber. To reconcile:

  1. Export charges from the dashboard or call the API endpoint for CSV/JSON.
  2. Fetch on-chain Charge events (Basescan CSV or RPC logs) and sort by usageId.
  3. Match rows on usageId; txHash and blockNumber should align between the on-chain log and the export.
  4. Investigate any missing usageIds to spot pending/failed charges.

If you are using batching, multiple usageIds can share the same txHash. Block numbers still map to the block where the batch was settled.