Skip to content

Latest commit

 

History

History
52 lines (27 loc) · 2.62 KB

6_Alonzo-purple-exercise-6.md

File metadata and controls

52 lines (27 loc) · 2.62 KB

Alonzo Purple Testnet Exercise Sheet 6: "Simple DApps"

In the previous set of exercises, you interacted with native tokens. In this set of exercises, you will build some more substantial applications.

Prerequisites

  1. Complete Exercise Sheet 5

  2. Start a passive Cardano node if you need to, and make sure that it has synced with the testnet.

  3. Make sure you have some Alonzo Purple test ada

Objectives

In this set of exercises, we will make sure that you can:

  1. Build more substantial DApps
  2. Adapt the DApps to changing external situations

Exercises

  1. Build a faucet application that dispenses funds on request. You should supply 1,000 Lovelace for each request.

  2. Extend your faucet so that it dispenses different amounts of Lovelace if specific API keys are provided. For example

API Key Amount
Secret1 10,000 lovelace
Secret2 100,000 lovelace
  1. Test your faucet by funding a number of addresses. Also fund the same address multiple times. Do you encounter any problems? If so, how can you fix them?

  2. A "stable coin" aims to maintain a constant value. A reserve of some asset is used to maintain the value of the stable coin. Build an application that models a stable coin using test Ada to fund the reserve. Each time a stable coin is minted or burned, an equivalent amount of ada should be transferred to/from the reserve.

  3. Extend your stable coin model so that it is stable against some external currency (for example, Euros, US dollars, or Japanese Yen). Additional ada must be injected into or removed from the reserve each time the ada to currency exchange rate changes. Test your stable coin model against a series of rate changes.

  4. Publicise your stable coin and exchange coins with other Testnet users. How effective is your model at maintaining a stable exchange rate? What problems do you encounter and how can you fix these.

Feedback

Please let us know of any problems that you have encountered