-
Notifications
You must be signed in to change notification settings - Fork 8
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
Royalties #579
Merged
Merged
Royalties #579
Changes from all commits
Commits
Show all changes
39 commits
Select commit
Hold shift + click to select a range
74d7330
Manage seller royalties
zajck c6e4e70
expand offer struct with royalty info
zajck 44f1f52
account related tests
zajck f597ca4
refactor + natspec
zajck 85f3fc7
domain tests royaltyrecipients, royaltyInfo, offer
zajck 3117f96
migrate from waffle
zajck dee9a81
adjust old test to work with default royalties
zajck 5a1a797
skip precommit action for empty lists
zajck 388da5e
Offers with royalty recipients
zajck 1b253cb
RR + EIP2981
zajck 5c52815
Merge branch 'main' into royalties-2
zajck e02b6dd
adjustment to automatic module compilation
zajck 2a8eee8
remove royalty management from voucher
zajck c1cf149
support royalties for preminted vouchers
zajck a0a0a50
return 0s instead of revert
zajck ac7cc92
Merge branch 'main' into royalties-2
zajck 174753b
tidy
zajck b1957f2
fix failing tests
zajck 16952d8
Merge branch 'main' into royalties-2
zajck 8bfefe7
fix percentage typo
zajck ebebf34
Merge branch 'main' into royalties-2
zajck d68e55a
tidy
zajck 04e77c3
Fix failing tests /1
zajck 26a7a39
enable mutable royalties
zajck 49a2eea
domain updated
zajck b3052d4
adapt old tests
zajck 82fb7e5
Fix failing tests /2
zajck 3ecfb6d
Fix escrow in sequential commit
zajck 116ea0d
rename royalty getters
zajck 99b1d16
getEIP2981Royalties() tests
zajck fa5432c
getRoyalties() tests
zajck 2dfb80d
additional tests with multiple recipients
zajck c826ac4
updateOfferRoyaltyRecipients tests
zajck df1e1d7
tests with external recipients
zajck a221393
Increase line coverage
zajck 420811e
Apply suggestions from code review
zajck 8582b06
Fix the rest of the typos
zajck 81fc8ea
Fix failing test
zajck 5c4cb54
Update contracts/protocol/libs/FundsLib.sol
zajck File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,6 @@ | ||
[submodule "submodules/royalty-registry-solidity"] | ||
path = submodules/royalty-registry-solidity | ||
url = [email protected]:manifoldxyz/royalty-registry-solidity.git | ||
[submodule "submodules/seaport"] | ||
path = submodules/seaport | ||
url = [email protected]:ProjectOpenSea/seaport.git | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -10,12 +10,11 @@ import { IERC721ReceiverUpgradeable } from "@openzeppelin/contracts-upgradeable/ | |
* | ||
* @notice This is the interface for the Boson Protocol ERC-721 Voucher contract. | ||
* | ||
* The ERC-165 identifier for this interface is: 0x5235dd2b | ||
* The ERC-165 identifier for this interface is: 0x6a474d2c | ||
*/ | ||
interface IBosonVoucher is IERC721Upgradeable, IERC721MetadataUpgradeable, IERC721ReceiverUpgradeable { | ||
event ContractURIChanged(string contractURI); | ||
event RoyaltyPercentageChanged(uint256 royaltyPercentage); | ||
event VoucherInitialized(uint256 indexed sellerId, uint256 indexed royaltyPercentage, string indexed contractURI); | ||
event VoucherInitialized(uint256 indexed sellerId, string indexed contractURI); | ||
event RangeReserved(uint256 indexed offerId, Range range); | ||
event VouchersPreMinted(uint256 indexed offerId, uint256 startId, uint256 endId); | ||
|
||
|
@@ -93,27 +92,6 @@ interface IBosonVoucher is IERC721Upgradeable, IERC721MetadataUpgradeable, IERC7 | |
uint256 _salePrice | ||
) external view returns (address receiver, uint256 royaltyAmount); | ||
|
||
/** | ||
* @notice Sets the royalty percentage. | ||
* Can only be called by the owner or during the initialization | ||
* | ||
* Emits RoyaltyPercentageChanged if successful. | ||
* | ||
* Reverts if: | ||
* - Caller is not the owner. | ||
* - `_newRoyaltyPercentage` is greater than max royalty percentage defined in the protocol | ||
* | ||
* @param _newRoyaltyPercentage fee in percentage. e.g. 500 = 5% | ||
*/ | ||
function setRoyaltyPercentage(uint256 _newRoyaltyPercentage) external; | ||
|
||
/** | ||
* @notice Gets the royalty percentage. | ||
* | ||
* @return royalty percentage | ||
*/ | ||
function getRoyaltyPercentage() external view returns (uint256); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Note: core-components/subgraph currently uses this method to get the royaltyPercentage of a voucher contract |
||
|
||
/** | ||
* @notice Reserves a range of vouchers to be associated with an offer | ||
* | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
why an externalId on chain?
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.
No functional reason on the protocol level. It's just it
getRoyaltyRecipients
returns a nicer output.It's not that costly (assuming the seller does not update it often), and it's not a required field, so they can even submit an empty string.
We also have similar external identifiers elsewhere (collections, DRfees).