Velas native application model is aiming to high performance by spliting its modifiable state across multiple accounts. While this allows to process transactions in parallel on single shard, thats also introduce complication for ordinary DApps developer. Also, most of DApps infrastructure is already relies on Solidity, and targeting Ethereum blockchain. These two reasons can significantly slow down the spread of solana ecosystem.
To make life of DApps developers, and integrators more easier, we at Velas introduce full hybrid of solana and EVM.
Check out Velas address convention for detail how addresses will look in evm.
Transfer native token to EVM
In order to transfer native token into EVM, we can use evm-utils binary. Note: EVM store tokens in nano lamports, so when you transfer for example, 5 lamports, your balance will be reported as 5*10^9
Result after transaction processing:
To make sure that balance was updated, you can request it using rpc:
0x12a05f200 is a hex representation of 5*10^9
For more information about rpc checkout evm-rpc page.
Transfer token from EVM back to native
For transfering tokens back to native chain, we have a special precompiled contract, that deployed at address:
With following interface:
native_recipient is 32byte address of Velas Native account.
To swap tokens, one should create transaction on address
value specified in transaction.
This transaction then can be sent to EVM Bridge, that will wrap it to native transaction.