►
From YouTube: New Features of Solidity 0.5.0 - Christian Reitwiessner
Description
No description was provided for this meeting.
If this is YOUR meeting, an easy way to fix this is to add a description to your video, wherever mtngs.io found it (probably YouTube).
A
A
This
is
special
because
we
we
follow
the
semver
versioning
scheme
and
this
means
zero-five-zero
is
a
breaking
change
and
the
last
breaking
change
was
I
think
in
something
around
October
2016.
So
quite
some
things
happened
since
then.
I
will
mostly
talk
about
the
actual
breaking
chains
and
not
the
actual
breaking
changes
and
not
the
features
that
happen
in
the
I
think
25
releases
we've
had
since
then
so.
Yeah.
A
For
zero-five-zero
or
for
the
breaking
changes
of
survived,
see
we
mostly
focused
on
safety,
so
we
noticed
that
it's
often
better
to
force
the
user
to
be
much
more
explicit
about
some
things.
We
will
see
examples
later
and
we
will
also
remove
some
things
which
are
yeah
can
be
interpreted
in
different
ways.
So,
we'd
like
to
everyone,
be
clear
about
the
semantics
of
the
language
and
we
will
also
add
some
more
runtime
checks.
A
Adding
runtime
checks
is
always
a
tricky
because
the
more
checks
you
do,
the
more
expensive
the
operations
will
be,
and
you
kind
of
fight
with
users
who
want
their
smart
contracts
to
be
cheap,
and
then
you
fight
with
other
users
who
want
their
smart
contracts
to
be
safe
and
yeah
I
always
have
to
find
a
middle
ground
there.
Okay,
let's
go
through
some
of
the
changes.
We
start
with
visibility,
constructors
and
events.
A
So
these
are
things
which
you
might
have
noticed
already
in
the
recent
non-breaking
versions,
because
we
so
most
of
the
changes
we
gradually
introduced
by
the
way
of
adding
warnings
if
you
still
use
the
old
non
ranking
recommended
way,
and
so
this
is
a
simple
smart
contract
in
the
zero
four
zero
syntax.
And
if
you
know
the
language
a
little,
then
you
notice
at
least
one
bug,
and
the
bug
is
that
this
initialize
function
is
meant
to
initialize
the
smart
contract.
A
So
it
should
only
be
called
from
the
constructor
only
from
a
privileged
user
and
the
reason
is
it
sets
the
owner.
But
since
there
is
no
visibility
specified
here,
it's
publicly
visible,
it
can
be
called
by
anyone.
So
anyone
can
change
the
owner
of
this
contract
and
yeah.
Most
of
you
perhaps
know
that
this
is
something
that
actually
happened,
and
because
of
that,
we
now
require
visibility
to
be
specified
explicitly
and
yeah.
In
current
versions.
The
compiler
produces
warning
from
zero-five-zero
arm.
It
will
be
an
error.
A
You
might
change
your
mind
about
the
name
of
the
contract
and
you
change
the
name
of
the
contract,
but
you
forget
to
change
the
name
of
the
constructor,
because
of
that
we
now
force
the
constructor
we
specified
in
this
new
syntax,
where
you
don't
use
the
function,
keyword
or
the
special
construct,
a
keyword,
and
now
you
can
change
the
name
of
the
smart
contract
without
having
to
change
the
name
of
the
constructor
and
then
events.
So
here
we
here,
we
call
an
event.
It
looks
very
similar
to
a
function
call,
but
events
are
rather
different.
A
They
don't
actually
execute
any
code,
they
just
log
information
and
because
of
that
to
make
it
explicit
before
we
require
an
image
keyword
to
be
used
together
with
events.
So
that's
not
a
big
security
thing,
but
it's
just
nice
to
have
I
think
good.
Then
the
next
thing
is
to
force
more
yeah
force
users
to
more
explicitly
mention
the
types
they
want
to
use.
A
A
A
A
556,
whatever
elements,
then
this
loop
will
not
terminate
because
I
is
always
smaller
than
length
length,
because
the
largest
value
it
can
hold
is
255
and
you
do
not
have
overflow
checks
here.
So,
even
if
we
had
overflow
checks,
this
is
not
the
behavior
would
want,
because
you
would
not
be
able
to
pass
in
an
array
with
one
and
two
and
fifty
six
elements.
A
Okay,
long
introduction
know
the
easy
thing
here
is
just
this
allow
bar.
So
we
had
a
warning
for
exactly
this
case,
because
that
happened
a
lot.
So
we
have
a
for
loop
and
do
not
declare
the
type
here.
We
already
had
a
warning
for
a
long
time,
but
now
we
said
yeah
I
mean
just
force
users
to
specify
types
explicitly
that
that
is
also
a
rule.
We
follow,
or
we
more
or
less
follow
inside
the
compiler
itself,
so
I
think
that's
it's
good
to
have.
A
Some
people
complain
that,
in
some
cases,
this
results
in
quite
robust
code,
but
we're
trying
to
introduce
elias's
or
type
type
definitions
that
might
help
in
these
cases,
then
another
thing
which
is
perhaps
not
too
visible
here,
but
in
other
cases
a
is
a
reference
type.
A
is
an
array,
a
reference
type
which
so
a
itself
points
somewhere,
and
it
can
point
either
to
memory
or
to
storage
or
to
call
data,
and
in
many
situations
I
always
fall
into
this
trap
from
time
to
time.
A
A
A
A
Variable
storage
objects
in
a
certain
way,
and
this
leads
to
this
variable
actually
having
in
having
an
invalid
value.
So
it
has
to
be
initialized
with
something
but
there's
actually
no
nothing.
The
compiler
could
initialize
it
with
to
be
valid,
and
because
of
that,
we
now
force
the
user
to
always
assign
P
assigned
something
to
P
when
it
is
declared.
Ok,
and
because
of
that,
it's
better
to
completely
rewrite
this
thing.
So
you
see
peace,
peace
defined
here
and
it
has
to
be
directly
assigned
from
somewhere.
A
A
That
storage
point
is
now
something
that
was
also
requested.
Quite
often
is
changing
a
change
in
the
scoping
rules.
Some
of
you
probably
don't
even
know,
but
solidity
inherited.
Its
scoping
rules
from
JavaScript
and
JavaScript
scoping
routes
are
really
really
weird.
A
The
thing
is:
JavaScript,
scopes
are
always
functions
so
usually
so
when
you
declare
a
variable
here
in
most
languages,
it
can
only
be
used
inside
this
block,
which
is
delimited
by
curly
braces,
but
in
JavaScript
a
variable
District
idea
that
is
declared
somewhere
is
always
visible
in
the
whole
function
and,
moreover,
it
is
also
visible
before
it
was
even
declared
and
even
visible
outside
of
whatever.
So
this
is
valid
solidity
code
and
a
version
of
it
will
also
be
valid
JavaScript
and
it
returns
three
yeah
with
zero
five
zero.
A
This
is
not
possible
anymore
and
we
have
regular
block
scope
variables,
as
you
would
expect
from
something
like
C++
or
Java.
So
even
this
Coast
code
is
valid,
that
this
is
not.
This
cannot
be
done
in
zero
for
zero,
because
you
would
declare
a
variable
here
whose
scope
is
the
full
function.
You
declare
a
variable
the
same
name
here
which
has
the
same
scope.
A
So,
okay
block
scope
means,
as
I
said,
variables
are
visible
inside
of
the
curly
braces
block.
They
were
declared
in
with
the
single
exception
that
if
you
have
a
for
loop
and
declare
the
variable
in
this
first
initializer
block,
it
is
visible
in
the
for
loop,
but
not
after
it,
and
another
advantage
of
block
scope
variables,
especially
in
solidity,
is
that
it
helps
a
little
improving
this
at
most
sixteen
variables
for
function
limitation,
because
variables
can
be
removed
from
the
stack
when
their
scope
ends.
A
Previously,
the
scope
was
the
full
function,
so
you
could
really
remove
it,
and
now
you
can
remove
functions
when
their
scope,
and
so
you
can
actually
have
more
than
sixteen
variables
in
a
single
function
as
long
as
you
don't
have
sixteen
five
variables
more
than
sixteen
variables
visible
at
the
same
time.
Okay.
So
if
we
already
have
fifteen
functions
in
this
fifteen
variables
in
this
functions,
declaring
this
I
variable
twice
doesn't
hurt
because
they
are
unrelated
good
we're
almost
done.
A
There
is
no
way
to
remove
the
last
element
of
a
storage
array
very
efficiently
and
idiomatically.
Then
we
expose
the
ABI
encoding
functions
so
there's
a
bi
dot
encode,
which
does
regular
ABI
encoding
and
returns
a
byte
array,
a
bi
dot,
encode
pact
which
does
pact
encoding.
That's
the
encoding
that
is
used
by
the
hash
functions,
for
example,
and
there
is
also
encode
with
selector
and
encode
with
signature.
A
A
Maybe
I
don't
encode
just
result
returns
the
actual
ABI
encoded
payload
data,
and
if
you
want
to
use
that
with
the
raw
function
call
you
have
to
prefix
that
with
four
bytes
that
tell
which
function
to
actually
execute
and
because
it
would
be
so
prefixing
data
onto
byte
arrays
is
kind
of
weird,
so
we
have
two
additional
functions
that
can
do
that
in
one
run.
So
the
first
argument
is
this:
for
piped
function,
selector
and
then
the
actual
data
arguments
follow.
A
We
will
also
support
enums
instruction
interfaces
that
will
request
it
quite
often
because
that
actually
allows
you
to
define
yeah
interfaces
for
smart
contracts
or
for
class
of
smart
contracts
in
a
useful
way,
then
so
this
these
were
three
functionality
changes
we
have
tons
more.
Most
of
them
were
introduced
already
earlier,
so
you
might
already
know
about
that.
A
A
Had
bytes
for
type,
then
we
would
encode
differently
and
also
the
encoding
of
call
was
very
weird.
It
wasn't
either
a
bi
encoding
nor
pact,
a
bi
encoding,
but
something
else
and
whatever
so
now
you
can
use
call
and
you
would
use
these
a
bi
encoding
functions
to
create
the
data
of
call,
and
then
just
this
of
course
applies
to
delegate
call
and
all
the
others.
Also
the
hash
functions
only
take
a
single
bytes
parameter.
A
If
you
want
to
get
the
old
behavior,
you
use
a
3
of
a
bi
dot,
encode
backpacked
off
and
then
the
actual
data,
while
cut
triple
assignments,
are
removed.
This
is
when
a
function
returns,
multiple
values,
but
you
are
only
interested
in
the
first.
You
could
do
a
comma
equals
function
call
and
because
that
was
easy
to
get
wrong.
Now
the
left
hand
side
has
to
have
the
same
number
of
components
as
the
right
hand
side.
So
you
would
do
a
comma,
comma,
comma
equals
the
interface
functions
have
to
be
external.
A
Yeah
and
then
the
next
thing
is
also
interesting,
so
the
bytes
types
are
yeah
byte,
arrays
of
up
to
32,
bytes
and
they're,
very
similar
to
the
unsigned
integer
types
which
also
come
in
various
flavors
up
to
32
bytes.
The
main
difference
is
that
byte
arrays
are
left
aligned
in
the
world
and
integers
are
right-aligned
in
the
world.
Now,
if
you
convert
between
byte,
arrays
and
integers
of
the
same
size,
what
would
you
expect
to
happen.
A
A
And
I
in
hexoren
binary
yeah
right,
so
it
it
takes
the
single
bite
which
was
right,
aligned
and
just
shifts
it
to
the
left.
Exactly
and
so.
I
hope
this
is
what
everyone
would
expect
and
it
gets
tricky
if
you
convert
between
these
two
when
the
number
of
bytes
are
different,
because
so,
okay,
if
you
invert,
if
you
convert
between
you
into
eight
and
you
in
sixteen,
then
you
would
expect
nothing
to
happen.
A
It's
just
the
the
the
range
is
increased
and
if
you
convert
between
bytes
1
and
bytes,
it
would
just
add
a
zero
byte.
Now
the
question
is:
what
happens
when
you
convert
between
you
and
eight
and
bytes
to
does
it
first?
Does
it
does
it
go
through
you
in
16,
or
does
it
go
through
you
into
eight?
So
does
it
first?
Where
does
it
add
the
zero
on
the
left?
One
right
right?
A
So
that's
the
tricky
part
and
that's
why
we
disallow
that-
and
you
still,
of
course,
can
get
exactly
the
same
behavior
by
just
having
two
conversions,
but
you
explicitly
specify
in
which
order
you
convert,
and
so
it
should
be
visible.
What
happens
right
shift
and
sign
is
it
is
this
is
actually
my
mistake.
I
thought,
oh
yeah
shifts
are
just
divisions
by
powers
of
two
or
multiplications
by
powers
of
two,
which
is,
of
course
incorrect
for
signed
integers
and
with
0
5
Siri
fix
it.
This
will
M.
A
Since
it's
not
just
a
division
by
a
power
of
2,
it's
a
little
bit
more
expensive
because
the
evm
does
not
have
native
shift
operations.
But
I
think
that's
fine.
If
nobody
uses
it
anyway,
yeah
and
then
yeah
constant
state
variables
were
very
weird
because
they
were
kind
of
usable
as
macros.
So
you
so
state
variables
are
these
variables,
which
are
declared
a
contract
level,
and
if
they
are
constant,
they
don't
have
to
be
concert
in
zero
for
zero.
But
instead
you
would
assign
them
from
an
expression.
A
And
then
this
expression
is
copied
everywhere,
where
this
variable
is
used
and
if
it's
not
concept
than
it
results
in
a
different
value
and
which
of
kosta
finds
the
purpose
of
a
constant
and
now
we're
forced
it
to
be
pure,
which
means
compile-time
constant,
and
thus
it
is
still
so.
The
the
the
way
the
code
is
generated
is
still
the
same.
The
expression
is
copied
everywhere,
but
at
least
the
value
would
be
always
the
same
good.
A
View
and
pure
functions
are
disallowed
to
make
any
modifications
to
the
state
view
can
read
from
the
state,
but
pure
functions
cannot
even
read
from
the
state
and
we
cannot
enforce
so
at
the
level
of
the
EVM.
We
cannot
enforce
the
difference
between
view
and
view
and
pure,
but
we
can
enforce
the
difference
between
regular
functions
and
view
or
pure
functions,
and
that
is
why
we
use
steady
call.
A
It
might
happen
that
you
compile
code
solidity
code
and
then
run
it
on
a
virtual
machine
which
does
not
implements
that
e
call
so
on
so
sometimes
test
nets.
If
you,
if
you
run
a
client
in
test
net
mode,
then
sometimes
it
uses
the
very
old
frontier
release,
and
in
that
case
you
have
to
manually
set
your
EVM
to
the
right
version
tor
to
Byzantium.
To
do
that.
If
you,
if
it's
impossible
to
set
it
to
Byzantium,
then
you
can
specify
so
in
a
compiler
setting.
A
A
A
So
what
happened
was
that
if
you,
so
you
specify
an
address
to
send
your
money
to
and
if
the
address
has
leading
zeros,
then
this
encoding
library
would
just
shift
it
to
the
left,
so
it
would
instead,
it
would
not
write,
align
it,
but
it
would
left,
align
it
and
that
yeah
that
of
course
results
in
the
money
ending
up
in
the
wrong
and
the
wrong
address.
But
the
good
thing
is
that
the
way
that
was
implemented
was
that
it
actually
did
not
write
padded
with
zeros,
but
the
data
was
just
one
byte
short
and.
A
Yeah,
I'm
really
going
to
do
this,
but
eyes
are
still
openness,
that's
good!
So
when
you
read
from
call
data,
then
everything
is
zero
padded.
So
the
data
that
is
passed
on
to
a
smart
contracts
actually
ends
in
an
infinite
number
of
zeros
and
because
there
it
still
worked.
So
if
you,
if
you
call
a
small
contract
and
give
it
not
enough
data,
then
it
still
works
because
it
just
fills
with
zeros,
but
this
is
yeah
most
in
99%
of
all
cases
not
desired.
A
I
would
say,
and
because
of
that,
we
now
check
whether
the
data
that
is
applied
to
the
smart
contract
is
long
enough
to
hold
actually
did
yeah
to
be
decoded
to
be
decodable
yeah.
So
this
might
cause
some
calls
to
fail.
If
you
do
low
level
stuff
proxy
contracts
or
something
like
that,
so
yeah,
please
take
care
there
and
then
inline
assembly.
A
A
A
Good
and
then
there's
another
yeah,
weird
thing
which
is
different
in
other
languages,
which
perhaps
I'm
also
to
blame,
because
I
didn't
find
it
in
the
review
so
do-while.
So
the
Dubai
loop
is
basically
a
similar
to
a
while
loop.
So
you
the
control
for
enters
here
and
then
runs
this
and
the
difference.
The
while
loop
is
that
the
condition
is
checked
at
the
end
and
if
the
condition
is
true,
it
jumps
back
to
the
beginning.
A
Runs
it
again
and
check
the
condition
again
and
if
the
condition
is
false,
then
it
exits
the
loop
here
now
there
are.
These
statements
called
continue
and
break
continue,
just
skips
the
rest
of
the
loop
and
continues
with
the
next
iteration
and
break
exits.
The
whole
loop
exits
loop
completely
and
yes,
somehow
in
solidity,
continue,
was
implemented
in
a
way
that
if
you
have
continued
here,
it
jumps
to
the
beginning
of
the
loop
and
skips
checking
the
condition,
because
I
mean
the
condition.
Is
it
Daddy
and
then
at
the
end,
so
yeah
yeah.
A
B
A
A
They
just
return
their
input
and
the
idea
was
that
it's
much
easier
to
implement
it
in
the
correct
way,
because
you
implement
every
single
thing
only
just
once
and
then
call
it
from
everywhere,
but
it
will
of
course
result
in
very
inefficient
code
because
you
have
tons
of
function,
calls
and
jumps,
and
because
of
that
we
implement
an
optimizer,
a
new
optimizer
just
for
you
just
for
inline
assembly
and
we're
not
yet
confident
in
that
optimizer.
That's
the
reason.
A
C
A
A
A
A
So
there's
this
so
at
the
position:
0
X,
4
0.
There
is
a
special
value
that
points
the
first
free
space
in
memory.
So
if
you
want
to
write
something
into
memory
without
overwriting
something,
then
you
would
write
it
there
and
then
increment
or
increase
this
this
pointer
and
what
we
changed
was
not
the
location
of
this
pointer
but
its
initial
value.
So,
and
this
was
done-
an
unbreaking
change
because
I
hope
it
didn't
break
anything
so.
C
A
A
A
C
A
A
C
A
C
A
A
B
B
A
There's
a
plan
to
make
it
return
to
values,
a
boolean
success,
value
and
memory,
byte
array
with
the
return
data,
and
the
reason
we
didn't
include
it
now
was
because
it's
not
really
useful
because
you
cannot,
we
don't
have
ABI
decoding
functions,
and
so
since
we
don't
have
any
ID
coding
functions,
you
have
to
resort
resort
to
in
that
assembly
anyway,
and
then
you
can
just
do
the
call
within
an
assembly
to
begin
with,
and
the
reason
we
don't
have.
Abi
decoding
functions
is
mainly
because
we
don't
have
a
nice
syntax.
A
So
the
difference
between
ABI
decoding
and
encoding
functions
is
that
the
so
in
both
of
them.
You
need
to
specify
the
type
somehow
you
want
to
decode
and
but
for
encode.
Just
you
to
just
take
the
types
of
the
arguments
you
put
into
that
and
for
decode.
You
kind
of
that
doesn't
really
work,
so
you
can
look
at
the
types
you
want
to
pull
out,
but
that
yeah
so
and
the
syntax
of
solidity
doesn't
really
allow
for
a
way
to
specify
the
types
in
a
nice
way.
So
we
thought
about
using
I,
don't
know.
Perhaps.
A
A
A
One
of
them
is
the
call
datasize
check
another
one
is
at
Mott
and
mall-mart.
These
are.
These
is
a
built-in
function
that
take
three
parameters
and
two
modular
addition
and
multiplication,
and
they
check
for
the
third
parameter
to
be
zero.
It
was
probably
on
something
would
encounter,
but
yeah.
This
is
another
one,
so
something
we've
already
added
and
was
perhaps
not
such
a
good
idea
to
add
it,
or
in
now
was
check
the
size
of
the
return
data.
A
A
That's
another
one
time
check:
we're
currently
also
experimenting
on
overflow
checks.
What
I
said
in
the
beginning?
So
if
overflow
checks
are
nice
to
have,
but
they
will
be
more
expensive,
so
we're
currently
evaluating
how
expensive
they
will
be
and
regardless
there
will
be
a
keyword
to
mark
an
area
to
be
unchecked,
so
I
think
that's
also
something
that
c-sharp
has
yeah.
Where
were
these
overflow
checks
would
be
switched
off.
D
A
D
A
A
A
A
A
Change
yeah,
so
if
you
for
example,
as
we
had
earlier
given
date
to
bytes
one,
that
has
to
be
an
explicit
conversion,
even
though
that
the
value
of
range
doesn't
really
increase,
so
you
won't
notice
the
difference.
Okay,
but
that's
disallowed
anyway,
now
so
yeah
all
right,
you
won't
notice
the
difference
between
converting
from
you
in
sixty
you
and
eight
two
bytes
one
and
converting
from
you
in
sixteen
to
you
into
eight,
for
example.
A
So
this
ii,
actually
truncates
data
and
the
first
is
not
truncate
data
just
changes,
the
alignment
so
having
a
more
fine-grained
distinction
between
those
cooked
something
we
could
be
something
we
should
add.
But
again
it's
not
clear
how
to
do
that
in
a
syntax
which
syntax
to
use
for
this
distinction.
D
A
A
And
then,
of
course,
the
the
SMT
components
so
the
the
static
static,
SMT
based
analyzer,
formal
verification
component,
we're
pretty
far
there
already.
So
it
now
accepts
storage,
so
it
can
handle
storage
variables,
it
even
handles
branches
and
recombines
the
control
for
branches.
Later
on
the
main
thing
we
will
have
to
add
there
next
is
handling
modifiers
and
when
we're
at
that
stage,
I
think
we
can
have
a
proof-of-concept
release
of
that
component.
C
A
That's
something
I
want
to
avoid,
because
you
can't
rely
on
us
until
checker
or
I.
Don't
want
to
rely
on
them.
There
are
some
things
that
the
optimizer
can
do,
but
we
have
to
be
really
careful.
I
mean
the
SMT.
Checker
is
just
a
black
box.
Anything
can
happen
inside
there.
Anything
can
change
between
words
and
chip
version
changes
and
so
on
so
yeah.