Using cairo programming language
Scarb
- A package manager for cairo projects on starknet
- Similar to Cargo for rust or npm for javascript
- Official Documentation docs.swmansion.com/scarb/
Starknet Foundry
- A toolchain for developing Starknet smart contracts. It helps with writing, deploying, and testing your smart contracts. It is inspired by Foundry.
Starkli
- Starknet Command-line Interface, like query starknet and make transactions and
- Official Documentation book.starkli.rs/
Deploy a contract
- copy private key from EOA
- paste command
starkli signer keystore from-key account0_keystore.json- starkli - starknet cli tool
- signer - subcommand for managing signing keys/accounts
- keystore - subcommand for keystore operations
- from-key - create a keystore file from an existing private key
- account0_keystore.json - the output filename for your encrypted keystore
- you will be prompt to paste your private key, and create a password to encrypt keystore file
- starkli account fetch
<wallet address>--rpc<sepolia testnet RPC endpoint>--output account0_account.json - The two file
account0_account.jsonandaccount0_keystore.jsonenable starkli to sign and send transactions just like your account scarb buildgenerate target folder, which has contract_class.json- compiled bytecode - the actual excecutable contract code
- ABI Application binary interface
- contract metadata - information needed for deployment
- starkli declare
target/dev/*.contract_class.json--rpc<sepolia testnet RPC endpoint>--accountaccount0_account.json--keystoreaccount0_keystore.json- starkli - the starknet cli tool
- declare - uploads your contract bytecode to the network
- target/dev/two *.contract_class.json path to your compiled contract file
8. starkli deploy
<CLASS HASH DECLARED> --rpc <sepolia testnet RPC endpoint> --account account0_account.json --keystore account0_keystore.json
Starknet Devnet
A local testnet for starknet
Openzeppelin
What is it used for?
This library consists of a set of reuseable components to build custom smart contrats
Introduce some useful modules
Upgrade
provide functions which take care of managing upgradeable deployments of contracts
Access control
what is incredibly important is "who is allowed to do this thing"