/evmts-monorepo

Execute solidity scripts in the browser

Primary LanguageSolidityMIT LicenseMIT

wagmi logo

Execute solidity scripts in browser 🏗️🚧

CI CI Version

evmts-monorepo

🏗️🚧 EVMts is a work in progress

EVMts enables direct evm execution clientside with forge cheat codes and direct solidity file imports.

Visit Docs for docs, guides, API and more! 📄

See EVMts Beta project board for progress on the upcoming beta release! 💥

Packages and apps 📦

packages

@evmts/playground contains an example vite app for developing on evmts @evmts/e2e contains e2e tests that run against all example apps @evmts/docs contains the docs astro app

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 ✨

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 Foundry, viem, abitype, ethereumjs-monorepo, wagmi, Verifiable rpc, Optimism (I work here), helios

License 📄