Overview
The Ethereum Virtual Machine (EVM) is the runtime environment for smart contracts. Sei is an EVM-compatible blockchain, so it supports Ethereum-based dApps. Sei’s EVM is parallelized for high performance and efficiency.Watch the video walkthrough for this topic in the Video Tutorials section.
- Turing completeness: The EVM is Turing complete, so it can execute any computable function. This lets developers write complex smart contracts.
- Gas: Transactions and contract executions on an EVM-compatible network consume gas. Gas measures computational work. On Sei networks, users pay for gas in usei. Gas prevents malicious or inefficient code from overloading the network.
- Bytecode execution: Smart contracts are compiled into bytecode (low-level, machine-readable instructions) and deployed to the EVM-compatible network. The EVM executes this bytecode.
Try it: deploy without any setup
You do not need a local toolchain to deploy a contract to Sei. First, confirm that the network is live. Then compile and deploy a minimalCounter.sol to Sei Testnet directly from your browser.
Add Sei Testnet to your wallet. Then use Remix below to deploy the contract. Compile it under Solidity Compiler. Next, open Deploy & Run and set Environment to Injected Provider - MetaMask.
Smart contract languages
The two most popular languages for developing smart contracts on the EVM are Solidity and Vyper.Solidity
- An object-oriented, high-level language for implementing smart contracts.
- A curly-bracket language that C++ influenced the most.
- Statically typed (the type of a variable is known at compile time).
- Supports:
- Inheritance (you can extend other contracts).
- Libraries (you can create reusable code that you can call from different contracts). Libraries are like static functions in a static class in other object-oriented programming languages.
- Complex user-defined types.
Example Solidity contract
Vyper
- A Pythonic programming language
- Strong typing
- Small and understandable compiler code
- Efficient bytecode generation
- Deliberately has fewer features than Solidity, to make contracts more secure
and easier to audit. Vyper does not support:
- Modifiers
- Inheritance
- Inline assembly
- Function overloading
- Operator overloading
- Recursive calling
- Infinite-length loops
- Binary fixed points