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

Updates #1

Open
wants to merge 5 commits 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
1 change: 0 additions & 1 deletion lesson5/sources/messages.tact
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

burn_notification query_id:uint64 amount:(VarUInteger 16)
sender:MsgAddress response_destination:MsgAddress
= InternalMsgBody;

Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,6 @@ message(0x595f07bc) Burn {
message(0x7bdd97de) BurnNotification {
query_id: Int as uint64;
amount: Int as coins;
sender: Address;
response_destination: Address;
}

Expand Down
3 changes: 1 addition & 2 deletions lesson5/sources/wallet.tact
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

burn_notification query_id:uint64 amount:(VarUInteger 16)
sender:MsgAddress response_destination:MsgAddress
= InternalMsgBody;

Original file line number Diff line number Diff line change
Expand Up @@ -92,8 +92,7 @@ contract TokenWallet {
body: BurnNotification {
query_id: msg.query_id,
amount: msg.amount,
sender: self.owner,
response_destination: msg.response_destination
response_destination: self.owner
}.toCell()
});
}
Expand Down
7 changes: 7 additions & 0 deletions lesson6/collection_data.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
{
"image": "https://yt3.googleusercontent.com/YR8JivTsOQ4svnDFCdnIqYAPhwIeTRg8w0Sukv1orUYJoN2iZtaEprhWXcweMdrtcGGmptvSgQ=s176-c-k-c0x00ffffff-no-rj",
"name": "NFT Lesson",
"description": "Tact Lessons Collection",
"social_links": ["https://www.youtube.com/@WikiMar", "https://t.me/tactlang", "https://github.com/nonam3e/tact-lessons"],
"marketplace": "getgems.io"
}
15 changes: 15 additions & 0 deletions lesson6/nft_data.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
{
"image": "https://cdn4.telegram-cdn.org/file/ZQ5gNY5A7o9zcnhOto310pj0wpLPYPdAtXY0TIXVJiubeg1HJWC4QzV8YdoHRXv370eFdm-wzmL7_IGk9usg9NZ9Q_sNcDbyjTBNw9TbsjIF9Jn_BLHt2tXoBOJgVfrjdjPu-Zi4pFAD9dLSxroyMHsKpzJCSZSZqhf1InowbsLQEg1MvNiMBsrAGw51VBm8xJovLxQy-u0YRPOIukkMibIhfWaG4phItMwcTbe90i0BX9rHN-Q-JMbc3mDQN7mgXhuUlfyHEGyz3psh_Fzj7pNUyfauJHnuHVvVA2hESPnPkjeXPLE-kXhynkYUvCUmIrMmkA7RqMfzRQ9Fl9eIyw.jpg",
"name": "Zero nft",
"description": "Example",
"attributes": [
{
"trait_type": "age",
"value": "5"
},
{
"trait_type": "lesson",
"value": "6"
}
]
}
3 changes: 2 additions & 1 deletion lesson8-9/sources/contract.tact
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

mulDiv(self.price, mulDiv(service_numerator, hundred_percent, service_denominator), hundred_percent) = mulDiv(self.price, service_numerator, service_denominator)

Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,8 @@ contract NftSale with Ownable {

receive(msg: TransferNotification) {
let ctx: Context = context();
let sale_fee: Int = mulDiv(self.price, mulDiv(service_numerator, hundred_percent, service_denominator), hundred_percent);
let value: Int = mulDiv(service_numerator, hundred_percent, service_denominator);
let sale_fee: Int = mulDiv(self.price, value, hundred_percent);
let royalty_fee: Int = mulDiv(self.price, mulDiv(self.numerator, hundred_percent, self.denominator), hundred_percent);
let full_price: Int = self.price + sale_fee + royalty_fee;
if(ctx.sender != self.jetton_wallet || self.nft_received == false || self.sale_ended || ctx.value < sale_processing_value || msg.amount < full_price) {
Expand Down