Skip to content

Commit

Permalink
Merge pull request #159 from EjembiEmmanuel/main
Browse files Browse the repository at this point in the history
feat: remove kakarot support
  • Loading branch information
Darlington02 authored Dec 9, 2024
2 parents 47b5876 + ef7db91 commit d0bc192
Show file tree
Hide file tree
Showing 5 changed files with 15 additions and 81 deletions.
7 changes: 6 additions & 1 deletion .github/workflows/build_contract.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
run: cd contracts && scarb build
5 changes: 5 additions & 0 deletions .github/workflows/test_contract.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
25 changes: 3 additions & 22 deletions bin/cli.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,6 @@ const installPackage = async () => {
"fullstack",
"debugger",
"dojo",
"kakarot",
];
console.log("Available package types:");
packageTypeChoices.forEach((type, index) =>
Expand All @@ -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) {
Expand Down Expand Up @@ -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`,
Expand Down Expand Up @@ -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");
}
Expand All @@ -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`);
Expand Down
49 changes: 0 additions & 49 deletions docs/src/chapter_5.md
Original file line number Diff line number Diff line change
Expand Up @@ -108,55 +108,6 @@ To migrate your dojo project, from the base repository run:
npm run migrate-dojo --name=<PROJECT_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=<PATH_TO_CONTRACT> --rpc-url=<RPC_URL> --private-key=<PRIVATE_KEY>
```
If you need to specify constructor args, run:
```
npm run deploy-kakarot-evm-contract --contract-path=<PATH_TO_CONTRACT> --constructor-args=<CONSTRUCTOR_ARGS> --rpc-url=<RPC_URL> --private-key=<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=<PATH_TO_KEYSTORE_FILE> --account=<PATH_TO_ACCOUNTS_FILE> --contract-name=<CONTRACT_NAME> --url=<RPC_URL> --fee-token=<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=<PATH_TO_KEYSTORE_FILE> --account=<PATH_TO_ACCOUNTS_FILE> --url=<RPC_URL> --fee-token=<FEE_TOKEN> --class-hash=<CLASS_HASH>
```

### Whitelist Contract
To whitelist a contract, from the base repository run:
```
npm run whitelist-contract --contract-address=<CONTRACT_ADDRESS>
```

## User Interface Scripts

The following are scripts from `Starknet-Scaffold` for handling the user interface.
Expand Down
10 changes: 1 addition & 9 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down

0 comments on commit d0bc192

Please sign in to comment.