-
Couldn't load subscription status.
- Fork 9
Vyper language features
Here we briefly enumerate the features of Vyper language. All of them are fully supported by K Vyper semantics. The semantics is based on the following commit of Vyper compiler: https://github.com/ethereum/vyper/commit/9fb7281cddfdea9174008860edbeedb062c53aa0
For more information please look at the Vyper documentation (currently work in progress):
https://github.com/ethereum/vyper
https://github.com/ethereum/vyper/blob/master/docs/types.rst
https://github.com/ethereum/vyper/blob/master/docs/built-in-functions.rst
Contract members:
- functions
- global variables
- events
- contract interfaces
Types:
int128uint256decimalbytes32addressbool- unit types
-
bytes[n]- variable-size byte arrays liststruct- tuple
- map
Statements:
- variable declaration:
a: int128ora: int128 = e - assignment:
a = e - augmented assignment:
a += e - if
- for in range:
for i in in range(rounds)orfor i in in range(start, end) - for in list:
for elem in [1, 2, 3] breakcontinuereturnassertthrow-
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:
balancecodesizeis_contractmsg.sendermsg.valuemsg.gasblock.difficultyblock.timestampblock.coinbaseblock.numberblock.prevhash
Functions:
floorceildecimalas_unitless_numberconvertslicelenconcatkeccak256method_idecrecoverecaddecmulextract32as_wei_valueraw_callcreate_with_code_ofRLPlistblockhashbitwise_andbitwise_orbitwise_xorbitwise_notuint256_adduint256_subuint256_muluint256_divuint256_expuint256_moduint256_addmoduint256_mulmoduint256_gtuint256_geuint256_ltuint256_leshiftminmaxsha3raw_logRLPList