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

chisel incorrectly parses the full word from storage when returning uint256 types #9377

Closed
2 tasks done
DrakeEvans opened this issue Nov 21, 2024 · 0 comments · Fixed by #9381
Closed
2 tasks done
Labels
C-chisel Command: chisel T-bug Type: bug

Comments

@DrakeEvans
Copy link
Contributor

Component

Chisel

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

  • Foundry
  • Foundryup

What version of Foundry are you on?

chisel 0.2.0 (4817280 2024-11-11T17:07:32.412876000Z)

What command(s) is the bug in?

chisel

Operating System

macOS (Apple Silicon)

Describe the bug

When returning the full word from storage for the following code snippet
keccak256(abi.encode(uint256(keccak256("AgoraStableSwapStorage.OracleStorage")) - 1)) & ~bytes32(uint256(0xff))

The output is
Type: uint256 ├ Hex: 0xa6b316b47a0cd26c1b582ae3dcffbd175283c221c3cb3d1c614e3e47f62a700 ├ Hex (full word): 0xa6b316b47a0cd26c1b582ae3dcffbd175283c221c3cb3d1c614e3e47f62a700 └ Decimal: 4712522199592559686081775781256535485973216673499069812336538043969769219840
You can see that the Hex (full word) only contains 63 characters which is incorrect as words are 256 bits. It should instead read 0x0a6b316b47a0cd26c1b582ae3dcffbd175283c221c3cb3d1c614e3e47f62a700 (missing a 0 in first position

@DrakeEvans DrakeEvans added T-bug Type: bug T-needs-triage Type: this issue needs to be labelled labels Nov 21, 2024
@github-project-automation github-project-automation bot moved this to Todo in Foundry Nov 21, 2024
@grandizzy grandizzy added C-chisel Command: chisel and removed T-needs-triage Type: this issue needs to be labelled labels Nov 22, 2024
@github-project-automation github-project-automation bot moved this from Todo to Done in Foundry Nov 22, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C-chisel Command: chisel T-bug Type: bug
Projects
Archived in project
Development

Successfully merging a pull request may close this issue.

2 participants