AI prompts
base on High-performance, well-tested & documented core libraries for Ethereum, in Rust # Alloy
Core libraries at the root of the Rust Ethereum ecosystem.
Alloy is a rewrite of [`ethers-rs`] from the ground up, with exciting new
features, high performance, and excellent docs.
We have a [book](https://alloy.rs) on all things Alloy and many [examples](https://github.com/alloy-rs/examples) to help you get started.
[`ethers-rs`] has been deprecated, and users are recommended to migrate to Alloy.
[`ethers-rs`]: https://github.com/gakonst/ethers-rs
[![Build Status][actions-badge]][actions-url]
[![Telegram chat][telegram-badge]][telegram-url]
[actions-badge]: https://img.shields.io/github/actions/workflow/status/alloy-rs/core/ci.yml?branch=main&style=for-the-badge
[actions-url]: https://github.com/alloy-rs/core/actions?query=branch%3Amain
[telegram-badge]: https://img.shields.io/endpoint?color=neon&style=for-the-badge&url=https%3A%2F%2Ftg.sumanjay.workers.dev%2Fethers_rs
[telegram-url]: https://t.me/ethers_rs
## Overview
This repository contains the following crates:
- [`alloy-core`]: Meta-crate for the entire project
- [`alloy-primitives`] - Primitive integer and byte types
- [`alloy-sol-types`] - Compile-time [ABI] and [EIP-712] implementations
- [`alloy-sol-macro`] - The [`sol!`] procedural macro
- [`alloy-dyn-abi`] - Run-time [ABI] and [EIP-712] implementations
- [`alloy-json-abi`] - Full Ethereum [JSON-ABI] implementation
- [`alloy-sol-type-parser`] - A simple parser for Solidity type strings
- [`syn-solidity`] - [`syn`]-powered Solidity parser
[`alloy-core`]: https://github.com/alloy-rs/core/tree/main/crates/core
[`alloy-primitives`]: https://github.com/alloy-rs/core/tree/main/crates/primitives
[`alloy-sol-types`]: https://github.com/alloy-rs/core/tree/main/crates/sol-types
[`alloy-sol-macro`]: https://github.com/alloy-rs/core/tree/main/crates/sol-macro
[`alloy-dyn-abi`]: https://github.com/alloy-rs/core/tree/main/crates/dyn-abi
[`alloy-json-abi`]: https://github.com/alloy-rs/core/tree/main/crates/json-abi
[`alloy-sol-type-parser`]: https://github.com/alloy-rs/core/tree/main/crates/sol-type-parser
[`syn-solidity`]: https://github.com/alloy-rs/core/tree/main/crates/syn-solidity
[JSON-ABI]: https://docs.soliditylang.org/en/latest/abi-spec.html#json
[ABI]: https://docs.soliditylang.org/en/latest/abi-spec.html
[EIP-712]: https://eips.ethereum.org/EIPS/eip-712
[`sol!`]: https://docs.rs/alloy-sol-macro/latest/alloy_sol_macro/macro.sol.html
[`syn`]: https://github.com/dtolnay/syn
## Supported Rust Versions (MSRV)
<!--
When updating this, also update:
- clippy.toml
- Cargo.toml
- .github/workflows/ci.yml
-->
The current MSRV (minimum supported rust version) is 1.81.
Alloy will keep a rolling MSRV policy of **at least** two versions behind the
latest stable release (so if the latest stable release is 1.58, we would
support 1.56).
Note that the MSRV is not increased automatically, and only as part of a patch
(pre-1.0) or minor (post-1.0) release.
## Contributing
Thanks for your help improving the project! We are so happy to have you! We have
[a contributing guide](./CONTRIBUTING.md) to help you get involved in the
Alloy project.
Pull requests will not be merged unless CI passes, so please ensure that your
contribution follows the linting rules and passes clippy.
## WASM support
We provide full support for all the `wasm*-*` targets. If a crate does not
build on a WASM target, please [open an issue].
When building for the `wasm32-unknown-unknown` target and the `"getrandom"`
feature is enabled, compilation for the `getrandom` crate will fail. This is
expected: see [their documentation][getrandom] for more details.
To fix this, either disable the `"getrandom"` feature on `alloy-core` or add
`getrandom` to your dependencies with the `"js"` feature enabled:
```toml
getrandom = { version = "0.2", features = ["js"] }
```
There is currently no plan to provide an official JS/TS-accessible library
interface, as we believe [viem] or [ethers.js] serve that need very well.
[open an issue]: https://github.com/alloy-rs/core/issues/new/choose
[getrandom]: https://docs.rs/getrandom/#webassembly-support
[viem]: https://viem.sh
[ethers.js]: https://docs.ethers.io/v6/
## Note on `no_std`
All crates in this workspace should support `no_std` environments, with the
`alloc` crate. If you find a crate that does not support `no_std`, please
[open an issue].
[open an issue]: https://github.com/alloy-rs/core/issues/new/choose
## Credits
None of these crates would have been possible without the great work done in:
- [`ethers.js`](https://github.com/ethers-io/ethers.js/)
- [`rust-web3`](https://github.com/tomusdrw/rust-web3/)
- [`ruint`](https://github.com/recmo/uint)
- [`ethabi`](https://github.com/rust-ethereum/ethabi)
- [`ethcontract-rs`](https://github.com/gnosis/ethcontract-rs/)
- [`guac_rs`](https://github.com/althea-net/guac_rs/)
#### License
<sup>
Licensed under either of <a href="LICENSE-APACHE">Apache License, Version
2.0</a> or <a href="LICENSE-MIT">MIT license</a> at your option.
</sup>
<br>
<sub>
Unless you explicitly state otherwise, any contribution intentionally submitted
for inclusion in these crates by you, as defined in the Apache-2.0 license,
shall be dual licensed as above, without any additional terms or conditions.
</sub>
", Assign "at most 3 tags" to the expected json: {"id":"2722","tags":[]} "only from the tags list I provide: [{"id":77,"name":"3d"},{"id":89,"name":"agent"},{"id":17,"name":"ai"},{"id":54,"name":"algorithm"},{"id":24,"name":"api"},{"id":44,"name":"authentication"},{"id":3,"name":"aws"},{"id":27,"name":"backend"},{"id":60,"name":"benchmark"},{"id":72,"name":"best-practices"},{"id":39,"name":"bitcoin"},{"id":37,"name":"blockchain"},{"id":1,"name":"blog"},{"id":45,"name":"bundler"},{"id":58,"name":"cache"},{"id":21,"name":"chat"},{"id":49,"name":"cicd"},{"id":4,"name":"cli"},{"id":64,"name":"cloud-native"},{"id":48,"name":"cms"},{"id":61,"name":"compiler"},{"id":68,"name":"containerization"},{"id":92,"name":"crm"},{"id":34,"name":"data"},{"id":47,"name":"database"},{"id":8,"name":"declarative-gui "},{"id":9,"name":"deploy-tool"},{"id":53,"name":"desktop-app"},{"id":6,"name":"dev-exp-lib"},{"id":59,"name":"dev-tool"},{"id":13,"name":"ecommerce"},{"id":26,"name":"editor"},{"id":66,"name":"emulator"},{"id":62,"name":"filesystem"},{"id":80,"name":"finance"},{"id":15,"name":"firmware"},{"id":73,"name":"for-fun"},{"id":2,"name":"framework"},{"id":11,"name":"frontend"},{"id":22,"name":"game"},{"id":81,"name":"game-engine "},{"id":23,"name":"graphql"},{"id":84,"name":"gui"},{"id":91,"name":"http"},{"id":5,"name":"http-client"},{"id":51,"name":"iac"},{"id":30,"name":"ide"},{"id":78,"name":"iot"},{"id":40,"name":"json"},{"id":83,"name":"julian"},{"id":38,"name":"k8s"},{"id":31,"name":"language"},{"id":10,"name":"learning-resource"},{"id":33,"name":"lib"},{"id":41,"name":"linter"},{"id":28,"name":"lms"},{"id":16,"name":"logging"},{"id":76,"name":"low-code"},{"id":90,"name":"message-queue"},{"id":42,"name":"mobile-app"},{"id":18,"name":"monitoring"},{"id":36,"name":"networking"},{"id":7,"name":"node-version"},{"id":55,"name":"nosql"},{"id":57,"name":"observability"},{"id":46,"name":"orm"},{"id":52,"name":"os"},{"id":14,"name":"parser"},{"id":74,"name":"react"},{"id":82,"name":"real-time"},{"id":56,"name":"robot"},{"id":65,"name":"runtime"},{"id":32,"name":"sdk"},{"id":71,"name":"search"},{"id":63,"name":"secrets"},{"id":25,"name":"security"},{"id":85,"name":"server"},{"id":86,"name":"serverless"},{"id":70,"name":"storage"},{"id":75,"name":"system-design"},{"id":79,"name":"terminal"},{"id":29,"name":"testing"},{"id":12,"name":"ui"},{"id":50,"name":"ux"},{"id":88,"name":"video"},{"id":20,"name":"web-app"},{"id":35,"name":"web-server"},{"id":43,"name":"webassembly"},{"id":69,"name":"workflow"},{"id":87,"name":"yaml"}]" returns me the "expected json"