This demonstrates the three important parts of a dapp and how they should be connected:
- The browser UI (ReactJS + Redux)
- Web3.js Library
- Smart Contract Solidity
- Chainlink Oracle (Get price USD/ETH, USD/LINK, USD/DAI)
Ethereum Token Standard have used by app
- BonSai (ERC-721): Each Bonsai has id unique, name and price.
- Oxygen (ERC-20): Generate when user plant Bonsai, use buy Bonsai.
Bonsai Chainlink :
- Get price ETH, LINK, DAI follow USD price.
- Buy Oxygen token with ETH, LINK or DAI.
- Buy Bonsai from stock by Oxygen token.
- Planting Bonsai in the collection.
- After a certain period of time (2 minutes), each Bonsai will photosynthesize some oxygen.
- Transfer Bonsai to friend.
Future Function:
- 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).
- 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.
- It is possible to resell the trees you have planted.
https://bonsai-chainlink.web.app
If you are beginer, you would go a tour with app
You would be received 3000 Oxygen to buy first Bonsai
Let's buy
Tada !
Buy Oxygen with Token (Native Token or ERC20 Token)
With ETH
With LINK Token
- Step1: Aprrove to smart contract Oxygen token.
- Step2: Buy Oxygen with LINK.
With DAI Token
- Step1: Aprrove to smart contract Oxygen token.
- Step2: Buy Oxygen with DAI.
Transfer Bonsai To Friends
Move Position Of Bonsai
cp .env.example .env
Add infor into .env
yarn install
yarn truffle migrate --network ropsten
cd ui
cp .env.example .env
yarn install
Add infor into .env
yarn start
View in http://localhost:3000