argotorg / argotorg/hevm

Support to function deal (3 parameters) of StdCheats.sol

Open
#423 1 comment 0 reactions 0 assignees View on GitHub
enhancement
Dominant language
Haskell
Stars
358
Forks
79
Avg merge
1d 1h
Merged PRs (30d)
6

Description

Configuration:
MacBook Pro, Apple M1 Pro, Sonoma 14.0, 32GB RAM

hevm: version 0.52.0
Z3: Z3 version 4.12.2 - 64 bit

When I call the below function in a symbolic test (prove):

function deal(address token, address to, uint256 give, bool adjust) internal virtual

I got

[FAIL] prove_harvest()

Failure: prove_harvest()

No reachable assertion violations, but all branches reverted
Prefix this testname with `proveFail` if this is expected

And I identified that the cause is in this statement:

// update balance
stdstore.target(token).sig(0x70a08231).with_key(to).checked_write(give);

Thanks!

Contributor guide

No contributing guide indexed for this repository

Research direction

Start in StdCheats.sol at deal(address token, address to, uint256 give, bool adjust), then inspect the stdstore.target(token).sig(0x70a08231).with_key(to).checked_write(give) call. Reproduce the symbolic prove_harvest() failure and verify that the three-parameter deal path no longer causes all branches to revert.

Written by the indexing model from the issue text.

Assessment

Tech stack
solidity
Domain
blockchain, testing
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
42/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.