-- Hoogle documentation, generated by Haddock -- See Hoogle, http://www.haskell.org/hoogle/ -- | Ethereum virtual machine evaluator -- -- Hevm implements the Ethereum virtual machine semantics. -- -- It can be used as a library, and it also comes with an executable that -- can run unit test suites, optionally with a visual TTY debugger. @package hevm @version 0.21 module EVM.FeeSchedule data Num n => FeeSchedule n FeeSchedule :: n -> n -> n -> n -> n -> n -> n -> n -> n -> n -> n -> n -> n -> n -> n -> n -> n -> n -> n -> n -> n -> n -> n -> n -> n -> n -> n -> n -> n -> n -> n -> n -> n -> n -> n -> FeeSchedule n [g_zero] :: FeeSchedule n -> n [g_base] :: FeeSchedule n -> n [g_verylow] :: FeeSchedule n -> n [g_low] :: FeeSchedule n -> n [g_mid] :: FeeSchedule n -> n [g_high] :: FeeSchedule n -> n [g_extcode] :: FeeSchedule n -> n [g_balance] :: FeeSchedule n -> n [g_sload] :: FeeSchedule n -> n [g_jumpdest] :: FeeSchedule n -> n [g_sset] :: FeeSchedule n -> n [g_sreset] :: FeeSchedule n -> n [r_sclear] :: FeeSchedule n -> n [r_selfdestruct] :: FeeSchedule n -> n [r_selfdestruct_newaccount] :: FeeSchedule n -> n [g_create] :: FeeSchedule n -> n [g_codedeposit] :: FeeSchedule n -> n [g_call] :: FeeSchedule n -> n [g_callvalue] :: FeeSchedule n -> n [g_callstipend] :: FeeSchedule n -> n [g_newaccount] :: FeeSchedule n -> n [g_exp] :: FeeSchedule n -> n [g_expbyte] :: FeeSchedule n -> n [g_memory] :: FeeSchedule n -> n [g_txcreate] :: FeeSchedule n -> n [g_txdatazero] :: FeeSchedule n -> n [g_txdatanonzero] :: FeeSchedule n -> n [g_transaction] :: FeeSchedule n -> n [g_log] :: FeeSchedule n -> n [g_logdata] :: FeeSchedule n -> n [g_logtopic] :: FeeSchedule n -> n [g_sha3] :: FeeSchedule n -> n [g_sha3word] :: FeeSchedule n -> n [g_copy] :: FeeSchedule n -> n [g_blockhash] :: FeeSchedule n -> n type EIP n = Num n => FeeSchedule n -> FeeSchedule n eip150 :: EIP n eip160 :: EIP n homestead :: Num n => FeeSchedule n metropolis :: Num n => FeeSchedule n instance (GHC.Num.Num n, GHC.Show.Show n) => GHC.Show.Show (EVM.FeeSchedule.FeeSchedule n) module EVM.Precompiled -- | Run a given precompiled contract using the C library. execute :: Int -> ByteString -> Int -> Maybe ByteString module EVM.TTYCenteredList -- | Turn a list state value into a widget given an item drawing function. renderList :: (Ord n, Show n) => (Bool -> e -> Widget n) -> Bool -> List n e -> Widget n drawListElements :: (Ord n, Show n) => Bool -> List n e -> (Bool -> e -> Widget n) -> Widget n module EVM.Types data Word512 Word512 :: {-# UNPACK #-} !Word256 -> {-# UNPACK #-} !Word256 -> Word512 data Int512 Int512 :: {-# UNPACK #-} !Int256 -> {-# UNPACK #-} !Word256 -> Int512 newtype W256 W256 :: Word256 -> W256 newtype Addr Addr :: Word160 -> Addr [addressWord160] :: Addr -> Word160 showAddrWith0x :: Addr -> String showWordWith0x :: W256 -> String showByteStringWith0x :: ByteString -> String hexByteString :: String -> ByteString -> ByteString hexText :: Text -> ByteString readN :: Integral a => String -> a wordField :: Object -> Text -> Parser W256 addrField :: Object -> Text -> Parser Addr dataField :: Object -> Text -> Parser ByteString toWord512 :: W256 -> Word512 fromWord512 :: Word512 -> W256 num :: (Integral a, Num b) => a -> b padLeft :: Int -> ByteString -> ByteString padRight :: Int -> ByteString -> ByteString word :: ByteString -> W256 byteAt :: (Bits a, Bits b, Integral a, Num b) => a -> Int -> b instance GHC.Generics.Generic EVM.Types.Addr instance Data.Bits.Bits EVM.Types.Addr instance GHC.Classes.Eq EVM.Types.Addr instance GHC.Enum.Enum EVM.Types.Addr instance GHC.Classes.Ord EVM.Types.Addr instance GHC.Real.Real EVM.Types.Addr instance GHC.Real.Integral EVM.Types.Addr instance GHC.Num.Num EVM.Types.Addr instance GHC.Generics.Generic EVM.Types.W256 instance GHC.Enum.Bounded EVM.Types.W256 instance Data.Bits.FiniteBits EVM.Types.W256 instance Data.Bits.Bits EVM.Types.W256 instance GHC.Classes.Eq EVM.Types.W256 instance GHC.Enum.Enum EVM.Types.W256 instance GHC.Classes.Ord EVM.Types.W256 instance GHC.Real.Real EVM.Types.W256 instance GHC.Real.Integral EVM.Types.W256 instance GHC.Num.Num EVM.Types.W256 instance GHC.Generics.Generic EVM.Types.Int512 instance Data.Data.Data EVM.Types.Int512 instance GHC.Generics.Generic EVM.Types.Word512 instance Data.Data.Data EVM.Types.Word512 instance GHC.Read.Read EVM.Types.Addr instance GHC.Show.Show EVM.Types.Addr instance Data.Aeson.Types.FromJSON.FromJSON EVM.Types.Addr instance Data.Aeson.Types.FromJSON.FromJSONKey EVM.Types.Addr instance Options.Generic.ParseField EVM.Types.Addr instance Options.Generic.ParseFields EVM.Types.Addr instance Options.Generic.ParseRecord EVM.Types.Addr instance GHC.Read.Read EVM.Types.W256 instance GHC.Show.Show EVM.Types.W256 instance Data.Aeson.Types.FromJSON.FromJSON EVM.Types.W256 instance Data.Aeson.Types.FromJSON.FromJSONKey EVM.Types.W256 instance Options.Generic.ParseField EVM.Types.W256 instance Options.Generic.ParseFields EVM.Types.W256 instance Options.Generic.ParseRecord EVM.Types.W256 instance Data.BinaryWord.BinaryWord EVM.Types.Word512 instance Data.DoubleWord.Base.DoubleWord EVM.Types.Int512 instance GHC.Classes.Eq EVM.Types.Int512 instance GHC.Classes.Ord EVM.Types.Int512 instance GHC.Enum.Bounded EVM.Types.Int512 instance GHC.Enum.Enum EVM.Types.Int512 instance GHC.Num.Num EVM.Types.Int512 instance GHC.Real.Real EVM.Types.Int512 instance GHC.Real.Integral EVM.Types.Int512 instance GHC.Show.Show EVM.Types.Int512 instance GHC.Read.Read EVM.Types.Int512 instance Data.Hashable.Class.Hashable EVM.Types.Int512 instance GHC.Arr.Ix EVM.Types.Int512 instance Data.Bits.Bits EVM.Types.Int512 instance Data.Bits.FiniteBits EVM.Types.Int512 instance Data.BinaryWord.BinaryWord EVM.Types.Int512 instance Data.DoubleWord.Base.DoubleWord EVM.Types.Word512 instance GHC.Classes.Eq EVM.Types.Word512 instance GHC.Classes.Ord EVM.Types.Word512 instance GHC.Enum.Bounded EVM.Types.Word512 instance GHC.Enum.Enum EVM.Types.Word512 instance GHC.Num.Num EVM.Types.Word512 instance GHC.Real.Real EVM.Types.Word512 instance GHC.Real.Integral EVM.Types.Word512 instance GHC.Show.Show EVM.Types.Word512 instance GHC.Read.Read EVM.Types.Word512 instance Data.Hashable.Class.Hashable EVM.Types.Word512 instance GHC.Arr.Ix EVM.Types.Word512 instance Data.Bits.Bits EVM.Types.Word512 instance Data.Bits.FiniteBits EVM.Types.Word512 module EVM.Op data Op OpStop :: Op OpAdd :: Op OpMul :: Op OpSub :: Op OpDiv :: Op OpSdiv :: Op OpMod :: Op OpSmod :: Op OpAddmod :: Op OpMulmod :: Op OpExp :: Op OpSignextend :: Op OpLt :: Op OpGt :: Op OpSlt :: Op OpSgt :: Op OpEq :: Op OpIszero :: Op OpAnd :: Op OpOr :: Op OpXor :: Op OpNot :: Op OpByte :: Op OpSha3 :: Op OpAddress :: Op OpBalance :: Op OpOrigin :: Op OpCaller :: Op OpCallvalue :: Op OpCalldataload :: Op OpCalldatasize :: Op OpCalldatacopy :: Op OpCodesize :: Op OpCodecopy :: Op OpGasprice :: Op OpExtcodesize :: Op OpExtcodecopy :: Op OpReturndatasize :: Op OpReturndatacopy :: Op OpBlockhash :: Op OpCoinbase :: Op OpTimestamp :: Op OpNumber :: Op OpDifficulty :: Op OpGaslimit :: Op OpPop :: Op OpMload :: Op OpMstore :: Op OpMstore8 :: Op OpSload :: Op OpSstore :: Op OpJump :: Op OpJumpi :: Op OpPc :: Op OpMsize :: Op OpGas :: Op OpJumpdest :: Op OpCreate :: Op OpCall :: Op OpCallcode :: Op OpReturn :: Op OpDelegatecall :: Op OpRevert :: Op OpSelfdestruct :: Op OpDup :: !Word8 -> Op OpSwap :: !Word8 -> Op OpLog :: !Word8 -> Op OpPush :: !W256 -> Op OpUnknown :: Word8 -> Op instance GHC.Classes.Eq EVM.Op.Op instance GHC.Show.Show EVM.Op.Op module EVM.Keccak keccak :: ByteString -> W256 abiKeccak :: ByteString -> Word32 newContractAddress :: Addr -> W256 -> Addr module EVM.Concrete wordAt :: Int -> ByteString -> W256 word256Bytes :: W256 -> ByteString readByteOrZero :: Int -> ByteString -> Word8 byteStringSliceWithDefaultZeroes :: Int -> Int -> ByteString -> ByteString data Whiff Dull :: Whiff FromKeccak :: ByteString -> Whiff w256 :: W256 -> Word blob :: ByteString -> Blob data Word C :: Whiff -> W256 -> Word newtype Blob B :: ByteString -> Blob newtype Byte ConcreteByte :: Word8 -> Byte newtype Memory ConcreteMemory :: ByteString -> Memory wordToByte :: Word -> Byte exponentiate :: Word -> Word -> Word sdiv :: Word -> Word -> Word smod :: Word -> Word -> Word addmod :: Word -> Word -> Word -> Word mulmod :: Word -> Word -> Word -> Word slt :: Word -> Word -> Word sgt :: Word -> Word -> Word forceConcreteBlob :: Blob -> ByteString forceConcreteWord :: Word -> W256 sliceMemory :: (Integral a, Integral b) => a -> b -> Memory -> Blob writeMemory :: Blob -> Word -> Word -> Word -> Memory -> Memory readMemoryWord :: Word -> Memory -> Word readMemoryWord32 :: Word -> Memory -> Word setMemoryWord :: Word -> Word -> Memory -> Memory setMemoryByte :: Word -> Byte -> Memory -> Memory readBlobWord :: Word -> Blob -> Word blobSize :: Blob -> Word keccakBlob :: Blob -> Word (^) :: W256 -> W256 -> W256 instance GHC.Show.Show EVM.Concrete.Whiff instance Data.Bits.Bits EVM.Concrete.Byte instance Data.Bits.FiniteBits EVM.Concrete.Byte instance GHC.Enum.Enum EVM.Concrete.Byte instance GHC.Classes.Eq EVM.Concrete.Byte instance GHC.Real.Integral EVM.Concrete.Byte instance Data.String.IsString EVM.Concrete.Blob instance GHC.Base.Semigroup EVM.Concrete.Blob instance GHC.Base.Monoid EVM.Concrete.Blob instance GHC.Base.Semigroup EVM.Concrete.Memory instance GHC.Base.Monoid EVM.Concrete.Memory instance GHC.Num.Num EVM.Concrete.Byte instance GHC.Classes.Ord EVM.Concrete.Byte instance GHC.Real.Real EVM.Concrete.Byte instance GHC.Show.Show EVM.Concrete.Blob instance GHC.Show.Show EVM.Concrete.Word instance GHC.Read.Read EVM.Concrete.Word instance Data.Bits.Bits EVM.Concrete.Word instance Data.Bits.FiniteBits EVM.Concrete.Word instance GHC.Enum.Bounded EVM.Concrete.Word instance GHC.Classes.Eq EVM.Concrete.Word instance GHC.Enum.Enum EVM.Concrete.Word instance GHC.Real.Integral EVM.Concrete.Word instance GHC.Num.Num EVM.Concrete.Word instance GHC.Real.Real EVM.Concrete.Word instance GHC.Classes.Ord EVM.Concrete.Word module EVM.ABI data AbiValue AbiUInt :: Int -> Word256 -> AbiValue AbiInt :: Int -> Int256 -> AbiValue AbiAddress :: Word160 -> AbiValue AbiBool :: Bool -> AbiValue AbiBytes :: Int -> ByteString -> AbiValue AbiBytesDynamic :: ByteString -> AbiValue AbiString :: ByteString -> AbiValue AbiArrayDynamic :: AbiType -> (Vector AbiValue) -> AbiValue AbiArray :: Int -> AbiType -> (Vector AbiValue) -> AbiValue data AbiType AbiUIntType :: Int -> AbiType AbiIntType :: Int -> AbiType AbiAddressType :: AbiType AbiBoolType :: AbiType AbiBytesType :: Int -> AbiType AbiBytesDynamicType :: AbiType AbiStringType :: AbiType AbiArrayDynamicType :: AbiType -> AbiType AbiArrayType :: Int -> AbiType -> AbiType data Event Event :: Text -> Anonymity -> [(AbiType, Indexed)] -> Event data Anonymity Anonymous :: Anonymity NotAnonymous :: Anonymity data Indexed Indexed :: Indexed NotIndexed :: Indexed putAbi :: AbiValue -> Put getAbi :: AbiType -> Get AbiValue getAbiSeq :: Int -> [AbiType] -> Get (Vector AbiValue) abiValueType :: AbiValue -> AbiType abiTypeSolidity :: AbiType -> Text abiCalldata :: Text -> Vector AbiValue -> ByteString encodeAbiValue :: AbiValue -> ByteString parseTypeName :: Text -> Maybe AbiType instance GHC.Generics.Generic EVM.ABI.Event instance GHC.Classes.Eq EVM.ABI.Event instance GHC.Classes.Ord EVM.ABI.Event instance GHC.Show.Show EVM.ABI.Event instance GHC.Generics.Generic EVM.ABI.Indexed instance GHC.Classes.Eq EVM.ABI.Indexed instance GHC.Classes.Ord EVM.ABI.Indexed instance GHC.Show.Show EVM.ABI.Indexed instance GHC.Generics.Generic EVM.ABI.Anonymity instance GHC.Classes.Eq EVM.ABI.Anonymity instance GHC.Classes.Ord EVM.ABI.Anonymity instance GHC.Show.Show EVM.ABI.Anonymity instance GHC.Generics.Generic EVM.ABI.AbiKind instance GHC.Classes.Ord EVM.ABI.AbiKind instance GHC.Classes.Eq EVM.ABI.AbiKind instance GHC.Read.Read EVM.ABI.AbiKind instance GHC.Show.Show EVM.ABI.AbiKind instance GHC.Generics.Generic EVM.ABI.AbiValue instance GHC.Classes.Ord EVM.ABI.AbiValue instance GHC.Classes.Eq EVM.ABI.AbiValue instance GHC.Read.Read EVM.ABI.AbiValue instance GHC.Show.Show EVM.ABI.AbiValue instance GHC.Generics.Generic EVM.ABI.AbiType instance GHC.Classes.Ord EVM.ABI.AbiType instance GHC.Classes.Eq EVM.ABI.AbiType instance GHC.Read.Read EVM.ABI.AbiType instance GHC.Show.Show EVM.ABI.AbiType instance Test.QuickCheck.Arbitrary.Arbitrary EVM.ABI.AbiValue instance Test.QuickCheck.Arbitrary.Arbitrary EVM.ABI.AbiType module EVM.Solidity solidity :: Text -> Text -> IO (Maybe ByteString) data JumpType JumpInto :: JumpType JumpFrom :: JumpType JumpRegular :: JumpType data SolcContract SolcContract :: W256 -> W256 -> ByteString -> ByteString -> Text -> [(Text, AbiType)] -> Map Word32 Method -> Map W256 Event -> Seq SrcMap -> Seq SrcMap -> Value -> SolcContract [_runtimeCodehash] :: SolcContract -> W256 [_creationCodehash] :: SolcContract -> W256 [_runtimeCode] :: SolcContract -> ByteString [_creationCode] :: SolcContract -> ByteString [_contractName] :: SolcContract -> Text [_constructorInputs] :: SolcContract -> [(Text, AbiType)] [_abiMap] :: SolcContract -> Map Word32 Method [_eventMap] :: SolcContract -> Map W256 Event [_runtimeSrcmap] :: SolcContract -> Seq SrcMap [_creationSrcmap] :: SolcContract -> Seq SrcMap [_contractAst] :: SolcContract -> Value data SourceCache SourceCache :: Map (Int, Int) ByteString -> Map Int (Text, ByteString) -> Map Int (Vector ByteString) -> Map Text Value -> SourceCache [_snippetCache] :: SourceCache -> Map (Int, Int) ByteString [_sourceFiles] :: SourceCache -> Map Int (Text, ByteString) [_sourceLines] :: SourceCache -> Map Int (Vector ByteString) [_sourceAsts] :: SourceCache -> Map Text Value data SrcMap SM :: {-# UNPACK #-}Int -> {-# UNPACK #-}Int -> {-# UNPACK #-}Int -> JumpType -> SrcMap [srcMapOffset] :: SrcMap -> {-# UNPACK #-}Int [srcMapLength] :: SrcMap -> {-# UNPACK #-}Int [srcMapFile] :: SrcMap -> {-# UNPACK #-}Int [srcMapJump] :: SrcMap -> JumpType data CodeType Creation :: CodeType Runtime :: CodeType data Method Method :: Maybe (Text, AbiType) -> [(Text, AbiType)] -> Text -> Text -> Method [_methodOutput] :: Method -> Maybe (Text, AbiType) [_methodInputs] :: Method -> [(Text, AbiType)] [_methodName] :: Method -> Text [_methodSignature] :: Method -> Text methodName :: Lens' Method Text methodSignature :: Lens' Method Text methodInputs :: Lens' Method [(Text, AbiType)] methodOutput :: Lens' Method (Maybe (Text, AbiType)) abiMap :: Lens' SolcContract (Map Word32 Method) eventMap :: Lens' SolcContract (Map W256 Event) contractName :: Lens' SolcContract Text constructorInputs :: Lens' SolcContract [(Text, AbiType)] creationCode :: Lens' SolcContract ByteString makeSrcMaps :: Text -> Maybe (Seq SrcMap) readSolc :: FilePath -> IO (Maybe (Map Text SolcContract, SourceCache)) runtimeCode :: Lens' SolcContract ByteString snippetCache :: Lens' SourceCache (Map (Int, Int) ByteString) runtimeCodehash :: Lens' SolcContract W256 creationCodehash :: Lens' SolcContract W256 runtimeSrcmap :: Lens' SolcContract (Seq SrcMap) creationSrcmap :: Lens' SolcContract (Seq SrcMap) contractAst :: Lens' SolcContract Value sourceFiles :: Lens' SourceCache (Map Int (Text, ByteString)) sourceLines :: Lens' SourceCache (Map Int (Vector ByteString)) sourceAsts :: Lens' SourceCache (Map Text Value) stripBytecodeMetadata :: ByteString -> ByteString lineSubrange :: Vector ByteString -> (Int, Int) -> Int -> Maybe (Int, Int) -- | Every node in the AST has an ID, and other nodes reference those IDs. -- This function recurses through the tree looking for objects with the -- "id" key and makes a big map from ID to value. astIdMap :: Foldable f => f Value -> Map Int Value astSrcMap :: Map Int Value -> (SrcMap -> Maybe Value) instance GHC.Classes.Ord EVM.Solidity.CodeType instance GHC.Classes.Eq EVM.Solidity.CodeType instance GHC.Show.Show EVM.Solidity.CodeType instance GHC.Show.Show EVM.Solidity.SrcMapParseState instance GHC.Generics.Generic EVM.Solidity.SolcContract instance GHC.Classes.Eq EVM.Solidity.SolcContract instance GHC.Show.Show EVM.Solidity.SolcContract instance GHC.Generics.Generic EVM.Solidity.SrcMap instance GHC.Classes.Ord EVM.Solidity.SrcMap instance GHC.Classes.Eq EVM.Solidity.SrcMap instance GHC.Show.Show EVM.Solidity.SrcMap instance GHC.Generics.Generic EVM.Solidity.JumpType instance GHC.Classes.Ord EVM.Solidity.JumpType instance GHC.Classes.Eq EVM.Solidity.JumpType instance GHC.Show.Show EVM.Solidity.JumpType instance GHC.Generics.Generic EVM.Solidity.SourceCache instance GHC.Classes.Eq EVM.Solidity.SourceCache instance GHC.Show.Show EVM.Solidity.SourceCache instance GHC.Generics.Generic EVM.Solidity.Method instance GHC.Classes.Ord EVM.Solidity.Method instance GHC.Classes.Eq EVM.Solidity.Method instance GHC.Show.Show EVM.Solidity.Method instance GHC.Base.Semigroup EVM.Solidity.SourceCache instance GHC.Base.Monoid EVM.Solidity.SourceCache module EVM data Error BalanceTooLow :: Word -> Word -> Error UnrecognizedOpcode :: Word8 -> Error SelfDestruction :: Error StackUnderrun :: Error BadJumpDestination :: Error Revert :: Error NoSuchContract :: Addr -> Error OutOfGas :: Word -> Word -> Error BadCheatCode :: Word32 -> Error StackLimitExceeded :: Error IllegalOverflow :: Error Query :: Query -> Error PrecompiledContractError :: Int -> Error StateChangeWhileStatic :: Error -- | The possible result states of a VM data VMResult -- | An operation failed VMFailure :: Error -> VMResult -- | Reached STOP, RETURN, or end-of-code VMSuccess :: Blob -> VMResult -- | The state of a stepwise EVM execution data VM VM :: Maybe VMResult -> FrameState -> [Frame] -> Env -> Block -> TxState -> Seq Log -> TreePos Empty Trace -> Cache -> ExecMode -> Word -> VM [_result] :: VM -> Maybe VMResult [_state] :: VM -> FrameState [_frames] :: VM -> [Frame] [_env] :: VM -> Env [_block] :: VM -> Block [_tx] :: VM -> TxState [_logs] :: VM -> Seq Log [_traces] :: VM -> TreePos Empty Trace [_cache] :: VM -> Cache [_execMode] :: VM -> ExecMode [_burned] :: VM -> Word data Trace Trace :: W256 -> Int -> TraceData -> Trace [_traceCodehash] :: Trace -> W256 [_traceOpIx] :: Trace -> Int [_traceData] :: Trace -> TraceData data TraceData EventTrace :: Log -> TraceData FrameTrace :: FrameContext -> TraceData QueryTrace :: Query -> TraceData ErrorTrace :: Error -> TraceData EntryTrace :: Text -> TraceData ReturnTrace :: Blob -> FrameContext -> TraceData data ExecMode ExecuteNormally :: ExecMode ExecuteAsVMTest :: ExecMode data Query [PleaseFetchContract] :: Addr -> (Contract -> EVM ()) -> Query [PleaseFetchSlot] :: Addr -> Word -> (Word -> EVM ()) -> Query -- | Alias for the type of e.g. exec1. type EVM a = State VM a -- | The cache is data that can be persisted for efficiency: any expensive -- query that is constant at least within a block. data Cache Cache :: Map Addr Contract -> Cache [_fetched] :: Cache -> Map Addr Contract -- | A way to specify an initial VM state data VMOpts VMOpts :: ByteString -> ByteString -> W256 -> Addr -> Addr -> Addr -> W256 -> W256 -> W256 -> Addr -> W256 -> W256 -> W256 -> FeeSchedule Word -> VMOpts [vmoptCode] :: VMOpts -> ByteString [vmoptCalldata] :: VMOpts -> ByteString [vmoptValue] :: VMOpts -> W256 [vmoptAddress] :: VMOpts -> Addr [vmoptCaller] :: VMOpts -> Addr [vmoptOrigin] :: VMOpts -> Addr [vmoptGas] :: VMOpts -> W256 [vmoptNumber] :: VMOpts -> W256 [vmoptTimestamp] :: VMOpts -> W256 [vmoptCoinbase] :: VMOpts -> Addr [vmoptDifficulty] :: VMOpts -> W256 [vmoptGaslimit] :: VMOpts -> W256 [vmoptGasprice] :: VMOpts -> W256 [vmoptSchedule] :: VMOpts -> FeeSchedule Word -- | A log entry data Log Log :: Addr -> Blob -> [Word] -> Log -- | An entry in the VM's "call/create stack" data Frame Frame :: FrameContext -> FrameState -> Frame [_frameContext] :: Frame -> FrameContext [_frameState] :: Frame -> FrameState -- | Call/create info data FrameContext CreationContext :: W256 -> FrameContext [creationContextCodehash] :: FrameContext -> W256 CallContext :: Word -> Word -> W256 -> Maybe Word -> Blob -> Map Addr Contract -> FrameContext [callContextOffset] :: FrameContext -> Word [callContextSize] :: FrameContext -> Word [callContextCodehash] :: FrameContext -> W256 [callContextAbi] :: FrameContext -> Maybe Word [callContextData] :: FrameContext -> Blob [callContextReversion] :: FrameContext -> Map Addr Contract -- | The "registers" of the VM along with memory and data stack data FrameState FrameState :: Addr -> Addr -> ByteString -> Int -> [Word] -> Memory -> Int -> Blob -> Word -> Addr -> Word -> Blob -> Bool -> FrameState [_contract] :: FrameState -> Addr [_codeContract] :: FrameState -> Addr [_code] :: FrameState -> ByteString [_pc] :: FrameState -> Int [_stack] :: FrameState -> [Word] [_memory] :: FrameState -> Memory [_memorySize] :: FrameState -> Int [_calldata] :: FrameState -> Blob [_callvalue] :: FrameState -> Word [_caller] :: FrameState -> Addr [_gas] :: FrameState -> Word [_returndata] :: FrameState -> Blob [_static] :: FrameState -> Bool -- | The state that spans a whole transaction data TxState TxState :: [Addr] -> [(Addr, Word)] -> TxState [_selfdestructs] :: TxState -> [Addr] [_refunds] :: TxState -> [(Addr, Word)] -- | The state of a contract data Contract Contract :: ByteString -> Map Word Word -> Word -> Word -> W256 -> Int -> Vector Int -> Vector (Int, Op) -> Bool -> Contract [_bytecode] :: Contract -> ByteString [_storage] :: Contract -> Map Word Word [_balance] :: Contract -> Word [_nonce] :: Contract -> Word [_codehash] :: Contract -> W256 [_codesize] :: Contract -> Int [_opIxMap] :: Contract -> Vector Int [_codeOps] :: Contract -> Vector (Int, Op) [_external] :: Contract -> Bool -- | Various environmental data data Env Env :: Map Addr Contract -> Map Word Blob -> Addr -> Env [_contracts] :: Env -> Map Addr Contract [_sha3Crack] :: Env -> Map Word Blob [_origin] :: Env -> Addr -- | Data about the block data Block Block :: Addr -> Word -> Word -> Word -> Word -> Word -> FeeSchedule Word -> Block [_coinbase] :: Block -> Addr [_timestamp] :: Block -> Word [_number] :: Block -> Word [_difficulty] :: Block -> Word [_gaslimit] :: Block -> Word [_gasprice] :: Block -> Word [_schedule] :: Block -> FeeSchedule Word blankState :: FrameState static :: Lens' FrameState Bool stack :: Lens' FrameState [Word] returndata :: Lens' FrameState Blob pc :: Lens' FrameState Int memorySize :: Lens' FrameState Int memory :: Lens' FrameState Memory gas :: Lens' FrameState Word contract :: Lens' FrameState Addr codeContract :: Lens' FrameState Addr code :: Lens' FrameState ByteString callvalue :: Lens' FrameState Word caller :: Lens' FrameState Addr calldata :: Lens' FrameState Blob frameState :: Lens' Frame FrameState frameContext :: Lens' Frame FrameContext timestamp :: Lens' Block Word schedule :: Lens' Block (FeeSchedule Word) number :: Lens' Block Word gasprice :: Lens' Block Word gaslimit :: Lens' Block Word difficulty :: Lens' Block Word coinbase :: Lens' Block Addr selfdestructs :: Lens' TxState [Addr] refunds :: Lens' TxState [(Addr, Word)] storage :: Lens' Contract (Map Word Word) opIxMap :: Lens' Contract (Vector Int) nonce :: Lens' Contract Word external :: Lens' Contract Bool codesize :: Lens' Contract Int codehash :: Lens' Contract W256 codeOps :: Lens' Contract (Vector (Int, Op)) bytecode :: Lens' Contract ByteString balance :: Lens' Contract Word sha3Crack :: Lens' Env (Map Word Blob) origin :: Lens' Env Addr contracts :: Lens' Env (Map Addr Contract) fetched :: Iso' Cache (Map Addr Contract) traceOpIx :: Lens' Trace Int traceData :: Lens' Trace TraceData traceCodehash :: Lens' Trace W256 tx :: Lens' VM TxState traces :: Lens' VM (TreePos Empty Trace) state :: Lens' VM FrameState result :: Lens' VM (Maybe VMResult) logs :: Lens' VM (Seq Log) frames :: Lens' VM [Frame] execMode :: Lens' VM ExecMode env :: Lens' VM Env cache :: Lens' VM Cache burned :: Lens' VM Word block :: Lens' VM Block currentContract :: VM -> Maybe Contract makeVm :: VMOpts -> VM initialContract :: ByteString -> Contract next :: (?op :: Word8) => EVM () exec1 :: EVM () precompiledContract :: (?op :: Word8) => EVM () noop :: Monad m => m () pushTo :: MonadState s m => ASetter s s [a] [a] -> a -> m () pushToSequence :: MonadState s m => ASetter s s (Seq a) (Seq a) -> a -> m () touchAccount :: Addr -> (Contract -> EVM ()) -> EVM () accessStorage :: Addr -> Word -> (Word -> EVM ()) -> EVM () -- | Replace current contract's code, like when CREATE returns from the -- constructor code. replaceCodeOfSelf :: ByteString -> EVM () resetState :: EVM () finalize :: EVM () loadContract :: Addr -> EVM () limitStack :: Int -> EVM () -> EVM () notStatic :: EVM () -> EVM () burn :: Word -> EVM () -> EVM () refund :: Word -> EVM () cheatCode :: Addr cheat :: (?op :: Word8) => (Word, Word) -> (Word, Word) -> EVM () type CheatAction = ([AbiType], [AbiValue] -> EVM (Maybe AbiValue)) cheatActions :: Map Word32 CheatAction delegateCall :: (?op :: Word8) => FeeSchedule Word -> Word -> Addr -> Word -> Word -> Word -> Word -> [Word] -> EVM () -> EVM () underrun :: EVM () vmError :: Error -> EVM () accessMemoryRange :: FeeSchedule Word -> Word -> Word -> EVM () -> EVM () accessMemoryWord :: FeeSchedule Word -> Word -> EVM () -> EVM () copyBytesToMemory :: Blob -> Word -> Word -> Word -> EVM () readMemory :: Word -> Word -> VM -> Blob word256At :: Functor f => Word -> (Word -> f Word) -> Memory -> f Memory withTraceLocation :: (MonadState VM m) => TraceData -> m Trace pushTrace :: TraceData -> EVM () insertTrace :: TraceData -> EVM () popTrace :: EVM () zipperRootForest :: TreePos Empty a -> Forest a traceForest :: VM -> Forest Trace traceLog :: (MonadState VM m) => Log -> m () push :: Word -> EVM () stackOp1 :: (?op :: Word8) => (Word -> Word) -> (Word -> Word) -> EVM () stackOp2 :: (?op :: Word8) => ((Word, Word) -> Word) -> ((Word, Word) -> Word) -> EVM () stackOp3 :: (?op :: Word8) => ((Word, Word, Word) -> Word) -> ((Word, Word, Word) -> Word) -> EVM () checkJump :: (Integral n) => n -> [Word] -> EVM () insidePushData :: Int -> EVM Bool opSize :: Word8 -> Int mkOpIxMap :: ByteString -> Vector Int vmOp :: VM -> Maybe Op vmOpIx :: VM -> Maybe Int opParams :: VM -> Map String Word readOp :: Word8 -> ByteString -> Op mkCodeOps :: ByteString -> Vector (Int, Op) costOfCall :: FeeSchedule Word -> Maybe a -> Word -> Word -> Word -> (Word, Word) memoryCost :: FeeSchedule Word -> Word -> Word ceilDiv :: (Num a, Integral a) => a -> a -> a allButOne64th :: (Num a, Integral a) => a -> a log2 :: FiniteBits b => b -> Int instance GHC.Base.Semigroup EVM.Cache instance GHC.Base.Monoid EVM.Cache instance GHC.Show.Show EVM.VMOpts instance GHC.Show.Show EVM.Error instance GHC.Show.Show EVM.VMResult instance GHC.Show.Show EVM.Contract instance GHC.Classes.Eq EVM.Contract instance GHC.Show.Show EVM.Query module EVM.Stepper -- | The instruction type of the operational monad data Action a -- | Keep executing until an intermediate result is reached [Exec] :: Action VMResult -- | Short-circuit with a failure [Fail] :: Failure -> Action a -- | Wait for a query to be resolved [Wait] :: Query -> Action () -- | Embed a VM state transformation [EVM] :: EVM a -> Action a -- | Write something to the log or terminal [Note] :: Text -> Action () -- | Some failure raised by a stepper data Failure ContractNotFound :: Failure DecodingError :: Failure VMFailed :: Error -> Failure -- | Type alias for an operational monad of Action type Stepper a = Program Action a exec :: Stepper VMResult -- | Run the VM until final result, resolving all queries execFully :: Stepper (Either Error Blob) execFullyOrFail :: Stepper Blob -- | Decode a blob as an ABI value, failing if ABI encoding wrong decode :: AbiType -> Blob -> Stepper AbiValue fail :: Failure -> Stepper a wait :: Query -> Stepper () evm :: EVM a -> Stepper a note :: Text -> Stepper () entering :: Text -> Stepper a -> Stepper a enter :: Text -> Stepper () instance GHC.Show.Show EVM.Stepper.Failure module EVM.Fetch -- | Abstract representation of an RPC fetch request data RpcQuery a [QueryCode] :: Addr -> RpcQuery ByteString [QueryBalance] :: Addr -> RpcQuery W256 [QueryNonce] :: Addr -> RpcQuery W256 [QuerySlot] :: Addr -> W256 -> RpcQuery W256 data BlockNumber Latest :: BlockNumber BlockNumber :: W256 -> BlockNumber mkr :: Addr rpc :: String -> [String] -> Value class ToRPC a toRPC :: ToRPC a => a -> String readText :: Read a => Text -> a fetchQuery :: Show a => BlockNumber -> (Value -> IO (Maybe Text)) -> RpcQuery a -> IO (Maybe a) fetchWithSession :: Text -> Session -> Value -> IO (Maybe Text) fetchContractWithSession :: BlockNumber -> Text -> Session -> Addr -> IO (Maybe Contract) fetchSlotWithSession :: BlockNumber -> Text -> Session -> Addr -> W256 -> IO (Maybe Word) fetchContractFrom :: BlockNumber -> Text -> Addr -> IO (Maybe Contract) fetchSlotFrom :: BlockNumber -> Text -> Addr -> W256 -> IO (Maybe Word) http :: BlockNumber -> Text -> Query -> IO (EVM ()) zero :: Monad m => Query -> m (EVM ()) type Fetcher = Query -> IO (EVM ()) instance GHC.Show.Show (EVM.Fetch.RpcQuery a) instance EVM.Fetch.ToRPC EVM.Types.Addr instance EVM.Fetch.ToRPC EVM.Types.W256 instance EVM.Fetch.ToRPC EVM.Fetch.BlockNumber module EVM.Facts data File File :: Path -> Data -> File [filePath] :: File -> Path [fileData] :: File -> Data data Fact BalanceFact :: Addr -> Word -> Fact [addr] :: Fact -> Addr [what] :: Fact -> Word NonceFact :: Addr -> Word -> Fact [addr] :: Fact -> Addr [what] :: Fact -> Word StorageFact :: Addr -> Word -> Word -> Fact [addr] :: Fact -> Addr [what] :: Fact -> Word [which] :: Fact -> Word CodeFact :: Addr -> ByteString -> Fact [addr] :: Fact -> Addr [blob] :: Fact -> ByteString newtype Data Data :: ASCII -> Data [dataASCII] :: Data -> ASCII data Path Path :: [ASCII] -> ASCII -> Path apply :: VM -> Set Fact -> VM contractFacts :: Addr -> Contract -> [Fact] vmFacts :: VM -> Set Fact factToFile :: Fact -> File fileToFact :: File -> Maybe Fact instance GHC.Show.Show EVM.Facts.File instance GHC.Classes.Ord EVM.Facts.File instance GHC.Classes.Eq EVM.Facts.File instance GHC.Show.Show EVM.Facts.Data instance GHC.Classes.Ord EVM.Facts.Data instance GHC.Classes.Eq EVM.Facts.Data instance GHC.Show.Show EVM.Facts.Path instance GHC.Classes.Ord EVM.Facts.Path instance GHC.Classes.Eq EVM.Facts.Path instance GHC.Show.Show EVM.Facts.Fact instance GHC.Classes.Eq EVM.Facts.Fact instance EVM.Facts.AsASCII EVM.Types.Addr instance EVM.Facts.AsASCII EVM.Concrete.Word instance EVM.Facts.AsASCII Data.ByteString.Internal.ByteString instance GHC.Classes.Ord EVM.Facts.Fact module EVM.Facts.Git saveFacts :: RepoAt -> Set Fact -> IO () loadFacts :: RepoAt -> IO (Set Fact) newtype RepoAt RepoAt :: String -> RepoAt instance GHC.Show.Show EVM.Facts.Git.RepoAt instance GHC.Classes.Ord EVM.Facts.Git.RepoAt instance GHC.Classes.Eq EVM.Facts.Git.RepoAt module EVM.Exec ethrunAddress :: Addr vmForEthrunCreation :: ByteString -> VM exec :: MonadState VM m => m VMResult execWhile :: MonadState VM m => (VM -> Bool) -> m Int module EVM.Debug data Mode Debug :: Mode Run :: Mode object :: [(Doc, Doc)] -> Doc prettyContract :: Contract -> Doc prettyContracts :: Map Addr Contract -> Doc srcMapCodePos :: SourceCache -> SrcMap -> Maybe (Text, Int) srcMapCode :: SourceCache -> SrcMap -> Maybe ByteString instance GHC.Show.Show EVM.Debug.Mode instance GHC.Classes.Eq EVM.Debug.Mode module EVM.Dapp data DappInfo DappInfo :: FilePath -> Map Text SolcContract -> Map W256 (CodeType, SolcContract) -> SourceCache -> [(Text, [Text])] -> Map W256 Event -> Map Int Value -> (SrcMap -> Maybe Value) -> DappInfo [_dappRoot] :: DappInfo -> FilePath [_dappSolcByName] :: DappInfo -> Map Text SolcContract [_dappSolcByHash] :: DappInfo -> Map W256 (CodeType, SolcContract) [_dappSources] :: DappInfo -> SourceCache [_dappUnitTests] :: DappInfo -> [(Text, [Text])] [_dappEventMap] :: DappInfo -> Map W256 Event [_dappAstIdMap] :: DappInfo -> Map Int Value [_dappAstSrcMap] :: DappInfo -> (SrcMap -> Maybe Value) dappUnitTests :: Lens' DappInfo [(Text, [Text])] dappSources :: Lens' DappInfo SourceCache dappSolcByName :: Lens' DappInfo (Map Text SolcContract) dappSolcByHash :: Lens' DappInfo (Map W256 (CodeType, SolcContract)) dappRoot :: Lens' DappInfo FilePath dappEventMap :: Lens' DappInfo (Map W256 Event) dappAstSrcMap :: Lens' DappInfo (SrcMap -> Maybe Value) dappAstIdMap :: Lens' DappInfo (Map Int Value) dappInfo :: FilePath -> Map Text SolcContract -> SourceCache -> DappInfo unitTestMarkerAbi :: Word32 findUnitTests :: (Text -> Bool) -> ([SolcContract] -> [(Text, [Text])]) unitTestMethods :: (Text -> Bool) -> (SolcContract -> [Text]) traceSrcMap :: DappInfo -> Trace -> Maybe SrcMap showTraceLocation :: DappInfo -> Trace -> Either Text Text module EVM.StorageLayout findContractDefinition :: DappInfo -> SolcContract -> Maybe Value storageLayout :: DappInfo -> SolcContract -> [Text] storageVariablesForContract :: Value -> Maybe [Text] nodeIs :: Text -> Value -> Bool isStorageVariableDeclaration :: Value -> Bool data SlotType StorageMapping :: (NonEmpty AbiType) -> AbiType -> SlotType StorageValue :: AbiType -> SlotType slotTypeSolidity :: SlotType -> Text slotTypeForDeclaration :: Value -> SlotType grokDeclarationType :: Value -> SlotType grokMappingType :: [Value] -> SlotType grokValueType :: Value -> AbiType instance GHC.Show.Show EVM.StorageLayout.SlotType module EVM.Format data Signedness Signed :: Signedness Unsigned :: Signedness showDec :: Signedness -> W256 -> Text showDecExact :: Integer -> Text showWordExact :: Word -> Text humanizeInteger :: (Num a, Integral a, Show a) => a -> Text showAbiValues :: Vector AbiValue -> Text showAbiArray :: Vector AbiValue -> Text showAbiValue :: AbiValue -> Text isPrintable :: ByteString -> Bool formatBytes :: ByteString -> Text formatQString :: ByteString -> Text formatString :: ByteString -> Text formatBinary :: ByteString -> Text showTraceTree :: DappInfo -> VM -> Text showTrace :: DappInfo -> Trace -> Text getAbiMethodOutput :: DappInfo -> W256 -> Word -> Maybe (Text, AbiType) getAbiTypes :: Text -> [Maybe AbiType] showCall :: [AbiType] -> ByteString -> Text showValue :: AbiType -> ByteString -> Text maybeContractName :: Maybe SolcContract -> Text maybeAbiName :: SolcContract -> Word -> Maybe Text contractNamePart :: Text -> Text contractPathPart :: Text -> Text formatLog :: Maybe Event -> ByteString -> Text getEvent :: Word -> Map W256 Event -> Maybe Event getEventName :: Maybe Event -> Text getEventUnindexedTypes :: Maybe Event -> [AbiType] getEventIndexedTypes :: Maybe Event -> [AbiType] getEventArgs :: Blob -> Text formatBlob :: Blob -> Text module EVM.Flatten flatten :: DappInfo -> Text -> IO () module EVM.UnitTest data UnitTestOptions UnitTestOptions :: Query -> IO (EVM ()) -> Bool -> Text -> VM -> VM -> TestVMParams -> UnitTestOptions [oracle] :: UnitTestOptions -> Query -> IO (EVM ()) [verbose] :: UnitTestOptions -> Bool [match] :: UnitTestOptions -> Text [vmModifier] :: UnitTestOptions -> VM -> VM [testParams] :: UnitTestOptions -> TestVMParams data TestVMParams TestVMParams :: Addr -> Addr -> Addr -> W256 -> W256 -> W256 -> W256 -> Addr -> W256 -> W256 -> W256 -> W256 -> W256 -> TestVMParams [testAddress] :: TestVMParams -> Addr [testCaller] :: TestVMParams -> Addr [testOrigin] :: TestVMParams -> Addr [testGasCreate] :: TestVMParams -> W256 [testGasCall] :: TestVMParams -> W256 [testBalanceCreate] :: TestVMParams -> W256 [testBalanceCall] :: TestVMParams -> W256 [testCoinbase] :: TestVMParams -> Addr [testNumber] :: TestVMParams -> W256 [testTimestamp] :: TestVMParams -> W256 [testGaslimit] :: TestVMParams -> W256 [testGasprice] :: TestVMParams -> W256 [testDifficulty] :: TestVMParams -> W256 defaultGasForCreating :: W256 defaultGasForInvoking :: W256 defaultBalanceForCreator :: W256 defaultBalanceForCreated :: W256 type ABIMethod = Text -- | Assuming a constructor is loaded, this stepper will run the -- constructor to create the test contract, give it an initial balance, -- and run `setUp()'. initializeUnitTest :: UnitTestOptions -> Stepper () -- | Assuming a test contract is loaded and initialized, this stepper will -- run the specified test method and return whether it succeeded. runUnitTest :: UnitTestOptions -> ABIMethod -> Stepper Bool tick :: Text -> IO () interpret :: UnitTestOptions -> Stepper a -> StateT VM IO (Either Failure a) -- | This is like an unresolved source mapping. data OpLocation OpLocation :: !W256 -> !Int -> OpLocation [srcCodehash] :: OpLocation -> !W256 [srcOpIx] :: OpLocation -> !Int srcMapForOpLocation :: DappInfo -> OpLocation -> Maybe SrcMap type CoverageState = (VM, MultiSet OpLocation) currentOpLocation :: VM -> OpLocation execWithCoverage :: StateT CoverageState IO VMResult interpretWithCoverage :: UnitTestOptions -> Stepper a -> StateT CoverageState IO (Either Failure a) coverageReport :: DappInfo -> MultiSet SrcMap -> Map Text (Vector (Int, ByteString)) coverageForUnitTestContract :: UnitTestOptions -> Map Text SolcContract -> SourceCache -> (Text, [Text]) -> IO (MultiSet SrcMap) runUnitTestContract :: UnitTestOptions -> Map Text SolcContract -> SourceCache -> (Text, [Text]) -> IO Bool indentLines :: Int -> Text -> Text passOutput :: VM -> Text -> Text failOutput :: VM -> DappInfo -> Text -> Text formatTestLogs :: Map W256 Event -> Seq Log -> Text formatTestLog :: Map W256 Event -> Log -> Maybe Text word32Bytes :: Word32 -> ByteString setupCall :: Addr -> Text -> W256 -> EVM () initialUnitTestVm :: UnitTestOptions -> SolcContract -> [SolcContract] -> VM getParametersFromEnvironmentVariables :: IO TestVMParams instance GHC.Show.Show EVM.UnitTest.OpLocation instance GHC.Classes.Ord EVM.UnitTest.OpLocation instance GHC.Classes.Eq EVM.UnitTest.OpLocation module EVM.TTY data Name AbiPane :: Name StackPane :: Name BytecodePane :: Name TracePane :: Name SolidityPane :: Name SolidityViewport :: Name TestPickerPane :: Name BrowserPane :: Name type UiWidget = Widget Name data UiVmState UiVmState :: VM -> Stepper () -> List Name (Int, Word) -> List Name (Int, Op) -> List Name Text -> List Name (Int, ByteString) -> Maybe SolcContract -> Maybe DappInfo -> Int -> UiVmState -> Maybe String -> [String] -> UiVmState [_uiVm] :: UiVmState -> VM [_uiVmNextStep] :: UiVmState -> Stepper () [_uiVmStackList] :: UiVmState -> List Name (Int, Word) [_uiVmBytecodeList] :: UiVmState -> List Name (Int, Op) [_uiVmTraceList] :: UiVmState -> List Name Text [_uiVmSolidityList] :: UiVmState -> List Name (Int, ByteString) [_uiVmSolc] :: UiVmState -> Maybe SolcContract [_uiVmDapp] :: UiVmState -> Maybe DappInfo [_uiVmStepCount] :: UiVmState -> Int [_uiVmFirstState] :: UiVmState -> UiVmState [_uiVmMessage] :: UiVmState -> Maybe String [_uiVmNotes] :: UiVmState -> [String] data UiTestPickerState UiTestPickerState :: List Name (Text, Text) -> DappInfo -> UiTestPickerState [_testPickerList] :: UiTestPickerState -> List Name (Text, Text) [_testPickerDapp] :: UiTestPickerState -> DappInfo data UiBrowserState UiBrowserState :: List Name (Addr, Contract) -> UiVmState -> UiBrowserState [_browserContractList] :: UiBrowserState -> List Name (Addr, Contract) [_browserVm] :: UiBrowserState -> UiVmState data UiState UiVmScreen :: UiVmState -> UiState UiVmBrowserScreen :: UiBrowserState -> UiState UiTestPickerScreen :: UiTestPickerState -> UiState uiVmTraceList :: Lens' UiVmState (List Name Text) uiVmStepCount :: Lens' UiVmState Int uiVmStackList :: Lens' UiVmState (List Name (Int, Word)) uiVmSolidityList :: Lens' UiVmState (List Name (Int, ByteString)) uiVmSolc :: Lens' UiVmState (Maybe SolcContract) uiVmNotes :: Lens' UiVmState [String] uiVmNextStep :: Lens' UiVmState (Stepper ()) uiVmMessage :: Lens' UiVmState (Maybe String) uiVmFirstState :: Lens' UiVmState UiVmState uiVmDapp :: Lens' UiVmState (Maybe DappInfo) uiVmBytecodeList :: Lens' UiVmState (List Name (Int, Op)) uiVm :: Lens' UiVmState VM testPickerList :: Lens' UiTestPickerState (List Name (Text, Text)) testPickerDapp :: Lens' UiTestPickerState DappInfo browserVm :: Lens' UiBrowserState UiVmState browserContractList :: Lens' UiBrowserState (List Name (Addr, Contract)) _UiTestPickerScreen :: Prism' UiState UiTestPickerState _UiVmBrowserScreen :: Prism' UiState UiBrowserState _UiVmScreen :: Prism' UiState UiVmState type Pred a = a -> Bool data StepMode -- | Finish after one opcode step StepOne :: StepMode -- | Run a specific number of steps StepMany :: !Int -> StepMode -- | Finish before the next opcode StepNone :: StepMode -- | Finish when a VM predicate holds StepUntil :: (Pred VM) -> StepMode -- | Each step command in the terminal should finish immediately with one -- of these outcomes. data StepOutcome a -- | Program finished Returned :: a -> StepOutcome a -- | Took one step; more steps to go Stepped :: (Stepper a) -> StepOutcome a -- | Came across blocking request Blocked :: (IO (Stepper a)) -> StepOutcome a -- | This turns a Stepper into a state action usable from within -- the TTY loop, yielding a StepOutcome depending on the -- StepMode. interpret :: (?fetcher :: Fetcher) => StepMode -> Stepper a -> State UiVmState (StepOutcome a) isUnitTestContract :: Text -> DappInfo -> Bool mkVty :: IO Vty runFromVM :: VM -> IO VM -- | Specifies whether to do I/O blocking or VM halting while stepping. -- When we step backwards, we don't want to allow those things. main :: UnitTestOptions -> FilePath -> FilePath -> IO () data StepPolicy -- | Allow blocking and returning StepNormally :: StepPolicy -- | Forbid blocking and returning StepTimidly :: StepPolicy takeStep :: (?fetcher :: Fetcher) => UiVmState -> StepPolicy -> StepMode -> EventM n (Next UiState) app :: UnitTestOptions -> App UiState () Name initialUiVmStateForTest :: UnitTestOptions -> DappInfo -> (Text, Text) -> UiVmState myTheme :: [(AttrName, Attr)] drawUi :: UiState -> [UiWidget] drawTestPicker :: UiTestPickerState -> [UiWidget] drawVmBrowser :: UiBrowserState -> [UiWidget] drawVm :: UiVmState -> [UiWidget] drawHelpBar :: UiWidget stepOneOpcode :: UiVmState -> UiVmState isNextSourcePosition :: UiVmState -> Pred VM isNextSourcePositionWithoutEntering :: UiVmState -> Pred VM currentSrcMap :: DappInfo -> VM -> Maybe SrcMap currentSolc :: DappInfo -> VM -> Maybe SolcContract renderVm :: UiVmState -> UiVmState updateUiVmState :: UiVmState -> VM -> UiVmState drawStackPane :: UiVmState -> UiWidget showWordExplanation :: W256 -> Maybe DappInfo -> Text drawBytecodePane :: UiVmState -> UiWidget dim :: Widget n -> Widget n withHighlight :: Bool -> Widget n -> Widget n drawTracePane :: UiVmState -> UiWidget drawSolidityPane :: UiVmState -> UiWidget ifTallEnough :: Int -> Widget n -> Widget n -> Widget n showPc :: (Integral a, Show a) => a -> String opWidget :: (Integral a, Show a) => (a, Op) -> Widget n selectedAttr :: AttrName dimAttr :: AttrName wordAttr :: AttrName boldAttr :: AttrName activeAttr :: AttrName instance GHC.Classes.Ord EVM.TTY.Name instance GHC.Show.Show EVM.TTY.Name instance GHC.Classes.Eq EVM.TTY.Name module EVM.Emacs data UiVmState UiVmState :: VM -> Stepper () -> Maybe SolcContract -> Maybe DappInfo -> Int -> UiVmState -> Fetcher -> Maybe Text -> UiVmState [_uiVm] :: UiVmState -> VM [_uiVmNextStep] :: UiVmState -> Stepper () [_uiVmSolc] :: UiVmState -> Maybe SolcContract [_uiVmDapp] :: UiVmState -> Maybe DappInfo [_uiVmStepCount] :: UiVmState -> Int [_uiVmFirstState] :: UiVmState -> UiVmState [_uiVmFetcher] :: UiVmState -> Fetcher [_uiVmMessage] :: UiVmState -> Maybe Text uiVmStepCount :: Lens' UiVmState Int uiVmSolc :: Lens' UiVmState (Maybe SolcContract) uiVmNextStep :: Lens' UiVmState (Stepper ()) uiVmMessage :: Lens' UiVmState (Maybe Text) uiVmFirstState :: Lens' UiVmState UiVmState uiVmFetcher :: Lens' UiVmState Fetcher uiVmDapp :: Lens' UiVmState (Maybe DappInfo) uiVm :: Lens' UiVmState VM type Pred a = a -> Bool data StepMode -- | Finish after one opcode step StepOne :: StepMode -- | Run a specific number of steps StepMany :: !Int -> StepMode -- | Finish before the next opcode StepNone :: StepMode -- | Finish when a VM predicate holds StepUntil :: (Pred VM) -> StepMode data StepOutcome a -- | Program finished Returned :: a -> StepOutcome a -- | Took one step; more steps to go Stepped :: (Stepper a) -> StepOutcome a -- | Came across blocking request Blocked :: (IO (Stepper a)) -> StepOutcome a interpret :: StepMode -> Stepper a -> State UiVmState (StepOutcome a) stepOneOpcode :: UiVmState -> UiVmState updateUiVmState :: UiVmState -> VM -> UiVmState type Sexp = WellFormedSExpr HaskLikeAtom prompt :: Console (Maybe Sexp) class SDisplay a sexp :: SDisplay a => a -> SExpr Text display :: SDisplay a => a -> Text txt :: Show a => a -> Text data UiState UiStarted :: UiState UiDappLoaded :: DappInfo -> UiState UiVm :: UiVmState -> UiState type Console a = StateT UiState IO a output :: SDisplay a => a -> Console () main :: IO () loop :: Console () handle :: Sexp -> Console () handleCmd :: UiState -> (Text, [Sexp]) -> Console () outputVm :: Console () isNextSourcePosition :: UiVmState -> Pred VM -- | Specifies whether to do I/O blocking or VM halting while stepping. -- When we step backwards, we don't want to allow those things. parseStepMode :: UiVmState -> Text -> Maybe StepMode data StepPolicy -- | Allow blocking and returning StepNormally :: StepPolicy -- | Forbid blocking and returning StepTimidly :: StepPolicy takeStep :: UiVmState -> StepPolicy -> StepMode -> Console () quoted :: Text -> Text defaultUnitTestOptions :: MonadIO m => m UnitTestOptions initialStateForTest :: UnitTestOptions -> DappInfo -> (Text, Text) -> UiVmState instance EVM.Emacs.SDisplay EVM.Dapp.DappInfo instance EVM.Emacs.SDisplay (Data.SCargot.Repr.SExpr Data.Text.Internal.Text) instance EVM.Emacs.SDisplay EVM.VM instance EVM.Emacs.SDisplay EVM.Types.Addr instance EVM.Emacs.SDisplay EVM.Contract instance EVM.Emacs.SDisplay EVM.Types.W256 instance (EVM.Emacs.SDisplay k, EVM.Emacs.SDisplay v) => EVM.Emacs.SDisplay (Data.Map.Internal.Map k v) instance EVM.Emacs.SDisplay a => EVM.Emacs.SDisplay (GHC.Base.Maybe a) instance EVM.Emacs.SDisplay EVM.VMResult instance EVM.Emacs.SDisplay EVM.Frame instance EVM.Emacs.SDisplay EVM.Concrete.Blob instance EVM.Emacs.SDisplay EVM.FrameContext instance EVM.Emacs.SDisplay EVM.FrameState instance EVM.Emacs.SDisplay a => EVM.Emacs.SDisplay [a] instance EVM.Emacs.SDisplay EVM.Concrete.Word instance EVM.Emacs.SDisplay Data.ByteString.Internal.ByteString instance EVM.Emacs.SDisplay EVM.Concrete.Memory module EVM.Dev loadDappInfo :: String -> String -> IO DappInfo ghciTest :: String -> String -> Maybe String -> IO [Bool] ghciTty :: String -> String -> Maybe String -> IO () ghciEmacs :: IO () foo :: IO () module EVM.VMTest data Case parseSuite :: ByteString -> Either String (Map String Case) vmForCase :: Case -> VM checkExpectation :: Case -> VM -> IO Bool interpret :: Stepper a -> EVM a instance GHC.Show.Show EVM.VMTest.Case instance GHC.Show.Show EVM.VMTest.Expectation instance GHC.Show.Show EVM.VMTest.Contract instance Data.Aeson.Types.FromJSON.FromJSON EVM.VMTest.Case instance Data.Aeson.Types.FromJSON.FromJSON EVM.VMTest.Contract module Paths_hevm version :: Version getBinDir :: IO FilePath getLibDir :: IO FilePath getDynLibDir :: IO FilePath getDataDir :: IO FilePath getLibexecDir :: IO FilePath getDataFileName :: FilePath -> IO FilePath getSysconfDir :: IO FilePath