Ready To Use
Utils
Royalties Splitter

RMRKRoyaltiesSplitter

RMRK team

RMRKRoyaltiesSplitter

Smart contract of the RMRK Royalties Spliter module.

This smart contract provides a simple way to share royalties from either native or erc20 payments.

Methods

MAX_BPS

function MAX_BPS() external view returns (uint256)

Returns

NameTypeDescription
_0uint256undefined

distributeERC20

function distributeERC20(address currency, uint256 amount) external nonpayable

Distributes an ERC20 payment to the beneficiaries.

The payment is distributed according to the shares specified in the constructor.

Parameters

NameTypeDescription
currencyaddressThe address of the ERC20 token.
amountuint256The amount of tokens to distribute.

getBenefiariesAndShares

function getBenefiariesAndShares() external view returns (address[] beneficiaries, uint256[] shares)

Returns the list of beneficiaries and their shares.

Returns

NameTypeDescription
beneficiariesaddress[]The list of beneficiaries.
sharesuint256[]The list of shares.

Events

ERCPaymentDistributed

event ERCPaymentDistributed(address indexed sender, address indexed currency, uint256 amount)

Parameters

NameTypeDescription
sender indexedaddressundefined
currency indexedaddressundefined
amountuint256undefined

NativePaymentDistributed

event NativePaymentDistributed(address indexed sender, uint256 amount)

Parameters

NameTypeDescription
sender indexedaddressundefined
amountuint256undefined

Errors

FailedToSend

error FailedToSend()

InvalidInput

error InvalidInput()

OnlyBeneficiary

error OnlyBeneficiary()