LosslessControllerV2
Last updated
Last updated
This contract is the gateway contract that connects LERC20 token contracts with all the lossless hack mitigation system.
Contract can be found here:
pauseAdmin
admin
recoveryAdmin
guardian
tokenProtections
This address has the access to pause and unpause controller contract.
This address has access to configure lossless protocol. Can be changed by recoveryAdmin
.
This is a super admin's address. This wallet is able to change the regular admin and pause admin. This address is the most powerful admin in the whole lossless protocol and we are using a secure and time tested multi-sig (Gnosis Safe) for it. This variable can be changed using transferRecoveryAdminOwnership
function.
The address of the guardian smart contract. Guardian contract has access to control protection strategies on controller contract.
This mapping saves info about every address that is protected. It has a flag that shows if the address is protected or not and also has strategy address so that if the address is protected the controller knows which of the protections strategies should be applied.
AdminChanged(address indexed previousAdmin, address indexed newAdmin)
RecoveryAdminChanged(address indexed previousAdmin, address indexed newAdmin)
PauseAdminChanged(address indexed previousAdmin, address indexed newAdmin)
GuardianSet(address indexed oldGuardian, address indexed newGuardian)
ProtectedAddressSet(address indexed token, address indexed protectedAddress, address indexed strategy)
RemovedProtectedAddress(address indexed token, address indexed protectedAddress)
onlyLosslessRecoveryAdmin
onlyLosslessAdmin
onlyPauseAdmin
onlyGuardian
Checks if msg.sender is recoveryAdmin
.
Checks if msg.sender
is admin
.
Checks if msg.sender
is pauseAdmin
.
Checks if msg.sender
is guardian
smart contract.
getVersion
isAddressProtected
getProtectedAddressStrategy
pause
unpause
setAdmin
setRecoveryAdmin
setPauseAdmin
setGuardian
setProtectedAddress
removeProtectedAddress
beforeTransfer
beforeTransferFrom
beforeApprove
beforeIncreaseAllowance
beforeDecreaseAllowance
afterApprove
afterTransfer
afterTransferFrom
afterIncreaseAllowance
afterDecreaseAllowance
Returns current version of the controller.
Returns either true or false depending if the address has any protections set up on it.
Parameters:
Returns address of the strategy that the protected address is using. If address is not protected returns zero address.
Parameters:
Sets the pause flag to true which in turn pauses some of the contracts functionality. Can be called only by the pauseAdmin
.
Sets the pause flag to false which in turn unpauses some of the contracts functionality. Can be called only by the pauseAdmin
.
Sets admin
address. Can be called only by recoveryAdmin
.
Parameters:
Sets recoveryAdmin
address. Can be called only by recoveryAdmin
.
Parameters:
Sets pauseAdmin
address. Can be called only by recoveryAdmin
.
Parameters:
Sets guardian
contract's address. Can be called only by admin
when contract is not paused.
Parameters:
Sets token scoped protection on an address. Can be called only by the guardian
when contract is not paused.
Parameters:
Removes token scoped protection. Can be called only by guardian
contract when contract is not paused.
Parameters:
Hook function that is called before every LERC20 token transfer
function. Also does a call to protection strategy in case sender's address is protected.
Parameters:
Hook function that is called before every LERC20 token transferFrom
function. Also does a call to protection strategy in case sender's address is protected.
Parameters:
Hook function that is called before every LERC20 token approve
function. Does not implement any logic yet.
Parameters:
Hook function that is called before every LERC20 token increaseAllowance
function. Does not implement any logic yet.
Parameters:
Hook function that is called before every LERC20 token decreaseAllowance
function. Does not implement any logic yet.
Parameters:
afterApprove
afterTransfer
afterTransferFrom
afterIncreaseAllowance
afterDecreaseAllowance
These functions are deprecated and do not contain any logic. These functions are kept in the controller because tokens that use older version of LERC20 do calls to these functions. They must be kept on the controller in order not to brick those tokens.
Name | Type | Description |
---|---|---|
Name | Type | Description |
---|---|---|
Name | Type | Description |
---|---|---|
Name | Type | Description |
---|---|---|
Name | Type | Description |
---|---|---|
Name | Type | Description |
---|---|---|
Name | Type | Description |
---|---|---|
Name | Type | Description |
---|---|---|
Name | Type | Description |
---|---|---|
Name | Type | Description |
---|---|---|
Name | Type | Description |
---|---|---|
Name | Type | Description |
---|---|---|