() recv_internal(int my_balance, int msg_value, cell in_msg_full, slice in_msg_body) impure { if (in_msg_body.slice_empty?()) { ;; ignore empty messages return (); } slice cs = in_msg_full.begin_parse(); int flags = cs~load_uint(4); if (flags & 1) { on_bounce(in_msg_body); return (); } slice sender_address = cs~load_msg_addr(); cs~load_msg_addr(); ;; skip dst cs~load_coins(); ;; skip value cs~skip_bits(1); ;; skip extracurrency collection cs~load_coins(); ;; skip ihr_fee int fwd_fee = muldiv(cs~load_coins(), 3, 2); ;; we use message fwd_fee for estimation of forward_payload costs int op = in_msg_body~load_uint(32); if (op == op::transfer()) { ;; outgoing transfer send_tokens(in_msg_body, sender_address, msg_value, fwd_fee); return (); } if (op == op::internal_transfer()) { ;; incoming transfer receive_tokens(in_msg_body, sender_address, my_balance, fwd_fee, msg_value); return (); } if (op == op::burn()) { ;; burn burn_tokens(in_msg_body, sender_address, msg_value, fwd_fee); return (); } throw(0xffff); }