Dripper

Git Source

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

address public vault;

dripRate

uint256 public dripRate;

dripDuration

uint256 public dripDuration;

lastCollectTS

uint256 public lastCollectTS;

Functions

constructor

Constructor to initialize the Dripper.

constructor(address _vault, uint256 _dripDuration);

Parameters

recoverTokens

Emergency fund recovery function.

Transfers the asset to the owner of the contract.

function recoverTokens(address _asset) external onlyOwner;

Parameters

addUSDs

Function to be used to send USDs to dripper and update dripRate.

function addUSDs(uint256 _amount) external;

Parameters

collect

Transfers the dripped tokens to the vault.

This function also updates the dripRate based on the fund state.

function collect() public returns (uint256);

Returns

updateVault

Update the vault address.

function updateVault(address _vault) public onlyOwner;

Parameters

updateDripDuration

Updates the dripDuration.

function updateDripDuration(uint256 _dripDuration) public onlyOwner;

Parameters

getCollectableAmt

Gets the collectible amount of tokens at the current time.

function getCollectableAmt() public view returns (uint256);

Returns

Events

Collected

event Collected(uint256 amount);

Recovered

event Recovered(address owner, uint256 amount);

VaultUpdated

event VaultUpdated(address vault);

DripDurationUpdated

event DripDurationUpdated(uint256 dripDuration);

USDsAdded

event USDsAdded(uint256 _amount);

Errors

NothingToRecover

error NothingToRecover();

Last updated