Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Abstract gas v3 #427

Merged
merged 11 commits into from
Jan 16, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 5 additions & 6 deletions cli/cli.hs
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,8 @@ import EVM.Solvers
import EVM.Stepper qualified
import EVM.SymExec
import EVM.Transaction qualified
import EVM.Types hiding (word, Env)
import EVM.Types hiding (word, Env, Symbolic)
import EVM.Types qualified
import EVM.UnitTest
import EVM.Effects

Expand Down Expand Up @@ -405,7 +406,7 @@ launchExec cmd = do
internalError "no EVM result"

-- | Creates a (concrete) VM from command line options
vmFromCommand :: Command Options.Unwrapped -> IO (VM RealWorld)
vmFromCommand :: Command Options.Unwrapped -> IO (VM Concrete RealWorld)
vmFromCommand cmd = do
(miner,ts,baseFee,blockNum,prevRan) <- case cmd.rpc of
Nothing -> pure (LitAddr 0,Lit 0,0,0,0)
Expand Down Expand Up @@ -490,14 +491,13 @@ vmFromCommand cmd = do
, baseState = EmptyBase
, txAccessList = mempty -- TODO: support me soon
, allowFFI = False
, symbolic = False
}
word f def = fromMaybe def (f cmd)
word64 f def = fromMaybe def (f cmd)
addr f def = maybe def LitAddr (f cmd)
bytes f def = maybe def decipher (f cmd)

symvmFromCommand :: Command Options.Unwrapped -> (Expr Buf, [Prop]) -> IO (VM RealWorld)
symvmFromCommand :: Command Options.Unwrapped -> (Expr Buf, [Prop]) -> IO (VM EVM.Types.Symbolic RealWorld)
symvmFromCommand cmd calldata = do
(miner,blockNum,baseFee,prevRan) <- case cmd.rpc of
Nothing -> pure (SymAddr "miner",0,0,0)
Expand Down Expand Up @@ -555,7 +555,7 @@ symvmFromCommand cmd calldata = do
, address = address
, caller = caller
, origin = origin
, gas = word64 (.gas) 0xffffffffffffffff
, gas = ()
, gaslimit = word64 (.gaslimit) 0xffffffffffffffff
, baseFee = baseFee
, priorityFee = word (.priorityFee) 0
Expand All @@ -572,7 +572,6 @@ symvmFromCommand cmd calldata = do
, baseState = maybe AbstractBase parseInitialStorage (cmd.initialStorage)
, txAccessList = mempty
, allowFFI = False
, symbolic = True
}
word f def = fromMaybe def (f cmd)
word64 f def = fromMaybe def (f cmd)
Expand Down
2 changes: 2 additions & 0 deletions hevm.cabal
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,8 @@ common shared
-Wno-orphans
-Wno-ambiguous-fields
-optc-Wno-ignored-attributes
-fspecialize-aggressively
-fexpose-all-unfoldings
default-language: GHC2021
default-extensions:
DuplicateRecordFields
Expand Down
Loading