pyenv install 3.9.14
pyenv local 3.9.14
python -m venv ./venv
source ./venv/bin/activate
pip3 install ecdsa fastecdsa sympy
pip3 install cairo-lang
# nile
sudo apt install -y libgmp3-dev
pip install cairo-nile
nile init
pytest tests
touch .env
# ACCOUNT_1=0x123456
# list starknet accounts
cat ~/.starknet_accounts/starknet_open_zeppelin_accounts.json
export STARKNET_NETWORK=alpha-goerli
export STARKNET_WALLET=starkware.starknet.wallets.open_zeppelin.OpenZeppelinAccount
# create account
starknet new_account
pip install cairo-nile openzeppelin-cairo-contracts
nile compile
nile node
-
account abstraction
-
remix
-
hello world
-
comments
-
felt
-
counter
-
function (input, outputs)
-
Reference 'syscall_ptr' was revoked (function must be defined before called)
-
revoked refs
-
variable
- let
- tempvar
- local?
- storage
-
assert
-
if / else
-
@storage_var - declares variable to be stored in storage
-
@external - function can be called by other users and contracts
-
@view - same as @external, in addition read-only
-
builtins
-
implicit args
-
import
-
token
-
wallet
-
math
-
boolean expressions
-
error
-
map
-
visibility
-
namespace
-
recursion
-
memory array
-
state variable array?
-
array calldata
-
pointer
-
struct
-
struct calldata
-
tuple
-
alloc
-
emit event
- low level emit_event
-
private data are not private
-
constructor
-
storage - multi values, struct,
-
storage with struct
-
sender
-
block info
-
tx info
-
interface, calling other contracts
-
delegate call (library call)
-
factory
-
L2 fees
-
L1 -> L2 fees
-
L2 -> L1 fees
-
L2 to L1
-
L1 to L2
-
default entry point
-
L1 default
-
library call l1 handler
-
hash (keccak, pedersen)
-
pedersen hash
-
ecdsa
-
signature
-
amm
-
token bridge
- cancel
- fee
-
cast
-
curve like amm?
-
cross chain amm
-
registers
- ap
- fp?
- pc
-
tools (nile)
cairo-compile test.cairo --output test_compiled.json
cairo-run \
--program=test_compiled.json --print_output \
--print_info --relocate_prints
cairo-compile felt.cairo --output felt_compiled.json
cairo-run --program felt_compiled.json --print_output --layout=small