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
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: