We're excited to debut our EVM-coder, an innovative tool by Unique Network that streamlines the contract development process by allowing blockchain developers to write smart contracts in the Rust language without prior knowledge of Solidity.
EVM-coder is a tool that simplifies writing Ethereum Virtual Machine (EVM) precompiles by abstracting the encoding and decoding tasks, allowing developers to focus on writing Rust logic.
By adhering to Ethereum standards, EVM-coder makes data management, documentation, and interface/API generation more straightforward while reducing the risk of data handling errors for tasks prevalent during the analysis and indexing process.
Purpose of the EVM-coder: Incorporating Rust Code to Construct EVM Precompiles
Frontier's pallet-evm on a chain offers many advantages. However, its full potential is only realized with the ability to push code and access chain data.
Precompiled EVMs and native contracts offer the ability to communicate. Yet, the complication of having to understand Solidity ABI and EVM nuances to encode/decode boilerplate and hard-code selectors/selector hashes into precompile code can be challenging.
Using EVM-coder, you can incorporate raw Rust code alongside precisely placed attributes to construct practical EVM precompiles. You can generate Solidity API declarations for contract developers and contract stubs for various purposes, such as ABI generation for end users.
Precompiles are unique structural components within the Ethereum network, setting them apart from standard contracts. They have the ability to communicate with specific internal processes of both EVM and Substrate interfaces, providing them with capabilities beyond those of other contracts. For example, precompiles can interact with pallets in addition to evm accounts and contracts.
EVM-coder: What are the Use Cases?
Going beyond giving Developers the capacity to build personalized smart contracts in Rust, i.e., For an NFT marketplace or dEX, EVM-coder offers several other beneficial use cases. These include:
1. Implementing Pallet logic into EVM
The seamless integration of business logic from Substrate Pallets into the Ethereum Virtual Machine (EVM) environment allows Substrate developers to leverage the powerful capabilities of Substrate and EVM, allowing Substrate-based blockchains to interoperate with existing Ethereum-based projects.
By enabling Substrate developers to harness the established functionalities of their Pallets within the EVM ecosystem, this Substrate—EVM synergy empowers builders to tap into the extensive ecosystem of smart contracts, dApps, and tools built on Ethereum, while retaining the flexibility and scalability of Substrate.
2. EVM compatibility for Ink! contracts
Ink! contracts, designed for use on the Substrate blockchain, benefit from seamless EVM compatibility by integrating this tool's functionality.
EVM-coder allows Ink! Contracts incorporate EVM calls into their logic and parse and execute incoming EVM calls, enabling interoperability between Substrate and Ethereum networks. This powerful feature expands the capabilities of Ink! Contracts allow interaction with EVM-based smart contracts, tokens, and other dApps seamlessly and efficiently.
3. Task analysis and indexing
EVM-coder makes analysis and indexing tasks more manageable by providing a clearly defined, ready-made encoding and decoding solution for the Ethereum Virtual Machine (EVM).
Users are not required to write Solidity data decoders themselves. Instead, they only need to provide the structure or contract descriptions, and EVM-coder will handle the rest. This streamlined process offers increased efficiency and reduced room for error in data handling.
Doubling Down on Interoperability
In conclusion, the EVM-coder is a useful tool developed to streamline contract development, facilitating more productive processes, fewer errors in data processing, and inspiring innovation for both the Substrate and Ethereum blockchains.
NOTE: In this Polkadot article, only basic EVM-coder features were utilized, while inheritance, events, runtime data, code reuse patterns, and #[derive(AbiType)] for passing complex structures between EVM and the precompile were not incorporated.
The precompile is ready for use.
Check out the project page here for more technical details and examples: https://github.com/uniquenetwork/evm-coder
Build on Unique Network
Are you a builder or developer looking for the most advanced NFT infrastructure? From SDKs, RFTs, and Customizable NFTs, we can help you create powerful and dynamic NFT solutions. Whether you're looking to build new dApps or integrate existing ones, we have the tools and expertise to help you succeed.
Get in touch with us for more support.