From fb45112566232d37793c5ecb03e2e0f63ebd5d20 Mon Sep 17 00:00:00 2001 From: notlesh Date: Mon, 26 Sep 2022 16:10:53 +0000 Subject: [PATCH] Use saturating_mul in fee() calculation --- src/executor/stack/executor.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/executor/stack/executor.rs b/src/executor/stack/executor.rs index a1fc1a619..eb4daf2a7 100644 --- a/src/executor/stack/executor.rs +++ b/src/executor/stack/executor.rs @@ -583,7 +583,7 @@ impl<'config, 'precompiles, S: StackState<'config>, P: PrecompileSet> /// Get fee needed for the current executor, given the price. pub fn fee(&self, price: U256) -> U256 { let used_gas = self.used_gas(); - U256::from(used_gas) * price + U256::from(used_gas).saturating_mul(price) } /// Get account nonce.