sncast account create --name Yusrah --network sepoliaSave the generated account address and fund it with Sepolia tokens for fees.
sncast account deploy --name Yusrah --network sepoliasncast account listSave the address for the Yusrah account.
Yusrah's acc. address 0x72658e0505e77137829e255912c52f8ca0ae73de5dde8332686b1adac3034f0
cd ~/Desktop/cairo-begining/cairo-bootcamp-6/starknet_contractsscarb buildsncast --account Yusrah \
declare \
--contract-name CounterV2 \
--network sepolia \
--waitSave the class_hash from the output.
class harsh 0x1e3a5b348490a07cea9f2788b81e46132c107724621e462494a5d20b67d458d
Replace:
PASTE_CLASS_HASH_HEREPASTE_YUSRAH_ADDRESS_HERE
sncast --account Yusrah \
deploy \
--class-hash PASTE_CLASS_HASH_HERE \
--constructor-calldata PASTE_YUSRAH_ADDRESS_HERE \
--network sepolia \
--waitSave the deployed contract_address.
contract address 0x031e9847e60b0e7224c095cd45e260aa96daa0cec22960a8ab1cc51949997f36
Replace PASTE_CONTRACT_ADDRESS_HERE.
sncast call \
--contract-address PASTE_CONTRACT_ADDRESS_HERE \
--function get_owner \
--network sepoliasncast call \
--contract-address PASTE_CONTRACT_ADDRESS_HERE \
--function get_count \
--network sepoliaExpected:
0
sncast --account Yusrah \
invoke \
--contract-address PASTE_CONTRACT_ADDRESS_HERE \
--function increase_count \
--calldata 10 \
--network sepolia \
--waitsncast call \
--contract-address PASTE_CONTRACT_ADDRESS_HERE \
--function get_count \
--network sepoliaExpected:
10
sncast --account Yusrah \
invoke \
--contract-address PASTE_CONTRACT_ADDRESS_HERE \
--function reduce_count \
--calldata 4 \
--network sepolia \
--waitsncast call \
--contract-address PASTE_CONTRACT_ADDRESS_HERE \
--function get_count \
--network sepoliaExpected:
6
sncast --account Yusrah \
invoke \
--contract-address PASTE_CONTRACT_ADDRESS_HERE \
--function reduce_count \
--calldata 200 \
--network sepolia \
--waitExpected:
An error because the subtraction underflows.
Replace OTHER_ACCOUNT_NAME.
sncast --account OTHER_ACCOUNT_NAME \
invoke \
--contract-address PASTE_CONTRACT_ADDRESS_HERE \
--function increase_count \
--calldata 1 \
--network sepolia \
--waitExpected:
An error because the caller is not the owner.
e.g of non owner address 0x00A879C0fEf9C803041Ab7524859879B5d68684f413890401566367ae38a3a10