flâneur

How to add a custom precompile contract · Issue #280 · bluealloy/revm

github.com · 122 words · saved by 1 readers

The text was updated successfully, but these errors were encountered: You can create your own EVMImpl and add your set of precompiles: Here it is how it is done inside revm. revm/crates/revm/src/evm.rs Lines 143 to 148 in 98baddd Sorry, something went wrong. should we write the Avax, Arbitrum, Celo and Binance precompiles, and expose them behind a feature flag? Sorry, something went wrong. As suggested by @gakonst, I'm moving the conversation re "Celo x Foundry" integration from here: @gakonst had a question which I'm copying here for future reference: Most of these precompiles are stateful, so would like to understand how you are thinking about introducing that state, e.g. https://github.com/bluealloy/revm/blob/main/crates/revm_precompiles/src/lib.rs#L58 @palango (from Celo blockchain team) will be the best placed to answer this and other integration questions. Sorry, something went wrong. To follow-up, I'm happy to help with the impleme

There was a idea to have CustomPrecompiles that would take EVM state and allow any kind of modification as the interpreter has. It was here: pub type StandardPrecompileFn = fn(&[u8], u64) -> PrecompileResult; pub type CustomPrecompileFn = fn(&[u8], u64) -> PrecompileResult; But I feel this approach is lacking and CustomPrecompile need to be specified inside revm crate and not inside revm_precompiles as dependency on revm internals is only possible in that way. The stateful thing can be done through Database, as CustomPrecompile should take something similar (or same) as Inspector is…

saved by

related reading