dexwebapp icon indicating copy to clipboard operation
dexwebapp copied to clipboard

Can't disable royalties when minting

Open cheesestringer opened this issue 2 years ago • 0 comments

Trying to mint an NFT with a royalty_percentage of 0 blocks the user with an error message of:

image

Checking the tutorial it seems 0 is an allowed value to disable royalties.

An integer from 0 - 10 describing the amount of royalty to be collected by the creator each time the NFT is sold. For example, if a creator mints an NFT with a royalty percentage of 10, the creator will receive 10% of the proceeds of every sale. Royalties are distributed to creators at the end of each month. If an NFT is minted with a royalty percentage of 0, no royalties will be collected.

Due to the royaltyPercentage falsy check in the updateBtnStatus function in useNFTMint.ts this is currently failing:

!error &&
   nftMintValue.royaltyPercentage && // 0 is falsy so fails early
   Number.isInteger(nftMintValue.royaltyPercentage / 1) &&
   nftMintValue.royaltyPercentage >= 0 &&
   nftMintValue.royaltyPercentage <= 10

cheesestringer avatar Apr 22 '22 17:04 cheesestringer