This repository was archived by the owner on Apr 22, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathsample.func
More file actions
33 lines (30 loc) · 1.53 KB
/
sample.func
File metadata and controls
33 lines (30 loc) · 1.53 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
() recv_internal(int my_balance, int msg_value, cell in_msg_full, slice in_msg_body) impure {
slice ds = get_data().begin_parse();
slice oracle_address = ds~load_msg_addr();
slice sender_address = utils::parse_sender_address(in_msg_full);
if(equal_slices(sender_address, oracle_address)){
slice original_sender = in_msg_body~load_msg_addr();
int original_time = in_msg_body~load_uint(64);
int original_msg_value = in_msg_body~load_grams();
slice original_msg_body = (in_msg_body~load_ref()).begin_parse();
int jobID = in_msg_body~load_uint(64);
int result = in_msg_body~load_uint(64);
} else {
cell link = ds~load_ref(); ;; https://github.com/ton-link/ton-link-contract-v3/blob/main/typescript/source/lib/link-format.md
var msg_body = begin_cell()
.store_uint(50, 32)
.store_uint(0, 64)
.store_ref(in_msg_body)
.store_ref(link)
.end_cell();
var msg = begin_cell()
.store_uint(0x18, 6)
.store_slice(oracle_address)
.store_grams(600000000)
.store_uint(0, 1 + 4 + 4 + 64 + 32 + 1 + 1)
.store_ref(msg_body)
.end_cell();
send_raw_message(msg, 3);
}
return ();
}