FreeFee
Var | Type |
---|---|
userUsage | mapping(address => struct IFreeFee.UsageInfo) |
totalUsage | uint256 |
globalTimestamp | uint256 |
No description
Declaration:
function constructor(
) public Only
Modifiers:
Modifier |
---|
Only |
Estimate total daily free fee left.
Declaration:
function estimateTotalLeft(
uint256 timestamp
) public returns (uint256 totalLeft)
Modifiers: No modifiers
Args:
Arg | Type | Description |
---|---|---|
timestamp | uint256 | Current timestamp |
Estimate user daily free fee usage.
Declaration:
function estimateUsage(
struct IFreeFee.UsageInfo ui,
uint256 timestamp
) public returns (uint256)
Modifiers: No modifiers
Args:
Arg | Type | Description |
---|---|---|
ui | struct IFreeFee.UsageInfo | User usage information |
timestamp | uint256 | Current timestamp |
Estimate user daily free fee left.
Declaration:
function estimateFreeFee(
address user,
uint256 timestamp
) external returns (uint256)
Modifiers: No modifiers
Args:
Arg | Type | Description |
---|---|---|
user | address | User address |
timestamp | uint256 | Current timestamp |
Consume user usage, it only can be called by router.
Declaration:
function consume(
address user,
uint256 usage
) external nonReentrant onlyRouter
Modifiers:
Modifier |
---|
nonReentrant |
onlyRouter |
Args:
Arg | Type | Description |
---|---|---|
user | address | Transaction sender |
usage | uint256 | Usage amount |
After block callback, it only can be called by router, it will update
globalTimestamp
if the time interval exceeds freeFeeRecoverInterval
.Declaration:
function onAfterBlock(
) external nonReentrant onlyRouter
Modifiers:
Modifier |
---|
nonReentrant |
onlyRouter |
Last modified 1yr ago