Skip to main content

IFeeDistributor

IFeeDistributor

Addresses

ChainAddress

Functions

receiveFee

Notify FeeDistributor that caller has sent it some fees. Check FeeReferral to see who referred the caller, and send that referrer their share of fees. Then, proportionally increase pending fees of each active FeeAllocation.

function receiveFee(address caller) external
Dev note

Normally, a function like this would pull tokens straight from msg.sender. This push-and-notify model allows the exchange to collect fees without having to call approve() each time, and (in the case of deposits and increases) to transfer tokens straight from the user to FeeDistributor without an intermediary transfer to the exchange. EOAs and integrators calling receiveFee() should do so within the context of a single smart contract transaction - otherwise, anybody can call receiveFee() with a high gas payment to "take credit" for a previous transfer.

Parameters

NameTypeDescription
calleraddressAddress responsible for recent increase in collateral balance. For instance, a trader who has just paid a fee.