10000 GitHub - omahs/evmts-monorepo: Execute solidity scripts in the browser
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

omahs/evmts-monorepo

Β 
Β 

Repository files navigation

wagmi logo

Execute solidity scripts in browser πŸ—οΈπŸš§

CI CI Version

evmts-monorepo

πŸ—οΈπŸš§ EVMts is a work in progress

EVMts core enables direct evm execution clientside with forge cheat codes

EVMts imports enable a streamlined dev experience with direct solidity imports and integration with Wagmi

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

See EVMts Beta project board for progress on the upcoming beta release! πŸ’₯

Runtime libraries πŸ“¦

  • core/ - core evmts library
  • config/ - Tooling for configuring an evmts.config.ts file

Bundlers

Bundlers such as Rollup, Webpack, or Vite are used By JavaScript tools to control the import graph of JavaScript projects. This is how EVMts contract imports are able to work seemlessly.

Bundlers are provided for all major tools. If yours is not supported consider opening an issue.

All bundlers are in the bundlers/* folder

Language server tools

The language service protocol is how tools such as VSCode and Neovim are able to provide features such as autocomplete, information on hover, autoimports, and more. EVMts language service tools brings this functionality to TypeScript for contracts.

Also included are tools for typechecking code and code generation for those using EVMts without a bundler

  • @evmts/ts-plugin - Typescript Server Plugin for decorating the TypeScript language server with additional functionality
  • @evmts/vscode - A work-in-progress vscode plugin for EVMts

Apps πŸ“¦

Example apps

Tests βœ…

e2e/ Playwright e2e tests that run against the example apps

Getting started πŸ—οΈ

See docs/evmts for installation and and more detailed usage documentation.

See docs/monorepo for documentation on how to execute the monorepo with nx

See docs/contributing for documentation on how to contribute to evmts. No contribution is too small

Basic usage ✨

Note: Scripting is currently unimplemented

EVMts has future plans to enable solidity scripting and optimistic execution. As of now only EVMts contract imports are supported

See EVMts Beta project board for updates.

1. First write a script in solidity

Scripts in EVMts work exactly like the scripts in forge

pragma solidity ^0.8.17;

import {Script} from "forge-std/Script.sol";
import {ERC20} from "@openzeppelin/contracts/token/ERC20/ERC20.sol";

contract Example is Script {
    function run(ERC20 erc20Contract, address recipient, uint256 amount) external {
        address signer = vm.envAddress("SIGNER");
        vm.startBroadcast(signer);
        contract.transferFrom(signer, recipient, amount);
        vm.stopBroadcast();
    }
}

2. Then execute your script in TypeScript

  • no code gen step
  • no abis
  • no boilerplate

Just import your script and run it.

import { Example } from "./Example.s.sol"; // [!code focus]
import { evmts } from "./evmts";
import { Address } from "@evmts/core";

const tokenAddress: Address = "0x4200000000000000000000000000000000000042";
const recipient: Address = "0xd8dA6BF26964aF9D7eEd9e03E53415D37aA96045";
const amount = BigInt(420);

evmts // [!code focus]
  .script(Example) // [!code focus]
  .run(tokenAddress, receipeint, amount) // [!code focus]
  .broadcast()
  .then(({ txHash }) => {
    console.log(txHash);
  });

Try EVMts now

You don't need to install anything just to play with EVMts! Try editing this sandbox or check out the getting started docs

Author ✍️

Security πŸ”’

If you believe you have found a security vulnerability we encourage you to responsibly disclose this and not open a public issue. We will investigate all legitimate reports. Email will@oplabs.co to disclose any security vulnerabilities.

Contributing πŸ’»

Please see our contributing.md.

🚧 WARNING: UNDER CONSTRUCTION 🚧

This project is work in progress and subject to frequent changes

Looking to get started building a production-ready dapp? Check out viem

Interested in the OP stack? Check out op stack blog here: https://optimism.mirror.xyz/fLk5UGjZDiXFuvQh6R_HscMQuuY9ABYNF7PI76-qJYs

Check out these tools πŸ”§

Enjoy this tool? Check out these other awesome tools that make this library possible

And these other awesome tools that helped with development process and planning

License πŸ“„

About

Execute solidity scripts in the browser

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • Solidity 57.1%
  • TypeScript 42.6%
  • Dockerfile 0.2%
  • HTML 0.1%
  • Makefile 0.0%
  • CSS 0.0%
0