EVM(general)

Overview

The Ethereum Virtual Machine (EVM) is the runtime environment for smart contracts, enabling compatibility with Ethereum-based dApps. Bitroot is an EVM compatible blockchain. Bitroot’s parallelized EVM ensures high performance and efficiency.

Here are some key points about the EVM:

  1. Turing Completeness: The EVM is Turing complete, meaning it can execute any computable function. This allows developers to write complex smart contracts.

  2. Gas: Transactions and contract executions on the EVM compatible network consume gas. Gas is a measure of computational work, and users pay for it in ubrt on Bitroot networks . Gas ensures that malicious or inefficient code doesn’t overload the network.

  3. 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.

Smart Contract Languages

The two most popular languages for developing smart contracts on the EVM are Solidity and Vyper.

Solidity

  • Object-oriented, high-level language for implementing smart contracts.

  • Curly-bracket language that has been most profoundly influenced by C++.

  • 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 – like static functions in a static class in other object oriented programming languages).

    • Complex user-defined types.

Example solidity contract

Vyper

  • Pythonic programming language

  • Strong typing

  • Small and understandable compiler code

  • Efficient bytecode generation

  • Deliberately has less features than Solidity with the aim of making 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

Example Vyper contract

Last updated