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

Cast parsing int types as uint #1719

Closed
2 tasks done
arjun-io opened this issue May 25, 2022 · 2 comments · Fixed by #1761
Closed
2 tasks done

Cast parsing int types as uint #1719

arjun-io opened this issue May 25, 2022 · 2 comments · Fixed by #1761
Labels
C-cast Command: cast good first issue Good for newcomers P-normal Priority: normal T-bug Type: bug

Comments

@arjun-io
Copy link

Component

Cast

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

  • Foundry
  • Foundryup

What version of Foundry are you on?

forge 0.2.0 (fc534d9 2022-05-23T00:04:42.704454Z)

What command(s) is the bug in?

cast call

Operating System

macOS (Apple Silicon)

Describe the bug

cast appears to be parsing int types as uint types. A minimal example:

pragma solidity ^0.8.0;

contract MyInt {
    constructor() {}

    function getInt() public pure returns(int256) {
        return -1;
    }
}
❯ cast call 0x50D75C1BC6a1cE35002C9f92D0AF4B3684aa6B74 "getInt()(int256)"
115792089237316195423570985008687907853269984665640564039457584007913129639935
@arjun-io arjun-io added the T-bug Type: bug label May 25, 2022
@mds1
Copy link
Collaborator

mds1 commented May 25, 2022

Going to add on that in general ints seem to be poorly supported in foundry and ethers-rs too. Related:

@onbjerg onbjerg added C-cast Command: cast good first issue Good for newcomers P-normal Priority: normal labels May 27, 2022
@distractedm1nd
Copy link
Contributor

Related to rust-ethereum/ethabi#249

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
C-cast Command: cast good first issue Good for newcomers P-normal Priority: normal T-bug Type: bug
Projects
No open projects
Archived in project
Development

Successfully merging a pull request may close this issue.

4 participants