Skip to content

Commit

Permalink
bref
Browse files Browse the repository at this point in the history
  • Loading branch information
Skydev0h committed Dec 28, 2023
1 parent c2432de commit 0448ceb
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions contracts/task2.fc
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,8 @@ int equal_slices?(slice a, slice b) asm "SDEQ";

() return_if(int cond) impure asm "IFRET";

builder store_builder_ref(builder to, builder from) asm "STBREFR";

() sub(int msg_value, cell in_msg_full, slice in_msg_body) impure inline {

if (in_msg_body~is_transfer_call()) {
Expand Down Expand Up @@ -68,7 +70,7 @@ int equal_slices?(slice a, slice b) asm "SDEQ";
(slice user_addr, int user_share) = unpair(user_data);
int value = muldiv(user_share, amount, total_share);
send_raw_message(
base.store_ref(
base.store_builder_ref(
msg_base
.store_coins(value) ;; amount:(VarUInteger 16)
;; .store_uint(1024, 3 + 8) ;; 10 0 00000000
Expand All @@ -82,7 +84,8 @@ int equal_slices?(slice a, slice b) asm "SDEQ";
;; .store_dict(null()) ;; custom_payload:(Maybe ^Cell)
;; .store_coins(1) ;; forward_ton_amount:(VarUInteger 16)
;; .store_dict(null()) ;; 0 ;; forward_payload:(Either Cell ^Cell)
.end_cell())
;;.end_cell()
)
.end_cell(),
1);

Expand Down Expand Up @@ -131,7 +134,7 @@ int equal_slices?(slice a, slice b) asm "SDEQ";
.store_slice(user_addr)
.store_coins(value)
.store_uint(0, 1 + 4 + 4 + 64 + 32 + 1 + 1)
.end_cell(),
.end_cell(),
1);

}
Expand Down

0 comments on commit 0448ceb

Please sign in to comment.