vyperlang / vyper

Pythonic Smart Contract Language for the EVM
https://vyperlang.org
Other
4.84k stars 788 forks source link

Unclear Buffer Length Computation #4186

Open ritzdorf opened 4 months ago

ritzdorf commented 4 months ago

Version Information

In Stmt._assert_reason(), a buffer of length 64 + msg_ir.typ.memory_bytes_required is allocated given that the type of the message is TupleT(StringT[N],), this accounts for:

A similar pattern as what is used in _pack_arguments() could be beneficial in showing the different components of the buffer's length.

if fn_type.return_type is not None:
    ...
else:
    buflen = args_abi_t.size_bound()

buflen += 32  # padding for the method id