@@ -43,7 +43,7 @@ import Echidna.Etheno (loadEthenoBatch)
4343import Echidna.Events (extractEvents )
4444import Echidna.Exec (execTx , execTxWithCov , initialVM )
4545import Echidna.SourceAnalysis.Slither
46- import Echidna.Test (createTests , isAssertionMode , isPropertyMode , isDapptestMode )
46+ import Echidna.Test (createTests , isAssertionMode , isPropertyMode , isDapptestMode , isExplorationMode )
4747import Echidna.Types.Campaign (CampaignConf (.. ))
4848import Echidna.Types.Config (EConfig (.. ), Env (.. ))
4949import Echidna.Types.Signature
@@ -155,11 +155,16 @@ filterMethodsWithArgs ms =
155155 [] -> error " No dapptest tests found"
156156 fs -> NE. fromList fs
157157
158+ fullAbiOf :: SolcContract -> NonEmpty SolSignature
159+ fullAbiOf solcContract =
160+ fallback :|
161+ (Map. elems solcContract. abiMap <&> \ method -> (method. name, snd <$> method. inputs))
162+
158163abiOf :: Text -> SolcContract -> NonEmpty SolSignature
159164abiOf pref solcContract =
160165 fallback :|
161166 filter (not . isPrefixOf pref . fst )
162- (Map. elems solcContract . abiMap <&> \ method -> (method . name, snd <$> method . inputs) )
167+ (NE. tail $ fullAbiOf solcContract )
163168
164169-- | Given an optional contract name and a list of 'SolcContract's, try to load the specified
165170-- contract, or, if not provided, the first contract in the list, into a 'VM' usable for Echidna
@@ -262,17 +267,20 @@ mkSignatureMap
262267mkSignatureMap solConf mainContract contracts = do
263268 let
264269 -- Filter ABI according to the config options
265- fabiOfc = if isDapptestMode solConf. testMode
266- then NE. toList $ filterMethodsWithArgs (abiOf solConf. prefix mainContract)
267- else filterMethods mainContract. contractName solConf. methodFilter $
268- abiOf solConf. prefix mainContract
270+ fabiOfc
271+ | isDapptestMode solConf. testMode = NE. toList $ filterMethodsWithArgs (abiOf solConf. prefix mainContract)
272+ | isExplorationMode solConf. testMode = NE. toList $ fullAbiOf mainContract
273+ | otherwise = filterMethods mainContract. contractName solConf. methodFilter $
274+ abiOf solConf. prefix mainContract
269275 -- Construct ABI mapping for World
270276 abiMapping =
271277 if solConf. allContracts then
272278 Map. fromList $ mapMaybe (\ contract ->
273- let filtered = filterMethods contract. contractName
274- solConf. methodFilter
275- (abiOf solConf. prefix contract)
279+ let filtered = if isExplorationMode solConf. testMode
280+ then NE. toList $ fullAbiOf contract
281+ else filterMethods contract. contractName
282+ solConf. methodFilter
283+ (abiOf solConf. prefix contract)
276284 in (contract. runtimeCodehash,) <$> NE. nonEmpty filtered)
277285 contracts
278286 else
0 commit comments