Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

unknown selector 0xdb4235f6 for VmCalls (no support for keyExistsJson) #388

Closed
2 tasks done
PatrickAlphaC opened this issue May 21, 2024 · 3 comments
Closed
2 tasks done

Comments

@PatrickAlphaC
Copy link

Component

Forge

Have you ensured that all of these are up to date?

  • Foundry
  • Foundryup

What version of Foundry are you on?

forge 0.0.2 (dc4b81f 2024-05-21T15:26:16.686968000Z)

What command(s) is the bug in?

forge test

Operating System

macOS (Intel)

Describe the bug

  1. Install foundry-zksync
  2. forge init
  3. Set your Counter.s.sol to the following:
// SPDX-License-Identifier: UNLICENSED
pragma solidity ^0.8.13;

import {Script, console} from "forge-std/Script.sol";

contract CounterScript is Script {
    function setUp() public {}

    function run() public {
        bool exists = vm.keyExistsJson('{"hi": "true"}', ".hi");
        console.log(exists);
    }
}
  1. Run the script:
forge script script/Counter.s.sol 

You'll get an output like:

✓ Compiled 20 files!     
Traces:
  [121871] → new CounterScript@0x7FA9385bE102ac3EAc297483Dd6233D62b3e1496
    └─ ← 498 bytes of code

  [98] CounterScript::setUp()
    └─ ← ()

  [2994] CounterScript::run()
    ├─ [0] VM::keyExistsJson("{\"hi\": \"true\"}", ".hi") [staticcall]
    │   └─ ← unknown selector `0xdb4235f6` for VmCalls
    └─ ← unknown selector `0xdb4235f6` for VmCalls


Gas used: 24058
Error: 
script failed: unknown selector `0xdb4235f6` for VmCalls

However, run it with vanilla foundry:

foundryup
 forge script script/Counter.s.sol

and you'll get:

Script ran successfully.
Gas used: 27031

== Logs ==
  true
@RonTuretzky
Copy link

also experiencing this on forge 2cb8757

@Karrq
Copy link
Contributor

Karrq commented Jun 26, 2024

As @nbaztec already mentioned here, this is due to the cheatcode in question (and possibly others) being added after our latest update from upstream foundry.
Currently we are in the process of updating our fork to upstream, which will add support to this cheatcode as well as others that have been added since then.

@Karrq
Copy link
Contributor

Karrq commented Jun 26, 2024

Tracking in #443

@Karrq Karrq closed this as not planned Won't fix, can't repro, duplicate, stale Jun 26, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants