Velas native application model is aiming for high performance by splitting its modifiable state across multiple accounts. While this allows Velas to process transactions in parallel on a single shard, it also introduces complications for ordinary DApps developers. Additionally, most DApp infrastructures already rely on Solidity and targeting the Ethereum blockchain. These two reasons can significantly slow down the spread of the Solana ecosystem.
To make the life of DApps developers and integrators more easier, we at Velas introduced a full hybrid of Solana (eBPF) VM and Ethereum VM.
Here you can gain an overview on how to deploy an EVM dApp on Velas.
Transfer native token to EVM
In order to transfer native token into EVM, we can use
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 transferring 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 a transaction on the address:
value specified in the transaction.
This transaction then can be sent to EVM Bridge, that will wrap it to native transaction.