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

NFT Royalty SC #1570

Merged
merged 26 commits into from
Jan 17, 2024
Merged

NFT Royalty SC #1570

merged 26 commits into from
Jan 17, 2024

Conversation

HenriqueNogara
Copy link
Contributor

Adds an example for a smart contract that handles NFT Royalty.

changelog

Copy link

codecov bot commented Dec 4, 2023

Codecov Report

All modified and coverable lines are covered by tests ✅

Comparison is base (9214c27) 58.65% compared to head (36d0098) 58.67%.
Report is 4 commits behind head on develop.

❗ Current head 36d0098 differs from pull request most recent head 7d57369. Consider uploading reports for the commit 7d57369 to get more accurate results

Additional details and impacted files
@@             Coverage Diff             @@
##           develop    #1570      +/-   ##
===========================================
+ Coverage    58.65%   58.67%   +0.01%     
===========================================
  Files          142      142              
  Lines        32236    32236              
===========================================
+ Hits         18909    18915       +6     
+ Misses       13327    13321       -6     

see 3 files with indirect coverage changes

contracts/nft_royalty/lib.rs Outdated Show resolved Hide resolved
contracts/nft_royalty/lib.rs Outdated Show resolved Hide resolved
contracts/nft_royalty/lib.rs Outdated Show resolved Hide resolved
contracts/nft_royalty/lib.rs Outdated Show resolved Hide resolved
@HenriqueNogara HenriqueNogara changed the title WIP: NFT SC Draft NFT Royalty SC Draft Dec 9, 2023
@HenriqueNogara HenriqueNogara marked this pull request as ready for review December 11, 2023 16:29
@HenriqueNogara HenriqueNogara changed the title NFT Royalty SC Draft NFT Royalty SC Dec 12, 2023
adamdossa and others added 3 commits December 15, 2023 17:26
* Write extrinsic error to output buffer

* Remove support for FuncId::OldCallRuntime; Add CallRuntimeWithError

* Split contract tests; Change test to use call_runtime instead of old_call_runtime

* Add InkDelegateCallError back

* Update polymesh-api dependency

* Add use_call_runtime_with_error

* Add use_call_runtime_with_error as a feature flag
contracts/nft_royalty/README.md Outdated Show resolved Hide resolved
contracts/nft_royalty/README.md Outdated Show resolved Hide resolved
Comment on lines 209 to 210
debug_println!("Retrieving contract's identity");
self.contract_identity = PolymeshInk::get_our_did()?;
Copy link
Contributor

Choose a reason for hiding this comment

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

I don't think we need to support the contract's identity changing after initialization.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

I have removed this, but what if the contract is initialized and then the contract's identity changes (e.g the create_child_identity extrisinc is called after initialization)? I also think this is an issue for the venue owner if we only allow initialize_contract to be called once.

Copy link
Contributor

Choose a reason for hiding this comment

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

All of the portfolios would have the wrong custodian (old identity). So this contract shouldn't be moved to a different identity. I think in general deployed contracts shouldn't have their identity changed on them. Supporting that would be difficult.

Copy link
Contributor

Choose a reason for hiding this comment

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

To use child identities I would recommend this workflow:

  1. Deploy contract (not initialized).
  2. Call create_child_identity with the contract's address to move the contract into it's own identity as the primary key.
  3. Call initialize_contract.

contracts/nft_royalty/lib.rs Outdated Show resolved Hide resolved
contracts/nft_royalty/lib.rs Outdated Show resolved Hide resolved
contracts/nft_royalty/lib.rs Outdated Show resolved Hide resolved
@Neopallium Neopallium enabled auto-merge (squash) January 17, 2024 06:48
@Neopallium Neopallium merged commit ff79eb8 into develop Jan 17, 2024
13 checks passed
@Neopallium Neopallium deleted the nft-sc-draft branch January 17, 2024 07:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants