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

asset

function asset() external view returns (address)

Get the vault's asset

Return Values

totalAssets

function totalAssets() public view returns (uint256)

Get the total amount of assets in the Vault

Return Values

totalSupply

function totalSupply() public view returns (uint256)

Get the total supply of shares

Return Values

totalAvailable

function totalAvailable() public view returns (uint256)

Get the current total amount of asset available in the Vault

Return Values

convertToShares

function convertToShares(uint256 assets) public pure returns (uint256)

Convert a given amount of assets to shares

Parameters

Return Values

convertToAssets

function convertToAssets(uint256 shares) public pure returns (uint256)

Convert a given amount of shares to assets

Parameters

Return Values

previewDeposit

function previewDeposit(uint256 assets) public pure returns (uint256)

Return the amount of shares expected for depositing the given assets

Parameters

Return Values

previewMint

function previewMint(uint256 shares) public pure returns (uint256)

Return the amount of assets expected for minting the given shares

Parameters

Return Values

previewWithdraw

function previewWithdraw(uint256 assets) public pure returns (uint256)

Return the amount of shares expected for withdrawing the given assets

Parameters

Return Values

previewRedeem

function previewRedeem(uint256 shares) public pure returns (uint256)

Return the amount of assets expected for burning the given shares

Parameters

Return Values

maxDeposit

function maxDeposit(address user) public view returns (uint256)

Get the maximum amount that can be deposited by the user

Parameters

Return Values

maxMint

function maxMint(address user) public view returns (uint256)

Get the maximum amount that can be minted by the user

Parameters

Return Values

maxWithdraw

function maxWithdraw(address owner) public view returns (uint256)

Get the maximum amount that can be withdrawn by the user

Parameters

Return Values

maxRedeem

function maxRedeem(address owner) public view returns (uint256)

Get the maximum amount that can be burned by the user

Parameters

Return Values

getCurrentIndex

function getCurrentIndex() public view returns (uint256)

Get the current index to convert between balance and scaled balances

Return Values

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

Return Values

mint

function mint(uint256 shares, address receiver) public returns (uint256 assets)

Mint vault shares by depositing assets

Parameters

Return Values

withdraw

function withdraw(uint256 assets, address receiver, address owner) public returns (uint256 shares)

Withdraw from the Vault & burn shares

Parameters

Return Values

redeem

function redeem(uint256 shares, address receiver, address owner) public returns (uint256 assets)

Burn shares to withdraw from the Vault

Parameters

Return Values

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

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

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

_getCurrentIndex

function _getCurrentIndex() internal view returns (uint256)

Get the current index to convert between balance and scaled balances

Return Values

_deposit

function _deposit(uint256 amount, address receiver, address depositor) internal returns (uint256, uint256)

Pull assets to deposit in the Vault & mint shares

Parameters

Return Values

_withdraw

function _withdraw(uint256 amount, address owner, address receiver, address sender) internal returns (uint256, uint256)

Withdraw assets from the Vault & send to the receiver & burn shares

Parameters

Return Values

beforeWithdraw

function beforeWithdraw(uint256 amount) internal

Hook exectued before withdrawing

Parameters

afterDeposit

function afterDeposit(uint256 amount) internal

Hook exectued after depositing

Parameters

_beforeTokenTransfer

function _beforeTokenTransfer(address from, address to, uint256 amount) internal virtual

Hook executed before each transfer

Parameters

_afterTokenTransfer

function _afterTokenTransfer(address from, address to, uint256 amount) internal virtual

Hook executed after each transfer

Parameters

_getStkAaveRewards

function _getStkAaveRewards() internal

Claim AAVE rewards from the Safety Module & stake them to receive stkAAVE

pause

function pause() external

Pause the contract

unpause

function unpause() external

Unpause the contract

transferAdmin

function transferAdmin(address newAdmin) external

Set a given address as the new pending admin

Parameters

acceptAdmin

function acceptAdmin() external

Accpet adminship of the contract (must be the pending admin)

addPodManager

function addPodManager(address newManager) external

Add a new Pod Manager

Parameters

blockPodManager

function blockPodManager(address manager) external

Block a Pod Manager

Parameters

updateVotingPowerManager

function updateVotingPowerManager(address newManager) external

Update the Vault's voting power manager & delegate the voting power to it

Parameters

updateProposalPowerManager

function updateProposalPowerManager(address newManager) external

Update the Vault's proposal power manager & delegate the proposal power to it

Parameters

updateReserveManager

function updateReserveManager(address newManager) external

Update the Vault's Reserve manager

Parameters

updateReserveRatio

function updateReserveRatio(uint256 newRatio) external

Uodate the reserve ratio parameter

Parameters

updateBufferRatio

function updateBufferRatio(uint256 newRatio) external

Uodate the buffer ratio parameter

Parameters

depositToReserve

function depositToReserve(uint256 amount) external returns (bool)

Deposit token in the reserve

Parameters

withdrawFromReserve

function withdrawFromReserve(uint256 amount, address receiver) external returns (bool)

Withdraw tokens from the reserve to send to the given receiver

Parameters

recoverERC20

function recoverERC20(address token) external returns (bool)

Recover ERC2O tokens sent by mistake to the contract

Recover ERC2O tokens sent by mistake to the contract

Parameters

Return Values

safe248

function safe248(uint256 n) internal pure returns (uint248)

Last updated