IHeart
Methods
activate
function activate() external nonpayable
Turns the heart on and resets the beatAccess restricted
This function is used to restart the heart after a pause
beat
function beat() external nonpayable
Beats the heartOnly 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
deactivate
function deactivate() external nonpayable
Turns the heart offAccess restricted
Emergency stop function for the heart
frequency
function frequency() external view returns (uint256)
Heart beat frequency, in seconds
Returns
Name | Type | Description |
---|---|---|
_0 | uint256 | undefined |
resetBeat
function resetBeat() external nonpayable
Unlocks the cycle if stuck on one side, eject functionAccess restricted
setRewardTokenAndAmount
function setRewardTokenAndAmount(contract ERC20 token_, uint256 reward_) external nonpayable
Sets the reward token and amount for the beat functionAccess restricted
Parameters
Name | Type | Description |
---|---|---|
token_ | contract ERC20 | - New reward token address |
reward_ | uint256 | - New reward amount, in units of the reward token |
withdrawUnspentRewards
function withdrawUnspentRewards(contract ERC20 token_) external nonpayable
Withdraws unspent balance of provided token to senderAccess restricted
Parameters
Name | Type | Description |
---|---|---|
token_ | contract ERC20 | undefined |
Events
Beat
event Beat(uint256 timestamp_)
Parameters
Name | Type | Description |
---|---|---|
timestamp_ | uint256 | undefined |
RewardIssued
event RewardIssued(address to_, uint256 rewardAmount_)
Parameters
Name | Type | Description |
---|---|---|
to_ | address | undefined |
rewardAmount_ | uint256 | undefined |
RewardUpdated
event RewardUpdated(contract ERC20 token_, uint256 rewardAmount_)
Parameters
Name | Type | Description |
---|---|---|
token_ | contract ERC20 | undefined |
rewardAmount_ | uint256 | undefined |
Errors
Heart_BeatAvailable
error Heart_BeatAvailable()
Heart_BeatStopped
error Heart_BeatStopped()
Heart_InvalidParams
error Heart_InvalidParams()
Heart_OutOfCycle
error Heart_OutOfCycle()