Closed maurelian closed 1 week ago
Some observations:
just
command is run in a zsh
or bash
shell. Using git bisect, I have confirmed https://github.com/foundry-rs/foundry/pull/8543 is the PR that introduced this bug. Before that PR, URLs are properly encoded when logged: https://dashboard.tenderly.co/TENDERLY_USERNAME/TENDERLY_PROJECT/simulator/new?network=10&contractAddress=0xcA11bde05977b3631167028862bE2a173976CA11&from=0x1804c8AB1F12E6bbf3894d4083f33e07309d1f38&stateOverrides=%5B%7B"contractAddress":"0x0a7361e734cf3f0394B0FC4a45C74E7a4Ec70940","storage":%5B%7B"key":"0x0000000000000000000000000000000000000000000000000000000000000004","value":"0x0000000000000000000000000000000000000000000000000000000000000001"%7D%5D%7D,%7B"contractAddress":"0x2501c477D0A35545a387Aa4A3EEe4292A9a8B3F0","storage":%5B%7B"key":"0x0000000000000000000000000000000000000000000000000000000000000004","value":"0x0000000000000000000000000000000000000000000000000000000000000001"%7D,%7B"key":"0x0000000.....
After, you can see the improper URL encoding: https://dashboard.tenderly.co/TENDERLY_USERNAME/TENDERLY_PROJECT/simulator/new?network=10&contractAddress=0xcA11bde05977b3631167028862bE2a173976CA11&from=0x1804c8AB1F12E6bbf3894d4083f33e07309d1f38&stateOverrides=%5%7"contractAddress":"0x0a7361e734cf3f0394B0FC4a45C74E7a4Ec70940","storage":%5%7"key":"0x0000000000000000000000000000000000000000000000000000000000000004","value":"0x0000000000000000000000000000000000000000000000000000000000000001"%7%5%7,%7"contractAddress":"0x2501c477D0A35545a387Aa4A3EEe4292A9a8B3F0","storage":%5%7"key":"0x0000000000000000000000000000000000000000000000000000000000000004","value":"0x0000000000000000000000000000000000000000000000000000000000000001"%7,%7"key":"0x0000000000000000000000000000000000000000000000000000000000000003","value":"0x0000000000000000000000000000000000000000000000000000000000000001"%7,%7"key":"0xe90b7bceb6e7df5418fb78d8ee546e97c83a08bbccc01a0644d599ccd2a7c2e0","value":"0x0000000000.....
For reference, here is where the URL encoding and logging happens: https://github.com/base-org/contracts/blob/1db896f62d5189426efd3dbe28e908fda4a92ebf/script/universal/Simulator.sol#L129-L189
Opened https://github.com/foundry-rs/foundry/issues/8700 to track
Bug Description
In some user's environments but not others, the
just sign
andjust simulate
scripts are outputting tenderly simulation URLs with invalid URL escaping.Steps to Reproduce
Note that the escape characters used should be %5B and %5D (open/closed square brackets) but the script prints %5 and %5. The same case is with %7B and %7D (curly brackets).
Expected behavior
The scripts should print a properly escaped URL.