alloy-rs / alloy-rs/alloy

[Feature] Expansive docs & more in depth examples

Open
#2,298 0 comments 0 reactions 0 assignees View on GitHub
enhancement
Dominant language
Rust
Stars
1.3k
Forks
668
Avg merge
2d 2h
Merged PRs (30d)
29

Description

### Component

other

### Describe the feature you would like

The docs don't seem to cover all the features & functionality of Alloy.

For example, there's no mention of testing or testing approaches, but while looking through the packages. I did see however that the docs were updated yesterday to include some new features, like `MockProvider`

Additionally, every reference/example is just simply in `fn main()`, this from my own experience makes the references not that applicable when trying to solve issues with their usage outside of the exact demonstrated usage.

What would be great:

- All features listed in the docs
- More complex examples, such as spawning subscriptions in a separate file, or running functions which require `tokio` runtime without assuming the tokio main decorator being placed on `fn main`
- A full test which spawns anvil, demonstrates creation, consumption and interaction with `SigningKey` & `Signer`
- Common conversions, while there are some examples, I've found issues with trying to align common types to the types requested from `sol!` parsed function signatures
- The examples for type conversions for the majority use hardcoded input types, while this does demonstrate expectations, this isn't a common scenario. What would have been brilliant as a reference, is taking 1 variable, and casting it to the common types. For example getting a Signer's address, then getting concating into a message to then sign that satisfies common Solidity signature params. (message: "Authorising App: 0x123...C0Ff33")

I imagine an example that could cover a few base's would be an NFT permit creating rust server. This could demonstrate consuming & using keys, responding to requests, signing, verifying & transacting, with some balance management thrown in. This is a common example seen in other library demonstrates which could be a bit more relatable for devs getting into using Rust & Alloy.

### Additional context

Background:

Predominantly Solidity, Forge, Hardhat, Dapp dev. Comfortable with Yul.

Not a lot of Rust experience, worked with Go for quite a while.

I usually look around for a reference project, like a production level repo but given this is usually closed source back end, finding references like that was a bit sparce.

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.