Skip to content

Commit c9be5cc

Browse files
committed
Add study notes for 2025-08-14
1 parent 43a1043 commit c9be5cc

1 file changed

Lines changed: 33 additions & 0 deletions

File tree

segment7.md

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,39 @@ segment7,成都,前北师大学生,现cs在读,目前使用lens protocol
1515
## Notes
1616

1717
<!-- Content_START -->
18+
# 2025-08-14
19+
20+
#### Solidity 基础规范示例.md
21+
- fewer storage slots = lower gas
22+
23+
24+
| **Type** | **Field** | **Why it’s chosen** |
25+
| --- | --- | --- |
26+
| `bytes32` | `name` | Fixed-size, cheaper than `string` |
27+
| `uint32` | `count` | Enough for 4.2 billion counts, saves gas |
28+
29+
| **`uint`** | **Output Range** |
30+
| --- | --- |
31+
| `uint8` | 0 to 255 |
32+
| `uint16` | 0 to 65,535 |
33+
| `uint32` | 0 to 4,294,967,295 |
34+
| `uint64` | 0 to 18,446,744,073,709,551,615 |
35+
- Ethereum自然语言规范格式([NatSpec](https://docs.soliditylang.org/zh-cn/latest/natspec-format.html#header-tags)
36+
37+
- 位运算
38+
39+
| a | b |a|b | a & b |
40+
| - | - | - | - |
41+
| 0 | 0 | 0 | 0 |
42+
| 0 | 1 | 1 | 0 |
43+
| 1 | 0 | 1 | 0 |
44+
| 1 | 1 | 1 | 1 |
45+
46+
- 移位符
47+
- `uint8 = 1 = 0b00000001`
48+
- `1 << 2 = 0b00000100`
49+
- `1 << 3 = 0b00001000`
50+
1851
# 2025-08-13
1952

2053
- **Extracting the Signature Parameters 原理 [🔗](https://docs.soliditylang.org/en/stable/solidity-by-example.html#extracting-the-signature-parameters)**

0 commit comments

Comments
 (0)