SwiftEVM

0.5.9

Pure Swift implementation of Ethereum Virtual Machine (EVM)
mrLSD/swift-evm

What's New

v0.5.9

2025-05-06T07:54:56Z

What's Changed

  • Feat: refactoring for Int operations instead of UInt for arrays by @mrLSD in #43

Full Changelog: v0.5.8...v0.5.9

License: MIT Swift CI codecov SwiftLint CI

SwiftEVM

mrLSD/SwiftEVM

A blazing fast 🚀, pure Swift implementation of the Ethereum Virtual Machine (EVM)


SwiftEVM is a high-performance, open-source implementation of the Ethereum Virtual Machine, written entirely in Swift. Engineered to empower web3-developers, it enables seamless integration of EVM—execution into a diverse array of applications and platforms, including macOS, iOS, other Apple ecosystems, wasm32, Linux, and beyond.

Our focus is on:

  • 🌐 Opensource: Fully open source, promoting transparency, community collaboration, and innovation.
  • Speed & Performance: Critical paths are highly optimized for blazing-fast execution.
  • 🔒 Security & Reliability: 100% test coverage ensures predictable and robust behavior.
  • 🔧 Extensibility & Maintainability: A modular architecture that facilitates ongoing improvements and customizations.

Modern development tools such as SwiftLint and swiftformat are part of our workflow, ensuring a clean, consistent codebase that is both developers-friendly.


Current Status

  • EVM Machine: Fully implemented
  • EVM Core: ~90% complete
  • EVM Runtime: Under active development
  • 🔜 Ethereum Hard Forks:
    • Berlin
    • London
    • Shanghai
    • Cancun
    • Prague

Integration & Future Plans

  • Blockchain Ecosystem: Planned integration with NEAR Protocol to broaden blockchain interoperability.
  • Key Environments:
    • Embedded Systems: Bring blockchain capabilities to resource-constrained devices.
    • WebAssembly (WASM): Run the EVM directly in WASM environments.
    • Mobile & Desktop: Seamlessly integrate decentralized functionalities into iOS, macOS, and other Swift-based platforms.

Benefits

  • Pure Swift Implementation: Leverage Swift’s performance and safety to integrate EVM directly into your projects.
  • Cross-Platform Compatibility: Enjoy hassle-free deployment across multiple platforms.
  • Open Source: Join a vibrant community—contribute, collaborate, and help shape the project’s future.
  • Customization & Extensibility: Easily adapt and extend the EVM functionality to meet specific project needs.

What’s included?

  • 🔢 PrimitiveTypes Library: Implements high-performance math tailored specifically for Ethereum’s needs—offering functionalities that generic libraries like BigInt and other general-purpose solutions can’t provide. It’s designed and optimized for the unique demands of the EVM.

  • ⚙️ EVM Library: Contains the actual implementation of the Ethereum Virtual Machine, powering EVM bytecode execution seamlessly.

  • 🔍 EVM Tracing Support: Provides robust tracing capabilities to assist developers in debugging and optimizing EVM execution.

How to use

📱 Swift Support: Minimum supported version is Swift 6. This is due the new capabilities of Swift 6, including support for the UInt128 type.

Use as dependency:

    dependencies: [
        .package(url: "https://github.com/mrLSD/evm-swift.git"
    ]

How to contribute

  • ✅ All Tests Passing: Ensure that all tests run successfully.
  • 📊 100% Test Coverage: Verify that your tests cover the entire codebase.
  • 🛠️ SwiftFormat: Confirm that the swiftformat command completes.
  • 🔧 SwiftLint: Confirm that the swiftlint command executes successfully.

Unit tests

You can run:

  • swift test
  • ./Tests/cli-test-runner - simple but yet powerful tool to show tests errors
  • swift test | xcbeautify - swift tests xcbeautify

LICENSE: MIT

Description

  • Swift Tools 6.0.0
View More Packages from this Author

Dependencies

Last updated: Fri May 16 2025 23:17:32 GMT-0900 (Hawaii-Aleutian Daylight Time)