Skip to content

Instantly share code, notes, and snippets.

@jsonMartin
Last active November 11, 2021 03:45
Show Gist options
  • Save jsonMartin/4d7780e406234b39d6120719689b13e6 to your computer and use it in GitHub Desktop.
Save jsonMartin/4d7780e406234b39d6120719689b13e6 to your computer and use it in GitHub Desktop.
Robotic.sol
contract Robotic {
// Each uint is tokenID in Items contract
// This Psuedocode example not optimized for memory, but can select smaller uint data types to conserve memory?
struct Robot { // uint refers to ERC-1155 tokenId
uint head;
uint leftArm;
uint rightArm;
uint legs;
uint torso;
uint background;
}
mapping (uint => Robot[]) public parentToChild; //parent id => Robot data structure for child items
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment