DullahanPod
MAX_BPS
uint256 MAX_BPSMax value for BPS - 100%
MIN_MINT_AMOUNT
uint256 MIN_MINT_AMOUNTMinimum allowed amount of GHO to mint
initialized
bool initializedIs the Pod initialized
manager
address managerAddress of the Pod manager
vault
address vaultAddress of the Vault
registry
address registryAddress of the Registry
podOwner
address podOwnerAddress of the Pod owner
votingPowerDelegate
address votingPowerDelegateAddress of the delegate receiving the Pod voting power
proposalPowerDelegate
address proposalPowerDelegateAddress of the delegate receiving the Pod proposal power
collateral
address collateralAddress of the collateral in the Pod
aToken
address aTokenAddress of the aToken for the collateral
aave
address aaveAddress of the AAVE token
stkAave
address stkAaveAddress of the stkAAVE token
PodInitialized
event PodInitialized(address podManager, address collateral, address podOwner, address vault, address registry)Event emitted when the Pod is initialized
CollateralDeposited
event CollateralDeposited(address collateral, uint256 amount)Event emitted when collateral is deposited
CollateralWithdrawn
event CollateralWithdrawn(address collateral, uint256 amount)Event emitted when collateral is withdrawn
CollateralLiquidated
event CollateralLiquidated(address collateral, uint256 amount)Event emitted when collateral is liquidated
GhoMinted
event GhoMinted(uint256 mintedAmount)Event emitted when GHO is minted
GhoRepayed
event GhoRepayed(uint256 amountToRepay)Event emitted when GHO is repayed
RentedStkAave
event RentedStkAave()Event emitted when stkAAVE is rented by the Pod
UpdatedDelegate
event UpdatedDelegate(address newVotingDelegate, address newProposalDelegate)Event emitted when the Pod delegates are updated
UpdatedRegistry
event UpdatedRegistry(address oldRegistry, address newRegistry)Event emitted when the Pod registry is updated
onlyPodOwner
modifier onlyPodOwner()Check that the caller is the Pod owner
onlyManager
modifier onlyManager()Check that the caller is the manager
isInitialized
modifier isInitialized()Check that the Pod is initialized
constructor
constructor() publicinit
function init(address _manager, address _vault, address _registry, address _podOwner, address _collateral, address _aToken, address _votingPowerDelegate, address _proposalPowerDelegate) externalInitialize the Pod with the given parameters
Parameters
_manager
address
Address of the Manager
_vault
address
Address of the Vault
_registry
address
Address of the Registry
_podOwner
address
Address of the Pod owner
_collateral
address
Address of the collateral
_aToken
address
Address of the aToken for the collateral
_votingPowerDelegate
address
Address of the delegate for the voting power
_proposalPowerDelegate
address
Address of the delegate for the proposal power
podCollateralBalance
function podCollateralBalance() external view returns (uint256)Get the Pod's current collateral balance
Return Values
[0]
uint256
uint256 : Current collateral balance
podDebtBalance
function podDebtBalance() public view returns (uint256)Get the Pod's current GHO debt balance
Return Values
[0]
uint256
uint256 : Current GHO debt balance
podOwedFees
function podOwedFees() external view returns (uint256)Get the stored amount of fees owed by this Pod
Return Values
[0]
uint256
uint256 : Stored amount of fees owed
depositCollateral
function depositCollateral(uint256 amount) externalDeposit collateral
Pull collateral in the Pod to deposit it in the Aave Pool
Parameters
amount
uint256
Amount to deposit
withdrawCollateral
function withdrawCollateral(uint256 amount, address receiver) externalWithdraw collateral
Parameters
amount
uint256
Amount to withdraw
receiver
address
Address to receive the collateral
claimAaveExtraRewards
function claimAaveExtraRewards(address receiver) externalClaim any existing rewards from the Aave Rewards Controller for this Pod
Parameters
receiver
address
Address to receive the rewards
compoundStkAave
function compoundStkAave() externalClaim Safety Module rewards & stake them in stkAAVE
mintGho
function mintGho(uint256 amountToMint, address receiver) external returns (uint256 mintedAmount)Mint GHO & rent stkAAVE
Rent stkAAVE from the Vault & mint GHO with the best interest rate discount possible
Parameters
amountToMint
uint256
Amount of GHO to be minted
receiver
address
Address to receive the minted GHO
Return Values
mintedAmount
uint256
- uint256 : amount of GHO minted after fees
repayGho
function repayGho(uint256 amountToRepay) external returns (bool)Repay GHO fees and debt
Parameters
amountToRepay
uint256
Amount of GHO to de repaid
Return Values
[0]
bool
bool : Success
repayGhoAndWithdrawCollateral
function repayGhoAndWithdrawCollateral(uint256 repayAmount, uint256 withdrawAmount, address receiver) external returns (bool)Repay GHO fees and debt & withdraw collateral
Repay GHO fees & debt to be allowed to withdraw collateral
Parameters
repayAmount
uint256
Amount of GHO to de repaid
withdrawAmount
uint256
Amount to withdraw
receiver
address
Address to receive the collateral
Return Values
[0]
bool
bool : Success
rentStkAave
function rentStkAave() external returns (bool)Rent stkAAVE from the Vault to get the best interest rate reduction
Return Values
[0]
bool
bool : Success
liquidateCollateral
function liquidateCollateral(uint256 amount, address receiver) externalLiquidate Pod collateral to repay owed fees
Liquidate Pod collateral to repay owed fees, in the case the this Pod got liquidated on Aave market, and fees are still owed to Dullahan
Parameters
amount
uint256
Amount of collateral to liquidate
receiver
address
Address to receive the collateral
updateDelegation
function updateDelegation(address newVotingDelegate, address newProposalDelegate) externalUpdate the Pod's delegate address & delegate the voting power to it
Parameters
newVotingDelegate
address
Address of the new voting power delegate
newProposalDelegate
address
Address of the new proposal power delegate
updateRegistry
function updateRegistry(address newRegistry) externalUpdate the Pod's Registry address
Parameters
newRegistry
address
Address of the new Registry
_withdrawCollateral
function _withdrawCollateral(uint256 amount, address receiver) internalWithdraw collateral from the Aave Pool directly to the given receiver (only if Pod fees are fully repaid)
Parameters
amount
uint256
Amount to withdraw
receiver
address
Address to receive the collateral
_repayGho
function _repayGho(uint256 amountToRepay) internal returns (bool)Repay GHO owed fees & debt (fees in priority)
Parameters
amountToRepay
uint256
Amount of GHO to be repayed
Return Values
[0]
bool
bool : Success
_getStkAaveRewards
function _getStkAaveRewards() internalClaim AAVE rewards from the Safety Module & stake them to receive stkAAVE & notify the Manager
Last updated
Was this helpful?