ITipsWithFee

Git Source

This is the interface for the TipsWithFee contract.

Functions

initialize

Initializes the TipsWithFee.

function initialize(address web3Entry_, address token_) external;

Parameters

NameTypeDescription
web3Entry_addressAddress of web3Entry.
token_addressAddress of token.

setDefaultFeeFraction

Changes the default fee percentage of specific receiver.

The feeReceiver can be a platform account.

function setDefaultFeeFraction(address feeReceiver, uint256 fraction) external;

Parameters

NameTypeDescription
feeReceiveraddressThe fee receiver address.
fractionuint256The percentage measured in basis points. Each basis point represents 0.01%.

setFeeFraction4Character

Changes the fee percentage of specific <receiver, character>.

If feeFraction4Character is set, it will override the default fee fraction.

function setFeeFraction4Character(address feeReceiver, uint256 characterId, uint256 fraction) external;

Parameters

NameTypeDescription
feeReceiveraddressThe fee receiver address.
characterIduint256The character ID.
fractionuint256The percentage measured in basis points. Each basis point represents 0.01%.

setFeeFraction4Note

Changes the fee percentage of specific <receiver, note>.

If feeFraction4Note is set, it will override feeFraction4Character and the default fee fraction.

function setFeeFraction4Note(address feeReceiver, uint256 characterId, uint256 noteId, uint256 fraction) external;

Parameters

NameTypeDescription
feeReceiveraddressThe fee receiver address.
characterIduint256The character ID .
noteIduint256The note ID .
fractionuint256The percentage measured in basis points. Each basis point represents 0.01%.

getFeeFraction

Returns the fee percentage of specific <receiver, note>.

It will return the first non-zero value by priority feeFraction4Note, feeFraction4Character and defaultFeeFraction.

function getFeeFraction(address feeReceiver, uint256 characterId, uint256 noteId) external view returns (uint256);

Parameters

NameTypeDescription
feeReceiveraddressThe fee receiver address.
characterIduint256The character ID .
noteIduint256The note ID .

Returns

NameTypeDescription
<none>uint256fraction The percentage measured in basis points. Each basis point represents 0.01%.

getFeeAmount

Returns how much the fee is owed by <feeFraction, tipAmount>.

function getFeeAmount(address feeReceiver, uint256 characterId, uint256 noteId, uint256 tipAmount)
    external
    view
    returns (uint256);

Parameters

NameTypeDescription
feeReceiveraddressThe fee receiver address.
characterIduint256The character ID .
noteIduint256The note ID .
tipAmountuint256

Returns

NameTypeDescription
<none>uint256The fee amount.

getWeb3Entry

Returns the address of web3Entry contract.

function getWeb3Entry() external view returns (address);

Returns

NameTypeDescription
<none>addressThe address of web3Entry contract.

getToken

Returns the address of mira token contract.

function getToken() external view returns (address);

Returns

NameTypeDescription
<none>addressThe address of mira token contract.