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

converters generate semantically invalid contracts #74

Open
cyberthirst opened this issue Dec 17, 2024 · 0 comments
Open

converters generate semantically invalid contracts #74

cyberthirst opened this issue Dec 17, 2024 · 0 comments

Comments

@cyberthirst
Copy link
Collaborator

Describe the bug

here are some semantically invalid contracts which were produced by the generators:

Subscript must be greater than 0

  function "func_0", line 12:49 
       11     x_STRING_0: String[1000] = ""
  ---> 12     assert False, concat("", convert(b"", String[0]))
  ---------------------------------------------------------^
       13
not allowed to query state variables in pure functions

  function "func_0", line 11:19 
       10 def func_0(x_INT_0: uint8):
  ---> 11     assert convert(IM_STRING_0, bool)
  ---------------------------^
       12     x_INT_1: uint8 = 0
assertion found to fail at compile time. (hint: did you mean `raise`?) /* assert False */ [assert, 0 <False>]

  function "__init__", line 8:12 
       7         for i_1: uint256 in range(0, 1):
  ---> 8             assert False
  -------------------^
       9
value= may not be passed for static or delegate calls!

  function "__default__", line 4:21 
       3 def __default__() -> uint8:
  ---> 4     x_BOOL_0: bool = raw_call(0x0000000000000000000000000000000000000000, convert("", Bytes[100]), value=convert(b"0", uint256), is_static_call=True, revert_on_failure=False)
  ----------------------------^
       5     if convert("", bool):
Expected uint256 but literal can only be cast as int104 or int96.

  function "func_0", line 11:30 
       10 def func_0():
  ---> 11     for i_1: uint256 in range(-1040187392, 0):
  --------------------------------------^
       12         return
Number out of range

  function "func_1", line 24:33 
       23 def func_1(x_INT_0: uint8):
  ---> 24     send(convert(convert(convert(b"2f00000000", uint8) + 0, bytes1), address), 0)
  -----------------------------------------^
       25

Version Information

  • OS: ubuntu lts
  • Fuzzer Version (commit): fff4311
  • Python Version: 3.10.10

Additional context

Add any other context about the problem here.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant