Skip to content

Commit bcdf61a

Browse files
committed
refactor: add a new chapter structure
License: MIT Signed-off-by: Vaibhav Saini <[email protected]>
1 parent 88b98bf commit bcdf61a

18 files changed

+242
-23
lines changed

1/contract_structure.md

+19
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
# Contract Structure
2+
3+
TODO: Add Lesson for Contract Structure
4+
5+
<!-- tabs:start -->
6+
7+
#### ** Template **
8+
9+
[embedded-code](../assets/1/1.1-template-code.vy ":include :type=code embed-template")
10+
11+
#### ** Solution **
12+
13+
[embedded-code-final](../assets/1/1.1-finished-code.vy ":include :type=code embed-final")
14+
15+
#### ** Previous Chapter Solution **
16+
17+
[embedded-code-previous](../assets/1/1.0-finished-code.vy ":include :type=code embed-previous")
18+
19+
<!-- tabs:end -->

1/control_structures.md

+19
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
# Control Structures
2+
3+
TODO: Add Lesson for Control Structures
4+
5+
<!-- tabs:start -->
6+
7+
#### ** Template **
8+
9+
[embedded-code](../assets/1/1.1-template-code.vy ":include :type=code embed-template")
10+
11+
#### ** Solution **
12+
13+
[embedded-code-final](../assets/1/1.1-finished-code.vy ":include :type=code embed-final")
14+
15+
#### ** Previous Chapter Solution **
16+
17+
[embedded-code-previous](../assets/1/1.0-finished-code.vy ":include :type=code embed-previous")
18+
19+
<!-- tabs:end -->

1/env_vars_and_constants.md

+19
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
# Env Vars and Constants
2+
3+
TODO: Add Lesson for Env Vars and Constants
4+
5+
<!-- tabs:start -->
6+
7+
#### ** Template **
8+
9+
[embedded-code](../assets/1/1.1-template-code.vy ":include :type=code embed-template")
10+
11+
#### ** Solution **
12+
13+
[embedded-code-final](../assets/1/1.1-finished-code.vy ":include :type=code embed-final")
14+
15+
#### ** Previous Chapter Solution **
16+
17+
[embedded-code-previous](../assets/1/1.0-finished-code.vy ":include :type=code embed-previous")
18+
19+
<!-- tabs:end -->

1/event_logging.md

+19
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
# Event Logging
2+
3+
TODO: Add Lesson for Event Logging
4+
5+
<!-- tabs:start -->
6+
7+
#### ** Template **
8+
9+
[embedded-code](../assets/1/1.1-template-code.vy ":include :type=code embed-template")
10+
11+
#### ** Solution **
12+
13+
[embedded-code-final](../assets/1/1.1-finished-code.vy ":include :type=code embed-final")
14+
15+
#### ** Previous Chapter Solution **
16+
17+
[embedded-code-previous](../assets/1/1.0-finished-code.vy ":include :type=code embed-previous")
18+
19+
<!-- tabs:end -->

1/functions.md

+19
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
# Functions
2+
3+
TODO: Add Lesson for Functions
4+
5+
<!-- tabs:start -->
6+
7+
#### ** Template **
8+
9+
[embedded-code](../assets/1/1.1-template-code.vy ":include :type=code embed-template")
10+
11+
#### ** Solution **
12+
13+
[embedded-code-final](../assets/1/1.1-finished-code.vy ":include :type=code embed-final")
14+
15+
#### ** Previous Chapter Solution **
16+
17+
[embedded-code-previous](../assets/1/1.0-finished-code.vy ":include :type=code embed-previous")
18+
19+
<!-- tabs:end -->

1/interfaces.md

+19
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
# Interfaces
2+
3+
TODO: Add Lesson for Interfaces
4+
5+
<!-- tabs:start -->
6+
7+
#### ** Template **
8+
9+
[embedded-code](../assets/1/1.1-template-code.vy ":include :type=code embed-template")
10+
11+
#### ** Solution **
12+
13+
[embedded-code-final](../assets/1/1.1-finished-code.vy ":include :type=code embed-final")
14+
15+
#### ** Previous Chapter Solution **
16+
17+
[embedded-code-previous](../assets/1/1.0-finished-code.vy ":include :type=code embed-previous")
18+
19+
<!-- tabs:end -->

1/metadata.md

+19
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
# NatSpec Metadata
2+
3+
TODO: Add Lesson for NatSpec Metadata
4+
5+
<!-- tabs:start -->
6+
7+
#### ** Template **
8+
9+
[embedded-code](../assets/1/1.1-template-code.vy ":include :type=code embed-template")
10+
11+
#### ** Solution **
12+
13+
[embedded-code-final](../assets/1/1.1-finished-code.vy ":include :type=code embed-final")
14+
15+
#### ** Previous Chapter Solution **
16+
17+
[embedded-code-previous](../assets/1/1.0-finished-code.vy ":include :type=code embed-previous")
18+
19+
<!-- tabs:end -->

