diff --git a/api/cairo b/api/cairo deleted file mode 160000 index ad5570f0..00000000 --- a/api/cairo +++ /dev/null @@ -1 +0,0 @@ -Subproject commit ad5570f0f25dbbffd9daedf02df140ff9e7291e4 diff --git a/api/cairo_compilers/build.sh b/api/cairo_compilers/build.sh deleted file mode 100644 index 6f8a71fd..00000000 --- a/api/cairo_compilers/build.sh +++ /dev/null @@ -1,24 +0,0 @@ -#!/bin/bash - -echo "Building cairo compilers" - -directories=$(ls -d */) - -for dir in $directories -do - echo "Building $dir" - - if [[ ! -f "$dir/Cargo.toml" ]]; then - echo "Invalid cairo version provided $dir" - exit 1 - fi - - cd "$dir" || exit 1 - - cargo build --bin starknet-compile --release - cargo build --bin starknet-sierra-compile --release - - cd .. - - echo "Done building $dir" -done diff --git a/api/cairo_compilers/v2.6.0 b/api/cairo_compilers/v2.6.0 deleted file mode 160000 index b741c26c..00000000 --- a/api/cairo_compilers/v2.6.0 +++ /dev/null @@ -1 +0,0 @@ -Subproject commit b741c26c553fd9fa3246cee91fd5c637f225cdb9 diff --git a/api/cairo_compilers/v2.6.1 b/api/cairo_compilers/v2.6.1 deleted file mode 160000 index b741c26c..00000000 --- a/api/cairo_compilers/v2.6.1 +++ /dev/null @@ -1 +0,0 @@ -Subproject commit b741c26c553fd9fa3246cee91fd5c637f225cdb9 diff --git a/api/cairo_compilers/v2.6.2 b/api/cairo_compilers/v2.6.2 deleted file mode 160000 index b741c26c..00000000 --- a/api/cairo_compilers/v2.6.2 +++ /dev/null @@ -1 +0,0 @@ -Subproject commit b741c26c553fd9fa3246cee91fd5c637f225cdb9 diff --git a/api/cairo_compilers/v2.6.3 b/api/cairo_compilers/v2.6.3 deleted file mode 160000 index b741c26c..00000000 --- a/api/cairo_compilers/v2.6.3 +++ /dev/null @@ -1 +0,0 @@ -Subproject commit b741c26c553fd9fa3246cee91fd5c637f225cdb9 diff --git a/api/cairo_compilers/v2.7.0 b/api/cairo_compilers/v2.7.0 deleted file mode 160000 index b741c26c..00000000 --- a/api/cairo_compilers/v2.7.0 +++ /dev/null @@ -1 +0,0 @@ -Subproject commit b741c26c553fd9fa3246cee91fd5c637f225cdb9 diff --git a/api/cairo_compilers/v2.8.2 b/api/cairo_compilers/v2.8.2 deleted file mode 160000 index 14b1d8c1..00000000 --- a/api/cairo_compilers/v2.8.2 +++ /dev/null @@ -1 +0,0 @@ -Subproject commit 14b1d8c1566b3346545eb7e65724e3d0cbb80a81 diff --git a/api/cairo_compilers/v2.8.4 b/api/cairo_compilers/v2.8.4 deleted file mode 160000 index 4a674b58..00000000 --- a/api/cairo_compilers/v2.8.4 +++ /dev/null @@ -1 +0,0 @@ -Subproject commit 4a674b58e65f67a5c521f81ac4c34710dee53202 diff --git a/api/compiled_cairo_artifacts/contract.json b/api/compiled_cairo_artifacts/contract.json deleted file mode 100644 index 873eb161..00000000 --- a/api/compiled_cairo_artifacts/contract.json +++ /dev/null @@ -1 +0,0 @@ -{"contract_definition":{"entry_points_by_type":{"EXTERNAL":[{"selector":"0x35a8bb8492337e79bdc674d6f31ac448f8017e26cc7bfe3144fb5d886fe5369","offset":"0xb"}],"L1_HANDLER":[],"CONSTRUCTOR":[]},"program":"H4sIAIHFfWQC/+1cW2/bOBb+K4GfdouuQVKUSA2wD07i6QTjJF3b3ZnZoiBkmU6E2JJHkpt4ivz3JXWxJVmyqYvbLLABkkjU4SHP5Ts8lEh+6z06bhj0frr41kPi7+dvPdubc3HVW/GV528/W+svF/+8CPjDigvCvjWf/+3vvfcXPcu2eRA4syVnge2tueTxucfYynJcxiRF/vrZt9Zr7geH95In465sl/k83Phu74sgWSy9Zxb6lv3kuA9sboVW1EtrvSuM7h98b7MWV1BU8RaLgIfiBryKO58vuC/4cubMIwlfX1+/yAezjbMMHTfusW+5D5zZj9x+ippNGvrcAy+YIossFnPxa1MAgOw4eEGAzkTJIvnlcSkGRJDA9EFcCNNnQJP15a/klZRSZMgq6ZN8FQrSphf7h6IKzTDie9qkZHGym0mjkneGNu3nXt69EII9StjPs12JSguMIA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Uz4RV6PTGbNxthftp3diFRYPy4Og3k90Ot/+pMWV5VoPyaKcXWkcFl9f/wvJMmS7bVIAAA==","abi":[{"name":"add","type":"function","inputs":[{"name":"a","type":"felt"},{"name":"b","type":"felt"}],"outputs":[{"name":"c","type":"felt"}],"stateMutability":"view"}]},"class_hash":"0x361af2ece54938621be8ecedf52d9343ab30c48ccc31c6e0e665b88f9b5b0a5","version":18} \ No newline at end of file diff --git a/api/scripts/deploy.js b/api/scripts/deploy.js deleted file mode 100644 index d38de0fb..00000000 --- a/api/scripts/deploy.js +++ /dev/null @@ -1,57 +0,0 @@ - - // Right click on the script name and hit "Run" to execute - (async () => { - try { - console.log('deploy to starknet...') - const compiledCairoContract = await remix.call('fileManager', 'readFile', 'compiled_cairo_artifacts/contract.json'); - const compiledContract = starknet.json.parse(compiledCairoContract); - const NetworkBaseUrls = { - 'goerli-alpha': 'https://alpha4.starknet.io', - 'mainnet-alpha': 'https://alpha-mainnet.starknet.io' - } - - const payload = { - compiledContract: compiledContract, - transactionInputs: [], // if you have constructor args please add your args - network: 'goerli-alpha' // mainnet-alpha or goerli-alpha or devnet - }; - - const baseUrl = payload['network'] ? NetworkBaseUrls[payload['network']] : payload['baseUrl']; - - const response = await fetch(baseUrl + '/gateway/add_transaction', { - method: 'POST', - headers: { - accept: 'application/json', - }, - body: JSON.stringify({ - type: 'DEPLOY', - contract_address_salt: '0x01319c1c1f0400688eafde419346d0b9876cd3d6a4daaa9f4768a3f5a810c543', - contract_definition: payload.compiledContract.contract_definition, - constructor_calldata: payload.transactionInputs - }) - }); - - const responseData = await response.json(); - - // const methodResponse = await callContract({ - // contract_address: responseData.address, - // entry_point_selector: getSelectorFromName("YOUR_FUNCTION_NAME"), - // calldata: ["1"], - // }); - - // const result = methodResponse.result[0]; - // result contains the return value of the method you gave to callContract - if(response.status === 200) { - console.log('Deployed contract address: ', responseData.address) - console.log('Deployed contract transaction hash: ', responseData.transaction_hash) - console.log('Deployment successful.') - } else { - console.log('Deployed contract error: ', responseData) - console.log('Deployment failed.') - } - - } catch (exception) { - console.log(exception.message) - } - })() - \ No newline at end of file diff --git a/scarb-test/Scarb.toml b/scarb-test/Scarb.toml deleted file mode 100644 index bdbf2255..00000000 --- a/scarb-test/Scarb.toml +++ /dev/null @@ -1,10 +0,0 @@ -[package] -name = "_test" -version = "0.1.0" - -[dependencies] -starknet = "2.6.4" - -[[target.starknet-contract]] -sierra = true -casm = true diff --git a/scarb-test/src/lib.cairo b/scarb-test/src/lib.cairo deleted file mode 100644 index 2590d84b..00000000 --- a/scarb-test/src/lib.cairo +++ /dev/null @@ -1,32 +0,0 @@ -#[starknet::interface] -trait IBalance { - // Returns the current balance. - fn get(self: @T) -> u256; - // Increases the balance by the given amount. - fn increase(ref self: T, a: u256); -} - -#[starknet::contract] -mod Balance { - use traits::Into; - - #[storage] - struct Storage { - value: u256, - } - - #[constructor] - fn constructor(ref self: ContractState, value_: u256) { - self.value.write(value_); - } - - #[abi(embed_v0)] - impl Balance of super::IBalance { - fn get(self: @ContractState) -> u256 { - self.value.read() - } - fn increase(ref self: ContractState, a: u256) { - self.value.write( self.value.read() + a ); - } - } -} diff --git a/src/features/Compilation/services/CompilationService.ts b/src/features/Compilation/services/CompilationService.ts deleted file mode 100644 index 94520c7f..00000000 --- a/src/features/Compilation/services/CompilationService.ts +++ /dev/null @@ -1,95 +0,0 @@ -import { type RemixClient } from "@remixproject/plugin-api"; -import { asyncFetch } from "../../../utils/async_fetch"; -import { apiUrl } from "../../../utils/network"; -import { type CompilationResult, type File, type CompilationError } from "../types"; - -export class CompilationError extends Error { - constructor( - message: string, - public readonly type: "syntax" | "runtime" | "network", - public readonly details?: unknown - ) { - super(message); - this.name = "CompilationError"; - } -} - -export interface CompilationService { - compileSingleFile(file: File): Promise; - compileProject(scarbPath: string, workspacePath: string): Promise; -} - -export class CairoCompilationService implements CompilationService { - constructor( - private readonly remixClient: RemixClient, - private readonly hashDir: string - ) {} - - async compileSingleFile(file: File): Promise { - try { - // Save file to backend - await this.saveFileToBackend(file); - - // Create compilation request - const request = { - files: [ - { - file_name: "src/lib.rs", - real_path: file.path, - file_content: file.content - } - ] - }; - - // Compile - const result = await asyncFetch("/compile-async", "compile-result", request); - return JSON.parse(result) as CompilationResult; - } catch (error) { - throw new CompilationError( - "Failed to compile file", - "runtime", - error instanceof Error ? error.message : error - ); - } - } - - async compileProject(scarbPath: string, workspacePath: string): Promise { - try { - const result = await asyncFetch( - `compile-scarb-async/${this.hashDir}/${workspacePath.replace(".", "")}/${scarbPath}`, - "compile-scarb-result" - ); - - const compilationResult = JSON.parse(result) as CompilationResult; - if (compilationResult.status !== "Success") { - throw new Error(compilationResult.message ?? "Unknown compilation error"); - } - - return compilationResult; - } catch (error) { - throw new CompilationError( - "Failed to compile project", - "runtime", - error instanceof Error ? error.message : error - ); - } - } - - private async saveFileToBackend(file: File): Promise { - try { - await fetch(`${apiUrl}/save_code/${this.hashDir}/${file.path}`, { - method: "POST", - body: file.content, - headers: { - "Content-Type": "application/octet-stream" - } - }); - } catch (error) { - throw new CompilationError( - "Failed to save file to backend", - "network", - error instanceof Error ? error.message : error - ); - } - } -} \ No newline at end of file