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 does not output anything for some valid calculations #6610

Closed
2 tasks done
Proxy1967 opened this issue Dec 16, 2023 · 2 comments · Fixed by #6647
Closed
2 tasks done

Chisel does not output anything for some valid calculations #6610

Proxy1967 opened this issue Dec 16, 2023 · 2 comments · Fixed by #6647
Labels
T-bug Type: bug

Comments

@Proxy1967
Copy link

Proxy1967 commented Dec 16, 2023

Component

Chisel

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

  • Foundry
  • Foundryup

What version of Foundry are you on?

forge 0.2.0 (3d6bfdd 2023-12-16T00:17:23.049683682Z)

What command(s) is the bug in?

chisel

Operating System

Linux

Describe the bug

When trying to calculate 10e18*1e18/110e18 chisel does not give any output. But for instance for 10e18*1e18/100e18 or 10e18*1e18/90e18 or even 10e18*1e18/200e18 it does. When dividing with anything from 101e18 to 199e18 it does not output anything. Same thing happens when dividing with 201e18 etc.

@Proxy1967 Proxy1967 added the T-bug Type: bug label Dec 16, 2023
@Evalir
Copy link
Member

Evalir commented Dec 20, 2023

cc @clabby / @refcell

@mattsse
Copy link
Member

mattsse commented Dec 21, 2023

closing this because 10e18*1e18/110e18 is invalid solidity:

Compiler errors:
Error (6090): Fractional numbers cannot yet be encoded.
  --> ReplContract.sol:14:46:
   |
14 |         bytes memory inspectoor = abi.encode(10e18*1e18/110e18);
   |                                                     ^^^^^^^^^^^^^^^^^

This operation is also invalid:

Compiler errors:
Error (4486): Type rational_const 1000000000000000000 / 11 is not implicitly convertible to expected type uint256. Try converting to type ufixed256x60 or use an explicit conversion.
  --> ReplContract.sol:14:9:
   |
14 |         uint256 x = 10e18*1e18/110e18;
   |        

with #6647 the error is now logged if run with -vvv, perhaps we should always log them, but could be noisy

@mattsse mattsse closed this as completed Dec 21, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
T-bug Type: bug
Projects
No open projects
Archived in project
Development

Successfully merging a pull request may close this issue.

3 participants