Skip to content

feat: add revive compiler support #10021

Open
@smiasojed

Description

@smiasojed

Component

Forge

Describe the feature you would like

This proposal aims to integrate the Revive(Resolc) compiler into the Foundry stack. The Revive compiler compiles Solidity code into PolkaVM’s RISC-V instruction set, enabling Solidity contract execution on AssetHub chain.

We see two possible approaches for this integration:

  1. Adding Revive(Resolc) as part of the Multicompiler. Draft PR
  2. Implementing a custom compiler integration, similar to how zkSync is handled. Draft PR

You can see our considerations here

Our primary goal is to upstream our changes into Foundry, ensuring long-term maintainability and alignment with the ecosystem.

We would greatly appreciate your guidance on the preferred approach that would best facilitate upstreaming our compiler into Foundry.
Looking forward to your insights!

Additional context

Context: Integrating Foundry with Polkadot AssetHub
The goal of this project is to integrate Foundry with the Polkadot AssetHub chain. AssetHub offers Ethereum compatibility, enabling the execution of Solidity smart contracts.

We aim to achieve the highest possible level of compatibility with Ethereum, covering both contract execution semantics and RPC endpoints. This ensures a seamless experience for developers familiar with Ethereum, allowing them to build and deploy applications on AssetHub with minimal friction.

Key Differences from Ethereum Solutions
Unlike most Ethereum-compatible platforms, AssetHub does not use the Ethereum Virtual Machine (EVM). Instead, we leverage our own PolkaVM, which is built on the RISC-V instruction set.

For Solidity developers, this difference is largely transparent. Our Revive(Resolc) compiler ensures full Solidity support, including inline assembly. However, one key distinction is that the compiled bytecode is not EVM-compatible due to the underlying architecture.
For more informations, please refer to our documentation

Compilation for PolkaVM
To compile Solidity contracts for execution on PolkaVM, we use the Revive(Resolc) compiler. This tool compiles Solidity code into a format compatible with PolkaVM. The compiler architecture you can find here.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    Status

    Todo

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions