nicolasgarcia214 / damn-vulnerable-defi-foundry

Damn Vulnerable DeFi - Foundry Version
MIT License
494 stars 189 forks source link

Error when running Puppet tests #34

Closed wallebach closed 10 months ago

wallebach commented 11 months ago

What version of Foundry are you on?

forge 0.2.0 (9e3ab9b 2024-01-04T00:18:01.892563000Z)

Describe the bug

For the first Puppet I get this error:

Encountered 1 failing test in test/Levels/puppet/Puppet.t.sol:Puppet
[FAIL. Reason: setup failed: missing field `stateMutability` at line 34 column 8] setUp() (gas: 0)

For Puppet V2 there is the following error:

Encountered 1 failing test in test/Levels/puppet-v2/PuppetV2.t.sol:PuppetV2
[FAIL. Reason: setup failed: duplicate field `bytecode` at line 403 column 14] setUp() (gas: 0)

Why could this happen and what to do?

wallebach commented 11 months ago

I downgraded as mentioned here https://github.com/nicolasgarcia214/damn-vulnerable-defi-foundry/issues/22#issuecomment-1325814904, but the issue still occurs. Now on versionforge 0.2.0 (9e3ab9b 2024-01-04T00:18:01.892563000Z)

wallebach commented 11 months ago

I tried to install a virtual environment (Ubuntu) on my Mac, but the issue still occurs even in the virtual environment. Could it be somehow related to Apple M1 processor?

cy4n1d3-p1x3l commented 11 months ago

94777647f6ea5d34572a1b15c9b57e35b8c77b41 migrate to this foundry commit instead it'll work

wallebach commented 10 months ago

Yes, it works now! Thanks a lot @cy4n1d3-p1x3l ! Why does it work on this specific commit?

cy4n1d3-p1x3l commented 10 months ago

No idea I just searched the commit in the repo around the time previous listed issue was addressed and found this particular commit. Maybe try raising a issue in the foundry repo, it'll be of great help to the both of us and Manu others.