Labels: medium-difficulty, yul, cryptography, gasguard
Difficulty: Medium
Module: contracts/crypto/
🧠 Concept
Build a Yul-based EIP-712 domain separator and struct hash evaluator that computes typed message digests with minimal memory allocations.
⚠️ Problem
Standard EIP-712 implementations execute multiple abi.encode steps, generating redundant memory allocations for every field in the typed struct.
📁 Implementation Scope
contracts/crypto/YulEIP712.sol
test/crypto/YulEIP712.test.ts
🛠️ Requirements
- Cache pre-computed
TYPEHASH constants in immutable bytecode storage.
- Construct EIP-712 struct payload in scratch space and execute single-pass hashing.
- Compute final
_hashTypedDataV4 digest via inline Yul.
🎯 Acceptance Criteria
Labels:
medium-difficulty,yul,cryptography,gasguardDifficulty: Medium
Module:
contracts/crypto/🧠 Concept
Build a Yul-based EIP-712 domain separator and struct hash evaluator that computes typed message digests with minimal memory allocations.
Standard EIP-712 implementations execute multiple
abi.encodesteps, generating redundant memory allocations for every field in the typed struct.📁 Implementation Scope
contracts/crypto/YulEIP712.soltest/crypto/YulEIP712.test.ts🛠️ Requirements
TYPEHASHconstants in immutable bytecode storage._hashTypedDataV4digest via inline Yul.🎯 Acceptance Criteria