From 861bd81efe9ffd37cd76b29a755556dfd5f0f5b0 Mon Sep 17 00:00:00 2001 From: djeck1432 Date: Thu, 26 Sep 2024 12:17:55 +0200 Subject: [PATCH] add contract deploy flow --- contract_deploy.md | 33 +++++++++++++++++++++++++++++++++ 1 file changed, 33 insertions(+) create mode 100644 contract_deploy.md diff --git a/contract_deploy.md b/contract_deploy.md new file mode 100644 index 00000000..b9b4df73 --- /dev/null +++ b/contract_deploy.md @@ -0,0 +1,33 @@ +# Devnet setup and contract deployment + +### Required asdf plugins: +* scarb +* starknet-devnet +* starknet-foundry + +### Start devnet +`starknet-devnet --fork-network "http://178.32.172.148:6060/v0_7"` + +### Create and deploy sncast account +`sncast account create --url http://127.0.0.1:5050 --name acc` + +``` +curl http://127.0.0.1:5050/mint -X POST -d '{"address": "
", "amount": 500000000000000000, "unit": "FRI"}' -H "Content-Type: application/json" +``` + +`sncast account deploy --url http://127.0.0.1:5050 --name acc --fee-token strk` + +### Declare and deploy spotnet Core +In spotnet directory(it should compile it and then declare): +`sncast --account acc declare --url http://127.0.0.1:5050 --fee-token strk --contract-name Core` +After, deploy with generated class hash: + +``` +sncast --account acc deploy --url http://127.0.0.1:5050 --fee-token strk --class-hash --constructor-calldata 0x00000005dd3d2f4429af886cd1a3b08289dbcea99a294197e9eb43b0e0325b4b 0x04c0a5193d58f74fbace4b74dcf65481e734ed1714121bdc571da345540efa05 +``` + +Now access it by address. +#### Docs: +* https://foundry-rs.github.io/starknet-foundry/starknet/account.html +* https://foundry-rs.github.io/starknet-foundry/starknet/declare.html +* https://foundry-rs.github.io/starknet-foundry/starknet/deploy.html