<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: AtharvSan</title>
    <description>The latest articles on DEV Community by AtharvSan (@atharvsan).</description>
    <link>https://dev.to/atharvsan</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F2132918%2F6ce193c3-235a-4572-9cea-07ba1be36bb5.png</url>
      <title>DEV Community: AtharvSan</title>
      <link>https://dev.to/atharvsan</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/atharvsan"/>
    <language>en</language>
    <item>
      <title>A sleek solidity cheatsheet</title>
      <dc:creator>AtharvSan</dc:creator>
      <pubDate>Sun, 30 Mar 2025 08:03:45 +0000</pubDate>
      <link>https://dev.to/atharvsan/a-sleek-solidity-cheatsheet-4b28</link>
      <guid>https://dev.to/atharvsan/a-sleek-solidity-cheatsheet-4b28</guid>
      <description>&lt;p&gt;part 1 of a 5 part series on essentials for solidity devs&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;solidity_cheatsheet.sol&lt;/li&gt;
&lt;li&gt;cryptography_cheatsheet.sol&lt;/li&gt;
&lt;li&gt;assembly_cheatsheet.sol&lt;/li&gt;
&lt;li&gt;designPatterns_cheatsheet.sol&lt;/li&gt;
&lt;li&gt;security_cheatsheet.sol&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;It compiles! &lt;a href="https://github.com/AtharvSan/solidity_cheatsheet/blob/main/src/solidity_cheatsheet.sol" rel="noopener noreferrer"&gt;Get the full cheatsheet here&lt;/a&gt;. Drop a star if you find this useful, it will motivate me to do more of it.&lt;/p&gt;

&lt;h2&gt;
  
  
  table of contents
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;basics

&lt;ul&gt;
&lt;li&gt;license&lt;/li&gt;
&lt;li&gt;pragma&lt;/li&gt;
&lt;li&gt;imports&lt;/li&gt;
&lt;li&gt;contract&lt;/li&gt;
&lt;li&gt;events&lt;/li&gt;
&lt;li&gt;constructor&lt;/li&gt;
&lt;li&gt;receive&lt;/li&gt;
&lt;li&gt;modifier&lt;/li&gt;
&lt;li&gt;functions&lt;/li&gt;
&lt;li&gt;symbols&lt;/li&gt;
&lt;li&gt;variables&lt;/li&gt;
&lt;li&gt;control sturctures&lt;/li&gt;
&lt;li&gt;units&lt;/li&gt;
&lt;li&gt;block&lt;/li&gt;
&lt;li&gt;msg&lt;/li&gt;
&lt;li&gt;tx&lt;/li&gt;
&lt;/ul&gt;


&lt;/li&gt;

&lt;li&gt;intermediate

&lt;ul&gt;
&lt;li&gt;OOPs&lt;/li&gt;
&lt;li&gt;library&lt;/li&gt;
&lt;li&gt;custom errors&lt;/li&gt;
&lt;li&gt;fallback&lt;/li&gt;
&lt;li&gt;variable passing&lt;/li&gt;
&lt;li&gt;value types&lt;/li&gt;
&lt;li&gt;reference types&lt;/li&gt;
&lt;li&gt;type conversion&lt;/li&gt;
&lt;li&gt;datatype builtins&lt;/li&gt;
&lt;li&gt;fringe arithmetic&lt;/li&gt;
&lt;/ul&gt;


&lt;/li&gt;

&lt;li&gt;advanced

&lt;ul&gt;
&lt;li&gt;function signatures and selectors&lt;/li&gt;
&lt;li&gt;abi encoding&lt;/li&gt;
&lt;li&gt;low level calls&lt;/li&gt;
&lt;li&gt;error handling&lt;/li&gt;
&lt;li&gt;bit operations&lt;/li&gt;
&lt;li&gt;bitmasking&lt;/li&gt;
&lt;/ul&gt;


&lt;/li&gt;

&lt;/ul&gt;

&lt;h2&gt;
  
  
  license
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;copyleft:

&lt;ul&gt;
&lt;li&gt;ensure that the software is free and open-source even in its derivative versions&lt;/li&gt;
&lt;li&gt;you use this when you do open source software and don't want to let someone else make it proprietary&lt;/li&gt;
&lt;li&gt;examples: GNU General Public License v3.0 (GPL-3.0)&lt;/li&gt;
&lt;/ul&gt;


