StrategyManager
LooksRare protocol team (👀,💎)
StrategyManager
This contract handles the addition and the update of execution strategies.
Methods​
addStrategy​
function addStrategy(uint16 standardProtocolFeeBp, uint16 minTotalFeeBp, uint16 maxProtocolFeeBp, bytes4 selector, bool isMakerBid, address implementation) external nonpayable
This function allows the owner to add a new execution strategy to the protocol.
Strategies have an id that is incremental. Only callable by owner.
Parameters​
Name | Type | Description |
---|---|---|
standardProtocolFeeBp | uint16 | Standard protocol fee (in basis point) |
minTotalFeeBp | uint16 | Minimum total fee (in basis point) |
maxProtocolFeeBp | uint16 | Maximum protocol fee (in basis point) |
selector | bytes4 | Function selector for the strategy |
isMakerBid | bool | Whether the function selector is for maker bid |
implementation | address | Implementation address |
cancelOwnershipTransfer​
function cancelOwnershipTransfer() external nonpayable
This function is used to cancel the ownership transfer.
This function can be used for both cancelling a transfer to a new owner and cancelling the renouncement of the ownership.
confirmOwnershipRenouncement​
function confirmOwnershipRenouncement() external nonpayable
This function is used to confirm the ownership renouncement.
confirmOwnershipTransfer​
function confirmOwnershipTransfer() external nonpayable
This function is used to confirm the ownership transfer.
This function can only be called by the current potential owner.
initiateOwnershipRenouncement​
function initiateOwnershipRenouncement() external nonpayable
This function is used to initiate the ownership renouncement.
initiateOwnershipTransfer​
function initiateOwnershipTransfer(address newPotentialOwner) external nonpayable
This function is used to initiate the transfer of ownership to a new owner.
Parameters​
Name | Type | Description |
---|---|---|
newPotentialOwner | address | New potential owner address |
isCurrencyAllowed​
function isCurrencyAllowed(address) external view returns (bool)
It checks whether the currency is allowed for transacting.
Parameters​
Name | Type | Description |
---|---|---|
_0 | address | undefined |
Returns​
Name | Type | Description |
---|---|---|
_0 | bool | undefined |
owner​
function owner() external view returns (address)
Address of the current owner.
Returns​
Name | Type | Description |
---|---|---|
_0 | address | undefined |
ownershipStatus​
function ownershipStatus() external view returns (enum IOwnableTwoSteps.Status)
Ownership status.
Returns​
Name | Type | Description |
---|---|---|
_0 | enum IOwnableTwoSteps.Status | undefined |
potentialOwner​
function potentialOwner() external view returns (address)
Address of the potential owner.
Returns​
Name | Type | Description |
---|---|---|
_0 | address | undefined |
strategyInfo​
function strategyInfo(uint256) external view returns (bool isActive, uint16 standardProtocolFeeBp, uint16 minTotalFeeBp, uint16 maxProtocolFeeBp, bytes4 selector, bool isMakerBid, address implementation)
This returns the strategy information for a strategy id.
Parameters​
Name | Type | Description |
---|---|---|
_0 | uint256 | undefined |
Returns​
Name | Type | Description |
---|---|---|
isActive | bool | undefined |
standardProtocolFeeBp | uint16 | undefined |
minTotalFeeBp | uint16 | undefined |
maxProtocolFeeBp | uint16 | undefined |
selector | bytes4 | undefined |
isMakerBid | bool | undefined |
implementation | address | undefined |
updateCurrencyStatus​
function updateCurrencyStatus(address currency, bool isAllowed) external nonpayable
This function allows the owner to update the status of a currency.
Only callable by owner.
Parameters​
Name | Type | Description |
---|---|---|
currency | address | Currency address (address(0) for ETH) |
isAllowed | bool | Whether the currency should be allowed for trading |
updateStrategy​
function updateStrategy(uint256 strategyId, bool isActive, uint16 newStandardProtocolFee, uint16 newMinTotalFee) external nonpayable
This function allows the owner to update parameters for an existing execution strategy.
Only callable by owner.
Parameters​
Name | Type | Description |
---|---|---|
strategyId | uint256 | Strategy id |
isActive | bool | Whether the strategy must be active |
newStandardProtocolFee | uint16 | New standard protocol fee (in basis point) |
newMinTotalFee | uint16 | New minimum total fee (in basis point) |
Events​
CancelOwnershipTransfer​
event CancelOwnershipTransfer()
This is emitted if the ownership transfer is cancelled.
CurrencyStatusUpdated​
event CurrencyStatusUpdated(address currency, bool isAllowed)
It is emitted if the currency status in the allowlist is updated.
Parameters​
Name | Type | Description |
---|---|---|
currency | address | undefined |
isAllowed | bool | undefined |
InitiateOwnershipRenouncement​
event InitiateOwnershipRenouncement()
This is emitted if the ownership renouncement is initiated.
InitiateOwnershipTransfer​
event InitiateOwnershipTransfer(address previousOwner, address potentialOwner)
This is emitted if the ownership transfer is initiated.
Parameters​
Name | Type | Description |
---|---|---|
previousOwner | address | undefined |
potentialOwner | address | undefined |
NewOwner​
event NewOwner(address newOwner)
This is emitted when there is a new owner.
Parameters​
Name | Type | Description |
---|---|---|
newOwner | address | undefined |
NewStrategy​
event NewStrategy(uint256 strategyId, uint16 standardProtocolFeeBp, uint16 minTotalFeeBp, uint16 maxProtocolFeeBp, bytes4 selector, bool isMakerBid, address implementation)
It is emitted when a new strategy is added.
Parameters​
Name | Type | Description |
---|---|---|
strategyId | uint256 | undefined |
standardProtocolFeeBp | uint16 | undefined |
minTotalFeeBp | uint16 | undefined |
maxProtocolFeeBp | uint16 | undefined |
selector | bytes4 | undefined |
isMakerBid | bool | undefined |
implementation | address | undefined |
StrategyUpdated​
event StrategyUpdated(uint256 strategyId, bool isActive, uint16 standardProtocolFeeBp, uint16 minTotalFeeBp)
It is emitted when an existing strategy is updated.
Parameters​
Name | Type | Description |
---|---|---|
strategyId | uint256 | undefined |
isActive | bool | undefined |
standardProtocolFeeBp | uint16 | undefined |
minTotalFeeBp | uint16 | undefined |
Errors​
NoOngoingTransferInProgress​
error NoOngoingTransferInProgress()
This is returned when there is no transfer of ownership in progress.
NotOwner​
error NotOwner()
This is returned when the caller is not the owner.
NotV2Strategy​
error NotV2Strategy()
If the strategy has not set properly its implementation contract.
It can only be returned for owner operations.
RenouncementNotInProgress​
error RenouncementNotInProgress()
This is returned when there is no renouncement in progress but the owner tries to validate the ownership renouncement.
StrategyHasNoSelector​
error StrategyHasNoSelector()
It is returned if the strategy has no selector.
It can only be returned for owner operations.
StrategyNotUsed​
error StrategyNotUsed()
It is returned if the strategyId is invalid.
StrategyProtocolFeeTooHigh​
error StrategyProtocolFeeTooHigh()
It is returned if the strategy's protocol fee is too high.
It can only be returned for owner operations.
TransferAlreadyInProgress​
error TransferAlreadyInProgress()
This is returned when the transfer is already in progress but the owner tries initiate a new ownership transfer.
TransferNotInProgress​
error TransferNotInProgress()
This is returned when there is no ownership transfer in progress but the ownership change tries to be approved.
WrongPotentialOwner​
error WrongPotentialOwner()
This is returned when the ownership transfer is attempted to be validated by the a caller that is not the potential owner.