Skip to content

Commit

Permalink
fix errors
Browse files Browse the repository at this point in the history
  • Loading branch information
zoep committed Apr 2, 2024
1 parent d042937 commit db9c2c9
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 12 deletions.
6 changes: 3 additions & 3 deletions flake.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

15 changes: 6 additions & 9 deletions src/Act/HEVM.hs
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
{-# LANGUAGE NoFieldSelectors #-}

-- {-# LANGUAGE TypeApplications #-}
-- {-# LANGUAGE DuplicateRecordFields #-}
{-# LANGUAGE DuplicateRecordFields #-}

module Act.HEVM where

Expand Down Expand Up @@ -48,7 +48,7 @@ import EVM.SMT (SMTCex(..), assertProps)
import EVM.Solvers
import EVM.Effects
import EVM.Format as Format

import EVM.Traversals

type family ExprType a where
ExprType 'AInteger = EVM.EWord
Expand Down Expand Up @@ -394,7 +394,7 @@ ethEnvToWord Callvalue = pure $ EVM.TxValue
ethEnvToWord Caller = do
c <- getCaller
pure $ EVM.WAddr c
ethEnvToWord Origin = EVM.WAddr (EVM.SymAddr "origin") -- Why not: pure $ EVM.Origin
ethEnvToWord Origin = pure $ EVM.WAddr (EVM.SymAddr "origin") -- Why not: pure $ EVM.Origin
ethEnvToWord Blocknumber = pure $ EVM.BlockNumber
ethEnvToWord Blockhash = pure $ EVM.BlockHash $ EVM.Lit 0
ethEnvToWord Chainid = pure $ EVM.ChainId
Expand Down Expand Up @@ -463,11 +463,8 @@ stripMods = mapExpr go
go (EVM.Mod a (EVM.Lit MAX_UINT)) = a
go a = a

<<<<<<< HEAD
toExpr :: forall a. Layout -> Exp a -> EVM.Expr (ExprType a)
toExpr layout =
toExpr :: forall a. ContractMap -> Exp a -> ActM (EVM.Expr (ExprType a))
toExpr cmap = stripMods . go
toExpr :: forall a. ContractMap -> Exp a -> ActM (EVM.Expr (ExprType a))
toExpr cmap = liftM stripMods . go
where
go = \case
-- booleans
Expand Down Expand Up @@ -521,7 +518,7 @@ toExpr cmap = stripMods . go
pure $ EVM.Not $ e
(NEq _ _ _ _) -> error "unsupported"

(ITE _ _ _ _) -> error $ "Internal error: expecting flat expression. got: " <> show e
e@(ITE _ _ _ _) -> error $ "Internal error: expecting flat expression. got: " <> show e
(Var _ SInteger typ x) -> -- TODO other types
pure $ fromCalldataFramgment $ symAbiArg (T.pack x) typ

Expand Down

0 comments on commit db9c2c9

Please sign in to comment.