LiquidityProtectionSingleLimitStrategy
Last updated
Last updated
Contract that implements protection strategy using a single limit. Inherits from StrategyBase.
Contract can be found here:
protection
A mapping of addresses and their protection rules.
getLimit
setLimitBatched
setLimit
removeLimits
pause
isTransferAllowed
Returns limit info for particular protected address.
Parameters:
Name | Type | Description |
---|---|---|
| address | Token for which the protection rules are being checked. |
| address | Address for which the limit should be returned. |
Sets limits for a list of addresses. Can be called only by token protection admin.
Parameters:
Name | Type | Description |
---|---|---|
| address | Token for which the protection rules are being applied. |
| address[] | A list of addresses that should get the limit applied. |
| uint256 | Limit period. |
| uint256 | Limit amount per period. |
| uint256 | Limit start time. |
Sets limit for a single address. Can be called only by token protection admin.
Parameters:
Name | Type | Description |
---|---|---|
| address | Token for which the protection rules are being applied. |
| address | Address that should get the limit applied. |
| uint256 | Limit period. |
| uint256 | Limit amount per period. |
| uint256 | Limit start time. |
Removes limits for addresses in the list. Can be called only by token protection admin.
Parameters:
Name | Type | Description |
---|---|---|
| address | Token for which the protection rules are being applied. |
| address[] | Addresses that should get limits removed. |
Change limit to 0, ie, pause transfers from this address. Can be called only by token protection admin.
Parameters:
Name | Type | Description |
---|---|---|
| address | Token for which the protection rules are being applied. |
| address | Address that should get it's limit paused. |
Checks if transfer from the sender is allowed. Internally it validates if limit is not reached and updates limit info after transfer is allowed to go through.
Parameters:
Name | Type | Description |
---|---|---|
| address | Token for which the protection rules are being checked. |
| address | Sender's address. |
| address | Recipient's address. |
| uint256 | Amount of tokens being transferred. |