Skip to content

Commit

Permalink
Merge branch 'main' of github.com:IntensiveCoLearning/starknet
Browse files Browse the repository at this point in the history
  • Loading branch information
qiaopengjun5162 committed Sep 22, 2024
2 parents 815d649 + 00113fc commit 3197979
Show file tree
Hide file tree
Showing 11 changed files with 198 additions and 24 deletions.
6 changes: 6 additions & 0 deletions Ellen.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,4 +15,10 @@

### 2024.09.19

### 2024.09.21

- 重新安装 foundry
- 执行 test hello world 成功
- 学习合约逻辑,了解存储结构

<!-- Content_END -->
5 changes: 5 additions & 0 deletions Hansen.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,11 @@ timezone: Asia/Shanghai

<!-- Content_START -->

### 2024.09.21

完成 starknet 的Getting Started
在Remix IDE 中 ,部署和调用了 合约

### 2024.09.19
学习了 视频的内容 https://youtu.be/p6mPT2HOGKI

Expand Down
9 changes: 9 additions & 0 deletions MartinYeung5.md
Original file line number Diff line number Diff line change
Expand Up @@ -102,4 +102,13 @@ https://remix.ethereum.org/#activate=Starknet&lang=en&optimize=false&runs=200&ev
試過重新刪所有cache、緩沖等,再重新開機,最後成功
![alt text](https://github.com/MartinYeung5/20240918_starknet/blob/main/20240921_interact_done.png?raw=true)

### 2024.09.22
實操:Remix IDE
* 心得
當透過官方提供的link進行時,會出現如下圖的popup提示: (需要下載整個repo, 要按6次"Accept", 否則就不能獲得完整repo)
![alt text](https://github.com/MartinYeung5/20240918_starknet/blob/main/20240922_remix_start_1.png?raw=true)
另外在deploy時也會出現2次popup,要求你去"Accept"。
最後,在按"Accept"時也要快,如果錯過了,就要刪緩沖的所有紀錄,重新開始,有需要時要重開機。


<!-- Content_END -->
41 changes: 28 additions & 13 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -111,19 +111,19 @@ Starknet 残酷共学是由 LXDAO、Starknet Astro、AAStar 联合发起,旨
| Name | 9.18 | 9.19 | 9.20 | 9.21 | 9.22 | 9.23 | 9.24 | 9.25 | 9.26 | 9.27 | 9.28 | 9.29 | 9.30 | 10.01 | 10.02 | 10.03 | 10.04 | 10.05 | 10.06 | 10.07 | 10.08 |
| ------------- | ---- | ---- | ---- | ---- | ---- | ---- | ---- | ---- | ---- | ---- | ---- | ---- | ---- | ---- | ---- | ---- | ---- | ---- | ---- | ---- | ---- |
| Ache | ⭕️ | ⭕️ || | | | | | | | | | | | | | | | | | |
| geyu | ⭕️ ||| | | | | | | | | | | | | | | | | | |
| aliyan404 |||| | | | | | | | | | | | | | | | | | |
| Hansen ||| ⭕️ | | | | | | | | | | | | | | | | | | |
| Reign ||||| | | | | | | | | | | | | | | | | |
| qiaopengjun |||| | | | | | | | | | | | | | | | | | |
| Ric-Li-C || ⭕️ | ⭕️ | | | | | | | | | | | | | | | | | | |
| River |||| | | | | | | | | | | | | | | | | | |
| awaqawaqawaq |||| | | | | | | | | | | | | | | | | | |
| phipupt |||| | | | | | | | | | | | | | | | | | |
| MartinYeung5 ||||| | | | | | | | | | | | | | | | | |
| dethan3 || ⭕️ || | | | | | | | | | | | | | | | | | |
| Cavn ||| ⭕️ | | | | | | | | | | | | | | | | | | |
| Ellen || ⭕️ | ⭕️ | | | | | | | | | | | | | | | | | | |
| geyu | ⭕️ ||| | | | | | | | | | | | | | | | | | |
| aliyan404 |||| ⭕️ | | | | | | | | | | | | | | | | | |
| Hansen ||| ⭕️ | | | | | | | | | | | | | | | | | | |
| Reign ||||| | | | | | | | | | | | | | | | | |
| qiaopengjun |||| | | | | | | | | | | | | | | | | | |
| Ric-Li-C || ⭕️ | ⭕️ | | | | | | | | | | | | | | | | | | |
| River |||| | | | | | | | | | | | | | | | | | |
| awaqawaqawaq |||| ⭕️ | | | | | | | | | | | | | | | | | |
| phipupt |||| | | | | | | | | | | | | | | | | | |
| MartinYeung5 ||||| | | | | | | | | | | | | | | | | |
| dethan3 || ⭕️ || ⭕️ | | | | | | | | | | | | | | | | | |
| Cavn ||| ⭕️ | ⭕️ | | | | | | | | | | | | | | | | | |
| Ellen || ⭕️ | ⭕️ | | | | | | | | | | | | | | | | | | |
<!-- END_COMMIT_TABLE -->


Expand Down Expand Up @@ -174,6 +174,21 @@ Starknet 残酷共学是由 LXDAO、Starknet Astro、AAStar 联合发起,旨





















Expand Down
43 changes: 42 additions & 1 deletion Reign.md
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,7 @@ These steps form the groundwork for deploying an example contract (`Ownable`) on

### 2024.09.21

### 2.Straknet Tooling
### 2. Straknet Tooling

### Suggested Learning Path:
1. **Cairo Programming Language**: It is essential to have a basic understanding of Cairo. Reading chapters 1-6 of the *Cairo Book* (covering topics such as Getting Started, Enums, and Pattern Matching) is advised, followed by the *Starknet Smart Contracts* chapter. This will help developers understand the examples in this chapter.
Expand All @@ -159,5 +159,46 @@ These steps form the groundwork for deploying an example contract (`Ownable`) on
5. **Testing**:
- **Starknet-Foundry** and **Devnet** provide tools for testing smart contracts effectively in a local environment.

### 2024.09.22

#### 2.1 Basic Installation
This chapter focuses on setting up the essential tools for Starknet development, including Starkli, Scarb, and Katana.

#### Key Tools:
1. **Starkli:** A command-line tool for interacting with the Starknet network.

- Install via:
~~~
curl https://get.starkli.sh | sh
starkliup
~~~
- Verify installation with:
~~~
starkli --version
~~~
2. **Scarb:** Cairo's package manager, similar to Rust’s Cargo, used to compile Cairo code to Sierra (an intermediate language between Cairo and CASM).

- Requirements: Git must be installed and added to the system's PATH.
- Recommended installation method: Use asdf to manage Scarb versions.
~~~
asdf plugin add scarb
asdf install scarb 2.5.4
asdf global scarb 2.5.4
~~~
- Alternatively, install Scarb via the official script:
~~~
curl --proto '=https' --tlsv1.2 -sSf https://docs.swmansion.com/scarb/install.sh | sh
~~~
3. **Katana:** A local Starknet node for development.

- Install using the dojoup installer:
~~~
curl -L https://install.dojoengine.org | bash
dojoup
~~~
- Verify installation with:
~~~
katana --version
~~~

<!-- Content_END -->
6 changes: 4 additions & 2 deletions Ric-Li-C.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,8 +20,10 @@ Yes 75%

观看在线视频 ~ Starknet 残酷共学分享 #1: Starknet & Cairo 技术概述

### 2024.09.19
### 2024.09.21

### 2024.09.20
学习 Starknet Book (https://book.starknet.io/index.html)

### 2024.09.22

<!-- Content_END -->
103 changes: 97 additions & 6 deletions River.md
Original file line number Diff line number Diff line change
Expand Up @@ -101,14 +101,29 @@ timezone: Pacific/Auckland # 新西兰标准时间 (UTC+12)

3. 安装`asdf`

这里使用的官方的下载方式
* 使用的官方的下载方式

因此安装时需要在`~/.bash_profile`文件下添加以下配置:
安装时需要在`~/.bash_profile`文件下添加以下配置:

~~~shell
. "$HOME/.asdf/asdf.sh"
. "$HOME/.asdf/completions/asdf.bash"
~~~
~~~shell
. "$HOME/.asdf/asdf.sh"
. "$HOME/.asdf/completions/asdf.bash"
~~~

* 使用`brew`方式安装

安装完成后会提示设置环境变量

~~~shell
To use asdf, add the following line (or equivalent) to your shell profile
e.g. ~/.profile or ~/.zshrc:
. /opt/homebrew/opt/asdf/libexec/asdf.sh
e.g. ~/.config/fish/config.fish
source /opt/homebrew/opt/asdf/libexec/asdf.fish
Restart your terminal for the settings to take effect.
~~~



4. 验证

Expand Down Expand Up @@ -343,4 +358,80 @@ fn main() {



### 2024.09.21

#### 函数

使用关键字`fn`声明一个函数。

函数的名称格式通常是下划线格式。如:

~~~rust
fn another_function() {
println!("Another function.");
}
~~~

#### 参数

参数是函数签名的一部分。在函数签名中,必须声明参数的类型。

~~~rust
fn print_labeled_measurement(value: u128, unit_label: ByteArray) {
println!("The measurement is: {value}{unit_label}");
}
~~~

#### 命名参数(Named Parameters)

`Cairo`中,当调用函数时,可以指定参数的名称。可以让函数调用有可读性和自描述性。

语法:`parameter_name: value`,如果传递的变量与参数的名称一样时,可以简写为`:parameter_name`

~~~rust
fn foo(x: u8, y: u8) {}

fn main() {
let first_arg = 3;
let second_arg = 4;
foo(x: first_arg, y: second_arg);
let x = 1;
let y = 2;
foo(:x, :y)
}
~~~



#### 语句与表达式

* 语句:执行一些操作的指令,没有返回值

~~~rust
let y = 6;
~~~

* 表达式:进行求值并得到结果值。可以是一行代码,也可以是代码块。**末尾没有分号**

~~~rust
let y = {
let x = 3;
x + 1
};
~~~



#### 方法返回值

在`Cairo`中,在函数签名后面的`->`之后来声明返回值类型

~~~rust
fn plus_one(x: u32) -> u32 {
x + 1
}
~~~



<!-- Content_END -->
2 changes: 2 additions & 0 deletions geyu.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,8 @@ fork 了 counter-workshop
通过了 Step 1 的要求
### 2024.09.20
通过了counter-workshop Step 2
### 2024.09.21
通过了counter-workshop Step 3


<!-- Content_END -->
7 changes: 5 additions & 2 deletions phipupt.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
---
timezone: Pacific/Auckland
timezone: Asia/Shanghai
---

---
Expand Down Expand Up @@ -76,9 +76,12 @@ Starknet Foundry 使用:

### 2024.09.20
今天阅读[官方文档](https://docs.starknet.io/),整理了一些 Starknet 相关概念
![starket-concepts](./starket-concepts.png)
![starket-concepts](./phipupt/starket-concepts.png)


### 2024.09.21
今天整理了一些 Starknet 生态项目
![starket-ecosystem](./phipupt/starknet-ecosystem.png)


<!-- Content_END -->
File renamed without changes
Binary file added phipupt/starknet-ecosystem.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit 3197979

Please sign in to comment.