Lesson 1 of 0
In Progress

Assignment No. 2

Topic: Solidity

Solve the following questions honestly by yourself and submit your responses by 07-02-2024 by 10 pm.

1. Hello World Smart Contract:

  • Create a simple Solidity smart contract that prints “Hello, World!” when a function is called.

2. Variable Declaration and Initialization:

  • Declare and initialize different types of variables (uint, string, bool) within a smart contract.
  • Create a function to update and retrieve the values of these variables.

3. Simple Arithmetic Operations:

  • Write a smart contract that performs basic arithmetic operations (addition, subtraction, multiplication, division) on two numbers.

4. Conditional Statements:

  • Implement a smart contract with conditional statements (if, else) to check a condition and execute different code based on the result.

5. Loops:

  • Use loops (for, while) in a smart contract to perform a repetitive task, such as iterating through an array and updating values.

6. Arrays and Mapping:

  • Declare an array and a mapping in a smart contract.
  • Write functions to add, retrieve, and update elements in the array and the mapping.

7. Events and Logging:

  • Add an event to your smart contract and emit it at specific points in your code.
  • Create a front-end application (using tools like Remix) to listen to and display the emitted events.

8. Modifiers:

  • Define a modifier in your smart contract and use it to restrict access to certain functions based on a condition.

9. Inheritance:

  • Create a parent smart contract with common functionality and two child contracts that are inherited from the parent.
  • Add additional functionality to each child contract.

10. Smart Contract Interaction:

  • Deploy two separate smart contracts and make one contract call functions from the other.
  • Pass arguments between contracts and handle the returned values.

You cannot copy content of this page