{
  "id": 7912,
  "title": "EIP-7912: Pragmatic stack manipulation tools",
  "status": "Stagnant",
  "type": "Standards Track",
  "category": "Core",
  "summary": "This adds practical stack manipulation tools to the EVM without requiring the complex EOF format. It extends the existing SWAP and DUP instructions to reach deeper stack positions (up to 24 positions), adds dynamic SWAPN and DUPN instructions for variable depth access, and introduces an EXCHANGE instruction that can swap any two arbitrary stack positions. These tools help compilers generate more efficient code when dealing with complex functions that have many local variables, reducing gas costs and bytecode size. Unlike previous attempts that required new code formats, this proposal works with existing legacy contracts by requiring specific PUSH instructions before the dynamic operations, making it a pragmatic solution that provides better stack access without breaking backward compatibility.",
  "impacts": [],
  "discussion_url": "https://ethereum-magicians.org/t/eip-7912-pragmatic-expansion-of-stack-manipulation-tools/23826",
  "source_markdown_url": "https://github.com/ethereum/EIPs/blob/master/EIPS/eip-7912.md",
  "canonical_url": "/latest/eips/7912.json",
  "markdown_url": "/latest/eips/7912.md",
  "citations": [
    {
      "recordId": "eip-7912",
      "artifactPath": "normalized/7912.json",
      "url": "/records/proposal/eip-7912/normalized/7912.json",
      "label": "EIP-7912: Pragmatic stack manipulation tools",
      "snippet": "This adds practical stack manipulation tools to the EVM without requiring the complex EOF format. It extends the existing SWAP and DUP instructions to reach deeper stack positions (up to 24 positions), adds dynamic SWAPN"
    }
  ]
}
