forked from murughan1985/solidity-language-examples
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathFunctions.sol
More file actions
33 lines (27 loc) · 722 Bytes
/
Functions.sol
File metadata and controls
33 lines (27 loc) · 722 Bytes
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
pragma solidity >=0.4.25 <0.6.0;
contract Functions
{
//View function type
string private message = "Welcome to Blockchain on AWS";
function ViewFunctionType() public view returns(string memory)
{
return message;
}
//Pure
function PureFunctionType() public pure returns(string memory)
{
return "Welcome to Blockchain on AWS";
}
//Payable
function GetBalance() public payable returns(uint) {
return msg.sender.balance;
}
}
//Calling a function from different contract
contract Caller
{
Functions func = new Functions();
function functionCall() public view returns (string memory) {
return func.ViewFunctionType();
}
}