@@ -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
@@ -264,15 +269,19 @@ mkSignatureMap solConf mainContract contracts = do
264269 -- Filter ABI according to the config options
265270 fabiOfc = if isDapptestMode solConf. testMode
266271 then NE. toList $ filterMethodsWithArgs (abiOf solConf. prefix mainContract)
267- else filterMethods mainContract. contractName solConf. methodFilter $
268- abiOf solConf. prefix mainContract
272+ else if isExplorationMode solConf. testMode
273+ then NE. toList $ fullAbiOf mainContract
274+ else filterMethods mainContract. contractName solConf. methodFilter $
275+ abiOf solConf. prefix mainContract
269276 -- Construct ABI mapping for World
270277 abiMapping =
271278 if solConf. allContracts then
272279 Map. fromList $ mapMaybe (\ contract ->
273- let filtered = filterMethods contract. contractName
274- solConf. methodFilter
275- (abiOf solConf. prefix contract)
280+ let filtered = if isExplorationMode solConf. testMode
281+ then NE. toList $ fullAbiOf contract
282+ else filterMethods contract. contractName
283+ solConf. methodFilter
284+ (abiOf solConf. prefix contract)
276285 in (contract. runtimeCodehash,) <$> NE. nonEmpty filtered)
277286 contracts
278287 else
0 commit comments