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 v2 #403

Closed
wants to merge 14 commits into from
9 changes: 3 additions & 6 deletions cli/cli.hs
Original file line number Diff line number Diff line change
Expand Up @@ -27,13 +27,12 @@ import System.Directory (withCurrentDirectory, getCurrentDirectory, doesDirector
import System.FilePath ((</>))
import System.Exit (exitFailure, exitWith, ExitCode(..))

import EVM (initialContract, abstractContract, makeVm)
import EVM (initialContract, abstractContract, makeVm, SymGas(..))
import EVM.ABI (Sig(..))
import EVM.Dapp (dappInfo, DappInfo, emptyDapp)
import EVM.Expr qualified as Expr
import EVM.Concrete qualified as Concrete
import GitHash
import EVM.FeeSchedule (feeSchedule)
import EVM.Fetch qualified as Fetch
import EVM.Format (hexByteString, strip0x, formatExpr)
import EVM.Solidity
Expand Down Expand Up @@ -401,7 +400,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 Word64 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 @@ -480,7 +479,6 @@ vmFromCommand cmd = do
, gasprice = word (.gasprice) 0
, maxCodeSize = word (.maxcodesize) 0xffffffff
, prevRandao = word (.prevRandao) prevRan
, schedule = feeSchedule
, chainId = word (.chainid) 1
, create = (.create) cmd
, baseState = EmptyBase
Expand All @@ -492,7 +490,7 @@ vmFromCommand cmd = do
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 SymGas RealWorld)
symvmFromCommand cmd calldata = do
(miner,blockNum,baseFee,prevRan) <- case cmd.rpc of
Nothing -> pure (SymAddr "miner",0,0,0)
Expand Down Expand Up @@ -561,7 +559,6 @@ symvmFromCommand cmd calldata = do
, gasprice = word (.gasprice) 0
, maxCodeSize = word (.maxcodesize) 0xffffffff
, prevRandao = word (.prevRandao) prevRan
, schedule = feeSchedule
, chainId = word (.chainid) 1
, create = (.create) cmd
, baseState = maybe AbstractBase parseInitialStorage (cmd.initialStorage)
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