crytic / medusa

Parallelized, coverage-guided, mutational Solidity smart contract fuzzing, powered by go-ethereum
https://secure-contracts.com/program-analysis/medusa/docs/src/
GNU Affero General Public License v3.0
301 stars 40 forks source link

add call sequence mutation that copies and repeats a call #376

Open 0xalpharush opened 4 months ago

0xalpharush commented 4 months ago

https://github.com/crytic/medusa/blob/master/fuzzing/fuzzer_worker_sequence_generator.go https://github.com/crytic/echidna/blob/2c72579e72eb2818d63c60a11180e7359f9984e4/lib/Echidna/Mutator/Corpus.hs#L37 https://github.com/crytic/echidna/blob/2c72579e72eb2818d63c60a11180e7359f9984e4/lib/Echidna/Mutator/Array.hs#L43-L51

We may also want to do the same for solidity array (repeat element in a list)

0xalpharush commented 3 months ago

Add a new generator callSeqGenFuncDuplicateAtRandom which duplicates a call seq. elem at index N and inserts it at N+1. Will be helpful to reference existing implementation https://github.com/crytic/medusa/blob/7b67cebd5b36bdc8005f935c0b9c1522c3a514d3/fuzzing/fuzzer_worker_sequence_generator.go#L356