Skip to content
🚧 Under Development! May be incomplete.Some pages/links may be incomplete or subject to change.

FeeCollector

0x9B6F83a371Db1d6eB2eA9B33E84f3b6CB4cDe1bE | ABI JSON

The Fee Collector contract is responsible for collecting fees from Berachain Dapps and auctioning them for a Payout token which then is distributed among the BGT stakers.

This contract is inspired by the Uniswap V3 Factory Owner contract.

Functions

queuePayoutAmountChange

Queues a new payout amount. Must be called by admin.

Update the payout amount to a new value. Must be called by admin.

solidity
function queuePayoutAmountChange(uint256 _newPayoutAmount) external;

Parameters

NameTypeDescription
_newPayoutAmountuint256The value that will be the new payout amount.

payoutToken

The ERC-20 token which must be used to pay for fees when claiming dapp fees.

solidity
function payoutToken() external view returns (address);

queuedPayoutAmount

The amount of payout token that is queued to be set as the payout amount.

It becomes the payout amount after the next claim.

solidity
function queuedPayoutAmount() external view returns (uint256);

payoutAmount

The amount of payout token that is required to claim dapp fees of a particular token.

This works as first come first serve basis. whoever pays this much amount of the payout amount first will get the fees.

solidity
function payoutAmount() external view returns (uint256);

rewardReceiver

The contract that receives the payout and is notified via method call, when dapp fees are claimed.

solidity
function rewardReceiver() external view returns (address);

claimFees

Claim collected dapp fees and transfer them to the recipient.

Caller needs to pay the PAYMENT_AMOUNT of PAYOUT_TOKEN tokens.

This function is NOT implementing slippage protection. Caller has to check that received amounts match the minimum expected.

solidity
function claimFees(address recipient, address[] calldata feeTokens) external;

Parameters

NameTypeDescription
recipientaddressThe address to which collected dapp fees will be transferred.
feeTokensaddress[]The addresses of the fee token to collect to the recipient.

directly sends dapp fees from msg.sender to the BGTStaker reward receiver.

The dapp fee ERC20 token MUST be the payoutToken.

The amount must be at least payoutAmount to notify the reward receiver.

solidity
function donate(uint256 amount) external;

Parameters

NameTypeDescription
amountuint256the amount of fee token to directly send to the reward receiver.

pause

Allows the owner to pause the collector.

solidity
function pause() external;

unpause

Allows the owner to unpause the collector.

solidity
function unpause() external;

Events

QueuedPayoutAmount

Emitted when the admin queues the payout amount.

solidity
event QueuedPayoutAmount(uint256 queuedPayoutAmount, uint256 currentPayoutAmount);

PayoutAmountSet

Emitted when the payout amount is updated.

Emitted when the admin updates the payout amount.

solidity
event PayoutAmountSet(uint256 indexed oldPayoutAmount, uint256 indexed newPayoutAmount);

FeesClaimed

Emitted when the dapp fees are claimed.

solidity
event FeesClaimed(address indexed caller, address indexed recipient);

Parameters

NameTypeDescription
calleraddressCaller of the claimFees function.
recipientaddressThe address to which collected dapp fees will be transferred.

PayoutDonated

Emitted when the PayoutToken is donated.

solidity
event PayoutDonated(address indexed caller, uint256 amount);

Parameters

NameTypeDescription
calleraddressCaller of the donate function.
amountuint256The amount of payout token that is transfered.

FeesClaimed

Emitted when the fees are claimed.

solidity
event FeesClaimed(address indexed caller, address indexed recipient, address indexed feeToken, uint256 amount);

Parameters

NameTypeDescription
calleraddressCaller of the claimFees function.
recipientaddressThe address to which collected dapp fees will be transferred.
feeTokenaddressThe address of the fee token to collect.
amountuint256The amount of fee token to transfer.