Unit 5: Solidity - Subjective Questions

CSC307 — Blockchain Architecture And Design-I • Practice Questions with Detailed Answers

20 questions

1

What is Remix IDE? Explain the steps involved in accessing and setting up Remix IDE as an online Solidity development environment.

2

Describe the main panels and features of the Remix IDE interface that assist in smart contract development.

3

Define a token standard. Why are token standards important in the Ethereum ecosystem?

4

Explain the ERC-20 token standard in detail, listing its mandatory functions and events.

5

Explain the ERC-721 token standard and describe how it enables Non-Fungible Tokens (NFTs).

6

Distinguish between ERC-20 and ERC-721 token standards with suitable examples.

7

Explain the structure of a basic Solidity smart contract with an example illustrating state variables, constructor, and functions.

8

Describe the various data types available in Solidity with examples.

9

Explain function visibility specifiers in Solidity: public, private, internal, and external.

10

What are function modifiers in Solidity? Explain with an example how they are used to enforce access control.

11

Explain the concepts of require, assert, and revert in Solidity error handling. When should each be used?

12

What are events in Solidity? Explain their purpose and how they are used in smart contracts and user interfaces.

13

Explain the complete lifecycle of smart contract management from writing code to deployment and interaction. (10 marks)

14

Describe how a user interface (front-end) connects to and interacts with a smart contract. Explain the role of Web3.js/Ethers.js and the ABI.

15

Explain the difference between view, pure, and payable functions in Solidity with examples.

16

Write a simple ERC-20 token contract in Solidity (using OpenZeppelin) and explain each part. (10 marks)

17

Explain the concept of mapping in Solidity. How is it used to maintain account balances in a token contract?

18

What is inheritance in Solidity? Explain how contracts can inherit from one another with an example.

19

Explain the concept of gas in Ethereum. Why is gas important when managing and deploying smart contracts?

20

Discuss the common security vulnerabilities in Solidity smart contracts and best practices to prevent them. (10 marks)