-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathFunctions.sol
More file actions
32 lines (25 loc) · 789 Bytes
/
Copy pathFunctions.sol
File metadata and controls
32 lines (25 loc) · 789 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
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.10;
contract Function {
function returnMany() public pure returns(uint, bool, uint) {
return (1, true, 2);
}
function named() public pure returns(uint x, bool b, uint y) {
return (1, true, 2);
}
function assigned() public pure returns(uint x, bool b, uint y) {
x = 1;
b = true;
y = 2;
}
function destructingAssignment() public pure returns(uint, bool, uint, uint, uint) {
(uint i, bool b, uint j) = returnMany();
(uint x, ,uint y) = (4,5,6);
return (i,b,j,x,y);
}
function arrayInput(uint [] memory _arr) public {}
uint[] public arr;
function arrayOutput() public view returns(uint[] memory) {
return arr;
}
}