-
Notifications
You must be signed in to change notification settings - Fork 51
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
Qbay smart contract #321
base: develop
Are you sure you want to change the base?
Qbay smart contract #321
Conversation
…n-in-gtest Feature/2025 02 03 more qpi function in gtest
…n-in-gtest Feature/2025 02 03 more qpi function in gtest
…eadlocks Feature/2025 02 05 solve contract deadlocks
…eadlocks Fix startup issue with uninitialized tick storage
…etUserCreatedNFT`
@@ -390,6 +390,14 @@ struct QUOTTERY : public ContractBase | |||
res -= (qtryGetHour(A) * 3600 + qtryGetMinute(A) * 60 + qtryGetSecond(A)); | |||
} | |||
|
|||
inline static bool isLeapYear(uint32 year) |
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.
year number on qubic is only 2 digits, we don't need to take care of this case
This won't take sooner than 2 epochs to have a proper review in security. |
I also suggest to support any token instead of $CFB only because soon we will have other tokens such as wrapped bitcoin, ether or stablecoin |
Qbay MarketPlace Smart Contract
Technical implementation for the collection and NFT in PFP Smart Contract
All the collections and NFTs will be saved inside 1GB Storage that can be saved the state data and also it can be integrated in PFP MarketPlace
The info for NFT is as follows.
struct InfoOfNFT
{
};
constexpr uint32 PFP_MAX_NUMBER_NFT = 2097152;
Array<InfoOfNFT, PFP_MAX_NUMBER_NFT> NFTs;
As you can see above, the max number of NFTs is 2097152. it means that this smart contrat holds the NFTs up to 2097152.
The capacity of one NFT is 238byte and total capacity for 2097152 NFTs is less than 1GB.
All the infos(creator, possesor, URI, status, price, ... ,) for NFT will be saved in this NFT struct.
The implementation for collection is same with implementation of NFT. there is a struct for info of collection.
All features in PFP MarketPlace
settingCFBAndQubicPrice
procedureThe only Marketplace owner can set the price for Qubic and CFB. it will be expressed as the amount of Qubic and CFB for 1 USD;
If other's try to use this procedure, it will be rejected by procedure.
If the Qubic smart contract supports the connection with Oracles in the future, this procedure would be removed and the Oracles would be connected for price of Qubic and CFB.
createCollection
procedureThe user can create their collection. The CFB payment is only available to create the collection.
When the user creates the collection, he can set the type of collection weither the collection is for own or Dropping NFTs.
mint
procedureThe user can mint the NFT in two option(minting a single NFT or a NFT using the collection). If user want to mint the NFT using his collection, he can mint the NFT without any fee, at this time, the creator and possessor of NFT should be creator of collection.
If user want to mint the single NFT without his collection, he need to pay the 5M $Qubic in Marketplace.
mintOfDrop
procedureThe user can mint the NFTs using the Drop collection.
The user need to pay the fee(it will be set when the collection is created by the collection creator) to creator of collection. the creator of NFT would be creator of collection and the possessor would be the user who mint this NFT.
transfer
procedureThe user can transfer their NFT to another user without fee.
listInMarket
procedureThe user can list the NFT in the Market without fee when he want to sell the NFT. it means the status of sale is 1.
The user will set the price for sale in the amount of Qubic.
buy
procedureThe user can buy the NFT if the status of sale for NFT is 1. the user can use the both of Qubic and CFB to pay the price of NFT.
If the user selects the CFB to pay the price, the price will be converted and calculated as CFB.
At this time, the fee will be distributed according to the set percent.
cancelSale
procedureThe user can cancel the sale without fee.
listInExchange
procedureThe user can list the NFT in the Exchange when he want to exchange his NFT with another NFT. it means that the status of another NFT(want to exchange) is 1;
If the another user already asked to exchange with his NFT, the possessor of NFT will be converted each other.
At this time, there is no fee.
cancelExchange
procedureThe user can cancel the status of exchange without fee. it means that the status of another NFT(wanted to exchange) is 0.
makeOffer
procedureThe user can make the offer with the price(he want to buy) if he want to buy the NFT. the user can use the both of Qubic and CFB to pay the price of NFT. also the price should be sent to marketplace at first.
If the user does not pay the price, the offer can not be made.
If another user make the offer with high price, the askUser and price will be changed with new user.
the user need to make in high price additional QBAY_MIN_DELTA_SIZE over than previous user.
The payment for previous user will be transferred to previous user.
acceptOffer
procedureIf the user want to sell to the user who made the offer, the user can accept the offer.
cancelOffer
procedureIf user want to cancel the Offer, he can use this proceudure. at this time, the paid amount of user who made the offer will be transferred to user who made the offer.
createTraditionalAuction
procedureThe user can create the auction. user need to set the method of payment for price($Qubic or $CFB). Other users must bid in set mothed of payment.
The start and end time will be decided by creator of auction.
bidOnTraditionalAuction
procedureThe users can bid in auction. the user need to bid in high price additional QBAY_MIN_DELTA_SIZE over than previous user.
The possessor of NFT will be changed whenever the user succeed in bid and the previous user receives the paid amount. and also the fee will be distributed reasonablly.
changeStatusOfMarketPlace
procedureMarketplace owner need to change the status of market. The users can create the collection and mint the NFT after marketplace owner changes the status as 1.
Marketplace owner want to create hie collection and NFT before other user creates the collection and NFT usint this smart contract.
So other users can create the collection and mint the NFT after marketplace owner changes the status of marketplace.
END_EPOCH
procedureAll earnings will transfer at the end of epoch by this procedure.
listInMarket
procedure, he can not use the other procedures liketransfer
,listInExchange
,makeOffer
,createTraditionalAuction
regarding the transferring the NFT.If he want to do other action regarding trasferring the NFT, he need to cancel the made action.
Fee
Query functions
All procedures and functions was tested by qubic-cli and google test. also the frontend was integrated in SC.
Update of Quottery smart contract
checkValidQtryDateTime
function of Quottery smart contract.There was some mistake to check leap year.