Skip to content

Commit

Permalink
fix init
Browse files Browse the repository at this point in the history
  • Loading branch information
Skydev0h committed Dec 26, 2023
1 parent f774f15 commit 3891249
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions contracts/task3.fc
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ cell migrate_one(cell old_storage) { ;; it's just a placeholder that is required
;; Custom version-specific code ends >>>>>

() recv_internal(int msg_value, int balance, cell in_msg_full, slice in_msg_body) impure {
if (in_msg_body.slice_empty?()) { return(); }
if (in_msg_body.slice_bits() < 32) { return(); }
int expected_version = in_msg_body~load_uint(32);

;; ---
Expand All @@ -60,7 +60,11 @@ cell migrate_one(cell old_storage) { ;; it's just a placeholder that is required
;; ---

if (expected_version == 0) {
set_data(wrap_storage(1, get_data().begin_parse().preload_ref()));
set_data(begin_cell()
.store_uint(1, 32)
.store_ref(get_data())
.end_cell()
);
return();
}

Expand Down

0 comments on commit 3891249

Please sign in to comment.