kkrt-labs / kakarot-ssj

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

Implement eth_get_balance #990

Closed saimeunt closed 2 months ago

saimeunt commented 2 months ago

This PR implements eth_get_balance and use it instead of querying the balanceOf function of the native_token in the codebase. It also fixes a suspected bug in get_starknet_address from KakarotCore.

Pull Request type

Please check the type of change your PR introduces:

What is the current behavior?

The eth_get_balance is not implemented and thus we need to query the native_token directly in several parts of the codebase.

Resolves: #941

What is the new behavior?

The eth_get_balance is now implemented and replicates its eth_getBalance counterpart in the EVM.

Does this introduce a breaking change?


This change is Reviewable

saimeunt commented 2 months ago

@enitrat Thank you for your quick review and your Cairo tips, I made the requested changes by following your best practices insights.

I will apply to #991 as I'd like to continue my work on Kakarot so this is appreciated! 🙌