h&4/a      !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~2018-2022 Simon ShineMIT!Simon Shine None 5ˁ evm-opcodesAn  for a given  contains the numeric encoding of the opcode, the number of items that this opcode removes from the stack (), and the number of items added to the stack (). These values are documented in the Ethereum Yellow Paper. Examples of s: -- Hex   OpcodeSpec 0x01 2 1 "add" OpcodeSpec 0x60 0 1 "push1 255" OpcodeSpec 0x61 0 1 "push2 256" evm-opcodesNumeric encoding of opcode evm-opcodes*Number of items opcode places on stack () evm-opcodes-Number of items opcode removes from stack () evm-opcodes Printable name for opcode, e.g. "add" evm-opcodes'Convenience type of cardinality 16 for ^ and _. evm-opcodes&Convenience type of cardinality 5 for `. evm-opcodesAn 3 is an Ethereum VM Opcode with parameterised jumps.?For a plain opcode using the basic EVM stack-based jumps, use  instead.This type is used for defining and translating from annotated opcodes, e.g. with labelled jumps. evm-opcodes0x00 evm-opcodes0x01  evm-opcodes0x02! evm-opcodes0x03" evm-opcodes0x04# evm-opcodes0x05$ evm-opcodes0x06% evm-opcodes0x07& evm-opcodes0x08' evm-opcodes0x09( evm-opcodes0x0a) evm-opcodes0x0b* evm-opcodes0x10+ evm-opcodes0x11, evm-opcodes0x12- evm-opcodes0x13. evm-opcodes0x14/ evm-opcodes0x150 evm-opcodes0x161 evm-opcodes0x172 evm-opcodes0x183 evm-opcodes0x194 evm-opcodes0x1a5 evm-opcodes0x1b, &https://eips.ethereum.org/EIPS/eip-1456 evm-opcodes0x1c, &https://eips.ethereum.org/EIPS/eip-1457 evm-opcodes0x1d, &https://eips.ethereum.org/EIPS/eip-1458 evm-opcodes0x209 evm-opcodes0x30: evm-opcodes0x31; evm-opcodes0x32< evm-opcodes0x33= evm-opcodes0x34> evm-opcodes0x35? evm-opcodes0x36@ evm-opcodes0x37A evm-opcodes0x38B evm-opcodes0x39C evm-opcodes0x3aD evm-opcodes0x3bE evm-opcodes0x3cF evm-opcodes0x3d, &https://eips.ethereum.org/EIPS/eip-211G evm-opcodes0x3e, &https://eips.ethereum.org/EIPS/eip-211H evm-opcodes0x3f, 'https://eips.ethereum.org/EIPS/eip-1052I evm-opcodes0x40J evm-opcodes0x41K evm-opcodes0x42L evm-opcodes0x43M evm-opcodes0x44N evm-opcodes0x45O evm-opcodes0x46, 'https://eips.ethereum.org/EIPS/eip-1344P evm-opcodes0x47, 'https://eips.ethereum.org/EIPS/eip-1884Q evm-opcodes0x50R evm-opcodes0x51S evm-opcodes0x52T evm-opcodes0x53U evm-opcodes0x54V evm-opcodes0x55W evm-opcodes0x56X evm-opcodes0x57Y evm-opcodes0x58Z evm-opcodes0x59[ evm-opcodes0x5a\ evm-opcodes0x5b] evm-opcodes0x60 - 0x7f (PUSH1 - PUSH32)^ evm-opcodes 0x80 - 0x8f ( - )_ evm-opcodes 0x90 - 0x9f ( - p)` evm-opcodes 0xa0 - 0xa4 (o - k)a evm-opcodes0xf0b evm-opcodes0xf1c evm-opcodes0xf2d evm-opcodes0xf3e evm-opcodes0xf4, $https://eips.ethereum.org/EIPS/eip-7f evm-opcodes0xf5, 'https://eips.ethereum.org/EIPS/eip-1014g evm-opcodes0xfah evm-opcodes0xfd, &https://eips.ethereum.org/EIPS/eip-140i evm-opcodes0xfe, &https://eips.ethereum.org/EIPS/eip-141j evm-opcodes0xff, $https://eips.ethereum.org/EIPS/eip-6k evm-opcodesUse k instead of ` .l evm-opcodesUse l instead of ` .m evm-opcodesUse m instead of ` .n evm-opcodesUse n instead of ` .o evm-opcodesUse o instead of ` .p evm-opcodesUse p instead of _ , etc.q evm-opcodesUse q instead of _ , etc.r evm-opcodesUse r instead of _ , etc.s evm-opcodesUse s instead of _ , etc.t evm-opcodesUse t instead of _ , etc.u evm-opcodesUse u instead of _ , etc.v evm-opcodesUse v instead of _ , etc.w evm-opcodesUse w instead of _ , etc.x evm-opcodesUse x instead of _ , etc.y evm-opcodesUse y instead of _  , etc.z evm-opcodesUse z instead of _  , etc.{ evm-opcodesUse { instead of _  , etc.| evm-opcodesUse | instead of _  , etc.} evm-opcodesUse } instead of _  , etc.~ evm-opcodesUse ~ instead of _ , etc. evm-opcodesUse  instead of _ , etc. evm-opcodesUse  instead of ^ . evm-opcodesUse  instead of ^ . evm-opcodesUse  instead of ^ . evm-opcodesUse  instead of ^ . evm-opcodesUse  instead of ^ . evm-opcodesUse  instead of ^ . evm-opcodesUse  instead of ^ . evm-opcodesUse  instead of ^ . evm-opcodesUse  instead of ^ . evm-opcodesUse  instead of ^  . evm-opcodesUse  instead of ^  . evm-opcodesUse  instead of ^  . evm-opcodesUse  instead of ^  . evm-opcodesUse  instead of ^  . evm-opcodesUse  instead of ^ . evm-opcodesUse  instead of ^ . evm-opcodes Convert any  a into an  (). evm-opcodes Extract the a from a W a or a X a. evm-opcodes Extract the a from a \ a. evm-opcodes Convert an  or an  to a . evm-opcodes Convert a  to an  or an . evm-opcodes Given an , produce its .For ^, _ and `0 this depends on the specific variant, and for ]5 it depends on the size of the constant being pushed. evm-opcodes#Convert the constant argument of a ] to the opcode encoding (0x60--0x7f) and its constant split into  segments. jihgfedcba`_^]\[ZYXWVUTSRQPONMLKJIHGFEDCBA@?>=<;:9876543210/-,)('&%$#"! +.*klmnopqrstuvwxyz{|}~jihgfedcba`_^]\[ZYXWVUTSRQPONMLKJIHGFEDCBA@?>=<;:9876543210/-,)('&%$#"! +.* ~}|{zyxwvutsrqponmlk2018-2022 Simon ShineMIT!Simon Shine None$ evm-opcodesAn . is a plain, parameterless Ethereum VM Opcode. evm-opcodes is a plain parameterless . evm-opcodes is a plain parameterless . evm-opcodes is a plain parameterless . evm-opcodes!Determine if a byte represents a ^ opcode ( -- ). evm-opcodes!Determine if a byte represents a _ opcode ( -- p). evm-opcodes!Determine if a byte represents a ` opcode (n -- k). evm-opcodes!Determine if a byte represents a ] opcode. evm-opcodesRead a ^ opcode ( --  ) safely. evm-opcodesRead a _ opcode ( -- p ) safely. evm-opcodesRead a ` opcode (n -- k ) safely. evm-opcodesRead a ] opcode safely. evm-opcodes Parse an  from a  . In case of ] instructions, read the constant being pushed from a subsequent . evm-opcodesShow  as . evm-opcodes;Calculate the size in bytes of an encoded opcode. The only " that uses more than one byte is ]+. Sizes are trivially determined for only  with unlabelled jumps, since we cannot know e.g. where the label of a 1 points to before code generation has completed. evm-opcodes Convert a []# to a string of ASCII hexadecimals. evm-opcodes Convert a [] to bytecode. evm-opcodes Convert an  to a [].To convert many s to bytecode, use .*.+ !"#$%&'(),-/0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~*.+ !"#$%&'(),-/0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghij~}|{zyxwvutsrqponmlk2018-2022 Simon ShineMIT!Simon Shine None(D evm-opcodesA ! has byte positions annotated at W, X and \; on W and X2 the positions denote where they jump to, and on \/ they denote the position of the opcode itself. evm-opcodesThe position of an Opcode. evm-opcodes Translate a  into an $ by converting the position into a ] instruction. evm-opcodes-The size of a jump to some absolute position.2018-2022 Simon ShineMIT!Simon Shine None* evm-opcodesAn = is a collection of four mapping functions that can map any  a to an  b5. For each of the three opcodes that are annotated, W, X and \, a separate mapping function is specified, and for any other opcode, a general mapping function is specified that falls back to the same opcode of type  b.See  for an example of usage. evm-opcodes Given an  and an  a , produce m ( b).2018-2022 Simon ShineMIT!Simon Shine None&/ evm-opcodesTranslation of s into 1s may fail if a jump is made to a non-occurring \ or a \ occurs twice. evm-opcodess use  to represent jumps.In particular, W "name", X "name" and \ "name"."All other opcodes remain the same. evm-opcodesFor now, all labels are . evm-opcodes+Replace all labels with absolute positions.Positions are calculated by fixed-point iteration to account for variable sizes of jumps. Labelled jumps don't have a size defined, the size of a positional jump depends on the address being jumped to.For example, if jumping to the \ on the 256th position in a [], this requires a PUSH2> instruction which uses an additional byte, which pushes the \ one byte ahead. evm-opcodes Extract a    that describes where each \ is located, taking into account the sizes of all prior opcodes.  Safe-Inferred/L      !"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\]^_`abcdefghijklmnopqrstuvwxyz{|}~        evm-opcodes-0.1.2-inplaceEVM.Opcode.Internal EVM.OpcodeEVM.Opcode.PositionalEVM.Opcode.TraversalEVM.Opcode.LabelledOpcodeLabelledOpcode translatePaths_evm_opcodes OpcodeSpecopcodeEncoding opcodeAlpha opcodeDelta opcodeNameOrd16Ord16_1Ord16_2Ord16_3Ord16_4Ord16_5Ord16_6Ord16_7Ord16_8Ord16_9Ord16_10Ord16_11Ord16_12Ord16_13Ord16_14Ord16_15Ord16_16Ord5Ord5_0Ord5_1Ord5_2Ord5_3Ord5_4Opcode'STOPADDMULSUBDIVSDIVMODSMODADDMODMULMODEXP SIGNEXTENDLTGTSLTSGTEQISZEROANDORXORNOTBYTESHLSHRSARSHA3ADDRESSBALANCEORIGINCALLER CALLVALUE CALLDATALOAD CALLDATASIZE CALLDATACOPYCODESIZECODECOPYGASPRICE EXTCODESIZE EXTCODECOPYRETURNDATASIZERETURNDATACOPY EXTCODEHASH BLOCKHASHCOINBASE TIMESTAMPNUMBER DIFFICULTYGASLIMITCHAINID SELFBALANCEPOPMLOADMSTOREMSTORE8SLOADSSTOREJUMPJUMPIPCMSIZEGASJUMPDESTPUSHDUPSWAPLOGCREATECALLCALLCODERETURN DELEGATECALLCREATE2 STATICCALLREVERTINVALID SELFDESTRUCTLOG4LOG3LOG2LOG1LOG0SWAP16SWAP15SWAP14SWAP13SWAP12SWAP11SWAP10SWAP9SWAP8SWAP7SWAP6SWAP5SWAP4SWAP3SWAP2SWAP1DUP16DUP15DUP14DUP13DUP12DUP11DUP10DUP9DUP8DUP7DUP6DUP5DUP4DUP3DUP2DUP1concrete jumpAnnot jumpdestAnnottoWord8 fromWord8 opcodeSpecpush' $fShowOpcode'$fEqOpcodeSpec$fShowOpcodeSpec $fEqOpcode' $fOrdOpcode'$fFunctorOpcode' $fEqOrd16 $fOrdOrd16 $fEnumOrd16$fBoundedOrd16$fEqOrd5 $fOrdOrd5 $fEnumOrd5 $fBoundedOrd5jumpjumpijumpdestisDUPisSWAPisLOGisPUSHreadDUPreadSWAPreadLOGreadPUSHreadOp opcodeText opcodeSizetoHexpacktoBytesPositionalOpcodePositionjumpSize OpcodeMapper mapOnJump mapOnJumpi mapOnJumpdest mapOnOther mapOpcodeMTranslateErrortranslateErrorMissingJumpdests translateErrorDuplicateJumpdestsLabellabelPositions$fEqTranslateError$fShowTranslateErrorbaseGHC.WordWord8bytestring-0.10.12.0Data.ByteString.Internal ByteString text-1.2.4.1Data.Text.InternalTextcontainers-0.6.5.1Data.Map.InternalMapversiongetDataFileName getBinDir getLibDir getDynLibDir getDataDir getLibexecDir getSysconfDir