Function balance_to_evm_value

Source
pub fn balance_to_evm_value<R>(
    value: <<R as Config>::Currency as Inspect<AccountIdFor<R>>>::Balance,
) -> U256
where R: Config, <<R as Config>::Currency as Inspect<AccountIdFor<R>>>::Balance: Into<U256>, U256: From<u32>,
Expand description

Converts from the generic Balance type to the Ethereum native U256.

ยงDeveloper Note

pallet-revive uses both types, hence we have to convert in between them for certain functions. Notice that precision loss might occur when converting the other way (from U256 to Balance).

See https://github.com/paritytech/polkadot-sdk/pull/9101 for more details.