-
-
Notifications
You must be signed in to change notification settings - Fork 44
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #306 from Cyfrin/hotfix/blockchain-basics-foundry
Hotfix/blockchain basics foundry
- Loading branch information
Showing
21 changed files
with
127 additions
and
0 deletions.
There are no files selected for viewing
50 changes: 50 additions & 0 deletions
50
.../blockchain-basics/1-basics/10-sending-your-first-transaction-tenderly/+page.md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,50 @@ | ||
## Sending Your First Transaction | ||
|
||
In this lesson, we'll set up a new virtual testnet and send our first transaction. We'll be using the testnet provided by Tenderly, which lets us simulate sending real transactions without using actual money. | ||
|
||
### Setting Up a Virtual Testnet | ||
|
||
1. Go to the [Tenderly](https://tenderly.co/?mtm_campaign=partner&mtm_kwd=cyfrin) website. | ||
2. Click the **Sign Up** button in the top right corner. | ||
3. Enter your **Email**, **Username**, and **Password**. | ||
4. Click **Create Account**. | ||
5. You'll be taken to the Tenderly dashboard. Click **Skip personalization**. | ||
6. On the left side of the page, find the **Virtual TestNets** section and click it. | ||
7. Click **Create Virtual TestNet**. | ||
8. We'll make a few configuration choices. | ||
9. Under **General**, choose **Sepolia** for the parent network. We could select **Ethereum Mainnet**, but it doesn't really matter. | ||
10. Give your testnet a **Name**. I'll call mine `my-chain`. | ||
11. Under **Chain ID**, select **Custom** and enter `111555111`. You can choose **Default** to keep the original chain ID. | ||
12. Under **Public Explorer**, select **Off** to restrict access for now. You could leave it at **Fork** or **On**. | ||
13. For **State Sync**, choose **Use latest block**. | ||
14. Click **Create**. | ||
15. A message will pop up from Tenderly, asking us to send a message with `CYFRIN2024` to extend our free trial. Send the message. | ||
16. You'll see your new virtual testnet, `my-chain`, has been created. | ||
17. Click **Add to Wallet** next to your virtual testnet's name. | ||
18. Your MetaMask window will appear. Click **Connect**. | ||
19. Your virtual testnet should now be added to MetaMask. | ||
|
||
### Sending Your First Transaction | ||
|
||
1. In MetaMask, go to the **Tokens** tab. | ||
2. Click the account drop-down menu and create a new account. | ||
3. Click **Add account** and name it, e.g. `Account 2`. | ||
4. Back in the account drop-down menu, you'll see `Account 1` with some funds and `Account 2` with zero funds. | ||
5. Click the **Send** button in MetaMask. | ||
6. We'll send money from `Account 1` to `Account 2`. You can either click the `Account 2` button or paste in `Account 2`'s address. I'll just click the button. | ||
7. Enter the amount of ETH you wish to send, e.g. `1 ETH`. | ||
8. Click **Continue**. | ||
9. A review of the transaction will pop up. Click **Confirm**. | ||
10. You'll see your transaction in a pending state. | ||
11. After a short delay, the transaction will be confirmed. | ||
12. In MetaMask, go back to the **Tokens** tab. You'll see that `Account 1` now has `999 ETH` and `Account 2` has `1 ETH`. | ||
13. Go back to the Tenderly dashboard. | ||
14. Go to the **Explorer** tab. | ||
15. You'll see a list of all the transactions that have been sent. Any transactions that are grayed out are from the forked chain and can be ignored for now. The latest transaction that is not grayed out is the transaction we just sent. | ||
16. Clicking on the transaction lets you view all the details, including the addresses of the sender and receiver, the amount sent, the timestamp, and the raw data. | ||
|
||
You've successfully sent your first transaction! Congratulations! This is exactly how you'd send money on the Ethereum network. This is a simulation, but you should be proud of yourself. | ||
|
||
### Conclusion | ||
|
||
In this lesson, we learned how to set up a virtual testnet on Tenderly and send a transaction using MetaMask. We learned how to configure the virtual testnet and how to view the details of our transactions. This gives us the tools to test our smart contracts without risking real money. You are now ready to move on to the next lesson! |
25 changes: 25 additions & 0 deletions
25
courses/blockchain-basics/1-basics/11-a-note-on-testnets/+page.md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,25 @@ | ||
## Testnets | ||
|
||
We're going to explore how to use testnets to deploy smart contracts and make transactions. | ||
|
||
### Tenderly | ||
|
||
We'll be using a virtual testnet tool called "Tenderly." This is our preferred method for interacting with a testnet. | ||
|
||
### Why Tenderly? | ||
|
||
Using a virtual testnet is our preferred method for interacting with a testnet. Obtaining actual testnet funds can be very challenging. | ||
|
||
### Testnet Transactions (Optional) | ||
|
||
We'll also take a look at what sending a transaction on a testnet looks like. This section is optional. | ||
|
||
If you are unable to obtain testnet funds, don't worry. You can still learn everything you need to know by using Tenderly. | ||
|
||
### Testnet Exploration (Optional) | ||
|
||
We'll explore what a different explorer looks like, such as Etherscan or Blockscout. This section is optional. | ||
|
||
### Summary | ||
|
||
The testnet sections are optional throughout CipherUpdraft. If you want to experience it firsthand, we highly recommend using Tenderly. |
49 changes: 49 additions & 0 deletions
49
...ckchain-basics/1-basics/12-sending-your-first-transaction-on-a-testnet/+page.md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,49 @@ | ||
## Working with Testnets | ||
|
||
We're going to learn how to work with Testnets. Working with Testnets is optional, but it's a great way to experiment with transactions and learn about gas without risking real money. | ||
|
||
**Testnet Basics** | ||
|
||
At the time of recording, Sepolia is a popular Testnet. You can find the most up-to-date information about Testnets on the GitHub repository associated with this course (Cyprin Foundry Full Course, formerly known as ChainAccelOrg Foundry Full Course). | ||
|
||
Testnets are constantly changing, so it's important to check the recommended Testnets section on the GitHub repository. | ||
|
||
We can use Sepolia Etherscan (`sepolia.etherscan.io`) to view our account balance and transactions on the Sepolia Testnet. | ||
|
||
*Important:* Getting testnet faucets can be challenging. If you are unable to get any testnet faucets, please do not waste a ton of time trying to get it, and just use tenderly virtual networks instead! | ||
|
||
**Sending a Testnet Transaction** | ||
|
||
To send a transaction on a Testnet, we need to use a **faucet**. A faucet allows us to get free Testnet tokens. | ||
|
||
* **Recommended Faucet:** `faucets.chain.link` (check the GitHub repository for the most up-to-date links). | ||
|
||
**Connecting Your Wallet to a Faucet** | ||
|
||
1. Connect your MetaMask wallet to the faucet website. | ||
2. Select the Sepolia Testnet in your MetaMask. | ||
3. Request Test ETH (you can also request Test LINK in the future). | ||
4. Log in via Twitter (or use another faucet if you don't have Twitter). | ||
|
||
**Receiving Testnet ETH** | ||
|
||
After requesting Test ETH, you'll see a transaction hash. This hash represents your transaction on the Sepolia Testnet. You can view the transaction details on Sepolia Etherscan. Once the transaction is complete, you'll see your Test ETH balance update in your MetaMask. | ||
|
||
**Understanding Transaction Details** | ||
|
||
You can view transaction details on Sepolia Etherscan. Important details include: | ||
|
||
* **Transaction hash:** A unique identifier for the transaction. | ||
* **Status:** Whether the transaction was successful. | ||
* **From:** The address that sent the transaction. | ||
* **To:** The address that received the transaction. | ||
* **Value:** The amount of ETH sent (in this case, 0.1 Test ETH). | ||
|
||
**Important Notes:** | ||
|
||
* Testnet transactions are not worth any real money. | ||
* Use Testnet transactions sparingly. | ||
* You can find information about different Testnets in the GitHub repository. | ||
* We'll cover adding different networks to your MetaMask in the future. | ||
|
||
**Congratulations on your first transaction!** Now, let's use this Testnet transaction to learn more about gas. |
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
3 changes: 3 additions & 0 deletions
3
courses/foundry/1-foundry-simple-storage/26-anvil-zksync-updated/+page.md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
--- | ||
ANVIL ZKSYNC UPDATED | ||
--- |
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.