-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMyFirstContract.sol
58 lines (42 loc) · 1.05 KB
/
MyFirstContract.sol
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
pragma solidity ^0.8.11;
//pragma solidity >=0.6.0 <0.8.0;
/*line 1
line 2 */
contract MyFirstContract{
/*
int a;
int b=5;
uint x=10;
string Str="Wagmi";
bool condition;
address receiver="0x3a0a36C16136D0EEF403B049917b98DBac3F4463";
bytes abc;
uint arr[];
arr=[1,2,3,4];
uint arr1[5];
uint arr2[5]=[1,2,3,4,5];
arr2[3]//4
arr2.length
arr.push[55]
mapping(string => address) keypair;
enum jeansSize {S, M, L, XL, 10XL};
jeansSize.S
*/
uint x=50; // state variables
uint y=6;
uint[] arr;
uint[3] arr1=[1,2,3];
function myAddition() external view returns(uint){
uint insideFunction = 10; // local variables
return x+y;
// global variable (no example here)
}
/* three type of variables
1. state
2. local
3. global */
// 0xd9145CCE52D386f254917e481eB44e9943F39138
// 0xd8b934580fcE35a11B58C6D73aDeE468a2833fa8
// 0xf8e81D47203A594245E36C48e151709F0C19fBe8
// 0xD7ACd2a9FD159E69Bb102A1ca21C9a3e3A5F771B
}