-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDatastorage.sol
More file actions
30 lines (24 loc) · 783 Bytes
/
Copy pathDatastorage.sol
File metadata and controls
30 lines (24 loc) · 783 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
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.10;
contract DataLLocations {
uint[] public arr;
mapping (uint => address) map;
struct MyStruct {
uint foo;
}
mapping (uint => MyStruct) myStructs;
function f() public {
_f(arr, map, myStructs[1]);
MyStruct storage myStruct = myStructs[1];
MyStruct memory myMemStruct = MyStruct(0);
}
function _f(uint[] storage _arr, mapping(uint => address) storage _map, MyStruct storage _myStruct) internal {
// do something with storage array
}
function g(uint[] memory _arr) public returns (uint[] memory) {
// do something with memory array
}
function h(uint[] calldata _arr) external {
// do something with calldata array
}
}