Skip to content
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

Support more encoding/decoding types #170

Open
dawsbot opened this issue Nov 5, 2022 · 8 comments
Open

Support more encoding/decoding types #170

dawsbot opened this issue Nov 5, 2022 · 8 comments
Labels
Epic Big or tricky

Comments

@dawsbot
Copy link
Owner

dawsbot commented Nov 5, 2022

There are several encoding + decoding types that are not yet working.

Enabling signing will be dangerous until most or all encoding/decoding types are working with essential-eth.

To start, we should find production smart-contracts which have unique and difficult types then add support via jest tests like was done with the CRV smart-contract tests. The readme outlines types that are already covered properly. Assume all others will error and this issue is to track adding support.

@dawsbot dawsbot added the Epic Big or tricky label Nov 5, 2022
@KeKs0r
Copy link
Contributor

KeKs0r commented Dec 6, 2022

@dawsbot
I am wondering if it makes sense to reimplement them all from scratch, or maybe copy paste the decoders from ethers (https://github.com/ethers-io/ethers.js/tree/master/packages/abi/src.ts/coders) and replace the ethers specific things like BigInt etc.

Would you be open to such a PR, or would you prefer building the decoding logic from scratch?

@dawsbot
Copy link
Owner Author

dawsbot commented Dec 8, 2022

@KeKs0r I'm open to being inspired by ethers, but the current encode/decode is hand-written to be tiny. If you can recreate ethers' encode/decode but tiny, then that might as well be a separate npm module which you also PR to ethers 🙌

Let me know what you think!

@KeKs0r
Copy link
Contributor

KeKs0r commented Dec 8, 2022

Thanks for considering. I started to dive into the efforts and realized that even the encoders of ethers are deeply entangled with a lot of code of their codebase. So might not be as simple as I thought. I might give it a try over the weekend anyways.

@dawsbot
Copy link
Owner Author

dawsbot commented Jan 12, 2023

Hi @KeKs0r any thoughts on the above? I can help make suggestions or jump-in if you have anything mid-way completed on this 🙏

@KeKs0r
Copy link
Contributor

KeKs0r commented Jan 24, 2023

Hey @dawsbot, I migrated to ethers to build an initial feature, since I realized it would take quite some efforts to reimplement in essentia-eth. Sorry for dropping the ball on this.

@dawsbot
Copy link
Owner Author

dawsbot commented Jan 26, 2023

All good, I still do that at-times too whenever it's too big of a lift to implement inside here. Could you help me out by linking me to a smart-contract which contains these data-types @KeKs0r ? I'll do the rest.

@KeKs0r
Copy link
Contributor

KeKs0r commented Feb 23, 2023

Unfortunately I dont remember which contracts exactly hit some issues, but I have a list of contracts that I am calling in my code and their abis.
I uploaded the ABIs to this gist: https://gist.github.com/KeKs0r/84d77cfa8c4fdcfc22e2fef93b5bfda6
Those are contracts from Uniswap and Sushiswap.

@dawsbot
Copy link
Owner Author

dawsbot commented Feb 25, 2023

Incredible, that should be plenty to help with debugging this @KeKs0r 🙏

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Epic Big or tricky
Projects
None yet
Development

No branches or pull requests

2 participants