d1onys1us / tevm-monorepo

Devnet, bundler and LSP for Solidity and TypeScript that runs in the browser

Home Page:https://evmts.dev

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Build powerful TypeScript applications powered by the EVM, simplified

CI Version

tevm-monorepo

Tevm is an ethereum development toolkit that offers

  • Arbitrary EVM execution and forking akin to anvil
  • A powerful solidity scripting environment akin to foundry scripts
  • Build tooling to create a smooth interface between your Solidity scripts and TypeScript code

Tevm runs in all environments

Visit Docs for docs, guides, API and more! πŸ“„

Code example

Tevm scripting is a simple yet powerful way to program.

  1. Write a solidity script HelloWorld.s.sol
// SPDX-License-Identifier: MIT
pragma solidity >0.8.0;

contract HelloWorld {
    function greet(string memory name) public pure returns (string memory) {
        return string(abi.encodePacked("Hello ", name, "!"));
    }
}
  1. Import the solidity file into a JavaScript or TypeScript file. No need to compile it.
import { HelloWorld } from './HelloWorld.sol'

console.log(HelloWorld.abi)
console.log(HelloWorld.bytecode)
  1. Initialize a Tevm memory client and execute your Script using the tevm.script action
import { HelloWorld } from './HelloWorld.sol'
import { createMemoryClient } from 'tevm'

const client = createMemoryClient()

const result = await client.script(
  HelloWorld.read.greate('World')
)

console.log(result.data) // Hello world!

This is just a small subset of what Tevm offers. See docs for more information.

Contributing πŸ’»

Contributions are encouraged, but please open an issue before doing any major changes to make sure your change will be accepted.

See CONTRIBUTING.md for contributing information

License πŸ“„

About

Devnet, bundler and LSP for Solidity and TypeScript that runs in the browser

https://evmts.dev

License:MIT License


Languages

Language:TypeScript 89.6%Language:JavaScript 9.8%Language:Solidity 0.4%Language:CSS 0.0%Language:Dockerfile 0.0%Language:Rust 0.0%