8000 GitHub - sambacha/tevm-monorepo: Devnet, bundler and LSP for Solidity and TypeScript that runs in the browser
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

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

License

Notifications You must be signed in to change notification settings

sambacha/tevm-monorepo

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Build powerful TypeScript applications powered by the EVM, simplified

CI NPM Version Tevm Downloads EVMts (0.x.x) Downloads Minzipped Size

tevm-monorepo

Tevm is a JavaScript EVM client and a Solidity-to-TypeScript compiler.

Features

✅  EVM simulations
✅  forking akin to 8653 anvil --fork-url
✅  Solidity scripting akin to foundry scripts
✅  Compiles contracts in JavaScript via importing solidity files
✅  Extensions for usage with Viem, Ethers.js, Next.js, and Express.
✅  Compiles contracts in JavaScript via importing solidity files
🏗️  EVM Tracing (coming in upcoming release)
🏗️  React hook library
🏗️  First class vue and svelte support

Tevm runs in all environments

Visit Docs (under construction) for docs, guides, API and more! 📄

Code example

  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.greet('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 📄

Most files are licensed under MIT license. There are some files that are copied from ethereumjs that inherit the MPL-2.0. These files are individually marked at the top of the file and are all in the @tevm/state @tevm/blockchain and other packages that wrap ethereumjs libraries.

About

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

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • TypeScript 88.6%
  • JavaScript 11.1%
  • Other 0.3%
0