IFeeDistributor
IFeeDistributor
Addresses
Chain | Address |
---|
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
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
Name | Type | Description |
---|---|---|
caller | address | Address responsible for recent increase in collateral balance. For instance, a trader who has just paid a fee. |