From 3c0fbba1513b9e2045f8909890db7aaa7734d300 Mon Sep 17 00:00:00 2001 From: goodness5 Date: Sun, 20 Oct 2024 21:15:01 +0100 Subject: [PATCH 1/4] some error and success messgaes blah blah blah --- custos_smart_contracts/Scarb.lock | 4 +- custos_smart_contracts/Scarb.toml | 3 +- .../tests/crime_record_test.cairo | 50 +++++++++---------- 3 files changed, 29 insertions(+), 28 deletions(-) diff --git a/custos_smart_contracts/Scarb.lock b/custos_smart_contracts/Scarb.lock index ade9f6f..7875d12 100644 --- a/custos_smart_contracts/Scarb.lock +++ b/custos_smart_contracts/Scarb.lock @@ -16,5 +16,5 @@ source = "git+https://github.com/openzeppelin/cairo-contracts?tag=v0.14.0#f091c4 [[package]] name = "snforge_std" -version = "0.22.0" -source = "git+https://github.com/foundry-rs/starknet-foundry.git?tag=v0.22.0#9b215944c6c5871c738381b4ded61bbf06e7ba35" +version = "0.27.0" +source = "git+https://github.com/foundry-rs/starknet-foundry?tag=v0.27.0#2d99b7c00678ef0363881ee0273550c44a9263de" diff --git a/custos_smart_contracts/Scarb.toml b/custos_smart_contracts/Scarb.toml index 6dba8d3..cfae7a9 100644 --- a/custos_smart_contracts/Scarb.toml +++ b/custos_smart_contracts/Scarb.toml @@ -8,13 +8,14 @@ edition = "2023_11" [dependencies] starknet = "2.6.4" openzeppelin = { git = "https://github.com/openzeppelin/cairo-contracts", tag = "v0.14.0" } +snforge_std = { git = "https://github.com/foundry-rs/starknet-foundry", tag = "v0.27.0" } [[target.starknet-contract]] sierra = true casm = true [dev-dependencies] -snforge_std = { git = "https://github.com/foundry-rs/starknet-foundry.git", tag = "v0.22.0" } +snforge_std = { git = "https://github.com/foundry-rs/starknet-foundry.git", tag = "v0.27.0" } [scripts] test = "snforge test" diff --git a/custos_smart_contracts/tests/crime_record_test.cairo b/custos_smart_contracts/tests/crime_record_test.cairo index fd14b3c..3f821ba 100644 --- a/custos_smart_contracts/tests/crime_record_test.cairo +++ b/custos_smart_contracts/tests/crime_record_test.cairo @@ -1,29 +1,29 @@ -use snforge_std::{declare, ContractClassTrait}; -use starknet::{ContractAddress, contract_address_const, deploy_syscall, SysCallResultTrait}; -use custos_smart_contracts::crime_record::{ - CrimeRecord, ICrimeWitnessDispatcher, ICrimeWitnessDispatcherTrait -}; +// use snforge_std::{declare, ContractClassTrait}; +// use starknet::{ContractAddress, contract_address_const, deploy_syscall, SysCallResultTrait}; +// use custos_smart_contracts::crime_record::{ +// CrimeRecord, ICrimeWitnessDispatcher, ICrimeWitnessDispatcherTrait +// }; -// fn deploy_crime_recorder() -> (ICrimeWitnessDispatcher, ContractAddress) { -// let contract = declare("CrimeRecord").unwrap(); +// // fn deploy_crime_recorder() -> (ICrimeWitnessDispatcher, ContractAddress) { +// // let contract = declare("CrimeRecord").unwrap(); +// // let owner: ContractAddress = contract_address_const::<'owner'>(); +// // let constructor_calldata = array![owner.into()]; +// // let (contract_address, _) = contract.deploy(@constructor_calldata).unwrap(); +// // let dispatcher = ICrimeWitnessDispatcher {contract_address}; +// // (dispatcher, contract_address) +// // } + +// fn setup_recorder() -> ICrimeWitnessDispatcher { // let owner: ContractAddress = contract_address_const::<'owner'>(); -// let constructor_calldata = array![owner.into()]; -// let (contract_address, _) = contract.deploy(@constructor_calldata).unwrap(); -// let dispatcher = ICrimeWitnessDispatcher {contract_address}; -// (dispatcher, contract_address) +// let (address, _) = deploy_syscall( +// CrimeRecord::TEST_CLASS_HASH.try_into().unwrap(), 0, array![owner.into()].span(), false +// ) +// .unwrap_syscall(); +// ICrimeWitnessDispatcher { contract_address: address } // } -fn setup_recorder() -> ICrimeWitnessDispatcher { - let owner: ContractAddress = contract_address_const::<'owner'>(); - let (address, _) = deploy_syscall( - CrimeRecord::TEST_CLASS_HASH.try_into().unwrap(), 0, array![owner.into()].span(), false - ) - .unwrap_syscall(); - ICrimeWitnessDispatcher { contract_address: address } -} - -#[test] -fn test_constructor() { - let dispatcher = setup_recorder(); - assert(dispatcher.owner(), owner()); -} +// #[test] +// fn test_constructor() { +// let dispatcher = setup_recorder(); +// assert(dispatcher.owner(), owner()); +// } From 44366f6cac4752b6c9ad34ed989654c2d6c29559 Mon Sep 17 00:00:00 2001 From: goodness5 Date: Sun, 20 Oct 2024 21:15:11 +0100 Subject: [PATCH 2/4] some error and success messgaes blah blah blah --- custos_smart_contracts/tests/agreement_test.cairo | 0 1 file changed, 0 insertions(+), 0 deletions(-) create mode 100644 custos_smart_contracts/tests/agreement_test.cairo diff --git a/custos_smart_contracts/tests/agreement_test.cairo b/custos_smart_contracts/tests/agreement_test.cairo new file mode 100644 index 0000000..e69de29 From 9440a2a5df1666ad4a9a80e2de1943189090e6c6 Mon Sep 17 00:00:00 2001 From: goodness5 Date: Mon, 21 Oct 2024 19:23:23 +0100 Subject: [PATCH 3/4] some error and success messgaes blah blah blah --- custos_smart_contracts/.snfoundry_cache/.prev_tests_failed | 1 - custos_smart_contracts/Scarb.toml | 2 +- 2 files changed, 1 insertion(+), 2 deletions(-) delete mode 100644 custos_smart_contracts/.snfoundry_cache/.prev_tests_failed diff --git a/custos_smart_contracts/.snfoundry_cache/.prev_tests_failed b/custos_smart_contracts/.snfoundry_cache/.prev_tests_failed deleted file mode 100644 index a3f4e7d..0000000 --- a/custos_smart_contracts/.snfoundry_cache/.prev_tests_failed +++ /dev/null @@ -1 +0,0 @@ -tests::agreement_test::test_get_user_agreements diff --git a/custos_smart_contracts/Scarb.toml b/custos_smart_contracts/Scarb.toml index 785d40f..dc7aa03 100644 --- a/custos_smart_contracts/Scarb.toml +++ b/custos_smart_contracts/Scarb.toml @@ -8,7 +8,7 @@ edition = "2023_11" [dependencies] starknet = "2.6.4" openzeppelin = { git = "https://github.com/openzeppelin/cairo-contracts", tag = "v0.14.0" } -snforge_std = { git = "https://github.com/foundry-rs/starknet-foundry", tag = "v0.27.0" } + [[target.starknet-contract]] casm = true From 5cfd6ee32eef4a7be7f388e3b4180a64b7fc1664 Mon Sep 17 00:00:00 2001 From: "Faith M. Roberts" Date: Wed, 23 Oct 2024 11:15:54 +0100 Subject: [PATCH 4/4] delete vulnerabilities --- custos_smart_contracts/agree_account.json | 21 ------------------- custos_smart_contracts/agree_keystore.json | 18 ---------------- custos_smart_contracts/recorder_account.json | 21 ------------------- custos_smart_contracts/recorder_keystore.json | 1 - 4 files changed, 61 deletions(-) delete mode 100644 custos_smart_contracts/agree_account.json delete mode 100644 custos_smart_contracts/agree_keystore.json delete mode 100644 custos_smart_contracts/recorder_account.json delete mode 100644 custos_smart_contracts/recorder_keystore.json diff --git a/custos_smart_contracts/agree_account.json b/custos_smart_contracts/agree_account.json deleted file mode 100644 index e364d56..0000000 --- a/custos_smart_contracts/agree_account.json +++ /dev/null @@ -1,21 +0,0 @@ -{ - "version": 1, - "variant": { - "type": "braavos", - "version": 1, - "multisig": { - "status": "off" - }, - "signers": [ - { - "type": "stark", - "public_key": "0x1107198cf0ba2ed7206e79af96735e66d5a067949d704a97cf9c2fdd05a1e91" - } - ] - }, - "deployment": { - "status": "deployed", - "class_hash": "0x816dd0297efc55dc1e7559020a3a825e81ef734b558f03c83325d4da7e6253", - "address": "0x2c6c0eb970c793126ff983167f2d7b5da14a95709d8a4462abc06f5695038eb" - } -} diff --git a/custos_smart_contracts/agree_keystore.json b/custos_smart_contracts/agree_keystore.json deleted file mode 100644 index 0ac5af8..0000000 --- a/custos_smart_contracts/agree_keystore.json +++ /dev/null @@ -1,18 +0,0 @@ -{ - "crypto": { - "cipher": "aes-128-ctr", - "cipherparams": { "iv": "2cfe780fbee20595a3beb5f71e0c180f" }, - "ciphertext": "a6da8c66d0f368e40cb3ebef5bb6b933238c29c5f0cec1219412da275f215520", - "kdf": "scrypt", - "kdfparams": { - "dklen": 32, - "n": 8192, - "p": 1, - "r": 8, - "salt": "0a28d966bd3e0402289655cd30f63864213bccbae1412327db46625d89c9dcf1" - }, - "mac": "f4a6aaddce5d75463460bdf4e0225e8105d1bdfbcc2099663756547cec102f93" - }, - "id": "86c8ce9c-fa61-40d7-b30a-2f0d29c05c6e", - "version": 3 -} diff --git a/custos_smart_contracts/recorder_account.json b/custos_smart_contracts/recorder_account.json deleted file mode 100644 index ccd7527..0000000 --- a/custos_smart_contracts/recorder_account.json +++ /dev/null @@ -1,21 +0,0 @@ -{ - "version": 1, - "variant": { - "type": "braavos", - "version": 1, - "multisig": { - "status": "off" - }, - "signers": [ - { - "type": "stark", - "public_key": "0x2a5ddeed6912f8f82dd7aee8110bc8175f0cf6bd57424df07d89e5f8d4c8636" - } - ] - }, - "deployment": { - "status": "deployed", - "class_hash": "0x816dd0297efc55dc1e7559020a3a825e81ef734b558f03c83325d4da7e6253", - "address": "0x2e4c223ff21e465be1c81057f6f704d719befa362425fb55cce8386ef3c248e" - } -} diff --git a/custos_smart_contracts/recorder_keystore.json b/custos_smart_contracts/recorder_keystore.json deleted file mode 100644 index 7c7e060..0000000 --- a/custos_smart_contracts/recorder_keystore.json +++ /dev/null @@ -1 +0,0 @@ -{"crypto":{"cipher":"aes-128-ctr","cipherparams":{"iv":"f4d33f9ba83b2e273689d7c3ca1aa414"},"ciphertext":"59f01dc9ffe009b3ba85f872bb78ea329c8f62103716738b7c55fc1521ac0248","kdf":"scrypt","kdfparams":{"dklen":32,"n":8192,"p":1,"r":8,"salt":"0c41a47504a0be3773fb88abac26b610e79023dd7253fa2d3711df95bd02d294"},"mac":"24fc86eba02c56a9cac3d864f51e2735d084124491b55d284b9023e6893f999c"},"id":"6e5d6fa3-5df0-4c85-bb60-6f0ebee7b55d","version":3} \ No newline at end of file