Standalone

Setting Up

close button

Part III

Downloading a Quest

As you might have noticed, your Questplay repo does not have any quests at the moment. To embark on our first quest, we have to first download one.

Downloading the Tutorial Quest

Let us try downloading this tutorial quest now.

quest find setting-up

You should be prompted to allow a download. When you download a quest onto Questplay, you download all the template contracts you will need to complete and a set of tests you can run to verify that your solution works.

After you have accepted and finished the download, navigate to the new quest directory.

cd campaigns/standalone-quests/setting-up

Types of Quests

Node Guardians supports two types of programming quests:

  1. Build Quests

  2. Capture the Flag (CTF) Quests

Build quests require you to build and test smart contracts locally, before submitting them via Github for verification. On the other hand, CTF quests are held on-chain and require you to "exploit" a contract on a live testnet.

For the remainder of the tutorial, we will be focusing on how to test and submit a build quest (this tutorial is an example of a build quest).

Testing a Build Quest

In the folder of your downloaded quest setting-up/, you should see the template contract file contracts/HelloGuardian.sol. Open the file and complete the hello() function.

After, verify your work locally by running the following command in the terminal.

quest test 3

We run quest test 3 since we're testing part 3!

Remember to navigate to the appropriate quest directory before running "quest test". If not, Questplay will not know which tests to run!

If done correctly, you should see an output similar to this.

setting_up_05.webp

Our Solidity quests run Hardhat tests by default. However, most Solidity quests come with local Foundry tests as well. If you prefer to test in Foundry, you can use the command "quest set-framework foundry".

Your Task

Download the tutorial quest, complete HelloGuardian.sol and test it locally!

What files can you modify? Every downloaded build quest comes with an accompanying files-to-test.json. In general, you should only make changes to files specified there. You should neither modify nor add any other files!

As you line up with the other apprentices, the Drill Sergeant starts instructing you in how to cast a simple fireball spell…