Bonsai Exchange👋

Screenshot from 2020-09-08 09-33-35

Live At

https://bonsai-exchange.web.app

Bonsai Exchange Dapp

This demonstrates the three important parts of a dapp and how they should be connected:

  1. The browser UI (ReactJS + Redux)
  2. ICON SDK for JavaScript
  3. SCORE (Python)

ICON Token Standard have used by app

  1. BonSai (IRC-3): Each Bonsai has id unique, name and price.
  2. Oxygen (IRC-2): Generate when user plant bonsai, use buy Bonsai.

Functionality

Bonsai Exchange :

  1. Buy bonsai from stock
  2. Planting bonsai in the collection.
  3. After a certain period of time (30 second), each bonsai will photosynthesize some oxygen.
  4. Transfer bonsai to friend.

Future:

  1. The contract has the ability to update properties such as the life of a bonsai, which will display other forms of the bonsai such as sprouting, flowering, and fruiting.

growing

  1. It is possible to resell the bonsai you have planted

Video Demo

demo

How to play

If you are beginer, you would go a tour with app

Screenshot from 2020-09-10 08-49-44

Screenshot from 2020-09-10 08-53-32

You would be received 30 Oxygen to buy first Bonsai

Screenshot from 2020-09-10 08-42-20

receive-sucessfully

Let's buy

Screenshot from 2020-09-10 08-42-43

Screenshot from 2020-09-10 08-43-31

Sign transaction with ICONex extension

sign-transaction

Tada !

Screenshot from 2020-09-10 08-48-06

Buy Oxygen by ICX

Screenshot from 2020-09-10 08-53-47

Transfer Bonsai To Friends

Screenshot from 2020-09-10 08-56-34

Move Position Of Bonsai

button-move

move-bonsai

How to run project

mkdir keystores

Copy JSON file of keystore (download from wallet ICONex) to folder keystores

Deployment to local tbears instance

Deploy Bonsai Contract

tbears deploy bonsai -k keystores/keystore.json -c config/deploy_bonsai_local.json

Deploy SunCoin Contract

tbears deploy suncoin -k keystores/keystore.json -c config/deploy_oxygen_local.json

Check result transaction

tbears txresult [txHASH]

Copy the scoreAddress from the result

Deployment to testnet

Faucet ICX testnet

Deploy Bonsai Contract

tbears deploy bonsai -k keystores/keystore.json -c config/deploy_bonsai_testnet.json

Deploy Oxygen Contract

tbears deploy oxygen -k keystores/keystore.json -c config/deploy_oxygen_testnet.json

Update Bonsai contract

tbears deploy bonsai -m update -o [address contract] -k keystores/keystore2.json -c config/deploy_bonsai_testnet.json

Check transaction

tbears txresult <txhash> -c config/depoy_bonsai_testnet.json

With Docker

docker-compose up

Deploy Bonsai Score

docker-compose exec Icon tbears deploy bonsai -k keystores/keystore.json -c config/deploy_bonsai_testnet.json

Deploy Oxygen Score

docker-compose exec Icon tbears deploy oxygen -k keystores/keystore.json -c config/deploy_oxygen_testnet.json

Testnet tracker: https://bicon.tracker.solidwallet.io/ put the score address

Run UI

cd ui
cp .env.example .env
yarn

Copy my info of wallet to .env

yarn start

View in localhost:3000

Built With

Share this project:

Updates