Events and settlementLink to this section
TL;DRLink to this section
- Events record settlement, reward funding, claims and ownership changes.
- Decode them with the ABI active at that Ethereum block; Mining5 event fields differ from Mining4.
- Store block hashes and log order so you can undo changes from blocks removed by a reorg.
Before you startLink to this section
Verify the contract addresses and code using Read contracts. Start from the deployment block in a verified deployment record, not a guessed address or height.
Core and Mining emit application events at their proxy addresses. Token and NFT emit events at their immutable direct deployments; track proxy upgrade logs alongside them.
StepsLink to this section
- Fetch logs in bounded Ethereum block ranges for the verified addresses. Include
Coresettlement,Miningaccounting,Tokentransfers and attribution, NFT transfers and proxy upgrades. - Persist raw logs with chain ID, block number/hash, transaction hash/index and log index. Use
(chainId, blockHash, transactionHash, logIndex)as an occurrence identity. - Process logs in Ethereum block, transaction index and log index order. Do not sort by
Coreround alone: one transaction can change several contracts. - Apply only committed transaction logs and use the source-specific event layouts. Keep pending head data separate from confirmation-safe public state.
- On a block-hash mismatch, roll back to a common ancestor and replay. Deduplicating log IDs without rolling back derived state is insufficient.
- After an upgrade, verify the new implementation before using its ABI. Stop indexing that contract if its code or storage layout is unknown; do not keep using the old ABI.
Decode a Mining5 checkpointLink to this section
This snippet decodes a raw log already filtered to the verified Mining proxy. It does not fetch or imply a live event.
import { decodeEventLog, parseAbi } from "viem";
const abi = parseAbi([
"event CheckpointAdvanced(uint64 finalizedThroughRound, uint64 mintedThroughBlock, uint64 lastActivationRound, uint256 minted, uint256 totalWeight, uint256 rewardIndex)",
]);
const decoded = decodeEventLog({
abi,
data: log.data,
topics: log.topics,
strict: true,
});
if (decoded.eventName === "CheckpointAdvanced") {
console.log(decoded.args);
}
Use the complete pinned ABI for the rest of the graph. Strict decoding does not replace the address, runtime or version checks.
Expected resultLink to this section
| Event | Projection effect |
|---|---|
Core RoundRecorded |
Active round work, cumulative work and completed Core block height |
Core BatchSettled |
Last certified round, including omitted zero-work rounds |
Mining PositionRegistered |
Level 1 pending mining power, activation round and cooldown |
Mining WeightActivated |
Total active mining power and reward index at activation |
Mining RoundFunded |
Round funding, completed blocks and applied multiplier |
Mining CheckpointAdvanced |
Last processed round/block, total mining power, reward index and lifetime minted amount |
Mining PositionsMerged |
Survivor's active/pending mining power and scaled credit; donor removed |
Mining RewardsClaimed |
Owner payout, selected IDs and scaled remainder on first ID |
NFT Transfer |
Ownership change, mint or authorized merge burn |
Token RoundMinted and Transfer |
Per-round amounts followed by their combined mint to Mining |
Core settles work before Mining funds rewards. Rounds with no active mining power or no completed Squeek blocks receive zero rewards; checkpoints also process certified empty spans without emitting an event for every omitted round.
Common failuresLink to this section
- Reusing a Mining4 ABI rejects or misinterprets Mining5 event fields.
- Counting both
RoundMintedattribution and aggregate ERC-20 mint as separate issuance doubles supply. - Crediting pending weight before
WeightActivatedpays it too early. - Treating
CoredataHashas the raw telemetry payload loses the distinction between a commitment and retained evidence. - Treating a receipt at head as permanently safe ignores reorgs.
Verify the resultLink to this section
At the same canonical Ethereum block, compare derived totals with Core state(), Mining state() and accounting(), Token totalSupply() and NFT ownership. Check minted - paid == trackedCustody; donations can make actual custody larger.
Keep an implementation history alongside event history. The events and errors reference identifies source declarations and inherited standards for exhaustive decoding.
SourceLink to this section
Mining5 source specification e0617449. First-party source is private; see source and release scope.