Skip to content

Refactor royalty #440

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

Open
wants to merge 2 commits into
base: dev
Choose a base branch
from
Open

Refactor royalty #440

wants to merge 2 commits into from

Conversation

adhocmaster
Copy link
Contributor

No description provided.

@adhocmaster adhocmaster requested a review from xklob May 12, 2022 18:24
@adhocmaster
Copy link
Contributor Author

the royal fee calculation function is pretty important here.

@adhocmaster adhocmaster requested a review from moahammadalt May 12, 2022 20:15
@@ -125,6 +126,10 @@ contract NonFungibleRegistryEnumerableUpgradeable is
/// @dev The REGISTRAR_ROLE_ADMIN curates the address with REGISTRAR_ROLE permissions
bytes32 public constant REGISTRAR_ROLE_ADMIN = keccak256("REGISTRAR_ROLE_ADMIN");


/// @notice used to calculate burn % in calculating royaltyAmount
uint constant burnDenom = 10000;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Change to uint256

@@ -273,7 +278,8 @@ contract NonFungibleRegistryEnumerableUpgradeable is

_createLabeledToken(to, label, registrationData, tokenId);

uint256 burnAmount = registrationFee * burnFee / 10000;
uint256 burnAmount = calculateRoyalty(registrationFee);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't think this is the intended functionality; this function costs "registration token" (ie Hypertoken) to use, and isn't/shouldn't be related to the royalties at all.

@@ -443,12 +449,16 @@ contract NonFungibleRegistryEnumerableUpgradeable is
}
}

function calculateRoyalty(uint256 salePrice) internal view returns(uint256 amount) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can change this to pure

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants