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

bug(forge script): Failed to decode constructor arguments: buffer overrun while deserializing #8995

Closed
2 tasks done
kevinsslin opened this issue Oct 1, 2024 · 1 comment · Fixed by #9050
Closed
2 tasks done
Assignees
Labels
Cmd-forge-script Command: forge script T-bug Type: bug

Comments

@kevinsslin
Copy link

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 (3ff3d05 2024-10-01T00:27:45.742842000Z)

What command(s) is the bug in?

forge script

Operating System

macOS (Apple Silicon)

Describe the bug

When I try to deploy the contract using the forge script, it crashes with a deserialization error. The error suggests a buffer overrun during the decoding of the constructor arguments.

Script

The script I ran:

forge script scripts/DeployGlobals.s.sol \
  --sig "run()" \
  --broadcast \
  --rpc-url $RPC_URL \
  --private-key $PRIVATE_KEY

Return

Script ran successfully.

== Return ==
globals_: contract IsleGlobals 0x0e7349cbcbA4d5394E51ae8B227a0f7D5ae3333c
2024-10-01T04:51:08.214841Z ERROR forge_script::transaction: Failed to decode constructor arguments contract=Some("ERC1967Proxy") signature=constructor(address,bytes) is_create2=false constructor_args=65676174652063616c6c206661696c65640000000000000000000000000b2bdd04d12f4fc7d4a45100ce3dc10605b44b0000000000000000000000000000000000000000000000000000000000000000400000000000000000000000000000000000000000000000000000000000000024c4d66de8000000000000000000000000516abfc478658666950cd371685a4fc6ce73c6c700000000000000000000000000000000000000000000000000000000
Error:
buffer overrun while deserializing

Context:
- buffer overrun while deserializing

Here is the source code of my script.

@kevinsslin kevinsslin added T-bug Type: bug T-needs-triage Type: this issue needs to be labelled labels Oct 1, 2024
@github-project-automation github-project-automation bot moved this to Todo in Foundry Oct 1, 2024
@grandizzy grandizzy self-assigned this Oct 1, 2024
@grandizzy grandizzy moved this from Todo to In Progress in Foundry Oct 1, 2024
@grandizzy grandizzy added Cmd-forge-script Command: forge script and removed T-needs-triage Type: this issue needs to be labelled labels Oct 1, 2024
@grandizzy
Copy link
Collaborator

per @klkvr comment here #8998 (comment) this is because UUPSProxy is identified as ERC1967Proxy because cbor_metadata is set to false in foundry.toml

bytecode_hash = "none"
cbor_metadata = false

removing these 2 setting makes it pass, you could run the deploy scripts with different profile that doesn't have them set

@klkvr do you have better suggestions for this one? thank you!

@zerosnacks zerosnacks added this to the v1.0.0 milestone Oct 2, 2024
@grandizzy grandizzy moved this from In Progress to Ready For Review in Foundry Oct 2, 2024
@grandizzy grandizzy moved this from Ready For Review to In Progress in Foundry Oct 7, 2024
@grandizzy grandizzy moved this from Ready For Review to In Progress in Foundry Oct 7, 2024
@github-project-automation github-project-automation bot moved this from In Progress to Done in Foundry Oct 14, 2024
@grandizzy grandizzy moved this from Done to Completed in Foundry Oct 21, 2024
@grandizzy grandizzy removed this from the v1.0.0 milestone Oct 28, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment