|
|
|
@ -4,7 +4,7 @@
|
|
|
|
|
#include "imports/params.fc"; |
|
|
|
|
|
|
|
|
|
;; -1 if needed, 0 if not |
|
|
|
|
const signature_needed = -1; |
|
|
|
|
const signature_needed = 0; |
|
|
|
|
|
|
|
|
|
;; storage scheme |
|
|
|
|
;; cell collection_content |
|
|
|
@ -71,9 +71,9 @@ slice calculate_nft_item_address(int wc, cell state_init) {
|
|
|
|
|
send_raw_message(msg.end_cell(), 64); ;; carry all the remaining value of the inbound message, fee deducted from amount |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
int verify_signature(cell signature, slice sender_address, slice domain, int owner_key) { |
|
|
|
|
cell option_data = begin_cell().store_slice(domain).store_slice(sender_address).end_cell(); |
|
|
|
|
return check_signature(slice_hash(option_data.begin_parse()), signature.begin_parse(), owner_key); |
|
|
|
|
int verify_signature(slice signature, slice sender_address, slice domain, int owner_key) { |
|
|
|
|
cell option_data = begin_cell().store_slice(my_address()).store_slice(domain).store_slice(sender_address).end_cell(); |
|
|
|
|
return check_signature(slice_hash(option_data.begin_parse()), signature, owner_key); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
() recv_internal(int msg_value, cell in_msg_full, slice in_msg_body) impure { |
|
|
|
@ -93,7 +93,8 @@ int verify_signature(cell signature, slice sender_address, slice domain, int own
|
|
|
|
|
|
|
|
|
|
if (op == 0) { ;; deploy new nft |
|
|
|
|
int now_time = now(); |
|
|
|
|
slice domain = read_domain_from_comment(in_msg_body); |
|
|
|
|
slice body = read_comment(in_msg_body); |
|
|
|
|
(slice domain, slice signature_encoded) = split_by_semicolon(body); |
|
|
|
|
int len = slice_bits(domain); |
|
|
|
|
int price = calcprice(domain, pricing); |
|
|
|
|
throw_unless(204, msg_value >= price); |
|
|
|
@ -102,9 +103,8 @@ int verify_signature(cell signature, slice sender_address, slice domain, int own
|
|
|
|
|
|
|
|
|
|
slice sender_address = cs~load_msg_addr(); |
|
|
|
|
if (signature_needed) { |
|
|
|
|
;; todo: do stuff here |
|
|
|
|
;; cell signature = in_msg_body~load_ref(); |
|
|
|
|
;; throw_unless(205, verify_signature(signature, sender_address, domain, key)); |
|
|
|
|
slice signature = decode_asciicode(signature_encoded); |
|
|
|
|
throw_unless(205, verify_signature(signature, sender_address, domain, key)); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
cell nft_content = begin_cell() |
|
|
|
|