Labels: high-difficulty, yul, precompiles, gasguard
Difficulty: High
Module: contracts/precompiles/
🧠 Concept
Construct a Yul proxy module that formats inputs and handles responses for native EVM precompiled contracts (ecrecover, sha256, modexp, bn256Pairing) with zero memory footprint expansion.
⚠️ Problem
High-level Solidity interactions with precompiled contracts introduce memory padding and type-casting overhead before executing the external precompile call.
📁 Implementation Scope
contracts/precompiles/PrecompileForwarder.sol
test/precompiles/PrecompileForwarder.test.ts
🛠️ Requirements
- Build specific Yul invocations for
modexp (0x05) and bn256Pairing (0x08).
- Write arguments directly into scratch space and invoke via
staticcall.
- Check returned status and copy result back to target execution stack.
🎯 Acceptance Criteria
Labels:
high-difficulty,yul,precompiles,gasguardDifficulty: High
Module:
contracts/precompiles/🧠 Concept
Construct a Yul proxy module that formats inputs and handles responses for native EVM precompiled contracts (
ecrecover,sha256,modexp,bn256Pairing) with zero memory footprint expansion.High-level Solidity interactions with precompiled contracts introduce memory padding and type-casting overhead before executing the external precompile call.
📁 Implementation Scope
contracts/precompiles/PrecompileForwarder.soltest/precompiles/PrecompileForwarder.test.ts🛠️ Requirements
modexp(0x05) andbn256Pairing(0x08).staticcall.🎯 Acceptance Criteria
0x01through0x09).