Skip to content

Instantly share code, notes, and snippets.

@swkim109
Created July 15, 2022 08:30
Show Gist options
  • Save swkim109/8a824d7c13664f968ad63d9c7be4900e to your computer and use it in GitHub Desktop.
Save swkim109/8a824d7c13664f968ad63d9c7be4900e to your computer and use it in GitHub Desktop.
struct array
//SPDX-License-Identifier:MIT
pragma solidity ^0.8.0;
contract MyContract {
struct Member {
uint256 age;
string name;
}
struct StudyGroup {
uint256 groupId; // value 타입의 필드가 있어야 컴파일이 된다.
Member[] members;
}
StudyGroup[] public groups; // 구조체 배열의 원소가 다시 구조체를 nest하고 있는 경우
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment