Skip to content

Instantly share code, notes, and snippets.

@caseyjkey
Created April 21, 2020 04:36
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save caseyjkey/f6a736a93ebcdef141a72e584775711a to your computer and use it in GitHub Desktop.
Save caseyjkey/f6a736a93ebcdef141a72e584775711a to your computer and use it in GitHub Desktop.
ComplexStorage
pragma solidity >=0.4.21 <0.7.0;
contract ComplexStorage {
mapping (address => Group) public userToGroup;
Group[] public groupArray;
Group public singleGroup;
struct Group {
string name;
uint8 members;
}
constructor() public {
address address1 = 0x5EE68F3BFa0b2cc8b1bED1e457F6825466dd6221;
address address2 = 0xaee905FdD3ED851e48d22059575b9F4245A82B04;
userToGroup[address1] = Group("Pay Pals", 4);
userToGroup[address2] = Group("Hollowsesh", 3);
singleGroup = Group("808 Mafia", 15);
groupArray.push(userToGroup[address1]);
groupArray.push(userToGroup[address2]);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment