Skip to content

Instantly share code, notes, and snippets.

@benzumbrunn
benzumbrunn / cake-js-exercise-tokensale.md
Last active March 3, 2023 14:17
Cake JavaScript Exercise - Multi-currency Token Sale

Cake JavaScript Exercise - Multi-currency Token Sale

The purpose of this exercise is to get you to be familiar with JavaScript in general, unit testing and cryptocurrency arithmetic. In blockchain & cryptocurrency, we are constantly dealing with huge numbers, for example Ether (ETH) with 18 decimal places, this exercise aims to get you familiarized with that.

This exercise should take about 2-3 hours.

Problem statement

Supposedly there's a token sale that sells token X for token Y. For ease of discussion, let's call token X (token for sale), SALE token and token Y (base currency) ETH.

Keybase proof

I hereby claim:

  • I am benzumbrunn on github.
  • I am benzumbrunn (https://keybase.io/benzumbrunn) on keybase.
  • I have a public key ASDk9xdNWLT_zCFEMeh0OVL3-vnVwwr8B-MFFwmsuCKA8Ao

To claim this, I am signing this object: