How to add a custom precompile contract · Issue #280 · bluealloy/revm
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
- revm/documentation/src/crates/precompile.md at b7b92aee232558ea48e9580bfac74d442a17babd · bluealloy/revmgithub.com
- EVM Codesevm.codes
- solidity - Are there any examples of using precompiled contracts? - Ethereum Stack Exchangeethereum.stackexchange.com
- REVM Is All You Need. How to build simulated blockchain… | by Solid Quant | Mediummedium.com
- Blake2b F precompile by pdyraga · Pull Request #4 · keep-network/go-ethereumgithub.com
- revm/documentation/src/crates/precompile.md at b7b92aee232558ea48e9580bfac74d442a17babd · bluealloy/revm · GitHubgithub.com
- EVM Codes - Opcodesevm.codes
- GitHub - foundry-rs/forge-std: A collection of helpful contracts and libraries for use with Forge and Foundrygithub.com
- go-ethereum/core/vm/contracts.go at bd6879ac518431174a490ba42f7e6e822dcb3ee1 · ethereum/go-ethereum · GitHubgithub.com
- solidity - How to use Ethereum precompile bn256Pairing to check equality on symmetric groups? - Ethereum Stack Exchangeethereum.stackexchange.com
- Contract ABI Specification — Solidity 0.8.38-develop documentationdocs.soliditylang.org
- Introduction to Smart Contracts — Solidity 0.8.38-develop documentationdocs.soliditylang.org