evm-opcodes 0.2.0 → 0.3.0
raw patch · 7 files changed
+36/−18 lines, 7 filesdep ~bytestringdep ~containersPVP ok
version bump matches the API change (PVP)
Dependency ranges changed: bytestring, containers
API changes (from Hackage documentation)
+ EVM.Opcode: BLOBBASEFEE :: Opcode' j
+ EVM.Opcode: BLOBHASH :: Opcode' j
+ EVM.Opcode: MCOPY :: Opcode' j
+ EVM.Opcode: PUSH0 :: Opcode' j
+ EVM.Opcode: TLOAD :: Opcode' j
+ EVM.Opcode: TSTORE :: Opcode' j
+ EVM.Opcode.Internal: BLOBBASEFEE :: Opcode' j
+ EVM.Opcode.Internal: BLOBHASH :: Opcode' j
+ EVM.Opcode.Internal: MCOPY :: Opcode' j
+ EVM.Opcode.Internal: PUSH0 :: Opcode' j
+ EVM.Opcode.Internal: TLOAD :: Opcode' j
+ EVM.Opcode.Internal: TSTORE :: Opcode' j
- EVM.Opcode: pattern DUP1 :: forall j. Opcode' j
+ EVM.Opcode: pattern DUP1 :: Opcode' j
- EVM.Opcode: pattern DUP10 :: forall j. Opcode' j
+ EVM.Opcode: pattern DUP10 :: Opcode' j
- EVM.Opcode: pattern DUP11 :: forall j. Opcode' j
+ EVM.Opcode: pattern DUP11 :: Opcode' j
- EVM.Opcode: pattern DUP12 :: forall j. Opcode' j
+ EVM.Opcode: pattern DUP12 :: Opcode' j
- EVM.Opcode: pattern DUP13 :: forall j. Opcode' j
+ EVM.Opcode: pattern DUP13 :: Opcode' j
- EVM.Opcode: pattern DUP14 :: forall j. Opcode' j
+ EVM.Opcode: pattern DUP14 :: Opcode' j
- EVM.Opcode: pattern DUP15 :: forall j. Opcode' j
+ EVM.Opcode: pattern DUP15 :: Opcode' j
- EVM.Opcode: pattern DUP16 :: forall j. Opcode' j
+ EVM.Opcode: pattern DUP16 :: Opcode' j
- EVM.Opcode: pattern DUP2 :: forall j. Opcode' j
+ EVM.Opcode: pattern DUP2 :: Opcode' j
- EVM.Opcode: pattern DUP3 :: forall j. Opcode' j
+ EVM.Opcode: pattern DUP3 :: Opcode' j
- EVM.Opcode: pattern DUP4 :: forall j. Opcode' j
+ EVM.Opcode: pattern DUP4 :: Opcode' j
- EVM.Opcode: pattern DUP5 :: forall j. Opcode' j
+ EVM.Opcode: pattern DUP5 :: Opcode' j
- EVM.Opcode: pattern DUP6 :: forall j. Opcode' j
+ EVM.Opcode: pattern DUP6 :: Opcode' j
- EVM.Opcode: pattern DUP7 :: forall j. Opcode' j
+ EVM.Opcode: pattern DUP7 :: Opcode' j
- EVM.Opcode: pattern DUP8 :: forall j. Opcode' j
+ EVM.Opcode: pattern DUP8 :: Opcode' j
- EVM.Opcode: pattern DUP9 :: forall j. Opcode' j
+ EVM.Opcode: pattern DUP9 :: Opcode' j
- EVM.Opcode: pattern LOG0 :: forall j. Opcode' j
+ EVM.Opcode: pattern LOG0 :: Opcode' j
- EVM.Opcode: pattern LOG1 :: forall j. Opcode' j
+ EVM.Opcode: pattern LOG1 :: Opcode' j
- EVM.Opcode: pattern LOG2 :: forall j. Opcode' j
+ EVM.Opcode: pattern LOG2 :: Opcode' j
- EVM.Opcode: pattern LOG3 :: forall j. Opcode' j
+ EVM.Opcode: pattern LOG3 :: Opcode' j
- EVM.Opcode: pattern LOG4 :: forall j. Opcode' j
+ EVM.Opcode: pattern LOG4 :: Opcode' j
- EVM.Opcode: pattern SWAP1 :: forall j. Opcode' j
+ EVM.Opcode: pattern SWAP1 :: Opcode' j
- EVM.Opcode: pattern SWAP10 :: forall j. Opcode' j
+ EVM.Opcode: pattern SWAP10 :: Opcode' j
- EVM.Opcode: pattern SWAP11 :: forall j. Opcode' j
+ EVM.Opcode: pattern SWAP11 :: Opcode' j
- EVM.Opcode: pattern SWAP12 :: forall j. Opcode' j
+ EVM.Opcode: pattern SWAP12 :: Opcode' j
- EVM.Opcode: pattern SWAP13 :: forall j. Opcode' j
+ EVM.Opcode: pattern SWAP13 :: Opcode' j
- EVM.Opcode: pattern SWAP14 :: forall j. Opcode' j
+ EVM.Opcode: pattern SWAP14 :: Opcode' j
- EVM.Opcode: pattern SWAP15 :: forall j. Opcode' j
+ EVM.Opcode: pattern SWAP15 :: Opcode' j
- EVM.Opcode: pattern SWAP16 :: forall j. Opcode' j
+ EVM.Opcode: pattern SWAP16 :: Opcode' j
- EVM.Opcode: pattern SWAP2 :: forall j. Opcode' j
+ EVM.Opcode: pattern SWAP2 :: Opcode' j
- EVM.Opcode: pattern SWAP3 :: forall j. Opcode' j
+ EVM.Opcode: pattern SWAP3 :: Opcode' j
- EVM.Opcode: pattern SWAP4 :: forall j. Opcode' j
+ EVM.Opcode: pattern SWAP4 :: Opcode' j
- EVM.Opcode: pattern SWAP5 :: forall j. Opcode' j
+ EVM.Opcode: pattern SWAP5 :: Opcode' j
- EVM.Opcode: pattern SWAP6 :: forall j. Opcode' j
+ EVM.Opcode: pattern SWAP6 :: Opcode' j
- EVM.Opcode: pattern SWAP7 :: forall j. Opcode' j
+ EVM.Opcode: pattern SWAP7 :: Opcode' j
- EVM.Opcode: pattern SWAP8 :: forall j. Opcode' j
+ EVM.Opcode: pattern SWAP8 :: Opcode' j
- EVM.Opcode: pattern SWAP9 :: forall j. Opcode' j
+ EVM.Opcode: pattern SWAP9 :: Opcode' j
- EVM.Opcode.Internal: pattern DUP1 :: forall j. Opcode' j
+ EVM.Opcode.Internal: pattern DUP1 :: Opcode' j
- EVM.Opcode.Internal: pattern DUP10 :: forall j. Opcode' j
+ EVM.Opcode.Internal: pattern DUP10 :: Opcode' j
- EVM.Opcode.Internal: pattern DUP11 :: forall j. Opcode' j
+ EVM.Opcode.Internal: pattern DUP11 :: Opcode' j
- EVM.Opcode.Internal: pattern DUP12 :: forall j. Opcode' j
+ EVM.Opcode.Internal: pattern DUP12 :: Opcode' j
- EVM.Opcode.Internal: pattern DUP13 :: forall j. Opcode' j
+ EVM.Opcode.Internal: pattern DUP13 :: Opcode' j
- EVM.Opcode.Internal: pattern DUP14 :: forall j. Opcode' j
+ EVM.Opcode.Internal: pattern DUP14 :: Opcode' j
- EVM.Opcode.Internal: pattern DUP15 :: forall j. Opcode' j
+ EVM.Opcode.Internal: pattern DUP15 :: Opcode' j
- EVM.Opcode.Internal: pattern DUP16 :: forall j. Opcode' j
+ EVM.Opcode.Internal: pattern DUP16 :: Opcode' j
- EVM.Opcode.Internal: pattern DUP2 :: forall j. Opcode' j
+ EVM.Opcode.Internal: pattern DUP2 :: Opcode' j
- EVM.Opcode.Internal: pattern DUP3 :: forall j. Opcode' j
+ EVM.Opcode.Internal: pattern DUP3 :: Opcode' j
- EVM.Opcode.Internal: pattern DUP4 :: forall j. Opcode' j
+ EVM.Opcode.Internal: pattern DUP4 :: Opcode' j
- EVM.Opcode.Internal: pattern DUP5 :: forall j. Opcode' j
+ EVM.Opcode.Internal: pattern DUP5 :: Opcode' j
- EVM.Opcode.Internal: pattern DUP6 :: forall j. Opcode' j
+ EVM.Opcode.Internal: pattern DUP6 :: Opcode' j
- EVM.Opcode.Internal: pattern DUP7 :: forall j. Opcode' j
+ EVM.Opcode.Internal: pattern DUP7 :: Opcode' j
- EVM.Opcode.Internal: pattern DUP8 :: forall j. Opcode' j
+ EVM.Opcode.Internal: pattern DUP8 :: Opcode' j
- EVM.Opcode.Internal: pattern DUP9 :: forall j. Opcode' j
+ EVM.Opcode.Internal: pattern DUP9 :: Opcode' j
- EVM.Opcode.Internal: pattern LOG0 :: forall j. Opcode' j
+ EVM.Opcode.Internal: pattern LOG0 :: Opcode' j
- EVM.Opcode.Internal: pattern LOG1 :: forall j. Opcode' j
+ EVM.Opcode.Internal: pattern LOG1 :: Opcode' j
- EVM.Opcode.Internal: pattern LOG2 :: forall j. Opcode' j
+ EVM.Opcode.Internal: pattern LOG2 :: Opcode' j
- EVM.Opcode.Internal: pattern LOG3 :: forall j. Opcode' j
+ EVM.Opcode.Internal: pattern LOG3 :: Opcode' j
- EVM.Opcode.Internal: pattern LOG4 :: forall j. Opcode' j
+ EVM.Opcode.Internal: pattern LOG4 :: Opcode' j
- EVM.Opcode.Internal: pattern SHA3 :: forall j. Opcode' j
+ EVM.Opcode.Internal: pattern SHA3 :: Opcode' j
- EVM.Opcode.Internal: pattern SWAP1 :: forall j. Opcode' j
+ EVM.Opcode.Internal: pattern SWAP1 :: Opcode' j
- EVM.Opcode.Internal: pattern SWAP10 :: forall j. Opcode' j
+ EVM.Opcode.Internal: pattern SWAP10 :: Opcode' j
- EVM.Opcode.Internal: pattern SWAP11 :: forall j. Opcode' j
+ EVM.Opcode.Internal: pattern SWAP11 :: Opcode' j
- EVM.Opcode.Internal: pattern SWAP12 :: forall j. Opcode' j
+ EVM.Opcode.Internal: pattern SWAP12 :: Opcode' j
- EVM.Opcode.Internal: pattern SWAP13 :: forall j. Opcode' j
+ EVM.Opcode.Internal: pattern SWAP13 :: Opcode' j
- EVM.Opcode.Internal: pattern SWAP14 :: forall j. Opcode' j
+ EVM.Opcode.Internal: pattern SWAP14 :: Opcode' j
- EVM.Opcode.Internal: pattern SWAP15 :: forall j. Opcode' j
+ EVM.Opcode.Internal: pattern SWAP15 :: Opcode' j
- EVM.Opcode.Internal: pattern SWAP16 :: forall j. Opcode' j
+ EVM.Opcode.Internal: pattern SWAP16 :: Opcode' j
- EVM.Opcode.Internal: pattern SWAP2 :: forall j. Opcode' j
+ EVM.Opcode.Internal: pattern SWAP2 :: Opcode' j
- EVM.Opcode.Internal: pattern SWAP3 :: forall j. Opcode' j
+ EVM.Opcode.Internal: pattern SWAP3 :: Opcode' j
- EVM.Opcode.Internal: pattern SWAP4 :: forall j. Opcode' j
+ EVM.Opcode.Internal: pattern SWAP4 :: Opcode' j
- EVM.Opcode.Internal: pattern SWAP5 :: forall j. Opcode' j
+ EVM.Opcode.Internal: pattern SWAP5 :: Opcode' j
- EVM.Opcode.Internal: pattern SWAP6 :: forall j. Opcode' j
+ EVM.Opcode.Internal: pattern SWAP6 :: Opcode' j
- EVM.Opcode.Internal: pattern SWAP7 :: forall j. Opcode' j
+ EVM.Opcode.Internal: pattern SWAP7 :: Opcode' j
- EVM.Opcode.Internal: pattern SWAP8 :: forall j. Opcode' j
+ EVM.Opcode.Internal: pattern SWAP8 :: Opcode' j
- EVM.Opcode.Internal: pattern SWAP9 :: forall j. Opcode' j
+ EVM.Opcode.Internal: pattern SWAP9 :: Opcode' j
- EVM.Opcode.Traversal: OpcodeMapper :: (a -> m (Opcode' b)) -> (a -> m (Opcode' b)) -> (a -> m (Opcode' b)) -> (Opcode' a -> m (Maybe (Opcode' b))) -> OpcodeMapper m a b
+ EVM.Opcode.Traversal: OpcodeMapper :: (a -> m (Opcode' b)) -> (a -> m (Opcode' b)) -> (a -> m (Opcode' b)) -> (Opcode' a -> m (Maybe (Opcode' b))) -> OpcodeMapper (m :: Type -> Type) a b
- EVM.Opcode.Traversal: [mapOnJump] :: OpcodeMapper m a b -> a -> m (Opcode' b)
+ EVM.Opcode.Traversal: [mapOnJump] :: OpcodeMapper (m :: Type -> Type) a b -> a -> m (Opcode' b)
- EVM.Opcode.Traversal: [mapOnJumpdest] :: OpcodeMapper m a b -> a -> m (Opcode' b)
+ EVM.Opcode.Traversal: [mapOnJumpdest] :: OpcodeMapper (m :: Type -> Type) a b -> a -> m (Opcode' b)
- EVM.Opcode.Traversal: [mapOnJumpi] :: OpcodeMapper m a b -> a -> m (Opcode' b)
+ EVM.Opcode.Traversal: [mapOnJumpi] :: OpcodeMapper (m :: Type -> Type) a b -> a -> m (Opcode' b)
- EVM.Opcode.Traversal: [mapOnOther] :: OpcodeMapper m a b -> Opcode' a -> m (Maybe (Opcode' b))
+ EVM.Opcode.Traversal: [mapOnOther] :: OpcodeMapper (m :: Type -> Type) a b -> Opcode' a -> m (Maybe (Opcode' b))
- EVM.Opcode.Traversal: data OpcodeMapper m a b
+ EVM.Opcode.Traversal: data OpcodeMapper (m :: Type -> Type) a b
- EVM.Opcode.Traversal: mapOpcodeM :: forall m a b. Monad m => OpcodeMapper m a b -> Opcode' a -> m (Opcode' b)
+ EVM.Opcode.Traversal: mapOpcodeM :: Monad m => OpcodeMapper m a b -> Opcode' a -> m (Opcode' b)
Files
- LICENSE +1/−1
- evm-opcodes.cabal +9/−9
- src/EVM/Opcode.hs +1/−1
- src/EVM/Opcode/Internal.hs +15/−3
- src/EVM/Opcode/Labelled.hs +1/−1
- src/EVM/Opcode/Positional.hs +1/−1
- src/EVM/Opcode/Traversal.hs +8/−2
LICENSE view
@@ -1,4 +1,4 @@-Copyright 2018-2024 Simon Shine+Copyright 2018-2026 Simon Shine Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
evm-opcodes.cabal view
@@ -1,11 +1,11 @@ cabal-version: 1.12 --- This file has been generated from package.yaml by hpack version 0.36.1.+-- This file has been generated from package.yaml by hpack version 0.38.1. -- -- see: https://github.com/sol/hpack name: evm-opcodes-version: 0.2.0+version: 0.3.0 synopsis: Opcode types for Ethereum Virtual Machine (EVM) description: This library provides opcode types for the Ethereum Virtual Machine. category: Ethereum, Finance, Network@@ -13,7 +13,7 @@ bug-reports: https://github.com/sshine/evm-opcodes/issues author: Simon Shine maintainer: simon@simonshine.dk-copyright: 2018-2024 Simon Shine+copyright: 2018-2026 Simon Shine license: MIT license-file: LICENSE build-type: Simple@@ -38,9 +38,9 @@ ghc-options: -Wall -Wnoncanonical-monad-instances -Wcompat -Wincomplete-record-updates -Wincomplete-uni-patterns -Wredundant-constraints build-depends: base >=4.12 && <5- , bytestring >=0.10+ , bytestring >=0.10 && <0.13 , cereal ==0.5.*- , containers >=0.6 && <0.8+ , containers >=0.6 && <0.9 , data-dword ==0.3.* , text >=1.2 default-language: Haskell2010@@ -56,9 +56,9 @@ test build-depends: base >=4.12 && <5- , bytestring >=0.10+ , bytestring >=0.10 && <0.13 , cereal ==0.5.*- , containers >=0.6 && <0.8+ , containers >=0.6 && <0.9 , data-dword ==0.3.* , evm-opcodes , hedgehog@@ -79,9 +79,9 @@ bench build-depends: base >=4.12 && <5- , bytestring >=0.10+ , bytestring >=0.10 && <0.13 , cereal ==0.5.*- , containers >=0.6 && <0.8+ , containers >=0.6 && <0.9 , data-dword ==0.3.* , evm-opcodes , tasty-bench
src/EVM/Opcode.hs view
@@ -2,7 +2,7 @@ -- | -- Module: EVM.Opcode--- Copyright: 2018-2024 Simon Shine+-- Copyright: 2018-2026 Simon Shine -- Maintainer: Simon Shine <simon@simonshine.dk> -- License: MIT --
src/EVM/Opcode/Internal.hs view
@@ -6,7 +6,7 @@ -- | -- Module: EVM.Opcode.Internal--- Copyright: 2018-2024 Simon Shine+-- Copyright: 2018-2026 Simon Shine -- Maintainer: Simon Shine <simon@simonshine.dk> -- License: MIT --@@ -92,6 +92,8 @@ | CHAINID -- ^ 0x46, https://eips.ethereum.org/EIPS/eip-1344 | SELFBALANCE -- ^ 0x47, https://eips.ethereum.org/EIPS/eip-1884 | BASEFEE -- ^ 0x48, https://eips.ethereum.org/EIPS/eip-3198+ | BLOBHASH -- ^ 0x49, https://eips.ethereum.org/EIPS/eip-4844+ | BLOBBASEFEE -- ^ 0x4a, https://eips.ethereum.org/EIPS/eip-7516 -- 50s: Stack, Memory, Storage and Flow Operations | POP -- ^ 0x50@@ -106,8 +108,12 @@ | MSIZE -- ^ 0x59 | GAS -- ^ 0x5a | JUMPDEST j -- ^ 0x5b+ | TLOAD -- ^ 0x5c, https://eips.ethereum.org/EIPS/eip-1153+ | TSTORE -- ^ 0x5d, https://eips.ethereum.org/EIPS/eip-1153+ | MCOPY -- ^ 0x5e, https://eips.ethereum.org/EIPS/eip-5656 - -- 60s & 70s: Push Operations+ -- 5f, 60s & 70s: Push Operations+ | PUSH0 -- ^ 0x5f, https://eips.ethereum.org/EIPS/eip-3855 | PUSH !Word256 -- ^ 0x60 - 0x7f (PUSH1 - PUSH32) -- 80s: Duplication Operations (DUP)@@ -276,6 +282,8 @@ CHAINID -> OpcodeSpec 0x46 0 1 "chainid" SELFBALANCE -> OpcodeSpec 0x47 0 1 "selfbalance" BASEFEE -> OpcodeSpec 0x48 0 1 "basefee"+ BLOBHASH -> OpcodeSpec 0x49 1 1 "blobhash"+ BLOBBASEFEE -> OpcodeSpec 0x4a 0 1 "blobbasefee" -- 50s: Stack, Memory, Storage and Flow Operations -- Hex α δ@@ -291,8 +299,12 @@ MSIZE -> OpcodeSpec 0x59 0 1 "msize" GAS -> OpcodeSpec 0x5a 0 1 "gas" JUMPDEST{} -> OpcodeSpec 0x5b 0 0 "jumpdest"+ TLOAD -> OpcodeSpec 0x5c 1 1 "tload"+ TSTORE -> OpcodeSpec 0x5d 2 0 "tstore"+ MCOPY -> OpcodeSpec 0x5e 3 0 "mcopy" - -- 60s & 70s: Push Operations+ -- 5f, 60s & 70s: Push Operations+ PUSH0 -> OpcodeSpec 0x5f 0 1 "push0" PUSH n -> let (pushHex, pushConst) = push' n in OpcodeSpec { opcodeEncoding = pushHex
src/EVM/Opcode/Labelled.hs view
@@ -2,7 +2,7 @@ -- | -- Module: EVM.Opcode.Labelled--- Copyright: 2018-2024 Simon Shine+-- Copyright: 2018-2026 Simon Shine -- Maintainer: Simon Shine <simon@simonshine.dk> -- License: MIT --
src/EVM/Opcode/Positional.hs view
@@ -1,6 +1,6 @@ -- | -- Module: EVM.Opcode.Positional--- Copyright: 2018-2024 Simon Shine+-- Copyright: 2018-2026 Simon Shine -- Maintainer: Simon Shine <simon@simonshine.dk> -- License: MIT --
src/EVM/Opcode/Traversal.hs view
@@ -2,7 +2,7 @@ -- | -- Module: EVM.Opcode.Traversal--- Copyright: 2018-2024 Simon Shine+-- Copyright: 2018-2026 Simon Shine -- Maintainer: Simon Shine <simon@simonshine.dk> -- License: MIT --@@ -98,6 +98,8 @@ CHAINID -> mapOnOther' CHAINID CHAINID SELFBALANCE -> mapOnOther' SELFBALANCE SELFBALANCE BASEFEE -> mapOnOther' BASEFEE BASEFEE+ BLOBHASH -> mapOnOther' BLOBHASH BLOBHASH+ BLOBBASEFEE -> mapOnOther' BLOBBASEFEE BLOBBASEFEE -- 50s: Stack, Memory, Storage and Flow Operations POP -> mapOnOther' POP POP@@ -109,8 +111,12 @@ PC -> mapOnOther' PC PC MSIZE -> mapOnOther' MSIZE MSIZE GAS -> mapOnOther' GAS GAS+ TLOAD -> mapOnOther' TLOAD TLOAD+ TSTORE -> mapOnOther' TSTORE TSTORE+ MCOPY -> mapOnOther' MCOPY MCOPY - -- 60s & 70s: Push Operations+ -- 5f, 60s & 70s: Push Operations+ PUSH0 -> mapOnOther' PUSH0 PUSH0 PUSH n -> mapOnOther' (PUSH n) (PUSH n) -- 80s: Duplication Operations (DUP)