Dripper
Inherits: IDripper, Ownable
Author: Sperax Foundation
This contract releases tokens at a steady rate to the Vault contract, for rebasing the USDs stablecoin.
The Dripper contract ensures that tokens are released gradually over time, allowing for consistent and controlled distribution.
State Variables
vault
dripRate
dripDuration
lastCollectTS
Functions
constructor
Constructor to initialize the Dripper.
Parameters
Name | Type | Description |
---|---|---|
_vault | address | Address of the contract that receives the dripped tokens. |
_dripDuration | uint256 | The duration over which tokens are dripped. |
recoverTokens
Emergency fund recovery function.
Transfers the asset to the owner of the contract.
Parameters
Name | Type | Description |
---|---|---|
_asset | address | Address of the asset to recover. |
addUSDs
Function to be used to send USDs to dripper and update dripRate
.
Parameters
Name | Type | Description |
---|---|---|
_amount | uint256 | Amount of USDs to be sent form caller to this contract. |
collect
Transfers the dripped tokens to the vault.
This function also updates the dripRate based on the fund state.
Returns
Name | Type | Description |
---|---|---|
uint256 | The amount of tokens collected and transferred to the vault. |
updateVault
Update the vault address.
Parameters
Name | Type | Description |
---|---|---|
_vault | address | Address of the new vault contract. |
updateDripDuration
Updates the dripDuration.
Parameters
Name | Type | Description |
---|---|---|
_dripDuration | uint256 | The desired drip duration to be set. |
getCollectableAmt
Gets the collectible amount of tokens at the current time.
Returns
Name | Type | Description |
---|---|---|
uint256 | The amount of tokens that can be collected. |
Events
Collected
Recovered
VaultUpdated
DripDurationUpdated
USDsAdded
Errors
NothingToRecover
Last updated