-
Notifications
You must be signed in to change notification settings - Fork 1
/
variables.cairo
45 lines (32 loc) · 1.67 KB
/
variables.cairo
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
############################################################################################################
# #
# Cairo #
# #
############################################################################################################
##### Setters #####
# storage variable
@storage_var
func storage_variable(i : felt):
end
storage_variable.write(1)
# local variable
func foo():
alloc_locals
local local_var = 1
return ()
end
# Temporary variables
tempvar var_name = 1
##### Getters #####
storage_variable.read()
############################################################################################################
# #
# Solidity #
# #
############################################################################################################
#### Setters #####
# global variables
bool public global_boolean = false;
address public global_address = 0x0000;
uint public global_integer = 1;
string public global_string = "global string";