Skip to content

dapp --replay passes incorrect string to hevm #722

@transmissions11

Description

@transmissions11

Running with dapp fails:

 dapp debug --replay '("invariantMetadata()", "0xf893f8919400a329c0648769a73afac7f9381e08fb43dbea7294ce71065d4017f316ec606fe4422e11eb2c47c246b84440c10f1900000000000000000000000000000000000000000000000000000000000ff0dacf45a6e39dc751df612f1d23e577471e184b84a51f02b3c5c641593ab34b8a68a00000000000000000000000000000000000000000000000000000000000000005")'
+ DAPP_LINK_TEST_LIBRARIES=1
+ dapp build
 dapp-build: building with linked libraries
dapp: Predeploying test library src/erc20/SafeERC20.sol:SafeERC20 at 0x0DdeDfFe2789df61F5f76479464F568334414389
dapp: Predeploying test library src/utils/FixedPointMath.sol:FixedPointMath at 0x5Fe5dAc04fe3527Cf7bDba8798F5A8b5edDfE4Af
+ hevm dapp-test --debug --dapp-root=. --state=hevm.libs.if4oJ --json-file=out/dapp.sol.json --replay '("invariantMetadata()",' '"0xf893f8919400a329c0648769a73afac7f9381e08fb43dbea7294ce71065d4017f316ec606fe4422e11eb2c47c246b84440c10f1900000000000000000000000000000000000000000000000000000000000ff0dacf45a6e39dc751df612f1d23e577471e184b84a51f02b3c5c641593ab34b8a68a00000000000000000000000000000000000000000000000000000000000000005")' --verbose 1 --fuzz-runs 200 --smttimeout 60000
Usage: hevm dapp-test [--json-file STRING] [--dapp-root STRING] [--debug]
                      [--jsontrace] [--fuzz-runs INT] [--depth INT]
                      [--replay (TEXT,BYTESTRING)] [--rpc TEXT] [--verbose INT]
                      [--coverage] [--state STRING] [--cache STRING]
                      [--match STRING] [--smttimeout INTEGER]
                      [--max-iterations INTEGER] [--solver TEXT] [--smtdebug]
                      [--ffi]

Available options:
  -h,--help                Show this help text
  --json-file STRING       Filename or path to dapp build output (default:
                           out/*.solc.json)
  --dapp-root STRING       Path to dapp project root directory (default: . )
  --debug                  Run interactively
  --jsontrace              Print json trace output at every step
  --fuzz-runs INT          Number of times to run fuzz tests
  --depth INT              Number of transactions to explore
  --replay (TEXT,BYTESTRING)
                           Custom fuzz case to run/debug
  --rpc TEXT               Fetch state from a remote node
  --verbose INT            Append call trace: {1} failures {2} all
  --coverage               Coverage analysis
  --state STRING           Path to state repository
  --cache STRING           Path to rpc cache repository
  --match STRING           Test case filter - only run methods matching regex
  --smttimeout INTEGER     Timeout given to SMT solver in milliseconds (default:
                           30000)
  --max-iterations INTEGER Number of times we may revisit a particular branching
                           point
  --solver TEXT            Used SMT solver: z3 (default) or cvc4
  --smtdebug               Print smt queries sent to the solver
  --ffi                    Allow the usage of the hevm.ffi() cheatcode (WARNING:
                           this allows test authors to execute arbitrary code on
                           your machine)

Running directly with hevm works:

hevm dapp-test --debug --dapp-root=. --json-file=out/dapp.sol.json --replay '("invariantMetadata()","0xf893f8919400a329c0648769a73afac7f9381e08fb43dbea7294ce71065d4017f316ec606fe4422e11eb2c47c246b84440c10f1900000000000000000000000000000000000000000000000000000000000ff0dacf45a6e39dc751df612f1d23e577471e184b84a51f02b3c5c641593ab34b8a68a00000000000000000000000000000000000000000000000000000000000000005")'

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions