Skip to main content

History

View transaction history and card provenance.


Overview

The History feature provides transparency into all activity on the platform. Every mint, transfer, and trade is permanently recorded on-chain.


Event Types

CardMinted

Emitted when a new card is created.

FieldDescription
ownerAddress that minted the card
tokenIdUnique identifier
pokemonIdPokemon species (1-151)
rarityTierRarity level (1-4)

CardTransferred

Emitted when a card changes owners.

FieldDescription
tokenIdCard being transferred
fromPrevious owner
toNew owner

CardLocked

Emitted when a card's lock period starts.

FieldDescription
tokenIdCard being locked
untilTimestamp when lock expires

TradeCreated

Emitted when a trade offer is created.

FieldDescription
offerIdUnique offer identifier
makerAddress creating the offer
makerTokenIdCard being offered
takerTokenIdCard requested

TradeAccepted

Emitted when a trade completes.

FieldDescription
offerIdOffer that was accepted
takerAddress accepting the offer
makerOriginal offer creator

TradeCancelled

Emitted when an offer is cancelled.

FieldDescription
offerIdCancelled offer ID

Provenance Tracking

What is Provenance?

Provenance is the complete ownership history of a card. Like art authentication, it proves:

  • Who minted the card
  • Every subsequent owner
  • When each transfer happened

On-Chain Storage

The PokemonCards contract stores previous owners:

mapping(uint256 => address[]) private _previousOwners;

Query with:

function getPreviousOwners(uint256 tokenId)
external view returns (address[] memory)

Why Provenance Matters

  • Authenticity - Verify the card's origin
  • History - See its journey through collectors
  • Value - Provenance can add collector value
  • Transparency - No hidden ownership changes

Viewing History

Your Activity

See your personal history:

  • Cards you've minted
  • Trades you've created
  • Trades you've accepted
  • Cards you've received/sent

Card History

Click any card to see its complete history:

  • Minting event
  • All transfers with timestamps
  • Lock events
  • Trade events (if traded via marketplace)

Global Activity

View platform-wide recent activity:

  • Latest mints
  • Recent trades
  • New offers

Verifying On-Chain

All events can be verified on Etherscan:

  1. Go to sepolia.etherscan.io
  2. Search for contract address
  3. Click "Events" tab
  4. Filter by event type

This provides independent verification outside of 5BLOCK.


Data Retention

Permanent Storage

Blockchain data is permanent:

  • Events are stored forever
  • Previous owners list grows with each transfer
  • No data can be deleted or modified

Scalability Note

The getPreviousOwners() function returns all owners. For cards with many transfers, this could be gas-intensive to query. Consider pagination for production use.


Technical Details

Querying Events

Events are indexed for efficient querying:

// Example: Get all CardMinted events for an address
const filter = pokemonCards.filters.CardMinted(ownerAddress);
const events = await pokemonCards.queryFilter(filter);

Block Timestamps

Each event includes the block timestamp, providing an immutable record of when it occurred.