Docs
Search
K
Comment on page

DullahanVault

MAX_BPS

uint256 MAX_BPS
Max value for BPS - 100%

MAX_UINT256

uint256 MAX_UINT256
Max value possible for an uint256

STK_AAVE

address STK_AAVE
Address of the stkAAVE token

AAVE

address AAVE
Address of the AAVE token

PodsManager

struct PodsManager {
bool rentingAllowed;
uint248 totalRented;
}

initialized

bool initialized
Is the Vault initialized

admin

address admin
Address of the Vault admin

pendingAdmin

address pendingAdmin
Address of the Vault pending admin

totalRentedAmount

uint256 totalRentedAmount
Total amount of stkAAVE rented to Pod Managers

podManagers

mapping(address => struct DullahanVault.PodsManager) podManagers
Pod Manager states

votingPowerManager

address votingPowerManager
Address receiving the delegated voting power from the Vault

proposalPowerManager

address proposalPowerManager
Address receiving the delegated proposal power from the Vault

bufferRatio

uint256 bufferRatio
Percentage of funds to stay in the contract for withdraws

reserveAmount

uint256 reserveAmount
Amount accrued as Reserve

reserveRatio

uint256 reserveRatio
Ratio of claimed rewards to be set as Reserve

reserveManager

address reserveManager
Address of the Reserve Manager

Initialized

event Initialized()
Event emitted when the Vault is initialized

RentToPod

event RentToPod(address manager, address pod, uint256 amount)
Event emitted when stkAAVE is rented to a Pod

NotifyRentedAmount

event NotifyRentedAmount(address manager, address pod, uint256 addedAmount)
Event emitted when stkAAVE claim is notified by a Pod

PullFromPod

event PullFromPod(address manager, address pod, uint256 amount)
Event emitted when stkAAVE is pulled back from a Pod

AdminTransferred

event AdminTransferred(address previousAdmin, address newAdmin)
Event emitted when the adminship is transfered

NewPendingAdmin

event NewPendingAdmin(address previousPendingAdmin, address newPendingAdmin)
Event emitted when a new pending admin is set

NewPodManager

event NewPodManager(address newManager)
Event emitted when a new Pod Manager is added

BlockedPodManager

event BlockedPodManager(address manager)
Event emitted when a Pod Manager is blocked

ReserveDeposit

event ReserveDeposit(address from, uint256 amount)
Event emitted when depositing in the Reserve

ReserveWithdraw

event ReserveWithdraw(address to, uint256 amount)
Event emitted when withdrawing from the Reserve

UpdatedVotingPowerManager

event UpdatedVotingPowerManager(address oldManager, address newManager)
Event emitted when the Voting maanger is updated

UpdatedProposalPowerManager

event UpdatedProposalPowerManager(address oldManager, address newManager)
Event emitted when the Proposal maanger is updated

UpdatedReserveManager

event UpdatedReserveManager(address oldManager, address newManager)
Event emitted when the Reserve manager is updated

UpdatedBufferRatio

event UpdatedBufferRatio(uint256 oldRatio, uint256 newRatio)
Event emitted when the Buffer ratio is updated

UpdatedReserveRatio

event UpdatedReserveRatio(uint256 oldRatio, uint256 newRatio)
Event emitted when the Reserve ratio is updated

TokenRecovered

event TokenRecovered(address token, uint256 amount)
Event emitted when an ERC20 token is recovered

onlyAdmin

modifier onlyAdmin()
Check that the caller is the admin

onlyAllowed

modifier onlyAllowed()
Check that the caller is the admin or the Reserve maanger

isInitialized

modifier isInitialized()
Check that the contract is initialized

constructor

constructor(address _admin, uint256 _reserveRatio, address _reserveManager, address _aave, address _stkAave, string _name, string _symbol) public

init

function init(address _votingPowerManager, address _proposalPowerManager) external
Initialize the Vault
Initialize the Vault by performing a seed deposit & delegating voting power

Parameters

Name
Type
Description
_votingPowerManager
address
Address to receive the voting power delegation
_proposalPowerManager
address
Address to receive the proposal power delegation

asset

function asset() external view returns (address)
Get the vault's asset

Return Values

Name
Type
Description
[0]
address
address : Address of the asset

totalAssets

function totalAssets() public view returns (uint256)
Get the total amount of assets in the Vault

Return Values

Name
Type
Description
[0]
uint256
uint256 : total amount of assets

totalSupply

function totalSupply() public view returns (uint256)
Get the total supply of shares

Return Values

Name
Type
Description
[0]
uint256
uint256 : Total supply of shares

totalAvailable

function totalAvailable() public view returns (uint256)
Get the current total amount of asset available in the Vault

Return Values

Name
Type
Description
[0]
uint256
uint256 : Current total amount available

convertToShares

function convertToShares(uint256 assets) public pure returns (uint256)
Convert a given amount of assets to shares

Parameters

Name
Type
Description
assets
uint256
amount of assets

Return Values

Name
Type
Description
[0]
uint256
uint256 : amount of shares

convertToAssets

function convertToAssets(uint256 shares) public pure returns (uint256)
Convert a given amount of shares to assets

