Skip to content

Commit 8e7f87a

Browse files
committed
Added tutorial 23
1 parent 15ef951 commit 8e7f87a

File tree

2 files changed

+24
-0
lines changed

2 files changed

+24
-0
lines changed

README.md

+1
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@ The companion to the Youtube tutorials
2525
- [Learning Solidity : Tutorial 20 Parameter Mapping and Multiple Return Values](https://www.youtube.com/watch?v=v3aoiTh-UVQ)
2626
- [Learning Solidity : Tutorial 21 Truffle, Atom and TestRPC](https://www.youtube.com/watch?v=YcTSilIfih0)
2727
- [Learning Solidity : Tutorial 22 Developing an ICO/Crowdsale with TDD](https://www.youtube.com/watch?v=Cow_aL7NUGY)
28+
- [Learning Solidity : Tutorial 23 State Modifiers](https://www.youtube.com/watch?v=RKos31UueqY)
2829

2930
### Support
3031

tutorial-23/StateModifiers.sol

+23
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
pragma solidity ^0.4.0;
2+
3+
contract StateModifiers {
4+
uint private constant varConstantValue = 55;
5+
uint private stateValue;
6+
7+
function stateAccess() public returns (uint) {
8+
stateValue = 10;
9+
return stateValue;
10+
}
11+
12+
function constantAccess() public constant returns (uint) {
13+
return block.number;
14+
}
15+
16+
function viewAccess() public view returns (uint) {
17+
return stateValue;
18+
}
19+
20+
function pureAccess() public pure returns (uint) {
21+
return varConstantValue;
22+
}
23+
}

0 commit comments

Comments
 (0)