IHeart
Interface for the Heart policy as of v1.7
Functions
beat
Beats the heart
Only callable when enough time has passed since last beat (determined by frequency variable)
This function is incentivized with a token reward (see rewardToken and reward variables).
Triggers price oracle update and market operations
function beat() external;
resetBeat
Unlocks the cycle if stuck on one side, eject function
Access restricted
function resetBeat() external;
setDistributor
Updates the Distributor contract address that the Heart calls on a beat
Access restricted
function setDistributor(address distributor_) external;
Parameters
| Name | Type | Description |
|---|---|---|
distributor_ | address | The address of the new Distributor contract |
setRewardAuctionParams
Sets the max reward amount, and auction duration for the beat function
Access restricted
function setRewardAuctionParams(uint256 maxReward_, uint48 auctionDuration_) external;
Parameters
| Name | Type | Description |
|---|---|---|
maxReward_ | uint256 | - New max reward amount, in units of the reward token |
auctionDuration_ | uint48 | - New auction duration, in seconds |
frequency
Heart beat frequency, in seconds
function frequency() external view returns (uint48);
currentReward
Current reward amount based on linear auction
function currentReward() external view returns (uint256);
Events
Beat
event Beat(uint256 timestamp_);
RewardIssued
event RewardIssued(address to_, uint256 rewardAmount_);
RewardUpdated
event RewardUpdated(uint256 maxRewardAmount_, uint48 auctionDuration_);
Errors
Heart_OutOfCycle
error Heart_OutOfCycle();
Heart_BeatStopped
error Heart_BeatStopped();
Heart_InvalidParams
error Heart_InvalidParams();
Heart_BeatAvailable
error Heart_BeatAvailable();
Heart_InvalidFrequency
error Heart_InvalidFrequency();