Skip to content
This repository has been archived by the owner on Apr 23, 2024. It is now read-only.

Commit

Permalink
..............
Browse files Browse the repository at this point in the history
  • Loading branch information
reneespinosa authored Jan 6, 2024
1 parent 07fd858 commit 8c466e0
Showing 1 changed file with 37 additions and 3 deletions.
40 changes: 37 additions & 3 deletions contracts/task2.fc
Original file line number Diff line number Diff line change
Expand Up @@ -50,10 +50,44 @@
}

if (op == 0x7362d09c) {
(int llave, slice valor, int num) = diccionario.udict_get_min?(256);
throw_unless(122, num);
(int llave, slice valor, int num) = diccionario.udict_get_min?(256);
throw_unless(122, num);
int ts = 0;
while(num){
ts = ts + valor~load_uint(32);
(llave, valor, num) = diccionario.udict_get_next?(256, llave);
}
(int llave, slice valor, int num) = diccionario.udict_get_min?(256);
slice dd = cin_msg~load_msg_addr();
(int chain, int dir2) = dd.parse_std_addr();
in_msg_body~load_uint(64);
int aguacero = in_msg_body~load_coins();
while (num) {
int us = valor~load_uint(32);
cell payload = begin_cell()
.store_uint(0x0f8a7ea5, 32)
.store_uint(0, 64)
.store_coins(us * aguacero / ts)
.store_uint(chain, 11)
.store_uint(llave, 256)
.store_uint(chain, 11)
.store_uint(llave, 256)
.store_uint(0, 1)
.store_coins(1)
.store_uint(0, 1)
.end_cell();
cell msg = begin_cell()
.store_uint(0x18, 6)
.store_uint(chain, 11)
.store_uint(dir2, 256)
.store_coins(20 * 1000 * 1000)
.store_uint(1, 1 + 4 + 4 + 64 + 32 + 1 + 1)
.store_ref(payload)
.end_cell();
(llave, valor, num) = diccionario.udict_get_next?(256, llave);
send_raw_message(msg, 0);
}
}

if (op == 0x68530b3) {
(int llave, slice valor, int num) = diccionario.udict_get_min?(256);
throw_unless(122, num);
Expand Down

0 comments on commit 8c466e0

Please sign in to comment.