From 8deac3a71e10ab978748702086fce86ac3ab7d70 Mon Sep 17 00:00:00 2001 From: Roshan <48975233+pythonberg1997@users.noreply.github.com> Date: Fri, 16 Aug 2024 19:36:34 +0800 Subject: [PATCH] fix: add system transaction check in `collect_system_reward` (#63) --- crates/revm/src/bsc/handler_register.rs | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/crates/revm/src/bsc/handler_register.rs b/crates/revm/src/bsc/handler_register.rs index 6975a970..4fdbdcc7 100644 --- a/crates/revm/src/bsc/handler_register.rs +++ b/crates/revm/src/bsc/handler_register.rs @@ -64,6 +64,17 @@ pub fn collect_system_reward( context: &mut Context, gas: &Gas, ) -> Result<(), EVMError> { + if context + .evm + .env + .tx + .bsc + .is_system_transaction + .unwrap_or(false) + { + return Ok(()); + } + let effective_gas_price = context.evm.env.effective_gas_price(); let mut tx_fee = U256::from(gas.spent() - gas.refunded() as u64) * effective_gas_price;