{"id":13512344,"url":"https://github.com/three-em/3em","last_synced_at":"2025-10-20T18:27:46.014Z","repository":{"id":38311239,"uuid":"428083681","full_name":"three-em/3em","owner":"three-em","description":"A blazingly fast, secure, reliable, multi-language execution machine for Smart Contracts.","archived":false,"fork":false,"pushed_at":"2023-12-21T18:52:04.000Z","size":38272,"stargazers_count":136,"open_issues_count":16,"forks_count":6,"subscribers_count":5,"default_branch":"main","last_synced_at":"2025-03-04T02:51:23.850Z","etag":null,"topics":["arweave","rust","smart-contracts","smartweave","solidity","v8-engine","wasm"],"latest_commit_sha":null,"homepage":"https://3em.dev","language":"Rust","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/three-em.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null}},"created_at":"2021-11-15T01:17:28.000Z","updated_at":"2024-11-12T21:13:37.000Z","dependencies_parsed_at":"2023-11-29T04:34:16.855Z","dependency_job_id":"9d8d59c5-673e-4abf-b4ad-abd88068be6a","html_url":"https://github.com/three-em/3em","commit_stats":{"total_commits":404,"total_committers":6,"mean_commits":67.33333333333333,"dds":0.5965346534653465,"last_synced_commit":"d75e2e6ac08ed3397667aed70a796649d1a116af"},"previous_names":[],"tags_count":26,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/three-em%2F3em","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/three-em%2F3em/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/three-em%2F3em/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/three-em%2F3em/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/three-em","download_url":"https://codeload.github.com/three-em/3em/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":246390879,"owners_count":20769475,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["arweave","rust","smart-contracts","smartweave","solidity","v8-engine","wasm"],"created_at":"2024-08-01T03:01:44.992Z","updated_at":"2025-10-20T18:27:40.978Z","avatar_url":"https://github.com/three-em.png","language":"Rust","funding_links":[],"categories":["Rust","Tools ⚙️"],"sub_categories":[],"readme":"\u003cp align=\"center\"\u003e\n\u003cimg src=\"https://3em.dev/logo.svg\" alt=\"3em Logo\" width=\"110\" height=\"110\"\u003e\n\u003ch3 align=\"center\"\u003e3em\u003c/h3\u003e\n\n\u003cp align=\"center\"\u003e\n    A blazingly fast, secure, reliable, multi-language execution environment for smart contracts inside the \u003ca href=\"https://arweave.org\"\u003eArweave\u003c/a\u003e ecosystem.\n  \u003c/p\u003e\n\u003c/p\u003e\n\n\u003cp align=\"center\"\u003e\nSpecial thanks to:\n\u003cul\u003e\n    \u003cli\u003e\n        \u003ca href=\"https://verto.exchange\"\u003eVerto Exchange\u003c/a\u003e for incubating this project as well as all their members which have been key part of conceiving 3em.\n    \u003c/li\u003e\n\u003c/ul\u003e\n\u003c/p\u003e\n\n## Purpose\n\n3em was conceived as an alternate solution to\n[SmartWeave](https://github.com/ArweaveTeam/SmartWeave) while still\naccomplishing the same goal: Simple \u0026 Scalable smart contracts on the Arweave\nprotocol.\n\nAfter receiving multiple feedback from different individuals and teams, we\nrealize there were 3 main issues that needed to be solved:\n\n- Speed\n- Security\n- Multi-language support\n\nFor more information on how we solved the issues mentioned above, please refer\nto our\n[technical guide](https://github.com/three-em/3em/tree/main/docs/technical_guide.md).\n\n## Install\n\n**With Shell:**\n\n```sh\ncurl -fsSL https://3em.dev/install.sh | sh\n```\n\n**With PowerShell:**\n\n```powershell\niwr https://3em.dev/install.ps1 -useb | iex\n```\n\n## CLI benchmarks\n\nMeasures:\n\n- Startup time\n- Filesystem cache\n- Execution performance\n- Interaction loading\n\n```bash\n$ hyperfine 'target/release/bench' 'target/release/bench_evm' 'target/release/bench_wasm' 'node tools/benchmarks/smartweave/index.js' 'target/release/bench_fh' -r 20 --export-json bench.json\n```\n\n![](tools/benchmarks/bench_mean.png)\n\n![](tools/benchmarks/bench_times.png)\n\n- The JavaScript contract used in `3em JS` and `SmartWeave JS` is\n  `t9T7DIOGxx4VWXoCEeYYarFYeERTpWIC1V3y-BPZgKE`.\n- The WebAssembly contract source used in `3em WASM` can be found\n  [here](testdata/01_wasm/01_wasm.rs). The block height is **not** fixed.\n- The EVM contract source used in `3em EVM` can be found\n  [here](testdata/evm/state1.sol). The block height is **not** fixed.\n- There are functional differences between evm and wasm contracts and the number\n  of interactions (except the JavaScript contract).\n- `fh` = Fixed height of `749180`\n- The gateway used is `arweave.net`\n\n## Multi-language support\n\n3em supports contracts written in:\n\n- JavaScript\n- WebAssembly (Rust, AssemblyScript, etc.)\n- EVM bytecode (Solidity, Yul, etc)\n\nPlease refer to the\n[\"helpers\"](https://github.com/three-em/3em/tree/main/helpers) for details on\nwriting contracts.\n\n## Javascript Library\n3EM can be integrated in both client and server side through the Javascript library.\n\nPlease [click here](https://github.com/three-em/3em/tree/main/js#executecontract) for more information.\n\n## Smartweave Compatability\n\n3em follows the SmartWeave\n[contract design](https://github.com/ArweaveTeam/SmartWeave/blob/master/CONTRACT-GUIDE.md).\nThis essentially means two things:\n\n- Contracts need to be deployed to Arweave in order for 3EM to run them\n- 3em is capable of running existing Smartweave contracts and exposes backward\n  compatible APIs (like the `SmartWeave` global)\n\n## Determinism\n\n3em execution is deterministic. Random operations have a constant seed and Non\ndeterministic APIs are overriden with their deterministic version. You can read\nmore about it in our technical guide.\n\n## CLI\n\n### Available Commands\n\n- `three_em run`\n  - Runs a contract deployed to Arweave given certain options.\n- `three_em dry-run`\n  - Runs a local contract which has not yet been deployed to Arweave.\n  - Only JS and WASM contracts are accepted during `dry-run`.\n- `three_em serve`\n  - Spawns a local server with an endpoint to evaluate contracts.\n\n---\n\n### run\n\nThe following flags are available for `three_em run`:\n\n- `--host` | `string`\n  - URL of gateway to be used during execution\n  - Default: arweave.net\n- `--port` | `number`\n  - Port of gateway to be used during execution\n  - Default: 443\n- `--protocol` | `string`\n  - Network protocol to be used during execution\n  - Default: https\n- `--contract-id` | `string`\n  - ID of contract to be evaluated\n- `--pretty-print` | `boolean`\n  - Whether output should be printed in a prettified JSON form\n  - Default: false\n- `--no-print` | `boolean`\n  - Whether output should be printed in the console. True will not print any\n    output\n  - Default: false\n- `--show-validity` | `boolean`\n  - Whether output should contain the validity table of evaluated interactions\n- `--save` | `string`\n  - If provided, it contains a file path where output will be saved in JSON form\n- `--benchmark` | `boolean`\n  - Whether to benchmark the execution time of the contract\n  - Default: false\n- `--height` | `number`\n  - Maximum height to be used during evaluation\n- `--no-cache`\n  - Whether it should use 3em's built-in cache system\n- `--show-errors`\n  - Whether errors from failed interactions should be printed\n\n**Example**\n\n```shell\nthree_em run --contract-id t9T7DIOGxx4VWXoCEeYYarFYeERTpWIC1V3y-BPZgKE\n```\n\n---\n\n### dry-run\n\nThe following flags are available for `three_em dry-run`:\n\n- `--file`\n  - File path for dry run JSON input.\n  - Please refer to our dry run documentation\n    [here](https://github.com/three-em/3em/tree/main/docs/dry_run.md)\n- `--host` | `string`\n  - URL of gateway to be used during execution\n  - Default: arweave.net\n- `--port` | `number`\n  - Port of gateway to be used during execution\n  - Default: 443\n- `--protocol` | `string`\n  - Network protocol to be used during execution\n  - Default: https\n- `--pretty-print` | `boolean`\n  - Whether output should be printed in a prettified JSON form\n  - Default: false\n- `--show-validity` | `boolean`\n  - Whether output should contain the validity table of evaluated interactions\n\n`dry-run` requires a JSON file containing the _dry-run_ structure, for more\ninformation about it please refer to\n[our dry run guide](https://github.com/three-em/3em/tree/main/docs/dry_run.md).\n\n\n--------\n\n### serve\n\nThe following flags are available for `three_em serve`:\n\n- `--host` | `string`\n  - Host to be used by the server\n  - Default: 127.0.0.1\n- `--port` | `number`\n  - Port to be used by the server\n  - Default: 5400\n\n**Example**\n\n```shell\nthree_em serve\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fthree-em%2F3em","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fthree-em%2F3em","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fthree-em%2F3em/lists"}