Skip to content

Commit

Permalink
cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
JackBekket committed Dec 6, 2021
1 parent 6d7b7d6 commit 51c1511
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 39 deletions.
3 changes: 2 additions & 1 deletion contracts/721/singleton/MSNFT.sol
Original file line number Diff line number Diff line change
Expand Up @@ -343,11 +343,12 @@ contract MSNFT is ERC721Enumerable, Ownable {
}


/*
// transfer authorship of mastercopy
function transferAuthorship() public {
}

*/

// update authorship for unique rarity token (setting owner of token to author)
function updateAuthorsip(uint tokenId) public {
Expand Down
40 changes: 2 additions & 38 deletions contracts/721/singleton/MetaMarketplace.sol
Original file line number Diff line number Diff line change
Expand Up @@ -184,30 +184,6 @@ contract MetaMarketplace {
}


/* UNDER CONSIDERATION
/// @notice Transfers royalties to the rightsowner if applicable
/// @param tokenId - the NFT assed queried for royalties
/// @param grossSaleValue - the price at which the asset will be sold
/// @return netSaleAmount - the value that will go to the seller after
/// deducting royalties
function _deduceRoyalties(uint256 tokenId, uint256 grossSaleValue)
internal returns (uint256 netSaleAmount) {
// Get amount of royalties to pays and recipient
(address royaltiesReceiver, uint256 royaltiesAmount) = token
.royaltyInfo(tokenId, grossSaleValue);
// Deduce royalties from sale value
uint256 netSaleValue = grossSaleValue - royaltiesAmount;
// Transfer royalties to rightholder if not zero
if (royaltiesAmount > 0) {
royaltiesReceiver.call{value: royaltiesAmount}('');
}
// Broadcast royalties payment
emit RoyaltiesPaid(tokenId, royaltiesAmount);
return netSaleValue;
}
*/


// deduct royalties, if NFT is created in MoonShard, then applicate +1.5% royalties fee to author of nft
function _deductRoyalties(address nft_token_contract_, uint256 token_id_, uint256 grossSaleValue) internal view returns (address royalties_reciver,uint256 royalties_amount) {

Expand Down Expand Up @@ -257,13 +233,7 @@ contract MetaMarketplace {
require(metainfo.activeSellOffers[tokenId].minPrice[currency_] > 0, "price for this currency has not been setted, use makeBuyOffer() instead");
require(bid_price_ >= metainfo.activeSellOffers[tokenId].minPrice[currency_],
"Bid amount lesser than desired price!");

// Pay royalties if applicable
/*
if (_checkRoyalties(_tokenContractAddress)) {
saleValue = _deduceRoyalties(tokenId, saleValue);
}
*/


// Transfer funds (ERC20-currency) to the seller and distribute fees
if(_processPurchase(token_contract_,tokenId,currency_,msg.sender,seller,bid_price_) == false) {
Expand Down Expand Up @@ -391,12 +361,6 @@ contract MetaMarketplace {
require(currentBuyer != address(0),
"No buy offer");
uint256 bid_value = metainfo.activeBuyOffers[tokenId][currency_].price;
// Pay royalties if applicable
/*
if (_checkRoyalties(_tokenContractAddress)) {
netSaleValue = _deduceRoyalties(tokenId, saleValue);
}
*/

// Delete the current sell offer whether it exists or not
delete (metainfo.activeSellOffers[tokenId]);
Expand All @@ -408,7 +372,7 @@ contract MetaMarketplace {

// Transfer funds to the seller
// Tries to forward funds from this contract (which already has been locked when makeBuyOffer executed) to seller and distribute fees
require(_forwardFunds(currency_, msg.sender, bid_value), "MetaMarketplace: can't forward funds to seller");
require(_forwardFunds(token_contract_,tokenId,currency_, msg.sender, bid_value), "MetaMarketplace: can't forward funds to seller");


// And transfer nft token to the buyer
Expand Down

0 comments on commit 51c1511

Please sign in to comment.