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

Console logs does not include variable and are not displayed in forge scripts #457

Open
dutterbutter opened this issue Nov 29, 2024 · 0 comments

Comments

@dutterbutter
Copy link
Collaborator

dutterbutter commented Nov 29, 2024

📝 Description

Console logs does not include variable and are not displayed in forge scripts in era-test-node

🔄 Reproduction Steps

  1. Build era_test_node
  2. ./era_test_node run
  3. Init a foundry project (forge init hello_world)
  4. cd hello_world
  5. Update template script to the following:
// SPDX-License-Identifier: UNLICENSED
pragma solidity ^0.8.13;

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

contract CounterScript is Script {
    Counter public counter;

    function setUp() public {}

    function run() public {
        vm.startBroadcast();

        counter = new Counter();
        console.log("Counter address: ", address(counter));
        counter.setNumber(10);

        vm.stopBroadcast();
    }
}
  1. Run:
forge script script/Counter.s.sol:CounterScript \
  --rpc-url http://localhost:8011 \
  --broadcast \
  --private-key <PK> \
  -vvvv  --zksync --slow
  1. Observe no console log. When the same log is applied in src/Counter.sol you only get the message with no variable

🤔 Expected Behavior

See console as written

😯 Current Behavior

You do not see the console log in scripts, and you do not see the variable even in contract

🖥️ Environment

  • Rust version: [e.g., rustc 1.52.0]
  • Operating System & Version: [e.g., Ubuntu 20.04]
  • Other relevant environment details:

📋 Additional Context

Add any other context about the problem here. If applicable, add screenshots to help explain.

📎 Log Output

Paste any relevant log output here.
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

1 participant