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
Marketplace contract implementation #4
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You should run cargo clippy
and checks the hints to make your code mode clean/idiomatic
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
Is contract_hash in factory same as contract_address in register's Marketplace contract implementation? I mean are they both |
while fee calculating why divide by |
Those two are not the same, the first one is contact hash, the second one is the deployed contract instance address. |
fee is percentage represented by integer value 100 is 1%, while 10_000 is 100%. If we want to calculate 10% fee we need to do the following 1_000 / 10_000 |
Add comment for each function in traits and impl |
Why to have the same comments on both places? This will be hard to maintain. |
logics/traits/marketplace.rs
Outdated
@@ -45,7 +45,7 @@ pub trait MarketplaceSale { | |||
price: Balance, | |||
) -> Result<(), MarketplaceError>; | |||
|
|||
/// Removes NFT from the marketplace sale. | |||
/// Removes aa NFT from the marketplace sale. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
aa
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
This is PR for initial implementation of the NFT marketplace contract with the following features:
factory
- creates a new instance of Shiden34 contract and registers the instance to the Marketplace. Caller needs to provide link to IPFS metadata file for NFT and some NFT details. Prerequisite for the factory is that Shiden34 contract is deployed to a network and the contract hash is provided to the Marketplace viaset_nft_contract_hash
call.register
- registers an existing contract to the Marketplace. This operation can be performed by contract or marketplace owner.list
- Lists a NFT for sale on the marketplace. This operation can be performed by a token owner.unlist
- Un-lists a NFT from the marketplace. This operation can be performed by a token owner.buy
- Transfers a token ownership to the caller. Also pays royalties and marketplace fees predefined receivers.