Skip to main content

Dripper

Dripper​

Drip​

struct Drip {
uint64 lastCollect;
uint192 perBlock;
}

vault​

address vault

token​

address token

dripDuration​

uint256 dripDuration

drip​

struct Dripper.Drip drip

constructor​

constructor(address _vault, address _token) public

availableFunds​

function availableFunds() external view returns (uint256)

Return Values​

NameTypeDescription
[0]uint256The amount that would be sent if a collect was called

collect​

function collect() external

Collect all dripped funds and send to vault. Recalculate new drip rate.

collectAndRebase​

function collectAndRebase() external

Collect all dripped funds, send to vault, recalculate new drip rate, and rebase OUSD.

setDripDuration​

function setDripDuration(uint256 _durationSeconds) external

Change the drip duration. Governor only.

Parameters​

NameTypeDescription
_durationSecondsuint256the number of seconds to drip out the entire balance over if no collects were called during that time.

transferToken​

function transferToken(address _asset, uint256 _amount) external

Transfer out ERC20 tokens held by the contract. Governor only.

Parameters​

NameTypeDescription
_assetaddressERC20 token address
_amountuint256amount to transfer

_availableFunds​

function _availableFunds(uint256 _balance, struct Dripper.Drip _drip) internal view returns (uint256)

Calculate available funds by taking the lower of either the currently dripped out funds or the balance available. Uses passed in parameters to calculate with for gas savings.

Parameters​

NameTypeDescription
_balanceuint256current balance in contract
_dripstruct Dripper.Dripcurrent drip parameters

_collect​

function _collect() internal

Sends the currently dripped funds to be vault, and sets the new drip rate based on the new balance.