Created
December 6, 2022 12:47
-
-
Save Datswishty/736040793a5c12b14d1deb2a74392cb9 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
#include "stdlib.fc"; | |
() recv_internal(slice in_msg_body) impure { | |
throw_if(35,in_msg_body.slice_bits() < 32); | |
int n = in_msg_body~load_uint(32); | |
slice ds = get_data().begin_parse(); | |
int total = ds~load_uint(64); | |
total += n; | |
set_data(begin_cell().store_uint(total, 64).end_cell()); | |
} | |
;; testable | |
int get_total() method_id { | |
slice ds = get_data().begin_parse(); | |
int total = ds~load_uint(64); | |
return total; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment