Skip to content

Instantly share code, notes, and snippets.

@jamesmorgan
Created March 3, 2023 10:54
Show Gist options
  • Save jamesmorgan/62d4825dff0ed05009016c6cb369f77a to your computer and use it in GitHub Desktop.
Save jamesmorgan/62d4825dff0ed05009016c6cb369f77a to your computer and use it in GitHub Desktop.
contract Structs {
struct Shipment {
// Slot 1: 20 bytes packed with bool (1 byte)
address receiver;
bool delivered;
// Slot 2: uint 8 + uint128 = 1 slot
uint8 typeCode;
uint128 price; (Max size: 170141183460469231731687303715884105727)
// String min 1 slot
string package;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment