Skip to content

A simple financial app with DRavage tokens inspired from curve.fi 's classic UI. Didnt deploy the project since to deploy into ICP blockchain you require ICP tokens.

Notifications You must be signed in to change notification settings

TheRAVAGE/Project-0003-Crypto-Token-App

Repository files navigation

Decentralised Token

Welcome to your new Decentralised Token project and to the internet computer development community. By default, creating a new project adds this README and some template files to your project directory. You can edit these template files to customize your project and to include your own code to speed up the development cycle.

NOTE: This project uses dfx or Difinity so you might want to download that if you are trying to run the app.

NOTE: Deploying on Internet Computer requires me to spend ICP Tokens to get computational cycles and would have to refill it every time it runs out, Hence I'm not deploying it on the ICP Blockchain. Although all the canisters required, are built.

To get started, you might want to explore the project directory structure and the default configuration file. Working with this project in your development environment will not affect any production deployment or identity tokens.

To learn more before you start working with token, see the following documentation available online:

If you want to start working on your project right away, you might want to try the following commands:

cd token/
dfx help
dfx config --help

Running the project locally

If you want to test your project locally, you can use the following commands:

# Starts the replica, running in the background
dfx start

# Deploys your canisters to the replica and generates your candid interface
dfx deploy

Once the job completes, your application will be available at http://localhost:8000?canisterId={asset_canister_id}.

Additionally, if you are making frontend changes, you can start a development server with

npm start

Which will start a server at http://localhost:8080, proxying API requests to the replica at port 8000.

Claim button

To make the claim button work, we need to add in some amount to canister since the function calls from frontend would have the id of the canister instead of the owner.Hence I added the tokens to the canister. So here's what you need to do in the terminal...

  1. Check canister ID:
dfx canister id token
  1. Save canister ID into a command line variable:
CANISTER_PUBLIC_KEY="principal \"$( \dfx canister id token )\""
  1. Check canister ID has been successfully saved:
echo $CANISTER_PUBLIC_KEY
  1. Transfer half a billion tokens to the canister Principal ID:
dfx canister call token transfer "($CANISTER_PUBLIC_KEY, 500_000_000)"

Note on frontend environment variables

If you are hosting frontend code somewhere without using DFX, you may need to make one of the following adjustments to ensure your project does not fetch the root key in production:

  • setNODE_ENV to production if you are using Webpack
  • use your own preferred method to replace process.env.NODE_ENV in the autogenerated declarations
  • Write your own createActor constructor

About

A simple financial app with DRavage tokens inspired from curve.fi 's classic UI. Didnt deploy the project since to deploy into ICP blockchain you require ICP tokens.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published