IROJIVerseRoyaltiesFacet

IROJIVerseRoyaltiesFacet

This is a facet that is added to the ROJIVerseDiamond contract. The events are emitted by the diamond.

RoyaltyReceiverCannotBeNull

error RoyaltyReceiverCannotBeNull()

Raised when address(0) is passed as a roalty receiver.

BPSMustNotExceed10000

error BPSMustNotExceed10000()

Raised when the BPS exceeds 10000. In general BPS should be between 0 and 1000, e.g. up to 10%.

RoyaltiesForTierChanged

event RoyaltiesForTierChanged(bool oldIsActive, bool isActive, uint16 oldBps, uint16 bps)

Emitted when the royalty for a tier is changed.

Parameters

Name
Type
Description

oldIsActive

bool

Boolean indicating if the tier was active before this update.

isActive

bool

Boolean indicating if the tier is active after this update.

oldBps

uint16

BPS before the update.

bps

uint16

BP after the update.

RoyaltiesReceiverChanged

event RoyaltiesReceiverChanged(address oldRoyaltyReceiver, address royaltyReceiver)

emitted when the royalties receiver is changed.

Parameters

Name
Type
Description

oldRoyaltyReceiver

address

The previous royalty receiver.

royaltyReceiver

address

The new royalty receiver.

RoyaltiesBPSChanged

event RoyaltiesBPSChanged(uint16 oldBps, uint16 bps)

Emitted when the default bps is changed.

Parameters

Name
Type
Description

oldBps

uint16

BPS before the update.

bps

uint16

BP after the update.

setRoyaltiesForTier

function setRoyaltiesForTier(bytes32 tier, bool isActive, uint16 bps) external

Sets the royalty information for a given tier.

Parameters

Name
Type
Description

tier

bytes32

The tier to set the royalty information for.

isActive

bool

Boolean that indicates the tier is active. If set to false then the default bps (royaltyBPS) will be returned.

bps

uint16

Tbe basis points for the royalty. Allowed range is 0 to 10000, with an upper limit of 1000 recommended.

setRoyaltiesReceiver

function setRoyaltiesReceiver(address royaltyReceiver) external

set the default royalities receiver.

Parameters

Name
Type
Description

royaltyReceiver

address

A valid address that will receive the royalties. Must not be address(0)

setRoyaltiesBPS

function setRoyaltiesBPS(uint16 royaltyBPS) external

set the default royalities BPS. This is the fallback value if the tier is not found or is inactive.

Parameters

Name
Type
Description

royaltyBPS

uint16

Tbe basis points for the royalty. Allowed range is 0 to 10000, with an upper limit of 1000 recommended.

royaltiesForTier

function royaltiesForTier(bytes32 tier) external view returns (bool isActive, uint16 bps)

Returns the royalty information for a given tier, or the default value if not active.

Parameters

Name
Type
Description

tier

bytes32

The tier to retrieve the royalty information for. This is a keccak of the tier string.

royaltiesReceiver

function royaltiesReceiver() external view returns (address royaltyReceiver)

Returns the receiver for the royalties. This is guaranteed to be a valid address and not address(0).

Return Values

Name
Type
Description

royaltyReceiver

address

The address of the royalties receiver.

royaltiesBPS

function royaltiesBPS() external view returns (uint16 royaltyBPS)

Returns the default BPS for the royalties.

Return Values

Name
Type
Description

royaltyBPS

uint16

The default BPS for the royalties. Always between 0 and 10,000. 1% equals 100 bps.

Was this helpful?