0% found this document useful (0 votes)
52 views11 pages

Solidity Smart Contract Essentials

blockchain model questions

Uploaded by

mzmindykkyan
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
52 views11 pages

Solidity Smart Contract Essentials

blockchain model questions

Uploaded by

mzmindykkyan
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd

CSIT 6000Q- Blockchain and Smart Contracts

Question-related to important concepts in Solidity


November 25, 2023

1 Question 1
What is an Ethereum smart contract?

2 Question 2
What makes an Ethereum smart contract so special compared to other programs?

3 Question 3
Can a smart contract interact with other smart contracts?

4 Question 4
Can a Solidity smart contract call an API on the web?

5 Question 5
Can a Solidity smart contract store a lot of data?

6 Question 6
Can a smart contract be written in another language than Solidity?

7 Question 7
Is Solidity a dynamically or statically typed language? (i.e need to define variable types)

1
8 Question 8
Is Solidity a dynamically or statically typed language? (i.e need to define variable types)

9 Question 9
Is Solidity compiled or interpreted?

10 Question 10
What is the file extension of Solidity files?

11 Question 11
What is the typical layout of a Solidity smart contract?

12 Question 12
What is the typical layout of a Solidity smart contract?

13 Question 13
What is the problem with the following code

14 Question 14
What is the problem with the following code?

15 Question 15
What are the 2 variable visibilities for state variables in Solidity?

16 Question 16
Who can read private and public variables?

2
17 Question 17
What is the default visibility of state variables?

18 Question 18
Are private variables really private?

19 Question 19
How to deal with private data then?

20 Question 20
Mention 3 data types that you use often, and explain why?

21 Question 21
What are the 2 container types in Solidity?

22 Question 22
How to declare an array of integer in Solidity?

23 Question 23
How to declare a mapping of address to booleans in Solidity?

24 Question 24
How to declare a mapping of address to mapping of address to booleans (nested mapping)?

25 Question 25
How to declare a mapping of address to mapping of address to booleans (nested mapping)?

3
26 Question 26
How to add data to an array declared as a state variable?

27 Question 27
How to add data to a mapping declared as a state variable?

28 Question 28
How to loop through an array?

29 Question 29
What is the difference between a uint8 and a uint16?

30 Question 30
What are the 4 function visibilities in Solidity, by increasing permissiveness?

31 Question 31
How to conditionally throw an error, with an error message?

32 Question 32
What are the 2 artifacts produced by the Solidity compiler when compiling a smart contract?

33 Question 33
What is the ABI of a smart contract?

34 Question 34
In the following contract, which function will be part of the ABI?

4
35 Question 35
Does the EVM understands Solidity?

36 Question 36
What is the EVM bytecode?

37 Question 37
What are the 2 APIs used to interact with a smart contract?

38 Question 38
What is gas?

39 Question 39
How is gas paid?

40 Question 40
What happens if there is not enough gas in a transaction?

41 Question 41
Who pays for gas in a transaction?

42 Question 42
What do you need to deploy a smart contract to the Ethereum network?

43 Question 43
List 4 famous Ethereum wallets

5
44 Question 44
List 3 networks where you can deploy a Solidity smart contract

45 Question 45
List 3 networks where you can deploy a Solidity smart contract

46 Question 46
List 3 networks where you can deploy a Solidity smart contract

47 Question 47
How to manage dates in Solidity?

48 Question 48
How to have the current timestamp in seconds?

49 Question 49
What are the 2 ways to define custom data structure in Solidity?

50 Question 50
When would you use a struct vs an enum?

51 Question 51
What are the 2 ways to instantiate a struct?

52 Question 52
How to instantiate a struct that has an inner mapping?

6
53 Question 53
When would you use an array vs a mapping?

54 Question 54
How to combine array and mapping to allow both iteration and rapid lookup of a struct?

55 Question 55
How to define an in-memory array of 3 integers?

56 Question 56
How to add a value to an in-memory array?

57 Question 57
How to create an in-memory mapping?

58 Question 58
What happen if you try to access the key of a mapping that does not exist?

59 Question 59
What are the 3 mechanisms for code re-use in Solidity?

60 Question 61
How to make a contract A inherit from a contract B in Solidity?

61 Question 62
If A inherit from B, and both define the same function foo, which one will be resolved?

7
62 Question 63
What are the 4 memory locations of Solidity?

63 Question 62
If A inherit from B, and both define the same function foo, which one will be resolved?

64 Question 63
What is the default visibility of state variables?

65 Question 64
What is the difference between address and address payable?

66 Question 66
Is it necessary to make an address address payable to transfer ERC20 tokens?

67 Question 67
Give 3 ways to save gas

68 Question 68
How would optimally order uint128, bytes32 and another uint128 to save gas?

69 Question 69
How would optimally order uint128, bytes32 and another uint128 to save gas?

70 Question 70
How to concatenate 2 strings a, b?

8
71 Question 71
How to get the length of a string in solidity?

72 Question 72
How to to create a smart contract from a smart contract?

73 Question 73
How to to call another smart contract from a smart contract?

74 Question 74
How to get the address of a smart contract that was deployed from a smart contract?

75 Question 75
What will be the value of [Link] if a contract calls another one?

76 Question 76
How to transfer ERC20 tokens?

77 Question 77
How to declare and emit an event?

78 Question 78
What is the indexed keyword in event definition?

79 Question 79
Is it possible for a smart contract to read the events emitted before?

9
80 Question 80
Is it possible to delete or modify a past event?

81 Question 81
How would you implement access control without modifier?

82 Question 82
How would you implement access control WITH modifier?

83 Question 83
How to cancel a transaction?

84 Question 84
Is it possible to send a transaction without requiring users to pay gas?

85 Question 85
Which Solidity function would you use to verify a signature?

86 Question 86
What is a library in Solidity?

87 Question 87
Give an example of how to use a library in a smart contract

88 Question 88
When is a library embedded vs deployed?

10
89 Question 89
When is a library embedded vs deployed?

90 Question 90
What is a re-entrancy attack?

91 Question 91
How to prevent against a re-entrancy attack?

92 Question 92
How to produce a hash of multiple values in Solidity?

93 Question 93
How to generate a random integer in Solidity?

94 Question 94
How to generate a random integer in Solidity?

95 Question 95
How to declare assembly code?

96 Question 96
How to declare assembly code?

11

You might also like