Parameters

Name
Type
Description
shares
uint256
amount of shares

Return Values

Name
Type
Description
[0]
uint256
uint256 : amount of assets

previewDeposit

function previewDeposit(uint256 assets) public pure returns (uint256)
Return the amount of shares expected for depositing the given assets

Parameters

Name
Type
Description
assets
uint256
Amount of assets to be deposited

Return Values

Name
Type
Description
[0]
uint256
uint256 : amount of shares

previewMint

function previewMint(uint256 shares) public pure returns (uint256)
Return the amount of assets expected for minting the given shares

Parameters

Name
Type
Description
shares
uint256
Amount of shares to be minted

Return Values

Name
Type
Description
[0]
uint256
uint256 : amount of assets

previewWithdraw

function previewWithdraw(uint256 assets) public pure returns (uint256)
Return the amount of shares expected for withdrawing the given assets

Parameters

Name
Type
Description
assets
uint256
Amount of assets to be withdrawn

Return Values

Name
Type
Description
[0]
uint256
uint256 : amount of shares

previewRedeem

function previewRedeem(uint256 shares) public pure returns (uint256)
Return the amount of assets expected for burning the given shares

Parameters

Name
Type
Description
shares
uint256
Amount of shares to be burned

Return Values

Name
Type
Description
[0]
uint256
uint256 : amount of assets

maxDeposit

function maxDeposit(address user) public view returns (uint256)
Get the maximum amount that can be deposited by the user

Parameters

Name
Type
Description
user
address
User address

Return Values

Name
Type
Description
[0]
uint256
uint256 : Max amount to deposit

maxMint

function maxMint(address user) public view returns (uint256)
Get the maximum amount that can be minted by the user

Parameters

Name
Type
Description
user
address
User address

Return Values

Name
Type
Description
[0]
uint256
uint256 : Max amount to mint

maxWithdraw

function maxWithdraw(address owner) public view returns (uint256)
Get the maximum amount that can be withdrawn by the user

Parameters

Name
Type
Description
owner
address
Owner address

Return Values

Name
Type
Description
[0]
uint256
uint256 : Max amount to withdraw

maxRedeem

function maxRedeem(address owner) public view returns (uint256)
Get the maximum amount that can be burned by the user

Parameters

Name
Type
Description
owner
address
Owner address

Return Values

Name
Type
Description
[0]
uint256
uint256 : Max amount to burn

getCurrentIndex

function getCurrentIndex() public view returns (uint256)
Get the current index to convert between balance and scaled balances

Return Values

Name
Type
Description
[0]
uint256
uint256 : Current index

getDelegates

function getDelegates() external view returns (address votingPower, address proposalPower)
Get the current delegates for the Vault voting power & proposal power

deposit

function deposit(uint256 assets, address receiver) public returns (uint256 shares)
Deposit assets in the Vault & mint shares

Parameters

Name
Type
Description
assets
uint256
Amount to deposit
receiver
address
Address to receive the shares

Return Values

Name
Type
Description
shares
uint256
- uint256 : Amount of shares minted

mint

function mint(uint256 shares, address receiver) public returns (uint256 assets)
Mint vault shares by depositing assets

Parameters

Name
Type
Description
shares
uint256
Amount of shares to mint
receiver
address
Address to receive the shares

Return Values

Name
Type
Description
assets
uint256
- uint256 : Amount of assets deposited

withdraw

function withdraw(uint256 assets, address receiver, address owner) public returns (uint256 shares)
Withdraw from the Vault & burn shares

Parameters

Name
Type
Description
assets
uint256
Amount of assets to withdraw
receiver
address
Address to receive the assets
owner
address
Address of the owner of the shares

Return Values

Name
Type
Description
shares
uint256
- uint256 : Amount of shares burned

redeem

function redeem(uint256 shares, address receiver, address owner) public returns (uint256 assets)
Burn shares to withdraw from the Vault

Parameters

Name
Type
Description
shares
uint256
Amount of shares to burn
receiver
address
Address to receive the assets
owner
address
Address of the owner of the shares

Return Values

Name
Type
Description
assets
uint256
- uint256 : Amount of assets withdrawn

updateStkAaveRewards

function updateStkAaveRewards() external
Claim Safety Module rewards & stake them in stkAAVE

rentStkAave

function rentStkAave(address pod, uint256 amount) external
Rent stkAAVE for a Pod
Rent stkAAVE to a Pod, sending the amount & tracking the manager that requested

Parameters

Name
Type
Description
pod
address
Address of the Pod
amount
uint256
Amount to rent

notifyRentedAmount

function notifyRentedAmount(address pod, uint256 addedAmount) external
Notify a claim on rented stkAAVE
Notify the newly claimed rewards from rented stkAAVE to a Pod & add it as rented to the Pod

Parameters

Name
Type
Description
pod
address
Address of the Pod
addedAmount
uint256
Amount added

pullRentedStkAave

function pullRentedStkAave(address pod, uint256 amount) external
Pull rented stkAAVE from a Pod
Pull stkAAVE from a Pod & update the tracked rented amount

Parameters