What's New

pragma version

0.3

# @version ^0.3.0

0.4

#pragma version ^0.4.0

Optimization mode

codesize, gas (default), or none

#pragma version ^0.4.0 optimize codesize

Constructor

0.3

@external
def __init__():
    self.greet = "Hello World"

0.4

@deploy
def __init__():
    self.greet = "Hello World"

For loop

0.3

for addr in addrs:
    ...

0.4

for addr: address in addrs:
    ...

Division

0.3

x / y

0.4

x // y

Constants

0.3

ZERO_ADDRESS
MAX_UINT256
EMPTY_BYTES32

0.4

empty(address)
max_value(uint256)
empty(bytes32)

Interface

static IFoo(addr).bar()
extcall IFoo(addr).bar()

Re-entrancy locks

0.3

@nonreentrant("lock")

0.4

@nonreentrant

Modules

See modules

Try on Smart Contract Engineer