Skip to content

tienbigg/contracts-minimum-deposit-controller

 
 

Repository files navigation

🦐 Minimum deposit controller

Overview

The minimum-deposit controller is built based on the default deposit controller from carbon-contracts and it is designed to give the portfolio manager the ability to set the minimum value that lenders can deposit.

Minimum deposit value is first initialized by the manager in the initialize function and can be changed by calling setMinimumDeposit or configure function.

Affected Methods

function onDeposit(
    address,
    uint256 assets,
    address
) external view returns (uint256, uint256)

Called by TrancheVault in the deposit function. Checks if deposit is greater or equal to minimum deposit value and returns number of shares that lender should get and deposit fee that lender should pay.

function onMint(
    address,
    uint256 shares,
    address
) external view returns (uint256, uint256)

Called by TrancheVault in the mint function. Checks if amount of shares converted to assets is greater or equal to minimum deposit value and returns number of assets that should be transferred and deposit fee that lender should pay.

function setMinimumDeposit(uint256 newMinimumDeposit) public

Sets minimum deposit value and emits event with changed value.

function configure(
    uint256 newCeiling,
    uint256 newFeeRate,
    uint256 newMinimumDeposit,
    ILenderVerifier newLenderVerifier,
    DepositAllowed memory newDepositAllowed
) external

Allows the manager to change multiple parameters in the deposit controller (ceiling, fee rate, minimum deposit, lender verifier and allowance for deposit).

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Solidity 85.8%
  • TypeScript 12.1%
  • JavaScript 1.1%
  • Shell 1.0%