0

In the console, I am getting:

Decoded output { “0”: “uint8: 255” }

and in the return value I am getting:

0: 0x00000000000000000000000000000000000000000000000000000000000000ff

What the above two things mean? and is the above converting "uint8" into uint256?

Some body please guide me.

Zulfi.

1 Answer 1

2

It is hex ff (at the end), left padded with 31 0x0 to make a word. It's the first 32-byte word (0).

In decimal, the value is 255.

Hope it helps.

3
  • There are two values in each case but same. Does "0" mean initial value and "255" means the final value?
    – zak100
    Jun 8, 2019 at 14:19
  • 1
    It's numbering the return values. Consider a case with more than one returned value. 0: address: studentAccount xCA35b7d915458EF540aDe6068dFe2F44E8fa733c 1: uint256: age 1 2: uint256: income 1 3: uint256: score 1 4: uint256: attendance 1 Jun 8, 2019 at 18:54
  • My program was returning just a single value of size uint8. It was 0 initially but when i did "dec" it became 255 or hex 'ff' but its showing uint8 as a 64 bit value? I can't understand why are we numbering the values? & why 8 bit uint is represented as a 64 bit value?
    – zak100
    Jun 9, 2019 at 23:04

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.