1/pick_a_pokemon.md

+19
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
# Picking a Pokemon
2+
3+
TODO: Add Lesson for Picking a Pokemon
4+
5+
<!-- tabs:start -->
6+
7+
#### ** Template **
8+
9+
[embedded-code](../assets/1/1.1-template-code.vy ":include :type=code embed-template")
10+
11+
#### ** Solution **
12+
13+
[embedded-code-final](../assets/1/1.1-finished-code.vy ":include :type=code embed-final")
14+
15+
#### ** Previous Chapter Solution **
16+
17+
[embedded-code-previous](../assets/1/1.0-finished-code.vy ":include :type=code embed-previous")
18+
19+
<!-- tabs:end -->

1/scoping_and_declarations.md

+19
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
# Scoping and Declarations
2+
3+
TODO: Add Lesson for Scoping and Declarations
4+
5+
<!-- tabs:start -->
6+
7+
#### ** Template **
8+
9+
[embedded-code](../assets/1/1.1-template-code.vy ":include :type=code embed-template")
10+
11+
#### ** Solution **
12+
13+
[embedded-code-final](../assets/1/1.1-finished-code.vy ":include :type=code embed-final")
14+
15+
#### ** Previous Chapter Solution **
16+
17+
[embedded-code-previous](../assets/1/1.0-finished-code.vy ":include :type=code embed-previous")
18+
19+
<!-- tabs:end -->

1/statements.md

+19
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
# Statements
2+
3+
TODO: Add Lesson for Statements
4+
5+
<!-- tabs:start -->
6+
7+
#### ** Template **
8+
9+
[embedded-code](../assets/1/1.1-template-code.vy ":include :type=code embed-template")
10+
11+
#### ** Solution **
12+
13+
[embedded-code-final](../assets/1/1.1-finished-code.vy ":include :type=code embed-final")
14+
15+
#### ** Previous Chapter Solution **
16+
17+
[embedded-code-previous](../assets/1/1.0-finished-code.vy ":include :type=code embed-previous")
18+
19+
<!-- tabs:end -->

1/types.md

+19
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
# Types
2+
3+
TODO: Add Lesson for Types
4+
5+
<!-- tabs:start -->
6+
7+
#### ** Template **
8+
9+
[embedded-code](../assets/1/1.1-template-code.vy ":include :type=code embed-template")
10+
11+
#### ** Solution **
12+
13+
[embedded-code-final](../assets/1/1.1-finished-code.vy ":include :type=code embed-final")
14+
15+
#### ** Previous Chapter Solution **
16+
17+
[embedded-code-previous](../assets/1/1.0-finished-code.vy ":include :type=code embed-previous")
18+
19+
<!-- tabs:end -->

_sidebar.md

+14
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,19 @@
11
- [Welcome](./README.md)
22

3+
- [**#1 Your First Pokemon**](1/introduction.md)
4+
5+
- [Pick a pokemon](1/pick_a_pokemon.md)
6+
- [Structure of a contract](1/contract_structure.md)
7+
- [Types](1/types.md)
8+
- [Env variables and constants](1/env_vars_and_constants.md)
9+
- [Statements](1/statements.md)
10+
- [Control Structures](1/control_structures.md)
11+
- [Scoping and declarations](1/scoping_and_declarations.md)
12+
- [Built-in functions](1/functions.md)
13+
- [Interfaces](1/interfaces.md)
14+
- [Event Logging](1/event_logging.md)
15+
- [NatSpec Metadata](1/metadata.md)
16+
317
<!-- - [Glossary](https://substrate.dev/docs/overview/glossary) -->
418

519
- [Documentation](https://vyper.readthedocs.io/en/stable/)

assets/1/1.0-finished-code.js

-1
This file was deleted.

assets/1/1.0-finished-code.vy

+5
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
'use-strict'
2+
3+
interface FooBar:
4+
def calculate() -> uint256: view
5+
def test1(): nonpayable

assets/1/1.1-finished-code.js

-12
This file was deleted.

assets/1/1.1-finished-code.vy

+13
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
# @version ^0.2.0
2+
3+
event Payment:
4+
amount: int128
5+
sender: indexed(address)
6+
7+
total_paid: int128
8+
9+
@external
10+
@payable
11+
def pay():
12+
self.total_paid += msg.value
13+
log Payment(msg.value, msg.sender)

assets/1/1.1-template-code.js

-10
This file was deleted.

assets/1/1.1-template-code.vy

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
# @version ^0.2.0

0 commit comments

Comments
 (0)