From de63ead0e3bba3272e14104b37723916260258df Mon Sep 17 00:00:00 2001 From: Julian Martinez <73849597+Julian-dev28@users.noreply.github.com> Date: Fri, 13 Oct 2023 10:06:08 -0700 Subject: [PATCH] Add tabs to dapps challenge checkpoints (#610) * Update challenge-0-crowdfund.mdx * Add tabs to interaction step * add tabs to checkpoints --- .../dapp-challenges/challenge-0-crowdfund.mdx | 93 +++++++++-- dapps/dapp-challenges/challenge-1-payment.mdx | 83 +++++++--- .../challenge-2-liquidity-pool.mdx | 152 ++++++++++++++++-- 3 files changed, 277 insertions(+), 51 deletions(-) diff --git a/dapps/dapp-challenges/challenge-0-crowdfund.mdx b/dapps/dapp-challenges/challenge-0-crowdfund.mdx index 8e04ecaa..72baccdc 100644 --- a/dapps/dapp-challenges/challenge-0-crowdfund.mdx +++ b/dapps/dapp-challenges/challenge-0-crowdfund.mdx @@ -15,6 +15,8 @@ import { ParentChallengeForm } from "../../src/components/atoms/challenge-form"; import { ParentChallengeContractForm } from "../../src/components/atoms/challenge-contract-form"; import CompleteStepButton from "../../src/components/atoms/complete-step-button"; import StartChallengeButton from "../../src/components/atoms/start-challenge-button"; +import Tabs from "@theme/Tabs"; +import TabItem from "@theme/TabItem"; @@ -98,45 +100,108 @@ You will need to add some Futurenet network lumens to your wallet to interact wi > Note: These are test lumens for use with Futurenet and cannot be used on Mainnet -## Checkpoint 3: ๐Ÿฆ Mint Tokens for the Crowdfunding Campaign +## Checkpoint 3: ๐ŸŒŸ Powering the Campaign + +Fuel the vision! In this step, you will learn how to mint tokens and fund the crowdfunding campaign. + + + + + + + + + +#### Open Dapp and Mint Open the dapp frontend and click on the "Mint 100 ABND" button. + + + + +#### Approve Transaction + You should see a popup from Freighter asking you to sign the transaction. Click on "Approve" and wait for the transaction to be confirmed. + + + + +#### Check Updated Balance + You should see an updated balance in the pledge component. -> Note: These are test tokens for use with Futurenet and cannot be used on Mainnet + + + -## Checkpoint 4: ๐Ÿ’ฐ Fund the Crowdfunding Campaign + -Now that you have your wallet set up, let's fund the crowdfunding campaign. + -Open the frontend and click on the "Back this project" button. You should see a popup from Freighter asking you to sign the transaction. + + + + +#### Fund the Campaign + +Now that you have your wallet set up, let's fund the crowdfunding campaign. Open the frontend and click on the "Back this project" button. You should see a popup from Freighter asking you to sign the transaction. -Click on "Approve" and wait for the transaction to be confirmed. + + + -Once the transaction is confirmed, you should see a success message. +#### Approve Transaction + +Click on "Approve" and wait for the transaction to be confirmed. Once the transaction is confirmed, you should see a success message. -You should see an updated balance in the amount you have pledged in the pledge component. + + + + +#### Check Updated Pledged Amount + +You should see an updated balance reflecting the amount you have pledged in the pledge component. + + + + + + + + +> Note: These are test tokens for use with Futurenet and cannot be used on Mainnet. + Funding completed -## Checkpoint 5: ๐Ÿšข Ship it! ๐Ÿš +## Checkpoint 4: ๐Ÿšข Ship it! ๐Ÿš Now that your dapp is fully functional, next prepare it for a new deployment on Futurenet, this time with a hosted frontend. @@ -200,7 +265,7 @@ You can now visit the preview link to see your deployed dapp! ๐ŸŽ‰ -## Checkpoint 6: ๐Ÿ’ช Pass the Challenge! +## Checkpoint 5: ๐Ÿ’ช Pass the Challenge! Submit your public url to the challenge form and proceed to the next step to check your work. @@ -214,17 +279,15 @@ Join [our Community in Discord](https://discord.gg/stellardev) in case you have ::: -## Checkpoint 7: โœ… Check your work! +## Checkpoint 6: โœ… Check your work! In order to successfully complete this challenge, your work needs to be checked. Please, follow this steps: 1. Fork [the challenge repository](https://github.com/stellar/soroban-dapps-challenge). -2. Fill `crowdfund/challenge/output.txt` file with your wallet address, contract ID and production url. Filled file should look like: +2. Fill `crowdfund/challenge/output.txt` file with your wallet address. Filled file should look like: ```sh -public key: GBSXUXZSA2VEXN5VGOWE5ODAJLC575JCMWRJ4FFRDWSTRCJ123456789 -contract Id: CBKY7UN5VGD4LIQFOBOTSUSQWK67BZZTA23NIEVWSWRR5SAT26JQN2BN -production: https://soroban-example-dapp-rho.vercel.app +Public Key: GBSXUXZSA2VEXN5VGOWE5ODAJLC575JCMWRJ4FFRDWSTRCJ123456789 ``` 3. Create a Pull Request to the `stellar/soroban-dapps-challenge/crowdfund` branch. When the PR will be created, CI actions will check the `crowdfund/challenge/output.txt` file data and update your progress. 4. Wait for the CI/CD pipeline results. diff --git a/dapps/dapp-challenges/challenge-1-payment.mdx b/dapps/dapp-challenges/challenge-1-payment.mdx index 15d6827d..3ee1149b 100644 --- a/dapps/dapp-challenges/challenge-1-payment.mdx +++ b/dapps/dapp-challenges/challenge-1-payment.mdx @@ -24,6 +24,8 @@ import { ParentChallengeForm } from "../../src/components/atoms/challenge-form"; import { ParentChallengeContractForm } from "../../src/components/atoms/challenge-contract-form"; import CompleteStepButton from "../../src/components/atoms/complete-step-button"; import StartChallengeButton from "../../src/components/atoms/start-challenge-button"; +import Tabs from "@theme/Tabs"; +import TabItem from "@theme/TabItem" @@ -135,64 +137,96 @@ Now open your browser and navigate to `http://localhost:9000/`. You should see t connect -## Checkpoint 4: ๐Ÿ“ก Add the Token to Freighter +## Checkpoint 4: ๐Ÿš€ Token Transfer Odyssey + +Strap in and get ready to send some tokens! In this step, you will use the Payment Dapp to send Soroban tokens to another account. + + + + + + + + +#### ๐Ÿ“ก Connect Freighter to Payment Dapp Follow the steps in the [Connect a Wallet: Freighter](../guides/wallets.mdx) guide to connect Freighter to the Payment Dapp. + -Add the Soroban token to your Freighter wallet. To do this, open your Freighter wallet and click on the `Manage Assets` button at the bottom of the screen. + +#### Add Soroban Token +Open your Freighter wallet and click on the `Manage Assets` button at the bottom of the screen. manage assets Then click on the `Add Soroban token ` button and enter the token ID that was returned when you deployed the smart contracts. - add token -
- new token +
-You should now see the Soroban token in your Freighter wallet. + +#### Check Token Addition +You should now see the Soroban token in your Freighter wallet. added balance + -## Checkpoint 5: ๐Ÿฆ Send Tokens to Another Account +
+
-First, connect Freighter and Select the account that will be used to send Soroban tokens. + + -Click "next" to continue. + +#### Connect Freighter and Select Account +First, connect Freighter and Select the account that will be used to send Soroban tokens. +Click "next" to continue. next + -Provide the public key of the account that will receive the Soroban tokens. + + +#### Provide Token Transfer Details +Provide the public key of the account that will receive the Soroban tokens. payment destination Input the Token ID of the Soroban token. - choose token Input the amount of Soroban tokens to send. - select token Confirm the payment settings. - payment settings + -Review the transaction details to ensure accuracy and then click the "Sign with Freighter". Freighter will prompt you to sign the transaction with your wallet's private key. + +#### Confirm and Submit Transaction +Review the transaction details to ensure accuracy and then click the "Sign with Freighter". Freighter will prompt you to sign the transaction with your wallet's private key. confirm payment Once signed, click the "Submit Payment" button, and the transaction will be submitted to the network. - submit payment The Payment Dapp will show a confirmation message once the transaction has been successfully submitted. - end You can now check the balance of the receiving account to ensure that the transaction was successful. - balance receiver You can also check the balance of an account with the soroban-cli by running the following command: @@ -207,17 +241,24 @@ You can also check the balance of an account with the soroban-cli by running the --id ``` + Output: ```bash "1000000000" ``` + + + + +
+ - Tokens added + Tokens Sent -## Checkpoint 6: ๐Ÿšข Ship it! ๐Ÿš +## Checkpoint 5: ๐Ÿšข Ship it! ๐Ÿš You can upload your dapp to a hosting platform of your choice. You could use platforms like Netlify, Vercel, or even an AWS S3 bucket. @@ -269,7 +310,7 @@ You can now visit the preview link to see your deployed dapp! ๐ŸŽ‰ You will need to add some Futurenet network lumens to your Freighter wallet to interact with the deployed dapp. Visit [https://laboratory.stellar.org/#create-account](https://laboratory.stellar.org/#create-account), and follow the instructions to create your Freighter account on Futurenet. -## Checkpoint 7: โœ… Complete the Challenge! +## Checkpoint 6: โœ… Complete the Challenge! Submit your public URL to the challenge form. @@ -283,7 +324,7 @@ Join [our Community in Discord](https://discord.gg/stellardev) in case you have ::: -## Checkpoint 8: ๐Ÿ’ช Share Your Accomplishment with the Community +## Checkpoint 7: ๐Ÿ’ช Share Your Accomplishment with the Community Don't forget to share your work with the community. Let others see what you've accomplished, receive feedback, and inspire others! diff --git a/dapps/dapp-challenges/challenge-2-liquidity-pool.mdx b/dapps/dapp-challenges/challenge-2-liquidity-pool.mdx index 81a42be8..19a039cd 100644 --- a/dapps/dapp-challenges/challenge-2-liquidity-pool.mdx +++ b/dapps/dapp-challenges/challenge-2-liquidity-pool.mdx @@ -41,6 +41,7 @@ git clone https://github.com/stellar/soroban-dapps-challenge cd soroban-dapps-challenge git checkout liquidity-pool ``` + Then, install soroban-cli alias by running the following command: ```sh @@ -96,69 +97,189 @@ You will need to add some Futurenet network lumens to your wallet to interact wi > Note: These are test lumens for use on Futurenet and cannot be used on Mainnet -## Checkpoint 3: ๐Ÿฆ Mint Tokens for the Liquidity Pool +## Checkpoint 3: ๐ŸŒŠ Dive into the Liquidity Pool + +Embark on a tidal journey! In this step you will mint, deposit, swap, and withdraw tokens from the liquidity pool. + +import Tabs from "@theme/Tabs"; +import TabItem from "@theme/TabItem"; + + + + + + + + + +#### Mint USDC and BTC Open the dapp frontend and click the "MINT" button for USDC and BTC. + + + + +#### Approve Transaction You should see a popup from Freighter asking you to sign the transactions. Click on "Approve" and wait for the transaction to be confirmed. + + + + +#### Check Updated Balance You should see an updated balance in the account balance component. + -> Note: These are test tokens for use on Futurenet or Mainnet. + + + -## Checkpoint 4: ๐Ÿ’ฐ Deposit into the Liquidity Pool + -Now that your wallet is set up, let's fund the liquidity pool. + + + + +#### Deposit into the Liquidity Pool Open the frontend, enter the desired token amounts, and click the "Deposit" button. You should see a popup from Freighter asking you to sign the transaction. + -Click on "Approve" and wait for the transaction to be confirmed. + -Once the transaction is confirmed, you should see your balances updated. +#### Approve Transaction - +Click on "Approve" and wait for the transaction to be confirmed. Once the transaction is confirmed, you should see your balances updated. + + + + + +#### Check Updated Balance You should see an updated balance in the amounts you have deposited in the account and reserve balance components, respectively. Following the example, you should see 50 USDC, 50 BTC, and 50 POOL. -## Checkpoint 5: ๐Ÿ”„ Make a Swap + + + + + + + + + + + -Now that you have funded the liquidity pool, let's make a swap. + + +#### Swap Tokens + +Now that you have funded the liquidity pool, you can make a swap. Open the swap tab, input the desired token swap amounts, and click the "Swap" button. You should see a popup from Freighter asking you to sign the transaction. + + + + +#### Approve Transaction + Click on "Approve" and wait for the transaction to be confirmed. + + + + +#### Check Updated Balance + Once the transaction is confirmed, you should see updated balances on the frontend. -## Checkpoint 6: โคด๏ธ Make a Withdrawal + + + + + + + + + + + + +#### Withdraw Tokens from the Liquidity Pool -Now that you have funded the liquidity pool, let's make a withdrawal. +Now that you have funded the liquidity pool, you can make a withdrawal. Open the withdraw tab, select how much liquidity you want to remove with the sliding bar, and click the "Withdraw" button. You should see a popup from Freighter asking you to sign the transaction. + + + + +#### Approve Transaction + Click on "Approve" and wait for the transaction to be confirmed. + + + + +#### Check Updated Balance + Once the transaction is confirmed, you should see updated balances on the frontend. + + + + + + + + +> Note: These are test tokens for use on Futurenet or Mainnet. + Transactions completed -## Checkpoint 7: ๐Ÿšข Ship It! ๐Ÿš +## Checkpoint 4: ๐Ÿšข Ship It! ๐Ÿš Now that your dapp is fully functional , it's time to prepare it for new deployment on Futurenet using Vercel. @@ -177,6 +298,7 @@ Then, navigate to the `frontend` directory and run the development server: cd frontend make setup && make start_dev ``` + Now, open your browser and visit [http://localhost:5173](http://localhost:5173/). Ensure that Freighter is connected to Futurenet, and you should be able to see the frontend of your dapp! @@ -271,13 +393,13 @@ You can now visit the preview link to see your deployed dapp! ๐ŸŽ‰ You must add Futurenet network lumens to your Freighter wallet to interact with the deployed example dapp. Visit https://laboratory.stellar.org/#account-creator?network=futurenet, and follow the instructions to create your Freighter account on Futurenet. -## Checkpoint 8: โœ… Complete the Challenge! +## Checkpoint 5: โœ… Complete the Challenge! Submit your public URL to the challenge form. -## Checkpoint 9: ๐Ÿ’ช Flex! +## Checkpoint 6: ๐Ÿ’ช Flex! ๐Ÿด [Fork the liquidity pool repo] and make your own changes to the dapp. @@ -308,4 +430,4 @@ Then, via the web UI, you should be able to: ## ๐Ÿ›ก๏ธ๐Ÿ—ก๏ธ Take On More Challenges -View your progress and take on more challenges by visiting your [User Dashboard!](/dashboard) \ No newline at end of file +View your progress and take on more challenges by visiting your [User Dashboard!](/dashboard)