Skip to content

Commit

Permalink
fix: use the shrunken abi values as the msg's data (#374)
Browse files Browse the repository at this point in the history
  • Loading branch information
0xalpharush authored Jun 24, 2024
1 parent 6750032 commit 08a6eab
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions fuzzing/fuzzer_worker.go
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ import (
fuzzerTypes "github.com/crytic/medusa/fuzzing/contracts"
"github.com/crytic/medusa/fuzzing/coverage"
"github.com/crytic/medusa/fuzzing/valuegeneration"
"github.com/crytic/medusa/logging"
"github.com/crytic/medusa/utils"
"github.com/ethereum/go-ethereum/common"
"golang.org/x/exp/maps"
Expand Down Expand Up @@ -466,6 +467,13 @@ func (fw *FuzzerWorker) shrinkCallSequence(callSequence calls.CallSequence, shri
abiValuesMsgData.InputValues[j] = mutatedInput
}

// Re-encode the ABI values as calldata.
abiData, err := abiValuesMsgData.Pack()
if err != nil {
logging.GlobalLogger.Panic("Failed to pack call message ABI values", err)
}
possibleShrunkSequence[i].Call.Data = abiData

// Test the shrunken sequence.
validShrunkSequence, err := fw.testShrunkenCallSequence(possibleShrunkSequence, shrinkRequest)
shrinkIteration++
Expand Down

0 comments on commit 08a6eab

Please sign in to comment.