2021-08-12 09:58:13 +00:00
|
|
|
// SPDX-License-Identifier: AGPL-3.0
|
2021-06-15 10:16:39 +00:00
|
|
|
pragma solidity ^0.7.6;
|
2021-06-16 06:41:44 +00:00
|
|
|
|
|
|
|
// https://docs.soliditylang.org/en/v0.8.5/layout-of-source-files.html#abi-coder-pragma
|
2021-06-15 10:16:39 +00:00
|
|
|
pragma abicoder v2;
|
|
|
|
|
|
|
|
contract TestNestedArrays {
|
2021-06-16 12:12:51 +00:00
|
|
|
address[4][3] nestedAddressArray;
|
|
|
|
|
2021-06-15 10:16:39 +00:00
|
|
|
struct TestStruct {
|
|
|
|
uint256 uint1;
|
|
|
|
address address1;
|
|
|
|
}
|
|
|
|
|
|
|
|
TestStruct[3][5] nestedStructArray;
|
|
|
|
|
2021-06-16 12:12:51 +00:00
|
|
|
int128[3][] nestedFixedDynamicArray;
|
|
|
|
|
|
|
|
uint32[][4] nestedDynamicFixedArray;
|
|
|
|
|
|
|
|
int64[][] nestedDynamicArray;
|
|
|
|
|
2021-06-15 10:16:39 +00:00
|
|
|
// Set variable nestedStructArray.
|
|
|
|
function setNestedStructArray(uint index, uint nestedIndex, TestStruct calldata value) external {
|
|
|
|
nestedStructArray[index][nestedIndex] = value;
|
|
|
|
}
|
2021-06-16 12:12:51 +00:00
|
|
|
|
|
|
|
// Set variable nestedAddressArray.
|
|
|
|
function setNestedAddressArray(address[4][3] calldata value) external {
|
|
|
|
nestedAddressArray = value;
|
|
|
|
}
|
|
|
|
|
|
|
|
// Set variable nestedFixedDynamicArray.
|
|
|
|
function setNestedFixedDynamicArray(int128[3][] calldata value) external {
|
|
|
|
nestedFixedDynamicArray = value;
|
|
|
|
}
|
|
|
|
|
|
|
|
// Set variable nestedDynamicFixedArray.
|
|
|
|
function setNestedDynamicFixedArray(uint32[][4] memory value) external {
|
|
|
|
nestedDynamicFixedArray = value;
|
|
|
|
}
|
|
|
|
|
|
|
|
// Set variable nestedDynamicArray.
|
|
|
|
function setNestedDynamicArray(int64[][] memory value) external {
|
|
|
|
nestedDynamicArray = value;
|
|
|
|
}
|
2021-06-15 10:16:39 +00:00
|
|
|
}
|