diff --git a/listings/ch00-getting-started/storage/.gitignore b/listings/ch00-getting-started/storage/.gitignore new file mode 100644 index 00000000..eb5a316c --- /dev/null +++ b/listings/ch00-getting-started/storage/.gitignore @@ -0,0 +1 @@ +target diff --git a/listings/ch00-getting-started/storage/Scarb.lock b/listings/ch00-getting-started/storage/Scarb.lock new file mode 100644 index 00000000..9b4d3726 --- /dev/null +++ b/listings/ch00-getting-started/storage/Scarb.lock @@ -0,0 +1,6 @@ +# Code generated by scarb DO NOT EDIT. +version = 1 + +[[package]] +name = "storage" +version = "0.1.0" diff --git a/listings/ch00-getting-started/storage/Scarb.toml b/listings/ch00-getting-started/storage/Scarb.toml new file mode 100644 index 00000000..733ef08d --- /dev/null +++ b/listings/ch00-getting-started/storage/Scarb.toml @@ -0,0 +1,8 @@ +[package] +name = "storage" +version = "0.1.0" + +[dependencies] +starknet = ">=2.3.0" + +[[target.starknet-contract]] diff --git a/listings/ch00-getting-started/storage/assets/MinimalContract.2.3.0.contract_class.json b/listings/ch00-getting-started/storage/assets/MinimalContract.2.3.0.contract_class.json new file mode 100644 index 00000000..82be378d --- /dev/null +++ b/listings/ch00-getting-started/storage/assets/MinimalContract.2.3.0.contract_class.json @@ -0,0 +1,34 @@ +{ + "sierra_program": [ + "0x1", + "0x3", + "0x0", + "0x2", + "0x3", + "0x0", + "0x1", + "0xff", + "0x0", + "0x4", + "0x0" + ], + "sierra_program_debug_info": { + "type_names": [], + "libfunc_names": [], + "user_func_names": [] + }, + "contract_class_version": "0.1.0", + "entry_points_by_type": { + "EXTERNAL": [], + "L1_HANDLER": [], + "CONSTRUCTOR": [] + }, + "abi": [ + { + "type": "event", + "name": "storage::minimal_contract::MinimalContract::Event", + "kind": "enum", + "variants": [] + } + ] +} diff --git a/listings/ch00-getting-started/storage/src/contract.cairo b/listings/ch00-getting-started/storage/src/contract.cairo new file mode 100644 index 00000000..e66252f0 --- /dev/null +++ b/listings/ch00-getting-started/storage/src/contract.cairo @@ -0,0 +1,9 @@ +#[starknet::contract] +mod Contract { + #[storage] + struct Storage { + a: u128, + b: u8, + c: u256 + } +} diff --git a/listings/ch00-getting-started/storage/src/lib.cairo b/listings/ch00-getting-started/storage/src/lib.cairo new file mode 100644 index 00000000..ec8c6136 --- /dev/null +++ b/listings/ch00-getting-started/storage/src/lib.cairo @@ -0,0 +1,2 @@ +mod minimal_contract; +mod contract; diff --git a/listings/ch00-getting-started/storage/src/minimal_contract.cairo b/listings/ch00-getting-started/storage/src/minimal_contract.cairo new file mode 100644 index 00000000..22291808 --- /dev/null +++ b/listings/ch00-getting-started/storage/src/minimal_contract.cairo @@ -0,0 +1,5 @@ +#[starknet::contract] +mod Contract { + #[storage] + struct Storage {} +}