forgenie / diamond-foundry

A modern framework for creating EIP2535 Diamonds 💎

Home Page:https://docs.forgenie.com

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

OZ-like `EnumerableBytes4Set`

urataps opened this issue · comments

We need to implement a library for EnumerableBytes4Set similar to OZ EnumerableBytes32Set where we can store 8 selectors in one storage slot.

Trade-off of two possible implementations:

  • storing bytes4[] consumes more gas on adding
  • storing 8 selectors in one bytes32 requires storing length separately.