TON Дев Чат
<{
SETCP0 ACCEPT
code PUSHREF SETCODE
}>s
’nop
можете обьяснить?
' nop
<{ LDMSGADDR DROP }>s runvmcode drop
// s -- wc addr s'
{ 1 i@+ swap not abort"Internal address expected"
1 i@+
1 i@+ swap { 4 u@+ swap u@+ nip } if
swap { 9 u@+ 32 } { 256 swap 8 } cond
i@+ rot u@+
} : addr@+
{ addr@+ drop } : addr@
{ (dump) "C{" $pos 0= } : cell?
string?
integer?
box?
tuple?
SYS-5-SSD-32 Server - Intel Xeon E3-1270v6 - 32GB DDR4 ECC 2400MHz - 2x 450GB SSD NVMe Soft RAID
is_test_only
, bounceable
и bounce
флагов?
def to_user_friendly_string(self, **kwargs):
tag = kwargs.get(
"tag", BOUNCEABLE_TAG if self.is_bounceable else NON_BOUNCEABLE_TAG
)
is_test_only = kwargs.get("is_test_only", self.is_test_only)
if is_test_only:
tag |= TEST_FLAG
user_friendly_address = bytearray()
user_friendly_address.append(tag)
user_friendly_address.append((self.workchain_id + 0x100) % 0x100)
user_friendly_address.extend(self.hash_part)
user_friendly_address_with_checksum = user_friendly_address + crc16(
user_friendly_address
)
uf_encoded = base64.urlsafe_b64encode(user_friendly_address_with_checksum).decode()
return uf_encoded
is_test_only
ето типа только в testnet ?
TEST_FLAG = 0x80
BOUNCEABLE_TAG = 0x11
NON_BOUNCEABLE_TAG = 0x51
not in {0, 1}
0x80:
0x11:
if tag & TEST_FLAG:
is_test_only = True
tag ^= TEST_FLAG
if tag not in {BOUNCEABLE_TAG, NON_BOUNCEABLE_TAG}:
raise tonlib_exceptions.InvalidUserFriendlyAddress("Unknown address tag")
generate-random-id
?generate-random-id -m keys
, они размером 36 байт. При этом если верить step-by-step
Там есть первые 2 "тег" байта и еще последние содержат что-то специфичное.