Skip to content

No log_named_bool() ? #2436

Answered by mds1
CaledoniaProject asked this question in Help
Jul 21, 2022 · 1 comments · 4 replies
Discussion options

You must be logged in to vote
// The first one might work, but solidity might ask you to be explicit on the types
// in which case the second one should work
emit log_named_uint("name", bool ? 1 : 0)
emit log_named_uint("name", bool ? uint256(1) : 0)

Alternatively, you can PR additional log_bool and log_named_bool events to forge-std: https://github.com/foundry-rs/forge-std/blob/27e14b7f2448e5f5ac32719f51fe652aa0b0733e/src/Test.sol#L20-L25

Replies: 1 comment 4 replies

Comment options

You must be logged in to vote
4 replies
@CaledoniaProject
Comment options

@mds1
Comment options

mds1 Jul 22, 2022
Maintainer

@CaledoniaProject
Comment options

@mds1
Comment options

mds1 Jul 23, 2022
Maintainer

Answer selected by onbjerg
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Help
Labels
None yet
2 participants