In the three finance contracts (EnglishAuction.sol, DutchAuction.sol, FixedPriceAuction.sol), sale revenue is potentially split two-ways; between the current asset owner and the marketplace (us). However, marketplaces have the option to enforce royalties on secondary transactions to the original creators of the NFT Project. EIP-2981 is a proposal to standardize the querying of royalty-related information directly from the nft contract. While the adoption of this proposal is not quite high, it is better to follow a community standard that has the potential for adoption than to create our own.
Important Notes from the EIP
Marketplaces that support this standard SHOULD implement some method of transferring royalties to the royalty recipient.
Marketplaces MUST pay the royalty in the same unit of exchange as that of the _salePrice passed to royaltyInfo(). This is equivalent to saying that the _salePrice parameter and the royaltyAmount return value MUST be denominated in the same monetary unit. For example, if the sale price is in ETH, then the royalty payment must also be paid in ETH, and if the sale price is in USDC, then the royalty payment must also be paid in USDC.
Implementers of this standard MUST calculate a percentage of the _salePrice when calculating the royalty amount.
Subsequent invocations of royaltyInfo() MAY return a different royaltyAmount.
Given that we are platform for both launching and buying/selling NFTs. Both the marketplace and implementer side are relevant to us.
Implementation(s)
Asset Contracts
Refactor ERC721Owl and ERC1155Owl to inherit from ERC2981Upgradeable.sol from @opezeppelin/contracts-upgradeable.
Create a new role called ROYALTY_ROLE. Grant it to _admin in the initializer.
Use _setDefaultRoyalty(address receiver, uint96 feeNumerator) to set the royalty in the intiailizer. receiver and feeNumerator should be added as parameters to the intiailizers.
Expose _setTokenRoyalty(uint256 tokenId, address receiver, uint96 feeNumerator) to external and protect it with onlyRole(ROYALTY_ROLE)
Marketplace Contracts
Query to see whether nft contract supports ERC2981 interface (look at EIP for example).
If it does, take that percentage out of the asset owner's cut.
Description
In the three finance contracts (
EnglishAuction.sol
,DutchAuction.sol
,FixedPriceAuction.sol
), sale revenue is potentially split two-ways; between the current asset owner and the marketplace (us). However, marketplaces have the option to enforce royalties on secondary transactions to the original creators of the NFT Project. EIP-2981 is a proposal to standardize the querying of royalty-related information directly from the nft contract. While the adoption of this proposal is not quite high, it is better to follow a community standard that has the potential for adoption than to create our own.Important Notes from the EIP
_salePrice
passed toroyaltyInfo()
. This is equivalent to saying that the_salePrice
parameter and theroyaltyAmount
return value MUST be denominated in the same monetary unit. For example, if the sale price is in ETH, then the royalty payment must also be paid in ETH, and if the sale price is in USDC, then the royalty payment must also be paid in USDC._salePrice
when calculating the royalty amount.royaltyInfo()
MAY return a differentroyaltyAmount
.Given that we are platform for both launching and buying/selling NFTs. Both the marketplace and implementer side are relevant to us.
Implementation(s)
Asset Contracts
ERC721Owl
andERC1155Owl
to inherit fromERC2981Upgradeable.sol
from@opezeppelin/contracts-upgradeable
.ROYALTY_ROLE
. Grant it to_admin
in the initializer._setDefaultRoyalty(address receiver, uint96 feeNumerator)
to set the royalty in the intiailizer.receiver
andfeeNumerator
should be added as parameters to the intiailizers._setTokenRoyalty(uint256 tokenId, address receiver, uint96 feeNumerator)
to external and protect it withonlyRole(ROYALTY_ROLE)
Marketplace Contracts
ERC2981
interface (look at EIP for example).Links
https://docs.openzeppelin.com/contracts/4.x/api/token/common#ERC2981-royaltyInfo-uint256-uint256- https://eips.ethereum.org/EIPS/eip-2981
closes #336