This Substreams package processes blockchain events from ERC-1155 gaming contracts on the Base Sepolia network. It extracts and classifies TransferSingle and TransferBatch events from gaming contracts, classifying them as mint, burn, transfer, stake, and unstake events.
Example Contracts:
0x30464983F177baa4dCAAb693E58ebDD1B9a785c5
0xd72E2341002Fb873c4E0cEE0Dc6078CAeA93793c
The package classifies events into the following categories:
mint
: New tokens created (from = 0x0, to = user)burn
: Tokens destroyed (from = user, to = 0x0)transfer
: Tokens moved between users (from = user, to = user)stake
: Tokens staked (from = 0x0, to = user)unstake
: Tokens unstaked (from = user, to = 0x0)transfer
: Staked tokens transferred (from = user, to = user)# Build the package
substreams build
# Run the map module
substreams run map_ngu_events \
--start-block=26954975 \
--stop-block=26954985
# Run from the published package
substreams run ngu_events_v1.0.0 map_ngu_events \
-e https://api.studio.thegraph.com/substreams/[PACKAGE_ID] \
--start-block=26954975 \
--stop-block=26954985
The package outputs NguEvents
protobuf messages containing:
message NguEvents {
repeated NguEvent events = 1;
uint64 total_count = 2;
uint64 first_block = 3;
uint64 last_block = 4;
}
message NguEvent {
string event_type = 1; // "mint", "burn", "transfer", "stake", "unstake"
uint64 block_number = 2;
string block_hash = 3;
string transaction_hash = 4;
uint64 transaction_index = 5;
uint64 log_index = 6;
uint64 timestamp = 7;
string contract_address = 8;
string contract_type = 9; // "NGU_GLYPH" or "NGU_STAKED"
EventData event_data = 10;
}
The package is configured to monitor these example contracts on Base Sepolia:
0x30464983F177baa4dCAAb693E58ebDD1B9a785c5
0xd72E2341002Fb873c4E0cEE0Dc6078CAeA93793c
This package is designed to work with:
# Install dependencies
cargo build --release --target wasm32-unknown-unknown
# Build Substreams package
substreams build
# Test with small block range
substreams run map_ngu_events \
--start-block=26954975 \
--stop-block=26954980
This package is designed for ERC-1155 gaming applications.
For issues or questions, please refer to the NumberGoUp documentation or create an issue in the repository.
substreams gui erc1155-gaming-events@v1.0.1 map_ngu_events
substreams gui erc1155-gaming-events@v1.0.1 store_event_counts
message
NguEvent
message
EventData
message
NguEventBlock
message
NguEvents
message
ContractConfig
message
MonitoringConfig
message
FileDescriptorSet
message
FileDescriptorProto
message
DescriptorProto
message
ExtensionRangeOptions
message
FieldDescriptorProto
message
OneofDescriptorProto
message
EnumDescriptorProto
message
EnumValueDescriptorProto
message
ServiceDescriptorProto
message
MethodDescriptorProto
message
FileOptions
message
MessageOptions
message
FieldOptions
message
OneofOptions
message
EnumOptions
message
EnumValueOptions
message
ServiceOptions
message
MethodOptions
message
UninterpretedOption
message
SourceCodeInfo
message
GeneratedCodeInfo
message
Any
message
Timestamp
message
Modules
message
Binary
message
Module
message
Package
message
NetworkParams
message
PackageMetadata
message
ModuleMetadata
message
Clock
message
BlockRef
message
Request
message
Response
message
BlockUndoSignal
message
BlockScopedData
message
SessionInit
message
InitialSnapshotComplete
message
InitialSnapshotData
message
MapModuleOutput
message
StoreModuleOutput
message
OutputDebugInfo
message
ModulesProgress
message
ProcessedBytes
message
Error
message
Job
message
Stage
message
ModuleStats
message
ExternalCallMetric
message
StoreDelta
message
BlockRange
message
DeployRequest
message
Parameter
message
DeployResponse
message
UpdateRequest
message
UpdateResponse
message
InfoRequest
message
InfoResponse
message
SinkProgress
message
PackageInfo
message
ListRequest
message
ListResponse
message
DeploymentWithStatus
message
RemoveRequest
message
RemoveResponse
message
PauseRequest
message
PauseResponse
message
StopRequest
message
StopResponse
message
ResumeRequest
message
ResumeResponse
enum
DeploymentStatus