Move .sol file to polymesh precompiles - #1982
Conversation
There was a problem hiding this comment.
🟡 Not ready to approve
The new precompiles crate currently has build-blocking visibility/workspace-dependency issues (private sol! module usage and workspace = true dependency usage outside workspace membership).
Once you've addressed the issues Copilot identified, you can request another Copilot review.
This review doesn't count toward merge requirements. Sign up for the private preview to control whether Copilot approvals count.
Pull request overview
This PR splits the Solidity ABI definitions into a new polymesh-precompiles crate and updates the runtime/pallet wiring so the pallet precompile implementation (pallet-precompiles) consumes the generated Alloy call/event types, with runtimes selecting the configured precompiles via a Precompiles type alias.
Changes:
- Introduces a new
precompiles/crate to host Solidity interfaces and generate Rust bindings viaalloy_core::sol!. - Renames the precompile pallet crate to
pallet-precompilesand updates runtime crates to definetype Precompiles = (...). - Updates the pallet precompile implementation to use
polymesh_precompiles::IFungibleAsset*generated types instead of locally generating bindings.
File summaries
| File | Description |
|---|---|
| precompiles/src/lib.rs | New crate entrypoint generating/re-exporting Alloy Solidity bindings. |
| precompiles/src/interfaces/IFungibleAsset.sol | Renames Solidity interface to IFungibleAsset. |
| precompiles/Cargo.toml | New crate manifest for polymesh-precompiles. |
| pallets/runtime/tests/src/storage.rs | Adds runtime-level Precompiles type alias for tests runtime. |
| pallets/runtime/tests/Cargo.toml | Switches dependency from old precompiles crate name to pallet-precompiles. |
| pallets/runtime/testnet/src/runtime.rs | Adds runtime-level Precompiles type alias. |
| pallets/runtime/testnet/Cargo.toml | Switches dependency from old precompiles crate name to pallet-precompiles (incl. features). |
| pallets/runtime/mainnet/src/runtime.rs | Adds runtime-level Precompiles type alias. |
| pallets/runtime/mainnet/Cargo.toml | Switches dependency from old precompiles crate name to pallet-precompiles (incl. features). |
| pallets/runtime/develop/src/runtime.rs | Adds runtime-level Precompiles type alias. |
| pallets/runtime/develop/Cargo.toml | Switches dependency from old precompiles crate name to pallet-precompiles (incl. features). |
| pallets/runtime/common/src/runtime.rs | Uses the runtime-provided Precompiles alias for pallet_revive::Config. |
| pallets/precompiles/src/lib.rs | Re-exports the renamed precompile interface type. |
| pallets/precompiles/src/interface/polymesh_specific.rs | Migrates polymesh-specific calls/events to IFungibleAsset generated types. |
| pallets/precompiles/src/interface/mod.rs | Swaps precompile dispatch interface from old generated types to IFungibleAssetCalls. |
| pallets/precompiles/src/interface/erc20.rs | Migrates ERC20 call/event encoding to IFungibleAsset generated types. |
| pallets/precompiles/Cargo.toml | Renames crate to pallet-precompiles and adds dependency on new polymesh-precompiles crate. |
| Cargo.toml | Renames workspace dep polymesh-precompiles → pallet-precompiles, adds new polymesh-precompiles path dep, adds alloy-core. |
| Cargo.lock | Updates lockfile for new/renamed crates and dependency graph changes. |
Review details
- Files reviewed: 18/19 changed files
- Comments generated: 2
- Review effort level: Low
We're testing this review assessment. Please use 👍 or 👎 to tell us if it's correct.
changelog
Other
polymesh_precompiles;