Labels: medium-difficulty, solidity, events, gasguard
Difficulty: Medium
Module: contracts/events/
🧠 Concept
Compress multiple discrete operational parameters into bit-packed bytes32 values before emitting event logs.
⚠️ Problem
Emitting events with many un-indexed data parameters increases calldata encoding gas and event logging costs ($375\text{ gas}$ per topic + $8\text{ gas}$ per byte of data).
📁 Implementation Scope
contracts/events/CompressedLogger.sol
test/events/CompressedLogger.test.ts
🛠️ Requirements
- Pack
uint64 timestamp, uint32 categoryId, address user, and uint64 amount into a single 256-bit word.
- Emit custom single-topic log event containing packed word data.
- Provide off-chain TypeScript parsing utilities to unpack emitted logs.
🎯 Acceptance Criteria
Labels:
medium-difficulty,solidity,events,gasguardDifficulty: Medium
Module:
contracts/events/🧠 Concept
Compress multiple discrete operational parameters into bit-packed
bytes32values before emitting event logs.Emitting events with many un-indexed data parameters increases calldata encoding gas and event logging costs ($375\text{ gas}$ per topic + $8\text{ gas}$ per byte of data).
📁 Implementation Scope
contracts/events/CompressedLogger.soltest/events/CompressedLogger.test.ts🛠️ Requirements
uint64 timestamp,uint32 categoryId,address user, anduint64 amountinto a single 256-bit word.🎯 Acceptance Criteria