Skip to content
This repository has been archived by the owner on Dec 27, 2023. It is now read-only.

abigen #66

Closed
quazzuk opened this issue Feb 4, 2023 · 2 comments
Closed

abigen #66

quazzuk opened this issue Feb 4, 2023 · 2 comments

Comments

@quazzuk
Copy link

quazzuk commented Feb 4, 2023

Hey Guys

Great work on cfmm-rs and uniswapv3_math-rs!!

Just had a question... I noticed in uniswap_v3.rs you are defining the swap event signature and writing code to decode swap logs, can't you instead just generate this code using abigen with ethers-rs?

Something like:

let event = UniswapV3PoolEvents::decode_log(&RawLog {
    topics: log.topics,
    data: log.data.to_vec(),
});

Thanks
Q

@0xKitsune
Copy link
Owner

Yes I believe this (or something similar) would work. I don't think there is a runtime cost to getting the event signatures from abigen but that would be the only reason to use a const the way we do now.

As for decoding the log, this was just an early implementation that just hasnt been updated yet, feel free to open up an issue/PR if you would like!

@quazzuk
Copy link
Author

quazzuk commented Feb 8, 2023

Yeah, I'll take a look.

@quazzuk quazzuk closed this as completed Feb 8, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants