TreasuryProtectionStrategy
Contract that implement protection strategy using a whitelist. Inherits from StrategyBase.
Contract can be found here:
Variables
protectedAddresses
protectedAddresses
A mapping of addresses and their protection rules.
Events
event WhitelistAddresses(address[] whitelist)
Functions
isAddressWhitelisted
isTransferAllowed
setProtectedAddress
removeProtectedAddresses
isAddressWhitelisted
Returns true if particular whitelistedAddress
is in the whitelist of protectedAddress
for token
.
Parameters:
Name | Type | Description |
---|---|---|
| address | Token for which the protection rules are being checked. |
| address | Address for which the whitelist is being checked. |
| address | Address to check if it's in the whitelist. |
isTransferAllowed
Reverts in case transfer from sender to recipient is not possible due to recipient not being in the sender's whitelist. This is called by the lossless controller every time a transfer is done from the protected address.
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 sent. |
setProtectedAddress
Sets a whitelist for the protected address inside one particular token's scope. Can be called only by the protection admin of a token.
Parameters:
Name | Type | Description |
---|---|---|
| address | Token for which the protection rules are being checked. |
| address | Address for which the protection rules should be applied. |
| address[] | A list of addresses that are allowed to receive tokens from the protected address. |
removeProtectedAddresses
Removes whitelist from the addresses in the list.
Parameters:
Name | Type | Description |
---|---|---|
| address | Token for which the protection rules are being removed. |
| address[] | A list of address that should get their whitelist removed. |
Last updated