|
|
|
@ -36,7 +36,7 @@ import Echidna.ABI (encodeSig, hashSig, stripBytecodeMetadata, fa |
|
|
|
|
import Echidna.Exec (execTx) |
|
|
|
|
import Echidna.RPC (loadEthenoBatch) |
|
|
|
|
import Echidna.Types.Signature (FunctionHash, SolSignature, SignatureMap) |
|
|
|
|
import Echidna.Types.Tx (TxConf, TxCall(..), Tx(..)) |
|
|
|
|
import Echidna.Types.Tx (TxConf, TxCall(..), Tx(..), initialTimestamp, initialBlockNumber) |
|
|
|
|
import Echidna.Types.World (World(..)) |
|
|
|
|
import Echidna.Processor |
|
|
|
|
|
|
|
|
@ -162,7 +162,7 @@ loadLibraries :: (MonadIO m, MonadThrow m, MonadReader x m, Has SolConf x) |
|
|
|
|
=> [SolcContract] -> Addr -> Addr -> VM -> m VM |
|
|
|
|
loadLibraries [] _ _ vm = return vm |
|
|
|
|
loadLibraries (l:ls) la d vm = loadLibraries ls (la + 1) d =<< loadRest |
|
|
|
|
where loadRest = execStateT (execTx $ Tx (SolCreate $ l ^. creationCode) d la 8000030 0 0 (0,0)) vm |
|
|
|
|
where loadRest = execStateT (execTx $ Tx (SolCreate $ l ^. creationCode) d la 8000030 0 0 (initialTimestamp, initialBlockNumber)) vm |
|
|
|
|
|
|
|
|
|
-- | Generate a string to use as argument in solc to link libraries starting from addrLibrary |
|
|
|
|
linkLibraries :: [String] -> String |
|
|
|
@ -234,7 +234,7 @@ loadSpecified name cs = do |
|
|
|
|
Just (t,_) -> throwM $ TestArgsFound t -- Test args check |
|
|
|
|
Nothing -> do |
|
|
|
|
vm <- loadLibraries ls addrLibrary d blank |
|
|
|
|
let transaction = unless (isJust fp) $ void . execTx $ Tx (SolCreate bc) d ca 8000030 0 (w256 $ fromInteger balc) (0, 0) |
|
|
|
|
let transaction = unless (isJust fp) $ void . execTx $ Tx (SolCreate bc) d ca 8000030 0 (w256 $ fromInteger balc) (initialTimestamp,initialBlockNumber) |
|
|
|
|
vm' <- execStateT transaction vm |
|
|
|
|
case currentContract vm' of |
|
|
|
|
Just _ -> return (vm', neFuns, fst <$> tests, abiMapping) |
|
|
|
|