risc0 / risc0-foundry-template

Template for integrating RISC Zero and Ethereum using Foundry and Bonsai
https://risczero.com
90 stars 53 forks source link

refactor!: replace ethabi with alloy #51

Closed austinabell closed 6 months ago

austinabell commented 1 year ago

Given that ethabi is unmaintained and a bit unwieldy to use, I figured I'd open a PR to suggest updating it to alloy since it seems to be the most promising alternative.

I also changed the input type to a uint32, since the contract previously panicked when above the 32 bit range anyway, but I can revert https://github.com/risc0/bonsai-foundry-template/commit/f41123ef5700b3165deb6e3662a216930d21f532 and https://github.com/risc0/bonsai-foundry-template/commit/4f45e5b3a6ceadfd49b6b334cd48e34f5e536557 if this is intentional for some reason.

Edit: moving to draft until I update the example utilities

Edit2: I didn't notice the ethers dependency with the Ethereum relay client. It might not be worth bringing this PR in, and very opinionated to mix two abi encoding libraries, but it seems reasonable in this case since the risc0 program is isolated and the main DevX barrier to entry. Feel free to close if not wanted as this is very opinionated.

mothran commented 1 year ago

Yeah once Alloy can replace both the ABI encode/decode as well as the provider interactions in the relay I suspect we will replace all use of ethers with it.

nategraf commented 6 months ago

We are in the process of a major refactor of this repo, and we are moving over to alloy in the process. I'm going to close this PR.