Giter Site home page Giter Site logo

0xpolarzero / tevm-monorepo Goto Github PK

View Code? Open in Web Editor NEW

This project forked from evmts/tevm-monorepo

1.0 1.0 0.0 27.29 MB

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

Home Page: https://evmts.dev

License: MIT License

JavaScript 8.96% Rust 0.01% TypeScript 90.60% CSS 0.04% Dockerfile 0.02% Solidity 0.37%

tevm-monorepo's Introduction

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 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 📄

tevm-monorepo's People

Contributors

roninjin10 avatar github-actions[bot] avatar dependabot[bot] avatar 0xpolarzero avatar 0xnoncents avatar o-az avatar kyscott18 avatar d1onys1us avatar omahs avatar

Stargazers

 avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.