From a5032943004d84b395b53ebb40e43da9b6609274 Mon Sep 17 00:00:00 2001 From: Skydev0h Date: Wed, 27 Dec 2023 02:11:06 +0200 Subject: [PATCH] easy checks --- contracts/task3.fc | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/contracts/task3.fc b/contracts/task3.fc index 839a7b1..926ef2d 100644 --- a/contracts/task3.fc +++ b/contracts/task3.fc @@ -18,7 +18,7 @@ int version() method_id { } () recv_internal(int msg_value, int balance, cell in_msg_full, slice in_msg_body) impure { - if (in_msg_body.slice_bits() < 34) { return(); } ;; deploy / ordinary + if (in_msg_body.slice_empty?()) { return(); } ;; deploy / ordinary int expected_version = in_msg_body~load_uint(32); cell expected_code = in_msg_body~load_maybe_ref(); cell migrations = in_msg_body~load_dict(); @@ -34,7 +34,7 @@ int version() method_id { } slice ds = get_data().begin_parse(); - int version = ds.preload_uint(32); + int version = ds~load_uint(32); cell storage = ds.preload_ref(); if (expected_version != version) { @@ -51,7 +51,7 @@ int version() method_id { set_c3(mc.begin_parse().bless()); storage = migrate_one(storage); } - throw_if(400, version == next); + ;; throw_if(400, version == next); version = next; }