|
1 | 1 | # EVMcrispr |
2 | 2 |
|
3 | | -This is an official starter Turborepo. |
| 3 | +[](https://www.npmjs.com/package/@1hive/evmcrispr) |
| 4 | +[](https://coveralls.io/github/1Hive/evmcrispr?branch=master) |
| 5 | +[](./LICENSE) |
4 | 6 |
|
5 | | -## Using this example |
| 7 | +**EVMcrispr** is a powerful TypeScript library and scripting language for interacting with EVM-based DAOs. It lets you encode complex sequences of actions — installing apps, managing permissions, transferring funds, and more — into EVM scripts that can be executed through DAO governance in a single transaction. |
6 | 8 |
|
7 | | -Run the following command: |
| 9 | +> **Note:** EVMcrispr is in active development. The API may change before reaching 1.0. |
| 10 | +
|
| 11 | +**Documentation:** [docs.evmcrispr.com](https://docs.evmcrispr.com) |
| 12 | + |
| 13 | +## Features |
| 14 | + |
| 15 | +- **Declarative scripting language (cas11)** — Write human-readable scripts that compile to EVM calldata |
| 16 | +- **Modular architecture** — Load only the modules you need (`std`, `aragonos`, `ens`, `giveth`, `tenderly`) |
| 17 | +- **Read-only contract calls** — Chain view function calls with the `::` operator (e.g. `token-manager::token()::decimals()`) |
| 18 | +- **Native arithmetic expressions** — Use math with operator precedence and parentheses directly in scripts |
| 19 | +- **Multi-chain support** — Switch networks dynamically within a script using `switch` |
| 20 | +- **Recursive DAO scoping** — Nest `connect` commands for cross-DAO operation scripts |
| 21 | +- **Web terminal app** — Interactive browser-based editor with Monaco, autocompletion, and wallet integration |
| 22 | + |
| 23 | +## Monorepo Structure |
| 24 | + |
| 25 | +This project is a [Turborepo](https://turbo.build/) monorepo managed with [Bun](https://bun.sh/). |
| 26 | + |
| 27 | +``` |
| 28 | +evmcrispr/ |
| 29 | +├── apps/ |
| 30 | +│ └── evmcrispr-terminal # Web-based terminal UI (React + Vite + Chakra UI) |
| 31 | +├── packages/ |
| 32 | +│ ├── evmcrispr # Core library (@1hive/evmcrispr) |
| 33 | +│ ├── config-eslint # Shared ESLint configuration |
| 34 | +│ ├── config-prettier # Shared Prettier configuration |
| 35 | +│ └── config-typescript # Shared TypeScript configuration |
| 36 | +``` |
| 37 | + |
| 38 | +## Modules |
| 39 | + |
| 40 | +EVMcrispr uses a module system loaded via the `load` command. The `std` module is loaded by default. |
| 41 | + |
| 42 | +### `std` (loaded by default) |
| 43 | + |
| 44 | +| Commands | Helpers | |
| 45 | +|----------|---------| |
| 46 | +| `exec`, `set`, `load`, `switch`, `raw`, `print`, `for` | `@me`, `@token`, `@token.balance`, `@date`, `@get`, `@id`, `@ipfs`, `@abi`, `@ens`, `@namehash` | |
| 47 | + |
| 48 | +### `aragonos` |
| 49 | + |
| 50 | +| Commands | Helpers | |
| 51 | +|----------|---------| |
| 52 | +| `connect`, `install`, `upgrade`, `grant`, `revoke`, `act`, `forward`, `new-dao`, `new-token` | `@aragonEns` | |
| 53 | + |
| 54 | +### `ens` |
| 55 | + |
| 56 | +| Commands | Helpers | |
| 57 | +|----------|---------| |
| 58 | +| `renew` | `@contenthash` | |
| 59 | + |
| 60 | +### `giveth` |
| 61 | + |
| 62 | +| Commands | Helpers | |
| 63 | +|----------|---------| |
| 64 | +| `donate`, `initiate-givbacks`, `verify-givbacks`, `finalize-givbacks` | `@projectAddr` | |
| 65 | + |
| 66 | +### `tenderly` |
| 67 | + |
| 68 | +| Commands | Helpers | |
| 69 | +|----------|---------| |
| 70 | +| `fork`, `expect`, `wait` | — | |
| 71 | + |
| 72 | +## Quick Start |
| 73 | + |
| 74 | +### Installation |
8 | 75 |
|
9 | 76 | ```sh |
10 | | -npx create-turbo@latest -e with-vite |
| 77 | +bun add @1hive/evmcrispr viem |
11 | 78 | ``` |
12 | 79 |
|
13 | | -## What's inside? |
| 80 | +### Usage |
14 | 81 |
|
15 | | -This Turborepo includes the following packages and apps: |
| 82 | +```ts |
| 83 | +import { EVMcrispr } from "@1hive/evmcrispr"; |
| 84 | +``` |
| 85 | + |
| 86 | +Write scripts using the cas11 scripting language: |
| 87 | + |
| 88 | +``` |
| 89 | +load aragonos as ar |
| 90 | +
|
| 91 | +set $dao 0xYourDaoAddress |
| 92 | +
|
| 93 | +ar:connect $dao token-manager voting ( |
| 94 | + install agent:new-agent |
| 95 | + grant voting agent:new-agent TRANSFER_ROLE voting |
| 96 | + exec vault transfer @token(WXDAI) agent:new-agent 100e18 |
| 97 | + act agent:new-agent @token(WXDAI) withdraw(uint256) 100e18 |
| 98 | + exec agent:new-agent transfer XDAI vault 100e18 |
| 99 | +) |
| 100 | +``` |
| 101 | + |
| 102 | +## Development |
| 103 | + |
| 104 | +### Prerequisites |
| 105 | + |
| 106 | +- [Bun](https://bun.sh/) (v1.2+) |
| 107 | +- [Node.js](https://nodejs.org/) (v18+) |
| 108 | + |
| 109 | +### Setup |
16 | 110 |
|
17 | | -### Apps and Packages |
| 111 | +```sh |
| 112 | +# Install dependencies |
| 113 | +bun install |
| 114 | + |
| 115 | +# Build all packages |
| 116 | +bun run build |
| 117 | + |
| 118 | +# Run the terminal app in development mode |
| 119 | +bun run dev:terminal |
| 120 | +``` |
| 121 | + |
| 122 | +### Commands |
| 123 | + |
| 124 | +| Command | Description | |
| 125 | +|---------|-------------| |
| 126 | +| `bun run build` | Build all packages | |
| 127 | +| `bun run dev` | Start all packages in dev/watch mode | |
| 128 | +| `bun run dev:terminal` | Start the terminal app | |
| 129 | +| `bun run test` | Run tests | |
| 130 | +| `bun run test:coverage` | Run tests with coverage | |
| 131 | +| `bun run lint` | Lint all packages | |
| 132 | +| `bun run type-check` | Type-check all packages | |
| 133 | +| `bun run format` | Format code with Prettier | |
| 134 | + |
| 135 | +### Environment Variables |
| 136 | + |
| 137 | +Copy the example env file in the core package and fill in the values: |
| 138 | + |
| 139 | +```sh |
| 140 | +cp packages/evmcrispr/.env.example packages/evmcrispr/.env |
| 141 | +``` |
18 | 142 |
|
19 | | -- `docs`: a vanilla [vite](https://vitejs.dev) ts app |
20 | | -- `web`: another vanilla [vite](https://vitejs.dev) ts app |
21 | | -- `@repo/ui`: a stub component & utility library shared by both `web` and `docs` applications |
22 | | -- `@repo/eslint-config`: shared `eslint` configurations |
23 | | -- `@repo/typescript-config`: `tsconfig.json`s used throughout the monorepo |
| 143 | +| Variable | Description | |
| 144 | +|----------|-------------| |
| 145 | +| `ARCHIVE_NODE_ENDPOINT` | Alchemy or similar archive node RPC URL | |
| 146 | +| `ETHERSCAN_API` | Etherscan API key | |
| 147 | +| `VITE_PINATA_JWT` | Pinata JWT for IPFS operations | |
24 | 148 |
|
25 | | -Each package and app is 100% [TypeScript](https://www.typescriptlang.org/). |
| 149 | +## Contributing |
26 | 150 |
|
27 | | -### Utilities |
| 151 | +We welcome community contributions! Please check out our open [Issues](https://github.com/EVMcrispr/evmcrispr/issues) to get started. |
28 | 152 |
|
29 | | -This Turborepo has some additional tools already setup for you: |
| 153 | +## License |
30 | 154 |
|
31 | | -- [TypeScript](https://www.typescriptlang.org/) for static type checking |
32 | | -- [ESLint](https://eslint.org/) for code linting |
33 | | -- [Prettier](https://prettier.io) for code formatting |
| 155 | +[AGPL-3.0](./LICENSE) — Copyright (C) Blossom Labs |
0 commit comments