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

Strange format/style output in broadcast file after running script #5150

Closed
2 tasks done
rpedroni opened this issue Jun 13, 2023 · 2 comments · Fixed by #5151
Closed
2 tasks done

Strange format/style output in broadcast file after running script #5150

rpedroni opened this issue Jun 13, 2023 · 2 comments · Fixed by #5151
Labels
T-bug Type: bug

Comments

@rpedroni
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 (08a629a 2023-06-03T00:14:26.563741000Z)

What command(s) is the bug in?

forge script

Operating System

macOS (Apple Silicon)

Describe the bug

When producing the broadcast file after running forge script, some arguments were improperly set. Given their unicode aspect, I'm assuming this is styling/formatting related. I've pasted the file's content below. Please note the arguments, more specifically "500000000000 \u001b[2;49;39m[5e11]\u001b[0m", and "250000000000 \u001b[2;49;39m[2.5e11]\u001b[0m",, where the original args were simply "500000000000" and "250000000000" - this happened for all deployed contracts from this script, specifically for this field

While not a huge issue, kind of a pain since I run scripts that consume this json and depend on the correct values.

{
  "transactions": [
    {
      "hash": "0x99f08ad93d7e18859cc5b424a9097ede51ad8f446aafa85af269ab005ec94ee1",
      "transactionType": "CREATE",
      "contractName": "SingleTokenPortfolio",
      "contractAddress": "0xdC4E3E75F444f4A83C02740fc0014c1D6F05570F",
      "function": null,
      "arguments": [
        "0x94106cA9c7E567109A1D39413052887d1F412183",
        "0xae78736Cd615f374D3085123A210448E74Fc6393",
        "Rocketpool ETH Portfolio Shares",
        "rETH-PS",
        "500000000000 \u001b[2;49;39m[5e11]\u001b[0m",
        "25",
        "0"
      ],
      "rpc": "https://mainnet.infura.io/v3/cdf3bdd9227744688fb91b658146d51b",
      "transaction": {
        "type": "0x02",
        "from": "0x4aabcba4c787759975ad0a455898b7b77adddd1c",
        "gas": "0x355665",
        "value": "0x0",
        "data": " ... ",
        "nonce": "0x20",
        "accessList": []
      },
      "additionalContracts": [],
      "isFixedGasLimit": false
    },
    {
      "hash": "0xa5019abcbf290976b6ce9ba43690efe3c78564d0d352d7854194690a3ba37e7d",
      "transactionType": "CREATE",
      "contractName": "SingleTokenPortfolio",
      "contractAddress": "0xEfc68dCE5C25bf70393244b1e2af56aCbe07824d",
      "function": null,
      "arguments": [
        "0x94106cA9c7E567109A1D39413052887d1F412183",
        "0x2260FAC5E5542a773Aa44fBCfeDf7C193bc2C599",
        "Wrapped Bitcoin Portfolio Shares",
        "WBTC++-PS",
        "250000000000 \u001b[2;49;39m[2.5e11]\u001b[0m",
        "25",
        "0"
      ],
      "rpc": "https://mainnet.infura.io/v3/cdf3bdd9227744688fb91b658146d51b",
      "transaction": {
        "type": "0x02",
        "from": "0x4aabcba4c787759975ad0a455898b7b77adddd1c",
        "gas": "0x35c8c9",
        "value": "0x0",
        "data": " ... ",
        "nonce": "0x21",
        "accessList": []
      },
      "additionalContracts": [],
      "isFixedGasLimit": false
    },
    
    ...
@rpedroni rpedroni added the T-bug Type: bug label Jun 13, 2023
@gakonst gakonst added this to Foundry Jun 13, 2023
@github-project-automation github-project-automation bot moved this to Todo in Foundry Jun 13, 2023
@DaniPopes
Copy link
Member

DaniPopes commented Jun 13, 2023

When creating the transactions uints are formatted with format_token which also prints the exponential form with ANSI codes

CC #4745 @mattsse @merklefruit

@merklefruit
Copy link
Contributor

@DaniPopes Tried a fix, let me know what you think :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
T-bug Type: bug
Projects
Archived in project
Development

Successfully merging a pull request may close this issue.

3 participants