[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"navigation":3,"url-settings":86,"blog-\u002Fblog\u002Funderstanding-structs-and-enums-in-solidity":671,"blog-author-\u002Fblog\u002Funderstanding-structs-and-enums-in-solidity":1207,"i-material-symbols:arrow-back-rounded":1219},{"id":4,"extension":5,"footer":6,"header":73,"meta":83,"stem":84,"__hash__":85},"navigation\u002Fdata\u002Fshared\u002Fnavigation.yml","yml",{"brand":7,"columns":13,"legal":63},{"name":8,"tagline":9,"downloadCta":10},"Pieces","The memory layer for modern work.",{"label":11,"href":12},"All downloads","\u002Fdownloads",[14,26,39,51],{"title":15,"links":16},"Product",[17,20,23],{"label":18,"href":19},"Pieces Desktop","\u002F",{"label":21,"href":22},"Pieces Enterprise","\u002Fenterprise",{"label":24,"href":25},"Pieces MCP","\u002Fmcp",{"title":27,"links":28},"Resources",[29,33,36],{"label":30,"href":31,"external":32},"Documentation","url:docs.home",true,{"label":34,"href":35},"Blog","\u002Fblog",{"label":37,"href":38,"external":32},"GitHub","url:github.org",{"title":40,"links":41},"Community",[42,45,48],{"label":43,"href":44,"external":32},"Discord","url:social.discord",{"label":46,"href":47,"external":32},"X \u002F Twitter","url:social.x",{"label":49,"href":50,"external":32},"LinkedIn","url:social.linkedin",{"title":52,"links":53},"Company",[54,57,60],{"label":55,"href":56},"About","\u002Fabout",{"label":58,"href":59},"Updates","\u002Fupdates",{"label":61,"href":62},"Contact","\u002Fcontact",[64,67,70],{"label":65,"href":66},"Privacy Policy","\u002Flegal\u002Fprivacy",{"label":68,"href":69},"Refund Policy","\u002Flegal\u002Frefund",{"label":71,"href":72},"Terms of Service","\u002Flegal\u002Fterms",{"links":74,"signIn":75,"contact":78,"cta":80},[],{"label":76,"href":77},"Manage account","url:portal.home",{"label":79,"href":62},"Get in touch",{"label":81,"href":82},"Download","url:routes.downloads",{},"data\u002Fshared\u002Fnavigation","XlSALC7vYCXHcmcXnjJViwIZKsqnQWF4bn4o9RrcSBE",{"id":87,"extension":5,"links":88,"meta":668,"stem":669,"__hash__":670},"urlSettings\u002Fdata\u002Fshared\u002Furls.yml",[89,93,97,101,105,109,113,117,121,125,129,133,137,141,145,149,153,157,161,165,169,173,177,181,185,189,192,196,200,204,208,212,216,220,224,228,232,236,240,244,248,252,256,260,264,268,272,276,280,284,288,292,296,300,303,307,311,314,318,322,326,330,334,338,342,346,350,354,358,362,366,370,374,378,382,386,390,394,398,402,406,410,414,418,422,426,430,434,438,442,446,450,454,458,461,465,469,473,477,481,485,488,491,494,497,501,505,508,512,516,520,524,528,532,536,540,544,548,552,556,559,563,567,571,575,579,582,585,588,592,595,599,603,607,611,614,618,622,625,628,631,635,639,643,646,649,652,656,660,664],{"key":90,"label":91,"href":92},"downloads.desktop","Desktop download page","https:\u002F\u002Fdocs.pieces.app\u002Fproducts\u002Fdesktop\u002Fdownload",{"key":94,"label":95,"href":96},"downloads.macOS.dmgArm64","macOS DMG Apple Silicon","https:\u002F\u002Fbuilds.pieces.app\u002Fstages\u002Fproduction\u002Fpieces_for_x\u002Fdmg-arm64\u002Fdownload",{"key":98,"label":99,"href":100},"downloads.macOS.dmgIntel","macOS DMG Intel","https:\u002F\u002Fbuilds.pieces.app\u002Fstages\u002Fproduction\u002Fpieces_for_x\u002Fdmg\u002Fdownload",{"key":102,"label":103,"href":104},"downloads.macOS.pkg","macOS PKG","https:\u002F\u002Fbuilds.pieces.app\u002Fstages\u002Fproduction\u002Fmacos_packaging\u002Fpkg\u002Fdownload",{"key":106,"label":107,"href":108},"downloads.macOS.universal","Desktop macOS Universal","https:\u002F\u002Fbuilds.pieces.app\u002Fstages\u002Fproduction\u002Fpieces_for_x\u002Fmacos-universal\u002Fdownload",{"key":110,"label":111,"href":112},"downloads.macOS.pkgArm64","Desktop macOS PKG Apple Silicon","https:\u002F\u002Fbuilds.pieces.app\u002Fstages\u002Fproduction\u002Fmacos_packaging\u002Fpkg-pfd-arm64\u002Fdownload",{"key":114,"label":115,"href":116},"downloads.macOS.pkgIntel","Desktop macOS PKG Intel","https:\u002F\u002Fbuilds.pieces.app\u002Fstages\u002Fproduction\u002Fmacos_packaging\u002Fpkg-pfd\u002Fdownload",{"key":118,"label":119,"href":120},"downloads.windows.appinstaller","Windows App Installer","https:\u002F\u002Fbuilds.pieces.app\u002Fstages\u002Fproduction\u002Fappinstaller\u002Fpieces_for_x.appinstaller",{"key":122,"label":123,"href":124},"downloads.windows.exe","Windows EXE","https:\u002F\u002Fbuilds.pieces.app\u002Fstages\u002Fproduction\u002Fpieces_for_x\u002Fwindows-exe\u002Fdownload",{"key":126,"label":127,"href":128},"downloads.windows.msix","Windows MSIX","https:\u002F\u002Fbuilds.pieces.app\u002Fstages\u002Fproduction\u002Fpieces_for_x\u002Fwindows-msix\u002Fdownload",{"key":130,"label":131,"href":132},"downloads.windows.suiteManager","Windows Suite Manager","https:\u002F\u002Fbuilds.pieces.app\u002Fstages\u002Fproduction\u002Fpieces_suite_windows\u002Fappinstaller\u002Fdownload",{"key":134,"label":135,"href":136},"downloads.linux.flatpakRepo","Linux Flatpak repository","https:\u002F\u002Fbuilds.pieces.app\u002Fpieces-flatpak-repo\u002Fpieces-flatpak.flatpakrepo",{"key":138,"label":139,"href":140},"downloads.linux.snapDesktop","Linux Snap Desktop","https:\u002F\u002Fsnapcraft.io\u002Fpieces-for-developers",{"key":142,"label":143,"href":144},"downloads.linux.snapPiecesOS","Linux Snap PiecesOS","https:\u002F\u002Fsnapcraft.io\u002Fpieces-os",{"key":146,"label":147,"href":148},"downloads.linux.snap","Desktop Linux Snap package","https:\u002F\u002Fbuilds.pieces.app\u002Fstages\u002Fproduction\u002Fpieces_for_x\u002Fsnap\u002Fdownload",{"key":150,"label":151,"href":152},"downloads.piecesOS.macOS.dmgArm64","PiecesOS macOS DMG Apple Silicon","https:\u002F\u002Fbuilds.pieces.app\u002Fstages\u002Fproduction\u002Fos_server\u002Fdmg-arm64\u002Fdownload",{"key":154,"label":155,"href":156},"downloads.piecesOS.macOS.dmgIntel","PiecesOS macOS DMG Intel","https:\u002F\u002Fbuilds.pieces.app\u002Fstages\u002Fproduction\u002Fos_server\u002Fdmg\u002Fdownload",{"key":158,"label":159,"href":160},"downloads.piecesOS.macOS.universal","PiecesOS macOS Universal","https:\u002F\u002Fbuilds.pieces.app\u002Fstages\u002Fproduction\u002Fos_server\u002Fmacos-universal\u002Fdownload",{"key":162,"label":163,"href":164},"downloads.piecesOS.macOS.pkgArm64","PiecesOS macOS PKG Apple Silicon","https:\u002F\u002Fbuilds.pieces.app\u002Fstages\u002Fproduction\u002Fmacos_packaging\u002Fpkg-pos-launch-only-arm64\u002Fdownload",{"key":166,"label":167,"href":168},"downloads.piecesOS.macOS.pkgIntel","PiecesOS macOS PKG Intel","https:\u002F\u002Fbuilds.pieces.app\u002Fstages\u002Fproduction\u002Fmacos_packaging\u002Fpkg-pos-launch-only\u002Fdownload",{"key":170,"label":171,"href":172},"downloads.piecesOS.windows.appinstaller","PiecesOS Windows App Installer","https:\u002F\u002Fbuilds.pieces.app\u002Fstages\u002Fproduction\u002Fappinstaller\u002Fos_server.appinstaller",{"key":174,"label":175,"href":176},"downloads.piecesOS.windows.exe","PiecesOS Windows EXE","https:\u002F\u002Fbuilds.pieces.app\u002Fstages\u002Fproduction\u002Fos_server\u002Fwindows-exe\u002Fdownload",{"key":178,"label":179,"href":180},"downloads.piecesOS.windows.msix","PiecesOS Windows MSIX","https:\u002F\u002Fbuilds.pieces.app\u002Fstages\u002Fproduction\u002Fos_server\u002Fwindows-msix\u002Fdownload",{"key":182,"label":183,"href":184},"downloads.piecesOS.linux.snap","PiecesOS Linux Snap package","https:\u002F\u002Fbuilds.pieces.app\u002Fstages\u002Fproduction\u002Fos_server\u002Fsnap\u002Fdownload",{"key":186,"label":187,"href":188},"downloads.combined.macOS.appleSilicon","Combined macOS installer Apple Silicon","https:\u002F\u002Fbuilds.pieces.app\u002Fstages\u002Fproduction\u002Fmacos_packaging\u002Fpkg-arm64\u002Fdownload",{"key":190,"label":191,"href":104},"downloads.combined.macOS.intel","Combined macOS installer Intel",{"key":193,"label":194,"href":195},"downloads.guides.macOS","macOS installation guide","https:\u002F\u002Fdocs.pieces.app\u002Fproducts\u002Fmeet-pieces\u002Fmacos-installation-guide",{"key":197,"label":198,"href":199},"downloads.guides.windows","Windows installation guide","https:\u002F\u002Fdocs.pieces.app\u002Fproducts\u002Fmeet-pieces\u002Fwindows-installation-guide",{"key":201,"label":202,"href":203},"downloads.guides.linux","Linux installation guide","https:\u002F\u002Fdocs.pieces.app\u002Fproducts\u002Fmeet-pieces\u002Flinux-installation-guide",{"key":205,"label":206,"href":207},"downloads.guides.linuxFlatpak","Linux Flatpak installation guide","https:\u002F\u002Fdocs.pieces.app\u002Fproducts\u002Fmeet-pieces\u002Flinux-installation-guide\u002Fflatpak",{"key":209,"label":210,"href":211},"downloads.guides.linuxSnap","Linux Snap installation guide","https:\u002F\u002Fdocs.pieces.app\u002Fproducts\u002Fmeet-pieces\u002Flinux-installation-guide\u002Fsnap",{"key":213,"label":214,"href":215},"downloads.guides.piecesOS","PiecesOS manual installation","https:\u002F\u002Fdocs.pieces.app\u002Fproducts\u002Fcore-dependencies\u002Fpieces-os\u002Fmanual-installation",{"key":217,"label":218,"href":219},"extensions.chrome","Chrome extension","https:\u002F\u002Fchrome.google.com\u002Fwebstore\u002Fdetail\u002Fpieces-save-code-snippets\u002Figbgibhbfonhmjlechmeefimncpekepm",{"key":221,"label":222,"href":223},"extensions.firefox","Firefox add-on","https:\u002F\u002Faddons.mozilla.org\u002Fen-US\u002Ffirefox\u002Faddon\u002Fpieces-save-code-from-the-web\u002F",{"key":225,"label":226,"href":227},"extensions.edge","Edge add-on","https:\u002F\u002Fmicrosoftedge.microsoft.com\u002Faddons\u002Fdetail\u002Fpieces-save-code-snippet\u002Fhglfimcdgonaeeobjckfdabcldfidmim",{"key":229,"label":230,"href":231},"extensions.vscode","VS Code extension","https:\u002F\u002Fmarketplace.visualstudio.com\u002Fitems?itemName=MeshIntelligentTechnologiesInc.pieces-vscode",{"key":233,"label":234,"href":235},"extensions.visualStudio","Visual Studio extension","https:\u002F\u002Fmarketplace.visualstudio.com\u002Fitems?itemName=MeshIntelligentTechnologiesInc.PiecesVisualStudio",{"key":237,"label":238,"href":239},"extensions.jetbrains","JetBrains plugin","https:\u002F\u002Fplugins.jetbrains.com\u002Fplugin\u002F17328-pieces--save-search-share--reuse-code-snippets",{"key":241,"label":242,"href":243},"extensions.obsidian","Obsidian plugin","https:\u002F\u002Fobsidian.md\u002Fplugins?id=pieces-for-developers",{"key":245,"label":246,"href":247},"extensions.sublime","Sublime package","https:\u002F\u002Fpackagecontrol.io\u002Fpackages\u002FPieces",{"key":249,"label":250,"href":251},"extensions.neovim","Neovim plugin","https:\u002F\u002Fgithub.com\u002Fpieces-app\u002Fplugin_neo_vim",{"key":253,"label":254,"href":255},"extensions.jupyterlab","JupyterLab plugin","https:\u002F\u002Fgithub.com\u002Fpieces-app\u002Fjupyterlab-pieces",{"key":257,"label":258,"href":259},"extensions.cli","Pieces CLI","https:\u002F\u002Fpypi.org\u002Fproject\u002Fpieces-cli\u002F",{"key":261,"label":262,"href":263},"docs.home","Documentation home","https:\u002F\u002Fdocs.pieces.app",{"key":265,"label":266,"href":267},"docs.getStarted","Get started docs","https:\u002F\u002Fdocs.pieces.app\u002Fproducts\u002Fmeet-pieces",{"key":269,"label":270,"href":271},"docs.api","API docs","https:\u002F\u002Fdocs.pieces.app\u002Fapi",{"key":273,"label":274,"href":275},"docs.desktop.overview","Desktop overview","https:\u002F\u002Fdocs.pieces.app\u002Fproducts\u002Fdesktop",{"key":277,"label":278,"href":279},"docs.desktop.onboarding","Desktop onboarding","https:\u002F\u002Fdocs.pieces.app\u002Fproducts\u002Fdesktop\u002Fonboarding",{"key":281,"label":282,"href":283},"docs.desktop.timeline","Desktop timeline docs","https:\u002F\u002Fdocs.pieces.app\u002Fproducts\u002Fdesktop\u002Ftimeline",{"key":285,"label":286,"href":287},"docs.desktop.summaries","Desktop summaries docs","https:\u002F\u002Fdocs.pieces.app\u002Fproducts\u002Fdesktop\u002Fsingle-click-summaries",{"key":289,"label":290,"href":291},"docs.desktop.search","Desktop conversational search docs","https:\u002F\u002Fdocs.pieces.app\u002Fproducts\u002Fdesktop\u002Fconversational-search",{"key":293,"label":294,"href":295},"docs.desktop.drive","Desktop drive docs","https:\u002F\u002Fdocs.pieces.app\u002Fproducts\u002Fdesktop\u002Fdrive",{"key":297,"label":298,"href":299},"docs.desktop.account","Desktop account settings docs","https:\u002F\u002Fdocs.pieces.app\u002Fproducts\u002Fdesktop\u002Fconfiguration\u002Faccount",{"key":301,"label":302,"href":92},"docs.desktop.download","Desktop download docs",{"key":304,"label":305,"href":306},"docs.piecesOS.overview","PiecesOS overview docs","https:\u002F\u002Fdocs.pieces.app\u002Fproducts\u002Fcore-dependencies",{"key":308,"label":309,"href":310},"docs.piecesOS.details","PiecesOS details docs","https:\u002F\u002Fdocs.pieces.app\u002Fproducts\u002Fcore-dependencies\u002Fpieces-os",{"key":312,"label":313,"href":215},"docs.piecesOS.install","PiecesOS install docs",{"key":315,"label":316,"href":317},"docs.piecesOS.quickMenu","PiecesOS quick menu docs","https:\u002F\u002Fdocs.pieces.app\u002Fproducts\u002Fcore-dependencies\u002Fpieces-os\u002Fquick-menu",{"key":319,"label":320,"href":321},"docs.piecesOS.storage","On-device storage docs","https:\u002F\u002Fdocs.pieces.app\u002Fproducts\u002Fcore-dependencies\u002Fon-device-storage",{"key":323,"label":324,"href":325},"docs.piecesOS.troubleshooting","PiecesOS troubleshooting docs","https:\u002F\u002Fdocs.pieces.app\u002Fproducts\u002Fcore-dependencies\u002Fpieces-os\u002Ftroubleshooting",{"key":327,"label":328,"href":329},"docs.mcp.overview","MCP overview docs","https:\u002F\u002Fdocs.pieces.app\u002Fproducts\u002Fmcp",{"key":331,"label":332,"href":333},"docs.mcp.cursor","MCP Cursor docs","https:\u002F\u002Fdocs.pieces.app\u002Fproducts\u002Fmcp\u002Fcursor",{"key":335,"label":336,"href":337},"docs.mcp.vscode","MCP VS Code docs","https:\u002F\u002Fdocs.pieces.app\u002Fproducts\u002Fmcp\u002Fvs-code",{"key":339,"label":340,"href":341},"docs.mcp.claudeDesktop","MCP Claude Desktop docs","https:\u002F\u002Fdocs.pieces.app\u002Fproducts\u002Fmcp\u002Fclaude-desktop",{"key":343,"label":344,"href":345},"docs.mcp.claudeCode","MCP Claude Code docs","https:\u002F\u002Fdocs.pieces.app\u002Fproducts\u002Fmcp\u002Fclaude-code",{"key":347,"label":348,"href":349},"docs.mcp.claudeCowork","MCP Claude Cowork docs","https:\u002F\u002Fdocs.pieces.app\u002Fproducts\u002Fmcp\u002Fclaude-cowork",{"key":351,"label":352,"href":353},"docs.mcp.githubCopilot","MCP GitHub Copilot docs","https:\u002F\u002Fdocs.pieces.app\u002Fproducts\u002Fmcp\u002Fgithub-copilot",{"key":355,"label":356,"href":357},"docs.mcp.goose","MCP Goose docs","https:\u002F\u002Fdocs.pieces.app\u002Fproducts\u002Fmcp\u002Fgoose",{"key":359,"label":360,"href":361},"docs.mcp.windsurf","MCP Windsurf docs","https:\u002F\u002Fdocs.pieces.app\u002Fproducts\u002Fmcp\u002Fwindsurf",{"key":363,"label":364,"href":365},"docs.mcp.zed","MCP Zed docs","https:\u002F\u002Fdocs.pieces.app\u002Fproducts\u002Fmcp\u002Fzed",{"key":367,"label":368,"href":369},"docs.mcp.jetbrains","MCP JetBrains docs","https:\u002F\u002Fdocs.pieces.app\u002Fproducts\u002Fmcp\u002Fjetbrains-ides",{"key":371,"label":372,"href":373},"docs.mcp.continueDev","MCP Continue docs","https:\u002F\u002Fdocs.pieces.app\u002Fproducts\u002Fmcp\u002Fcontinue-dev",{"key":375,"label":376,"href":377},"docs.mcp.cline","MCP Cline docs","https:\u002F\u002Fdocs.pieces.app\u002Fproducts\u002Fmcp\u002Fcline",{"key":379,"label":380,"href":381},"docs.mcp.raycast","MCP Raycast docs","https:\u002F\u002Fdocs.pieces.app\u002Fproducts\u002Fmcp\u002Fraycast",{"key":383,"label":384,"href":385},"docs.mcp.rovoDevCli","MCP Rovo Dev CLI docs","https:\u002F\u002Fdocs.pieces.app\u002Fproducts\u002Fmcp\u002Frovo-dev-cli",{"key":387,"label":388,"href":389},"docs.mcp.openaiCodexCli","MCP OpenAI Codex CLI docs","https:\u002F\u002Fdocs.pieces.app\u002Fproducts\u002Fmcp\u002Fopenai-codex-cli",{"key":391,"label":392,"href":393},"docs.mcp.googleGeminiCli","MCP Google Gemini CLI docs","https:\u002F\u002Fdocs.pieces.app\u002Fproducts\u002Fmcp\u002Fgoogle-gemini-cli",{"key":395,"label":396,"href":397},"docs.mcp.amazonQ","MCP Amazon Q docs","https:\u002F\u002Fdocs.pieces.app\u002Fproducts\u002Fmcp\u002Famazon-q-developer",{"key":399,"label":400,"href":401},"docs.mcp.chatgptDev","MCP ChatGPT Developer Mode docs","https:\u002F\u002Fdocs.pieces.app\u002Fproducts\u002Fmcp\u002Fchatgpt-developer-mode",{"key":403,"label":404,"href":405},"docs.mcp.openclaw","MCP OpenClaw docs","https:\u002F\u002Fdocs.pieces.app\u002Fproducts\u002Fmcp\u002Fopenclaw",{"key":407,"label":408,"href":409},"docs.mcp.mcpRemote","MCP Remote docs","https:\u002F\u002Fdocs.pieces.app\u002Fproducts\u002Fmcp\u002Fmcp-remote",{"key":411,"label":412,"href":413},"docs.mcp.ngrok","MCP ngrok docs","https:\u002F\u002Fdocs.pieces.app\u002Fproducts\u002Fmcp\u002Fngrok-setup",{"key":415,"label":416,"href":417},"docs.troubleshooting.macOS","macOS troubleshooting docs","https:\u002F\u002Fdocs.pieces.app\u002Fproducts\u002Fmeet-pieces\u002Ftroubleshooting\u002Fmacos",{"key":419,"label":420,"href":421},"docs.troubleshooting.windows","Windows troubleshooting docs","https:\u002F\u002Fdocs.pieces.app\u002Fproducts\u002Fmeet-pieces\u002Ftroubleshooting\u002Fwindows",{"key":423,"label":424,"href":425},"docs.troubleshooting.linux","Linux troubleshooting docs","https:\u002F\u002Fdocs.pieces.app\u002Fproducts\u002Fmeet-pieces\u002Ftroubleshooting\u002Flinux",{"key":427,"label":428,"href":429},"docs.privacy","Privacy and security docs","https:\u002F\u002Fdocs.pieces.app\u002Fproducts\u002Fprivacy-security-your-data",{"key":431,"label":432,"href":433},"docs.support","Support docs","https:\u002F\u002Fdocs.pieces.app\u002Fproducts\u002Fsupport",{"key":435,"label":436,"href":437},"portal.home","Pieces portal","https:\u002F\u002Fportal.pieces.app",{"key":439,"label":440,"href":441},"site.home","Website home","https:\u002F\u002Fpieces.app",{"key":443,"label":444,"href":445},"site.about","About page","https:\u002F\u002Fpieces.app\u002Fabout",{"key":447,"label":448,"href":449},"site.features","Features page","https:\u002F\u002Fpieces.app\u002Ffeatures",{"key":451,"label":452,"href":453},"site.plugins","Plugins page","https:\u002F\u002Fpieces.app\u002Fplugins",{"key":455,"label":456,"href":457},"site.contact","Contact page","https:\u002F\u002Fpieces.app\u002Fcontact",{"key":459,"label":58,"href":460},"site.updates","https:\u002F\u002Fpieces.app\u002Fupdates",{"key":462,"label":463,"href":464},"site.news","News","https:\u002F\u002Fpieces.app\u002Fnews",{"key":466,"label":467,"href":468},"site.events","Community events","https:\u002F\u002Fpieces.app\u002Fcommunity\u002Fevents",{"key":470,"label":471,"href":472},"site.userStories","User stories","https:\u002F\u002Fpieces.app\u002Fuser-stories",{"key":474,"label":475,"href":476},"site.academy","Academy","https:\u002F\u002Fpieces.app\u002Flearn\u002Facademy",{"key":478,"label":479,"href":480},"site.support","Website support","https:\u002F\u002Fpieces.app\u002Fsupport",{"key":482,"label":483,"href":484},"site.standup","Standup","https:\u002F\u002Fpieces.app\u002Fstandup",{"key":486,"label":34,"href":487},"site.blog","https:\u002F\u002Fcode.pieces.app\u002Fblog",{"key":489,"label":43,"href":490},"social.discord","https:\u002F\u002Fdiscord.gg\u002Fgetpieces",{"key":492,"label":46,"href":493},"social.x","https:\u002F\u002Fx.com\u002Fgetpieces",{"key":495,"label":496,"href":493},"social.twitter","Twitter",{"key":498,"label":499,"href":500},"social.instagram","Instagram","https:\u002F\u002Fwww.instagram.com\u002Fgetpieces\u002F",{"key":502,"label":503,"href":504},"social.tiktok","TikTok","https:\u002F\u002Fwww.tiktok.com\u002F@getpieces",{"key":506,"label":49,"href":507},"social.linkedin","https:\u002F\u002Fwww.linkedin.com\u002Fcompany\u002Fgetpieces\u002F",{"key":509,"label":510,"href":511},"social.youtube","YouTube","https:\u002F\u002Fyoutube.com\u002F@getpieces",{"key":513,"label":514,"href":515},"github.org","GitHub organization","https:\u002F\u002Fgithub.com\u002Fpieces-app",{"key":517,"label":518,"href":519},"github.support","GitHub support","https:\u002F\u002Fgithub.com\u002Fpieces-app\u002Fsupport",{"key":521,"label":522,"href":523},"github.issues","GitHub issues","https:\u002F\u002Fgithub.com\u002Fpieces-app\u002Fsupport\u002Fissues",{"key":525,"label":526,"href":527},"github.discussions","GitHub discussions","https:\u002F\u002Fgithub.com\u002Fpieces-app\u002Fsupport\u002Fdiscussions",{"key":529,"label":530,"href":531},"github.documentation","GitHub documentation","https:\u002F\u002Fgithub.com\u002Fpieces-app\u002Fdocumentation",{"key":533,"label":534,"href":535},"github.opensource","GitHub open source","https:\u002F\u002Fgithub.com\u002Fpieces-app\u002Fopensource",{"key":537,"label":538,"href":539},"github.sdks.python","Python SDK","https:\u002F\u002Fgithub.com\u002Fpieces-app\u002Fpieces-os-client-sdk-for-python",{"key":541,"label":542,"href":543},"github.sdks.typescript","TypeScript SDK","https:\u002F\u002Fgithub.com\u002Fpieces-app\u002Fpieces-os-client-sdk-for-typescript",{"key":545,"label":546,"href":547},"github.sdks.dart","Dart SDK","https:\u002F\u002Fgithub.com\u002Fpieces-app\u002Fpieces-os-client-sdk-for-dart",{"key":549,"label":550,"href":551},"github.sdks.kotlin","Kotlin SDK","https:\u002F\u002Fgithub.com\u002Fpieces-app\u002Fpieces-os-client-sdk-for-kotlin",{"key":553,"label":554,"href":555},"github.plugins.obsidian","Obsidian plugin repository","https:\u002F\u002Fgithub.com\u002Fpieces-app\u002Fobsidian-pieces",{"key":557,"label":558,"href":255},"github.plugins.jupyterlab","JupyterLab plugin repository",{"key":560,"label":561,"href":562},"github.plugins.sublime","Sublime plugin repository","https:\u002F\u002Fgithub.com\u002Fpieces-app\u002Fplugin_sublime",{"key":564,"label":565,"href":566},"github.plugins.neovim","Neovim plugin repository","https:\u002F\u002Fgithub.com\u002Fpieces-app\u002Fplugin_neovim",{"key":568,"label":569,"href":570},"github.cliAgent","CLI agent repository","https:\u002F\u002Fgithub.com\u002Fpieces-app\u002Fcli-agent",{"key":572,"label":573,"href":574},"github.mcpDart","MCP Dart repository","https:\u002F\u002Fgithub.com\u002Fpieces-app\u002Fmcp_dart",{"key":576,"label":577,"href":578},"github.awesomePieces","Awesome Pieces repository","https:\u002F\u002Fgithub.com\u002Fpieces-app\u002Fawesome-pieces",{"key":580,"label":581,"href":66},"legal.privacyPolicy","Privacy policy",{"key":583,"label":584,"href":69},"legal.refundPolicy","Refund policy",{"key":586,"label":587,"href":72},"legal.terms","Terms",{"key":589,"label":590,"href":591},"legal.security","Legal security","https:\u002F\u002Fpieces.app\u002Flegal\u002Fsecurity",{"key":593,"label":594,"href":511},"videos.youtubeChannel","YouTube channel",{"key":596,"label":597,"href":598},"videos.gettingStartedDesktop","Getting started desktop video","https:\u002F\u002Fyoutu.be\u002FdUr1lRM_TYk",{"key":600,"label":601,"href":602},"videos.snippetDiscoveryxR","Snippet discovery video","https:\u002F\u002Fyoutu.be\u002FG6vb1USw-30",{"key":604,"label":605,"href":606},"sales.bookACall","Book a sales call","https:\u002F\u002Fcalendar.app.google\u002FWVUDtUfNy5Vst3sH7",{"key":608,"label":609,"href":610},"sales.enterprise","Enterprise form","https:\u002F\u002Fgetpieces.typeform.com\u002Fto\u002FaVQFTvpE",{"key":612,"label":613,"href":527},"sales.feedback","Feedback discussions",{"key":615,"label":616,"href":617},"sales.earlyAccess","Early access form","https:\u002F\u002Fgetpieces.typeform.com\u002Fearlyaccess",{"key":619,"label":620,"href":621},"sales.supportEmail","Support email","mailto:support@pieces.app",{"key":623,"label":624,"href":19},"routes.home","Home route",{"key":626,"label":627,"href":56},"routes.about","About route",{"key":629,"label":630,"href":12},"routes.downloads","Downloads route",{"key":632,"label":633,"href":634},"routes.thanks","Post-install thanks route","\u002Finstall\u002Fthanks",{"key":636,"label":637,"href":638},"routes.pricing","Pricing route","\u002Fpricing",{"key":640,"label":641,"href":642},"cta.freeTrial","Start free trial CTA (Pieces Pro) — used by \u002Fcampaigns\u002F* landing pages","https:\u002F\u002Fcampaigns.pieces.app\u002F",{"key":644,"label":645,"href":22},"routes.enterprise","Enterprise route",{"key":647,"label":648,"href":62},"routes.contact","Contact route",{"key":650,"label":651,"href":59},"routes.updates","Updates route",{"key":653,"label":654,"href":655},"routes.migrationError","Migration error route","\u002Fmigration\u002Ferror",{"key":657,"label":658,"href":659},"routes.authenticated","Post-login authenticated route","\u002Fauth\u002Fsigned-in",{"key":661,"label":662,"href":663},"routes.signed-out","Signed out route","\u002Fauth\u002Fsigned-out",{"key":665,"label":666,"href":667},"routes.authentication-error","Authentication error route","\u002Fauth\u002Ferror",{},"data\u002Fshared\u002Furls","2AvfSWI6bZACH5Kr1ZS3txMLjteRjCjbDR_ul1uRZ9Q",{"id":672,"title":673,"author":674,"authorPhoto":675,"authorPhotoAlt":676,"authorSlug":677,"body":678,"buttonText":1194,"buttonUrl":1194,"category":1195,"date":1196,"description":1197,"draft":1198,"editorsPick":1198,"extension":1199,"featured":1198,"image":1200,"imageAlt":1201,"meta":1202,"navigation":32,"ogImage":1194,"ogImageAlt":1194,"path":1203,"seo":1204,"stem":1205,"tags":1194,"__hash__":1206},"blog\u002Fblog\u002Funderstanding-structs-and-enums-in-solidity.md","Understanding Structs and Enums in Solidity","Sage Osoro","https:\u002F\u002Fstorage.googleapis.com\u002Fpieces-marketing-website\u002Fimages\u002Fblog\u002Funderstanding-structs-and-enums-in-solidity\u002Fauthor.png","Sage Osoro.","sage-osoro",{"type":679,"value":680,"toc":1175},"minimark",[681,685,688,693,704,711,714,725,728,734,737,743,750,756,759,764,767,809,813,816,822,826,829,835,838,844,847,853,856,862,865,871,875,882,893,899,908,914,920,926,929,935,941,945,948,954,958,961,967,970,976,983,987,994,1000,1003,1009,1015,1019,1026,1032,1038,1043,1046,1052,1055,1061,1063,1069,1075,1079,1090,1096,1114,1120,1126,1132,1141,1147,1153,1159,1168,1172],[682,683,684],"p",{},"Enums (Enumerables)are user-defined data types that restrict a variable to have only one predefined value from a set of multiple predefined values. Enums are assigned integer values starting from zero to the value of the last index.",[682,686,687],{},"In this article, I will explain how structs and enums work and how to use them.",[689,690,692],"h2",{"id":691},"getting-started","Getting Started",[682,694,695,696,703],{},"It will be best if you code along with me in order to best understand the material. Visit ",[697,698,702],"a",{"href":699,"rel":700},"http:\u002F\u002Fremix.ethereum.org\u002F",[701],"nofollow","remix.ethereum.org","— This online IDE is an excellent and easy-to-use environment for beginners. Go to the File Explorer tab, click on contracts and create a new file with your preferred name and “.sol” at the end. I will be using “StructsAndEnums.sol” as my file name:",[682,705,706],{},[707,708],"img",{"alt":709,"src":710},"The project's file explorer.","https:\u002F\u002Fstorage.googleapis.com\u002Fpieces-marketing-website\u002Fimages\u002Fblog\u002Funderstanding-structs-and-enums-in-solidity\u002Fimg-001.png",[682,712,713],{},"Now in the file, start by specifying the license identifier. License identifiers indicate relevant license information at any level from the package to the source code file level. Make sure you make it a comment:",[715,716,721],"pre",{"className":717,"code":719,"language":720},[718],"language-text","\u002F\u002F SPDX-License-Identifier: Unlicense\n","text",[722,723,719],"code",{"__ignoreMap":724},"",[682,726,727],{},"Specify the solidity compiler version you want to use:",[715,729,732],{"className":730,"code":731,"language":720},[718],"pragma solidity 0.8.0;\n",[722,733,731],{"__ignoreMap":724},[682,735,736],{},"Finally, create a contract by using the “contract” keyword and the name you wish to assign to the smart contract:",[715,738,741],{"className":739,"code":740,"language":720},[718],"contract StructsAndEnums{}\n",[722,742,740],{"__ignoreMap":724},[682,744,745,746,749],{},"This empty contract ",[722,747,748],{},"StructsAndEnums"," is already a valid contract and is deployable to any blockchain. Go to the Solidity Compiler tab, change the compiler version to the version you are working with and click compile. Once the compilation is successful, you should see a green checkmark by the side of the compiler icon:",[682,751,752],{},[707,753],{"alt":754,"src":755},"The Solidity compiler in an IDE.","https:\u002F\u002Fstorage.googleapis.com\u002Fpieces-marketing-website\u002Fimages\u002Fblog\u002Funderstanding-structs-and-enums-in-solidity\u002Fimg-002.png",[682,757,758],{},"Awesome! Now we can write all of our smart contract code into StructsAndEnums.",[760,761,763],"h3",{"id":762},"variable-types-in-solidity","Variable types in Solidity",[682,765,766],{},"Solidity has six main variable types. They are:",[768,769,770,779,785,791,797,803],"ol",{},[771,772,773,774,778],"li",{},"Strings - represented as ",[775,776,777],"strong",{},"string",".",[771,780,781,782,778],{},"Signed integers - represented as ",[775,783,784],{},"int",[771,786,787,788,778],{},"Unsigned integers - represented as ",[775,789,790],{},"uint",[771,792,793,794,778],{},"Booleans - represented as ",[775,795,796],{},"bool",[771,798,799,800,778],{},"Addresses - represented as ",[775,801,802],{},"address",[771,804,805,806,778],{},"Bytes - represented as ",[775,807,808],{},"bytes",[689,810,812],{"id":811},"how-to-declare-a-struct","How to declare a Struct",[682,814,815],{},"To declare a struct, start off by typing the struct keyword along with the name you wish to assign to the struct. Inside the struct, list out the different data types you want the struct to have. In the code snippet below, I have a struct named “Shipment” with some variable names and types in it:",[715,817,820],{"className":818,"code":819,"language":720},[718],"struct Shipment {\n    string package;\n    string state;\n    address sender;\n    address receiver;\n    uint price;\n bool delivered;\n}\n",[722,821,819],{"__ignoreMap":724},[760,823,825],{"id":824},"creating-struct-variables","Creating Struct variables",[682,827,828],{},"To create a struct variable, type in the name of the struct followed by the name of your variable. You will need to parse the values of the different data types of the struct into the variable. One way of doing this is by assigning the values according to the order of the data type in the struct like so:",[715,830,833],{"className":831,"code":832,"language":720},[718],"Shipment purchase = Shipment(\"Flash Drive\", \"Texas\", 0x5B38Da6a701c568545dCfcB03FcB875f56beddC4, 0x78731D3Ca6b7E34aC0F824c42a7cC18A495cabaB, 20, true);\n",[722,834,832],{"__ignoreMap":724},[682,836,837],{},"Another way is by assigning the values in any order with the key of the variable and the value:",[715,839,842],{"className":840,"code":841,"language":720},[718],"Shipment purchase = Shipment({price: 20, sender:0x5B38Da6a701c568545dCfcB03FcB875f56beddC4, package: \"Flash Drive\", delivered: true, receiver:0x78731D3Ca6b7E34aC0F824c42a7cC18A495cabaB});\n",[722,843,841],{"__ignoreMap":724},[682,845,846],{},"To see the variable, we have to assign it to the public keyword:",[715,848,851],{"className":849,"code":850,"language":720},[718],"Shipment public purchase = Shipment(\"Flash Drive\", \"Texas\", 0x5B38Da6a701c568545dCfcB03FcB875f56beddC4, 0x78731D3Ca6b7E34aC0F824c42a7cC18A495cabaB, 20, true);\n",[722,852,850],{"__ignoreMap":724},[682,854,855],{},"Let’s try and look into the variables stored in this struct variable called purchase. First, we have to deploy the contract. We will deploy to the remix virtual machine, a simulation used for tests by developers and not a live blockchain network. With any new changes we add to the smart contract, we will be deploying new contracts and deleting previous ones to see the changes. By nature, smart contracts are immutable and can never be edited after deployment. Go to the Deploy & run transactions tab at the bottom and click deploy.",[682,857,858],{},[707,859],{"alt":860,"src":861},"Running a transaction in an IDE.","https:\u002F\u002Fstorage.googleapis.com\u002Fpieces-marketing-website\u002Fimages\u002Fblog\u002Funderstanding-structs-and-enums-in-solidity\u002Fimg-003.png",[682,863,864],{},"After a successful deployment, at the bottom, you will find a Deployed Contracts section which holds the contract you just deployed. When you click on the dropdown, you will find the public variable called purchase we created earlier in our code. Click on the purchase button. Remix will return the variables stored in the purchase struct variable. Here’s what the output will look like:",[682,866,867],{},[707,868],{"alt":869,"src":870},"Viewing deployed contracts.","https:\u002F\u002Fstorage.googleapis.com\u002Fpieces-marketing-website\u002Fimages\u002Fblog\u002Funderstanding-structs-and-enums-in-solidity\u002Fimg-004.png",[760,872,874],{"id":873},"updating-struct-variables","Updating Struct variables",[682,876,877,878,881],{},"So we’ve created a struct and a struct variable, but what if we wanted to change certain things in that variable? What if we wanted to change the values inside the ",[722,879,880],{},"purchase"," variable from outside the contract? Let’s create a function that does just that.",[682,883,884,885,888,889,892],{},"Let’s name the function ",[722,886,887],{},"update"," and make it public. This function will take all of the variables needed by the struct variable. Variable types such as strings and bytes are stored in data locations. The keyword ",[722,890,891],{},"memory"," tells Solidity to temporarily store the input data of the string variable while a function is being called.",[715,894,897],{"className":895,"code":896,"language":720},[718],"function update (string memory _package, string memory _state, \n    address _sender, address _receiver, uint _price, bool _delivered) public{\n        purchase = Shipment(_package, _state, _sender, _receiver, _price, _delivered);\n}\n",[722,898,896],{"__ignoreMap":724},[682,900,901,902,904,905,907],{},"Once we compile and deploy this code, we should be able to see two buttons in the Deployed Contracts section. One of which is the ",[722,903,880],{}," struct variable and the ",[722,906,887],{}," function. If we click on purchase, we will see the variables from earlier:",[682,909,910],{},[707,911],{"alt":912,"src":913},"Updating a deployed contract.","https:\u002F\u002Fstorage.googleapis.com\u002Fpieces-marketing-website\u002Fimages\u002Fblog\u002Funderstanding-structs-and-enums-in-solidity\u002Fimg-005.png",[682,915,916,917,919],{},"We'll try and change these values. So by the right of the ",[722,918,887],{}," button, click on the dropdown icon, fill in your preferred values and click on transact:",[682,921,922],{},[707,923],{"alt":924,"src":925},"The newly requested contract details.","https:\u002F\u002Fstorage.googleapis.com\u002Fpieces-marketing-website\u002Fimages\u002Fblog\u002Funderstanding-structs-and-enums-in-solidity\u002Fimg-006.png",[682,927,928],{},"And, once we click on purchase again:",[682,930,931],{},[707,932],{"alt":933,"src":934},"A successfully purchased contract.","https:\u002F\u002Fstorage.googleapis.com\u002Fpieces-marketing-website\u002Fimages\u002Fblog\u002Funderstanding-structs-and-enums-in-solidity\u002Fimg-007.png",[682,936,937,938,940],{},"Sweet! We were able to change the values in ",[722,939,880],{}," successfully.",[689,942,944],{"id":943},"how-to-declare-an-enum","How to declare an Enum",[682,946,947],{},"To declare an enum, type in the enum keyword before the name you wish to assign to the enum. Enums are somewhat similar to booleans. The only difference between them is that booleans can only have two choices which are “0” (false) and “1” (true), while enums can have more than two choices. Let us see an example of an enum with four choices:",[715,949,952],{"className":950,"code":951,"language":720},[718],"enum Status {\n    None,\n    Pending,\n    Shipped,\n    Received\n}\n",[722,953,951],{"__ignoreMap":724},[760,955,957],{"id":956},"creating-enum-variables","Creating Enum variables",[682,959,960],{},"To assign a variable to an enum, similarly to what we did earlier with structs, we have the name of the enum in front of the variable and declare it public for us to see its value:",[715,962,965],{"className":963,"code":964,"language":720},[718],"Status public orderStatus;\n",[722,966,964],{"__ignoreMap":724},[682,968,969],{},"And when we compile and deploy this:",[682,971,972],{},[707,973],{"alt":974,"src":975},"Viewing the order status.","https:\u002F\u002Fstorage.googleapis.com\u002Fpieces-marketing-website\u002Fimages\u002Fblog\u002Funderstanding-structs-and-enums-in-solidity\u002Fimg-008.png",[682,977,978,979,982],{},"We get a value of 0 which is the first choice assigned to the enum (None). Enums always use the first case as the default. We could have also given a different choice to ",[722,980,981],{},"orderStatus"," and it would be assigned that value.",[760,984,986],{"id":985},"updating-enum-variables","Updating Enum variables",[682,988,989,990,993],{},"Let us use a function similar to the one we created for structs. The function will be called ",[722,991,992],{},"change"," and will take in a single parameter of type uint:",[715,995,998],{"className":996,"code":997,"language":720},[718],"function change(uint value) public {\n  orderStatus = Status(value);\n}\n",[722,999,997],{"__ignoreMap":724},[682,1001,1002],{},"And once we compile and deploy this:",[682,1004,1005],{},[707,1006],{"alt":1007,"src":1008},"The updated and deployed enum variables.","https:\u002F\u002Fstorage.googleapis.com\u002Fpieces-marketing-website\u002Fimages\u002Fblog\u002Funderstanding-structs-and-enums-in-solidity\u002Fimg-009.png",[682,1010,1011,1012,1014],{},"The value of ",[722,1013,981],{}," is now at the third index (2) which is \"Shipped\".",[689,1016,1018],{"id":1017},"using-an-enum-in-a-struct","Using an Enum in a Struct",[682,1020,1021,1022,1025],{},"Since a struct is a compilation of different data types, it can also take in enums. Let us replace the boolean variable called ",[722,1023,1024],{},"delivered"," with an enum:",[715,1027,1030],{"className":1028,"code":1029,"language":720},[718],"struct Shipment {\n  string package;\n  string state;\n  address sender;\n  address receiver;\n  uint price;\n  Status delivered;\n}\n",[722,1031,1029],{"__ignoreMap":724},[682,1033,1034,1035,1037],{},"Before compiling, let us make a few changes. Back in our ",[722,1036,880],{}," variable, change:",[715,1039,1041],{"className":1040,"code":850,"language":720},[718],[722,1042,850],{"__ignoreMap":724},[682,1044,1045],{},"To this:",[715,1047,1050],{"className":1048,"code":1049,"language":720},[718],"Shipment public purchase = Shipment(\"Flash Drive\", \"Texas\",0x5B38Da6a701c568545dCfcB03FcB875f56beddC4, 0x78731D3Ca6b7E34aC0F824c42a7cC18A495cabaB, 20, Status(0));\n",[722,1051,1049],{"__ignoreMap":724},[682,1053,1054],{},"Do the same for the update function. Change this:",[715,1056,1059],{"className":1057,"code":1058,"language":720},[718],"function update(string memory _package, string memory _state, \naddress _sender, address _receiver, uint _price, bool _delivered) public{\n    purchase = Shipment(_package, _state, _sender, _receiver, _price, _delivered);\n}\n",[722,1060,1058],{"__ignoreMap":724},[682,1062,1045],{},[715,1064,1067],{"className":1065,"code":1066,"language":720},[718],"function update(string memory _package, string memory _state, \naddress _sender, address _receiver, uint _price, Status _delivered) public{\n    purchase = Shipment(_package, _state, _sender, _receiver, _price, _delivered);\n}\n",[722,1068,1066],{"__ignoreMap":724},[682,1070,1071,1072,1074],{},"Now compile and deploy the contract. To input the value for the enum data type when calling the ",[722,1073,887],{}," function, type in the uint value for the choice you wish to use. For example, if we want the choice to be “Pending”, our input value has to be 1.",[760,1076,1078],{"id":1077},"storing-structs-and-enums-in-a-mapping","Storing Structs and Enums in a mapping",[682,1080,1081,1082,1085,1086,1089],{},"Mappings act like hash tables or dictionaries in other languages. We can use a mapping to store multiple data on the blockchain with a key. Mappings are more precise and also more efficient than arrays. We will keep the enum Status in the ",[722,1083,1084],{},"Shipment"," struct like we did previously but will be storing the struct in a mapping called ",[722,1087,1088],{},"getPurchase",". The key for the mapping will be the address of the sender and the value will be the data from the current Shipment struct tied to that address. To declare a mapping, type in the mapping keyword along with the key and value of the mapping in brackets and a name for the mapping at the end:",[715,1091,1094],{"className":1092,"code":1093,"language":720},[718],"mapping(address => Shipment) public getPurchase;\n",[722,1095,1093],{"__ignoreMap":724},[682,1097,1098,1099,1101,1102,1105,1106,1109,1110,1113],{},"In the ",[722,1100,887],{}," function, we will take in new struct variables as well as new changes made to existing struct variables and store them in the mapping. Let’s make the sender the actual sender of the transaction by changing ",[722,1103,1104],{},"_sender"," to the ",[722,1107,1108],{},"msg.sender"," keyword. After doing this, we will no longer need ",[722,1111,1112],{},"address _sender"," as a parameter in the function:",[715,1115,1118],{"className":1116,"code":1117,"language":720},[718],"function update(string memory _package, string memory _state, address _receiver, uint _price, Status _delivered) public{\n  purchase = Shipment(_package, _state, msg.sender, _receiver, _price, _delivered);\n  getPurchase[msg.sender] = purchase;\n}\n",[722,1119,1117],{"__ignoreMap":724},[682,1121,1122,1123,1125],{},"After we compile and deploy, let’s input new values to the ",[722,1124,887],{}," function:",[682,1127,1128],{},[707,1129],{"alt":1130,"src":1131},"Inputting new values to the update function.","https:\u002F\u002Fstorage.googleapis.com\u002Fpieces-marketing-website\u002Fimages\u002Fblog\u002Funderstanding-structs-and-enums-in-solidity\u002Fimg-010.png",[682,1133,1134,1135,1137,1138,1140],{},"Let’s look for the sender data in the ",[722,1136,1088],{}," mapping by inputting the address of ",[722,1139,1108],{}," as the key. To get your address, scroll to the top of the “Deploy & Run Transactions” tab, and you will see a list of virtual addresses created by remix:",[682,1142,1143],{},[707,1144],{"alt":1145,"src":1146},"Deploying and running remix transactions.","https:\u002F\u002Fstorage.googleapis.com\u002Fpieces-marketing-website\u002Fimages\u002Fblog\u002Funderstanding-structs-and-enums-in-solidity\u002Fimg-011.png",[682,1148,1149,1150,1152],{},"Copy the first address used to make the transaction and input that address to the ",[722,1151,1088],{}," mapping:",[682,1154,1155],{},[707,1156],{"alt":1157,"src":1158},"Using a new address to get a purchase address.","https:\u002F\u002Fstorage.googleapis.com\u002Fpieces-marketing-website\u002Fimages\u002Fblog\u002Funderstanding-structs-and-enums-in-solidity\u002Fimg-012.png",[682,1160,1161,1162,1164,1165,1167],{},"Great! All new and existing sender addresses that interact with the ",[722,1163,887],{}," function will also have their struct and enum data stored or updated in the mapping. To test this further, you can try switching to multiple account addresses at the top, interacting with the ",[722,1166,887],{}," function from each and inputting those addresses as the key to the mapping.",[689,1169,1171],{"id":1170},"conclusion","Conclusion",[682,1173,1174],{},"Structs and enums reduce complexity and make it easier for other developers to read and understand your code. Whenever you receive an error from your compiler that says, “Stack too deep. Try removing local variables,” it means that you’ve created too many local variables inside of a single function. Using a struct to store these local variables lets you get past that error. Using structs and enums is also great for optimization.",{"title":724,"searchDepth":1176,"depth":1176,"links":1177},2,[1178,1182,1186,1190,1193],{"id":691,"depth":1176,"text":692,"children":1179},[1180],{"id":762,"depth":1181,"text":763},3,{"id":811,"depth":1176,"text":812,"children":1183},[1184,1185],{"id":824,"depth":1181,"text":825},{"id":873,"depth":1181,"text":874},{"id":943,"depth":1176,"text":944,"children":1187},[1188,1189],{"id":956,"depth":1181,"text":957},{"id":985,"depth":1181,"text":986},{"id":1017,"depth":1176,"text":1018,"children":1191},[1192],{"id":1077,"depth":1181,"text":1078},{"id":1170,"depth":1176,"text":1171},null,"Software Development","2022-11-02T00:00:00.000Z","Structs allow you to create custom data types in Solidity. Enums restrict a variable to have only one value. Learn how to use them in this tutorial.",false,"md","https:\u002F\u002Fstorage.googleapis.com\u002Fpieces-marketing-website\u002Fimages\u002Fblog\u002Funderstanding-structs-and-enums-in-solidity\u002Fhero.jpeg","A rhombus connected to several other rhombuses.",{},"\u002Fblog\u002Funderstanding-structs-and-enums-in-solidity",{"title":673,"description":1197},"blog\u002Funderstanding-structs-and-enums-in-solidity","XNUIpiOOood_4y2UocR7wfrFeu5HQbZb-ctciYFOwl0",{"id":1208,"title":674,"body":1209,"description":724,"draft":1198,"extension":1199,"meta":1213,"navigation":32,"path":1214,"photo":1215,"photoAlt":1194,"seo":1216,"stem":1217,"__hash__":1218},"authors\u002Fauthors\u002Fsage-osoro.md",{"type":679,"value":1210,"toc":1211},[],{"title":724,"searchDepth":1176,"depth":1176,"links":1212},[],{},"\u002Fauthors\u002Fsage-osoro","https:\u002F\u002Fstorage.googleapis.com\u002Fpieces-marketing-website\u002Fimages\u002Fauthors\u002Fsage-osoro.jpg",{"title":674,"description":724},"authors\u002Fsage-osoro","eOzmqrF3uDwizDgwrjudaWbfCSJJ98Ie5kQcz6Uh-Bw",{"left":1220,"top":1220,"width":1221,"height":1221,"rotate":1220,"vFlip":1198,"hFlip":1198,"body":1222},0,24,"\u003Cpath fill=\"currentColor\" d=\"m7.825 13l4.9 4.9q.3.3.288.7t-.313.7q-.3.275-.7.288t-.7-.288l-6.6-6.6q-.15-.15-.213-.325T4.426 12t.063-.375t.212-.325l6.6-6.6q.275-.275.688-.275t.712.275q.3.3.3.713t-.3.712L7.825 11H19q.425 0 .713.288T20 12t-.288.713T19 13z\"\u002F>"]