-
Notifications
You must be signed in to change notification settings - Fork 464
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add uniswap V2 WETH-USDC swap example #1353
Conversation
8241d25
to
8cbffa7
Compare
@onbjerg Should be fixed. I think |
@pawurb you can use |
examples/uniswap_v2_usdc_swap.rs
Outdated
let mut alloydb = AlloyDB::new(client, None); | ||
let mut cache_db = CacheDB::new(EmptyDB::default()); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
you can just do CacheDB::new(AlloyDB::new(client, None))
, then calls to e.g. db.basic
will automatically first get pulled from the alloy provider, and then stored in the cache db! that avoids you needing to do what you are doing on eg L45, L48 etc
pending comment #1353 (comment) |
@rakita I don't understand, I think I've already applied suggestions from this comment. |
That is true, didn't see that is a outdated comment. lgtm, merging |
Related to #1084 . This example shows common use cases not covered by other examples.