Assignment 2: Create an “actual” Token
The goal of this assignment is to create your first Aleo token following the current community adopted token standard: ARC21.
Following the specifications in chapter 5.4, your goal is to write a program managing such a token: by handling the registration and initial coin offering of the token. It must import the token_registry.aleo
program:
import token_registry.aleo;
Learning Objectives
By completing this assignment, you will:
Understand how to use the token community standard
Write your first DeFi program
Tasks
Your program must include the following transitions:
initialize
: it is responsible for registering the token, callingtoken_registry.aleo/register
transition. Your token metadata such as token ID, max supply, name... should all be defined as constants at the beginning of your program.mint
: it is the transition called by users directly to mint the tokentoken_registry.aleo/mint_public
. This minting should be allowed only after a certain block height, defined as a constantMINT_START_HEIGHT
. Upon minting, the minter should transfer publicly Aleo credits to aTREASURY
address defined as a constant.MINT_PRICE
constant will define the price to mint per token.update_admin
: a transition to update the token admin with the address provided as an input, it callstoken_registry.aleo/update_token_management
to do so.
Also, add as a comment at the end of the program the command that will be executed to initialize the token:
leo execute initialize #...
Last updated