Skip to content

sun-blockchain/bonsai-chainlink

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

23 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Bonsai Chainlink

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

Bonsai Chainlink Dapp

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

  1. The browser UI (ReactJS + Redux)
  2. Web3.js Library
  3. Smart Contract Solidity
  4. Chainlink Oracle (Get price USD/ETH, USD/LINK, USD/DAI)

Ethereum Token Standard have used by app

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

Functionality

Bonsai Chainlink :

  1. Get price ETH, LINK, DAI follow USD price.
  2. Buy Oxygen token with ETH, LINK or DAI.
  3. Buy Bonsai from stock by Oxygen token.
  4. Planting Bonsai in the collection.
  5. After a certain period of time (2 minutes), each Bonsai will photosynthesize some oxygen.
  6. Transfer Bonsai to friend.

Future Function:

  1. Each Bonsai is growed from a seed (generate random from Verifiable Random Numbers of Chainlink). The seed determines the quality of the plant as well as other parameters such as growth rate and price (Legendary Bonsai or Normal Bonsai).

legendary bonsai

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

growing

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

Video Demo

demo

Live At (Ropsten testnet)

https://bonsai-chainlink.web.app

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-22 16-10-19

You would be received 3000 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-22 16-13-08

Screenshot from 2020-09-22 16-15-01

Tada !

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

Buy Oxygen with Token (Native Token or ERC20 Token)

Screenshot from 2020-09-24 16-11-29

With ETH

Screenshot from 2020-09-25 07-57-03

With LINK Token

  • Step1: Aprrove to smart contract Oxygen token.
  • Step2: Buy Oxygen with LINK.

Screenshot from 2020-09-24 16-11-41

Screenshot from 2020-09-24 16-19-08

With DAI Token

  • Step1: Aprrove to smart contract Oxygen token.
  • Step2: Buy Oxygen with DAI.

Screenshot from 2020-09-24 16-19-28

Screenshot from 2020-09-25 13-29-53

Transfer Bonsai To Friends

Screenshot from 2020-09-22 16-32-28

Screenshot from 2020-09-22 16-33-16

Move Position Of Bonsai

Screenshot from 2020-09-22 16-34-15

Screenshot from 2020-09-22 16-34-48

Screenshot from 2020-09-22 16-34-58

How to run project

cp .env.example .env

Add infor into .env

Deployment Ropsten

Deploy Contract

yarn install
yarn truffle migrate --network ropsten

Run UI

cd ui
cp .env.example .env
yarn install

Add infor into .env

yarn start

View in http://localhost:3000

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 4

  •  
  •  
  •  
  •