hackquest logo
 

Yield Farming - Part 2

In Part 2 of the Yield Farming course, we will learn to implement basic functionalities for “Unlock Yield Farming”: reward, deposit, and withdraw.

Language

Solidity

Total Length

1.7h

Part of Learning Track

Build on Ethereum + 1

What You’ll Learn

Implementation of functionalities for “Unlock Yield Farming”, including deposit, reward distribution, and withdrawal.
deposit
reward
withdraw

Syllabus

Loan Library

In this section, we will learn how to create libraries with functionality for calculating interest.

Reward - Section 1

This section covers the collection of necessary parameters essential for the calculation of interest.

Reward - Section 2

We will explore creating an interest rate for unlocked deposits and establishing a mapping variable to record the corresponding time when users withdraw their interest.

Reward - Section 3

This section focuses on calculating the interest and ensuring its transfer to the user, a key aspect of financial management in this context.

Deposit - Section 1

We will explore how to settle interest to users and initiate the process of deposits, a crucial step in the management of financial transactions.

Deposit - Section 2

The section will guide you through updating the user’s account balance, an integral part of maintaining accurate financial records.

Withdraw - Section 1

This section is dedicated to checking the user’s account balance and updating it.

Withdraw - Section 2

Finally, we will learn how to transfer the withdrawal amount of tokens to the user, completing the cycle of token transactions.