Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update all NFT contracts stdlib.fc dependencies to available alternatives #16

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
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
2 changes: 1 addition & 1 deletion nft/nft-collection-editable.fc
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ slice calculate_nft_item_address(int wc, cell state_init) {
return ();
}

throw_unless(401, equal_slices(sender_address, owner_address));
throw_unless(401, equal_slice_bits(sender_address, owner_address));


if (op == 1) { ;; deploy new nft
Expand Down
2 changes: 1 addition & 1 deletion nft/nft-collection.fc
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ slice calculate_nft_item_address(int wc, cell state_init) {
return ();
}

throw_unless(401, equal_slices(sender_address, owner_address));
throw_unless(401, equal_slice_bits(sender_address, owner_address));


if (op == 1) { ;; deploy new nft
Expand Down
10 changes: 5 additions & 5 deletions nft/nft-item-editable-DRAFT.fc
Original file line number Diff line number Diff line change
Expand Up @@ -57,15 +57,15 @@ int min_tons_for_storage() asm "50000000 PUSHINT"; ;; 0.05 TON
.store_uint(op, 32)
.store_uint(query_id, 64);

if (~ builder_null?(payload)) {
if (~ builder_depth(payload)) {
msg = msg.store_builder(payload);
}

send_raw_message(msg.end_cell(), send_mode);
}

() transfer_ownership(int my_balance, int index, slice collection_address, slice owner_address, cell content, slice editor_address, slice sender_address, int query_id, slice in_msg_body, int fwd_fees) impure inline {
throw_unless(401, equal_slices(sender_address, owner_address));
throw_unless(401, equal_slice_bits(sender_address, owner_address));

slice new_owner_address = in_msg_body~load_msg_addr();
force_chain(new_owner_address);
Expand Down Expand Up @@ -96,7 +96,7 @@ int min_tons_for_storage() asm "50000000 PUSHINT"; ;; 0.05 TON
}

() transfer_editorship(int my_balance, int index, slice collection_address, slice owner_address, cell content, slice editor_address, slice sender_address, int query_id, slice in_msg_body, int fwd_fees) impure inline {
throw_unless(401, equal_slices(sender_address, editor_address));
throw_unless(401, equal_slice_bits(sender_address, editor_address));

slice new_editor_address = in_msg_body~load_msg_addr();
force_chain(new_editor_address);
Expand Down Expand Up @@ -147,7 +147,7 @@ int min_tons_for_storage() asm "50000000 PUSHINT"; ;; 0.05 TON

(int init?, int index, slice collection_address, slice owner_address, cell content, slice editor_address) = load_data();
if (~ init?) {
throw_unless(405, equal_slices(collection_address, sender_address));
throw_unless(405, equal_slice_bits(collection_address, sender_address));
store_data(index, collection_address, in_msg_body~load_msg_addr(), in_msg_body~load_ref(), in_msg_body~load_msg_addr());
return ();
}
Expand All @@ -168,7 +168,7 @@ int min_tons_for_storage() asm "50000000 PUSHINT"; ;; 0.05 TON
return ();
}
if (op == op::edit_content()) {
throw_unless(410, equal_slices(sender_address, editor_address));
throw_unless(410, equal_slice_bits(sender_address, editor_address));
store_data(index, collection_address, owner_address, in_msg_body~load_ref(), editor_address);
return ();
}
Expand Down
6 changes: 3 additions & 3 deletions nft/nft-item.fc
Original file line number Diff line number Diff line change
Expand Up @@ -55,15 +55,15 @@ int min_tons_for_storage() asm "50000000 PUSHINT"; ;; 0.05 TON
.store_uint(op, 32)
.store_uint(query_id, 64);

if (~ builder_null?(payload)) {
if (~ builder_depth(payload)) {
msg = msg.store_builder(payload);
}

send_raw_message(msg.end_cell(), send_mode);
}

() transfer_ownership(int my_balance, int index, slice collection_address, slice owner_address, cell content, slice sender_address, int query_id, slice in_msg_body, int fwd_fees) impure inline {
throw_unless(401, equal_slices(sender_address, owner_address));
throw_unless(401, equal_slice_bits(sender_address, owner_address));

slice new_owner_address = in_msg_body~load_msg_addr();
force_chain(new_owner_address);
Expand Down Expand Up @@ -116,7 +116,7 @@ int min_tons_for_storage() asm "50000000 PUSHINT"; ;; 0.05 TON

(int init?, int index, slice collection_address, slice owner_address, cell content) = load_data();
if (~ init?) {
throw_unless(405, equal_slices(collection_address, sender_address));
throw_unless(405, equal_slice_bits(collection_address, sender_address));
store_data(index, collection_address, in_msg_body~load_msg_addr(), in_msg_body~load_ref());
return ();
}
Expand Down
2 changes: 1 addition & 1 deletion nft/nft-marketplace.fc
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
slice sender_address = cs~load_msg_addr();

var (owner_address) = load_data();
throw_unless(401, equal_slices(sender_address, owner_address));
throw_unless(401, equal_slice_bits(sender_address, owner_address));
int op = in_msg_body~load_uint(32);

if (op == 1) { ;; deploy new auction
Expand Down
6 changes: 3 additions & 3 deletions nft/nft-sale.fc
Original file line number Diff line number Diff line change
Expand Up @@ -97,11 +97,11 @@ int min_gas_amount() asm "1000000000 PUSHINT"; ;; 1 TON

if (~ is_initialized) {

if (equal_slices(sender_address, marketplace_address)) {
if (equal_slice_bits(sender_address, marketplace_address)) {
return (); ;; just accept coins on deploy
}

throw_unless(500, equal_slices(sender_address, nft_address));
throw_unless(500, equal_slice_bits(sender_address, nft_address));
int op = in_msg_body~load_uint(32);
throw_unless(501, op == op::ownership_assigned());
int query_id = in_msg_body~load_uint(64);
Expand Down Expand Up @@ -135,7 +135,7 @@ int min_gas_amount() asm "1000000000 PUSHINT"; ;; 1 TON

if (op == 3) { ;; cancel sale
throw_unless(457, msg_value >= min_gas_amount());
throw_unless(458, equal_slices(sender_address, nft_owner_address) | equal_slices(sender_address, marketplace_address));
throw_unless(458, equal_slice_bits(sender_address, nft_owner_address) | equal_slice_bits(sender_address, marketplace_address));

var msg = begin_cell()
.store_uint(0x10, 6) ;; nobounce
Expand Down
Loading