Skip to content
This repository has been archived by the owner on Jul 5, 2024. It is now read-only.

Commit

Permalink
allow running evm without precompiles in wasm
Browse files Browse the repository at this point in the history
Co-authored-by: adria0 <adria0@nowhere>
  • Loading branch information
zemse and adria0 committed Jan 19, 2024
1 parent c2058c6 commit bba44eb
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions bus-mapping/src/precompile.rs
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,12 @@ use revm_precompile::{Precompile, PrecompileError, Precompiles};
/// Check if address is a precompiled or not.
pub fn is_precompiled(address: &Address) -> bool {
#[cfg(target_arch = "wasm32")]
unreachable!();
if address.0[0..19] == [0u8; 19] && (1..=9).contains(&address.0[19]) {
// TODO add support for precompiles in WASM
panic!("Precompile {address} is currently not supported in WASM");
} else {
return false;
}

#[cfg(not(target_arch = "wasm32"))]
Precompiles::berlin()
Expand All @@ -26,7 +31,8 @@ pub(crate) fn execute_precompiled(
gas: u64,
) -> (Vec<u8>, u64, bool) {
#[cfg(target_arch = "wasm32")]
unreachable!();
// TODO add support for precompiles in WASM
panic!("Running precompile {address} is currently not supported in WASM");

#[cfg(not(target_arch = "wasm32"))]
{
Expand Down

0 comments on commit bba44eb

Please sign in to comment.