Index of every page on this site: llms.txt
All skills
Run it yourself

Verify on-chain Doppler behavior with cast, viem, RPC, and explorers for dynamic auctions, multicurve launches, hook initializer state, and migration flows.

Use this Skill: https://skilld.dev/gh/whetstoneresearch/doppler-skills/verification

Nothing lands on disk. Nothing to clean up.

Fork this Skill

Edit a local copy. It keeps the author and licence.

referencesCAST.md

≈1.7k tokens on demand. Your agent reads this file only when SKILL.md points to it.

Cast Commands

Foundry's cast CLI for quick on-chain reads. Best for single-value queries and rapid debugging.

Setup

# Install Foundry (if not installed)
curl -L https://foundry.paradigm.xyz | bash
foundryup

# Set RPC endpoint
export ETH_RPC_URL="https://eth-mainnet.g.alchemy.com/v2/YOUR_KEY"

Basic Patterns

Read View Functions

# Generic pattern
cast call <CONTRACT> "functionName(args)(returnType)" [ARGS...] --rpc-url $ETH_RPC_URL

# With environment variable for RPC (recommended)
cast call $CONTRACT "balanceOf(address)(uint256)" $WALLET

Read Storage Slots

# Direct slot read
cast storage <CONTRACT> <SLOT_NUMBER>

# Example: slot 0
cast storage $CONTRACT 0

Decode Hex Values

cast --to-dec 0x1234      # Hex to decimal
cast --to-int256 0xff...   # Hex to signed int256
cast --from-wei 1000000000000000000  # Wei to ether

Doppler V4 Dynamic Auction

Read Configuration

# Token ordering
cast call $HOOK "isToken0()(bool)"

# Tick bounds
cast call $HOOK "startingTick()(int24)"
cast call $HOOK "endingTick()(int24)"

# Dynamic auction parameter
cast call $HOOK "gamma()(int24)"

# Time bounds
cast call $HOOK "startingTime()(uint256)"
cast call $HOOK "endingTime()(uint256)"
cast call $HOOK "epochLength()(uint256)"

# Sale parameters
cast call $HOOK "numTokensToSell()(uint256)"
cast call $HOOK "minimumProceeds()(uint256)"
cast call $HOOK "maximumProceeds()(uint256)"

# Terminal states
cast call $HOOK "earlyExit()(bool)"
cast call $HOOK "insufficientProceeds()(bool)"

Read State

# Full state struct
cast call $HOOK "state()(uint40,int256,uint256,uint256,uint256,int128,int128)"

# Returns:
# [0] lastEpoch (uint40)
# [1] tickAccumulator (int256)
# [2] totalTokensSold (uint256)
# [3] totalProceeds (uint256)
# [4] totalTokensSoldLastEpoch (uint256)
# [5] feesAccrued.amount0 (int128)
# [6] feesAccrued.amount1 (int128)

Read Computed Values

# Current epoch number
cast call $HOOK "getCurrentEpoch()(uint256)"

# Normalized time elapsed (0 to WAD)
cast call $HOOK "getNormalizedTimeElapsed(uint256)(uint256)" $(date +%s)

# Expected tokens sold (linear schedule)
cast call $HOOK "getExpectedAmountSold()(uint256)"

# Max tick change per epoch
cast call $HOOK "getMaxTickDeltaPerEpoch()(int256)"

# Current tick range from accumulator
cast call $HOOK "getTicksBasedOnState(int256,int24)(int24,int24)" $ACCUMULATOR $TICK_SPACING

Read Positions

# Position struct: (tickLower, tickUpper, liquidity, salt)

# Lower slug (redemption)
cast call $HOOK "positions(bytes32)(int24,int24,uint128,uint8)" 0x0000000000000000000000000000000000000000000000000000000000000001

# Upper slug (current sales)
cast call $HOOK "positions(bytes32)(int24,int24,uint128,uint8)" 0x0000000000000000000000000000000000000000000000000000000000000002

# Price discovery slug 0
cast call $HOOK "positions(bytes32)(int24,int24,uint128,uint8)" 0x0000000000000000000000000000000000000000000000000000000000000003

# Number of PD slugs
cast call $HOOK "getNumPDSlugs()(uint256)"

Doppler V3 Static Auction

Read Initializer State

# Get pool state from initializer
cast call $INITIALIZER "getState(address)(address,address,int24,int24,uint16,bool,bool,uint256,uint256)" $POOL

# Returns:
# [0] token0
# [1] token1
# [2] tickLower
# [3] tickUpper
# [4] fee (in bps)
# [5] isToken0
# [6] isInitialized
# [7] maxShareToBeSold
# [8] maxShareToBond

Uniswap Pool Queries

V3 Pool slot0

cast call $POOL "slot0()(uint160,int24,uint16,uint16,uint16,uint8,bool)"

