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
_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
[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
[0]
uint256
uint256 : total amount of assets
totalSupply
function totalSupply() public view returns (uint256)
Get the total supply of shares
Return Values
[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
[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
assets
uint256
amount of assets
Return Values
[0]
uint256
uint256 : amount of shares
convertToAssets
function convertToAssets(uint256 shares) public pure returns (uint256)
Convert a given amount of shares to assets
Parameters
shares
uint256
amount of shares
Return Values
[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
assets
uint256
Amount of assets to be deposited
Return Values
[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
shares
uint256
Amount of shares to be minted
Return Values
[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
assets
uint256
Amount of assets to be withdrawn
Return Values
[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
shares
uint256
Amount of shares to be burned
Return Values
[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
user
address
User address
Return Values
[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
user
address
User address
Return Values
[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
owner
address
Owner address
Return Values
[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
owner
address
Owner address
Return Values
[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
[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
assets
uint256
Amount to deposit
receiver
address
Address to receive the shares
Return Values
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
shares
uint256
Amount of shares to mint
receiver
address
Address to receive the shares
Return Values
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
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
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
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
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
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
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
pod
address
Address of the Pod
amount
uint256
Amount to pull
_getCurrentIndex
function _getCurrentIndex() internal view returns (uint256)
Get the current index to convert between balance and scaled balances
Return Values
[0]
uint256
uint256 : Current index
_deposit
function _deposit(uint256 amount, address receiver, address depositor) internal returns (uint256, uint256)
Pull assets to deposit in the Vault & mint shares
Parameters
amount
uint256
Amount to deposit
receiver
address
Address to receive the shares
depositor
address
Address depositing the assets
Return Values
[0]
uint256
uint256 : Amount of assets deposited
[1]
uint256
uint256 : Amount of shares minted
_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
amount
uint256
Amount to withdraw
owner
address
Address owning the shares
receiver
address
Address to receive the assets
sender
address
Address of the caller
Return Values
[0]
uint256
uint256 : Amount of assets withdrawn
[1]
uint256
uint256 : Amount of shares burned
beforeWithdraw
function beforeWithdraw(uint256 amount) internal
Hook exectued before withdrawing
Parameters
amount
uint256
Amount to withdraw
afterDeposit
function afterDeposit(uint256 amount) internal
Hook exectued after depositing
Parameters
amount
uint256
Amount deposited
_beforeTokenTransfer
function _beforeTokenTransfer(address from, address to, uint256 amount) internal virtual
Hook executed before each transfer
Parameters
from
address
Sender address
to
address
Receiver address
amount
uint256
Amount to transfer
_afterTokenTransfer
function _afterTokenTransfer(address from, address to, uint256 amount) internal virtual
Hook executed after each transfer
Parameters
from
address
Sender address
to
address
Receiver address
amount
uint256
Amount to transfer
_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
newAdmin
address
Address to be the new admin
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
newManager
address
Address of the new manager
blockPodManager
function blockPodManager(address manager) external
Block a Pod Manager
Parameters
manager
address
Address of the manager
updateVotingPowerManager
function updateVotingPowerManager(address newManager) external
Update the Vault's voting power manager & delegate the voting power to it
Parameters
newManager
address
Address of the new manager
updateProposalPowerManager
function updateProposalPowerManager(address newManager) external
Update the Vault's proposal power manager & delegate the proposal power to it
Parameters
newManager
address
Address of the new manager
updateReserveManager
function updateReserveManager(address newManager) external
Update the Vault's Reserve manager
Parameters
newManager
address
Address of the new manager
updateReserveRatio
function updateReserveRatio(uint256 newRatio) external
Uodate the reserve ratio parameter
Parameters
newRatio
uint256
New ratio value
updateBufferRatio
function updateBufferRatio(uint256 newRatio) external
Uodate the buffer ratio parameter
Parameters
newRatio
uint256
New ratio value
depositToReserve
function depositToReserve(uint256 amount) external returns (bool)
Deposit token in the reserve
Parameters
amount
uint256
Amount of token to deposit
withdrawFromReserve
function withdrawFromReserve(uint256 amount, address receiver) external returns (bool)
Withdraw tokens from the reserve to send to the given receiver
Parameters
amount
uint256
Amount of token to withdraw
receiver
address
Address to receive the tokens
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
token
address
Address of the ERC2O token
Return Values
[0]
bool
bool: success
safe248
function safe248(uint256 n) internal pure returns (uint248)
Last updated
Was this helpful?