Skip to content

Commit 2b12902

Browse files
committed
Check balance overflow
1 parent cfef5ca commit 2b12902

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

frame/evm/src/runner/stack.rs

+4-2
Original file line numberDiff line numberDiff line change
@@ -611,10 +611,12 @@ impl<'vicinity, 'config, T: Config> StackStateT<'config>
611611
T::Currency::transfer(
612612
&source,
613613
&target,
614-
value.low_u128().unique_saturated_into(),
614+
value
615+
.try_into()
616+
.map_err(|_| ExitError::OutOfFund)?,
615617
ExistenceRequirement::AllowDeath,
616618
)
617-
.map_err(|_| ExitError::OutOfFund)
619+
.map_err(|_| ExitError::OutOfFund)
618620
}
619621

620622
fn reset_balance(&mut self, _address: H160) {

0 commit comments

Comments
 (0)