hashtagget_deposit_count

Read the total number of validator deposits from the deposit contract

Read the total number of validator deposits that have been made to the Seismic deposit contract. This count is used by the consensus layer to track deposit history.


Overview

The Seismic deposit contract maintains a counter that increments with each validator deposit. This counter is used by the consensus layer to:

  • Track the total number of deposits

  • Verify deposit indices

  • Coordinate deposit processing

This method queries the current count.


Signatures

Sync
Async

Parameters

Parameter
Type
Default
Description

address

str

Address of the deposit contract to query

The default address is the genesis deposit contract (DEPOSIT_CONTRACT_ADDRESS).


Returns

Type: int

The total number of deposits as a Python integer.


Examples

Sync Usage

Async Usage

With Wallet Client

Custom Contract Address

Monitoring New Deposits

Verifying Deposit

With Deposit Root


Implementation Details

Contract Call

This method calls the deposit contract's get_deposit_count() function:

The contract returns an 8-byte little-endian encoded integer. The SDK:

  1. Encodes the function call using the deposit contract ABI

  2. Calls eth_call to the deposit contract

  3. Extracts bytes 64-72 from the response (the 8-byte count)

  4. Decodes as a little-endian integer

  5. Returns as a Python int

Encoding Details

The on-chain value is stored as:

  • Format: 8-byte little-endian integer

  • Location: Bytes 64-72 of the contract response

  • Range: 0 to 2^64 - 1 (18,446,744,073,709,551,615)

The SDK handles the conversion automatically.

Genesis Contract

The default deposit contract address (DEPOSIT_CONTRACT_ADDRESS) is deployed at genesis on all Seismic networks.


Use Cases

Network Statistics

Track network growth by monitoring deposits:

Validator Onboarding

Check network size before deciding to become a validator:

Deposit Verification

Verify your deposit was included:

Rate Limiting

Implement rate limiting for deposit processing:


Notes

Public Method

get_deposit_count() is available on both:

  • Public clients (create_public_client) — Read-only, no private key

  • Wallet clients (create_wallet_client) — Full capabilities

Read-Only

This is a view function that does not modify state. It does not consume gas or require a transaction.

Monotonic Counter

The deposit count is monotonically increasing — it only goes up, never down. Each deposit increments the count by exactly 1.

Deposit Index

The deposit count also represents the next deposit index (0-indexed):

  • First deposit: index 0, count becomes 1

  • Second deposit: index 1, count becomes 2

  • Third deposit: index 2, count becomes 3


Error Handling


Performance

Caching

If you're querying the deposit count frequently, consider caching:


See Also

Last updated