Labels: medium-difficulty, solidity, bitmaps, gasguard
Difficulty: Medium
Module: contracts/data/
🧠 Concept
Replace standard mapping(uint256 => bool) or mapping(address => bool) structures with bitwise Bitmap libraries to store 256 boolean flags per storage slot.
⚠️ Problem
Using full 32-byte storage slots to track single boolean states (20,000 gas per new slot) creates excessive storage bloat.
📁 Implementation Scope
contracts/data/BitmapTracker.sol
test/data/BitmapTracker.test.ts
🛠️ Requirements
- Integrate OpenZeppelin
BitMaps.sol or custom Yul bit-shift operations.
- Store operational flags, processed nonces, and user claims using bitmap offset indexes.
- Provide
isSet(uint256 index) and set(uint256 index) helper routines.
🎯 Acceptance Criteria
Labels:
medium-difficulty,solidity,bitmaps,gasguardDifficulty: Medium
Module:
contracts/data/🧠 Concept
Replace standard
mapping(uint256 => bool)ormapping(address => bool)structures with bitwiseBitmaplibraries to store 256 boolean flags per storage slot.Using full 32-byte storage slots to track single boolean states (
20,000 gasper new slot) creates excessive storage bloat.📁 Implementation Scope
contracts/data/BitmapTracker.soltest/data/BitmapTracker.test.ts🛠️ Requirements
BitMaps.solor custom Yul bit-shift operations.isSet(uint256 index)andset(uint256 index)helper routines.🎯 Acceptance Criteria