Skip to content

Instantly share code, notes, and snippets.

@Th0rgal
Last active May 26, 2022 17:40
Show Gist options
  • Save Th0rgal/1026f2508bc5bc727dba2b5535fe5db5 to your computer and use it in GitHub Desktop.
Save Th0rgal/1026f2508bc5bc727dba2b5535fe5db5 to your computer and use it in GitHub Desktop.
Personal CheatSheet for programming on StarkNet

Checking transaction status

https://alpha4.starknet.io/feeder_gateway/get_transaction_receipt?transactionHash=

Using hints

Go to starkware/starknet/testing/starknet.py In the definition of deploy, you will see there the invocation of compile_starknet_files. Add the argument disable_hints_validation=True

Usage:

%{
print(ids.my_felt)
print(ids.my_struct.get_or_set_value("some_field", None))
exit()
%}

Std Lib

Maths (assert >, <, etc)

asserts:

https://github.com/starkware-libs/cairo-lang/blob/master/src/starkware/cairo/common/math.cairo

comparisons:

https://github.com/starkware-libs/cairo-lang/blob/master/src/starkware/cairo/common/math_cmp.cairo

For beginners

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment