Skip to content

Latest commit

 

History

History
81 lines (56 loc) · 4.72 KB

README.md

File metadata and controls

81 lines (56 loc) · 4.72 KB

🎮 Algorand Coding Challenge: Fix The Bug 🐞!

🚩 Challenge 4: How Do I Atomically Send 2 Payment Transactions? 🤔

I want to group 2 payment transactions using Algorand's atomic transfers feature but it's not working!

Inside of index.ts file, there is code that is trying to atomically group 2 payment transactions and synchronously send them using atomic transfers. The code is using the Algorand JavaScript SDK and the AlgoKit Utils TypeScript.

However, if you try to run the index.ts file after going into the challenge directory, opening Docker Desktop, and then running:

algokit bootstrap all
algokit localnet start
npm run start

it will fail and show this error: TypeError: signer is not a function

Find out what is wrong and fix the bug.

💬 Meet other hackers working on this challenge and get help in the General Dev Discord Channel!

Checkpoint 1: 🧰 Prerequisites

  1. Install AlgoKit.
  2. Install Docker. It is used to run a local Algorand network for development.
  3. Install Node.JS / npm

Checkpoint 2: 💻 Set up your development environment

  1. Fork this repository.
  2. Clone the repository
cd [DIRECTORY_OF_YOUR_CHOICE]
git clone [FORKED_REPO_URL]
  1. Open the cloned repository with the code editor of your choosing.
  2. Setup Dev environment using AlgoKit. Run the below command inside of the challenge folder.
algokit bootstrap all

This command will install all dependencies and also generate a .env file for you.

Video walkthrough of forking and cloning this repository:

fork-clone-tutorial.mp4

Now you are ready to fix the bug!

Checkpoint 3: 🐞 Fix the bug 🧐

  1. Open Docker Desktop and launch Algorand localnet by running algokit localnet start in your terminal For more info click me!.
  2. Go to ./index.ts and read the comments on the file and fix the bug!
  3. After fixing the bug run the below command inside of the challenge folder:
npm run start
  1. If you see: The first payment transaction sent 1000000 microAlgos and the second payment transaction sent 2000000 microAlgos in the console, you successfully fixed the bug! 😆

References

😰 Are you struggling?

atc.addTransaction() takes in a transactionWithSigner object as the parameter. You can get the signer of an account using the makeBasicAccountTransactionSigner function from the Algorand JavaScript SDK.

Checkpoint 4: 💯 Submit your answer

  1. After fixing the bug, push your code to your forked Github repo and make a PR to the original repo.
  2. Inside the PR include:
    1. What was the problem?
    2. How did you solve the problem?
    3. Screenshot of your terminal showing the result of running index.ts file.

Checkpoint 5: 🏆 Claim your certificate of completion NFT! 🎓

The Algorand Developer Relations team will review the submission and "approve" the PR by labeling it Approved. Once it's approved, we will share the magic link to claim your certificate of completion NFT in the comment of the PR!

The certificate of completion NFT is a verifiable credential minted on the GoPlausible platform that follows the W3C standard for certificates and OpenBadges standard for badges.

🎉 Congratulations on completing the challenge Algodev! This was the final challenge of the 1st season of #AlgoCodingChallenge. Be on the lookout for the 2nd season of #AlgoCodingChallenge!