Rise In Logo





Build on BNB Chain - Course 3 | Smart Contract and dApp Development on BNB Chain

Part 1: Smart Contract Development

In this final project, you will be building a Safe Smart Contract on the BNB Chain. This contract will act as a secure vault for users to lock their tokens for a specified period, earning rewards over time. Each user will have a separate compartment within the contract, ensuring individualized security and reward calculation.

Features

  • Token Locking: Users can send tokens to the contract and lock them for a defined period.
  • Reward Calculation: The contract will calculate rewards based on the time the tokens are locked.
  • Individual Compartments: Each user will have a unique compartment within the contract, ensuring personalized security and reward management.

Requirements

  1. Token Locking Mechanism: Implement a function to allow users to send tokens to the contract and lock them for a specified duration.
  2. Reward Calculation: Develop a mechanism to calculate rewards based on the locking period. Note that the contract will only calculate rewards; it will not distribute them.
  3. User Compartments: Create individual compartments for each user within the contract to manage their tokens and rewards separately.
  4. Security Measures: Implement necessary security checks to ensure that only the owner of the tokens can lock, unlock, or query their compartment.
  5. Testing: Include comprehensive test cases to validate the correctness of your code.

You should be submitting the github repo links of the smart contracts you have written. You can access the sample read.me file via this link.  

Part 2: Frontend Development

The frontend of this project will provide a user-friendly interface to interact with the Safe Smart Contract. It will allow users to lock tokens, view their compartments, and see their calculated rewards.

Requirements

  1. Lock Tokens: Create a simple interface to allow users to send tokens to the contract and lock them for a specified duration.
  2. View Compartments: Implement a feature to enable users to view their individual compartments, including locked tokens and calculated rewards.
  3. Simple Design: The frontend should be simple and intuitive, focusing on demonstrating the functionality of the contract without unnecessary complexity.

Conclusion

The BNB Chain Safe Smart Contract project offers a practical and engaging way to explore smart contract development and frontend integration. By building a secure vault for token locking and reward calculation, you will gain hands-on experience with key concepts in blockchain development. Happy coding! ⌨️

Project

Rise In Logo

Rise together in web3