Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion audit.py
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ def audit(courses):
depth = len(dirpath.split(os.sep)) - len(root_directory.split(os.sep))

if depth == 2:
# Print directory and caption_count if they are less than the threshold
# Print directory and caption_count if they are less than the threshold
if caption_count < MIN_CAPTION_COUNT:
count_line = f"{dirpath} Captions: {caption_count}"
with open("audit.txt", "a") as file:
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

We are going to continue our exploration of digital signatures with something called ECDSA recover, which was mentioned in the last video. This is a process that will be incredibly important to what we are doing here with our Merkle airdrop. Let's dive in.

### What are ECDSA Signatures?
### What are ECDSA Signatures?

ECDSA stands for Elliptic Curve Digital Signature Algorithm. It's a mouthful, but it's based on Elliptic Curve Cryptography. Don't worry, we'll get into what that means in a second. ECDSA is used to:
- generate key pairs
Expand Down Expand Up @@ -40,7 +40,7 @@ Public and private keys are generated using a process that involves two importan

We only really need to remember that these constants are, in fact, constants. They will be used in subsequent calculations.

### What is a Signature in ECDSA?
### What is a Signature in ECDSA?

ECDSA signatures are made up of three integers:
- V
Expand All @@ -60,7 +60,7 @@ The ECDSA verification algorithm takes the signed message, the signature from th

The EVM pre-compiler does this verification for us. It checks to see if the signature is valid. If it is not valid, the pre-compiler will return the zero address, and the smart contract will revert.

### ECDSA Recover
### ECDSA Recover

ECDSA recover is a function used in smart contracts. It retrieves the signer's address of a message that has been signed using a private key with ECDSA. It uses the signature to do this.

Expand All @@ -74,7 +74,7 @@ We should always use the OpenZeppelin ECDSA library to verify signatures. This l

We also discussed another issue with using ECDSA recover directly. If the signature is invalid, the ECDSA recover function will return the zero address. The smart contract should have a check in place to ensure it reverts if the zero address is returned from the ECDSA recover function. Again, the OpenZeppelin ECDSA library already has this check in place.

### Conclusion
### Conclusion

Well done, we covered a lot of information, and it can be overwhelming. You should be proud of yourself for making it through. If anything was confusing, or you need to go over this again, you can always read some other articles, or dive into the math. It's very complex stuff and it's unlikely you'll get your head around it the first time.

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ Merkle trees are like a hierarchical data structure that allows for efficient an

Let's dive into the world of Merkle Trees and understand the key concepts behind them.

## What are Merkle Trees?
## What are Merkle Trees?

Merkle trees essentially help us to efficiently verify a large amount of data using a small, compact hash value. They are like a hierarchical data structure that holds data and its hash values.

Expand All @@ -27,7 +27,7 @@ We can build a Merkle Tree by:
2. **Pairing and hashing hash values:** We pair up the hash values, creating a new hash by combining the two hash values. The new hash can be created by sorting the hashes and then combining them using a cryptographic hash function.
3. **Continuing the process:** The newly generated hash values from step 2 are then paired up and hashed again, creating a new level in the tree. This process continues until we reach the root node.

## Example
## Example

We are going to go over a simple Merkle Tree with four leaf nodes.

Expand Down Expand Up @@ -66,7 +66,7 @@ patrick@kcu:mox-signatures-cu % mox run make_merkle

This will output a `JSON` file that contains the Merkle Tree data.

## Workshop
## Workshop

We are now going to complete a workshop. We will build a Merkle Tree with eight leaf nodes. We will be using the code we've created above as a starting point.

Expand Down
4 changes: 2 additions & 2 deletions courses/curve-v1/5-add-liquidity/4-imbalance-fee/+page.md
Original file line number Diff line number Diff line change
Expand Up @@ -68,10 +68,10 @@ b = [100, 90, 110]
# Adding 300 DAI
b1 = [b[0] + 300, b[1], b[2]]

# Initial liquidity
# Initial liquidity
D0 = calc_D(b[0], b[1], b[2], A, [0, 0, 0])

# Liquidity after adding liquidity
# Liquidity after adding liquidity
D1 = calc_D(b1[0], b1[1], b1[2], A, D0)

# Imbalance fee
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
## Removing Liquidity
## Removing Liquidity

We can call a function to remove liquidity from the pool. If we want to remove liquidity in one coin, then we can call the `remove_liquidity_one_coin()` function.

Expand Down
2 changes: 1 addition & 1 deletion courses/uniswap-v2/2-swap/19-spot-price-graph/+page.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ The slope of this line is dY / dX. We can see that as dX gets smaller, the slope

So, the price of token X in terms of token Y is given by the slope of the tangent line to the curve at the point (X,Y).

## Diagram
## Diagram

```mermaid
graph LR
Expand Down
2 changes: 1 addition & 1 deletion courses/uniswap-v2/7-twap/8-twap-code-walk/+page.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@ The code snippet below is the section of the `update` function we'll be focused
price1CumulativeLast += uint(uq112x112.encode(reserve0).uqdiv(reserve1)) * timeElapsed;
```

## Understanding Time-Weighted Average Price (TWAP)
## Understanding Time-Weighted Average Price (TWAP)

TWAP is a mechanism used to calculate the average price of a token over a certain period. It's used to help mitigate price manipulation by preventing large, sudden trades from impacting the price too significantly.

Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
### Difference between Uniswap V2 and V3
### Difference between Uniswap V2 and V3

In this lesson, we will discuss the differences between Uniswap V2 and V3.

Expand Down