Tips and tricks for learning Solidity, including using console.log, locking the pragma version, avoiding the Stack Too Deep error, splitting large contracts, reusing functions and structs, working with percentages, reading state variables, instantiating nested mappings, working with nested arrays, returning all elements in an array, iterating over a mapping, applying the principle of least privilege, validating external values, saving gas with events, using the uncheck keyword, understanding storage vs. stack variables, using keywords, choosing between mappings and arrays, and optimizing variable stacking.
Table of contents
Solidity Tips and TrickConsole LogSticky Pragma VersionStack Too Deep errorSmart contract getting too big?Reusing Functions and StructsPercentages in SolidityReading State variablesInstantiate Nested MappingsNested ArrayReturn all the elements in an arrayIterating over a MappingLeast PrivilegeNever trust external valuesGas savings using EventsUncheck keywordStorage vs StackKeywordsMappings vs ArraysVariable StackingConclusionSort: