Skip to main content

Indexers & explorers

This page covers indexing Secure Lock locks and points to the references for launchpad activity. The contract details are in Secure Lock and events and data.

Data sources​

On-chain​

  • Secure Lock: the CheeseLock contract at 0x1E7826b7E3244aDB5e137A5F1CE49095f6857140 on BNB Smart Chain (56), Robinhood Chain (4663), Arc (5042), BNB Smart Chain Testnet (97), and Arc Testnet (5042002). The Secure Lock page lists the deployment block to start from on each chain.
  • Launchpad: one launchpad contract per chain, emitting every pool, microsale, and Melt Pool event. Addresses are in launchpad integration.
  • Vaults: each vault emits its own events; see events and data.

Off-chain (optional)​

  • Project metadata: the poolDetails field of the API responses, a JSON string with the project's title, logo, links, and description.
  • Indexed data: the CheesePad API serves the same data CheesePad's own indexers store, including locks (GET /lockers). Use it to backfill or cross-check, not as the source of truth.

Indexing Secure Lock​

Discovering locks​

  • Watch LockAdded, or poll getTotalLockCount() and read each new index with getLockAt(i). The CheesePad indexer polls: it catches locks even if it misses a log.
  • Key each lock by chain ID, locker address, and the lock's id. On BNB Smart Chain Testnet, IDs start at 1000000; elsewhere they start at 0.

Following changes​

Apply these events to the stored lock:

EventIndexedWhat to do
LockUpdated(id, token, owner, newAmount, newUnlockDate)idset the amount and tgeDate
LockRemoved(id, token, owner, amount, unlockedAt)idmark the lock fully unlocked
LockVested(id, token, owner, amount, remaining, timestamp)idadd amount to the unlocked total; set the remaining balance to remaining
LockOwnerChanged(lockId, owner, newOwner)nothingset the owner; newOwner == address(0) is a renounce
LockDescriptionChanged(lockId)nothingre-read the description with getLockById

LockOwnerChanged and LockDescriptionChanged have no indexed arguments: filter them by event topic and decode the lock ID from the data.

On a vesting lock's final claim, LockRemoved.amount is the lifetime total unlocked, and the claim itself is in the LockVested that follows. Do not add LockRemoved.amount to the unlocked total for a vesting lock.

Ordering and reconciliation​

  • Apply logs in order of block number, transaction index, and log index.
  • Skip any event that is not after the last one you applied for that lock, so re-scanning a block range is safe.
  • Re-read locks with getLockById(id) periodically, and after a reorg, instead of assuming your event history is complete.

Displaying locks​

  • Link the lock's creation transaction and the token or LP contract.
  • Show the schedule: a single unlock date for a normal lock, or the TGE share and cycle for a vesting lock.
  • Show both the remaining (locked) and the unlocked amounts, scaled by the token's decimals.
  • Show a lock whose owner is address(0) as permanently locked.
  • Use cumulativeLockInfo(token).factory != address(0) to label LP tokens.

Security notes​

  • Accept locks only from the CheeseLock address above, and launchpad events only from the launchpad addresses in these docs.
  • Anyone can lock any token. Check the token address, not its name or symbol, to avoid look-alike tokens.

Indexing launchpad activity​

To index pools, microsales, Melt Pools, and vaults, see events and data, which lists every event, struct, and view the launchpad exposes.