Adding a Precompile | Optimism Docs
OP Stack Hacks are explicitly things that you can do with the OP Stack that are not currently intended for production use. OP Stack Hacks are not for the faint of heart. You will not be able to receive significant developer support for OP Stack Hacks — be prepared to get your hands dirty and to work without support. One possible use of OP Stack is to run an EVM with a new precompile for operations to speed up calculations that are not currently supported. In this tutorial, you'll make a simple precompile that returns a constant value if it's called with four or less bytes, or an error if it is called with more than that. To create a new precompile, the file to modify is op-geth/core/vm/contracts.go (opens in a new tab) . add a structure named after your new precompile, and use an address that is unlikely to ever clash with a standard precompile (0x100, for example): This is the precompile interface definition: It means that for every precompile you need two functions: For every fork th
Explore this link on the map →