Implementing the farming frontend
We have learned that the feature of yield farming is a specific type of staking that is used for LP tokens only. It can use the same smart contract as the staking tokens.
When implementing the frontend of farming, we can reuse the JavaScript files that we created previously by copying the files from src/frontend/features/Stake
into a new directory: src/frontend/features/Farm
, which accommodates farming frontend source files. Here are the six JavaScript files we copied for the farming frontend:
FarmRouter.js
: The React router components for the sub-routes of farming. It is copied fromStakeRouter.js
. You can refer to the source of this file at https://github.com/PacktPublishing/Building-Full-stack-DeFi-Application/blob/chapter10-end/defi-apps/src/frontend/features/Farm/FarmRouter.js.ListFarmingPools.js
: The farming pool listing dashboard page, which is copied fromListStakingPools.js
. It will show the farming pool information in each...