Skip to content

Commit

Permalink
Merge pull request #21 from emarai/fix-mandatory-parameters
Browse files Browse the repository at this point in the history
Fix 'Some mandatory parameters on nft_transfer and nft_transfer_payout are not part of NFT standard'
  • Loading branch information
BenKurrek authored Mar 29, 2022
2 parents 8f0da53 + 9588d70 commit e2b0af7
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 9 deletions.
12 changes: 6 additions & 6 deletions nft-contract/src/nft_core.rs
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ pub trait NonFungibleTokenCore {
receiver_id: AccountId,
token_id: TokenId,
//we introduce an approval ID so that people with that approval ID can transfer the token
approval_id: u64,
approval_id: Option<u64>,
memo: Option<String>,
);

Expand All @@ -24,7 +24,7 @@ pub trait NonFungibleTokenCore {
receiver_id: AccountId,
token_id: TokenId,
//we introduce an approval ID so that people with that approval ID can transfer the token
approval_id: u64,
approval_id: Option<u64>,
memo: Option<String>,
msg: String,
) -> PromiseOrValue<bool>;
Expand Down Expand Up @@ -97,7 +97,7 @@ impl NonFungibleTokenCore for Contract {
receiver_id: AccountId,
token_id: TokenId,
//we introduce an approval ID so that people with that approval ID can transfer the token
approval_id: u64,
approval_id: Option<u64>,
memo: Option<String>,
) {
//assert that the user attached exactly 1 yoctoNEAR. This is for security and so that the user will be redirected to the NEAR wallet.
Expand All @@ -110,7 +110,7 @@ impl NonFungibleTokenCore for Contract {
&sender_id,
&receiver_id,
&token_id,
Some(approval_id),
approval_id,
memo,
);

Expand All @@ -128,7 +128,7 @@ impl NonFungibleTokenCore for Contract {
receiver_id: AccountId,
token_id: TokenId,
//we introduce an approval ID so that people with that approval ID can transfer the token
approval_id: u64,
approval_id: Option<u64>,
memo: Option<String>,
msg: String,
) -> PromiseOrValue<bool> {
Expand Down Expand Up @@ -158,7 +158,7 @@ impl NonFungibleTokenCore for Contract {
&sender_id,
&receiver_id,
&token_id,
Some(approval_id),
approval_id,
memo.clone(),
);

Expand Down
6 changes: 3 additions & 3 deletions nft-contract/src/royalty.rs
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ pub trait NonFungibleTokenCore {
receiver_id: AccountId,
token_id: TokenId,
approval_id: u64,
memo: String,
memo: Option<String>,
balance: U128,
max_len_payout: u32,
) -> Payout;
Expand Down Expand Up @@ -66,7 +66,7 @@ impl NonFungibleTokenCore for Contract {
receiver_id: AccountId,
token_id: TokenId,
approval_id: u64,
memo: String,
memo: Option<String>,
balance: U128,
max_len_payout: u32,
) -> Payout {
Expand All @@ -80,7 +80,7 @@ impl NonFungibleTokenCore for Contract {
&receiver_id,
&token_id,
Some(approval_id),
Some(memo),
memo,
);

//refund the previous token owner for the storage used up by the previous approved account IDs
Expand Down

0 comments on commit e2b0af7

Please sign in to comment.