Tag: foundry

  1. Updated

    Demystifying Solidity ABI Encoding

    Category: Blockchain

    There are many encode functions in Solidity: abi.encode(), abi.encodePacked(), abi.encodeWithSignature(), and abi.encodeCall(). Which one to use, and when.

  2. Updated

    Solidity: Read Contract Storage by Slots with Foundry

    Category: Blockchain

    State variables are stored in different "slots" in a contract, and each slot is 32 bytes (256 bits). However, multiple adjacent state variables declared in the contract may be packed into the same slot by the Solidity compiler if their combined size does not exceed 32 bytes.