0

What is the meaning of "current" in the description of the michelson instruction LEVEL:

LEVEL: Push the current block level

3

LEVEL pushes the level of the block that contains the current transactions.

We can verify this by originating a contract that only stores the level as returned by LEVEL:

$ tezos-client originate contract lvl transferring 0 from bootstrap1 running \ 
    'parameter unit; storage nat; code { DROP; LEVEL; NIL operation; PAIR; }' \
    --burn-cap 1 --force --init '0'
$ tezos-client bake for bootstrap5

It's initial storage is set to 0. We now send a transaction to this contract:

$ tezos-client transfer 0 from bootstrap1 to lvl
$ tezos-client bake for bootstrap5

Now, the level of the last block is the same as the storage of the contract:

$ tezos-client rpc get /chains/main/blocks/head/header/ | jq .level
45
$ tezos-client get contract storage for lvl
45

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.