adding-precompiles

Create and register EVM precompiles exposing Substrate pallets to Solidity contracts.

3|2|Updated Mar 9, 2026
One-click install
npx skills add https://github.com/Moonsong-Labs/knowledge-work-plugins --skill adding-precompiles-moonsong-labs
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: adding-precompiles
Source: https://github.com/Moonsong-Labs/knowledge-work-plugins/tree/main/moonbeam-engineering/skills/adding-precompiles
Command: npx skills add https://github.com/Moonsong-Labs/knowledge-work-plugins --skill adding-precompiles-moonsong-labs

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Expose Substrate pallet functionality to Ethereum-compatible smart contracts by creating and integrating EVM precompiles, enabling Solidity contracts to interact with on-chain pallets.

Core Features & Use Cases

  • Create and register custom precompile addresses that map to pallet calls.
  • Implement robust precompile logic in Rust using the precompile-utils macro with proper gas accounting and event logging.
  • Use cases include bridging Substrate state to Solidity, exposing pallet capabilities, and building Ethereum-compatible interfaces for on-chain governance or automation.

Quick Start

Follow the workflow: create a precompile crate, implement it with the precompile macro, and register it in your runtime precompiles.

Frequently Asked Questions about adding-precompiles

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I expose Substrate pallet functionality to Ethereum smart contracts?

To expose Substrate pallet functionality to Ethereum smart contracts, you create and register EVM precompiles. This bridges Substrate state to Solidity by mapping specific precompile addresses directly to pallet calls.

What is the workflow for adding EVM precompiles in a Moonbeam-like environment?

The workflow for adding EVM precompiles involves creating a precompile crate, implementing the logic in Rust with the precompile-utils macro, and registering the precompile in your runtime.

Does implementing precompiles require explicit gas accounting and event logging?

Yes, implementing production-grade precompiles requires explicit gas accounting and event logging. The precompile-utils macro in Rust ensures these operations are handled correctly when Solidity interacts with pallets.

Can I use Solidity to interact with on-chain Substrate governance pallets?

Yes, you can expose on-chain Substrate governance or automation pallets to Solidity. By creating custom EVM precompiles, Ethereum-compatible contracts can directly invoke mapped pallet capabilities.

What is the best way to bridge Substrate state to an Ethereum-compatible interface?

The best way to bridge Substrate state to an Ethereum-compatible interface is by creating EVM precompiles. This approach maps explicit precompile addresses to pallet calls, enabling seamless interaction between Solidity and Substrate.