diff --git a/live-session/week-6/soroban-hello-world/.gitignore b/live-session/week-6/soroban-hello-world/.gitignore index 67da8be0f..469cd0231 100644 --- a/live-session/week-6/soroban-hello-world/.gitignore +++ b/live-session/week-6/soroban-hello-world/.gitignore @@ -4,3 +4,6 @@ target # Local settings .soroban .stellar + +/test_snapshots +/target diff --git a/submissions/week-1/day-2/Wilfred_Adzer_Basic_Arithmetics_In_Rust/Arithmetic_operation.png b/submissions/week-1/day-2/Wilfred_Adzer_Basic_Arithmetics_In_Rust/Arithmetic_operation.png new file mode 100644 index 000000000..40c478b09 Binary files /dev/null and b/submissions/week-1/day-2/Wilfred_Adzer_Basic_Arithmetics_In_Rust/Arithmetic_operation.png differ diff --git a/submissions/week-1/day-2/Wilfred_Adzer_Basic_Arithmetics_In_Rust/Cargo.lock b/submissions/week-1/day-2/Wilfred_Adzer_Basic_Arithmetics_In_Rust/Cargo.lock new file mode 100644 index 000000000..5027e6ee7 --- /dev/null +++ b/submissions/week-1/day-2/Wilfred_Adzer_Basic_Arithmetics_In_Rust/Cargo.lock @@ -0,0 +1,7 @@ +# This file is automatically @generated by Cargo. +# It is not intended for manual editing. +version = 4 + +[[package]] +name = "Wilfred_Adzer_Basic_Arithmetics_In_Rust" +version = "0.1.0" diff --git a/submissions/week-1/day-2/Wilfred_Adzer_Basic_Arithmetics_In_Rust/Cargo.toml b/submissions/week-1/day-2/Wilfred_Adzer_Basic_Arithmetics_In_Rust/Cargo.toml new file mode 100644 index 000000000..b004845a1 --- /dev/null +++ b/submissions/week-1/day-2/Wilfred_Adzer_Basic_Arithmetics_In_Rust/Cargo.toml @@ -0,0 +1,6 @@ +[package] +name = "Wilfred_Adzer_Basic_Arithmetics_In_Rust" +version = "0.1.0" +edition = "2024" + +[dependencies] diff --git a/submissions/week-1/day-2/Wilfred_Adzer_Basic_Arithmetics_In_Rust/Wilfred_Rust_Book.md b/submissions/week-1/day-2/Wilfred_Adzer_Basic_Arithmetics_In_Rust/Wilfred_Rust_Book.md new file mode 100644 index 000000000..448f51b28 --- /dev/null +++ b/submissions/week-1/day-2/Wilfred_Adzer_Basic_Arithmetics_In_Rust/Wilfred_Rust_Book.md @@ -0,0 +1,72 @@ +RUST BOOK + +Chapter three +Scalar types are types that represent a single value +-Integers : - They represent a whole number and not part of a whole so they are called numbers without a fractional component, they can be unsigned or signed integers, the isize and usize types of integers depends on the computer arch you are running on +-Floating point numbers +-Booleans +-Characters + +Compound Types can group multiple types into one type, rust has two primitive compound types arrays and tuples +- Tuple types - Ways of grouping together a number of values with variety of types into one compound type. tuples have a fixed length once declared cannit grow or shrink in size + +fn main() { + let tup: (i32, f64, u8) = (500, 6.4, 1); +} +you can access vales in a tuple using the indexes of the value assigned to the tuple + +- Arrays - Elements in an array must be of the same type, arrays in rust have a fixed length +fn main() { + let a = [1, 2, 3, 4, 5]; +} +Arrays are used when you are dealing with fixed data types or when you knoe the data will not grow or shrink +let months = ["January", "February", "March", "April", "May", "June", "July", + "August", "September", "October", "November", "December"]; +let a: [i32; 5] = [1, 2, 3, 4, 5]; + +Arrays are used when you want your data to be allocated on a stack + +Accessing Array Elements + +An array is a single chunk of memory of a known, fixed size that can be allocated on the stack. You can access elements of an array using indexing, like this: + +fn main() { + let a = [1, 2, 3, 4, 5]; + + let first = a[0]; + let second = a[1]; +} + +Functions +The main.rs is the entry point to a rust program +Functions are a set of instructions given to a program to execute and bring forth outputs + +We define a function in Rust by entering the fn keyword followed by a function name and a set of parentheses. The curly brackets tell the compiler where the function body begins and ends. + + + Statements are instructions that perform some action and do not return a value. + Expressions evaluate to a resultant value. Let’s look at some examples. +In rust you have to state the type of return a value a function is expecting + + + +OWNERSHIP +Ownership is a set of rules that govern how rust manages memory + +The stack and the heap +Code uses both the stack and heap memory at runtime +Data added to a stack is done in an orderly fashion, data is pilled on top of another and when data is to be accessed on the stack it is done by the last in first out fashion. Data stored on the stack must be fixed sized data and must be known + +Data stored on the heap is less organized and does not need to have a fixed size, when a data is to be stored on a heap the memory allocator finds an empty space on the heap marks it as in use and returns the address of that location. The pointer is stored on the stack because it is fixed and known, the data is pushed to the heap and the pointer to the location of the data is stored on the stack + +Understanding memory management is key to understanding how the rust programing language works + +When your code calls a function, the values passed into the function (including, potentially, pointers to data on the heap) and the function’s local variables get pushed onto the stack. When the function is over, those values get popped off the stack. + +Ownership Rules + + Each value in Rust has an owner. + There can only be one owner at a time. + When the owner goes out of scope, the value will be dropped. + + diff --git a/submissions/week-1/day-2/Wilfred_Adzer_Basic_Arithmetics_In_Rust/src/Operation.rs b/submissions/week-1/day-2/Wilfred_Adzer_Basic_Arithmetics_In_Rust/src/Operation.rs new file mode 100644 index 000000000..2e9f7d5d1 --- /dev/null +++ b/submissions/week-1/day-2/Wilfred_Adzer_Basic_Arithmetics_In_Rust/src/Operation.rs @@ -0,0 +1,18 @@ +pub fn add(a: u64, b:u64)-> u64 { + a + b +} + + +pub fn sub(a:u64, b:u64) -> u64 { + a - b +} + + +pub fn mul(a:u64, b:u64) -> u64 { + a * b +} + + +pub fn div(a:u64, b:u64)-> u64 { + a/b +} \ No newline at end of file diff --git a/submissions/week-1/day-2/Wilfred_Adzer_Basic_Arithmetics_In_Rust/src/main.rs b/submissions/week-1/day-2/Wilfred_Adzer_Basic_Arithmetics_In_Rust/src/main.rs new file mode 100644 index 000000000..783f6a891 --- /dev/null +++ b/submissions/week-1/day-2/Wilfred_Adzer_Basic_Arithmetics_In_Rust/src/main.rs @@ -0,0 +1,17 @@ +mod Operation; + +fn main() { + + let a = 10; + let b = 5; + + + + + println!("Addition: {a} + {b} = {}", Operation::add(a,b)); + println!("Subtraction: {a} + {b} = {}", Operation::sub(a,b)); + println!("Multiplication: {a} + {b} = {}", Operation::mul(a,b)); + println!("Division: {a} + {b} = {}", Operation::div(a,b)); + + +} diff --git a/submissions/week-1/day-2/Wilfred_Adzer_Basic_Arithmetics_In_Rust/target/.rustc_info.json b/submissions/week-1/day-2/Wilfred_Adzer_Basic_Arithmetics_In_Rust/target/.rustc_info.json new file mode 100644 index 000000000..44087ea94 --- /dev/null +++ b/submissions/week-1/day-2/Wilfred_Adzer_Basic_Arithmetics_In_Rust/target/.rustc_info.json @@ -0,0 +1 @@ +{"rustc_fingerprint":11283209983122246465,"outputs":{"17747080675513052775":{"success":true,"status":"","code":0,"stdout":"rustc 1.85.0 (4d91de4e4 2025-02-17)\nbinary: rustc\ncommit-hash: 4d91de4e48198da2e33413efdcd9cd2cc0c46688\ncommit-date: 2025-02-17\nhost: x86_64-unknown-linux-gnu\nrelease: 1.85.0\nLLVM version: 19.1.7\n","stderr":""},"13331785392996375709":{"success":true,"status":"","code":0,"stdout":"___\nlib___.rlib\nlib___.so\nlib___.so\nlib___.a\nlib___.so\n/home/wilfred/.rustup/toolchains/stable-x86_64-unknown-linux-gnu\noff\npacked\nunpacked\n___\ndebug_assertions\npanic=\"unwind\"\nproc_macro\ntarget_abi=\"\"\ntarget_arch=\"x86_64\"\ntarget_endian=\"little\"\ntarget_env=\"gnu\"\ntarget_family=\"unix\"\ntarget_feature=\"fxsr\"\ntarget_feature=\"sse\"\ntarget_feature=\"sse2\"\ntarget_has_atomic=\"16\"\ntarget_has_atomic=\"32\"\ntarget_has_atomic=\"64\"\ntarget_has_atomic=\"8\"\ntarget_has_atomic=\"ptr\"\ntarget_os=\"linux\"\ntarget_pointer_width=\"64\"\ntarget_vendor=\"unknown\"\nunix\n","stderr":""}},"successes":{}} \ No newline at end of file diff --git a/submissions/week-1/day-2/Wilfred_Adzer_Basic_Arithmetics_In_Rust/target/CACHEDIR.TAG b/submissions/week-1/day-2/Wilfred_Adzer_Basic_Arithmetics_In_Rust/target/CACHEDIR.TAG new file mode 100644 index 000000000..20d7c319c --- /dev/null +++ b/submissions/week-1/day-2/Wilfred_Adzer_Basic_Arithmetics_In_Rust/target/CACHEDIR.TAG @@ -0,0 +1,3 @@ +Signature: 8a477f597d28d172789f06886806bc55 +# This file is a cache directory tag created by cargo. +# For information about cache directory tags see https://bford.info/cachedir/ diff --git a/submissions/week-1/day-2/Wilfred_Adzer_Basic_Arithmetics_In_Rust/target/debug/.cargo-lock b/submissions/week-1/day-2/Wilfred_Adzer_Basic_Arithmetics_In_Rust/target/debug/.cargo-lock new file mode 100644 index 000000000..e69de29bb diff --git a/submissions/week-1/day-2/Wilfred_Adzer_Basic_Arithmetics_In_Rust/target/debug/.fingerprint/Wilfred_Adzer_Basic_Arithmetics_In_Rust-f49849a7a125ed57/bin-Wilfred_Adzer_Basic_Arithmetics_In_Rust b/submissions/week-1/day-2/Wilfred_Adzer_Basic_Arithmetics_In_Rust/target/debug/.fingerprint/Wilfred_Adzer_Basic_Arithmetics_In_Rust-f49849a7a125ed57/bin-Wilfred_Adzer_Basic_Arithmetics_In_Rust new file mode 100644 index 000000000..2108bcc56 --- /dev/null +++ b/submissions/week-1/day-2/Wilfred_Adzer_Basic_Arithmetics_In_Rust/target/debug/.fingerprint/Wilfred_Adzer_Basic_Arithmetics_In_Rust-f49849a7a125ed57/bin-Wilfred_Adzer_Basic_Arithmetics_In_Rust @@ -0,0 +1 @@ +e08f7436ba7978d7 \ No newline at end of file diff --git a/submissions/week-1/day-2/Wilfred_Adzer_Basic_Arithmetics_In_Rust/target/debug/.fingerprint/Wilfred_Adzer_Basic_Arithmetics_In_Rust-f49849a7a125ed57/bin-Wilfred_Adzer_Basic_Arithmetics_In_Rust.json b/submissions/week-1/day-2/Wilfred_Adzer_Basic_Arithmetics_In_Rust/target/debug/.fingerprint/Wilfred_Adzer_Basic_Arithmetics_In_Rust-f49849a7a125ed57/bin-Wilfred_Adzer_Basic_Arithmetics_In_Rust.json new file mode 100644 index 000000000..043f23fa1 --- /dev/null +++ b/submissions/week-1/day-2/Wilfred_Adzer_Basic_Arithmetics_In_Rust/target/debug/.fingerprint/Wilfred_Adzer_Basic_Arithmetics_In_Rust-f49849a7a125ed57/bin-Wilfred_Adzer_Basic_Arithmetics_In_Rust.json @@ -0,0 +1 @@ +{"rustc":8277423686421874925,"features":"[]","declared_features":"[]","target":3885547685639333307,"profile":8731458305071235362,"path":4942398508502643691,"deps":[],"local":[{"CheckDepInfo":{"dep_info":"debug/.fingerprint/Wilfred_Adzer_Basic_Arithmetics_In_Rust-f49849a7a125ed57/dep-bin-Wilfred_Adzer_Basic_Arithmetics_In_Rust","checksum":false}}],"rustflags":[],"config":2069994364910194474,"compile_kind":0} \ No newline at end of file diff --git a/submissions/week-1/day-2/Wilfred_Adzer_Basic_Arithmetics_In_Rust/target/debug/.fingerprint/Wilfred_Adzer_Basic_Arithmetics_In_Rust-f49849a7a125ed57/dep-bin-Wilfred_Adzer_Basic_Arithmetics_In_Rust b/submissions/week-1/day-2/Wilfred_Adzer_Basic_Arithmetics_In_Rust/target/debug/.fingerprint/Wilfred_Adzer_Basic_Arithmetics_In_Rust-f49849a7a125ed57/dep-bin-Wilfred_Adzer_Basic_Arithmetics_In_Rust new file mode 100644 index 000000000..ea1357a0a Binary files /dev/null and b/submissions/week-1/day-2/Wilfred_Adzer_Basic_Arithmetics_In_Rust/target/debug/.fingerprint/Wilfred_Adzer_Basic_Arithmetics_In_Rust-f49849a7a125ed57/dep-bin-Wilfred_Adzer_Basic_Arithmetics_In_Rust differ diff --git a/submissions/week-1/day-2/Wilfred_Adzer_Basic_Arithmetics_In_Rust/target/debug/.fingerprint/Wilfred_Adzer_Basic_Arithmetics_In_Rust-f49849a7a125ed57/invoked.timestamp b/submissions/week-1/day-2/Wilfred_Adzer_Basic_Arithmetics_In_Rust/target/debug/.fingerprint/Wilfred_Adzer_Basic_Arithmetics_In_Rust-f49849a7a125ed57/invoked.timestamp new file mode 100644 index 000000000..e00328da5 --- /dev/null +++ b/submissions/week-1/day-2/Wilfred_Adzer_Basic_Arithmetics_In_Rust/target/debug/.fingerprint/Wilfred_Adzer_Basic_Arithmetics_In_Rust-f49849a7a125ed57/invoked.timestamp @@ -0,0 +1 @@ +This file has an mtime of when this was started. \ No newline at end of file diff --git a/submissions/week-1/day-2/Wilfred_Adzer_Basic_Arithmetics_In_Rust/target/debug/.fingerprint/Wilfred_Adzer_Basic_Arithmetics_In_Rust-f49849a7a125ed57/output-bin-Wilfred_Adzer_Basic_Arithmetics_In_Rust b/submissions/week-1/day-2/Wilfred_Adzer_Basic_Arithmetics_In_Rust/target/debug/.fingerprint/Wilfred_Adzer_Basic_Arithmetics_In_Rust-f49849a7a125ed57/output-bin-Wilfred_Adzer_Basic_Arithmetics_In_Rust new file mode 100644 index 000000000..7d862e72b --- /dev/null +++ b/submissions/week-1/day-2/Wilfred_Adzer_Basic_Arithmetics_In_Rust/target/debug/.fingerprint/Wilfred_Adzer_Basic_Arithmetics_In_Rust-f49849a7a125ed57/output-bin-Wilfred_Adzer_Basic_Arithmetics_In_Rust @@ -0,0 +1,2 @@ +{"$message_type":"diagnostic","message":"module `Operation` should have a snake case name","code":{"code":"non_snake_case","explanation":null},"level":"warning","spans":[{"file_name":"src/main.rs","byte_start":4,"byte_end":13,"line_start":1,"line_end":1,"column_start":5,"column_end":14,"is_primary":true,"text":[{"text":"mod Operation;","highlight_start":5,"highlight_end":14}],"label":null,"suggested_replacement":null,"suggestion_applicability":null,"expansion":null}],"children":[{"message":"`#[warn(non_snake_case)]` on by default","code":null,"level":"note","spans":[],"children":[],"rendered":null},{"message":"convert the identifier to snake case","code":null,"level":"help","spans":[{"file_name":"src/main.rs","byte_start":4,"byte_end":13,"line_start":1,"line_end":1,"column_start":5,"column_end":14,"is_primary":true,"text":[{"text":"mod Operation;","highlight_start":5,"highlight_end":14}],"label":null,"suggested_replacement":"operation","suggestion_applicability":"MaybeIncorrect","expansion":null}],"children":[],"rendered":null}],"rendered":"\u001b[0m\u001b[1m\u001b[33mwarning\u001b[0m\u001b[0m\u001b[1m: module `Operation` should have a snake case name\u001b[0m\n\u001b[0m \u001b[0m\u001b[0m\u001b[1m\u001b[38;5;12m--> \u001b[0m\u001b[0msrc/main.rs:1:5\u001b[0m\n\u001b[0m \u001b[0m\u001b[0m\u001b[1m\u001b[38;5;12m|\u001b[0m\n\u001b[0m\u001b[1m\u001b[38;5;12m1\u001b[0m\u001b[0m \u001b[0m\u001b[0m\u001b[1m\u001b[38;5;12m|\u001b[0m\u001b[0m \u001b[0m\u001b[0mmod Operation;\u001b[0m\n\u001b[0m \u001b[0m\u001b[0m\u001b[1m\u001b[38;5;12m|\u001b[0m\u001b[0m \u001b[0m\u001b[0m\u001b[1m\u001b[33m^^^^^^^^^\u001b[0m\u001b[0m \u001b[0m\u001b[0m\u001b[1m\u001b[33mhelp: convert the identifier to snake case (notice the capitalization): `operation`\u001b[0m\n\u001b[0m \u001b[0m\u001b[0m\u001b[1m\u001b[38;5;12m|\u001b[0m\n\u001b[0m \u001b[0m\u001b[0m\u001b[1m\u001b[38;5;12m= \u001b[0m\u001b[0m\u001b[1mnote\u001b[0m\u001b[0m: `#[warn(non_snake_case)]` on by default\u001b[0m\n\n"} +{"$message_type":"diagnostic","message":"1 warning emitted","code":null,"level":"warning","spans":[],"children":[],"rendered":"\u001b[0m\u001b[1m\u001b[33mwarning\u001b[0m\u001b[0m\u001b[1m: 1 warning emitted\u001b[0m\n\n"} diff --git a/submissions/week-1/day-2/Wilfred_Adzer_Basic_Arithmetics_In_Rust/target/debug/Wilfred_Adzer_Basic_Arithmetics_In_Rust b/submissions/week-1/day-2/Wilfred_Adzer_Basic_Arithmetics_In_Rust/target/debug/Wilfred_Adzer_Basic_Arithmetics_In_Rust new file mode 100755 index 000000000..a6567d7de Binary files /dev/null and b/submissions/week-1/day-2/Wilfred_Adzer_Basic_Arithmetics_In_Rust/target/debug/Wilfred_Adzer_Basic_Arithmetics_In_Rust differ diff --git a/submissions/week-1/day-2/Wilfred_Adzer_Basic_Arithmetics_In_Rust/target/debug/Wilfred_Adzer_Basic_Arithmetics_In_Rust.d b/submissions/week-1/day-2/Wilfred_Adzer_Basic_Arithmetics_In_Rust/target/debug/Wilfred_Adzer_Basic_Arithmetics_In_Rust.d new file mode 100644 index 000000000..0b560e649 --- /dev/null +++ b/submissions/week-1/day-2/Wilfred_Adzer_Basic_Arithmetics_In_Rust/target/debug/Wilfred_Adzer_Basic_Arithmetics_In_Rust.d @@ -0,0 +1 @@ +/home/wilfred/Projects/Rust_Masterclass/Web3bridge-Rust-Masterclass-Cohort-I/submissions/week-1/day-2/Wilfred_Adzer_Basic_Arithmetics_In_Rust/target/debug/Wilfred_Adzer_Basic_Arithmetics_In_Rust: /home/wilfred/Projects/Rust_Masterclass/Web3bridge-Rust-Masterclass-Cohort-I/submissions/week-1/day-2/Wilfred_Adzer_Basic_Arithmetics_In_Rust/src/Operation.rs /home/wilfred/Projects/Rust_Masterclass/Web3bridge-Rust-Masterclass-Cohort-I/submissions/week-1/day-2/Wilfred_Adzer_Basic_Arithmetics_In_Rust/src/main.rs diff --git a/submissions/week-1/day-2/Wilfred_Adzer_Basic_Arithmetics_In_Rust/target/debug/deps/Wilfred_Adzer_Basic_Arithmetics_In_Rust-f49849a7a125ed57 b/submissions/week-1/day-2/Wilfred_Adzer_Basic_Arithmetics_In_Rust/target/debug/deps/Wilfred_Adzer_Basic_Arithmetics_In_Rust-f49849a7a125ed57 new file mode 100755 index 000000000..a6567d7de Binary files /dev/null and b/submissions/week-1/day-2/Wilfred_Adzer_Basic_Arithmetics_In_Rust/target/debug/deps/Wilfred_Adzer_Basic_Arithmetics_In_Rust-f49849a7a125ed57 differ diff --git a/submissions/week-1/day-2/Wilfred_Adzer_Basic_Arithmetics_In_Rust/target/debug/deps/Wilfred_Adzer_Basic_Arithmetics_In_Rust-f49849a7a125ed57.d b/submissions/week-1/day-2/Wilfred_Adzer_Basic_Arithmetics_In_Rust/target/debug/deps/Wilfred_Adzer_Basic_Arithmetics_In_Rust-f49849a7a125ed57.d new file mode 100644 index 000000000..816c70c67 --- /dev/null +++ b/submissions/week-1/day-2/Wilfred_Adzer_Basic_Arithmetics_In_Rust/target/debug/deps/Wilfred_Adzer_Basic_Arithmetics_In_Rust-f49849a7a125ed57.d @@ -0,0 +1,6 @@ +/home/wilfred/Projects/Rust_Masterclass/Web3bridge-Rust-Masterclass-Cohort-I/submissions/week-1/day-2/Wilfred_Adzer_Basic_Arithmetics_In_Rust/target/debug/deps/Wilfred_Adzer_Basic_Arithmetics_In_Rust-f49849a7a125ed57: src/main.rs src/Operation.rs + +/home/wilfred/Projects/Rust_Masterclass/Web3bridge-Rust-Masterclass-Cohort-I/submissions/week-1/day-2/Wilfred_Adzer_Basic_Arithmetics_In_Rust/target/debug/deps/Wilfred_Adzer_Basic_Arithmetics_In_Rust-f49849a7a125ed57.d: src/main.rs src/Operation.rs + +src/main.rs: +src/Operation.rs: diff --git a/submissions/week-1/day-2/Wilfred_Adzer_Basic_Arithmetics_In_Rust/target/debug/incremental/Wilfred_Adzer_Basic_Arithmetics_In_Rust-2nd3zwenfuibn/s-h919lpe889-0lc7515-2w7kddfvcgbb3g7thihvlvi6w/16qqsf97ml9dhhoencufv7enw.o b/submissions/week-1/day-2/Wilfred_Adzer_Basic_Arithmetics_In_Rust/target/debug/incremental/Wilfred_Adzer_Basic_Arithmetics_In_Rust-2nd3zwenfuibn/s-h919lpe889-0lc7515-2w7kddfvcgbb3g7thihvlvi6w/16qqsf97ml9dhhoencufv7enw.o new file mode 100644 index 000000000..bd0c603e7 Binary files /dev/null and b/submissions/week-1/day-2/Wilfred_Adzer_Basic_Arithmetics_In_Rust/target/debug/incremental/Wilfred_Adzer_Basic_Arithmetics_In_Rust-2nd3zwenfuibn/s-h919lpe889-0lc7515-2w7kddfvcgbb3g7thihvlvi6w/16qqsf97ml9dhhoencufv7enw.o differ diff --git a/submissions/week-1/day-2/Wilfred_Adzer_Basic_Arithmetics_In_Rust/target/debug/incremental/Wilfred_Adzer_Basic_Arithmetics_In_Rust-2nd3zwenfuibn/s-h919lpe889-0lc7515-2w7kddfvcgbb3g7thihvlvi6w/1hwmysridgu5o8x14dbfuy02y.o b/submissions/week-1/day-2/Wilfred_Adzer_Basic_Arithmetics_In_Rust/target/debug/incremental/Wilfred_Adzer_Basic_Arithmetics_In_Rust-2nd3zwenfuibn/s-h919lpe889-0lc7515-2w7kddfvcgbb3g7thihvlvi6w/1hwmysridgu5o8x14dbfuy02y.o new file mode 100644 index 000000000..51575653c Binary files /dev/null and b/submissions/week-1/day-2/Wilfred_Adzer_Basic_Arithmetics_In_Rust/target/debug/incremental/Wilfred_Adzer_Basic_Arithmetics_In_Rust-2nd3zwenfuibn/s-h919lpe889-0lc7515-2w7kddfvcgbb3g7thihvlvi6w/1hwmysridgu5o8x14dbfuy02y.o differ diff --git a/submissions/week-1/day-2/Wilfred_Adzer_Basic_Arithmetics_In_Rust/target/debug/incremental/Wilfred_Adzer_Basic_Arithmetics_In_Rust-2nd3zwenfuibn/s-h919lpe889-0lc7515-2w7kddfvcgbb3g7thihvlvi6w/1wuwf3cjygh265uwanyhsj8gx.o b/submissions/week-1/day-2/Wilfred_Adzer_Basic_Arithmetics_In_Rust/target/debug/incremental/Wilfred_Adzer_Basic_Arithmetics_In_Rust-2nd3zwenfuibn/s-h919lpe889-0lc7515-2w7kddfvcgbb3g7thihvlvi6w/1wuwf3cjygh265uwanyhsj8gx.o new file mode 100644 index 000000000..b369d99d3 Binary files /dev/null and b/submissions/week-1/day-2/Wilfred_Adzer_Basic_Arithmetics_In_Rust/target/debug/incremental/Wilfred_Adzer_Basic_Arithmetics_In_Rust-2nd3zwenfuibn/s-h919lpe889-0lc7515-2w7kddfvcgbb3g7thihvlvi6w/1wuwf3cjygh265uwanyhsj8gx.o differ diff --git a/submissions/week-1/day-2/Wilfred_Adzer_Basic_Arithmetics_In_Rust/target/debug/incremental/Wilfred_Adzer_Basic_Arithmetics_In_Rust-2nd3zwenfuibn/s-h919lpe889-0lc7515-2w7kddfvcgbb3g7thihvlvi6w/1znj30zjapq90ai3ix68zy4yj.o b/submissions/week-1/day-2/Wilfred_Adzer_Basic_Arithmetics_In_Rust/target/debug/incremental/Wilfred_Adzer_Basic_Arithmetics_In_Rust-2nd3zwenfuibn/s-h919lpe889-0lc7515-2w7kddfvcgbb3g7thihvlvi6w/1znj30zjapq90ai3ix68zy4yj.o new file mode 100644 index 000000000..ba371b1ce Binary files /dev/null and b/submissions/week-1/day-2/Wilfred_Adzer_Basic_Arithmetics_In_Rust/target/debug/incremental/Wilfred_Adzer_Basic_Arithmetics_In_Rust-2nd3zwenfuibn/s-h919lpe889-0lc7515-2w7kddfvcgbb3g7thihvlvi6w/1znj30zjapq90ai3ix68zy4yj.o differ diff --git a/submissions/week-1/day-2/Wilfred_Adzer_Basic_Arithmetics_In_Rust/target/debug/incremental/Wilfred_Adzer_Basic_Arithmetics_In_Rust-2nd3zwenfuibn/s-h919lpe889-0lc7515-2w7kddfvcgbb3g7thihvlvi6w/43twjn0ukqljogulaxbxj8ar1.o b/submissions/week-1/day-2/Wilfred_Adzer_Basic_Arithmetics_In_Rust/target/debug/incremental/Wilfred_Adzer_Basic_Arithmetics_In_Rust-2nd3zwenfuibn/s-h919lpe889-0lc7515-2w7kddfvcgbb3g7thihvlvi6w/43twjn0ukqljogulaxbxj8ar1.o new file mode 100644 index 000000000..f568dc453 Binary files /dev/null and b/submissions/week-1/day-2/Wilfred_Adzer_Basic_Arithmetics_In_Rust/target/debug/incremental/Wilfred_Adzer_Basic_Arithmetics_In_Rust-2nd3zwenfuibn/s-h919lpe889-0lc7515-2w7kddfvcgbb3g7thihvlvi6w/43twjn0ukqljogulaxbxj8ar1.o differ diff --git a/submissions/week-1/day-2/Wilfred_Adzer_Basic_Arithmetics_In_Rust/target/debug/incremental/Wilfred_Adzer_Basic_Arithmetics_In_Rust-2nd3zwenfuibn/s-h919lpe889-0lc7515-2w7kddfvcgbb3g7thihvlvi6w/5ie52pwrf7ej4eah0h07gwf0s.o b/submissions/week-1/day-2/Wilfred_Adzer_Basic_Arithmetics_In_Rust/target/debug/incremental/Wilfred_Adzer_Basic_Arithmetics_In_Rust-2nd3zwenfuibn/s-h919lpe889-0lc7515-2w7kddfvcgbb3g7thihvlvi6w/5ie52pwrf7ej4eah0h07gwf0s.o new file mode 100644 index 000000000..5fa24d2af Binary files /dev/null and b/submissions/week-1/day-2/Wilfred_Adzer_Basic_Arithmetics_In_Rust/target/debug/incremental/Wilfred_Adzer_Basic_Arithmetics_In_Rust-2nd3zwenfuibn/s-h919lpe889-0lc7515-2w7kddfvcgbb3g7thihvlvi6w/5ie52pwrf7ej4eah0h07gwf0s.o differ diff --git a/submissions/week-1/day-2/Wilfred_Adzer_Basic_Arithmetics_In_Rust/target/debug/incremental/Wilfred_Adzer_Basic_Arithmetics_In_Rust-2nd3zwenfuibn/s-h919lpe889-0lc7515-2w7kddfvcgbb3g7thihvlvi6w/9d3m1bwcfayaewivbbro8srpo.o b/submissions/week-1/day-2/Wilfred_Adzer_Basic_Arithmetics_In_Rust/target/debug/incremental/Wilfred_Adzer_Basic_Arithmetics_In_Rust-2nd3zwenfuibn/s-h919lpe889-0lc7515-2w7kddfvcgbb3g7thihvlvi6w/9d3m1bwcfayaewivbbro8srpo.o new file mode 100644 index 000000000..0476e0bbe Binary files /dev/null and b/submissions/week-1/day-2/Wilfred_Adzer_Basic_Arithmetics_In_Rust/target/debug/incremental/Wilfred_Adzer_Basic_Arithmetics_In_Rust-2nd3zwenfuibn/s-h919lpe889-0lc7515-2w7kddfvcgbb3g7thihvlvi6w/9d3m1bwcfayaewivbbro8srpo.o differ diff --git a/submissions/week-1/day-2/Wilfred_Adzer_Basic_Arithmetics_In_Rust/target/debug/incremental/Wilfred_Adzer_Basic_Arithmetics_In_Rust-2nd3zwenfuibn/s-h919lpe889-0lc7515-2w7kddfvcgbb3g7thihvlvi6w/c4h05zkk0uv1iaodg8egq7xqe.o b/submissions/week-1/day-2/Wilfred_Adzer_Basic_Arithmetics_In_Rust/target/debug/incremental/Wilfred_Adzer_Basic_Arithmetics_In_Rust-2nd3zwenfuibn/s-h919lpe889-0lc7515-2w7kddfvcgbb3g7thihvlvi6w/c4h05zkk0uv1iaodg8egq7xqe.o new file mode 100644 index 000000000..a7cb47084 Binary files /dev/null and b/submissions/week-1/day-2/Wilfred_Adzer_Basic_Arithmetics_In_Rust/target/debug/incremental/Wilfred_Adzer_Basic_Arithmetics_In_Rust-2nd3zwenfuibn/s-h919lpe889-0lc7515-2w7kddfvcgbb3g7thihvlvi6w/c4h05zkk0uv1iaodg8egq7xqe.o differ diff --git a/submissions/week-1/day-2/Wilfred_Adzer_Basic_Arithmetics_In_Rust/target/debug/incremental/Wilfred_Adzer_Basic_Arithmetics_In_Rust-2nd3zwenfuibn/s-h919lpe889-0lc7515-2w7kddfvcgbb3g7thihvlvi6w/dep-graph.bin b/submissions/week-1/day-2/Wilfred_Adzer_Basic_Arithmetics_In_Rust/target/debug/incremental/Wilfred_Adzer_Basic_Arithmetics_In_Rust-2nd3zwenfuibn/s-h919lpe889-0lc7515-2w7kddfvcgbb3g7thihvlvi6w/dep-graph.bin new file mode 100644 index 000000000..dcda65bb6 Binary files /dev/null and b/submissions/week-1/day-2/Wilfred_Adzer_Basic_Arithmetics_In_Rust/target/debug/incremental/Wilfred_Adzer_Basic_Arithmetics_In_Rust-2nd3zwenfuibn/s-h919lpe889-0lc7515-2w7kddfvcgbb3g7thihvlvi6w/dep-graph.bin differ diff --git a/submissions/week-1/day-2/Wilfred_Adzer_Basic_Arithmetics_In_Rust/target/debug/incremental/Wilfred_Adzer_Basic_Arithmetics_In_Rust-2nd3zwenfuibn/s-h919lpe889-0lc7515-2w7kddfvcgbb3g7thihvlvi6w/query-cache.bin b/submissions/week-1/day-2/Wilfred_Adzer_Basic_Arithmetics_In_Rust/target/debug/incremental/Wilfred_Adzer_Basic_Arithmetics_In_Rust-2nd3zwenfuibn/s-h919lpe889-0lc7515-2w7kddfvcgbb3g7thihvlvi6w/query-cache.bin new file mode 100644 index 000000000..6cdbf81bc Binary files /dev/null and b/submissions/week-1/day-2/Wilfred_Adzer_Basic_Arithmetics_In_Rust/target/debug/incremental/Wilfred_Adzer_Basic_Arithmetics_In_Rust-2nd3zwenfuibn/s-h919lpe889-0lc7515-2w7kddfvcgbb3g7thihvlvi6w/query-cache.bin differ diff --git a/submissions/week-1/day-2/Wilfred_Adzer_Basic_Arithmetics_In_Rust/target/debug/incremental/Wilfred_Adzer_Basic_Arithmetics_In_Rust-2nd3zwenfuibn/s-h919lpe889-0lc7515-2w7kddfvcgbb3g7thihvlvi6w/work-products.bin b/submissions/week-1/day-2/Wilfred_Adzer_Basic_Arithmetics_In_Rust/target/debug/incremental/Wilfred_Adzer_Basic_Arithmetics_In_Rust-2nd3zwenfuibn/s-h919lpe889-0lc7515-2w7kddfvcgbb3g7thihvlvi6w/work-products.bin new file mode 100644 index 000000000..f2b8e4fb5 Binary files /dev/null and b/submissions/week-1/day-2/Wilfred_Adzer_Basic_Arithmetics_In_Rust/target/debug/incremental/Wilfred_Adzer_Basic_Arithmetics_In_Rust-2nd3zwenfuibn/s-h919lpe889-0lc7515-2w7kddfvcgbb3g7thihvlvi6w/work-products.bin differ diff --git a/submissions/week-1/day-2/Wilfred_Adzer_Basic_Arithmetics_In_Rust/target/debug/incremental/Wilfred_Adzer_Basic_Arithmetics_In_Rust-2nd3zwenfuibn/s-h919lpe889-0lc7515.lock b/submissions/week-1/day-2/Wilfred_Adzer_Basic_Arithmetics_In_Rust/target/debug/incremental/Wilfred_Adzer_Basic_Arithmetics_In_Rust-2nd3zwenfuibn/s-h919lpe889-0lc7515.lock new file mode 100644 index 000000000..e69de29bb diff --git a/submissions/week-6/day-3/Wilfred/todo_project/.gitignore b/submissions/week-6/day-3/Wilfred/todo_project/.gitignore new file mode 100644 index 000000000..d74cc01f6 --- /dev/null +++ b/submissions/week-6/day-3/Wilfred/todo_project/.gitignore @@ -0,0 +1,6 @@ +# Rust's output directory +target + +# Local settings +.soroban +.stellar diff --git a/submissions/week-6/day-3/Wilfred/todo_project/Cargo.lock b/submissions/week-6/day-3/Wilfred/todo_project/Cargo.lock new file mode 100644 index 000000000..12f6eb1fa --- /dev/null +++ b/submissions/week-6/day-3/Wilfred/todo_project/Cargo.lock @@ -0,0 +1,1668 @@ +# This file is automatically @generated by Cargo. +# It is not intended for manual editing. +version = 3 + +[[package]] +name = "ahash" +version = "0.8.12" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5a15f179cd60c4584b8a8c596927aadc462e27f2ca70c04e0071964a73ba7a75" +dependencies = [ + "cfg-if", + "once_cell", + "version_check", + "zerocopy", +] + +[[package]] +name = "android-tzdata" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e999941b234f3131b00bc13c22d06e8c5ff726d1b6318ac7eb276997bbb4fef0" + +[[package]] +name = "android_system_properties" +version = "0.1.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "819e7219dbd41043ac279b19830f2efc897156490d7fd6ea916720117ee66311" +dependencies = [ + "libc", +] + +[[package]] +name = "arbitrary" +version = "1.3.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7d5a26814d8dcb93b0e5a0ff3c6d80a8843bafb21b39e8e18a6f05471870e110" +dependencies = [ + "derive_arbitrary", +] + +[[package]] +name = "ark-bls12-381" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c775f0d12169cba7aae4caeb547bb6a50781c7449a8aa53793827c9ec4abf488" +dependencies = [ + "ark-ec", + "ark-ff", + "ark-serialize", + "ark-std", +] + +[[package]] +name = "ark-ec" +version = "0.4.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "defd9a439d56ac24968cca0571f598a61bc8c55f71d50a89cda591cb750670ba" +dependencies = [ + "ark-ff", + "ark-poly", + "ark-serialize", + "ark-std", + "derivative", + "hashbrown 0.13.2", + "itertools", + "num-traits", + "zeroize", +] + +[[package]] +name = "ark-ff" +version = "0.4.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ec847af850f44ad29048935519032c33da8aa03340876d351dfab5660d2966ba" +dependencies = [ + "ark-ff-asm", + "ark-ff-macros", + "ark-serialize", + "ark-std", + "derivative", + "digest", + "itertools", + "num-bigint", + "num-traits", + "paste", + "rustc_version", + "zeroize", +] + +[[package]] +name = "ark-ff-asm" +version = "0.4.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3ed4aa4fe255d0bc6d79373f7e31d2ea147bcf486cba1be5ba7ea85abdb92348" +dependencies = [ + "quote", + "syn 1.0.109", +] + +[[package]] +name = "ark-ff-macros" +version = "0.4.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7abe79b0e4288889c4574159ab790824d0033b9fdcb2a112a3182fac2e514565" +dependencies = [ + "num-bigint", + "num-traits", + "proc-macro2", + "quote", + "syn 1.0.109", +] + +[[package]] +name = "ark-poly" +version = "0.4.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d320bfc44ee185d899ccbadfa8bc31aab923ce1558716e1997a1e74057fe86bf" +dependencies = [ + "ark-ff", + "ark-serialize", + "ark-std", + "derivative", + "hashbrown 0.13.2", +] + +[[package]] +name = "ark-serialize" +version = "0.4.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "adb7b85a02b83d2f22f89bd5cac66c9c89474240cb6207cb1efc16d098e822a5" +dependencies = [ + "ark-serialize-derive", + "ark-std", + "digest", + "num-bigint", +] + +[[package]] +name = "ark-serialize-derive" +version = "0.4.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ae3281bc6d0fd7e549af32b52511e1302185bd688fd3359fa36423346ff682ea" +dependencies = [ + "proc-macro2", + "quote", + "syn 1.0.109", +] + +[[package]] +name = "ark-std" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "94893f1e0c6eeab764ade8dc4c0db24caf4fe7cbbaafc0eba0a9030f447b5185" +dependencies = [ + "num-traits", + "rand", +] + +[[package]] +name = "autocfg" +version = "1.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c08606f8c3cbf4ce6ec8e28fb0014a2c086708fe954eaa885384a6165172e7e8" + +[[package]] +name = "base16ct" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4c7f02d4ea65f2c1853089ffd8d2787bdbc63de2f0d29dedbcf8ccdfa0ccd4cf" + +[[package]] +name = "base64" +version = "0.13.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9e1b586273c5702936fe7b7d6896644d8be71e6314cfe09d3167c95f712589e8" + +[[package]] +name = "base64" +version = "0.22.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "72b3254f16251a8381aa12e40e3c4d2f0199f8c6508fbecb9d91f575e0fbb8c6" + +[[package]] +name = "base64ct" +version = "1.8.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "55248b47b0caf0546f7988906588779981c43bb1bc9d0c44087278f80cdb44ba" + +[[package]] +name = "block-buffer" +version = "0.10.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3078c7629b62d3f0439517fa394996acacc5cbc91c5a20d8c658e77abd503a71" +dependencies = [ + "generic-array", +] + +[[package]] +name = "bumpalo" +version = "3.19.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "46c5e41b57b8bba42a04676d81cb89e9ee8e859a1a66f80a5a72e1cb76b34d43" + +[[package]] +name = "bytes-lit" +version = "0.0.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0adabf37211a5276e46335feabcbb1530c95eb3fdf85f324c7db942770aa025d" +dependencies = [ + "num-bigint", + "proc-macro2", + "quote", + "syn 2.0.105", +] + +[[package]] +name = "cc" +version = "1.2.32" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2352e5597e9c544d5e6d9c95190d5d27738ade584fa8db0a16e130e5c2b5296e" +dependencies = [ + "shlex", +] + +[[package]] +name = "cfg-if" +version = "1.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9555578bc9e57714c812a1f84e4fc5b4d21fcb063490c624de019f7464c91268" + +[[package]] +name = "chrono" +version = "0.4.41" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c469d952047f47f91b68d1cba3f10d63c11d73e4636f24f08daf0278abf01c4d" +dependencies = [ + "android-tzdata", + "iana-time-zone", + "num-traits", + "serde", + "windows-link", +] + +[[package]] +name = "const-oid" +version = "0.9.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c2459377285ad874054d797f3ccebf984978aa39129f6eafde5cdc8315b612f8" + +[[package]] +name = "core-foundation-sys" +version = "0.8.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "773648b94d0e5d620f64f280777445740e61fe701025087ec8b57f45c791888b" + +[[package]] +name = "cpufeatures" +version = "0.2.17" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "59ed5838eebb26a2bb2e58f6d5b5316989ae9d08bab10e0e6d103e656d1b0280" +dependencies = [ + "libc", +] + +[[package]] +name = "crate-git-revision" +version = "0.0.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c521bf1f43d31ed2f73441775ed31935d77901cb3451e44b38a1c1612fcbaf98" +dependencies = [ + "serde", + "serde_derive", + "serde_json", +] + +[[package]] +name = "crypto-bigint" +version = "0.5.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0dc92fb57ca44df6db8059111ab3af99a63d5d0f8375d9972e319a379c6bab76" +dependencies = [ + "generic-array", + "rand_core", + "subtle", + "zeroize", +] + +[[package]] +name = "crypto-common" +version = "0.1.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1bfb12502f3fc46cca1bb51ac28df9d618d813cdc3d2f25b9fe775a34af26bb3" +dependencies = [ + "generic-array", + "typenum", +] + +[[package]] +name = "ctor" +version = "0.2.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "32a2785755761f3ddc1492979ce1e48d2c00d09311c39e4466429188f3dd6501" +dependencies = [ + "quote", + "syn 2.0.105", +] + +[[package]] +name = "curve25519-dalek" +version = "4.1.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "97fb8b7c4503de7d6ae7b42ab72a5a59857b4c937ec27a3d4539dba95b5ab2be" +dependencies = [ + "cfg-if", + "cpufeatures", + "curve25519-dalek-derive", + "digest", + "fiat-crypto", + "rustc_version", + "subtle", + "zeroize", +] + +[[package]] +name = "curve25519-dalek-derive" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f46882e17999c6cc590af592290432be3bce0428cb0d5f8b6715e4dc7b383eb3" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.105", +] + +[[package]] +name = "darling" +version = "0.20.11" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fc7f46116c46ff9ab3eb1597a45688b6715c6e628b5c133e288e709a29bcb4ee" +dependencies = [ + "darling_core", + "darling_macro", +] + +[[package]] +name = "darling_core" +version = "0.20.11" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0d00b9596d185e565c2207a0b01f8bd1a135483d02d9b7b0a54b11da8d53412e" +dependencies = [ + "fnv", + "ident_case", + "proc-macro2", + "quote", + "strsim", + "syn 2.0.105", +] + +[[package]] +name = "darling_macro" +version = "0.20.11" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fc34b93ccb385b40dc71c6fceac4b2ad23662c7eeb248cf10d529b7e055b6ead" +dependencies = [ + "darling_core", + "quote", + "syn 2.0.105", +] + +[[package]] +name = "data-encoding" +version = "2.9.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2a2330da5de22e8a3cb63252ce2abb30116bf5265e89c0e01bc17015ce30a476" + +[[package]] +name = "der" +version = "0.7.10" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e7c1832837b905bbfb5101e07cc24c8deddf52f93225eee6ead5f4d63d53ddcb" +dependencies = [ + "const-oid", + "zeroize", +] + +[[package]] +name = "deranged" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9c9e6a11ca8224451684bc0d7d5a7adbf8f2fd6887261a1cfc3c0432f9d4068e" +dependencies = [ + "powerfmt", + "serde", +] + +[[package]] +name = "derivative" +version = "2.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fcc3dd5e9e9c0b295d6e1e4d811fb6f157d5ffd784b8d202fc62eac8035a770b" +dependencies = [ + "proc-macro2", + "quote", + "syn 1.0.109", +] + +[[package]] +name = "derive_arbitrary" +version = "1.3.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "67e77553c4162a157adbf834ebae5b415acbecbeafc7a74b0e886657506a7611" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.105", +] + +[[package]] +name = "digest" +version = "0.10.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9ed9a281f7bc9b7576e61468ba615a66a5c8cfdff42420a70aa82701a3b1e292" +dependencies = [ + "block-buffer", + "const-oid", + "crypto-common", + "subtle", +] + +[[package]] +name = "downcast-rs" +version = "1.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "75b325c5dbd37f80359721ad39aca5a29fb04c89279657cffdda8736d0c0b9d2" + +[[package]] +name = "dyn-clone" +version = "1.0.20" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d0881ea181b1df73ff77ffaaf9c7544ecc11e82fba9b5f27b262a3c73a332555" + +[[package]] +name = "ecdsa" +version = "0.16.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ee27f32b5c5292967d2d4a9d7f1e0b0aed2c15daded5a60300e4abb9d8020bca" +dependencies = [ + "der", + "digest", + "elliptic-curve", + "rfc6979", + "signature", +] + +[[package]] +name = "ed25519" +version = "2.2.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "115531babc129696a58c64a4fef0a8bf9e9698629fb97e9e40767d235cfbcd53" +dependencies = [ + "pkcs8", + "signature", +] + +[[package]] +name = "ed25519-dalek" +version = "2.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "70e796c081cee67dc755e1a36a0a172b897fab85fc3f6bc48307991f64e4eca9" +dependencies = [ + "curve25519-dalek", + "ed25519", + "rand_core", + "serde", + "sha2", + "subtle", + "zeroize", +] + +[[package]] +name = "either" +version = "1.15.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "48c757948c5ede0e46177b7add2e67155f70e33c07fea8284df6576da70b3719" + +[[package]] +name = "elliptic-curve" +version = "0.13.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b5e6043086bf7973472e0c7dff2142ea0b680d30e18d9cc40f267efbf222bd47" +dependencies = [ + "base16ct", + "crypto-bigint", + "digest", + "ff", + "generic-array", + "group", + "rand_core", + "sec1", + "subtle", + "zeroize", +] + +[[package]] +name = "equivalent" +version = "1.0.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "877a4ace8713b0bcf2a4e7eec82529c029f1d0619886d18145fea96c3ffe5c0f" + +[[package]] +name = "escape-bytes" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2bfcf67fea2815c2fc3b90873fae90957be12ff417335dfadc7f52927feb03b2" + +[[package]] +name = "ethnum" +version = "1.5.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ca81e6b4777c89fd810c25a4be2b1bd93ea034fbe58e6a75216a34c6b82c539b" + +[[package]] +name = "ff" +version = "0.13.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c0b50bfb653653f9ca9095b427bed08ab8d75a137839d9ad64eb11810d5b6393" +dependencies = [ + "rand_core", + "subtle", +] + +[[package]] +name = "fiat-crypto" +version = "0.2.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "28dea519a9695b9977216879a3ebfddf92f1c08c05d984f8996aecd6ecdc811d" + +[[package]] +name = "fnv" +version = "1.0.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3f9eec918d3f24069decb9af1554cad7c880e2da24a9afd88aca000531ab82c1" + +[[package]] +name = "generic-array" +version = "0.14.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "85649ca51fd72272d7821adaf274ad91c288277713d9c18820d8499a7ff69e9a" +dependencies = [ + "typenum", + "version_check", + "zeroize", +] + +[[package]] +name = "getrandom" +version = "0.2.16" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "335ff9f135e4384c8150d6f27c6daed433577f86b4750418338c01a1a2528592" +dependencies = [ + "cfg-if", + "js-sys", + "libc", + "wasi", + "wasm-bindgen", +] + +[[package]] +name = "group" +version = "0.13.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f0f9ef7462f7c099f518d754361858f86d8a07af53ba9af0fe635bbccb151a63" +dependencies = [ + "ff", + "rand_core", + "subtle", +] + +[[package]] +name = "hashbrown" +version = "0.12.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8a9ee70c43aaf417c914396645a0fa852624801b24ebb7ae78fe8272889ac888" + +[[package]] +name = "hashbrown" +version = "0.13.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "43a3c133739dddd0d2990f9a4bdf8eb4b21ef50e4851ca85ab661199821d510e" +dependencies = [ + "ahash", +] + +[[package]] +name = "hashbrown" +version = "0.15.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9229cfe53dfd69f0609a49f65461bd93001ea1ef889cd5529dd176593f5338a1" + +[[package]] +name = "hello-world" +version = "0.0.0" +dependencies = [ + "soroban-sdk", +] + +[[package]] +name = "hex" +version = "0.4.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7f24254aa9a54b5c858eaee2f5bccdb46aaf0e486a595ed5fd8f86ba55232a70" +dependencies = [ + "serde", +] + +[[package]] +name = "hex-literal" +version = "0.4.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6fe2267d4ed49bc07b63801559be28c718ea06c4738b7a03c94df7386d2cde46" + +[[package]] +name = "hmac" +version = "0.12.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6c49c37c09c17a53d937dfbb742eb3a961d65a994e6bcdcf37e7399d0cc8ab5e" +dependencies = [ + "digest", +] + +[[package]] +name = "iana-time-zone" +version = "0.1.63" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b0c919e5debc312ad217002b8048a17b7d83f80703865bbfcfebb0458b0b27d8" +dependencies = [ + "android_system_properties", + "core-foundation-sys", + "iana-time-zone-haiku", + "js-sys", + "log", + "wasm-bindgen", + "windows-core", +] + +[[package]] +name = "iana-time-zone-haiku" +version = "0.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f31827a206f56af32e590ba56d5d2d085f558508192593743f16b2306495269f" +dependencies = [ + "cc", +] + +[[package]] +name = "ident_case" +version = "1.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b9e0384b61958566e926dc50660321d12159025e767c18e043daf26b70104c39" + +[[package]] +name = "indexmap" +version = "1.9.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bd070e393353796e801d209ad339e89596eb4c8d430d18ede6a1cced8fafbd99" +dependencies = [ + "autocfg", + "hashbrown 0.12.3", + "serde", +] + +[[package]] +name = "indexmap" +version = "2.10.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fe4cd85333e22411419a0bcae1297d25e58c9443848b11dc6a86fefe8c78a661" +dependencies = [ + "equivalent", + "hashbrown 0.15.5", + "serde", +] + +[[package]] +name = "indexmap-nostd" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8e04e2fd2b8188ea827b32ef11de88377086d690286ab35747ef7f9bf3ccb590" + +[[package]] +name = "itertools" +version = "0.10.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b0fd2260e829bddf4cb6ea802289de2f86d6a7a690192fbe91b3f46e0f2c8473" +dependencies = [ + "either", +] + +[[package]] +name = "itoa" +version = "1.0.15" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4a5f13b858c8d314ee3e8f639011f7ccefe71f97f96e50151fb991f267928e2c" + +[[package]] +name = "js-sys" +version = "0.3.77" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1cfaf33c695fc6e08064efbc1f72ec937429614f25eef83af942d0e227c3a28f" +dependencies = [ + "once_cell", + "wasm-bindgen", +] + +[[package]] +name = "k256" +version = "0.13.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f6e3919bbaa2945715f0bb6d3934a173d1e9a59ac23767fbaaef277265a7411b" +dependencies = [ + "cfg-if", + "ecdsa", + "elliptic-curve", + "sha2", +] + +[[package]] +name = "keccak" +version = "0.1.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ecc2af9a1119c51f12a14607e783cb977bde58bc069ff0c3da1095e635d70654" +dependencies = [ + "cpufeatures", +] + +[[package]] +name = "libc" +version = "0.2.175" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6a82ae493e598baaea5209805c49bbf2ea7de956d50d7da0da1164f9c6d28543" + +[[package]] +name = "libm" +version = "0.2.15" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f9fbbcab51052fe104eb5e5d351cf728d30a5be1fe14d9be8a3b097481fb97de" + +[[package]] +name = "log" +version = "0.4.27" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "13dc2df351e3202783a1fe0d44375f7295ffb4049267b0f3018346dc122a1d94" + +[[package]] +name = "memchr" +version = "2.7.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "32a282da65faaf38286cf3be983213fcf1d2e2a58700e808f83f4ea9a4804bc0" + +[[package]] +name = "num-bigint" +version = "0.4.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a5e44f723f1133c9deac646763579fdb3ac745e418f2a7af9cd0c431da1f20b9" +dependencies = [ + "num-integer", + "num-traits", +] + +[[package]] +name = "num-conv" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "51d515d32fb182ee37cda2ccdcb92950d6a3c2893aa280e540671c2cd0f3b1d9" + +[[package]] +name = "num-derive" +version = "0.4.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ed3955f1a9c7c0c15e092f9c887db08b1fc683305fdf6eb6684f22555355e202" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.105", +] + +[[package]] +name = "num-integer" +version = "0.1.46" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7969661fd2958a5cb096e56c8e1ad0444ac2bbcd0061bd28660485a44879858f" +dependencies = [ + "num-traits", +] + +[[package]] +name = "num-traits" +version = "0.2.19" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "071dfc062690e90b734c0b2273ce72ad0ffa95f0c74596bc250dcfd960262841" +dependencies = [ + "autocfg", +] + +[[package]] +name = "once_cell" +version = "1.21.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "42f5e15c9953c5e4ccceeb2e7382a716482c34515315f7b03532b8b4e8393d2d" + +[[package]] +name = "p256" +version = "0.13.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c9863ad85fa8f4460f9c48cb909d38a0d689dba1f6f6988a5e3e0d31071bcd4b" +dependencies = [ + "ecdsa", + "elliptic-curve", + "primeorder", + "sha2", +] + +[[package]] +name = "paste" +version = "1.0.15" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "57c0d7b74b563b49d38dae00a0c37d4d6de9b432382b2892f0574ddcae73fd0a" + +[[package]] +name = "pkcs8" +version = "0.10.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f950b2377845cebe5cf8b5165cb3cc1a5e0fa5cfa3e1f7f55707d8fd82e0a7b7" +dependencies = [ + "der", + "spki", +] + +[[package]] +name = "powerfmt" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "439ee305def115ba05938db6eb1644ff94165c5ab5e9420d1c1bcedbba909391" + +[[package]] +name = "ppv-lite86" +version = "0.2.21" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "85eae3c4ed2f50dcfe72643da4befc30deadb458a9b590d720cde2f2b1e97da9" +dependencies = [ + "zerocopy", +] + +[[package]] +name = "prettyplease" +version = "0.2.36" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ff24dfcda44452b9816fff4cd4227e1bb73ff5a2f1bc1105aa92fb8565ce44d2" +dependencies = [ + "proc-macro2", + "syn 2.0.105", +] + +[[package]] +name = "primeorder" +version = "0.13.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "353e1ca18966c16d9deb1c69278edbc5f194139612772bd9537af60ac231e1e6" +dependencies = [ + "elliptic-curve", +] + +[[package]] +name = "proc-macro2" +version = "1.0.97" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d61789d7719defeb74ea5fe81f2fdfdbd28a803847077cecce2ff14e1472f6f1" +dependencies = [ + "unicode-ident", +] + +[[package]] +name = "quote" +version = "1.0.40" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1885c039570dc00dcb4ff087a89e185fd56bae234ddc7f056a945bf36467248d" +dependencies = [ + "proc-macro2", +] + +[[package]] +name = "rand" +version = "0.8.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "34af8d1a0e25924bc5b7c43c079c942339d8f0a8b57c39049bef581b46327404" +dependencies = [ + "libc", + "rand_chacha", + "rand_core", +] + +[[package]] +name = "rand_chacha" +version = "0.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e6c10a63a0fa32252be49d21e7709d4d4baf8d231c2dbce1eaa8141b9b127d88" +dependencies = [ + "ppv-lite86", + "rand_core", +] + +[[package]] +name = "rand_core" +version = "0.6.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ec0be4795e2f6a28069bec0b5ff3e2ac9bafc99e6a9a7dc3547996c5c816922c" +dependencies = [ + "getrandom", +] + +[[package]] +name = "ref-cast" +version = "1.0.24" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4a0ae411dbe946a674d89546582cea4ba2bb8defac896622d6496f14c23ba5cf" +dependencies = [ + "ref-cast-impl", +] + +[[package]] +name = "ref-cast-impl" +version = "1.0.24" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1165225c21bff1f3bbce98f5a1f889949bc902d3575308cc7b0de30b4f6d27c7" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.105", +] + +[[package]] +name = "rfc6979" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f8dd2a808d456c4a54e300a23e9f5a67e122c3024119acbfd73e3bf664491cb2" +dependencies = [ + "hmac", + "subtle", +] + +[[package]] +name = "rustc_version" +version = "0.4.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cfcb3a22ef46e85b45de6ee7e79d063319ebb6594faafcf1c225ea92ab6e9b92" +dependencies = [ + "semver", +] + +[[package]] +name = "rustversion" +version = "1.0.22" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b39cdef0fa800fc44525c84ccb54a029961a8215f9619753635a9c0d2538d46d" + +[[package]] +name = "ryu" +version = "1.0.20" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "28d3b2b1366ec20994f1fd18c3c594f05c5dd4bc44d8bb0c1c632c8d6829481f" + +[[package]] +name = "schemars" +version = "0.9.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4cd191f9397d57d581cddd31014772520aa448f65ef991055d7f61582c65165f" +dependencies = [ + "dyn-clone", + "ref-cast", + "serde", + "serde_json", +] + +[[package]] +name = "schemars" +version = "1.0.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "82d20c4491bc164fa2f6c5d44565947a52ad80b9505d8e36f8d54c27c739fcd0" +dependencies = [ + "dyn-clone", + "ref-cast", + "serde", + "serde_json", +] + +[[package]] +name = "sec1" +version = "0.7.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d3e97a565f76233a6003f9f5c54be1d9c5bdfa3eccfb189469f11ec4901c47dc" +dependencies = [ + "base16ct", + "der", + "generic-array", + "subtle", + "zeroize", +] + +[[package]] +name = "semver" +version = "1.0.26" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "56e6fa9c48d24d85fb3de5ad847117517440f6beceb7798af16b4a87d616b8d0" + +[[package]] +name = "serde" +version = "1.0.219" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5f0e2c6ed6606019b4e29e69dbaba95b11854410e5347d525002456dbbb786b6" +dependencies = [ + "serde_derive", +] + +[[package]] +name = "serde_derive" +version = "1.0.219" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5b0276cf7f2c73365f7157c8123c21cd9a50fbbd844757af28ca1f5925fc2a00" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.105", +] + +[[package]] +name = "serde_json" +version = "1.0.142" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "030fedb782600dcbd6f02d479bf0d817ac3bb40d644745b769d6a96bc3afc5a7" +dependencies = [ + "itoa", + "memchr", + "ryu", + "serde", +] + +[[package]] +name = "serde_with" +version = "3.14.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f2c45cd61fefa9db6f254525d46e392b852e0e61d9a1fd36e5bd183450a556d5" +dependencies = [ + "base64 0.22.1", + "chrono", + "hex", + "indexmap 1.9.3", + "indexmap 2.10.0", + "schemars 0.9.0", + "schemars 1.0.4", + "serde", + "serde_derive", + "serde_json", + "serde_with_macros", + "time", +] + +[[package]] +name = "serde_with_macros" +version = "3.14.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "de90945e6565ce0d9a25098082ed4ee4002e047cb59892c318d66821e14bb30f" +dependencies = [ + "darling", + "proc-macro2", + "quote", + "syn 2.0.105", +] + +[[package]] +name = "sha2" +version = "0.10.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a7507d819769d01a365ab707794a4084392c824f54a7a6a7862f8c3d0892b283" +dependencies = [ + "cfg-if", + "cpufeatures", + "digest", +] + +[[package]] +name = "sha3" +version = "0.10.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "75872d278a8f37ef87fa0ddbda7802605cb18344497949862c0d4dcb291eba60" +dependencies = [ + "digest", + "keccak", +] + +[[package]] +name = "shlex" +version = "1.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0fda2ff0d084019ba4d7c6f371c95d8fd75ce3524c3cb8fb653a3023f6323e64" + +[[package]] +name = "signature" +version = "2.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "77549399552de45a898a580c1b41d445bf730df867cc44e6c0233bbc4b8329de" +dependencies = [ + "digest", + "rand_core", +] + +[[package]] +name = "smallvec" +version = "1.15.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "67b1b7a3b5fe4f1376887184045fcf45c69e92af734b7aaddc05fb777b6fbd03" + +[[package]] +name = "soroban-builtin-sdk-macros" +version = "22.1.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cf2e42bf80fcdefb3aae6ff3c7101a62cf942e95320ed5b518a1705bc11c6b2f" +dependencies = [ + "itertools", + "proc-macro2", + "quote", + "syn 2.0.105", +] + +[[package]] +name = "soroban-env-common" +version = "22.1.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "027cd856171bfd6ad2c0ffb3b7dfe55ad7080fb3050c36ad20970f80da634472" +dependencies = [ + "arbitrary", + "crate-git-revision", + "ethnum", + "num-derive", + "num-traits", + "serde", + "soroban-env-macros", + "soroban-wasmi", + "static_assertions", + "stellar-xdr", + "wasmparser", +] + +[[package]] +name = "soroban-env-guest" +version = "22.1.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9a07dda1ae5220d975979b19ad4fd56bc86ec7ec1b4b25bc1c5d403f934e592e" +dependencies = [ + "soroban-env-common", + "static_assertions", +] + +[[package]] +name = "soroban-env-host" +version = "22.1.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "66e8b03a4191d485eab03f066336112b2a50541a7553179553dc838b986b94dd" +dependencies = [ + "ark-bls12-381", + "ark-ec", + "ark-ff", + "ark-serialize", + "curve25519-dalek", + "ecdsa", + "ed25519-dalek", + "elliptic-curve", + "generic-array", + "getrandom", + "hex-literal", + "hmac", + "k256", + "num-derive", + "num-integer", + "num-traits", + "p256", + "rand", + "rand_chacha", + "sec1", + "sha2", + "sha3", + "soroban-builtin-sdk-macros", + "soroban-env-common", + "soroban-wasmi", + "static_assertions", + "stellar-strkey", + "wasmparser", +] + +[[package]] +name = "soroban-env-macros" +version = "22.1.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "00eff744764ade3bc480e4909e3a581a240091f3d262acdce80b41f7069b2bd9" +dependencies = [ + "itertools", + "proc-macro2", + "quote", + "serde", + "serde_json", + "stellar-xdr", + "syn 2.0.105", +] + +[[package]] +name = "soroban-ledger-snapshot" +version = "22.0.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2826e2c9d364edbb2ea112dc861077c74557bdad0a7a00487969088c7c648169" +dependencies = [ + "serde", + "serde_json", + "serde_with", + "soroban-env-common", + "soroban-env-host", + "thiserror", +] + +[[package]] +name = "soroban-sdk" +version = "22.0.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c7ac27d7573e62b745513fa1be8dab7a09b9676a7f39db97164f1d458a344749" +dependencies = [ + "arbitrary", + "bytes-lit", + "ctor", + "derive_arbitrary", + "ed25519-dalek", + "rand", + "rustc_version", + "serde", + "serde_json", + "soroban-env-guest", + "soroban-env-host", + "soroban-ledger-snapshot", + "soroban-sdk-macros", + "stellar-strkey", +] + +[[package]] +name = "soroban-sdk-macros" +version = "22.0.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9ef0d7d62b2584696d306b8766728971c7d0731a03a5e047f1fc68722ac8cf0c" +dependencies = [ + "crate-git-revision", + "darling", + "itertools", + "proc-macro2", + "quote", + "rustc_version", + "sha2", + "soroban-env-common", + "soroban-spec", + "soroban-spec-rust", + "stellar-xdr", + "syn 2.0.105", +] + +[[package]] +name = "soroban-spec" +version = "22.0.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a4ad0867aec99770ed614fedbec7ac4591791df162ff9e548ab7ebd07cd23a9c" +dependencies = [ + "base64 0.13.1", + "stellar-xdr", + "thiserror", + "wasmparser", +] + +[[package]] +name = "soroban-spec-rust" +version = "22.0.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "aebe31c042adfa2885ec47b67b08fcead8707da80a3fe737eaf2a9ae1a8cfdc3" +dependencies = [ + "prettyplease", + "proc-macro2", + "quote", + "sha2", + "soroban-spec", + "stellar-xdr", + "syn 2.0.105", + "thiserror", +] + +[[package]] +name = "soroban-wasmi" +version = "0.31.1-soroban.20.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "710403de32d0e0c35375518cb995d4fc056d0d48966f2e56ea471b8cb8fc9719" +dependencies = [ + "smallvec", + "spin", + "wasmi_arena", + "wasmi_core", + "wasmparser-nostd", +] + +[[package]] +name = "spin" +version = "0.9.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6980e8d7511241f8acf4aebddbb1ff938df5eebe98691418c4468d0b72a96a67" + +[[package]] +name = "spki" +version = "0.7.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d91ed6c858b01f942cd56b37a94b3e0a1798290327d1236e4d9cf4eaca44d29d" +dependencies = [ + "base64ct", + "der", +] + +[[package]] +name = "static_assertions" +version = "1.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a2eb9349b6444b326872e140eb1cf5e7c522154d69e7a0ffb0fb81c06b37543f" + +[[package]] +name = "stellar-strkey" +version = "0.0.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5e3aa3ed00e70082cb43febc1c2afa5056b9bb3e348bbb43d0cd0aa88a611144" +dependencies = [ + "crate-git-revision", + "data-encoding", + "thiserror", +] + +[[package]] +name = "stellar-xdr" +version = "22.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2ce69db907e64d1e70a3dce8d4824655d154749426a6132b25395c49136013e4" +dependencies = [ + "arbitrary", + "base64 0.13.1", + "crate-git-revision", + "escape-bytes", + "hex", + "serde", + "serde_with", + "stellar-strkey", +] + +[[package]] +name = "strsim" +version = "0.11.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7da8b5736845d9f2fcb837ea5d9e2628564b3b043a70948a3f0b778838c5fb4f" + +[[package]] +name = "subtle" +version = "2.6.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "13c2bddecc57b384dee18652358fb23172facb8a2c51ccc10d74c157bdea3292" + +[[package]] +name = "syn" +version = "1.0.109" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "72b64191b275b66ffe2469e8af2c1cfe3bafa67b529ead792a6d0160888b4237" +dependencies = [ + "proc-macro2", + "quote", + "unicode-ident", +] + +[[package]] +name = "syn" +version = "2.0.105" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7bc3fcb250e53458e712715cf74285c1f889686520d79294a9ef3bd7aa1fc619" +dependencies = [ + "proc-macro2", + "quote", + "unicode-ident", +] + +[[package]] +name = "thiserror" +version = "1.0.69" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b6aaf5339b578ea85b50e080feb250a3e8ae8cfcdff9a461c9ec2904bc923f52" +dependencies = [ + "thiserror-impl", +] + +[[package]] +name = "thiserror-impl" +version = "1.0.69" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4fee6c4efc90059e10f81e6d42c60a18f76588c3d74cb83a0b242a2b6c7504c1" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.105", +] + +[[package]] +name = "time" +version = "0.3.41" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8a7619e19bc266e0f9c5e6686659d394bc57973859340060a69221e57dbc0c40" +dependencies = [ + "deranged", + "itoa", + "num-conv", + "powerfmt", + "serde", + "time-core", + "time-macros", +] + +[[package]] +name = "time-core" +version = "0.1.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c9e9a38711f559d9e3ce1cdb06dd7c5b8ea546bc90052da6d06bb76da74bb07c" + +[[package]] +name = "time-macros" +version = "0.2.22" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3526739392ec93fd8b359c8e98514cb3e8e021beb4e5f597b00a0221f8ed8a49" +dependencies = [ + "num-conv", + "time-core", +] + +[[package]] +name = "todo_contract" +version = "0.0.0" +dependencies = [ + "base64ct", + "soroban-sdk", +] + +[[package]] +name = "typenum" +version = "1.18.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1dccffe3ce07af9386bfd29e80c0ab1a8205a2fc34e4bcd40364df902cfa8f3f" + +[[package]] +name = "unicode-ident" +version = "1.0.18" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5a5f39404a5da50712a4c1eecf25e90dd62b613502b7e925fd4e4d19b5c96512" + +[[package]] +name = "version_check" +version = "0.9.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0b928f33d975fc6ad9f86c8f283853ad26bdd5b10b7f1542aa2fa15e2289105a" + +[[package]] +name = "wasi" +version = "0.11.1+wasi-snapshot-preview1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ccf3ec651a847eb01de73ccad15eb7d99f80485de043efb2f370cd654f4ea44b" + +[[package]] +name = "wasm-bindgen" +version = "0.2.100" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1edc8929d7499fc4e8f0be2262a241556cfc54a0bea223790e71446f2aab1ef5" +dependencies = [ + "cfg-if", + "once_cell", + "rustversion", + "wasm-bindgen-macro", +] + +[[package]] +name = "wasm-bindgen-backend" +version = "0.2.100" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2f0a0651a5c2bc21487bde11ee802ccaf4c51935d0d3d42a6101f98161700bc6" +dependencies = [ + "bumpalo", + "log", + "proc-macro2", + "quote", + "syn 2.0.105", + "wasm-bindgen-shared", +] + +[[package]] +name = "wasm-bindgen-macro" +version = "0.2.100" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7fe63fc6d09ed3792bd0897b314f53de8e16568c2b3f7982f468c0bf9bd0b407" +dependencies = [ + "quote", + "wasm-bindgen-macro-support", +] + +[[package]] +name = "wasm-bindgen-macro-support" +version = "0.2.100" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8ae87ea40c9f689fc23f209965b6fb8a99ad69aeeb0231408be24920604395de" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.105", + "wasm-bindgen-backend", + "wasm-bindgen-shared", +] + +[[package]] +name = "wasm-bindgen-shared" +version = "0.2.100" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1a05d73b933a847d6cccdda8f838a22ff101ad9bf93e33684f39c1f5f0eece3d" +dependencies = [ + "unicode-ident", +] + +[[package]] +name = "wasmi_arena" +version = "0.4.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "104a7f73be44570cac297b3035d76b169d6599637631cf37a1703326a0727073" + +[[package]] +name = "wasmi_core" +version = "0.13.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "dcf1a7db34bff95b85c261002720c00c3a6168256dcb93041d3fa2054d19856a" +dependencies = [ + "downcast-rs", + "libm", + "num-traits", + "paste", +] + +[[package]] +name = "wasmparser" +version = "0.116.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a58e28b80dd8340cb07b8242ae654756161f6fc8d0038123d679b7b99964fa50" +dependencies = [ + "indexmap 2.10.0", + "semver", +] + +[[package]] +name = "wasmparser-nostd" +version = "0.100.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d5a015fe95f3504a94bb1462c717aae75253e39b9dd6c3fb1062c934535c64aa" +dependencies = [ + "indexmap-nostd", +] + +[[package]] +name = "windows-core" +version = "0.61.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c0fdd3ddb90610c7638aa2b3a3ab2904fb9e5cdbecc643ddb3647212781c4ae3" +dependencies = [ + "windows-implement", + "windows-interface", + "windows-link", + "windows-result", + "windows-strings", +] + +[[package]] +name = "windows-implement" +version = "0.60.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a47fddd13af08290e67f4acabf4b459f647552718f683a7b415d290ac744a836" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.105", +] + +[[package]] +name = "windows-interface" +version = "0.59.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bd9211b69f8dcdfa817bfd14bf1c97c9188afa36f4750130fcdf3f400eca9fa8" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.105", +] + +[[package]] +name = "windows-link" +version = "0.1.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5e6ad25900d524eaabdbbb96d20b4311e1e7ae1699af4fb28c17ae66c80d798a" + +[[package]] +name = "windows-result" +version = "0.3.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "56f42bd332cc6c8eac5af113fc0c1fd6a8fd2aa08a0119358686e5160d0586c6" +dependencies = [ + "windows-link", +] + +[[package]] +name = "windows-strings" +version = "0.4.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "56e6c93f3a0c3b36176cb1327a4958a0353d5d166c2a35cb268ace15e91d3b57" +dependencies = [ + "windows-link", +] + +[[package]] +name = "zerocopy" +version = "0.8.26" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1039dd0d3c310cf05de012d8a39ff557cb0d23087fd44cad61df08fc31907a2f" +dependencies = [ + "zerocopy-derive", +] + +[[package]] +name = "zerocopy-derive" +version = "0.8.26" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9ecf5b4cc5364572d7f4c329661bcc82724222973f2cab6f050a4e5c22f75181" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.105", +] + +[[package]] +name = "zeroize" +version = "1.8.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ced3678a2879b30306d323f4542626697a464a97c0a07c9aebf7ebca65cd4dde" +dependencies = [ + "zeroize_derive", +] + +[[package]] +name = "zeroize_derive" +version = "1.4.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ce36e65b0d2999d2aafac989fb249189a141aee1f53c612c1f37d72631959f69" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.105", +] diff --git a/submissions/week-6/day-3/Wilfred/todo_project/Cargo.toml b/submissions/week-6/day-3/Wilfred/todo_project/Cargo.toml new file mode 100644 index 000000000..a04ea4fb3 --- /dev/null +++ b/submissions/week-6/day-3/Wilfred/todo_project/Cargo.toml @@ -0,0 +1,23 @@ +[workspace] +resolver = "2" +members = [ + "contracts/*", +] + +[workspace.dependencies] +soroban-sdk = "22.0.0" + +[profile.release] +opt-level = "z" +overflow-checks = true +debug = 0 +strip = "symbols" +debug-assertions = false +panic = "abort" +codegen-units = 1 +lto = true + +# For more information about this profile see https://soroban.stellar.org/docs/basic-tutorials/logging#cargotoml-profile +[profile.release-with-logs] +inherits = "release" +debug-assertions = true diff --git a/submissions/week-6/day-3/Wilfred/todo_project/README.md b/submissions/week-6/day-3/Wilfred/todo_project/README.md new file mode 100644 index 000000000..012e23c44 --- /dev/null +++ b/submissions/week-6/day-3/Wilfred/todo_project/README.md @@ -0,0 +1,21 @@ +# Soroban Project + +## Project Structure + +This repository uses the recommended structure for a Soroban project: +```text +. +├── contracts +│   └── hello_world +│   ├── src +│   │   ├── lib.rs +│   │   └── test.rs +│   └── Cargo.toml +├── Cargo.toml +└── README.md +``` + +- New Soroban contracts can be put in `contracts`, each in their own directory. There is already a `hello_world` contract in there to get you started. +- If you initialized this project with any other example contracts via `--with-example`, those contracts will be in the `contracts` directory as well. +- Contracts should have their own `Cargo.toml` files that rely on the top-level `Cargo.toml` workspace for their dependencies. +- Frontend libraries can be added to the top-level directory as well. If you initialized this project with a frontend template via `--frontend-template` you will have those files already included. \ No newline at end of file diff --git a/submissions/week-6/day-3/Wilfred/todo_project/contracts/hello-world/Cargo.toml b/submissions/week-6/day-3/Wilfred/todo_project/contracts/hello-world/Cargo.toml new file mode 100644 index 000000000..c3e84a9f3 --- /dev/null +++ b/submissions/week-6/day-3/Wilfred/todo_project/contracts/hello-world/Cargo.toml @@ -0,0 +1,15 @@ +[package] +name = "hello-world" +version = "0.0.0" +edition = "2021" +publish = false + +[lib] +crate-type = ["lib", "cdylib"] +doctest = false + +[dependencies] +soroban-sdk = { workspace = true } + +[dev-dependencies] +soroban-sdk = { workspace = true, features = ["testutils"] } diff --git a/submissions/week-6/day-3/Wilfred/todo_project/contracts/hello-world/Makefile b/submissions/week-6/day-3/Wilfred/todo_project/contracts/hello-world/Makefile new file mode 100644 index 000000000..b9719346b --- /dev/null +++ b/submissions/week-6/day-3/Wilfred/todo_project/contracts/hello-world/Makefile @@ -0,0 +1,16 @@ +default: build + +all: test + +test: build + cargo test + +build: + stellar contract build + @ls -l target/wasm32v1-none/release/*.wasm + +fmt: + cargo fmt --all + +clean: + cargo clean diff --git a/submissions/week-6/day-3/Wilfred/todo_project/contracts/hello-world/src/lib.rs b/submissions/week-6/day-3/Wilfred/todo_project/contracts/hello-world/src/lib.rs new file mode 100644 index 000000000..f8120043a --- /dev/null +++ b/submissions/week-6/day-3/Wilfred/todo_project/contracts/hello-world/src/lib.rs @@ -0,0 +1,23 @@ +#![no_std] +use soroban_sdk::{contract, contractimpl, vec, Env, String, Vec}; + +#[contract] +pub struct Contract; + +// This is a sample contract. Replace this placeholder with your own contract logic. +// A corresponding test example is available in `test.rs`. +// +// For comprehensive examples, visit . +// The repository includes use cases for the Stellar ecosystem, such as data storage on +// the blockchain, token swaps, liquidity pools, and more. +// +// Refer to the official documentation: +// . +#[contractimpl] +impl Contract { + pub fn hello(env: Env, to: String) -> Vec { + vec![&env, String::from_str(&env, "Hello"), to] + } +} + +mod test; diff --git a/submissions/week-6/day-3/Wilfred/todo_project/contracts/hello-world/src/test.rs b/submissions/week-6/day-3/Wilfred/todo_project/contracts/hello-world/src/test.rs new file mode 100644 index 000000000..0bdcba082 --- /dev/null +++ b/submissions/week-6/day-3/Wilfred/todo_project/contracts/hello-world/src/test.rs @@ -0,0 +1,21 @@ +#![cfg(test)] + +use super::*; +use soroban_sdk::{vec, Env, String}; + +#[test] +fn test() { + let env = Env::default(); + let contract_id = env.register(Contract, ()); + let client = ContractClient::new(&env, &contract_id); + + let words = client.hello(&String::from_str(&env, "Dev")); + assert_eq!( + words, + vec![ + &env, + String::from_str(&env, "Hello"), + String::from_str(&env, "Dev"), + ] + ); +} diff --git a/submissions/week-6/day-3/Wilfred/todo_project/contracts/todo_contract/Cargo.toml b/submissions/week-6/day-3/Wilfred/todo_project/contracts/todo_contract/Cargo.toml new file mode 100644 index 000000000..648d517cf --- /dev/null +++ b/submissions/week-6/day-3/Wilfred/todo_project/contracts/todo_contract/Cargo.toml @@ -0,0 +1,16 @@ +[package] +name = "todo_contract" +version = "0.0.0" +edition = "2021" +publish = false + +[lib] +crate-type = ["lib", "cdylib"] +doctest = false + +[dependencies] +base64ct = "1.8.0" +soroban-sdk = { workspace = true } + +[dev-dependencies] +soroban-sdk = { workspace = true, features = ["testutils"] } diff --git a/submissions/week-6/day-3/Wilfred/todo_project/contracts/todo_contract/Makefile b/submissions/week-6/day-3/Wilfred/todo_project/contracts/todo_contract/Makefile new file mode 100644 index 000000000..e7013d355 --- /dev/null +++ b/submissions/week-6/day-3/Wilfred/todo_project/contracts/todo_contract/Makefile @@ -0,0 +1,16 @@ +default: build + +all: test + +test: build + cargo test + +build: + stellar contract build + @ls -l ../../target/wasm32v1-none/release/*.wasm + +fmt: + cargo fmt --all + +clean: + cargo clean diff --git a/submissions/week-6/day-3/Wilfred/todo_project/contracts/todo_contract/src/lib.rs b/submissions/week-6/day-3/Wilfred/todo_project/contracts/todo_contract/src/lib.rs new file mode 100644 index 000000000..6d2adcf48 --- /dev/null +++ b/submissions/week-6/day-3/Wilfred/todo_project/contracts/todo_contract/src/lib.rs @@ -0,0 +1,3 @@ +#![no_std] +mod test; +mod todo_list; diff --git a/submissions/week-6/day-3/Wilfred/todo_project/contracts/todo_contract/src/test.rs b/submissions/week-6/day-3/Wilfred/todo_project/contracts/todo_contract/src/test.rs new file mode 100644 index 000000000..03209b30d --- /dev/null +++ b/submissions/week-6/day-3/Wilfred/todo_project/contracts/todo_contract/src/test.rs @@ -0,0 +1,115 @@ +#![cfg(test)] + +use crate::todo_list::{Todolist, TodolistClient}; + +use super::*; +use soroban_sdk::{vec, Env, String}; + +fn setup() -> (Env, TodolistClient<'static>) { + let env = Env::default(); + let contract_id = env.register(Todolist, ()); + let client = TodolistClient::new(&env, &contract_id); + + (env, client) +} +#[test] +fn test() { + let (env, client) = setup(); + + let title = String::from_str(&env, "Go home!!!"); + + let description = String::from_str(&env, "From Garage to the hostel"); + + let words = client.create_todo(&title, &description); + + let all_todo = client.get_todos(); + + assert_eq!(all_todo.len(), 1); + assert_eq!(words.description, description); + assert_eq!(words.title, title); + assert_eq!(words.id, 1); + assert!(!words.status); +} + +#[test] +fn test_delete() { + let (env, client) = setup(); + + let title = String::from_str(&env, "Go home!!!"); + + let id = 1_u32; + + let description = String::from_str(&env, "From Garage to the hostel"); + + client.create_todo(&title, &description); + + let all_todo = client.get_todos(); + + assert_eq!(all_todo.len(), 1); + + client.delete_todo(&id); + + let all_todo = client.get_todos(); + + assert_eq!(all_todo.len(), 0); +} + +#[test] +fn update_todo() { + let (env, client) = setup(); + + // Step 1: Create a todo first + let title = String::from_str(&env, "Go home!!!"); + let description = String::from_str(&env, "From Garage to the hostel"); + let todo = client.create_todo(&title, &description); + + // Step 2: Update the todo + let new_title = String::from_str(&env, "Finish Homework"); + let new_description = String::from_str(&env, "Complete Rust assignment"); + + let result = client.update_todo(&todo.id, &new_title, &new_description); + + // Step 3: Assert update returned true + assert!(result); + + // Step 4: Fetch all todos and verify the update + let all_todos = client.get_todos(); + let updated = all_todos.get(0).unwrap(); + + assert_eq!(updated.title, new_title); + assert_eq!(updated.description, new_description); + assert_eq!(updated.id, todo.id); + assert!(!updated.status); // Status should remain unchanged +} + +#[test] +fn complete_todo() { + let (env, client) = setup(); + + // Step 1: Create a todo first + let title = String::from_str(&env, "Go home!!!"); + let description = String::from_str(&env, "From Garage to the hostel"); + let todo = client.create_todo(&title, &description); + + // Step 2: Complete the todo (toggle status) + let result = client.complete_todo(&todo.id); + + // Step 3: Assert the function returned true + assert!(result); + + // Step 4: Fetch all todos and verify the status changed + let all_todos = client.get_todos(); + let updated = all_todos.get(0).unwrap(); + + assert!(updated.status); // Status should now be true + + // Step 5: Toggle again to make sure it can revert + let result2 = client.complete_todo(&todo.id); + assert!(result2); + + let all_todos2 = client.get_todos(); + let reverted = all_todos2.get(0).unwrap(); + + assert!(!reverted.status); // Status should now be false again +} + diff --git a/submissions/week-6/day-3/Wilfred/todo_project/contracts/todo_contract/src/todo_list.rs b/submissions/week-6/day-3/Wilfred/todo_project/contracts/todo_contract/src/todo_list.rs new file mode 100644 index 000000000..669bb2fcb --- /dev/null +++ b/submissions/week-6/day-3/Wilfred/todo_project/contracts/todo_contract/src/todo_list.rs @@ -0,0 +1,114 @@ +use soroban_sdk::{ + contract, contractimpl, contracttype, symbol_short, xdr::SorobanCredentials, Env, String, + Symbol, Vec, +}; + +#[contracttype] +#[derive(Debug, PartialEq, Eq, Clone)] +pub struct Todo { + pub id: u32, + pub title: String, + pub description: String, + pub status: bool, +} + +const TODOS: Symbol = symbol_short!("TOD0S"); + +const NEXT_ID: Symbol = symbol_short!("NEXT_ID"); + +#[contract] +pub struct Todolist; + +#[contractimpl] +impl Todolist { + pub fn create_todo(env: Env, title: String, description: String) -> Todo { + let mut todos = Self::get_todos(&env); + + let mut current_id = env.storage().persistent().get(&NEXT_ID).unwrap_or(1); + + let todo = Todo { + id: current_id, + title, + description, + status: false, + }; + + todos.push_back(todo.clone()); + + env.storage().persistent().set(&TODOS, &todos); + + current_id += 1; + + env.storage().persistent().set(&NEXT_ID, ¤t_id); + + todo + } + + pub fn update_todo(env: Env, id: u32, title: String, description: String) -> bool { + let mut todos = Self::get_todos(&env); + for i in 0..todos.len() { + let mut updated = todos.get(i).unwrap(); + if updated.id == id { + updated.title = title; + updated.description = description; + todos.set(i, updated); + env.storage().persistent().set(&TODOS, &todos); + return true; + } + } + false + } + + pub fn complete_todo(env: Env, id: u32) -> bool { + let mut todos = Self::get_todos(&env); + + for i in 0..todos.len() { + if let Some(mut todo) = todos.get(i) { + if todo.id == id { + todo.status = !todo.status; + todos.set(i, todo); + env.storage().persistent().set(&TODOS, &todos); + return true; + } + } + } + false + } + + pub fn delete_todo(env: Env, id: u32) -> bool { + let mut todos = Self::get_todos(&env); + + if let Some(todo) = todos.iter().position(|i| i.id == id) { + todos.remove(todo as u32); + env.storage().persistent().set(&TODOS, &todos); + return true; + } + + false + } + + pub fn update_todo2(env: Env, id: u32, title: String, description: String) -> bool { + let mut todos = Self::get_todos(&env); + + for i in 0..todos.len() { + if let Some(mut todo) = todos.get(i) { + if todo.id == id { + todo.title = title; + todo.description = description; + todos.set(i, todo); + env.storage().persistent().set(&TODOS, &todos); + + return true; + } + } + } + false + } + + pub fn get_todos(env: &Env) -> Vec { + env.storage() + .persistent() + .get(&TODOS) + .unwrap_or(Vec::new(env)) + } +} diff --git a/submissions/week-6/day-3/Wilfred/todo_project/contracts/todo_contract/test_snapshots/test/complete_todo.1.json b/submissions/week-6/day-3/Wilfred/todo_project/contracts/todo_contract/test_snapshots/test/complete_todo.1.json new file mode 100644 index 000000000..395a79904 --- /dev/null +++ b/submissions/week-6/day-3/Wilfred/todo_project/contracts/todo_contract/test_snapshots/test/complete_todo.1.json @@ -0,0 +1,179 @@ +{ + "generators": { + "address": 1, + "nonce": 0 + }, + "auth": [ + [], + [], + [], + [], + [], + [] + ], + "ledger": { + "protocol_version": 22, + "sequence_number": 0, + "timestamp": 0, + "network_id": "0000000000000000000000000000000000000000000000000000000000000000", + "base_reserve": 0, + "min_persistent_entry_ttl": 4096, + "min_temp_entry_ttl": 16, + "max_entry_ttl": 6312000, + "ledger_entries": [ + [ + { + "contract_data": { + "contract": "CAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAD2KM", + "key": { + "symbol": "NEXT_ID" + }, + "durability": "persistent" + } + }, + [ + { + "last_modified_ledger_seq": 0, + "data": { + "contract_data": { + "ext": "v0", + "contract": "CAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAD2KM", + "key": { + "symbol": "NEXT_ID" + }, + "durability": "persistent", + "val": { + "u32": 2 + } + } + }, + "ext": "v0" + }, + 4095 + ] + ], + [ + { + "contract_data": { + "contract": "CAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAD2KM", + "key": { + "symbol": "TOD0S" + }, + "durability": "persistent" + } + }, + [ + { + "last_modified_ledger_seq": 0, + "data": { + "contract_data": { + "ext": "v0", + "contract": "CAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAD2KM", + "key": { + "symbol": "TOD0S" + }, + "durability": "persistent", + "val": { + "vec": [ + { + "map": [ + { + "key": { + "symbol": "description" + }, + "val": { + "string": "From Garage to the hostel" + } + }, + { + "key": { + "symbol": "id" + }, + "val": { + "u32": 1 + } + }, + { + "key": { + "symbol": "status" + }, + "val": { + "bool": false + } + }, + { + "key": { + "symbol": "title" + }, + "val": { + "string": "Go home!!!" + } + } + ] + } + ] + } + } + }, + "ext": "v0" + }, + 4095 + ] + ], + [ + { + "contract_data": { + "contract": "CAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAD2KM", + "key": "ledger_key_contract_instance", + "durability": "persistent" + } + }, + [ + { + "last_modified_ledger_seq": 0, + "data": { + "contract_data": { + "ext": "v0", + "contract": "CAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAD2KM", + "key": "ledger_key_contract_instance", + "durability": "persistent", + "val": { + "contract_instance": { + "executable": { + "wasm": "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855" + }, + "storage": null + } + } + } + }, + "ext": "v0" + }, + 4095 + ] + ], + [ + { + "contract_code": { + "hash": "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855" + } + }, + [ + { + "last_modified_ledger_seq": 0, + "data": { + "contract_code": { + "ext": "v0", + "hash": "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855", + "code": "" + } + }, + "ext": "v0" + }, + 4095 + ] + ] + ] + }, + "events": [] +} \ No newline at end of file diff --git a/submissions/week-6/day-3/Wilfred/todo_project/contracts/todo_contract/test_snapshots/test/test.1.json b/submissions/week-6/day-3/Wilfred/todo_project/contracts/todo_contract/test_snapshots/test/test.1.json new file mode 100644 index 000000000..1ccb3681e --- /dev/null +++ b/submissions/week-6/day-3/Wilfred/todo_project/contracts/todo_contract/test_snapshots/test/test.1.json @@ -0,0 +1,176 @@ +{ + "generators": { + "address": 1, + "nonce": 0 + }, + "auth": [ + [], + [], + [] + ], + "ledger": { + "protocol_version": 22, + "sequence_number": 0, + "timestamp": 0, + "network_id": "0000000000000000000000000000000000000000000000000000000000000000", + "base_reserve": 0, + "min_persistent_entry_ttl": 4096, + "min_temp_entry_ttl": 16, + "max_entry_ttl": 6312000, + "ledger_entries": [ + [ + { + "contract_data": { + "contract": "CAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAD2KM", + "key": { + "symbol": "NEXT_ID" + }, + "durability": "persistent" + } + }, + [ + { + "last_modified_ledger_seq": 0, + "data": { + "contract_data": { + "ext": "v0", + "contract": "CAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAD2KM", + "key": { + "symbol": "NEXT_ID" + }, + "durability": "persistent", + "val": { + "u32": 2 + } + } + }, + "ext": "v0" + }, + 4095 + ] + ], + [ + { + "contract_data": { + "contract": "CAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAD2KM", + "key": { + "symbol": "TOD0S" + }, + "durability": "persistent" + } + }, + [ + { + "last_modified_ledger_seq": 0, + "data": { + "contract_data": { + "ext": "v0", + "contract": "CAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAD2KM", + "key": { + "symbol": "TOD0S" + }, + "durability": "persistent", + "val": { + "vec": [ + { + "map": [ + { + "key": { + "symbol": "description" + }, + "val": { + "string": "From Garage to the hostel" + } + }, + { + "key": { + "symbol": "id" + }, + "val": { + "u32": 1 + } + }, + { + "key": { + "symbol": "status" + }, + "val": { + "bool": false + } + }, + { + "key": { + "symbol": "title" + }, + "val": { + "string": "Go home!!!" + } + } + ] + } + ] + } + } + }, + "ext": "v0" + }, + 4095 + ] + ], + [ + { + "contract_data": { + "contract": "CAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAD2KM", + "key": "ledger_key_contract_instance", + "durability": "persistent" + } + }, + [ + { + "last_modified_ledger_seq": 0, + "data": { + "contract_data": { + "ext": "v0", + "contract": "CAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAD2KM", + "key": "ledger_key_contract_instance", + "durability": "persistent", + "val": { + "contract_instance": { + "executable": { + "wasm": "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855" + }, + "storage": null + } + } + } + }, + "ext": "v0" + }, + 4095 + ] + ], + [ + { + "contract_code": { + "hash": "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855" + } + }, + [ + { + "last_modified_ledger_seq": 0, + "data": { + "contract_code": { + "ext": "v0", + "hash": "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855", + "code": "" + } + }, + "ext": "v0" + }, + 4095 + ] + ] + ] + }, + "events": [] +} \ No newline at end of file diff --git a/submissions/week-6/day-3/Wilfred/todo_project/contracts/todo_contract/test_snapshots/test/test_delete.1.json b/submissions/week-6/day-3/Wilfred/todo_project/contracts/todo_contract/test_snapshots/test/test_delete.1.json new file mode 100644 index 000000000..b54c7cfbc --- /dev/null +++ b/submissions/week-6/day-3/Wilfred/todo_project/contracts/todo_contract/test_snapshots/test/test_delete.1.json @@ -0,0 +1,141 @@ +{ + "generators": { + "address": 1, + "nonce": 0 + }, + "auth": [ + [], + [], + [], + [], + [] + ], + "ledger": { + "protocol_version": 22, + "sequence_number": 0, + "timestamp": 0, + "network_id": "0000000000000000000000000000000000000000000000000000000000000000", + "base_reserve": 0, + "min_persistent_entry_ttl": 4096, + "min_temp_entry_ttl": 16, + "max_entry_ttl": 6312000, + "ledger_entries": [ + [ + { + "contract_data": { + "contract": "CAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAD2KM", + "key": { + "symbol": "NEXT_ID" + }, + "durability": "persistent" + } + }, + [ + { + "last_modified_ledger_seq": 0, + "data": { + "contract_data": { + "ext": "v0", + "contract": "CAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAD2KM", + "key": { + "symbol": "NEXT_ID" + }, + "durability": "persistent", + "val": { + "u32": 2 + } + } + }, + "ext": "v0" + }, + 4095 + ] + ], + [ + { + "contract_data": { + "contract": "CAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAD2KM", + "key": { + "symbol": "TOD0S" + }, + "durability": "persistent" + } + }, + [ + { + "last_modified_ledger_seq": 0, + "data": { + "contract_data": { + "ext": "v0", + "contract": "CAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAD2KM", + "key": { + "symbol": "TOD0S" + }, + "durability": "persistent", + "val": { + "vec": [] + } + } + }, + "ext": "v0" + }, + 4095 + ] + ], + [ + { + "contract_data": { + "contract": "CAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAD2KM", + "key": "ledger_key_contract_instance", + "durability": "persistent" + } + }, + [ + { + "last_modified_ledger_seq": 0, + "data": { + "contract_data": { + "ext": "v0", + "contract": "CAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAD2KM", + "key": "ledger_key_contract_instance", + "durability": "persistent", + "val": { + "contract_instance": { + "executable": { + "wasm": "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855" + }, + "storage": null + } + } + } + }, + "ext": "v0" + }, + 4095 + ] + ], + [ + { + "contract_code": { + "hash": "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855" + } + }, + [ + { + "last_modified_ledger_seq": 0, + "data": { + "contract_code": { + "ext": "v0", + "hash": "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855", + "code": "" + } + }, + "ext": "v0" + }, + 4095 + ] + ] + ] + }, + "events": [] +} \ No newline at end of file diff --git a/submissions/week-6/day-3/Wilfred/todo_project/contracts/todo_contract/test_snapshots/test/update_todo.1.json b/submissions/week-6/day-3/Wilfred/todo_project/contracts/todo_contract/test_snapshots/test/update_todo.1.json new file mode 100644 index 000000000..a4919b3a3 --- /dev/null +++ b/submissions/week-6/day-3/Wilfred/todo_project/contracts/todo_contract/test_snapshots/test/update_todo.1.json @@ -0,0 +1,177 @@ +{ + "generators": { + "address": 1, + "nonce": 0 + }, + "auth": [ + [], + [], + [], + [] + ], + "ledger": { + "protocol_version": 22, + "sequence_number": 0, + "timestamp": 0, + "network_id": "0000000000000000000000000000000000000000000000000000000000000000", + "base_reserve": 0, + "min_persistent_entry_ttl": 4096, + "min_temp_entry_ttl": 16, + "max_entry_ttl": 6312000, + "ledger_entries": [ + [ + { + "contract_data": { + "contract": "CAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAD2KM", + "key": { + "symbol": "NEXT_ID" + }, + "durability": "persistent" + } + }, + [ + { + "last_modified_ledger_seq": 0, + "data": { + "contract_data": { + "ext": "v0", + "contract": "CAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAD2KM", + "key": { + "symbol": "NEXT_ID" + }, + "durability": "persistent", + "val": { + "u32": 2 + } + } + }, + "ext": "v0" + }, + 4095 + ] + ], + [ + { + "contract_data": { + "contract": "CAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAD2KM", + "key": { + "symbol": "TOD0S" + }, + "durability": "persistent" + } + }, + [ + { + "last_modified_ledger_seq": 0, + "data": { + "contract_data": { + "ext": "v0", + "contract": "CAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAD2KM", + "key": { + "symbol": "TOD0S" + }, + "durability": "persistent", + "val": { + "vec": [ + { + "map": [ + { + "key": { + "symbol": "description" + }, + "val": { + "string": "Complete Rust assignment" + } + }, + { + "key": { + "symbol": "id" + }, + "val": { + "u32": 1 + } + }, + { + "key": { + "symbol": "status" + }, + "val": { + "bool": false + } + }, + { + "key": { + "symbol": "title" + }, + "val": { + "string": "Finish Homework" + } + } + ] + } + ] + } + } + }, + "ext": "v0" + }, + 4095 + ] + ], + [ + { + "contract_data": { + "contract": "CAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAD2KM", + "key": "ledger_key_contract_instance", + "durability": "persistent" + } + }, + [ + { + "last_modified_ledger_seq": 0, + "data": { + "contract_data": { + "ext": "v0", + "contract": "CAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAD2KM", + "key": "ledger_key_contract_instance", + "durability": "persistent", + "val": { + "contract_instance": { + "executable": { + "wasm": "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855" + }, + "storage": null + } + } + } + }, + "ext": "v0" + }, + 4095 + ] + ], + [ + { + "contract_code": { + "hash": "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855" + } + }, + [ + { + "last_modified_ledger_seq": 0, + "data": { + "contract_code": { + "ext": "v0", + "hash": "e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855", + "code": "" + } + }, + "ext": "v0" + }, + 4095 + ] + ] + ] + }, + "events": [] +} \ No newline at end of file diff --git a/submissions/week-6/day-3/Wilfred_sep41/soroban-sep41/.gitignore b/submissions/week-6/day-3/Wilfred_sep41/soroban-sep41/.gitignore new file mode 100644 index 000000000..d74cc01f6 --- /dev/null +++ b/submissions/week-6/day-3/Wilfred_sep41/soroban-sep41/.gitignore @@ -0,0 +1,6 @@ +# Rust's output directory +target + +# Local settings +.soroban +.stellar diff --git a/submissions/week-6/day-3/Wilfred_sep41/soroban-sep41/Cargo.lock b/submissions/week-6/day-3/Wilfred_sep41/soroban-sep41/Cargo.lock new file mode 100644 index 000000000..2a427a530 --- /dev/null +++ b/submissions/week-6/day-3/Wilfred_sep41/soroban-sep41/Cargo.lock @@ -0,0 +1,1660 @@ +# This file is automatically @generated by Cargo. +# It is not intended for manual editing. +version = 4 + +[[package]] +name = "ahash" +version = "0.8.12" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5a15f179cd60c4584b8a8c596927aadc462e27f2ca70c04e0071964a73ba7a75" +dependencies = [ + "cfg-if", + "once_cell", + "version_check", + "zerocopy", +] + +[[package]] +name = "android-tzdata" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e999941b234f3131b00bc13c22d06e8c5ff726d1b6318ac7eb276997bbb4fef0" + +[[package]] +name = "android_system_properties" +version = "0.1.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "819e7219dbd41043ac279b19830f2efc897156490d7fd6ea916720117ee66311" +dependencies = [ + "libc", +] + +[[package]] +name = "arbitrary" +version = "1.3.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7d5a26814d8dcb93b0e5a0ff3c6d80a8843bafb21b39e8e18a6f05471870e110" +dependencies = [ + "derive_arbitrary", +] + +[[package]] +name = "ark-bls12-381" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c775f0d12169cba7aae4caeb547bb6a50781c7449a8aa53793827c9ec4abf488" +dependencies = [ + "ark-ec", + "ark-ff", + "ark-serialize", + "ark-std", +] + +[[package]] +name = "ark-ec" +version = "0.4.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "defd9a439d56ac24968cca0571f598a61bc8c55f71d50a89cda591cb750670ba" +dependencies = [ + "ark-ff", + "ark-poly", + "ark-serialize", + "ark-std", + "derivative", + "hashbrown 0.13.2", + "itertools", + "num-traits", + "zeroize", +] + +[[package]] +name = "ark-ff" +version = "0.4.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ec847af850f44ad29048935519032c33da8aa03340876d351dfab5660d2966ba" +dependencies = [ + "ark-ff-asm", + "ark-ff-macros", + "ark-serialize", + "ark-std", + "derivative", + "digest", + "itertools", + "num-bigint", + "num-traits", + "paste", + "rustc_version", + "zeroize", +] + +[[package]] +name = "ark-ff-asm" +version = "0.4.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3ed4aa4fe255d0bc6d79373f7e31d2ea147bcf486cba1be5ba7ea85abdb92348" +dependencies = [ + "quote", + "syn 1.0.109", +] + +[[package]] +name = "ark-ff-macros" +version = "0.4.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7abe79b0e4288889c4574159ab790824d0033b9fdcb2a112a3182fac2e514565" +dependencies = [ + "num-bigint", + "num-traits", + "proc-macro2", + "quote", + "syn 1.0.109", +] + +[[package]] +name = "ark-poly" +version = "0.4.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d320bfc44ee185d899ccbadfa8bc31aab923ce1558716e1997a1e74057fe86bf" +dependencies = [ + "ark-ff", + "ark-serialize", + "ark-std", + "derivative", + "hashbrown 0.13.2", +] + +[[package]] +name = "ark-serialize" +version = "0.4.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "adb7b85a02b83d2f22f89bd5cac66c9c89474240cb6207cb1efc16d098e822a5" +dependencies = [ + "ark-serialize-derive", + "ark-std", + "digest", + "num-bigint", +] + +[[package]] +name = "ark-serialize-derive" +version = "0.4.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ae3281bc6d0fd7e549af32b52511e1302185bd688fd3359fa36423346ff682ea" +dependencies = [ + "proc-macro2", + "quote", + "syn 1.0.109", +] + +[[package]] +name = "ark-std" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "94893f1e0c6eeab764ade8dc4c0db24caf4fe7cbbaafc0eba0a9030f447b5185" +dependencies = [ + "num-traits", + "rand", +] + +[[package]] +name = "autocfg" +version = "1.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c08606f8c3cbf4ce6ec8e28fb0014a2c086708fe954eaa885384a6165172e7e8" + +[[package]] +name = "base16ct" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4c7f02d4ea65f2c1853089ffd8d2787bdbc63de2f0d29dedbcf8ccdfa0ccd4cf" + +[[package]] +name = "base64" +version = "0.13.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9e1b586273c5702936fe7b7d6896644d8be71e6314cfe09d3167c95f712589e8" + +[[package]] +name = "base64" +version = "0.22.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "72b3254f16251a8381aa12e40e3c4d2f0199f8c6508fbecb9d91f575e0fbb8c6" + +[[package]] +name = "base64ct" +version = "1.8.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "55248b47b0caf0546f7988906588779981c43bb1bc9d0c44087278f80cdb44ba" + +[[package]] +name = "block-buffer" +version = "0.10.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3078c7629b62d3f0439517fa394996acacc5cbc91c5a20d8c658e77abd503a71" +dependencies = [ + "generic-array", +] + +[[package]] +name = "bumpalo" +version = "3.19.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "46c5e41b57b8bba42a04676d81cb89e9ee8e859a1a66f80a5a72e1cb76b34d43" + +[[package]] +name = "bytes-lit" +version = "0.0.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0adabf37211a5276e46335feabcbb1530c95eb3fdf85f324c7db942770aa025d" +dependencies = [ + "num-bigint", + "proc-macro2", + "quote", + "syn 2.0.106", +] + +[[package]] +name = "cc" +version = "1.2.33" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3ee0f8803222ba5a7e2777dd72ca451868909b1ac410621b676adf07280e9b5f" +dependencies = [ + "shlex", +] + +[[package]] +name = "cfg-if" +version = "1.0.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9aeec81361cbe5564f44e79538fc112002f70a448966f9160591c2bd5706dfad" + +[[package]] +name = "chrono" +version = "0.4.41" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c469d952047f47f91b68d1cba3f10d63c11d73e4636f24f08daf0278abf01c4d" +dependencies = [ + "android-tzdata", + "iana-time-zone", + "num-traits", + "serde", + "windows-link", +] + +[[package]] +name = "const-oid" +version = "0.9.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c2459377285ad874054d797f3ccebf984978aa39129f6eafde5cdc8315b612f8" + +[[package]] +name = "core-foundation-sys" +version = "0.8.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "773648b94d0e5d620f64f280777445740e61fe701025087ec8b57f45c791888b" + +[[package]] +name = "cpufeatures" +version = "0.2.17" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "59ed5838eebb26a2bb2e58f6d5b5316989ae9d08bab10e0e6d103e656d1b0280" +dependencies = [ + "libc", +] + +[[package]] +name = "crate-git-revision" +version = "0.0.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c521bf1f43d31ed2f73441775ed31935d77901cb3451e44b38a1c1612fcbaf98" +dependencies = [ + "serde", + "serde_derive", + "serde_json", +] + +[[package]] +name = "crypto-bigint" +version = "0.5.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0dc92fb57ca44df6db8059111ab3af99a63d5d0f8375d9972e319a379c6bab76" +dependencies = [ + "generic-array", + "rand_core", + "subtle", + "zeroize", +] + +[[package]] +name = "crypto-common" +version = "0.1.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1bfb12502f3fc46cca1bb51ac28df9d618d813cdc3d2f25b9fe775a34af26bb3" +dependencies = [ + "generic-array", + "typenum", +] + +[[package]] +name = "ctor" +version = "0.2.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "32a2785755761f3ddc1492979ce1e48d2c00d09311c39e4466429188f3dd6501" +dependencies = [ + "quote", + "syn 2.0.106", +] + +[[package]] +name = "curve25519-dalek" +version = "4.1.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "97fb8b7c4503de7d6ae7b42ab72a5a59857b4c937ec27a3d4539dba95b5ab2be" +dependencies = [ + "cfg-if", + "cpufeatures", + "curve25519-dalek-derive", + "digest", + "fiat-crypto", + "rustc_version", + "subtle", + "zeroize", +] + +[[package]] +name = "curve25519-dalek-derive" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f46882e17999c6cc590af592290432be3bce0428cb0d5f8b6715e4dc7b383eb3" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.106", +] + +[[package]] +name = "darling" +version = "0.20.11" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fc7f46116c46ff9ab3eb1597a45688b6715c6e628b5c133e288e709a29bcb4ee" +dependencies = [ + "darling_core", + "darling_macro", +] + +[[package]] +name = "darling_core" +version = "0.20.11" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0d00b9596d185e565c2207a0b01f8bd1a135483d02d9b7b0a54b11da8d53412e" +dependencies = [ + "fnv", + "ident_case", + "proc-macro2", + "quote", + "strsim", + "syn 2.0.106", +] + +[[package]] +name = "darling_macro" +version = "0.20.11" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fc34b93ccb385b40dc71c6fceac4b2ad23662c7eeb248cf10d529b7e055b6ead" +dependencies = [ + "darling_core", + "quote", + "syn 2.0.106", +] + +[[package]] +name = "data-encoding" +version = "2.9.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2a2330da5de22e8a3cb63252ce2abb30116bf5265e89c0e01bc17015ce30a476" + +[[package]] +name = "der" +version = "0.7.10" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e7c1832837b905bbfb5101e07cc24c8deddf52f93225eee6ead5f4d63d53ddcb" +dependencies = [ + "const-oid", + "zeroize", +] + +[[package]] +name = "deranged" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9c9e6a11ca8224451684bc0d7d5a7adbf8f2fd6887261a1cfc3c0432f9d4068e" +dependencies = [ + "powerfmt", + "serde", +] + +[[package]] +name = "derivative" +version = "2.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fcc3dd5e9e9c0b295d6e1e4d811fb6f157d5ffd784b8d202fc62eac8035a770b" +dependencies = [ + "proc-macro2", + "quote", + "syn 1.0.109", +] + +[[package]] +name = "derive_arbitrary" +version = "1.3.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "67e77553c4162a157adbf834ebae5b415acbecbeafc7a74b0e886657506a7611" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.106", +] + +[[package]] +name = "digest" +version = "0.10.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9ed9a281f7bc9b7576e61468ba615a66a5c8cfdff42420a70aa82701a3b1e292" +dependencies = [ + "block-buffer", + "const-oid", + "crypto-common", + "subtle", +] + +[[package]] +name = "downcast-rs" +version = "1.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "75b325c5dbd37f80359721ad39aca5a29fb04c89279657cffdda8736d0c0b9d2" + +[[package]] +name = "dyn-clone" +version = "1.0.20" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d0881ea181b1df73ff77ffaaf9c7544ecc11e82fba9b5f27b262a3c73a332555" + +[[package]] +name = "ecdsa" +version = "0.16.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ee27f32b5c5292967d2d4a9d7f1e0b0aed2c15daded5a60300e4abb9d8020bca" +dependencies = [ + "der", + "digest", + "elliptic-curve", + "rfc6979", + "signature", +] + +[[package]] +name = "ed25519" +version = "2.2.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "115531babc129696a58c64a4fef0a8bf9e9698629fb97e9e40767d235cfbcd53" +dependencies = [ + "pkcs8", + "signature", +] + +[[package]] +name = "ed25519-dalek" +version = "2.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "70e796c081cee67dc755e1a36a0a172b897fab85fc3f6bc48307991f64e4eca9" +dependencies = [ + "curve25519-dalek", + "ed25519", + "rand_core", + "serde", + "sha2", + "subtle", + "zeroize", +] + +[[package]] +name = "either" +version = "1.15.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "48c757948c5ede0e46177b7add2e67155f70e33c07fea8284df6576da70b3719" + +[[package]] +name = "elliptic-curve" +version = "0.13.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b5e6043086bf7973472e0c7dff2142ea0b680d30e18d9cc40f267efbf222bd47" +dependencies = [ + "base16ct", + "crypto-bigint", + "digest", + "ff", + "generic-array", + "group", + "rand_core", + "sec1", + "subtle", + "zeroize", +] + +[[package]] +name = "equivalent" +version = "1.0.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "877a4ace8713b0bcf2a4e7eec82529c029f1d0619886d18145fea96c3ffe5c0f" + +[[package]] +name = "escape-bytes" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2bfcf67fea2815c2fc3b90873fae90957be12ff417335dfadc7f52927feb03b2" + +[[package]] +name = "ethnum" +version = "1.5.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ca81e6b4777c89fd810c25a4be2b1bd93ea034fbe58e6a75216a34c6b82c539b" + +[[package]] +name = "ff" +version = "0.13.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c0b50bfb653653f9ca9095b427bed08ab8d75a137839d9ad64eb11810d5b6393" +dependencies = [ + "rand_core", + "subtle", +] + +[[package]] +name = "fiat-crypto" +version = "0.2.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "28dea519a9695b9977216879a3ebfddf92f1c08c05d984f8996aecd6ecdc811d" + +[[package]] +name = "fnv" +version = "1.0.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3f9eec918d3f24069decb9af1554cad7c880e2da24a9afd88aca000531ab82c1" + +[[package]] +name = "generic-array" +version = "0.14.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "85649ca51fd72272d7821adaf274ad91c288277713d9c18820d8499a7ff69e9a" +dependencies = [ + "typenum", + "version_check", + "zeroize", +] + +[[package]] +name = "getrandom" +version = "0.2.16" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "335ff9f135e4384c8150d6f27c6daed433577f86b4750418338c01a1a2528592" +dependencies = [ + "cfg-if", + "js-sys", + "libc", + "wasi", + "wasm-bindgen", +] + +[[package]] +name = "group" +version = "0.13.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f0f9ef7462f7c099f518d754361858f86d8a07af53ba9af0fe635bbccb151a63" +dependencies = [ + "ff", + "rand_core", + "subtle", +] + +[[package]] +name = "hashbrown" +version = "0.12.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8a9ee70c43aaf417c914396645a0fa852624801b24ebb7ae78fe8272889ac888" + +[[package]] +name = "hashbrown" +version = "0.13.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "43a3c133739dddd0d2990f9a4bdf8eb4b21ef50e4851ca85ab661199821d510e" +dependencies = [ + "ahash", +] + +[[package]] +name = "hashbrown" +version = "0.15.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9229cfe53dfd69f0609a49f65461bd93001ea1ef889cd5529dd176593f5338a1" + +[[package]] +name = "hex" +version = "0.4.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7f24254aa9a54b5c858eaee2f5bccdb46aaf0e486a595ed5fd8f86ba55232a70" +dependencies = [ + "serde", +] + +[[package]] +name = "hex-literal" +version = "0.4.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6fe2267d4ed49bc07b63801559be28c718ea06c4738b7a03c94df7386d2cde46" + +[[package]] +name = "hmac" +version = "0.12.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6c49c37c09c17a53d937dfbb742eb3a961d65a994e6bcdcf37e7399d0cc8ab5e" +dependencies = [ + "digest", +] + +[[package]] +name = "iana-time-zone" +version = "0.1.63" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b0c919e5debc312ad217002b8048a17b7d83f80703865bbfcfebb0458b0b27d8" +dependencies = [ + "android_system_properties", + "core-foundation-sys", + "iana-time-zone-haiku", + "js-sys", + "log", + "wasm-bindgen", + "windows-core", +] + +[[package]] +name = "iana-time-zone-haiku" +version = "0.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f31827a206f56af32e590ba56d5d2d085f558508192593743f16b2306495269f" +dependencies = [ + "cc", +] + +[[package]] +name = "ident_case" +version = "1.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b9e0384b61958566e926dc50660321d12159025e767c18e043daf26b70104c39" + +[[package]] +name = "indexmap" +version = "1.9.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bd070e393353796e801d209ad339e89596eb4c8d430d18ede6a1cced8fafbd99" +dependencies = [ + "autocfg", + "hashbrown 0.12.3", + "serde", +] + +[[package]] +name = "indexmap" +version = "2.10.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fe4cd85333e22411419a0bcae1297d25e58c9443848b11dc6a86fefe8c78a661" +dependencies = [ + "equivalent", + "hashbrown 0.15.5", + "serde", +] + +[[package]] +name = "indexmap-nostd" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8e04e2fd2b8188ea827b32ef11de88377086d690286ab35747ef7f9bf3ccb590" + +[[package]] +name = "itertools" +version = "0.10.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b0fd2260e829bddf4cb6ea802289de2f86d6a7a690192fbe91b3f46e0f2c8473" +dependencies = [ + "either", +] + +[[package]] +name = "itoa" +version = "1.0.15" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4a5f13b858c8d314ee3e8f639011f7ccefe71f97f96e50151fb991f267928e2c" + +[[package]] +name = "js-sys" +version = "0.3.77" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1cfaf33c695fc6e08064efbc1f72ec937429614f25eef83af942d0e227c3a28f" +dependencies = [ + "once_cell", + "wasm-bindgen", +] + +[[package]] +name = "k256" +version = "0.13.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f6e3919bbaa2945715f0bb6d3934a173d1e9a59ac23767fbaaef277265a7411b" +dependencies = [ + "cfg-if", + "ecdsa", + "elliptic-curve", + "sha2", +] + +[[package]] +name = "keccak" +version = "0.1.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ecc2af9a1119c51f12a14607e783cb977bde58bc069ff0c3da1095e635d70654" +dependencies = [ + "cpufeatures", +] + +[[package]] +name = "libc" +version = "0.2.175" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6a82ae493e598baaea5209805c49bbf2ea7de956d50d7da0da1164f9c6d28543" + +[[package]] +name = "libm" +version = "0.2.15" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f9fbbcab51052fe104eb5e5d351cf728d30a5be1fe14d9be8a3b097481fb97de" + +[[package]] +name = "log" +version = "0.4.27" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "13dc2df351e3202783a1fe0d44375f7295ffb4049267b0f3018346dc122a1d94" + +[[package]] +name = "memchr" +version = "2.7.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "32a282da65faaf38286cf3be983213fcf1d2e2a58700e808f83f4ea9a4804bc0" + +[[package]] +name = "num-bigint" +version = "0.4.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a5e44f723f1133c9deac646763579fdb3ac745e418f2a7af9cd0c431da1f20b9" +dependencies = [ + "num-integer", + "num-traits", +] + +[[package]] +name = "num-conv" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "51d515d32fb182ee37cda2ccdcb92950d6a3c2893aa280e540671c2cd0f3b1d9" + +[[package]] +name = "num-derive" +version = "0.4.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ed3955f1a9c7c0c15e092f9c887db08b1fc683305fdf6eb6684f22555355e202" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.106", +] + +[[package]] +name = "num-integer" +version = "0.1.46" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7969661fd2958a5cb096e56c8e1ad0444ac2bbcd0061bd28660485a44879858f" +dependencies = [ + "num-traits", +] + +[[package]] +name = "num-traits" +version = "0.2.19" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "071dfc062690e90b734c0b2273ce72ad0ffa95f0c74596bc250dcfd960262841" +dependencies = [ + "autocfg", +] + +[[package]] +name = "once_cell" +version = "1.21.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "42f5e15c9953c5e4ccceeb2e7382a716482c34515315f7b03532b8b4e8393d2d" + +[[package]] +name = "p256" +version = "0.13.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c9863ad85fa8f4460f9c48cb909d38a0d689dba1f6f6988a5e3e0d31071bcd4b" +dependencies = [ + "ecdsa", + "elliptic-curve", + "primeorder", + "sha2", +] + +[[package]] +name = "paste" +version = "1.0.15" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "57c0d7b74b563b49d38dae00a0c37d4d6de9b432382b2892f0574ddcae73fd0a" + +[[package]] +name = "pkcs8" +version = "0.10.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f950b2377845cebe5cf8b5165cb3cc1a5e0fa5cfa3e1f7f55707d8fd82e0a7b7" +dependencies = [ + "der", + "spki", +] + +[[package]] +name = "powerfmt" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "439ee305def115ba05938db6eb1644ff94165c5ab5e9420d1c1bcedbba909391" + +[[package]] +name = "ppv-lite86" +version = "0.2.21" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "85eae3c4ed2f50dcfe72643da4befc30deadb458a9b590d720cde2f2b1e97da9" +dependencies = [ + "zerocopy", +] + +[[package]] +name = "prettyplease" +version = "0.2.37" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "479ca8adacdd7ce8f1fb39ce9ecccbfe93a3f1344b3d0d97f20bc0196208f62b" +dependencies = [ + "proc-macro2", + "syn 2.0.106", +] + +[[package]] +name = "primeorder" +version = "0.13.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "353e1ca18966c16d9deb1c69278edbc5f194139612772bd9537af60ac231e1e6" +dependencies = [ + "elliptic-curve", +] + +[[package]] +name = "proc-macro2" +version = "1.0.101" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "89ae43fd86e4158d6db51ad8e2b80f313af9cc74f5c0e03ccb87de09998732de" +dependencies = [ + "unicode-ident", +] + +[[package]] +name = "quote" +version = "1.0.40" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1885c039570dc00dcb4ff087a89e185fd56bae234ddc7f056a945bf36467248d" +dependencies = [ + "proc-macro2", +] + +[[package]] +name = "rand" +version = "0.8.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "34af8d1a0e25924bc5b7c43c079c942339d8f0a8b57c39049bef581b46327404" +dependencies = [ + "libc", + "rand_chacha", + "rand_core", +] + +[[package]] +name = "rand_chacha" +version = "0.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e6c10a63a0fa32252be49d21e7709d4d4baf8d231c2dbce1eaa8141b9b127d88" +dependencies = [ + "ppv-lite86", + "rand_core", +] + +[[package]] +name = "rand_core" +version = "0.6.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ec0be4795e2f6a28069bec0b5ff3e2ac9bafc99e6a9a7dc3547996c5c816922c" +dependencies = [ + "getrandom", +] + +[[package]] +name = "ref-cast" +version = "1.0.24" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4a0ae411dbe946a674d89546582cea4ba2bb8defac896622d6496f14c23ba5cf" +dependencies = [ + "ref-cast-impl", +] + +[[package]] +name = "ref-cast-impl" +version = "1.0.24" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1165225c21bff1f3bbce98f5a1f889949bc902d3575308cc7b0de30b4f6d27c7" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.106", +] + +[[package]] +name = "rfc6979" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f8dd2a808d456c4a54e300a23e9f5a67e122c3024119acbfd73e3bf664491cb2" +dependencies = [ + "hmac", + "subtle", +] + +[[package]] +name = "rustc_version" +version = "0.4.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cfcb3a22ef46e85b45de6ee7e79d063319ebb6594faafcf1c225ea92ab6e9b92" +dependencies = [ + "semver", +] + +[[package]] +name = "rustversion" +version = "1.0.22" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b39cdef0fa800fc44525c84ccb54a029961a8215f9619753635a9c0d2538d46d" + +[[package]] +name = "ryu" +version = "1.0.20" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "28d3b2b1366ec20994f1fd18c3c594f05c5dd4bc44d8bb0c1c632c8d6829481f" + +[[package]] +name = "schemars" +version = "0.9.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4cd191f9397d57d581cddd31014772520aa448f65ef991055d7f61582c65165f" +dependencies = [ + "dyn-clone", + "ref-cast", + "serde", + "serde_json", +] + +[[package]] +name = "schemars" +version = "1.0.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "82d20c4491bc164fa2f6c5d44565947a52ad80b9505d8e36f8d54c27c739fcd0" +dependencies = [ + "dyn-clone", + "ref-cast", + "serde", + "serde_json", +] + +[[package]] +name = "sec1" +version = "0.7.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d3e97a565f76233a6003f9f5c54be1d9c5bdfa3eccfb189469f11ec4901c47dc" +dependencies = [ + "base16ct", + "der", + "generic-array", + "subtle", + "zeroize", +] + +[[package]] +name = "semver" +version = "1.0.26" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "56e6fa9c48d24d85fb3de5ad847117517440f6beceb7798af16b4a87d616b8d0" + +[[package]] +name = "sep42-token" +version = "1.0.0" +dependencies = [ + "soroban-sdk", +] + +[[package]] +name = "serde" +version = "1.0.219" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5f0e2c6ed6606019b4e29e69dbaba95b11854410e5347d525002456dbbb786b6" +dependencies = [ + "serde_derive", +] + +[[package]] +name = "serde_derive" +version = "1.0.219" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5b0276cf7f2c73365f7157c8123c21cd9a50fbbd844757af28ca1f5925fc2a00" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.106", +] + +[[package]] +name = "serde_json" +version = "1.0.143" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d401abef1d108fbd9cbaebc3e46611f4b1021f714a0597a71f41ee463f5f4a5a" +dependencies = [ + "itoa", + "memchr", + "ryu", + "serde", +] + +[[package]] +name = "serde_with" +version = "3.14.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f2c45cd61fefa9db6f254525d46e392b852e0e61d9a1fd36e5bd183450a556d5" +dependencies = [ + "base64 0.22.1", + "chrono", + "hex", + "indexmap 1.9.3", + "indexmap 2.10.0", + "schemars 0.9.0", + "schemars 1.0.4", + "serde", + "serde_derive", + "serde_json", + "serde_with_macros", + "time", +] + +[[package]] +name = "serde_with_macros" +version = "3.14.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "de90945e6565ce0d9a25098082ed4ee4002e047cb59892c318d66821e14bb30f" +dependencies = [ + "darling", + "proc-macro2", + "quote", + "syn 2.0.106", +] + +[[package]] +name = "sha2" +version = "0.10.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a7507d819769d01a365ab707794a4084392c824f54a7a6a7862f8c3d0892b283" +dependencies = [ + "cfg-if", + "cpufeatures", + "digest", +] + +[[package]] +name = "sha3" +version = "0.10.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "75872d278a8f37ef87fa0ddbda7802605cb18344497949862c0d4dcb291eba60" +dependencies = [ + "digest", + "keccak", +] + +[[package]] +name = "shlex" +version = "1.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0fda2ff0d084019ba4d7c6f371c95d8fd75ce3524c3cb8fb653a3023f6323e64" + +[[package]] +name = "signature" +version = "2.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "77549399552de45a898a580c1b41d445bf730df867cc44e6c0233bbc4b8329de" +dependencies = [ + "digest", + "rand_core", +] + +[[package]] +name = "smallvec" +version = "1.15.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "67b1b7a3b5fe4f1376887184045fcf45c69e92af734b7aaddc05fb777b6fbd03" + +[[package]] +name = "soroban-builtin-sdk-macros" +version = "22.1.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cf2e42bf80fcdefb3aae6ff3c7101a62cf942e95320ed5b518a1705bc11c6b2f" +dependencies = [ + "itertools", + "proc-macro2", + "quote", + "syn 2.0.106", +] + +[[package]] +name = "soroban-env-common" +version = "22.1.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "027cd856171bfd6ad2c0ffb3b7dfe55ad7080fb3050c36ad20970f80da634472" +dependencies = [ + "arbitrary", + "crate-git-revision", + "ethnum", + "num-derive", + "num-traits", + "serde", + "soroban-env-macros", + "soroban-wasmi", + "static_assertions", + "stellar-xdr", + "wasmparser", +] + +[[package]] +name = "soroban-env-guest" +version = "22.1.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9a07dda1ae5220d975979b19ad4fd56bc86ec7ec1b4b25bc1c5d403f934e592e" +dependencies = [ + "soroban-env-common", + "static_assertions", +] + +[[package]] +name = "soroban-env-host" +version = "22.1.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "66e8b03a4191d485eab03f066336112b2a50541a7553179553dc838b986b94dd" +dependencies = [ + "ark-bls12-381", + "ark-ec", + "ark-ff", + "ark-serialize", + "curve25519-dalek", + "ecdsa", + "ed25519-dalek", + "elliptic-curve", + "generic-array", + "getrandom", + "hex-literal", + "hmac", + "k256", + "num-derive", + "num-integer", + "num-traits", + "p256", + "rand", + "rand_chacha", + "sec1", + "sha2", + "sha3", + "soroban-builtin-sdk-macros", + "soroban-env-common", + "soroban-wasmi", + "static_assertions", + "stellar-strkey", + "wasmparser", +] + +[[package]] +name = "soroban-env-macros" +version = "22.1.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "00eff744764ade3bc480e4909e3a581a240091f3d262acdce80b41f7069b2bd9" +dependencies = [ + "itertools", + "proc-macro2", + "quote", + "serde", + "serde_json", + "stellar-xdr", + "syn 2.0.106", +] + +[[package]] +name = "soroban-ledger-snapshot" +version = "22.0.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2826e2c9d364edbb2ea112dc861077c74557bdad0a7a00487969088c7c648169" +dependencies = [ + "serde", + "serde_json", + "serde_with", + "soroban-env-common", + "soroban-env-host", + "thiserror", +] + +[[package]] +name = "soroban-sdk" +version = "22.0.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c7ac27d7573e62b745513fa1be8dab7a09b9676a7f39db97164f1d458a344749" +dependencies = [ + "arbitrary", + "bytes-lit", + "ctor", + "derive_arbitrary", + "ed25519-dalek", + "rand", + "rustc_version", + "serde", + "serde_json", + "soroban-env-guest", + "soroban-env-host", + "soroban-ledger-snapshot", + "soroban-sdk-macros", + "stellar-strkey", +] + +[[package]] +name = "soroban-sdk-macros" +version = "22.0.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9ef0d7d62b2584696d306b8766728971c7d0731a03a5e047f1fc68722ac8cf0c" +dependencies = [ + "crate-git-revision", + "darling", + "itertools", + "proc-macro2", + "quote", + "rustc_version", + "sha2", + "soroban-env-common", + "soroban-spec", + "soroban-spec-rust", + "stellar-xdr", + "syn 2.0.106", +] + +[[package]] +name = "soroban-spec" +version = "22.0.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a4ad0867aec99770ed614fedbec7ac4591791df162ff9e548ab7ebd07cd23a9c" +dependencies = [ + "base64 0.13.1", + "stellar-xdr", + "thiserror", + "wasmparser", +] + +[[package]] +name = "soroban-spec-rust" +version = "22.0.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "aebe31c042adfa2885ec47b67b08fcead8707da80a3fe737eaf2a9ae1a8cfdc3" +dependencies = [ + "prettyplease", + "proc-macro2", + "quote", + "sha2", + "soroban-spec", + "stellar-xdr", + "syn 2.0.106", + "thiserror", +] + +[[package]] +name = "soroban-wasmi" +version = "0.31.1-soroban.20.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "710403de32d0e0c35375518cb995d4fc056d0d48966f2e56ea471b8cb8fc9719" +dependencies = [ + "smallvec", + "spin", + "wasmi_arena", + "wasmi_core", + "wasmparser-nostd", +] + +[[package]] +name = "spin" +version = "0.9.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6980e8d7511241f8acf4aebddbb1ff938df5eebe98691418c4468d0b72a96a67" + +[[package]] +name = "spki" +version = "0.7.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d91ed6c858b01f942cd56b37a94b3e0a1798290327d1236e4d9cf4eaca44d29d" +dependencies = [ + "base64ct", + "der", +] + +[[package]] +name = "static_assertions" +version = "1.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a2eb9349b6444b326872e140eb1cf5e7c522154d69e7a0ffb0fb81c06b37543f" + +[[package]] +name = "stellar-strkey" +version = "0.0.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5e3aa3ed00e70082cb43febc1c2afa5056b9bb3e348bbb43d0cd0aa88a611144" +dependencies = [ + "crate-git-revision", + "data-encoding", + "thiserror", +] + +[[package]] +name = "stellar-xdr" +version = "22.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2ce69db907e64d1e70a3dce8d4824655d154749426a6132b25395c49136013e4" +dependencies = [ + "arbitrary", + "base64 0.13.1", + "crate-git-revision", + "escape-bytes", + "hex", + "serde", + "serde_with", + "stellar-strkey", +] + +[[package]] +name = "strsim" +version = "0.11.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7da8b5736845d9f2fcb837ea5d9e2628564b3b043a70948a3f0b778838c5fb4f" + +[[package]] +name = "subtle" +version = "2.6.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "13c2bddecc57b384dee18652358fb23172facb8a2c51ccc10d74c157bdea3292" + +[[package]] +name = "syn" +version = "1.0.109" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "72b64191b275b66ffe2469e8af2c1cfe3bafa67b529ead792a6d0160888b4237" +dependencies = [ + "proc-macro2", + "quote", + "unicode-ident", +] + +[[package]] +name = "syn" +version = "2.0.106" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ede7c438028d4436d71104916910f5bb611972c5cfd7f89b8300a8186e6fada6" +dependencies = [ + "proc-macro2", + "quote", + "unicode-ident", +] + +[[package]] +name = "thiserror" +version = "1.0.69" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b6aaf5339b578ea85b50e080feb250a3e8ae8cfcdff9a461c9ec2904bc923f52" +dependencies = [ + "thiserror-impl", +] + +[[package]] +name = "thiserror-impl" +version = "1.0.69" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4fee6c4efc90059e10f81e6d42c60a18f76588c3d74cb83a0b242a2b6c7504c1" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.106", +] + +[[package]] +name = "time" +version = "0.3.41" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8a7619e19bc266e0f9c5e6686659d394bc57973859340060a69221e57dbc0c40" +dependencies = [ + "deranged", + "itoa", + "num-conv", + "powerfmt", + "serde", + "time-core", + "time-macros", +] + +[[package]] +name = "time-core" +version = "0.1.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c9e9a38711f559d9e3ce1cdb06dd7c5b8ea546bc90052da6d06bb76da74bb07c" + +[[package]] +name = "time-macros" +version = "0.2.22" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3526739392ec93fd8b359c8e98514cb3e8e021beb4e5f597b00a0221f8ed8a49" +dependencies = [ + "num-conv", + "time-core", +] + +[[package]] +name = "typenum" +version = "1.18.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1dccffe3ce07af9386bfd29e80c0ab1a8205a2fc34e4bcd40364df902cfa8f3f" + +[[package]] +name = "unicode-ident" +version = "1.0.18" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5a5f39404a5da50712a4c1eecf25e90dd62b613502b7e925fd4e4d19b5c96512" + +[[package]] +name = "version_check" +version = "0.9.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0b928f33d975fc6ad9f86c8f283853ad26bdd5b10b7f1542aa2fa15e2289105a" + +[[package]] +name = "wasi" +version = "0.11.1+wasi-snapshot-preview1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ccf3ec651a847eb01de73ccad15eb7d99f80485de043efb2f370cd654f4ea44b" + +[[package]] +name = "wasm-bindgen" +version = "0.2.100" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1edc8929d7499fc4e8f0be2262a241556cfc54a0bea223790e71446f2aab1ef5" +dependencies = [ + "cfg-if", + "once_cell", + "rustversion", + "wasm-bindgen-macro", +] + +[[package]] +name = "wasm-bindgen-backend" +version = "0.2.100" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2f0a0651a5c2bc21487bde11ee802ccaf4c51935d0d3d42a6101f98161700bc6" +dependencies = [ + "bumpalo", + "log", + "proc-macro2", + "quote", + "syn 2.0.106", + "wasm-bindgen-shared", +] + +[[package]] +name = "wasm-bindgen-macro" +version = "0.2.100" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7fe63fc6d09ed3792bd0897b314f53de8e16568c2b3f7982f468c0bf9bd0b407" +dependencies = [ + "quote", + "wasm-bindgen-macro-support", +] + +[[package]] +name = "wasm-bindgen-macro-support" +version = "0.2.100" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8ae87ea40c9f689fc23f209965b6fb8a99ad69aeeb0231408be24920604395de" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.106", + "wasm-bindgen-backend", + "wasm-bindgen-shared", +] + +[[package]] +name = "wasm-bindgen-shared" +version = "0.2.100" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1a05d73b933a847d6cccdda8f838a22ff101ad9bf93e33684f39c1f5f0eece3d" +dependencies = [ + "unicode-ident", +] + +[[package]] +name = "wasmi_arena" +version = "0.4.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "104a7f73be44570cac297b3035d76b169d6599637631cf37a1703326a0727073" + +[[package]] +name = "wasmi_core" +version = "0.13.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "dcf1a7db34bff95b85c261002720c00c3a6168256dcb93041d3fa2054d19856a" +dependencies = [ + "downcast-rs", + "libm", + "num-traits", + "paste", +] + +[[package]] +name = "wasmparser" +version = "0.116.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a58e28b80dd8340cb07b8242ae654756161f6fc8d0038123d679b7b99964fa50" +dependencies = [ + "indexmap 2.10.0", + "semver", +] + +[[package]] +name = "wasmparser-nostd" +version = "0.100.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d5a015fe95f3504a94bb1462c717aae75253e39b9dd6c3fb1062c934535c64aa" +dependencies = [ + "indexmap-nostd", +] + +[[package]] +name = "windows-core" +version = "0.61.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c0fdd3ddb90610c7638aa2b3a3ab2904fb9e5cdbecc643ddb3647212781c4ae3" +dependencies = [ + "windows-implement", + "windows-interface", + "windows-link", + "windows-result", + "windows-strings", +] + +[[package]] +name = "windows-implement" +version = "0.60.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a47fddd13af08290e67f4acabf4b459f647552718f683a7b415d290ac744a836" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.106", +] + +[[package]] +name = "windows-interface" +version = "0.59.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bd9211b69f8dcdfa817bfd14bf1c97c9188afa36f4750130fcdf3f400eca9fa8" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.106", +] + +[[package]] +name = "windows-link" +version = "0.1.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5e6ad25900d524eaabdbbb96d20b4311e1e7ae1699af4fb28c17ae66c80d798a" + +[[package]] +name = "windows-result" +version = "0.3.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "56f42bd332cc6c8eac5af113fc0c1fd6a8fd2aa08a0119358686e5160d0586c6" +dependencies = [ + "windows-link", +] + +[[package]] +name = "windows-strings" +version = "0.4.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "56e6c93f3a0c3b36176cb1327a4958a0353d5d166c2a35cb268ace15e91d3b57" +dependencies = [ + "windows-link", +] + +[[package]] +name = "zerocopy" +version = "0.8.26" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1039dd0d3c310cf05de012d8a39ff557cb0d23087fd44cad61df08fc31907a2f" +dependencies = [ + "zerocopy-derive", +] + +[[package]] +name = "zerocopy-derive" +version = "0.8.26" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9ecf5b4cc5364572d7f4c329661bcc82724222973f2cab6f050a4e5c22f75181" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.106", +] + +[[package]] +name = "zeroize" +version = "1.8.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ced3678a2879b30306d323f4542626697a464a97c0a07c9aebf7ebca65cd4dde" +dependencies = [ + "zeroize_derive", +] + +[[package]] +name = "zeroize_derive" +version = "1.4.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ce36e65b0d2999d2aafac989fb249189a141aee1f53c612c1f37d72631959f69" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.106", +] diff --git a/submissions/week-6/day-3/Wilfred_sep41/soroban-sep41/Cargo.toml b/submissions/week-6/day-3/Wilfred_sep41/soroban-sep41/Cargo.toml new file mode 100644 index 000000000..527e38f7e --- /dev/null +++ b/submissions/week-6/day-3/Wilfred_sep41/soroban-sep41/Cargo.toml @@ -0,0 +1,55 @@ +[workspace] +resolver = "2" +members = [ + "contracts/sep41-token", +] + +[workspace.dependencies] +soroban-sdk = "22.0.0" + +[profile.release] +opt-level = "z" +overflow-checks = true +debug = 0 +strip = "symbols" +debug-assertions = false +panic = "abort" +codegen-units = 1 +lto = true + +# For more information about this profile see https://soroban.stellar.org/docs/basic-tutorials/logging#cargotoml-profile +[profile.release-with-logs] +inherits = "release" +debug-assertions = true + +# # Add this to your workspace root Cargo.toml +# [patch.crates-io] +# sha2 = "=0.10.8" + + +# [workspace] +# resolver = "2" +# members = [ +# "contracts/*", +# ] + +# [workspace.dependencies] +# soroban-sdk = "22.0.0" + +# [profile.release] +# opt-level = "z" +# overflow-checks = true +# debug = 0 +# strip = "symbols" +# debug-assertions = false +# panic = "abort" +# codegen-units = 1 +# lto = true + +# [profile.release-with-logs] +# inherits = "release" +# debug-assertions = true + +# # Correct replace syntax - no version requirement symbols +# [replace] +# "sha2:0.10.9" = { version = "0.10.6", default-features = false, features = ["std"] } \ No newline at end of file diff --git a/submissions/week-6/day-3/Wilfred_sep41/soroban-sep41/README.md b/submissions/week-6/day-3/Wilfred_sep41/soroban-sep41/README.md new file mode 100644 index 000000000..012e23c44 --- /dev/null +++ b/submissions/week-6/day-3/Wilfred_sep41/soroban-sep41/README.md @@ -0,0 +1,21 @@ +# Soroban Project + +## Project Structure + +This repository uses the recommended structure for a Soroban project: +```text +. +├── contracts +│   └── hello_world +│   ├── src +│   │   ├── lib.rs +│   │   └── test.rs +│   └── Cargo.toml +├── Cargo.toml +└── README.md +``` + +- New Soroban contracts can be put in `contracts`, each in their own directory. There is already a `hello_world` contract in there to get you started. +- If you initialized this project with any other example contracts via `--with-example`, those contracts will be in the `contracts` directory as well. +- Contracts should have their own `Cargo.toml` files that rely on the top-level `Cargo.toml` workspace for their dependencies. +- Frontend libraries can be added to the top-level directory as well. If you initialized this project with a frontend template via `--frontend-template` you will have those files already included. \ No newline at end of file diff --git a/submissions/week-6/day-3/Wilfred_sep41/soroban-sep41/contracts/sep41-token/Cargo.toml b/submissions/week-6/day-3/Wilfred_sep41/soroban-sep41/contracts/sep41-token/Cargo.toml new file mode 100644 index 000000000..7523215b8 --- /dev/null +++ b/submissions/week-6/day-3/Wilfred_sep41/soroban-sep41/contracts/sep41-token/Cargo.toml @@ -0,0 +1,16 @@ +[package] +name = "sep42-token" +version = "1.0.0" +edition = "2021" + +[lib] +crate-type = ["cdylib"] + +[dependencies] +soroban-sdk = { workspace = true } + +[dev-dependencies] +soroban-sdk = { workspace = true, features = ["testutils"] } + +[features] +testutils = ["soroban-sdk/testutils"] diff --git a/submissions/week-6/day-3/Wilfred_sep41/soroban-sep41/contracts/sep41-token/Makefile b/submissions/week-6/day-3/Wilfred_sep41/soroban-sep41/contracts/sep41-token/Makefile new file mode 100644 index 000000000..b9719346b --- /dev/null +++ b/submissions/week-6/day-3/Wilfred_sep41/soroban-sep41/contracts/sep41-token/Makefile @@ -0,0 +1,16 @@ +default: build + +all: test + +test: build + cargo test + +build: + stellar contract build + @ls -l target/wasm32v1-none/release/*.wasm + +fmt: + cargo fmt --all + +clean: + cargo clean diff --git a/submissions/week-6/day-3/Wilfred_sep41/soroban-sep41/contracts/sep41-token/src/admin.rs b/submissions/week-6/day-3/Wilfred_sep41/soroban-sep41/contracts/sep41-token/src/admin.rs new file mode 100644 index 000000000..de50b1bc5 --- /dev/null +++ b/submissions/week-6/day-3/Wilfred_sep41/soroban-sep41/contracts/sep41-token/src/admin.rs @@ -0,0 +1,34 @@ +use soroban_sdk::{Address, Env}; +use crate::error::TokenError; +use crate::storage::storage_utils; + +/// Administrative functions for the token contract +pub mod admin { + use super::*; + + /// Check if the caller is the admin + pub fn require_admin(env: &Env, caller: &Address) -> Result<(), TokenError> { + let admin = storage_utils::get_admin(env)?; + if admin != *caller { + return Err(TokenError::Unauthorized); + } + Ok(()) + } + + /// Set a new admin (only callable by current admin) + pub fn set_admin(env: &Env, caller: &Address, new_admin: &Address) -> Result<(), TokenError> { + require_admin(env, caller)?; + storage_utils::set_admin(env, new_admin); + Ok(()) + } + + /// Get the current admin address + pub fn get_admin(env: &Env) -> Result { + storage_utils::get_admin(env) + } + + /// Initialize admin during contract initialization + pub fn initialize_admin(env: &Env, admin: &Address) { + storage_utils::set_admin(env, admin); + } +} \ No newline at end of file diff --git a/submissions/week-6/day-3/Wilfred_sep41/soroban-sep41/contracts/sep41-token/src/contract.rs b/submissions/week-6/day-3/Wilfred_sep41/soroban-sep41/contracts/sep41-token/src/contract.rs new file mode 100644 index 000000000..2e259ca4c --- /dev/null +++ b/submissions/week-6/day-3/Wilfred_sep41/soroban-sep41/contracts/sep41-token/src/contract.rs @@ -0,0 +1,174 @@ +use soroban_sdk::{contract, contractimpl, Address, Env, String}; +use crate::interface::{TokenInterface, TokenAdminInterface}; +use crate::storage_utils::{storage_utils, AllowanceValue} +use crate::events::events; +use crate:metadata::metadata; +use crate::admin::admin; +use crate::error::TokenError; + + +#[contract] + +pub struct Token; + +#[contracimpl] + +impl TokenInterface for Token { + fn allowance(env: &ENV, from: Address, spender: Address) -> i128 { + let allowance = storage_utils::get_allowance(env, from, spender); + allowance.effective_amount(&env) + } + + + fn approve(env: &ENV, from: Address, spender:Address, amount: i128, expiration_ledger:u32) { + //req auth from owner + from.require_auth(); + + //check if amount is valid + if amount < o { + panic!(TokenError::InvalidAmount); + } + + //check if expiration is valid + if expiration_ledger < env.ledger.sequence(); + if amount > 0 && expiration_ledger < env.ledger.sequence(){ + panic!(TokenError::InvalidExpiration) + } + + + //set allowance + storage_utils::set_allowance(&env, &from, amount, &spender, expiration_ledger); + + //emit event + events::emit_approval(&env, &from, &spender, amount, expiration_ledger) + } + + + fn balance(env: Env, id: Address) -> i128 { + storage_utils::get_balance(&env, id) + } + + + fn transfer(env: Env, from: Address, to: Address, amount: i128){ + //req authentication from sender + from.require_auth(); + + + //Make the transfer + Self::internal_transfer(&env, &from, &to, amount) + } + + fn burn(env: Env, from: Address, amount: i128){ + //require auth from the from address + from.require_auth(); + + //check and consume allowance + Self::consume_allowance(&env, &from, amount); + + //perform burn + Self::internal_burn(&env, &from, amount); + } + + fn decimals(env: Env) -> u32 { + metadata::get_decimals(&env).unwrap_or_else(|_| { + panic!(TokenError::NotInitialized) + }) + } + + fn name(env: Env) -> String { + metadata::get_name(&env).unwrap_or_else(|_|) { + panic!(TokenError::NotInitialized) + } + } + + fn symbol(env: Env) -> String { + metadata::get_symbol(&env).unwrap_or_else(|_| { + panic!(TokenError::NotInitialized) + }) + } +} + +impl Token { + /// Internal transfer function + fn internal_transfer(env: &Env, from: &Address, to: &Address, amount: i128) { + // Validate amount + if amount < 0 { + panic!("Invalid amount"); + } + + if amount == 0 { + return; + } + + // Get current balances + let from_balance = storage_utils::get_balance(env, from); + if from_balance < amount { + panic!("Insufficient balance"); + } + + let to_balance = storage_utils::get_balance(env, to); + + // Calculate new balances + let new_from_balance = from_balance - amount; + let new_to_balance = to_balance.checked_add(amount).unwrap_or_else(|| { + panic!("Overflow"); + }); + + // Update balances + storage_utils::set_balance(env, from, new_from_balance); + storage_utils::set_balance(env, to, new_to_balance); + + // Emit transfer event + events::emit_transfer(env, from.clone(), to.clone(), amount); + } + + /// Internal burn function + fn internal_burn(env: &Env, from: &Address, amount: i128) { + // Validate amount + if amount < 0 { + panic!("Invalid amount"); + } + + if amount == 0 { + return; + } + + // Check balance + let current_balance = storage_utils::get_balance(env, from); + if current_balance < amount { + panic!("Insufficient balance"); + } + + // Update balance + let new_balance = current_balance - amount; + storage_utils::set_balance(env, from, new_balance); + + // Update total supply + let current_supply = storage_utils::get_total_supply(env); + let new_supply = current_supply.checked_sub(amount).unwrap_or_else(|| { + panic!("Underflow"); + }); + storage_utils::set_total_supply(env, new_supply); + + // Emit burn event + events::emit_burn(env, from.clone(), amount); + } + + /// Consume allowance for transfer_from and burn_from operations + fn consume_allowance(env: &Env, from: &Address, spender: &Address, amount: i128) { + let allowance = storage_utils::get_allowance(env, from, spender); + let effective_allowance = allowance.effective_amount(env); + + if effective_allowance < amount { + if allowance.is_expired(env) { + panic!("Allowance expired"); + } else { + panic!("Insufficient allowance"); + } + } + + // Update allowance + let new_allowance = effective_allowance - amount; + storage_utils::set_allowance(env, from, spender, new_allowance, allowance.expiration_ledger); + } +} diff --git a/submissions/week-6/day-3/Wilfred_sep41/soroban-sep41/contracts/sep41-token/src/error.rs b/submissions/week-6/day-3/Wilfred_sep41/soroban-sep41/contracts/sep41-token/src/error.rs new file mode 100644 index 000000000..24923a46f --- /dev/null +++ b/submissions/week-6/day-3/Wilfred_sep41/soroban-sep41/contracts/sep41-token/src/error.rs @@ -0,0 +1,24 @@ +use soroban_sdk::contracterror; + + +//contract error types for the sep14 contract + +#[contracterror] + +#[derive(Debug, PartialEq, Copy, Clone, PartialOrd, Eq, Ord)] +#[reprl(u32)] + + +pub enum TokenError { + InsufficientBalance = 1, + InsufficientAllowance = 2, + Unauthorized = 3, + InvalidAmount = 4, + NotInitialized = 5, + AlreadyInitialized = 6, + InvalidAddress = 7, + AllowanceExpired = 8, + InvalidExpiration = 9, + Overflow = 10, + Underflow = 11, +} \ No newline at end of file diff --git a/submissions/week-6/day-3/Wilfred_sep41/soroban-sep41/contracts/sep41-token/src/event.rs b/submissions/week-6/day-3/Wilfred_sep41/soroban-sep41/contracts/sep41-token/src/event.rs new file mode 100644 index 000000000..a64e7003d --- /dev/null +++ b/submissions/week-6/day-3/Wilfred_sep41/soroban-sep41/contracts/sep41-token/src/event.rs @@ -0,0 +1,86 @@ +use soroban_sdk::{contracttype, symbol_short, Address, Env, Symbol}; + +/// Event topics as symbols +pub const TRANSFER: Symbol = symbol_short!("transfer"); +pub const APPROVE: Symbol = symbol_short!("approve"); +pub const BURN: Symbol = symbol_short!("burn"); +pub const MINT: Symbol = symbol_short!("mint"); + +/// Transfer event data +#[contracttype] +#[derive(Clone, Debug, Eq, PartialEq)] +pub struct TransferEvent { + pub from: Address, + pub to: Address, + pub amount: i128, +} + +/// Approval event data +#[contracttype] +#[derive(Clone, Debug, Eq, PartialEq)] +pub struct ApprovalEvent { + pub owner: Address, + pub spender: Address, + pub amount: i128, + pub expiration_ledger: u32, +} + +/// Burn event data +#[contracttype] +#[derive(Clone, Debug, Eq, PartialEq)] +pub struct BurnEvent { + pub from: Address, + pub amount: i128, +} + +/// Mint event data +#[contracttype] +#[derive(Clone, Debug, Eq, PartialEq)] +pub struct MintEvent { + pub to: Address, + pub amount: i128, +} + +/// Event emission functions +pub mod events { + use super::*; + + /// Emit a transfer event + pub fn emit_transfer(env: &Env, from: Address, to: Address, amount: i128) { + let event = TransferEvent { from, to, amount }; + env.events() + .publish((TRANSFER,), event); + } + + /// Emit an approval event + pub fn emit_approval( + env: &Env, + owner: Address, + spender: Address, + amount: i128, + expiration_ledger: u32, + ) { + let event = ApprovalEvent { + owner, + spender, + amount, + expiration_ledger, + }; + env.events() + .publish((APPROVE,), event); + } + + /// Emit a burn event + pub fn emit_burn(env: &Env, from: Address, amount: i128) { + let event = BurnEvent { from, amount }; + env.events() + .publish((BURN,), event); + } + + /// Emit a mint event + pub fn emit_mint(env: &Env, to: Address, amount: i128) { + let event = MintEvent { to, amount }; + env.events() + .publish((MINT,), event); + } +} \ No newline at end of file diff --git a/submissions/week-6/day-3/Wilfred_sep41/soroban-sep41/contracts/sep41-token/src/interface.rs b/submissions/week-6/day-3/Wilfred_sep41/soroban-sep41/contracts/sep41-token/src/interface.rs new file mode 100644 index 000000000..88dabf207 --- /dev/null +++ b/submissions/week-6/day-3/Wilfred_sep41/soroban-sep41/contracts/sep41-token/src/interface.rs @@ -0,0 +1,141 @@ +use soroban_sdk::{contracttrait, Address, Env, String}; + +/// SEP-41 Token Interface +/// +/// This trait defines the standard interface for tokens on Stellar Soroban +/// as specified in SEP-41. All compliant tokens should implement this interface +/// to ensure interoperability with other contracts and applications. +#[contracttrait] +pub trait TokenInterface { + /// Returns the allowance for `spender` to transfer from `from`. + /// + /// # Arguments + /// + /// * `from` - The address holding the balance of tokens to be drawn from. + /// * `spender` - The address spending the tokens held by `from`. + fn allowance(env: Env, from: Address, spender: Address) -> i128; + + /// Set the allowance by `amount` for `spender` to transfer/burn from `from`. + /// + /// # Arguments + /// + /// * `from` - The address holding the balance of tokens to be drawn from. + /// * `spender` - The address being authorized to spend the tokens held by `from`. + /// * `amount` - The tokens to be made available to `spender`. + /// * `expiration_ledger` - The ledger number where this allowance expires. + /// + /// # Events + /// + /// Emits an event with topics `["approve", from: Address, spender: Address]`, + /// data = `[amount: i128, expiration_ledger: u32]` + fn approve(env: Env, from: Address, spender: Address, amount: i128, expiration_ledger: u32); + + /// Returns the balance of `id`. + /// + /// # Arguments + /// + /// * `id` - The address for which a balance is being queried. + fn balance(env: Env, id: Address) -> i128; + + /// Transfer `amount` from `from` to `to`. + /// + /// # Arguments + /// + /// * `from` - The address holding the balance of tokens which will be withdrawn from. + /// * `to` - The address which will receive the transferred tokens. + /// * `amount` - The amount of tokens to be transferred. + /// + /// # Events + /// + /// Emits an event with topics `["transfer", from: Address, to: Address]`, + /// data = `amount: i128` + fn transfer(env: Env, from: Address, to: Address, amount: i128); + + /// Transfer `amount` from `from` to `to`, consuming the allowance of `spender`. + /// + /// # Arguments + /// + /// * `spender` - The address authorizing the transfer. + /// * `from` - The address holding the balance of tokens which will be withdrawn from. + /// * `to` - The address which will receive the transferred tokens. + /// * `amount` - The amount of tokens to be transferred. + /// + /// # Events + /// + /// Emits an event with topics `["transfer", from: Address, to: Address]`, + /// data = `amount: i128` + fn transfer_from(env: Env, spender: Address, from: Address, to: Address, amount: i128); + + /// Burn `amount` from `from`. + /// + /// # Arguments + /// + /// * `from` - The address holding the balance of tokens which will be burned from. + /// * `amount` - The amount of tokens to be burned. + /// + /// # Events + /// + /// Emits an event with topics `["burn", from: Address]`, data = `amount: i128` + fn burn(env: Env, from: Address, amount: i128); + + /// Burn `amount` from `from`, consuming the allowance of `spender`. + /// + /// # Arguments + /// + /// * `spender` - The address authorizing the burn. + /// * `from` - The address holding the balance of tokens which will be burned from. + /// * `amount` - The amount of tokens to be burned. + /// + /// # Events + /// + /// Emits an event with topics `["burn", from: Address]`, data = `amount: i128` + fn burn_from(env: Env, spender: Address, from: Address, amount: i128); + + /// Returns the number of decimals used to represent amounts of this token. + fn decimals(env: Env) -> u32; + + /// Returns the name for this token. + fn name(env: Env) -> String; + + /// Returns the symbol for this token. + fn symbol(env: Env) -> String; +} + +/// Administrative interface for token management +/// +/// This trait defines additional functions for token administration +/// that are not part of the core SEP-41 interface but are commonly needed. +#[contracttrait] +pub trait TokenAdminInterface { + /// Initialize the token contract with metadata and admin. + /// + /// # Arguments + /// + /// * `admin` - The address that will have administrative privileges. + /// * `name` - The name of the token. + /// * `symbol` - The symbol of the token. + /// * `decimals` - The number of decimal places for the token. + fn initialize(env: Env, admin: Address, name: String, symbol: String, decimals: u32); + + /// Mint new tokens to a specified address. + /// + /// # Arguments + /// + /// * `to` - The address to mint tokens to. + /// * `amount` - The amount of tokens to mint. + /// + /// # Events + /// + /// Emits an event with topics `["mint", to: Address]`, data = `amount: i128` + fn mint(env: Env, to: Address, amount: i128); + + /// Set a new admin for the contract. + /// + /// # Arguments + /// + /// * `new_admin` - The address of the new admin. + fn set_admin(env: Env, new_admin: Address); + + /// Get the current admin address. + fn admin(env: Env) -> Address; +} \ No newline at end of file diff --git a/submissions/week-6/day-3/Wilfred_sep41/soroban-sep41/contracts/sep41-token/src/lib.rs b/submissions/week-6/day-3/Wilfred_sep41/soroban-sep41/contracts/sep41-token/src/lib.rs new file mode 100644 index 000000000..7e6eeaff0 --- /dev/null +++ b/submissions/week-6/day-3/Wilfred_sep41/soroban-sep41/contracts/sep41-token/src/lib.rs @@ -0,0 +1,157 @@ + +#![no_std] + +mod contract; +mod interface; +mod storage; +mod events; +mod metadata; +mod admin; +mod error; + +// Re-export the main contract and interfaces +pub use contract::Token; +pub use interface::{TokenInterface, TokenAdminInterface}; +pub use error::TokenError; + +// Re-export commonly used types +pub use storage::{DataKey, AllowanceDataKey, AllowanceValue, TokenMetadata}; +pub use events::{TransferEvent, ApprovalEvent, BurnEvent, MintEvent}; + +#[cfg(test)] +mod tests { + use super::*; + use soroban_sdk::{testutils::Address as _, Address, Env, String}; + + #[test] + fn test_initialization() { + let env = Env::default(); + let admin = Address::generate(&env); + let name = String::from_str(&env, "Test Token"); + let symbol = String::from_str(&env, "TEST"); + let decimals = 18; + + Token::initialize(env.clone(), admin.clone(), name.clone(), symbol.clone(), decimals); + + assert_eq!(Token::name(env.clone()), name); + assert_eq!(Token::symbol(env.clone()), symbol); + assert_eq!(Token::decimals(env.clone()), decimals); + assert_eq!(Token::admin(env), admin); + } + + #[test] + fn test_mint_and_balance() { + let env = Env::default(); + let admin = Address::generate(&env); + let user = Address::generate(&env); + let amount = 1000i128; + + // Initialize token + Token::initialize( + env.clone(), + admin.clone(), + String::from_str(&env, "Test Token"), + String::from_str(&env, "TEST"), + 18, + ); + + // Mint tokens + Token::mint(env.clone(), user.clone(), amount); + + // Check balance + assert_eq!(Token::balance(env, user), amount); + } + + #[test] + fn test_transfer() { + let env = Env::default(); + env.mock_all_auths(); + + let admin = Address::generate(&env); + let user1 = Address::generate(&env); + let user2 = Address::generate(&env); + let amount = 1000i128; + let transfer_amount = 300i128; + + // Initialize and mint + Token::initialize( + env.clone(), + admin.clone(), + String::from_str(&env, "Test Token"), + String::from_str(&env, "TEST"), + 18, + ); + Token::mint(env.clone(), user1.clone(), amount); + + // Transfer + Token::transfer(env.clone(), user1.clone(), user2.clone(), transfer_amount); + + // Check balances + assert_eq!(Token::balance(env.clone(), user1), amount - transfer_amount); + assert_eq!(Token::balance(env, user2), transfer_amount); + } + + #[test] + fn test_approve_and_transfer_from() { + let env = Env::default(); + env.mock_all_auths(); + + let admin = Address::generate(&env); + let owner = Address::generate(&env); + let spender = Address::generate(&env); + let recipient = Address::generate(&env); + let amount = 1000i128; + let allowance_amount = 500i128; + let transfer_amount = 300i128; + let expiration = env.ledger().sequence() + 100; + + // Initialize and mint + Token::initialize( + env.clone(), + admin.clone(), + String::from_str(&env, "Test Token"), + String::from_str(&env, "TEST"), + 18, + ); + Token::mint(env.clone(), owner.clone(), amount); + + // Approve + Token::approve(env.clone(), owner.clone(), spender.clone(), allowance_amount, expiration); + assert_eq!(Token::allowance(env.clone(), owner.clone(), spender.clone()), allowance_amount); + + // Transfer from + Token::transfer_from(env.clone(), spender.clone(), owner.clone(), recipient.clone(), transfer_amount); + + // Check balances and remaining allowance + assert_eq!(Token::balance(env.clone(), owner), amount - transfer_amount); + assert_eq!(Token::balance(env.clone(), recipient), transfer_amount); + assert_eq!(Token::allowance(env, owner, spender), allowance_amount - transfer_amount); + } + + #[test] + fn test_burn() { + let env = Env::default(); + env.mock_all_auths(); + + let admin = Address::generate(&env); + let user = Address::generate(&env); + let amount = 1000i128; + let burn_amount = 300i128; + + // Initialize and mint + Token::initialize( + env.clone(), + admin.clone(), + String::from_str(&env, "Test Token"), + String::from_str(&env, "TEST"), + 18, + ); + Token::mint(env.clone(), user.clone(), amount); + + // Burn + Token::burn(env.clone(), user.clone(), burn_amount); + + // Check balance + assert_eq!(Token::balance(env, user), amount - burn_amount); + } +} diff --git a/submissions/week-6/day-3/Wilfred_sep41/soroban-sep41/contracts/sep41-token/src/metadata.rs b/submissions/week-6/day-3/Wilfred_sep41/soroban-sep41/contracts/sep41-token/src/metadata.rs new file mode 100644 index 000000000..4f517f8cf --- /dev/null +++ b/submissions/week-6/day-3/Wilfred_sep41/soroban-sep41/contracts/sep41-token/src/metadata.rs @@ -0,0 +1,66 @@ +use soroban_sdk::{Env, String}; +use crate::storage::{ Datakey, TokenMetadata}; +use crate::error::TokenError; + + + +pub mod metadata { + use super::*; + + + //set token metadata + pub fn set_metadata(env: &ENV, name: String, symbol: String, decimals:u8){ + env.storage().instance.set(:Datakey::Name, name); + env.storage().instance().set(&Datakey::Symbol, symbol); + env.storage().instance().set(&Datakey::Decimal, decimals) + } + + + //Get token name + pub fn get_name(env: &ENV) -> Result{ + env.storage() + .instance() + .get(&Datakey::Name) + .ok_or(TokenError::NotInitialized) + } + + + //Get token symbol + pub fn get_symbol(env: &ENV) -> Result{ + env.storage() + .instance() + .get(&Datakey::Symbol) + .ok_or(TokenError::NotInitialized) + } + + + //get token decimals + pub fn get_decimals(env:&ENV) -> Result { + env.storage() + .instance() + .get(&Datakey::Decimals) + .ok_or(TokenError::NotInitialized) + } + + + pub fn check_metadata(name: &String, symbol:&String, decimals: u8) -> Result<(), TokenError> { + + //check if name is empty + if name.len() == 0 { + return Err(TokenError::InvalidAmount); + } + + + //check if symbol is empty + if symbol.len() == 0 { + return Err(TokenError::InvalidAmount); + } + + //check if decimal is greater than 18 + if decimals > 18 { + return Err(TokenError::InvalidAmount); + } + + Ok(()) + } +} \ No newline at end of file diff --git a/submissions/week-6/day-3/Wilfred_sep41/soroban-sep41/contracts/sep41-token/src/storage.rs b/submissions/week-6/day-3/Wilfred_sep41/soroban-sep41/contracts/sep41-token/src/storage.rs new file mode 100644 index 000000000..92eefe2c5 --- /dev/null +++ b/submissions/week-6/day-3/Wilfred_sep41/soroban-sep41/contracts/sep41-token/src/storage.rs @@ -0,0 +1,174 @@ +use soroban_sdk::{contracttype, Address, Env, String}; + + +//storage keys for the token contract + +#[derive(Clone)] +#[contracttype] + +pub enum Datakey { + //token balance for a given contract + Balance(Address), + + //token allowance + Allowance(AllowanceDataKey), + //token metadata + name, + symbol, + decimals, + //admin information + Admin, + ///token total supply + TotalSupply, + //contract init status + Initialized, +} + + +#[derive(Clone)] +#[contracttype] +pub struct AllowanceDataKey { + pub from: Address, + pub spender: Address, +} + + +//Allowance value with expiration +#[derive(Clone)] +#[contracttype] +pub struct AllowanceValue { + pub amount: i128, + pub expiration_ledger: u32, +} + + +// Token metadata structure +#[derive(Clone)] +#[contracttype] +pub struct TokenMetadata { + pub name: String, + pub symbol: String, + pub decimals: u32 +} + + +impl AllowanceDataKey { + pub fn new(from: Address, spender: Address) -> Self { + Self { from, spender} + } +} + +impl AllowanceValue { + pub fn new(amount: i128, expiration: u32) -> Self { + Self { amount, expiration_ledger } + } +} + +//check if allowance has expired +// This function checks if the stored expiration ledger is less than the current ledger sequence +// If it is, the allowance is considered expired and returns true, otherwise false. +pub fn is_expired(&self, env:&ENV) -> bool { + self.expiration_ledger < env.ledger.sequence() +} + + + +//get the effective amount of allowance +// This function checks if the allowance has expired using the is_expired method. +// If it has expired, it returns 0, otherwise it returns the stored amount. +pub fn effective_amount(&self, env: &ENV) -> i128 { + if self.is_expired(env) { + 0 + } else { + self.amount + } +} + + + + +// Helper functions for storage utils +pub mod storage_utils { + use super::*; + use soroban_sdk::{ ENV, Address}; + use crate ::error::TokenError; + + pub fn get_balance(env: &ENV, addr: Address) -> i128 { + env.storage() + .instance() + .get(&Datakey::Balance(addr.clone())) + .unwrap_or(0) + } + + + // set balance for a given token + + pub fn set_balance(env: &ENV, addr: Address, amount: i128) { + env.storage() + .instance() + .set(&Datakey::Balance(addr.clone()), amount); + } + + + //Get allowance between two addresses + pub fn get_allowance(env: ENV, from: Address, spender: Address) -> AllowanceValue { + let key = AllowanceDataKey::new(from.clone(), spender.clone()); + env.storage() + .instance() + .get(&Datakey::Allowance(key)) + .unwrap_or(AllowanceValue::new(0,0)) + } + + + // set allowance between two addresses + pub fn set_allowance(env: &ENV, from:Address, spender: Address, amount: i128, expiration_ledger: u32) { + let key: AllowanceDataKey::new(from.clone(), spender.clone()); + let value = AllowanceValue::new(amount, expiration_ledger); + + if amount = 0 { + env.storage().instance().remove(&Datakey::Allowance(key)); + } else { + env.storage() + .instance() + .set(&Datakey::Allowance(key, value)); + } + } + + + //key total supply + pub fn get_total_supply(env: &ENV) -> i128 { + env.storage() + .instance() + .get(&Datakey::TotalSupply) + .unwrap_or(0) + } + + + //check if contract is initialized + pub fn is_initialized(env: &ENV) -> bool { + emv.storage() + .instance() + .set(&Datakey::Initialized, true); + } + + + //Get admin address + pub fn get_admin(env: &ENV) -> Result { + env.storage() + .instance() + .get(&Datakey::Admin) + .ok_or(TokenError::NotInitialized) + } + + + //Set admin address + pub fn set_admin(env:&ENV, admin: Address) { + env.storage() + .instance() + .set(&Datakey::Admin, admin); + } + + + + +} \ No newline at end of file diff --git a/submissions/week-6/day-3/Wilfred_sep41/soroban-sep41/contracts/sep41-token/src/test.rs b/submissions/week-6/day-3/Wilfred_sep41/soroban-sep41/contracts/sep41-token/src/test.rs new file mode 100644 index 000000000..0bdcba082 --- /dev/null +++ b/submissions/week-6/day-3/Wilfred_sep41/soroban-sep41/contracts/sep41-token/src/test.rs @@ -0,0 +1,21 @@ +#![cfg(test)] + +use super::*; +use soroban_sdk::{vec, Env, String}; + +#[test] +fn test() { + let env = Env::default(); + let contract_id = env.register(Contract, ()); + let client = ContractClient::new(&env, &contract_id); + + let words = client.hello(&String::from_str(&env, "Dev")); + assert_eq!( + words, + vec![ + &env, + String::from_str(&env, "Hello"), + String::from_str(&env, "Dev"), + ] + ); +}