foundry-rs / foundry-rs/forge-std

bug(StdStorage): unable to find bool slot within map struct

Open
#90 1 comment 0 reactions 1 assignee Claimed by @ZeroEkkusu View on GitHub
bug
Dominant language
Solidity
Stars
1.1k
Forks
520
Avg merge
3d 13h
Merged PRs (30d)
9

Description

Hey guys,

Seems like `stdStorage` unable to find `bool` slot within a map struct variable. I debug and found out that the `rdata` not return hex"1337" if `address.staticcall` to the bool slot. The whole bytes32 just become `0000000000000000000000000000000000000000000000000000000000000000` as you can see below:
![telegram-cloud-photo-size-5-6145377720268337323-y](https://user-images.githubusercontent.com/78094022/173783956-74c1182c-64a3-483a-bf45-75fb72aba6f9.jpg)

You can reproduce with this contract: https://github.com/spicysquid168/solidity-playground/blob/main/src/TryStdStorageBool.sol
Run by `forge script ./src/TryStdStorageBool.sol -vvv`

Thanks,

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.