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.log() does not work with uint #6501

Closed
2 tasks done
ckksec opened this issue Dec 2, 2023 · 4 comments · Fixed by #6504
Closed
2 tasks done

console.log() does not work with uint #6501

ckksec opened this issue Dec 2, 2023 · 4 comments · Fixed by #6504
Labels
T-bug Type: bug

Comments

@ckksec
Copy link

ckksec commented Dec 2, 2023

Component

Forge

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

  • Foundry
  • Foundryup

What version of Foundry are you on?

forge 0.2.0 (1529edd 2023-12-01T15:45:10.088350100Z) but also tested on a version 2023-06-XX something

What command(s) is the bug in?

forge test (-vvvvv)

Operating System

Windows

Describe the bug

console.log(...) is not recognized in the stack trace when working with numbers, for example uint, int, etc. The same goes for console.logUint(...) or console.logInt(...). The function is output with its signature in the stack trace instead of a "human readable" [0] console::log(""). In my examples I used it as an additional parameter, but also just using console.log(num) where num is any number (type) does not work properly. However, console2.log(...) works fine. But that on the other hand does not support parameter replacing, so e.g. console2.log("A string %s in a string!", "< I am a string >"); does not work, the %s is not replaced (not sure if it's a bug or just working as should for console2.log(...)).
num1
num2

@ckksec ckksec added the T-bug Type: bug label Dec 2, 2023
@gakonst gakonst added this to Foundry Dec 2, 2023
@github-project-automation github-project-automation bot moved this to Todo in Foundry Dec 2, 2023
@mattsse
Copy link
Member

mattsse commented Dec 2, 2023

@DaniPopes hmm maybe we're missing these log signatures during decoding?

@DaniPopes
Copy link
Member

I don't think we ever decoded hardhat console (not console2) due to their non-conformance with ABI.

@DaniPopes
Copy link
Member

@ckksec

but also tested on a version 2023-06-XX something

Were the screenshots taken with the older version?

Anyway, this should be fixed in #6504; you can try with foundryup --pr 6504 (builds from source).

@github-project-automation github-project-automation bot moved this from Todo to Done in Foundry Dec 4, 2023
@ckksec
Copy link
Author

ckksec commented Dec 4, 2023

@ckksec

but also tested on a version 2023-06-XX something

Were the screenshots taken with the older version?

Anyway, this should be fixed in #6504; you can try with foundryup --pr 6504 (builds from source).

Yes they were, but both tested versions showed the same output. It has been fixed now, thank you!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
T-bug Type: bug
Projects
Archived in project
Development

Successfully merging a pull request may close this issue.

3 participants