Fee

Contents

Globals

Functions

constructor

No description

Declaration:

  function constructor(
  ) public Only

Modifiers:

deposit

Deposit amount to target user.

Declaration:

  function deposit(
    address user
  ) external nonReentrant

Modifiers:

Args:

withdraw

Withdraw amount from target user.

Declaration:

  function withdraw(
    address user,
    uint256 desiredAmount,
    uint256 minAmount
  ) external nonReentrant

Modifiers:

Args:

estimateWithdrawableTimestamp

Estimate wtihdrawable timestamp, if the estimation fails, return 0.

Declaration:

  function estimateWithdrawableTimestamp(
    address user,
    address from
  ) external returns (uint256 timestamp)

Modifiers: No modifiers

Args:

estimateWithdrawableAmount

Estimate wtihdrawable amount.

Declaration:

  function estimateWithdrawableAmount(
    address user,
    uint256 timestamp
  ) public returns (uint256)

Modifiers: No modifiers

Args:

estimateFee

Estimate user fee.

 userFee = userTotalAmount * dailyFee / totalAmount - userUsage

Declaration:

  function estimateFee(
    address user,
    uint256 timestamp
  ) public returns (uint256 fee)

Modifiers: No modifiers

Args:

estimateUsage

Estimate user usage

 T: current timestamp
 T': last timestamp
 userUsage': last fee usage

 if T - T' < feeRecoverInterval
     userUsage = (1 - (T - T') / feeRecoverInterval) * userUsage'
 else
     userUsage = 0

Declaration:

  function estimateUsage(
    struct IFee.UsageInfo ui,
    uint256 timestamp
  ) public returns (uint256 usage)

Modifiers: No modifiers

Args:

consume

Consume user fee, can only be called by the system caller.

Declaration:

  function consume(
    address user,
    uint256 usage
  ) external nonReentrant onlyRouter

Modifiers:

Args:

Events

Deposit

Emit when user deposits.

Params:

Params:

Last updated