Skip to content
This repository was archived by the owner on Jun 20, 2024. It is now read-only.

Commit 4633176

Browse files
committed
📝 format
1 parent 9b9b26b commit 4633176

File tree

2 files changed

+6
-6
lines changed

2 files changed

+6
-6
lines changed

src/ch02-14-security-considerations.md

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -124,6 +124,7 @@ fn on_receive_sword(ref self: ContractState) {
124124
}
125125
}
126126
```
127+
127128
Reentrancy protections are critical in many ERC standards with `safeTransfer` functions (like ERC721, ERC777, ERC1155, ERC223) and in flash loans, where borrower contracts need to safely use and return funds.
128129

129130
### Recommendation:
@@ -285,8 +286,8 @@ When these functions encounter overflows or underflows, the transaction will rev
285286

286287
Failure reasons for `u256`:
287288

288-
* Overflow: `0x753235365f616464204f766572666c6f77=u256_add Overflow`
289-
* Underflow: `0x753235365f737562204f766572666c6f77=u256_sub Overflow`
289+
- Overflow: `0x753235365f616464204f766572666c6f77=u256_add Overflow`
290+
- Underflow: `0x753235365f737562204f766572666c6f77=u256_sub Overflow`
290291

291292
Similarly, the `u128` data type can be used to handle overflow and underflow:
292293

@@ -308,8 +309,9 @@ Overflow or underflow in u128 will similarly revert the transaction, with corres
308309
<img alt="u128" src="img/ch02-sec_under_u128.png" class="center" style="width: 75%;" />
309310

310311
Failure reasons for u128:
311-
- Overflow: `0x753132385f616464204f766572666c6f77=u128_add Overflow`
312-
- Underflow: `0x753132385f737562204f766572666c6f77=u128_sub Overflow`
312+
313+
- Overflow: `0x753132385f616464204f766572666c6f77=u128_add Overflow`
314+
- Underflow: `0x753132385f737562204f766572666c6f77=u128_sub Overflow`
313315

314316
Using these data types, you can ensure safer arithmetic operations in your smart contracts, avoiding unintended consequences of overflows and underflows.
315317

src/ch02-15-security-tools.md

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,5 @@ This section covers:
1010
Below is an overview of the tools for Starknet security testing discussed in this chapter:
1111

1212
1. **Cairo-fuzzer**: A tool for smart contract developers to test security. It functions both as a standalone tool and as a library.
13-
1413
2. **Caracal**: A static analysis tool for Starknet smart contracts, utilizing the SIERRA representation.
15-
1614
3. **Thoth**: A comprehensive Cairo/Starknet security toolkit. It includes analyzers, disassemblers, and decompilers.

0 commit comments

Comments
 (0)