►
From YouTube: CasperLabs Weekly Workshop 6/19: Contract Headers
Description
During this workshop, we will introduce how contract headers work.
To attend the next workshop, visit: https://bit.ly/2TQnXfM
Follow Us: https://twitter.com/meetCasperLabs
General Discussion: https://t.me/CasperLabs
Technical Discussion: https://discordapp.com/invite/Q38s3Vh
A
Okay,
it's
recording
I,
don't
know
how!
Well
you
remember
when
we
talked
about
zesting
contract
and
that
was
while
ago
so
today,
I
want
you
I
want
to
show
you
a
feature.
We
call
contract
headers,
and
this
is
a
step
with
it
towards
being
more
developer-friendly
for
writing.
Smart
contracts
and
I
rewrote
my
fasting
contract
to
support
this
feature
and.
A
You
so
many
times
that
you
had
to
parse
it
by
your
own
and
assume
that
the
first
argument
is
the
method
name
and
then,
based
on
this
decide
which
actual
function
you
want
to
call
and
that
that
wasn't
very
good,
because
that's
not
something
developers
should
be
doing
it
would
be
rather
than
the
system
gives
this
to
you
and
that
what
we
did,
we
focused
a
lot
on.
What's
the
next
big
thing,
we
want
the
improvements
on,
and
that
was
our.
This
is
to
get
rid
of
this
and
introduce
functions
function
name.
A
A
A
A
A
Then
the
host
function,
the
host
environment,
let's
say
we'll
call
the
virtual
machine
and
it
will
put
the
wasn't
file
inside
the
virtual
machine
and
it
will
call
the
method
to
you
specified.
That's
why
every
method
that
you
want
to
specify
should
be
no
mangled
function,
which
means
the
compiler
will
not
change
its
name
inside
the
world.
It
wasn't
filed.
B
A
A
Instead
of
having
positional
arguments,
we
changed
to
the
named
arguments,
which
means
it's
no
longer
relevant.
What's
the
name
of
the
position
of
document,
we
only
focus
Python
names
of
the
first,
so
you
should
do
runtime
get
named
arc
and
specify
a
string
in
this
case.
It's
admin
here.
It's
just
a
string,
admin
and
expected
and
again,
if
you,
when
I,
call
something
that's
that's
not
there
or
something
that
has
the
wrong
type,
then
you
then
the
system
will
handle
this
for
you,
you
don't
have
to
specify
by
your
own
okay.
A
A
So
when
you
have
the
my
vesting
in
testing,
contract
implements
vesting
trait
and
those
functions
are
setters
and
getters
for
specific
time.
The
types
that
I
use
in
that
trait,
which
means
that
every
time
the
vesting
trait
wants
to
save
or
read
something
from
the
memory,
it
will
use
one
those
functions,
and
this
is
the
building
with
the
with
the
blockchain.
A
These
are
cliff
timestamp,
some
at
some
point
point
of
time.
Users
should
be
able
to
withdraw
some
amount,
and
this
is
amount
is
cliff
amount,
and
then
we
have
drip
duration
and
drip
amount
means
after
after
so
after
the
cliff
timestamp
moment
is
reached
every
dripped
duration.
The
user
can
withdraw
additional
drip
amount.
A
A
A
A
These
are
just
set
safe
value
under
a
key
which
is
admin
or
recipient,
and
then
I
can
use
it
in
verify.
Admin
account
and
verify
recipient
account,
which
is
this
get
the
admin
account.
That
was
calling
the
contract
and
compare
and
if
it's
not
the
same
thing,
return
error
simple
check,
but
that
allows
me
to
to
guard
functions
so,
for
example,
post
someone
will
call
pause.
A
A
Then
it's
good
for
the
contract
to
know
that
this
is
allowed
allowed
argument.
That's
one
thing,
and
the
second
thing
is
that
it
should
have
a
specific
type,
because
we
don't
want
the
contract
to
accept
arguments
that
are
random
or
that
could
be
anything
we
want
to
specify
what
we
want.
So
that's
the
one
one
thing
we
want
to
do
and
how
we
do
it
so.
A
Keep
in
mind
that
for
later
so
right
now,
if
you
want
to
deploy
the
contract,
you
don't
simply
deploy
the
contract
you
want
to.
You
need
to
actually
create
a
package,
we
call
contract
package
and
then
you
can
be
adding
multiple
versions
of
the
contract
contracts
to
this
package.
So
this
package
will
be
your
starting
point
for
managing
contracts.
So
that's
that's
for
the
updates
reason.
B
A
Okay,
so
what
I
do
now?
What
I
do
here
contract
package
has
I
have
the
contract
package
has
I,
can
manage
this
contract
package
hash,
because
my
access
Europe
is
still
in
scope,
but
if
I,
don't
I,
don't
save
it
anywhere.
So
after
this
code
is
executed,
then
the
admin
will
no
longer
have
the
access,
but
I
simply
don't
need
it
that
way.
I
haven't
done
anything
with
it
and
okay.
Next
thing
is
a
group
start
which
create
contract
user
group.
A
That's
a
that's
the
function
to
add
a
group
create
a
few
you
rats
and
we
turn
those
URIs
okay.
So
the
first
argument
is
the
contract
packet
hash.
Then,
because
this
is
the
contract
package
we
work
with
and
we
want
to
add
group
into
then
I
specify
a
string
need
group.
This
is,
is
it
so
that's
just
string
name
of
the
group
in
your
group,
then
I
specify
number
of
new
Europe's
I
want
to
create,
and
then,
if
I
want
to
other
existing
curious
I
can
using
bit
reset.
A
So
this
is
the
Europe,
as
you
might
remember,
us
is
the
pointer
in
this
is
in
our
system,
but
also
it
is
treated
as
a
access
token.
So,
if
you
have
Europe,
then
the
contract
could
check.
If
you
have
this
Europe
and
let
you
in
you
can
do
about
it.
For
example,
you
can
have
a
Europe
that
points
on
the
and
the
purse
that
holds
tokens.
So
if
you
have
it,
you
can
access
it.
If
you
don't,
you
cannot
so
in
this
case
after
this
call
is
done.
A
A
It's
here
on
me
like
I
use
it
in
the
I
will
gonna
use
this
in
this
call,
but
I
will
not
use
it
later,
because
this
is
the
you
ref
and
the
group.
That's
that
why
I
called
in
it
group,
because
this,
the
I'm,
the
goal
of
this
group
is
to
set
access
rights
to
the
init
function
and
the
init
function
in
my
example
needs
to
be
called
only
once
during
this
call.
So
that's
the
constructor,
so
you
cannot
call
the
constructor
multiple
times
shouldn't
be
so
I
created
this
group.
A
A
A
List
of
arguments,
and
so
for
example,
first
argument
is
here
an
admin.
This
is
string
and
you
specify
CL
type
so
program
for
here
below
this.
You
5
1
2,
it's
a
simple
sale
type,
but
you
can
pass
a
more
complex
types
and
every
every
type
that
can
be
accepted
by
the
system
should
implement
a
trade
called
CL
typed,
the
has
CL
type
function
and
it
will
return
some
sort
of
CL
type
combination,
so
that
could
be
like.
Maybe
that
could
be
this
here.
A
We
have
a
list
fix
this
of
32
elements
of
bytes,
and
so
we
don't
have
to
type
it
manually.
We
can
reuse
this
and
that
says,
accept
an
argument
called
admin
with
this
type,
all
right.
So
that's
the
list
of
arguments
and
then
I
specify
the
return
type
for
now.
Here,
every
type
every
function
returns
nothing.
A
A
That's
a
proper
on
top
of
string,
so
only
you
reps,
that
are
only
accounts
that
helps
you
reps,
that
are
in
the
in
each
group.
Can
access
this
and
in
this
call,
because
we
just
created
it,
we
still
have
it
in
the
scope,
so
we
can
access
it
here
during
this
deploy
function,
execution,
okay,
so
later,
I
specify
I,
also
specify
entry
point
type,
and
this
is
something
I'm
really
excited
about,
because
that
solves
a
lot
of
problems
in
the
past.
A
When
you
wanted
to
call
and
implement
and
call
smart
contract,
you
had
to
first
call
the
function
as
a
account.
So
you
have
you
need
to
have
a
type
context
of
the
account
and
then
the
account
should
call
the
contract,
because
only
this
way
you
could
gain
the
contracts
own
context,
so
some
time
ago
requested
that
it
was
very
helpful
just
to
be
able
to
call
the
contracts
by
its
own
and
directly.
A
B
A
But
in
this
example,
every
entry
point
is
a
contract
so
because
I'm
writing
smart
contract
here.
Okay,
so
that's
all
you
know:
let's
go
a
bit
further
three
documents,
so
we
want.
We
want
to
know
some
arguments
here.
We
expect
this
to
be
passed
to
the
along
with
the
Watson
file,
so
we
extract
admin.
We
extract
recipient
and
the
best
in
config
and
the
best
in
config.
A
So
that's
just
the
best
in
conflict
right,
that's
composed
out
of
multiple
multiple
arguments
that
specify
cranked
up
quick
amount
and
and
others.
So
this
this
part
is
reading
arguments
and
what
next
repair
contractors
so
again
as
I
did
in
the
past,
so
it's
required
to
pass
the
purse
with
tokens
to
the
contract.
How
do
you
do
it?
You
create
you,
take
the
main
parts
of
the
account
that
has
a
positive
balance.
A
A
That
are
the
name
keys
for
the
contract
and
if
you
pass
it
so
you
pass
it
here,
the
contract
will
have
those
name
please,
and
this
is
where
the
contract
gets
actually
deployed
and
so
storage
at
contract
version,
and
that
will
add
the
first
version
of
our
contract
to
the
contract
package
so
yeah.
So
you
need
to
put
package
hash
entry
points
of
the
list
of
we
created
and
the
vesting
keys
and
the
second
list
we
created
this
way
gives
you
contract
hash.
A
First,
you
can
save
the
best
in
contract,
but
also
for
the
regions
of
smart
free
testing.
Testing
frame
would
not
be
able
to
exactly
extract
it
from
from
this
one.
The
half
of
the
contract
is
good
to
wrap
it
under
a
UF
and
store
it
under
a
different
key.
So
that
will
give
you
the
hash
and
that
will
give
you
the
instance
of
the
contract
but
will
be
used
in
the
testing
framework
and
the
end
of
this
method
is
actually
calling
the
in
it.
And
so
you
specify
you
do
a
runtime
call
contract.
A
Let's
fight
the
hash,
specify
the
method
and
specify
arguments,
and
here
we
introduced
runtime
arcs
macro,
that's
defined.
As
you
see
it's
a
very
nice,
so
you
specify
the
key
and
the
value,
and
this
should
be
all
of
the
arguments
required
by
in
it.
So
dislike
admin,
recipient,
cliffs,
drip
total
on
this
duration,
and
this
is
the
same
list
as
you
saw
here,
and
then
the
function
ends
and
two
elements.