Seismic Book
  • Welcome
  • introduction
    • Why
    • What
    • How
  • onboarding
    • Installation
    • Quickstart
    • Tutorial
      • Setting Up Your Walnut App Project
        • Verify devtool installation
        • Create project structure and monorepo workspace
        • Initialize the contracts subdirectory
        • Initialize the CLI subdirectory
      • Writing, testing and deploying the contract
        • Chapter 1: Making the Kernel
        • Chapter 2: Making the Shell and revealing the Kernel
        • Chapter 3: Reset Mechanism, Rounds, and a more conditional Kernel Reveal
        • Chapter 4: Testing your Walnut contract
        • Deploying your contract
      • Interacting with the contract via a CLI
        • Quick primer: seismic-viem
        • Chapter 1: Defining the constants and utilities
        • Chapter 2: Writing the core app
        • Chapter 3: Bringing it all together
      • Understanding the Walnut contract
  • core
    • Basics
      • suint / sint
      • saddress
      • sbool
    • Collections
    • Clients
  • Appendix
    • Devnet
Powered by GitBook

Contact us

  • Telegram
  • Twitter
  • Email
On this page
Export as PDF
  1. Appendix

Gotchas

  • conditional execution

  • dynamic loops

3.3 Literals and Enums

  • Be cautious when using literals and enums with shielded types. They can inadvertently leak information if not handled properly.

3.4 Exponentiation and Gas Costs

  • Using shielded integers as exponents in exponentiation operations can leak information through gas usage, as gas cost scales with the exponent value.

3.5 .min() and .max() Functions

  • Calling .min() and .max() on shielded integers can reveal information about their values.

3.6 immutable Variables

  • Shielded immutable variables are only truly confidential if the transaction calldata used during their instantiation is encrypted.

  • Avoid Public Exposure: Never expose shielded variables through public getters or events.

  • Careful with Gas Usage: Be mindful of operations where gas cost can vary based on shielded values (e.g., loops, exponentiation).

  • Encrypt Calldata: Ensure that any calldata used for initializing shielded immutable variables is encrypted.

  • Manual Slot Packing: If slot packing is necessary, use inline assembly carefully to avoid introducing vulnerabilities.

  • Review Compiler Warnings: Pay attention to compiler warnings related to shielded types to prevent accidental leaks.

Last updated 5 months ago