Skip to content

Support for hardhat/foundry console output#1050

Open
gustavo-grieco wants to merge 9 commits intomainfrom
dev-console
Open

Support for hardhat/foundry console output#1050
gustavo-grieco wants to merge 9 commits intomainfrom
dev-console

Conversation

@gustavo-grieco
Copy link
Copy Markdown
Collaborator

@gustavo-grieco gustavo-grieco commented Mar 26, 2026

Description

This PR implement console logging in the same way Foundry did (and Hardhat initially). The feature is explained here. This will help to fix crytic/echidna#1233.

Checklist

  • tested locally
  • added automated tests
  • updated the docs
  • updated the changelog

Copy link
Copy Markdown
Collaborator

@msooseth msooseth left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, but can you maybe give more explanation at the top of the PR what this is about? I am not very familiar with hardhat. Then I'll approve and we can merge!

@gustavo-grieco
Copy link
Copy Markdown
Collaborator Author

Added some description to this PR.

Copy link
Copy Markdown
Collaborator

@blishko blishko left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks reasonable to me.
The tests need additional work.

EXTCODESIZE now returns 1 for the console address (matching cheatCode
behavior), so contracts that check code size before calling won't
skip the console.log call. Added 8 new tests covering EXTCODESIZE,
format decoding (bool, address, no-args, unknown selector, short
input), return value correctness, and multiple console.log calls.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@msooseth
Copy link
Copy Markdown
Collaborator

msooseth commented Apr 2, 2026

I did a thing -- adding more tests, changelog, and also one more place where a hardcoded address should be checked maybe?

gustavo-grieco and others added 4 commits April 2, 2026 19:49
The test contract files were not tracked in git, causing CI failures
since the Nix build only includes git-tracked files.

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
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

Successfully merging this pull request may close these issues.

Feature Request: Support for logging in view functions like Foundry's console2

3 participants