Execute solidity scripts in browser ποΈπ§
ποΈπ§ 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! π₯
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
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
- @evmts/docs Future documentation site. Contains lots of unimplemented features such as a clientside VM
- examples/* Current documentation site for EVMts Imports Beta
- examples/next An example of a forge/next app using evmts
- examples/webpack An example of a forge/webpack app using evmts
- examples/vite An example of a forge/vite app using evmts
- examples/rollup An example of a forge/rollup library built with evmts
- examples/esbuild An example of a forge/esbuild cli tool built with evmts
e2e/ Playwright e2e tests that run against the example apps
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
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.
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();
}
}
- 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);
});
You don't need to install anything just to play with EVMts! Try editing this sandbox or check out the getting started docs
- Will Cory (@fucory)
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.
Please see our contributing.md.
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
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