OperableDeposit

Git Source

Inherits: Farm

Author: Sperax Foundation.

This contract helps in creating farms with increase/decrease deposit functionality.

Functions

_updateSubscriptionForIncrease

Update subscription data of a deposit for increase in liquidity.

function _updateSubscriptionForIncrease(uint256 _depositId, uint256 _amount) internal;

Parameters

NameTypeDescription

_depositId

uint256

Unique deposit id for the deposit.

_amount

uint256

_amount to be increased.

_updateSubscriptionForDecrease

Update subscription data of a deposit after decrease in liquidity.

function _updateSubscriptionForDecrease(uint256 _depositId, uint256 _amount) internal;

Parameters

NameTypeDescription

_depositId

uint256

Unique deposit id for the deposit

_amount

uint256

_amount to be decreased.

_increaseDeposit

Common logic for increasing a deposit.

function _increaseDeposit(uint256 _depositId, uint256 _amount) internal;

Parameters

NameTypeDescription

_depositId

uint256

Unique deposit id for the deposit

_amount

uint256

_amount to be decreased.

_decreaseDeposit

Common logic for decreasing a deposit.

function _decreaseDeposit(uint256 _depositId, uint256 _amount) internal;

Parameters

NameTypeDescription

_depositId

uint256

Unique deposit id for the deposit

_amount

uint256

_amount to be decreased.

Events

DepositIncreased

event DepositIncreased(uint256 indexed depositId, uint256 liquidity);

DepositDecreased

event DepositDecreased(uint256 indexed depositId, uint256 liquidity);

Errors

DecreaseDepositNotPermitted

error DecreaseDepositNotPermitted();

InsufficientLiquidity

error InsufficientLiquidity();