&lt;/li&gt;

&lt;li&gt;permissive:

&lt;ul&gt;
&lt;li&gt;allows the software to be used in proprietary software&lt;/li&gt;
&lt;li&gt;you use this when you want maximum adoption with minimal legal overhead&lt;/li&gt;
&lt;li&gt;examples: MIT, Apache-2.0, BSD-3-Clause&lt;/li&gt;
&lt;/ul&gt;


&lt;/li&gt;

&lt;li&gt;implementaion: SPDX-License-Identifier: licence

&lt;ul&gt;
&lt;li&gt;Software Package Data Exchange (SPDX)&lt;/li&gt;
&lt;li&gt;this licence declaration is directly included in the source code as a commment
&lt;/li&gt;
&lt;/ul&gt;


&lt;/li&gt;

&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;// SPDX-License-Identifier : GPL-3.0
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  pragma
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;^version: means versions above this but below breaking changes version&lt;/li&gt;
&lt;li&gt;nothing before the version means just that one version
&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;pragma solidity ^0.8.20;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  imports
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;import "filename";

&lt;ul&gt;
&lt;li&gt;imports everything from that file&lt;/li&gt;
&lt;/ul&gt;


&lt;/li&gt;

&lt;li&gt;import {symbol1, symbol2} from "filename";

&lt;ul&gt;
&lt;li&gt;imports only the mentioned items&lt;/li&gt;
&lt;/ul&gt;


&lt;/li&gt;

&lt;li&gt;import {symbol1 as alias1, symbol2 as alias2} from "filename";
&lt;/li&gt;

&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;import "@openzeppelin/token/ERC20/utils/SafeERC20.sol";
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  OOPs
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;problem : large codebases are hard to manage&lt;/li&gt;
&lt;li&gt;solution : structure code into smaller packets.&lt;/li&gt;
&lt;li&gt;implementation

&lt;ul&gt;
&lt;li&gt;components: class, object, method, variables&lt;/li&gt;
&lt;li&gt;is: inherits contracts

&lt;ul&gt;
&lt;li&gt;contract A is B,C,D : B is most base, D is most derived&lt;/li&gt;
&lt;li&gt;C3 linearization right to left(D to B) to resolve conflicts in inheritance&lt;/li&gt;
&lt;/ul&gt;


&lt;/li&gt;

&lt;li&gt;constructor: order of execution from most base to most derived (B to D)&lt;/li&gt;

&lt;li&gt;visibility: public, internal, private, external&lt;/li&gt;

&lt;li&gt;abstract: when a function is missing definition&lt;/li&gt;

&lt;li&gt;super: call parent class definition&lt;/li&gt;

&lt;li&gt;this: the contract itself in which 'this' is invoked(contract type)&lt;/li&gt;

&lt;li&gt;virtual and override: manage polymorphism&lt;/li&gt;

&lt;/ul&gt;

&lt;/li&gt;

&lt;li&gt;properties

&lt;ul&gt;
&lt;li&gt;encapsulation: bundling everything to form a fully working entity&lt;/li&gt;
&lt;li&gt;abstraction: only expose what is required, rest is kept enclosed&lt;/li&gt;
&lt;li&gt;inheritance: acquiring properties from parents&lt;/li&gt;
&lt;li&gt;polymorphism: The ability to take multiple forms (method overloading &amp;amp; method overriding)&lt;/li&gt;
&lt;/ul&gt;


&lt;/li&gt;

&lt;li&gt;pros :

&lt;ul&gt;
&lt;li&gt;Code Reusability&lt;/li&gt;
&lt;li&gt;Modularity&lt;/li&gt;
&lt;li&gt;Security &amp;amp; Data Hiding&lt;/li&gt;
&lt;li&gt;Easy Maintenance &amp;amp; Scalability&lt;/li&gt;
&lt;/ul&gt;


&lt;/li&gt;

&lt;li&gt;trivia:

&lt;ul&gt;
&lt;li&gt;C3 linearization to resolve inheritance conflicts: inheritance from right to left in the 'is' statement&lt;/li&gt;
&lt;/ul&gt;


&lt;/li&gt;

&lt;/ul&gt;

&lt;h2&gt;
  
  
  library
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;implementation

