Bonsai Exchange👋
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:
- The browser UI (ReactJS + Redux)
- ICON SDK for JavaScript
- SCORE (Python)
ICON Token Standard have used by app
- BonSai (IRC-3): Each Bonsai has id unique, name and price.
- Oxygen (IRC-2): Generate when user plant bonsai, use buy Bonsai.
Functionality
Bonsai Exchange :
- Buy bonsai from stock
- Planting bonsai in the collection.
- After a certain period of time (30 second), each bonsai will photosynthesize some oxygen.
- Transfer bonsai to friend.
Future:
- 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.
- It is possible to resell the bonsai you have planted
Video Demo
How to play
If you are beginer, you would go a tour with app
You would be received 30 Oxygen to buy first Bonsai
Let's buy
Sign transaction with ICONex extension
Tada !
Buy Oxygen by ICX
Transfer Bonsai To Friends
Move Position Of 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
- docker
- javascript
- python
- react-js
- redux
Log in or sign up for Devpost to join the conversation.