diff --git a/.github/workflows/build_contract.yml b/.github/workflows/build_contract.yml index 65ec809..72d7990 100644 --- a/.github/workflows/build_contract.yml +++ b/.github/workflows/build_contract.yml @@ -9,8 +9,13 @@ jobs: runs-on: ubuntu-latest steps: - uses: actions/checkout@v3 + - uses: software-mansion/setup-scarb@v1 + with: + scarb-version: "2.8.2" + - name: Check cairo format run: cd contracts && scarb fmt --check + - name: Build cairo programs - run: cd contracts && scarb build \ No newline at end of file + run: cd contracts && scarb build diff --git a/.github/workflows/test_contract.yml b/.github/workflows/test_contract.yml index e6b71fc..041e236 100644 --- a/.github/workflows/test_contract.yml +++ b/.github/workflows/test_contract.yml @@ -8,9 +8,14 @@ jobs: runs-on: ubuntu-latest steps: - uses: actions/checkout@v3 + - uses: software-mansion/setup-scarb@v1 + with: + scarb-version: "2.8.2" + - uses: foundry-rs/setup-snfoundry@v3 with: starknet-foundry-version: 0.31.0 + - name: Run cairo tests run: cd contracts && snforge test diff --git a/bin/cli.mjs b/bin/cli.mjs index 37d5390..0e515c9 100755 --- a/bin/cli.mjs +++ b/bin/cli.mjs @@ -37,7 +37,6 @@ const installPackage = async () => { "fullstack", "debugger", "dojo", - "kakarot", ]; console.log("Available package types:"); packageTypeChoices.forEach((type, index) => @@ -47,7 +46,7 @@ const installPackage = async () => { let packageType; while (!packageType) { const packageTypeChoice = await askQuestion( - "Select the package type (1-5): " + `Select the package type (1-${packageTypeChoices.length}): ` ); packageType = packageTypeChoices[parseInt(packageTypeChoice) - 1]; if (!packageType) { @@ -86,11 +85,7 @@ const installPackage = async () => { "CNAME", ]; - if ( - packageType === "fullstack" || - packageType === "dojo" || - packageType === "kakarot" - ) { + if (packageType === "fullstack" || packageType === "dojo") { const FRONTEND_BASE_PATH = "frontend/src/app"; const componentsToRemove = [ `${FRONTEND_BASE_PATH}/burner`, @@ -169,18 +164,6 @@ const installPackage = async () => { recursive: true, force: true, }); - } else if (packageType == "kakarot") { - await exec("npm run initialize-kakarot"); - - await exec("npm run setup-kakarot"); - - const tool_versions = await getVersionsFromToolFile( - path.join(projectPath, "/contracts/.tool-versions") - ); - - await exec( - `npm run install --scarb-version=${tool_versions.scarb} --legacy-peer-deps` - ); } else if (packageType !== "contract_only") { await exec("npm run install --legacy-peer-deps"); } @@ -190,9 +173,7 @@ const installPackage = async () => { console.log("You can now run the scaffold with:"); console.log(` cd ${packageName}`); - if (packageType == "kakarot") { - console.log(` npm run start-kakarot`); - } else if (packageType == "contract_only") { + if (packageType == "contract_only") { console.log(` npm run devnet`); } else { console.log(` npm run start`); diff --git a/docs/src/chapter_5.md b/docs/src/chapter_5.md index 803e0dc..1a59de6 100644 --- a/docs/src/chapter_5.md +++ b/docs/src/chapter_5.md @@ -108,55 +108,6 @@ To migrate your dojo project, from the base repository run: npm run migrate-dojo --name= ``` -## Kakarot Scripts -Below are npm scripts provided by `Starknet-Scaffold` for your Kakarot development. - -### Setup Kakarot -To setup Kakarot, from the base repository run: -``` -npm run setup-kakarot -``` - -### Start Kakarot -To start Kakarot, from the base repository run: -``` -npm run start-kakarot -``` - -### Deploy Kakarot L1 Messaging Contracts to Local RPC -To deploy Kakarot l1 messaging contracts locally, from the base repository run: -``` -npm run deploy-kakarot-l1-messaging-contracts-local -``` - -### Deploy Kakarot EVM Contract -To deploy a Kakarot EVM contract, from the base repository run: -``` -npm run deploy-kakarot-evm-contract --contract-path= --rpc-url= --private-key= -``` -If you need to specify constructor args, run: -``` -npm run deploy-kakarot-evm-contract --contract-path= --constructor-args= --rpc-url= --private-key= -``` - -### Declare Cairo Contract Using Keystore -To declare a Cairo contract using keystore, from the base repository run: -``` -npm run keystore-declare-contract --keystore= --account= --contract-name= --url= --fee-token= -``` - -### Deploy Cairo Contract Using Keystore -To deploy a Cairo contract using keystore, from the base repository run: -``` -npm run keystore-deploy-contract --keystore= --account= --url= --fee-token= --class-hash= -``` - -### Whitelist Contract -To whitelist a contract, from the base repository run: -``` -npm run whitelist-contract --contract-address= -``` - ## User Interface Scripts The following are scripts from `Starknet-Scaffold` for handling the user interface. diff --git a/package.json b/package.json index 4fc791a..1f1fae8 100644 --- a/package.json +++ b/package.json @@ -23,15 +23,7 @@ "start": "cd frontend && npm run dev", "install": "cd scripts && bash install_tools.sh $(test -n \"$npm_config_scarb_version\" && echo --scarb $npm_config_scarb_version) $(test -n \"$npm_config_starknet_foundry_version\" && echo --starknet-foundry $npm_config_starknet_foundry_version) $(test -n \"$npm_config_foundry_version\" && echo --foundry $npm_config_foundry_version) $(test -n \"$npm_config_dojo_version\" && echo --dojo $npm_config_dojo_version) && cd ../frontend && npm install --legacy-peer-deps", "install-tools": "snfoundryup && foundryup", - "build-ui": "cd frontend && npm run build", - "initialize-kakarot": "git clone https://github.com/kkrt-labs/build-on-kakarot.git && rm -rf contracts && mkdir contracts && cp -r build-on-kakarot/cairo_contracts/. ./contracts && cp -r build-on-kakarot/katana.account.json ./contracts && cp -r build-on-kakarot/katana.key.json ./contracts && mkdir kakarot && cp -r build-on-kakarot/. ./kakarot && cd kakarot && rm -rf cairo_contracts && rm -rf .github && rm -rf .trunk && git init && cd .. && rm -rf build-on-kakarot", - "setup-kakarot": "cd kakarot && make setup", - "start-kakarot": "cd kakarot && make start", - "deploy-kakarot-l1-messaging-contracts-local": "cd kakarot && make deploy-l1", - "deploy-kakarot-evm-contract": "cd kakarot && forge create ${npm_config_contract_path} $(test -n \"$npm_config_constructor_args\" && echo --constructor-args $npm_config_constructor_args) --rpc-url ${npm_config_rpc_url} --private-key ${npm_config_private_key}", - "keystore-declare-contract": "cd contracts && sncast --keystore ${npm_config_keystore} --account ${npm_config_account} declare --contract-name ${npm_config_contract_name} --url ${npm_config_url} --fee-token ${npm_config_fee_token}", - "keystore-deploy-contract": "cd contracts && sncast --keystore ${npm_config_keystore} --account ${npm_config_account} deploy --url ${npm_config_url} --fee-token ${npm_config_fee_token} --class-hash ${npm_config_class_hash}", - "whitelist-contract": "cd kakarot && make whitelist-contract CONTRACT_ADDRESS=${npm_config_contract_address}" + "build-ui": "cd frontend && npm run build" }, "repository": { "type": "git",