Try it Live
Run Opcode examples in the interactive playground
Opcode.isSwap()
Check if opcode is SWAP1-SWAP16.- Functional API
Parameters
opcode: BrandedOpcode- Opcode to check
Returns
boolean - True if SWAP1-SWAP16 (0x90-0x9F)
SWAP Operations
Exchange top with item at depth 1-16:- SWAP1 (0x90): Swap top with 2nd
- SWAP2 (0x91): Swap top with 3rd
- SWAP16 (0x9F): Swap top with 17th
Related
- swapPosition() - Get SWAP stack position

