{"id":21221821,"url":"https://github.com/primitivefinance/ethers-rs","last_synced_at":"2025-07-22T13:35:08.359Z","repository":{"id":185107076,"uuid":"673002632","full_name":"primitivefinance/ethers-rs","owner":"primitivefinance","description":null,"archived":false,"fork":false,"pushed_at":"2023-07-31T17:40:20.000Z","size":6492,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":6,"default_branch":"master","last_synced_at":"2025-03-15T01:14:56.032Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Rust","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/primitivefinance.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG-OLD.md","contributing":"CONTRIBUTING.md","funding":null,"license":"LICENSE-APACHE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null}},"created_at":"2023-07-31T16:38:18.000Z","updated_at":"2023-07-31T16:39:51.000Z","dependencies_parsed_at":"2023-07-31T19:04:02.686Z","dependency_job_id":null,"html_url":"https://github.com/primitivefinance/ethers-rs","commit_stats":null,"previous_names":["primitivefinance/ethers-rs"],"tags_count":97,"template":false,"template_full_name":null,"purl":"pkg:github/primitivefinance/ethers-rs","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/primitivefinance%2Fethers-rs","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/primitivefinance%2Fethers-rs/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/primitivefinance%2Fethers-rs/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/primitivefinance%2Fethers-rs/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/primitivefinance","download_url":"https://codeload.github.com/primitivefinance/ethers-rs/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/primitivefinance%2Fethers-rs/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":266506253,"owners_count":23940021,"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","status":"online","status_checked_at":"2025-07-22T02:00:09.085Z","response_time":66,"last_error":null,"robots_txt_status":null,"robots_txt_updated_at":null,"robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"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":[],"created_at":"2024-11-20T22:34:09.280Z","updated_at":"2025-07-22T13:35:08.334Z","avatar_url":"https://github.com/primitivefinance.png","language":"Rust","funding_links":[],"categories":[],"sub_categories":[],"readme":"# \u003ch1 align=\"center\"\u003e ethers-rs \u003c/h1\u003e\n\n**A complete Ethereum and Celo Rust library**\n\n![Github Actions](https://github.com/gakonst/ethers-rs/workflows/Tests/badge.svg)\n[![Telegram Chat](https://img.shields.io/endpoint?color=neon\u0026style=flat-square\u0026url=https%3A%2F%2Ftg.sumanjay.workers.dev%2Fethers_rs)](https://t.me/ethers_rs)\n[![Crates.io][crates-badge]][crates-url]\n\n[crates-badge]: https://img.shields.io/crates/v/ethers.svg\n[crates-url]: https://crates.io/crates/ethers\n\n## Quickstart\n\nAdd this to your Cargo.toml:\n\n```toml\n[dependencies]\nethers = \"2.0\"\n```\n\nAnd this to your code:\n\n```rust\nuse ethers::prelude::*;\n```\n\n## Documentation\n\nView the API reference [here](https://docs.rs/ethers) or the online book [here](https://gakonst.com/ethers-rs).\n\nExamples are organized into individual crates under the `/examples` folder.\nYou can run any of the examples by executing:\n\n```bash\n# cargo run -p \u003cexample-crate-name\u003e --example \u003cname\u003e\ncargo run -p examples-big-numbers --example math_operations\n```\n\n## EVM-compatible chains support\n\nThere are many chains live which are Ethereum JSON-RPC \u0026 EVM compatible, but do not yet have\nsupport for [EIP-2718](https://eips.ethereum.org/EIPS/eip-2718) Typed Transactions. This means\nthat transactions submitted to them by default in ethers-rs will have invalid serialization. To\naddress that, you must use the `legacy` feature flag:\n\n```toml\n[dependencies]\nethers = { version = \"2.0\", features = [\"legacy\"] }\n```\n\n### Polygon support\n\nThere is abigen support for Polygon and the Mumbai test network. It is recommended that you set the `POLYGONSCAN_API_KEY` environment variable.\nYou can get one [here](https://polygonscan.io/apis).\n\n### Avalanche support\n\nThere is abigen support for Avalanche and the Fuji test network. It is recommended that you set the `SNOWTRACE_API_KEY` environment variable.\nYou can get one [here](https://snowtrace.io/apis).\n\n### Optimism support\n\nOptimism is supported via the `optimism` feature flag:\n\n```toml\n[dependencies]\nethers = { version = \"2.0\", features = [\"optimism\"] }\n```\n\nOptimism has a new transaction type: [Deposited Transactions](https://github.com/ethereum-optimism/optimism/blob/develop/specs/deposits.md#the-deposited-transaction-type)\nwith type ID `0x7E`, which requires 3 new fields:\n\n-   `sourceHash`: The hash which uniquely identifies the origin of the deposit\n-   `mint`: The ETH value to mint on L2.\n-   `isSystemTx`: True if the tx does not interact with the L2 block gas pool\n\n**Note:** the `optimism` and `celo` features are mutually exclusive.\n\n### Celo Support\n\n[Celo](https://celo.org) support is turned on via the feature-flag `celo`:\n\n```toml\n[dependencies]\nethers = { version = \"2.0\", features = [\"celo\"] }\n```\n\nCelo's transactions differ from Ethereum transactions by including 3 new fields:\n\n-   `fee_currency`: The currency fees are paid in (None for CELO, otherwise it's an Address)\n-   `gateway_fee_recipient`: The address of the fee recipient (None for no gateway fee paid)\n-   `gateway_fee`: Gateway fee amount (None for no gateway fee paid)\n\nThe feature flag enables these additional fields in the transaction request builders and\nin the transactions which are fetched over JSON-RPC.\n\n**Note:** the `optimism` and `celo` features are mutually exclusive.\n\n## Features\n\n-   [x] Ethereum JSON-RPC Client\n-   [x] Interacting and deploying smart contracts\n-   [x] Type safe smart contract bindings code generation\n-   [x] Querying past events\n-   [x] Event monitoring as `Stream`s\n-   [x] ENS as a first class citizen\n-   [x] Celo support\n-   [x] Polygon support\n-   [x] Avalanche support\n-   [x] Optimism support\n-   [x] Websockets / `eth_subscribe`\n-   [x] Hardware Wallet Support\n-   [x] Parity APIs (`tracing`, `parity_blockWithReceipts`)\n-   [x] Geth TxPool API\n-   [ ] WASM Bindings (see note)\n-   [ ] FFI Bindings (see note)\n-   [ ] CLI for common operations\n\n### Websockets\n\nWebsockets support is turned on via the feature-flag `ws`:\n\n```toml\n[dependencies]\nethers = { version = \"2.0\", features = [\"ws\"] }\n```\n\n### Interprocess Communication (IPC)\n\nIPC support is turned on via the feature-flag `ipc`:\n\n```toml\n[dependencies]\nethers = { version = \"2.0\", features = [\"ipc\"] }\n```\n\n### HTTP Secure (HTTPS)\n\nIf you are looking to connect to a HTTPS endpoint, then you need to enable the `rustls` or `openssl` feature.\nfeature-flags.\n\nTo enable `rustls`:\n\n```toml\n[dependencies]\nethers = { version = \"2.0\", features = [\"rustls\"] }\n```\n\nTo enable `openssl`:\n\n```toml\n[dependencies]\nethers = { version = \"2.0\", features = [\"openssl\"] }\n```\n\n## Note on WASM and FFI bindings\n\nYou should be able to build a wasm app that uses ethers-rs (see the [example](./examples/wasm) for reference).\nIf ethers fails to compile in WASM, please [open an issue][issue].\nThere is currently no plan to provide an official JS/TS-accessible library\ninterface, as we believe [viem](https://viem.sh) or [ethers.js](https://docs.ethers.io/v6/)\nserve that need very well.\n\nSimilarly, you should be able to build FFI bindings to ethers-rs. If ethers\nfails to compile in C library formats, please [open an issue][issue].\nThere is currently no plan to provide official FFI bindings.\n\n[issue]: https://github.com/gakonst/ethers-rs/issues/new/choose\n\n## Getting Help\n\nFirst, see if the answer to your question can be found in the [API documentation](https://docs.rs/ethers). If the answer\nis not there, try opening an [issue](https://github.com/gakonst/ethers-rs/issues/new) with the question.\n\nJoin the [ethers-rs telegram](https://t.me/ethers_rs) to chat with the community!\n\n## Contributing\n\nThanks for your help improving the project! We are so happy to have you! We have\n[a contributing guide](./CONTRIBUTING.md) to help you get involved in the ethers-rs project.\n\nIf you open a Pull Request, do not forget to add your changes in the [CHANGELOG](./CHANGELOG.md), ensure your code is\nproperly formatted with `cargo +nightly fmt` and that Clippy is happy `cargo clippy`; you can even try to let clippy fix simple\nissues itself: `cargo +nightly clippy --fix`\n\n### Running the tests\n\nTests require the following installed:\n\n1. [`solc`](https://docs.soliditylang.org/en/latest/installing-solidity.html) (\u003e=0.8.0). We also recommend using [svm](https://github.com/roynalnaruto/svm-rs) for more flexibility.\n2. [`anvil`](https://github.com/foundry-rs/foundry/blob/master/anvil/README.md)\n3. [`geth`](https://github.com/ethereum/go-ethereum)\n\nAdditionally, the `ETHERSCAN_API_KEY` environment variable has to be set to run [`ethers-etherscan`](./ethers-etherscan) tests.\nYou can get one [here](https://etherscan.io/apis).\n\n## Projects using ethers-rs\n\n-   [Yield Liquidator](https://github.com/yieldprotocol/yield-liquidator/): Liquidator for Yield Protocol\n-   [MEV Inspect](https://github.com/flashbots/mev-inspect-rs/): Miner Extractable Value inspector\n-   [Ethers CCIP-Read](https://github.com/ensdomains/ethers-ccip-read): Ethers middleware for ENS [CCIP-Read](https://eips.ethereum.org/EIPS/eip-3668) support\n-   [Ethers Flashbots](https://github.com/onbjerg/ethers-flashbots): Ethers middleware for [Flashbots](https://docs.flashbots.net)\n-   [Ethers Fireblocks](https://github.com/gakonst/ethers-fireblocks): Ethers middleware and signer for [Fireblocks](https://fireblocks.io)' API\n-   [Celo Threshold BLS DKG](https://github.com/celo-org/celo-threshold-bls-rs/): CLI for using Celo as a data availability network for the Joint-Feldman BLS DKG\n-   [Celo Plumo Prover](https://github.com/celo-org/plumo-prover): Creates Celo's ultralight client proof from on-chain data\n-   [Celo SNARK Setup Coordinator](https://github.com/celo-org/snark-setup-operator): Coordinator for executing a pipelined Groth16 SNARK setup\n-   [ERC-4337 Bundler](https://github.com/Vid201/aa-bundler/): Account Abstraction (ERC-4337) bundler\n\n## Credits\n\nThis library would not have been possible without the great work done in:\n\n-   [`ethers.js`](https://github.com/ethers-io/ethers.js/)\n-   [`rust-web3`](https://github.com/tomusdrw/rust-web3/)\n-   [`ethcontract-rs`](https://github.com/gnosis/ethcontract-rs/)\n-   [`guac_rs`](https://github.com/althea-net/guac_rs/)\n\nA lot of the code was inspired and adapted from them, to a unified and opinionated interface,\nbuilt with async/await and std futures from the ground up.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fprimitivefinance%2Fethers-rs","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fprimitivefinance%2Fethers-rs","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fprimitivefinance%2Fethers-rs/lists"}