&lt;ul&gt;
&lt;li&gt;cannot have state variables&lt;/li&gt;
&lt;li&gt;functions in library to have the first parameter as the 'datatype' on which to attach the library&lt;/li&gt;
&lt;/ul&gt;


&lt;/li&gt;

&lt;li&gt;libraries can be used in two methods 

&lt;ul&gt;
&lt;li&gt;using library for type : attaches library functions to the type&lt;/li&gt;
&lt;li&gt;library.method&lt;/li&gt;
&lt;/ul&gt;


&lt;/li&gt;

&lt;li&gt;trivia:

&lt;ul&gt;
&lt;li&gt;cannot inherit, nor be inherited&lt;/li&gt;
&lt;li&gt;inheritance doesnt bring using for statement from parent to child, need to write using for again in child.&lt;/li&gt;
&lt;li&gt;cannot recieve ether&lt;/li&gt;
&lt;li&gt;deployment:

&lt;ul&gt;
&lt;li&gt;libraries are deployed only when it contains external functions and called by delegatecall
&lt;/li&gt;
&lt;li&gt;else its code is embedded into the calling contract at compile time&lt;/li&gt;
&lt;/ul&gt;


&lt;/li&gt;

&lt;li&gt;the calling convention is designed like internal call not following the abi standard
&lt;/li&gt;

&lt;/ul&gt;

&lt;/li&gt;

&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;using SafeERC20 for IERC20;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  events
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;has normal params and indexed params(for quick searches)&lt;/li&gt;
&lt;li&gt;indexed topics are capped at max 3&lt;/li&gt;
&lt;li&gt;trivia:

&lt;ul&gt;
&lt;li&gt;Event logs are stored on blockchain but not accessible from within contracts not even from the contract that created them&lt;/li&gt;
&lt;li&gt;indexed are special params included in a seperate place called topics&lt;/li&gt;
&lt;li&gt;'indexed' arguments make it easy for searching and filtering through the logs
&lt;/li&gt;
&lt;/ul&gt;


&lt;/li&gt;

&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;event Log(string message);
event newOwner(address indexed owner);
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  custom errors
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;Cheaper gas costs (saves storage compared to string messages)&lt;/li&gt;
&lt;li&gt;More structured error messages.&lt;/li&gt;
&lt;li&gt;implementation

&lt;ul&gt;
&lt;li&gt;error certain_edge_case_messing_up();&lt;/li&gt;
&lt;li&gt;error certain_edge_case_messing_up_explained_with_args(args);&lt;/li&gt;
&lt;li&gt;revert certain_edge_case_messing_up();&lt;/li&gt;
&lt;li&gt;revert certain_edge_case_messing_up_explained_with_args(args);
&lt;/li&gt;
&lt;/ul&gt;


&lt;/li&gt;

