EIP2981 - setting royalty bps error value out of bounds

Hi I am trying to implement royalties on a per token basis and everything works fine if I use any number 255 or less for the royaltypercent/bps.

// set royalty to creator
_setTokenRoyalty(tokenId, creator, _royaltyPercent);

But that's only 2.55% and I want to set it at 10% using "1000" bps (fee numerator). Im getting a value out of bounds error and I'm not sure how should I set the bps at 1000 without having to do any kind of overrides. In the docs this seems to be simple?

Error encoding arguments: Error: value out-of-bounds (argument=null, value="1000", code=INVALID_ARGUMENT, version=abi/5.5.0)

This sounds like something else is wrong on the client side, not the contract.
Error: value out-of-bounds (argument=null, value="1000", code=INVALID_ARGUMENT, version=abi/5.5.0)
I would have expected to see the argument name or a type parameter in there like uint96.
So think the abi encode is failing.
If you would have set an too high of value you should have gotten a transaction error "ERC2981: royalty fee will exceed salePrice".
It might happen if you modified the _setTokenRoyalty function parameters types, but there would be no reason to do that.

Thank you, I realized my silly error, I was using uint8 instead of uint96. :sweat_smile:

1 Like