Open MalekLahbib opened 3 hours ago
Can you please provide the code you used?
Seems that the error you're getting is from strconv.ParseUint
, not a VM panic.
I tried to put a condition in the beginning of the function to verify the overflow:
but I don't think the error message is from the function execution, I said VM as I still don't understand so much how it's working. It says in the beginning: --= Error =-- Data: internal error Msg Traces: 0 /home/malek/gno/tm2/pkg/crypto/keys/client/maketx.go:215 - deliver transaction failed: log:recovered: error parsing uint64 "18446744073709551616": strconv.ParseUint: parsing "18446744073709551616": value out of range
Am I wrong?
I think you can change your condition to
if amout > 18446744073709551615
because uint64
is never negative
Description
I was going through the GRC20 package, and noticed in banker.gno file some comments form @moul
// TODO: check for overflow
. So I made a test and called a function with overflow and had this:From what I understand, it's not possible for the moment to check for the overflow in the file, as the panic message seems to come from the VM.
Am I right? Is this the way things are supposed to work?
I imagine that it's not necessary to check for overflow in the code if the VM will do it automatically and not let the function execute.