An Ethereum implementation and tool suite designed for Solidity testing and development. The unit testing framework provides fast parallelized test execution, built-in code coverage reporting, strongly typed Contract interfaces with powerful code-completion, Solidity stacktraces for reverts and exceptions, breakpoint debugging and more.
Written completely in cross-platform C# with .NET Core. Meadow can be used in VS Code, Visual Studio, and JetBrains Rider.
Builds | Windows Status | MacOS Status |
Install .NET Core SDK v2.1.4 or higher, then run these commands in a new directory for your project:
dotnet new -i Meadow.ProjectTemplate
dotnet new meadow
Open your project directory in VSCode or your favorite C# IDE.
-
Writing unit tests - getting started writing tests against Solidity contracts and generating code coverage reports.
-
Using the CLI - contract deployment and interaction against testnode or production.
-
Configuration - Specifying gas defaults, solc version, solc optimizer, accounts, RPC host, unit test parallelism, etc..
-
Usage examples; miscellaneous - ABI & RLP encoding, ECSign / ECRecover, testing reverts, etc..
Provides an intuitive framework for writing C# to perform contract deployments, transactions, function calls, RPC requests, and more. Solidity source files are automatically compiled and exposed as C# classes with all contract methods, events, and natspec documentation. Includes a personal Ethereum test node that automatically is setup during test executions.
Better understanding and investigation of Solidity execution problems.
Perform thorough testing of Solidity codebases. Generate HTML and JSON code coverage reports showing .sol source code coverage for line, branch, and function execution.
Solidity debugger extension for Visual Studio Code supporting breakpoints, stepping, rewinding, call stacks, local & state variable inspection.
Library | Description |
---|---|
Meadow.EVM |
An Ethereum Virtual Machine that includes:
|
Meadow.TestNode |
Ethereum "personal blockchain" / "test node" / "RPC Server" / "Ethereum client". Ran as either a standalone server or via programmatic setup / teardown during unit test execution. Supports several non-standard RPC methods for debugging, testing, and coverage report generation. |
Meadow.TestNode.Host |
Standalone test RPC node/server used as a command line tool. |
Meadow.SolCodeGen |
Tool that compiles Solidity source files and generates a C# class for each contract. All public methods and events in the contract ABI are translated to corresponding idiomatic C# methods and event log classes. Solidity NatSpec comments / docs are also translated to IntelliSense / code-completion tooltips. This nuget package can be simply added to a project and Solidity files in the project contracts directory are automatically compiled. |
Meadow.CoverageReport |
Generates HTML and JSON code coverage reports for Solidity source files. Uses execution trace data from the EVM. |
Meadow.UnitTestTemplate |
Test harness providing seamless integration between MSTest and Solidity contracts. Provides a simple workflow where Solidity source files are dropped into a unit test project and C# contract code is automatically generated. C# unit tests can easily deploy/call/transact with contracts. RPC test node servers & clients are automatically boostrapped and provided to unit tests. Code coverage reports are automatically generated after unit tests are ran. |
Meadow.Cli |
Tool that allows contract deployments and interaction through the command line. Solidity source files are live-compiled using a file system watcher. Can be ran against a automatically bootstrapped test RPC node or an externally configured node. Leverages PowerShell Core to a provide cross platform REPL-like environment with powerful tab-completion when interacting with contracts. |
Meadow.Core |
|
Meadow.JsonRpc |
|
Meadow.JsonRpc.Client |
JSON-RPC client implementation, supported transports: http, WebSocket, and IPC. |
Meadow.JsonRpc.Server |
Fast and lightweight HTTP and WebSockets JSON-RPC server - using Kestrel and managed sockets. |