This repository has been archived by the owner on Apr 23, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
reneespinosa
committed
Jan 6, 2024
1 parent
34b211f
commit 097a058
Showing
1 changed file
with
30 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,35 @@ | ||
#include "imports/stdlib.fc"; | ||
|
||
() recv_internal(int my_balance, int msg_value, cell in_msg_full, slice in_msg_body) impure { | ||
slice cin_msg = in_msg_full.begin_parse(); | ||
cin_msg~load_uint(4); | ||
slice store = get_data().begin_parse(); | ||
(int chain, int dir) = store~load_msg_addr().parse_std_addr(); | ||
|
||
cell diccionario = store~load_dict(); | ||
|
||
if (op == 0x368ddef3) { | ||
(int chain, int dir) = cin_msg~load_msg_addr().parse_std_addr(); | ||
throw_unless(120, admin_address == addr); | ||
} | ||
|
||
if (op == 0x278205c8) { | ||
(int chain, int dir) = cin_msg~load_msg_addr().parse_std_addr(); | ||
throw_unless(120, admin_address == addr); | ||
} | ||
} | ||
|
||
cell get_users() method_id { | ||
(slice store, slice dir) = get_data().begin_parse().load_msg_addr(); | ||
return store~load_dict(); | ||
} | ||
|
||
int get_user_share(slice cosa) method_id { | ||
(int chain, int dir) = cosa~parse_std_addr(); | ||
(slice s, int num) = get_users().udict_get?(256, addr); | ||
if (num) { | ||
return s~load_uint(32); | ||
} else { | ||
return 0; | ||
} | ||
} |