1

Here is what i have read on this vyper official documentation:

https://vyper.readthedocs.io/en/stable/types.html#initial-values

int128 1

uint256 1

I have create this very basic smartcontract:

variable_test: int128

@external
@view
def myfunction() -> int128:
  return self.variable_test

The myfunction function should return 1 according to the documentation, but it returns 0...

Any idea ?

Thanks

0

That documentation can't possibly correct :-) Else you couldn't reliably convey the meaning of 1 (or 0).

The docs you've linked to do appear to contradict with the values in the Vyper GitHub pages, which appear to make more sense:

Type    Default Value
address  0x0000000000000000000000000000000000000000
bool    False
bytes32 0x0000000000000000000000000000000000000000000000000000000000000000
decimal 0.0
int128  0
uint256 0

Edit:

In fact they were wrong on the GitHub pages as well until someone made a PR to correct them.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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