Skip to content

Navigation Menu

Sign in
Sign up

Tutorial step 3- Uplift to latest ink! and Openbrush - #15

Open
bobo-k2 wants to merge 3 commits into
tutorial/trait-step3 from
tutorial/trait-step3-uplift
Open

Tutorial step 3- Uplift to latest ink! and Openbrush #15
bobo-k2 wants to merge 3 commits into
tutorial/trait-step3 from
tutorial/trait-step3-uplift

Conversation

@bobo-k2

@bobo-k2 bobo-k2 commented Jul 28, 2023

Copy link
Copy Markdown
Collaborator

No description provided.

bobo-k2 requested a review from Maar-io July 28, 2023 11:22
@bobo-k2 bobo-k2 changed the title (削除) Tutorial step 23- Uplift to latest ink! and Openbrush (削除ここまで) (追記) Tutorial step 3- Uplift to latest ink! and Openbrush (追記ここまで) Jul 28, 2023

@Maar-io Maar-io left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Please check comments

Comment thread logics/lib.rs
@@ -1,5 +1,4 @@
#![cfg_attr(not(feature = "std"), no_std)]

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

add no_main

Comment thread contracts/shiden34/lib.rs
instance._init_with_owner(instance.env().caller());
let collection_id = instance.collection_id();
instance._set_attribute(
let mut _instance = Self::default();

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

remove _

Comment on lines +21 to +17
#[openbrush::trait_definition]
pub trait PayableMintImpl: psp34::InternalImpl {
#[ink(message, payable)]
fn mint(&mut self, account: AccountId, id: Id) -> Result<(), PSP34Error> {
if Self::env().transferred_value() != 1_000_000_000_000_000_000 {
return Err(PSP34Error::Custom(String::from("BadMintValue")))
return Err(PSP34Error::Custom(String::from("BadMintValue")));
}
self._mint_to(account, id)

psp34::InternalImpl::_mint_to(self, account, id)
}
} No newline at end of file
}

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

This look to me like the overide of the mint() psp34:InternalImpl.
This chapter was about how to create custom trait, while the code is just overriding OB mint function.
I feel the best would be to delete this whole step in the code and in the doc merge chapters

  • Custom Trait
  • PayableMint trait

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Reviewers

@Maar-io Maar-io Maar-io requested changes

Assignees

No one assigned

Labels

None yet

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

2 participants

AltStyle によって変換されたページ (->オリジナル) /