NethermindEth / warp

Warp - Bringing Solidity to Starknet at warp speed. Warp is a Solidity to Cairo Compiler, this allows teams to write/migrate Solidity to Cairo for easy onboarding into the StarkNet ecosystem.
https://nethermind.io/warp/
Apache License 2.0
754 stars 70 forks source link

translate int conversions to Cairo 1 #1070

Closed temyurchenko closed 1 year ago

temyurchenko commented 1 year ago

Instead of generating Cairo functions, we use generic capabilities of Cairo 1 to write a single static function in warplib.

Additionally we remove some usages of old functions, but not all of them, since they are tied to much into some subsystems, like calldata and storage. This will be finished in future work.

temyurchenko commented 1 year ago

I see two warnings of this kind: https://typescript-eslint.io/rules/no-non-null-assertion/.

The non-null-check operator "!" is used in two, seemingly to me, perfectly reasonable places. It is basically equivalent to saying «the max int type is 256 bytes wide». Furthermore, I can see this operator being useful in other static contexts, like accessing elements of a static array. It might be reasonable to remove this option from eslint, and check validity of using such an operator on a case-by-case basis.