# Returns:
# [0] sqrtPriceX96 (uint160)
# [1] tick (int24)
# [2] observationIndex
# [3] observationCardinality
# [4] observationCardinalityNext
# [5] feeProtocol
# [6] unlocked

Pool Liquidity

cast call $POOL "liquidity()(uint128)"

Pool Tokens

cast call $POOL "token0()(address)"
cast call $POOL "token1()(address)"
cast call $POOL "fee()(uint24)"

Block-Specific Queries

# Read state at specific block
cast call $HOOK "state()" --block 18500000

# Get block timestamp
cast block 18500000 --field timestamp

# Get current block
cast block-number

Transaction Analysis

Decode Calldata

# Get function selector
cast sig "swap(address,bool,int256,uint160,bytes)"

# Decode calldata
cast calldata-decode "swap(address,bool,int256,uint160,bytes)" 0x...

# 4byte lookup
cast 4byte 0x128acb08

Inspect Transaction

# Transaction details
cast tx 0xTX_HASH

# Specific fields
cast tx 0xTX_HASH --field input    # Calldata
cast tx 0xTX_HASH --field value    # ETH sent
cast tx 0xTX_HASH --field gasPrice

# Receipt with logs
cast receipt 0xTX_HASH

Common Verification Commands

Check Auction Progress

# Quick status check
echo "Epoch: $(cast call $HOOK 'getCurrentEpoch()(uint256)')"
echo "Sold: $(cast call $HOOK 'state()' | sed -n '3p') / $(cast call $HOOK 'numTokensToSell()(uint256)')"
echo "Proceeds: $(cast call $HOOK 'state()' | sed -n '4p')"
echo "Early Exit: $(cast call $HOOK 'earlyExit()(bool)')"
echo "Insufficient: $(cast call $HOOK 'insufficientProceeds()(bool)')"

Check Migration Readiness

# Can migrate if:
# - earlyExit == true, OR
# - block.timestamp >= endingTime AND totalProceeds >= minimumProceeds

EARLY_EXIT=$(cast call $HOOK "earlyExit()(bool)")
INSUFFICIENT=$(cast call $HOOK "insufficientProceeds()(bool)")
ENDING_TIME=$(cast call $HOOK "endingTime()(uint256)")
MIN_PROCEEDS=$(cast call $HOOK "minimumProceeds()(uint256)")
PROCEEDS=$(cast call $HOOK "state()" | sed -n '4p')

echo "Early Exit: $EARLY_EXIT"
echo "Insufficient Proceeds: $INSUFFICIENT"
echo "Ending Time: $ENDING_TIME (now: $(date +%s))"
echo "Proceeds: $PROCEEDS / Min: $MIN_PROCEEDS"

Verify Tick Alignment

# Get current tick and tick spacing
TICK=$(cast call $POOL "slot0()" | sed -n '2p')
TICK_SPACING=$(cast call $HOOK "tickSpacing()(int24)" 2>/dev/null || echo "Check pool for spacing")

# Tick should be divisible by spacing
echo "Tick: $TICK"
echo "Spacing: $TICK_SPACING"
# Aligned if: tick % tickSpacing == 0

Event Topic Hashes

Use these to filter logs:

# Compute event signatures
cast sig-event "Rebalance(int24,int24,int24,uint256)"
# 0x...

cast sig-event "Swap(int24,uint256,uint256)"
# 0x...

cast sig-event "EarlyExit(uint256)"
# 0x...

cast sig-event "InsufficientProceeds()"
# 0x...

Tips

  1. Use --rpc-url or ETH_RPC_URL - Don't hardcode RPC endpoints
  2. Pipe to sed or awk for extracting specific return values
  3. Use --block for historical queries (requires archive node)
  4. Check cast --help for more options
  5. Use cast abi-encode to construct calldata for complex args

Source: SKILL.md on GitHub

No rule matched.

skilld matched fixed text patterns in SKILL.md and file names. Patterns miss obfuscated code.

skilld run checks every file with the same patterns. It asks for approval before it loads a Skill with a behavior marked Needs approval.

1 warning2mo5 checks · Risk SAFE
  • Gen Agent Trust Hub2mo

    The skill provides on-chain verification documentation and scripts using standard ecosystem tools such as Foundry cast, viem, and Ethereum RPC nodes. It includes standard installation instructions for Foundry from its well-known repository.

  • Socket2mo

    No alerts

  • Snyk2mo

    Risk: LOW · No issues

  • Runlayer8mo

    2/5 files flagged

  • ZeroLeaks7mo

    Score: 93/100 · 2 sections analyzed

Signed by skilld at 4f654fe. This ties the file your Agent reads to that commit on GitHub. It does not review the instructions.

Last checked against GitHub 2 months ago.

Steadyupdated 9 months ago
metadata
{
  "author": "doppler",
  "version": "2.0"
}

README badge

README badge for whetstoneresearch/doppler-skills/verification