evmts / tevm-monorepo Goto Github PK
View Code? Open in Web Editor NEWAn ecosystem of ethereum tools to build robust TypeScript applications
Home Page: https://tevm.sh
License: MIT License
An ecosystem of ethereum tools to build robust TypeScript applications
Home Page: https://tevm.sh
License: MIT License
Make evmts typesafe via adding a custom ts plugin
For evmts to be production ready it must be typesafe. By default, typescript has no way of infering types from solidity files. What we need to do is create a tsplugin that creates a pipe
solidity-import -> abi -> abitype -> final types
This will allow typesafety in the editor without a build step which is the ultimate ux for making solidity a first class citizen in js.
For this iteration we are only offering ts support in editors. The actual typescript build will not fail. Adding a special check that users can use instead of tsc (similar to what astro does) will be one of the first priorities after MVP is love.
In the future we want to expand this to full ts-language server support so we can improve developer experience within the editor and create a full-blown framework around it similar to astro
Documentation should be added to a typescript
section in the docs. It should be pretty brief
Set up any additional fixtures if necessary
Deliverable here is to extract the abi type from a solidity file location based on compiling the contract under the hood. Check early to make sure async nature of that isn't going to cause problems
Once we have the abi we can use abitype to infer contract types. Consider just reusing viem contract types more or less for now. We can modify it later if necessary
Should live in @evmts/tsplugin
POC 1 still doesn't work. Debug why.
Add a pnpm link to lib/ethereum-js so we can modify it
Implement rollup plugin via reusing the foundry and hardhat plugins from wagmi. The plugin should just reuse wagmi cli plugin interface under the hood for it's plugin interface but otherwise function exactly like the current POC version of the plugin works
We need to generalize the plugin. The POC works great but it is hardcoded to Forge with minimal configuration. We can easily and quickly add configuration via reusing wagmis code for their cli.
EVMts believes in being modular and we want the plugin to work with other runtime tools such as Viem and Ethers. This will help the plugin establish itself as a standardized industry build tool like jsx rather than a one off tool.
The ability to use solidity code in typescript as a first class citizen like graphql files or css files creates a more streamlined experience for evmts but other libraries such as ethers, viem, or wagmi can utilize this build tool in the same way.
Plugin usage should be documented. For now leave out the detail that these are wagmi plugins (even if we are rexporting wagmi plugins. Protect the API from breaking on latest anytime wagmi plugins change their interface.
Fixtures should be testing this with both the hardhat plugin and the foundry plugin
wagmi plugins return an object that includes the abi, address(if known), and contract name
our prototype plugin [returns a very similar object](https://github.com/evmts/evmts-monorepo/blob/main/packages/plugin-internal/src/getArtifacts.ts)
The implementations are as follows in order of preference
Add bytecode to wagmi plugin as an optional property build tools can choose to use
Just create a new plugin that extends the wagmi plugin interface to also include bytecode
Now swap out the current unconfigurable forge logic in @evmts/plugin
for wagmi plugin
Accept the wagmi plugin interface as an options. Default to attempting to use an unconfigured forge plugin
Reuse code from the rollup plugin in teh webpack plugin
The jest test is serving as an e2e test for now
Add an e2e test with playwright too in app/e2e
Ticket is placeholder for all the tickets needed to implement forge cheat codes and evm execution via reth+foundry to wasm.
needs more investigation to demystify the work needed to be done
The POC uses ethereumjs and while ethereumjs was by far the easiest way to get to an MVP, it was clear it would not scale to ever being production ready and maintainable without significant work. Comparatively, if we can compile foundry and reth to wasm with minimal hacks and changes, we can have production ready tooling that maximally reuses existing implementations of the API we are going for especially forge cheat codes
Add developer docs
We want contributions
For speed, stability, and the ultimate developer experience ๐ค
If the signer is not connected to the correct chain a request to switch chains should be issued
It's possible we can just get away with a babel plugin and not bother with rollup/webpack
Should be able to pass in type. Doesn't need to be typesafe fully yet just make user give a type and maybe add a one off cli tool to check for it.
Currently using rollup plugin as vite plugin since it works but we might be able to get better peformance by making a vite plugin
Should be able to simulate a tx and return information such as events emitted and gas used
Pnpm fetch is a less hacky way of efficiently building a dockerbuild. Currently we have a hacky multistage build that copys in package.json. Pnpm fetch will read only pnpm.lock
Create a demo on something like stackblitz that allows devs to play with evmts
An online demo will create the lowest friction way for devs to see how easy to use evmts is
Stackblitz or whatever works
Add basic rollup plugin similar to the babel plugin
Add an example repo that deploys to vercel
Forge is not on npm and they have no plans to enable it. It is likely a big lift until the moment forge is packaged up as a single binary.
We need to either find some hack or offer an easy to use example to make it easy for anybody to deploy to vercel
No idea figure it out. Easiest option is to build within a docker container. We need to attempt to find something easier than that though.
Should be similar to the foundry examples folder
Implement fixture projects with playwright tests building them and running e2e tests vs them
We are following documentation and test driven development. After first pass of docs are done we should be good to implement fixtures. We should then iterate until the first draft of the API looks clean. This will guarantee we don't make the mistake of making the implementation easier at the cost of the library api being worse
Should use the app registry contract
Save local state to op stack analogous to using firebase
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.