kkrt-labs / kakarot-ssj

Kakarot zkEVM - rewrite in the latest version of Cairo
https://www.kakarot.org
MIT License
137 stars 81 forks source link

feat: add `eth_chain_id` entrypoint #923

Closed enitrat closed 1 month ago

enitrat commented 1 month ago

Closes #920

bitfalt commented 1 month ago

hii! Is this issue open for contributors? If so I'd love to tackle this issue. I assume I would need to use get_tx_info().unbox() and then return the chain_id field after applying modulo 2**53, then refactor the code with the value returned from it.

onlydustapp[bot] commented 1 month ago

Hey @bitfalt! Thanks for showing interest. We've created an application for you to contribute to Kakarot zkEVM. Go check it out on OnlyDust!

enitrat commented 1 month ago

Hi! Yes, you can do it.

To help you, here's an existing implementation in old cairo.

https://github.com/kkrt-labs/kakarot/blob/7a83ddf6cfb7a69d995245291fe11c1d2444e408/src/kakarot/library.cairo#L124-L131

You could generally just find and replace all occurences of use of this tx_info.chain_id by a call to this function

bitfalt commented 1 month ago

Okay! Thank you so much for providing a link to the existing implementation, will start ASAP!