Skip to content

Commit a3751db

Browse files
committed
add links to code examples in the EVM documentation
1 parent 49f51d4 commit a3751db

File tree

1 file changed

+33
-11
lines changed

1 file changed

+33
-11
lines changed

src/developers/experimental/ethereum.md

Lines changed: 33 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,36 @@
1-
# Using EVM-Based Smart Contracts on Linera
1+
# Using EVM Smart Contracts on Linera
22

3-
It is possible to use Ethereum Virtual Machine (EVM)-based smart contracts on
4-
Linera. These contracts are typically written in Solidity.
3+
Thanks to the experimental integration of
4+
[`Revm`](https://bluealloy.github.io/revm/) in Linera, it is now possible to run
5+
smart contracts compiled for the Ethereum Virtual Machine (EVM) within Linera
6+
microchains.
57

6-
EVM smart contracts have access Linera-specific functionality of Linera through
7-
the `Linera.sol` library which exposes necessary interfaces for integration.
8+
The main purpose of this integration is to allow opensource smart contracts
9+
originally written for Ethereum to be more easily migrated to the Linera
10+
protocol and composed with existing Linera applications.
811

9-
This allows smart contracts originally deployed on Ethereum to be migrated to
10-
Linera and progressively adapted to Linera’s architecture and features.
12+
## Overview and code examples
1113

12-
## Publishing EVM Smart Contracts
14+
We generally assume that EVM smart contracts are written in
15+
[Solidity](https://soliditylang.org/) and compiled to EVM bytecode using the
16+
Solidity compiler.
17+
18+
Transactions running on the EVM are still following the programming model of the
19+
Linera protocol, notably they can only access the local state of the microchain
20+
that executes them. Inside a microchain, contracts may call each other as usual,
21+
possibly across virtual machines.
22+
23+
The main features of Linera, such as cross-chain messaging, are also supported
24+
in the EVM. These functionalities are exposed through a Solidity library
25+
[`Linera.sol`](https://github.com/linera-io/linera-protocol/tree/main/linera-execution/solidity/Linera.sol).
26+
27+
Frontends may interact with EVM contracts using custom EVM-like RPCs or using a
28+
Rust/Wasm application as a proxy.
29+
30+
Code examples for the features described below can be found under the directory
31+
[`linera-service/tests/fixtures`](https://github.com/linera-io/linera-protocol/tree/main/linera-service/tests/fixtures).
32+
33+
## Publishing EVM smart contracts
1334

1435
The process for publishing EVM smart contracts is similar to that for Wasm smart
1536
contracts, with the key difference being the need to specify the virtual machine
@@ -52,7 +73,7 @@ command:
5273

5374
The serialization code can be generated using the `serde-reflection` crate.
5475

55-
### Wasm Smart Contracts calling EVM Contracts.
76+
### Wasm smart contracts calling EVM Contracts.
5677

5778
Wasm smart contracts can call EVM contracts using the `alloy-sol-types` crate.
5879
This crate enables construction of Solidity-compatible types and supports RLP
@@ -93,8 +114,9 @@ Additional SDK functions available include:
93114

94115
## Difference between EVM applications in Ethereum and Linera.
95116

96-
- `Reentrancy`: Reentrancy is not supported on Linera. Contracts relying on it
97-
will fail with a clean error.
117+
- `Reentrancy`: Reentrancy is currently not supported on Linera. Contracts
118+
relying on it will fail with a clean error. In the future, reentrancy may be
119+
allowed as an option.
98120

99121
- `Address Computation`: Contract addresses are computed differently from
100122
Ethereum.

0 commit comments

Comments
 (0)