PhEVM Precompiles
Overview of the precompiles made available for the Phylax Credible Layer
Overview
Precompiles are PhEVM(Phylax EVM) specific instructions that are implemented in native code instead of EVM bytecode. Precompiles additionally can communicate with Internal APIs. Currently the PhEVM supports all existing precompiles in Ethereum up to Dancun, and introduces a few new classes of precompiles:
- Manipulation of the PhEVM state
- Forking of the state of one or multiple EVM networks
- Utilities that make assertions more useful and easier to write
Precompile Interface
A list of available precompiles in Ajax as follows:
load
Loads a storage slot from an address.
mockCall
Mocks a call to an address, returning specified data.
Forking
forkPreState
Updates the currently active fork to the state before the transaction that triggered the assertion.
forkPostState
Updates the currently active fork to the state after the transaction that triggered the assertion.
getLogs
Gets all the logs that were emitted by the latest applied transaction.
getTransaction
Get the transaction that triggered the current assertion.
Implementation Notes
Precompiles are implemented in PhEVM. Assertions are able to call a pre-specified address or set of addresses that implement the interface described above.
Example usage, not finalized interface: