-
Notifications
You must be signed in to change notification settings - Fork 0
/
Functions.sol
32 lines (30 loc) · 947 Bytes
/
Functions.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
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;
contract Functions{
uint public luckyNumber =7; // Aşağıdki kod satırının yerine bunu kullanabiliriz
/*function showNumber()public view returns(uint){
return luckyNumber;
}*/
function setNumber(uint newNumber) public {
luckyNumber = newNumber;
}
function nothing() public pure returns(uint, bool, bool) {
return (5, true, false);
}
//nothing ve nothing2 benzer kullanımlara sahiptir
function nothing2() public pure returns(uint x, bool y, bool z) {
x = 5;
y = true;
z = false;
}
uint g=15;
function setG(uint k) public view returns(uint){
return g+k;
}
function add(uint a,uint b) public view returns(uint){
return a+b+block.timestamp;
}
function add2(uint a,uint b) public pure returns(uint){
return a+b;
}
}