From f814c26f8c06d580e17fdd7a99fc74050fd6fef9 Mon Sep 17 00:00:00 2001 From: mcisb <83702309+KyryloKilin@users.noreply.github.com> Date: Fri, 10 Nov 2023 16:17:33 +0200 Subject: [PATCH 1/3] Update README.md Signed-off-by: mcisb <83702309+KyryloKilin@users.noreply.github.com> --- basic_bank/README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/basic_bank/README.md b/basic_bank/README.md index a4fe922..bb55a6e 100644 --- a/basic_bank/README.md +++ b/basic_bank/README.md @@ -19,7 +19,7 @@ Note that the program can be easily extended to include addition features such a You may have already guessed that this program has a few bugs. We list some of them below: - `withdraw` can only be invoked by the bank. A malicious bank could lock users' tokens by not invoking `withdraw`. - `withdraw` fails if the sum of the interest and principal is greater than the user's balance. -- User's can increase their principal by depositing tokens multiple times, including immediately before withdrawl. +- User's can increase their principal by depositing tokens multiple times, including immediately before withdrawal. - Integer division rounds down; if the calculated interest is too small, then it will be rounded down to zero. Can you find any others? @@ -116,4 +116,4 @@ PRIVATE_KEY=APrivateKey1zkpHtqVWT6fSHgUMNxsuVf7eaR6id2cj7TieKY1Z8CP5rCD leo run withdraw aleo1zeklp6dd8e764spe74xez6f8w27dlua3w7hl4z2uln03re52egpsv46ngg 50u64 1234u64 15u64 ``` -You'll see here the withdrawal function creates a new private record for the user containing all 266 withdrawn tokens, and then calls the finalize `withdraw` function with arguments (address, amount), which will update the public balance of the bank back to 0. The public mapping will be queryable on-chain. \ No newline at end of file +You'll see here the withdrawal function creates a new private record for the user containing all 266 withdrawn tokens, and then calls the finalize `withdraw` function with arguments (address, amount), which will update the public balance of the bank back to 0. The public mapping will be queryable on-chain. From 08c96aad15a74ab48adb6e134254e81727f1a8c3 Mon Sep 17 00:00:00 2001 From: mcisb <83702309+KyryloKilin@users.noreply.github.com> Date: Fri, 10 Nov 2023 16:18:47 +0200 Subject: [PATCH 2/3] Update README.md Signed-off-by: mcisb <83702309+KyryloKilin@users.noreply.github.com> --- token/README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/token/README.md b/token/README.md index 4187f95..f1509b7 100644 --- a/token/README.md +++ b/token/README.md @@ -83,7 +83,7 @@ PRIVATE_KEY=APrivateKey1zkp1w8PTxrRgGfAtfKUSq43iQyVbdQHfhGbiNPEg2LVSEXR leo run transfer_public aleo17vy26rpdhqx4598y5gp7nvaa9rk7tnvl6ufhvvf4calsrrqdaqyshdsf5z 10u64 ``` -Again, we see the arguments used for the finzalize function of `transfer_public` - Alice's address, Bob's address, and the amount to transfer. The public mapping will be queryable on-chain. +Again, we see the arguments used for the finalize function of `transfer_public` - Alice's address, Bob's address, and the amount to transfer. The public mapping will be queryable on-chain. ## Private Transfer From d272c15687d293dd41a40fc7558c7b780f663194 Mon Sep 17 00:00:00 2001 From: mcisb <83702309+KyryloKilin@users.noreply.github.com> Date: Fri, 10 Nov 2023 16:19:54 +0200 Subject: [PATCH 3/3] Update README.md Signed-off-by: mcisb <83702309+KyryloKilin@users.noreply.github.com> --- battleship/README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/battleship/README.md b/battleship/README.md index ed0edc5..7b86dd7 100644 --- a/battleship/README.md +++ b/battleship/README.md @@ -793,7 +793,7 @@ We can make the observation that the original bitstring is always shifted by a p To ensure that the remaining number is a power of 2, we can use a bit trick. See the bit trick for ensuring a bitstring is a power of 2 section. -In the code, you'll notice one extra step. Dividing a ship placement bitstring by a ship bitstring representation could result in 0, and then subtracting by 1 will result in an underflow. In that case, we know the ship placement is not valid, so we can set a number which is gauranteed to not be a power of 2. +In the code, you'll notice one extra step. Dividing a ship placement bitstring by a ship bitstring representation could result in 0, and then subtracting by 1 will result in an underflow. In that case, we know the ship placement is not valid, so we can set a number which is guaranteed to not be a power of 2. ### Splitting a row or column