&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;error amount_smaller_than_100(uint256 amount);
function custom_error(uint256 amount) public pure {
    if (amount&amp;lt; 100) {
        revert amount_smaller_than_100(amount);
    }
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  constructor
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;executes once during deployment &lt;/li&gt;
&lt;li&gt;can recieve ether during deployment&lt;/li&gt;
&lt;li&gt;its runtime code, not part of the contract&lt;/li&gt;
&lt;li&gt;constructor execution order: B -&amp;gt; C -&amp;gt; solidity_cheatsheet

&lt;ul&gt;
&lt;li&gt;most base to most derived
&lt;/li&gt;
&lt;/ul&gt;


&lt;/li&gt;

&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;constructor(/* args1, args2 */) /* B(args1) C(args2) */ payable {
    wingman = new Wingman();
    owner = msg.sender;
    emit newOwner(owner);
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  fallback
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;called when the contract is invoked with calldata, but function definition is absent&lt;/li&gt;
&lt;li&gt;this function has builtin definition and its very strict, only two variations allowed&lt;/li&gt;
&lt;li&gt;fallback() external [payable] {}&lt;/li&gt;
&lt;li&gt;fallback(bytes calldata input) external [payable] returns(bytes memory) {}&lt;/li&gt;
&lt;li&gt;trivia:

&lt;ul&gt;
&lt;li&gt;does not have a function signature
&lt;/li&gt;
&lt;/ul&gt;


&lt;/li&gt;

&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;fallback(bytes calldata _shipment) external payable returns(bytes memory){ 
    string memory payload = abi.decode(_shipment,(string));
    return bytes(string.concat(payload, "_done"));
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  receive
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;this function is called when the contract is invoked without calldata&lt;/li&gt;
&lt;li&gt;main purpose is to receive ETH&lt;/li&gt;
&lt;li&gt;this function has builtin definition, only one variation allowed&lt;/li&gt;
&lt;li&gt;receive() external payable {}&lt;/li&gt;
&lt;li&gt;its mostly kept empty&lt;/li&gt;
&lt;li&gt;trivia:

&lt;ul&gt;
&lt;li&gt;does not have a function signature
&lt;/li&gt;
&lt;/ul&gt;


&lt;/li&gt;

&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;receive() external payable {} 
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  modifier
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;a piece of code that generally contains some checks and is placed on top of a function&lt;/li&gt;
&lt;li&gt;modifiers can accept arguments&lt;/li&gt;
&lt;li&gt;function body represented by _ it can be included multiple times.&lt;/li&gt;
&lt;li&gt;Modifiers wrap around the function body using the special placeholder _ When multiple modifiers are applied, they execute in a nested manner:&lt;/li&gt;
&lt;li&gt;The first modifier runs until it reaches _.&lt;/li&gt;
&lt;li&gt;Control moves to the next modifier in the order they are listed.&lt;/li&gt;
&lt;li&gt;This continues until the function itself executes.&lt;/li&gt;
&lt;li&gt;Once the function completes, execution unwinds back up through the modifiers.
&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;modifier onlyOwner() {
    require(msg.sender == owner, "only owner can call this function");
    _;
}
modifier single_digit_value(uint256 _value) {
    require(_value &amp;lt; 10, "value should be less than 10");
    _;
}
function onlyOwnerFunction(uint256 value) view public onlyOwner single_digit_value(value) returns(string memory) {
    return "greetings to the owner";
}
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  functions
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;return variables can be used as any other local variable.&lt;/li&gt;
&lt;li&gt;members: .selector &lt;/li&gt;
&lt;li&gt;return: concludes the function execution generally returns some value.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  symbols
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;() --&amp;gt; functions, mapping, typecasting&lt;/li&gt;
&lt;li&gt;{} --&amp;gt; function blocks, struct blocks, conditional blocks, loop blocks&lt;/li&gt;
&lt;li&gt;[] --&amp;gt; arrays&lt;/li&gt;
&lt;li&gt;; --&amp;gt; end of statement&lt;/li&gt;
&lt;li&gt;: --&amp;gt; key value pair, array slicing, ternary operator&lt;/li&gt;
&lt;li&gt;, --&amp;gt; seperator&lt;/li&gt;
&lt;li&gt;. --&amp;gt; access&lt;/li&gt;
&lt;li&gt;- --&amp;gt; subtraction&lt;/li&gt;
&lt;li&gt;+ --&amp;gt; addition&lt;/li&gt;
&lt;li&gt;* --&amp;gt; multiplication&lt;/li&gt;
&lt;li&gt;/ --&amp;gt; division&lt;/li&gt;
&lt;li&gt;% --&amp;gt; modulo&lt;/li&gt;
&lt;li&gt;** --&amp;gt; power&lt;/li&gt;
&lt;li&gt;|| --&amp;gt; or&lt;/li&gt;
&lt;li&gt;&amp;amp;&amp;amp; --&amp;gt; and&lt;/li&gt;
&lt;li&gt;| --&amp;gt; bitwise or&lt;/li&gt;
&lt;li&gt;&amp;amp; --&amp;gt; bitwise and&lt;/li&gt;
&lt;li&gt;! --&amp;gt; not&lt;/li&gt;
&lt;li&gt;~ --&amp;gt; bitwise not&lt;/li&gt;
&lt;li&gt;^ --&amp;gt; bitwise xor&lt;/li&gt;
&lt;li&gt;&amp;lt;&amp;lt; --&amp;gt; left shift&lt;/li&gt;
&lt;li&gt;&amp;gt;&amp;gt; --&amp;gt; right shift&lt;/li&gt;
&lt;li&gt;== --&amp;gt; equal&lt;/li&gt;
&lt;li&gt;!= --&amp;gt; not equal&lt;/li&gt;
&lt;li&gt;&amp;lt; --&amp;gt; less than&lt;/li&gt;
&lt;li&gt;&amp;gt; --&amp;gt; greater than&lt;/li&gt;
&lt;li&gt;&amp;lt;= --&amp;gt; less than or equal&lt;/li&gt;
&lt;li&gt;&amp;gt;= --&amp;gt; greater than or equal&lt;/li&gt;
&lt;li&gt;= --&amp;gt; assignment&lt;/li&gt;
&lt;li&gt;+= --&amp;gt; addition assignment&lt;/li&gt;
&lt;li&gt;_ --&amp;gt; integer filler&lt;/li&gt;
&lt;li&gt;"" --&amp;gt; string&lt;/li&gt;
&lt;li&gt;'' --&amp;gt; string&lt;/li&gt;
&lt;li&gt;\ --&amp;gt; escape character&lt;/li&gt;
&lt;li&gt;// --&amp;gt; single line comment&lt;/li&gt;
&lt;li&gt;/// --&amp;gt; natspec comment&lt;/li&gt;
&lt;li&gt;/* */ --&amp;gt; multi line comment&lt;/li&gt;
&lt;li&gt;/**  */ --&amp;gt; multi line natspec comment&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  variables
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;life cycle of a variable

&lt;ul&gt;
&lt;li&gt;definition&lt;/li&gt;
&lt;li&gt;declaration&lt;/li&gt;
&lt;li&gt;assignment&lt;/li&gt;
&lt;li&gt;access&lt;/li&gt;
&lt;/ul&gt;


&lt;/li&gt;

&lt;li&gt;attributes

&lt;ul&gt;
&lt;li&gt;interpretation&lt;/li&gt;
&lt;li&gt;size&lt;/li&gt;
&lt;li&gt;type&lt;/li&gt;
&lt;li&gt;data location&lt;/li&gt;
&lt;li&gt;slot position&lt;/li&gt;
&lt;li&gt;behaviour&lt;/li&gt;
&lt;li&gt;visibility&lt;/li&gt;
&lt;li&gt;name&lt;/li&gt;
&lt;li&gt;value&lt;/li&gt;
&lt;/ul&gt;


&lt;/li&gt;

&lt;/ul&gt;

&lt;h2&gt;
  
  
  variable passing
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;pass by value: value copy pasted to new location, new variable (copy paste)&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;pass by reference: &lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;pass in same data location: nothing is copy pasted, instead a new name is given to the same location value pair (renaming)&lt;/li&gt;
&lt;li&gt;pass in different data location: pass by value&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;|   value   |&lt;br&gt;
 |-----------|&lt;br&gt;
 |  location |&lt;/p&gt;


&lt;/li&gt;

&lt;/ul&gt;

&lt;p&gt;name1 &lt;/p&gt;

&lt;h2&gt;
  
  
  data location
&lt;/h2&gt;

&lt;p&gt;bit level architecture, data location, inline assembly and gas costs covered in assembly cheatsheet.&lt;br&gt;
--- memory ---&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;structure : byte addressable array that reads and writes on 32 byte words&lt;/li&gt;
&lt;li&gt;trivia 

&lt;ul&gt;
&lt;li&gt;locally available, function scoped&lt;/li&gt;
&lt;li&gt;temporary existence, only for duration of tx&lt;/li&gt;
&lt;li&gt;cheap&lt;/li&gt;
&lt;/ul&gt;


&lt;/li&gt;

&lt;/ul&gt;

&lt;p&gt;--- storage ---&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;structure

&lt;ul&gt;
&lt;li&gt;mapping of 32-byte keys(storage-slots) to a 32-byte values&lt;/li&gt;
&lt;li&gt;storage slots start at slot 0&lt;/li&gt;
&lt;/ul&gt;


&lt;/li&gt;

&lt;li&gt;trivia

&lt;ul&gt;
&lt;li&gt;globally avilable&lt;/li&gt;
&lt;li&gt;permanent existance&lt;/li&gt;
&lt;li&gt;expensive &lt;/li&gt;
&lt;/ul&gt;


&lt;/li&gt;

&lt;/ul&gt;

&lt;p&gt;--- calldata ---&lt;br&gt;
samae as memory, but its read only&lt;/p&gt;

</description>
      <category>solidity</category>
      <category>cheatsheet</category>
      <category>foundry</category>
      <category>ethereum</category>
    </item>
  </channel>
</rss>
