{
  "id": 663,
  "title": "EIP-663: SWAPN, DUPN and EXCHANGE instructions",
  "status": "Stagnant",
  "type": "Standards Track",
  "category": "Core",
  "summary": "This adds three new EVM instructions (DUPN, SWAPN, and EXCHANGE) that allow smart contracts to access and manipulate stack items beyond the current 16-item limit, reaching up to 256 items deep. Currently, the EVM stack can hold 1024 items but only the top 16 are easily accessible. These new instructions help compilers write more efficient code for complex functions with many variables by providing better stack management capabilities. The feature only works with the new EOF bytecode format, not legacy contracts.",
  "impacts": [],
  "discussion_url": "https://ethereum-magicians.org/t/eip-663-unlimited-swap-and-dup-instructions/3346",
  "source_markdown_url": "https://github.com/ethereum/EIPs/blob/master/EIPS/eip-663.md",
  "canonical_url": "/latest/eips/663.json",
  "markdown_url": "/latest/eips/663.md",
  "citations": [
    {
      "recordId": "eip-663",
      "artifactPath": "normalized/663.json",
      "url": "/records/proposal/eip-663/normalized/663.json",
      "label": "EIP-663: SWAPN, DUPN and EXCHANGE instructions",
      "snippet": "This adds three new EVM instructions (DUPN, SWAPN, and EXCHANGE) that allow smart contracts to access and manipulate stack items beyond the current 16-item limit, reaching up to 256 items deep. Currently, the EVM stack c"
    }
  ]
}
