Overview
Last updated
Last updated
Repo: https://github.com/sherlock-protocol/sherlock-v2-core
The core contract (Sherlock.sol) is the main point of interaction for stakers. The contract has an upgradeable reference to 5 addresses.
Yield strategy (MasterStrategy.sol)
SHER rewards (SherDistributionManager.sol)
Protocol manager (SherlockProtocolManager.sol)
Claims/payout process (SherlockClaimManager.sol)
Non-Staker address (multisig wallet)
Core holds USDC and the exact amount of SHER that will be distributed to stakers upon exiting their position.
The yield strategy holds most of the USDC as the owner of the core contract can move funds into to the Master Strategy contract which will distribute the USDC between different protocols based on a preconfigured distribution.
Protocol manager holds all the balances deposited by protocols and exposes the exact amount of debt to core, which is claimable each block.
The claims/payout process contract is not supposed to hold funds.
The non-staker address is able to claim funds from protocol manager based on the configuration of each covered protocol.
Conceptually there a couple objects with a lifecycle
Stake position (Core)
Claim (Claim manager)
Protocol (Protocol manager)
SHER Rewards Curve (SHER distribution manager)
Each object and their lifecycle can be viewed in the specific docs
Some of the contracts used in Sherlock V2 implement access control for certain functions.
For Ownable, OpenZeppelin's Ownable library is being used. The owner address will belong to Sherlock governance.
Ownable
enableStakingPeriod()
disableStakingPeriod()
updateSherDistributionManager()
removeSherDistributionManager()
updateNonStakersAddress()
updateSherlockProtocolManager()
updateSherlockClaimManager()
updateYieldStrategy()
pause()
unpause()
yieldStrategyDeposit()
yieldStrategyWithdraw()
yieldStrategyWithdrawAll()
Functions 1 to 8 are functions calls that have a big effect on the way the protocol executes.
Functions 9 and 10 are used in emergency situations when the protocol needs to be paused for investigation.
Function 11, 12 and 13 are used to move the staker pool in and out of the active strategy.
Ownable
withdrawAllByAdmin()
withdrawByAdmin()
These functions are used to get USDC out of the underlying strategies.
onlySherlockCore
This role means that only the address associated with the active Sherlock.sol implementation can call the function.
deposit()
withdrawAll()
withdraw()
These functions are used to get liquidity in and out of the underlying strategies.
Ownable
sweep()
This function is used to get the remaining ERC20s and ETH out of the contract. This can only be called if it isn't the current active sher distribution manager.
Ownable
setMinActiveBalance()
protocolAdd()
protocolUpdate()
protocolRemove()
setProtocolPremium()
setProtocolPremiums()
sweep()
This function is used to get the remaining ERC20s and ETH out of the contract. This can only be called if it isn't the current active sher distribution manager.
Protocol Agent
withdrawActiveBalance()
These function can only be called by the protocol agent, there are as many protocol agents as there are protocols.
Non Stakers
nonStakersClaim()
This function can only be called by the nonStakersAddress
, which is defined in Sherlock.sol
Ownable
renounceUmaHaltOperator()
addCallback()
removeCallback()
Protocol Agent
startClaim()
escalate()
payoutClaim()
cleanUp()
These function can only be called by the protocol agent, there are as many protocol agents as there are protocols. This agent retrieved from SherlockProtocolManager.sol
NOTE: Function 2 and 3 use the stored protocol agent of startClaim()
UMA
Read more about our UMA integration here https://docs.sherlock.xyz/claims/claims-process
priceProposed()
priceDisputed()
priceSettled()
These functions can only be called by UMA
, this is a hardcoded address in SherlockClaimManager.sol
UMAHO
executeHalt()
These functions can only be called by UMAHO
(UMA Halt Operator), this is an address passed on in the constructor of SherlockClaimManager.sol
SPCC
spccApprove()
spccRefuse()
These functions can only be called by SPCC
(Sherlock Protocol Claims Committee), this is an address passed on in the constructor of SherlockClaimManager.sol