Skip to content

Vyper language features

Denis Bogdanas edited this page Apr 9, 2018 · 5 revisions

Here we briefly enumerate the features of Vyper language.

Contract members:

  • functions
  • global variables
  • events
  • contract interfaces

Types:

  • int128
  • uint256
  • decimal
  • bytes32
  • address
  • bool
  • unit types
  • bytes[n] - variable-size byte arrays
  • list
  • struct
  • tuple
  • map

Statements:

  • variable declaration: a: int128 or a: int128 = e
  • assignment: a = e
  • augmented assignment: a += e
  • if
  • for in range: for i in in range(rounds) or for i in in range(start, end)
  • for in list: `for elem in [1, 2, 3]'
  • break
  • continue
  • return
  • assert
  • throw
  • log - event logging
  • del - deleting elements from a map
  • function calls
  • external contract calls

Binary operators: + - * / % **

Unary operators: ! -

Boolean operators: and or

Comparison operators: < <= > >= == != in

Reserved expressions:

  • balance
  • codesize
  • is_contract
  • msg.sender
  • msg.value
  • msg.gas
  • block.difficulty
  • block.timestamp
  • block.coinbase
  • block.number
  • block.prevhash

Functions:

  • floor
  • ceil
  • decimal
  • as_unitless_number
  • convert
  • slice
  • len
  • concat
  • keccak256
  • method_id
  • ``
  • ``
  • ``
  • ``
  • ``
  • ``
  • ``
  • ``
  • ``
  • ``
  • ``
  • ``
  • ``

Clone this wiki locally