Skip to content

Conversation

@brunopgalvao
Copy link
Contributor

πŸ“ Description

Resolves #1045

πŸ” Review Preference

Choose one:

  • βœ… I have time to handle formatting/style feedback myself
  • ⚑ Docs team handles formatting (check "Allow edits from maintainers")

πŸ€– AI-Ready Docs

If content changed, regenerate AI files:

  • βœ… I ran python3 scripts/generate_llms.py
  • ⚑ Docs team will regenerate (check "Allow edits from maintainers")

βœ… Checklist

@brunopgalvao brunopgalvao self-assigned this Oct 21, 2025
@brunopgalvao brunopgalvao added B0 - Needs Review Pull request is ready for review C1 - Medium Medium priority task A0 - New Content Pull request contains new content pages labels Oct 21, 2025
@brunopgalvao brunopgalvao marked this pull request as ready for review October 21, 2025 14:17
@brunopgalvao brunopgalvao requested a review from a team as a code owner October 21, 2025 14:17
@brunopgalvao brunopgalvao changed the title Add smart contract support page Add smart contract functionality page Oct 21, 2025

For a real-world example of how these pallets are implemented in production, you can check Moonbeam's implementation of [`pallet-evm`](https://github.com/moonbeam-foundation/moonbeam/blob/9e2ddbc9ae8bf65f11701e7ccde50075e5fe2790/runtime/moonbeam/src/lib.rs#L532){target=\_blank} and [`pallet-ethereum`](https://github.com/moonbeam-foundation/moonbeam/blob/9e2ddbc9ae8bf65f11701e7ccde50075e5fe2790/runtime/moonbeam/src/lib.rs#L698){target=\_blank}.
**Essential Pallet:**
- **[`pallet-revive`](https://github.com/paritytech/polkadot-sdk/tree/master/substrate/frame/revive){target=\_blank}** - Provides the core smart contract execution environment with PolkaVM and REVM backends

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Issue: External link missing backslash in target attribute.

Suggested change
- **[`pallet-revive`](https://github.com/paritytech/polkadot-sdk/tree/master/substrate/frame/revive){target=\_blank}** - Provides the core smart contract execution environment with PolkaVM and REVM backends
[`pallet-revive`](https://github.com/paritytech/polkadot-sdk/tree/master/substrate/frame/revive){target=\_blank}
**[`pallet-revive`](https://github.com/paritytech/polkadot-sdk/tree/master/substrate/frame/revive){target=\_blank}** - Provides the core smart contract execution environment with PolkaVM and REVM backends


## Wasm Smart Contracts
**Optional RPC Adapter:**
- **[`pallet-revive-eth-rpc`](https://crates.io/crates/pallet-revive-eth-rpc){target=\_blank}** - Adds full Ethereum RPC compatibility for Ethereum tooling integration

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Issue: External link missing backslash in target attribute.

Suggested change
- **[`pallet-revive-eth-rpc`](https://crates.io/crates/pallet-revive-eth-rpc){target=\_blank}** - Adds full Ethereum RPC compatibility for Ethereum tooling integration
**[`pallet-revive-eth-rpc`](https://crates.io/crates/pallet-revive-eth-rpc){target=\_blank}** - Adds full Ethereum RPC compatibility for Ethereum tooling integration

**Dual Execution Model:**

<div class="grid cards" markdown>
1. **PolkaVM Backend**: Executes PolkaVM bytecode with native performance optimization, precise gas metering, and enhanced security features

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Issue: Missing period at end of full sentence list item.

Suggested change
1. **PolkaVM Backend**: Executes PolkaVM bytecode with native performance optimization, precise gas metering, and enhanced security features
1. **PolkaVM Backend**: Executes PolkaVM bytecode with native performance optimization, precise gas metering, and enhanced security features.


<div class="grid cards" markdown>
1. **PolkaVM Backend**: Executes PolkaVM bytecode with native performance optimization, precise gas metering, and enhanced security features
2. **REVM Backend**: Executes EVM bytecode for compatibility with existing Ethereum contracts, ensuring seamless migration

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Issue: Missing period at end of full sentence list item.

Suggested change
2. **REVM Backend**: Executes EVM bytecode for compatibility with existing Ethereum contracts, ensuring seamless migration
2. **REVM Backend**: Executes EVM bytecode for compatibility with existing Ethereum contracts, ensuring seamless migration.


## pallet-contracts (Legacy)

[`pallet-contracts`](https://docs.rs/pallet-contracts/latest/pallet_contracts/index.html#contracts-pallet){target=\_blank} is the original Wasm-based smart contract pallet for Polkadot SDK chains. While still functional, it's considered legacy as development efforts have shifted to pallet-revive.

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Issue: External link missing backslash in target attribute.

Suggested change
[`pallet-contracts`](https://docs.rs/pallet-contracts/latest/pallet_contracts/index.html#contracts-pallet){target=\_blank} is the original Wasm-based smart contract pallet for Polkadot SDK chains. While still functional, it's considered legacy as development efforts have shifted to pallet-revive.
[pallet-contracts](https://docs.rs/pallet-contracts/latest/pallet_contracts/index.html#contracts-pallet){target=\_blank} is the original Wasm-based smart contract pallet for Polkadot SDK chains. While still functional, it's consider...

- **[`pallet-revive`](https://github.com/paritytech/polkadot-sdk/tree/master/substrate/frame/revive){target=\_blank}** - Provides the core smart contract execution environment with PolkaVM and REVM backends

## Wasm Smart Contracts
**Optional RPC Adapter:**
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'd say this isn't optional. More importantly, it's crucial because otherwise you'll only be able to send Substrate-type transactions.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Let's remove the "Optional".

### Supported Languages and Compilers

- **[`pallet-contracts`](https://docs.rs/pallet-contracts/latest/pallet_contracts/index.html#contracts-pallet){target=\_blank}**: Provides the Wasm smart contract execution environment.
pallet-revive accepts smart contracts from multiple languages and compilation paths:
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Here I'd say that it supports any language that can be compiled down to RISC-V

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think this is fine here especially because we want to focus on Solidity (REVM/PVM). Later on in this page on line 41 I state: "Any language that can compile to PolkaVM bytecode and utilize pallet-revive's host functions (via pallet-revive-uapi) is supported."

| Language | Compiler | Output Bytecode | Execution Backend | Performance |
|----------|----------|-----------------|-------------------|-------------|
| Solidity | `resolc` | PolkaVM | PolkaVM | Optimal |
| Solidity | `solc` | EVM | REVM | Compatible |
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

not sure if "performance/compatible" makes sense

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Remove the "Performance" column.

| Rust (ink!) | `cargo-contract` | PolkaVM | PolkaVM | Optimal |

For a real-world example of how this pallet is implemented in production, you can check Astar's implementation of [`pallet-contracts`](https://github.com/AstarNetwork/Astar/blob/b6f7a408d31377130c3713ed52941a06b5436402/runtime/astar/src/lib.rs#L693){target=\_blank}.
Any language that can compile to PolkaVM bytecode and utilize pallet-revive's host functions (via `pallet-revive-uapi`) is supported.
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

is there a link for pallet-revive-uapi

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

**Dual Execution Model:**

<div class="grid cards" markdown>
1. **PolkaVM Backend**: Executes PolkaVM bytecode with native performance optimization, precise gas metering, and enhanced security features
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Haha, I would definitely NOT say that the gas metering is precise

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Okay haha. We can say: "Executes PolkaVM bytecode with native performance optimization."

### Implementation Examples

[:octicons-arrow-right-24: Reference](/smart-contracts/get-started/)
See real-world implementation in the [Asset Hub system parachain runtime](https://github.com/polkadot-fellows/runtimes/blob/8914a1c70ce2a821f1d4646feaab462204e01b26/system-parachains/asset-hubs/asset-hub-kusama/src/lib.rs#L1180-L1209){target=\_blank} in the Polkadot Fellows repository.
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

maybe this should be "Polkadot Hub TestNet", and be pointed to passet hub

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I believe the passet hub runtime is just the asset hub runtime:

And yes we can say "Polkadot Hub TestNet" and replace with the following link:


For a real-world example of how these pallets are implemented in production, you can check Moonbeam's implementation of [`pallet-evm`](https://github.com/moonbeam-foundation/moonbeam/blob/9e2ddbc9ae8bf65f11701e7ccde50075e5fe2790/runtime/moonbeam/src/lib.rs#L532){target=\_blank} and [`pallet-ethereum`](https://github.com/moonbeam-foundation/moonbeam/blob/9e2ddbc9ae8bf65f11701e7ccde50075e5fe2790/runtime/moonbeam/src/lib.rs#L698){target=\_blank}.
**Essential Pallet:**
- **[`pallet-revive`](https://github.com/paritytech/polkadot-sdk/tree/master/substrate/frame/revive){target=\_blank}** - Provides the core smart contract execution environment with PolkaVM and REVM backends
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe you could briefly explain or add a reference for both, polkavm and revm

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.


Frontier offers flexible integration depending on your compatibility needs:

#### EVM Execution Only
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This can be deferred to the regulators, but I believe we tend to avoid using 4 hashtags "####".


- **[`pallet-evm`](https://github.com/polkadot-evm/frontier/tree/master/frame/evm){target=\_blank}** - Provides the core EVM execution environment

This configuration allows EVM contract execution but requires using Polkadot SDK-specific APIs for interaction.
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Out of curiosity, what's the reason of this?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is if you want to create a Substrate chain with an EVM and use extrinsics instead of Eth RPC style transactions. Basically you want an EVM but you don't care about Eth compatibility.

### Key Benefits of Full Integration

- **Ethereum tooling compatibility**: Full compatibility with MetaMask, Hardhat, Remix, Truffle, and other Ethereum development tools
- **Zero-friction migration**: Deploy existing Ethereum dapps with minimal or no modifications
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Instead of "Zero", I'd say "Minimal". WDYT? just to be safe haha

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Agreed!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

A0 - New Content Pull request contains new content pages B0 - Needs Review Pull request is ready for review C1 - Medium Medium priority task

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants