0x65766D3A). So we perform
0xAF8536395A1EEC8EDA6FB9CF36739ECF75BECF6FEA04CEEC108BBB6AA15B7CB3, whose balance in the Balances module will be used for EVM-related operations.
Blake2, but the
Keccakis also a possibility.
accountis the source substrate account,
truncatetakes the first 20 bytes as the Ethereum address, and
evm:prefix and takes the hash as to convert back into a 32-byte Substrate address.
withdrawfor transferring funds back from an Ethereum account to the source Substrate account.
accountis the source Substrate account, and
truncatetakes the first 20 bytes as the Ethereum address.
ethAddressis the 20-byte Ethereum address, and
evm:prefix and takes the hash, as explained above.
FeeCalculator, which in Edgeware's case is set to a 1-to-1 wei-to-Substrate token mapping.
gasPriceis specified in the EVM call, as the conversion factor from the
gasUsedfield in the receipt to wei.
address[0..20]— take the first 20 bytes.
evm:prefix to data, and take the hash. THIS IS NOT REVERSIBLE.
AccountId32which is an array
[u8, 32], represented here as a 64 char hex string):
Hashis defined in the runtime as either Blake or Keccak. Edgeware uses Blake (see: https://github.com/hicommonwealth/edgeware-node/blob/edg-frontier-up-1/node/runtime/src/lib.rs#L857), so the final output would be, in hex:
0x12345...maps to the 20-byte "ethereum account"
0x12345...1234which maps to the 32-byte "substrate-ethereum equivalent"
0xAF8536...which functions as a valid Substrate address. This is the Substrate address used to maintain account balances for the corresponding EVM account.
"it seems one cannot use native substrate addresses by default to interact with the EVM, can you expand on this more? What does a user have to. do if they have 0 balance at genesis"
evm-address.jswhich purports to perform this conversion, but doesn't seem to do it correctly based on the updated evm pallet (the util hasn't been updated in 4 months)
pallet_evm::withdrawfunction, as the "substrate-ethereum equivalent" does not have a known private key from which to send transactions.
deposit_creatingon the "substrate-ethereum equivalent" depending on whether balance was added or removed: https://github.com/paritytech/substrate/blob/master/frame/evm/src/lib.rs#L440
EVM_CONFIGin the runtime.
ISTANBULconfig, with the CreateContractLimit raised.
FeeCalculator, which in Edgeware's case is set to a 1-to-1 mapping.
applyed on the backend: https://github.com/paritytech/substrate/blob/master/frame/evm/src/backend.rs#L144