Assignment: Build a staking dApp

Objective:

The objective of this assignment is to demonstrate your understanding of smart contracts and how to build a decentralized application using the Rust programming language and a frontend application.

Instructions:

Smart Contract:

  • Create a staking smart contract in the Rust programming language. The smart contract should have the following functionality:

    • Initial token issuance

    • Staking of tokens

    • Unstaking of tokens

    • Query the staking balance of an account

    • Distribution of rewards to stakers based on their staking balance

  • The smart contract should enforce the following constraints:

    • Limit the minimum and maximum amount of tokens that can be staked

    • Prevent unstaking before a certain period has passed

Frontend Application:

  • Build a frontend application in a JavaScript framework of your choice (e.g. React, Angular, Vue, etc.) to interact with the staking smart contract.

  • The application should have the following functionality:

    • Stake tokens

    • Unstake tokens

    • Display the staking balance of an account

    • Display the rewards earned by an account

Submission:

  • Submit the Rust code for the smart contract and the frontend application source code to the GitHub repository.

  • Include a short description of the design choices you made and any challenges you faced during the development process.

Last updated