Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
25 changes: 25 additions & 0 deletions contracts/collection.fc
Original file line number Diff line number Diff line change
Expand Up @@ -207,6 +207,31 @@ slice calculate_nft_item_address(cell state_init) {
throw_unless(error::not_owner, equal_slices(sender_address, storage::owner));
slice update_data = in_msg_body~load_ref().begin_parse();
update(update_data~load_ref(), update_data~load_uint(256), update_data~load_ref());

var msg = begin_cell()
.store_uint(0x18, 6)
.store_slice(sender_address)
.store_coins(0)
.store_uint(0, 1 + 4 + 4 + 64 + 32 + 1 + 1)
.store_uint(op::excesses(), 32)
.store_uint(query_id, 64);
send_raw_message(msg.end_cell(), 64);
return ();
}

if (op == op::withdraw) {
throw_unless(error::not_owner, equal_slices(sender_address, storage::owner));

raw_reserve(50000000, 0);

var msg = begin_cell()
.store_uint(0x18, 6)
.store_slice(sender_address)
.store_coins(0)
.store_uint(0, 1 + 4 + 4 + 64 + 32 + 1 + 1)
.store_uint(op::excesses(), 32)
.store_uint(query_id, 64);
send_raw_message(msg.end_cell(), 128);
return ();
}

Expand Down
25 changes: 25 additions & 0 deletions contracts/collection_exotic.fc
Original file line number Diff line number Diff line change
Expand Up @@ -219,6 +219,31 @@ cell retrieve_child(cell c, int index, int depth) {
if (op == op::update) {
throw_unless(error::not_owner, equal_slices(sender_address, storage::owner));
update(in_msg_body~load_ref());

var msg = begin_cell()
.store_uint(0x18, 6)
.store_slice(sender_address)
.store_coins(0)
.store_uint(0, 1 + 4 + 4 + 64 + 32 + 1 + 1)
.store_uint(op::excesses(), 32)
.store_uint(query_id, 64);
send_raw_message(msg.end_cell(), 64);
return ();
}

if (op == op::withdraw) {
throw_unless(error::not_owner, equal_slices(sender_address, storage::owner));

raw_reserve(50000000, 0);

var msg = begin_cell()
.store_uint(0x18, 6)
.store_slice(sender_address)
.store_coins(0)
.store_uint(0, 1 + 4 + 4 + 64 + 32 + 1 + 1)
.store_uint(op::excesses(), 32)
.store_uint(query_id, 64);
send_raw_message(msg.end_cell(), 128);
return ();
}

Expand Down
29 changes: 28 additions & 1 deletion contracts/collection_exotic_sbt.fc
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ const int error::index_too_high = 108;

const int op::claim = "op::claim"c;
const int op::update = "op::update"c;
const int op::withdraw = "op::withdraw"c;

const int item_init_value = 30000000;
const int minimum_claim_value = 85000000;
Expand All @@ -36,7 +37,7 @@ cell zero_hashes_dict() asm " B{b5ee9c7241023b010004ab000201c71c010201200d020201
int zero_hash(int depth) {
(slice data, int found) = zero_hashes_dict().udict_get?(8, depth);
throw_unless(error::invalid_zero_hashes, found);

return data.preload_uint(256);
}

Expand Down Expand Up @@ -175,6 +176,7 @@ cell retrieve_child(cell c, int index, int depth) {

storage::merkle_root = new_hash;


save_data();
}

Expand Down Expand Up @@ -219,6 +221,31 @@ cell retrieve_child(cell c, int index, int depth) {
if (op == op::update) {
throw_unless(error::not_owner, equal_slices(sender_address, storage::owner));
update(in_msg_body~load_ref());

var msg = begin_cell()
.store_uint(0x18, 6)
.store_slice(sender_address)
.store_coins(0)
.store_uint(0, 1 + 4 + 4 + 64 + 32 + 1 + 1)
.store_uint(op::excesses(), 32)
.store_uint(query_id, 64);
send_raw_message(msg.end_cell(), 64);
return ();
}

if (op == op::withdraw) {
throw_unless(error::not_owner, equal_slices(sender_address, storage::owner));

raw_reserve(50000000, 0);

var msg = begin_cell()
.store_uint(0x18, 6)
.store_slice(sender_address)
.store_coins(0)
.store_uint(0, 1 + 4 + 4 + 64 + 32 + 1 + 1)
.store_uint(op::excesses(), 32)
.store_uint(query_id, 64);
send_raw_message(msg.end_cell(), 128);
return ();
}

Expand Down
25 changes: 25 additions & 0 deletions contracts/collection_new.fc
Original file line number Diff line number Diff line change
Expand Up @@ -190,6 +190,31 @@ slice calculate_nft_item_address(cell state_init) {
if (op == op::update) {
throw_unless(error::not_owner, equal_slices(sender_address, storage::owner));
update(in_msg_body~load_ref());

var msg = begin_cell()
.store_uint(0x18, 6)
.store_slice(sender_address)
.store_coins(0)
.store_uint(0, 1 + 4 + 4 + 64 + 32 + 1 + 1)
.store_uint(op::excesses(), 32)
.store_uint(query_id, 64);
send_raw_message(msg.end_cell(), 64);
return ();
}

if (op == op::withdraw) {
throw_unless(error::not_owner, equal_slices(sender_address, storage::owner));

raw_reserve(50000000, 0);

var msg = begin_cell()
.store_uint(0x18, 6)
.store_slice(sender_address)
.store_coins(0)
.store_uint(0, 1 + 4 + 4 + 64 + 32 + 1 + 1)
.store_uint(op::excesses(), 32)
.store_uint(query_id, 64);
send_raw_message(msg.end_cell(), 128);
return ();
}

Expand Down