|
|
|
@ -3,6 +3,9 @@
|
|
|
|
|
#include "imports/op-codes.fc"; |
|
|
|
|
#include "imports/params.fc"; |
|
|
|
|
|
|
|
|
|
;; -1 if needed, 0 if not |
|
|
|
|
const signature_needed = -1; |
|
|
|
|
|
|
|
|
|
;; storage scheme |
|
|
|
|
;; cell collection_content |
|
|
|
|
;; cell nft_item_code |
|
|
|
@ -68,6 +71,11 @@ 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); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
() recv_internal(int msg_value, cell in_msg_full, slice in_msg_body) impure { |
|
|
|
|
if (in_msg_body.slice_empty?()) { ;; bounce back empty messages |
|
|
|
|
throw(0xffff); |
|
|
|
@ -93,6 +101,12 @@ slice calculate_nft_item_address(int wc, cell state_init) {
|
|
|
|
|
int item_index = slice_hash(domain); |
|
|
|
|
|
|
|
|
|
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)); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
cell nft_content = begin_cell() |
|
|
|
|
.store_slice(sender_address) |
|
|
|
|
.store_ref(begin_cell().store_slice(domain).end_cell()) |
|
|
|
|