https://gitlab.com/tezos/tezos
Raw File
Tip revision: 946045f0fd19b10f0419990eee290306edc15077 authored by Nic Volanschi on 28 April 2023, 14:15:13 UTC
doc: explain the default role in the doc guidelines
Tip revision: 946045f
lsl_bytes_016.tz
parameter unit;
storage unit;
code { DROP;

       # If shift is 0, LSL returns the bytes untouched
       # 0x06 LSL 0 = 0x06
       PUSH nat 0; PUSH bytes 0x06; LSL; PUSH bytes 0x06; ASSERT_CMPEQ;

       # If shift is not 0, LSL returns a bytes longer than the original
       # 0x06 LSL 1 = 0x000c  (not 0x0c)
       PUSH nat 1; PUSH bytes 0x06; LSL; PUSH bytes 0x000c; ASSERT_CMPEQ;

       # 0x06 LSL 8 = 0x0600
       PUSH nat 8; PUSH bytes 0x06; LSL; PUSH bytes 0x0600; ASSERT_CMPEQ;

       # 0x0006 LSL 1 = 0x00000c  (not 0x0c nor 0x000c)
       PUSH nat 1; PUSH bytes 0x0006; LSL; PUSH bytes 0x00000c; ASSERT_CMPEQ;

       UNIT; NIL @noop operation; PAIR; };
back to top