FRAME provides an EVM execution pallet that allows unmodified EVM code to be executed in a Substrate-based blockchain. As a key part to Substrate's Ethereum compatibility layer, also known as Frontier, it works together with the Ethereum pallet and the Dynmaic Fee pallet to enable the creation of runtimes capable of fully emulating Ethereum block production and transaction processing.
There are a separate set of accounts managed by the EVM pallet. Substrate based accounts can call the EVM pallet to deposit or withdraw balance from the Substrate base-currency into a different balance managed and used by the EVM pallet. Once a user has populated their balance, they can create and call smart contracts using this pallet.
Substrate 账户和 EVM 外部账户是一一对应的，该映射关系由转换函数定义。
EVM Pallet vs. Ethereum Network
The EVM pallet should be able to produce nearly identical results compared to the Ethereum mainnet, including gas cost and balance changes.
- The available length of block hashes may not be 256 depending on the configuration of the System pallet in the Substrate runtime.
- Difficulty and coinbase, which do not make sense in this pallet and is currently hard coded to zero.
我们目前并不打算让state root等不可观测的行为变得相同。 我们也不打算遵循完全相同的交易/收据格式。 However, given one Ethereum transaction and one Substrate account's private key, one should be able to convert any Ethereum transaction into a transaction compatible with this pallet.
目前 gas 的配置硬编码在伊斯坦布尔硬分叉中。 以后可以扩展到支持早期的硬分叉配置。
- 了解我们的 Contracts 模块，它支持 Wasm 智能合约的部署和执行。
- 按照教程为你的 FRAME Runtime 添加一个模块。