Fee
Contents
Globals
Var | Type |
---|---|
userTotalAmount | mapping(address => uint256) |
userUsage | mapping(address => struct IFee.UsageInfo) |
userDeposit | mapping(address => mapping(address => struct IFee.DepositInfo)) |
totalAmount | uint256 |
Functions
constructor
No description
Declaration:
Modifiers:
Modifier |
---|
Only |
deposit
Deposit amount to target user.
Declaration:
Modifiers:
Modifier |
---|
nonReentrant |
Args:
Arg | Type | Description |
---|---|---|
| address | Target user address |
withdraw
Withdraw amount from target user.
Declaration:
Modifiers:
Modifier |
---|
nonReentrant |
Args:
Arg | Type | Description |
---|---|---|
| address | Target user address |
| uint256 | Desired withdraw amount |
| uint256 | Min withdraw amount |
estimateWithdrawableTimestamp
Estimate wtihdrawable timestamp, if the estimation fails, return 0.
Declaration:
Modifiers: No modifiers
Args:
Arg | Type | Description |
---|---|---|
| address | Target user address |
| address | From user address |
estimateWithdrawableAmount
Estimate wtihdrawable amount.
Declaration:
Modifiers: No modifiers
Args:
Arg | Type | Description |
---|---|---|
| address | Target user address |
| uint256 | Current timestamp |
estimateFee
Estimate user fee.
Declaration:
Modifiers: No modifiers
Args:
Arg | Type | Description |
---|---|---|
| address | User address |
| uint256 | Current timestamp |
estimateUsage
Estimate user usage
Declaration:
Modifiers: No modifiers
Args:
Arg | Type | Description |
---|---|---|
| struct IFee.UsageInfo | Usage information |
| uint256 | Current timestamp |
consume
Consume user fee, can only be called by the system caller.
Declaration:
Modifiers:
Modifier |
---|
nonReentrant |
onlyRouter |
Args:
Arg | Type | Description |
---|---|---|
| address | User address |
| uint256 | Number of usage fee |
Events
Deposit
Emit when user deposits.
Params:
Param | Type | Indexed | Description |
---|---|---|---|
| address | Deposit user | |
| address | Receiver user | |
| uint256 | Deposit amount | |
### Withdraw | |||
Emit when user withdraws. |
Params:
Param | Type | Indexed | Description |
---|---|---|---|
| address | Withdraw user | |
| address | From user | |
| uint256 | Withdraw amount |
Last updated