Ownable
design pattern used in three functions:claimRewardsFor()
,updateRewardsBalance()
andupdatePeriodReward()
.updateRewardsBalance()
andupdatePeriodReward()
are called only by the contract creator to update the reward airdrop for a specific period, i.e.claimRewardsFor()
is onwned by the admin contractHelperAdmin
and is called by the external functionclaimRewards
, this is design that way so the user can claim the rewards from all the vault type he's part of in one transaction instead of doing one transaction by vault type.
HelperAdmin
andVaultLongMaiFinanceBase
contracts inherits the OpenZeppelinOwnable
contract to enable ownership for one managing user/party.VaultLongMaiFinanceBase
is an abstract contract and all the vault types such asWethVaultLong
,GhstVaultLong
etc... inherits from it.
VaultLongMaiFinanceBase
make use extensivly of the Mai finance vaults contracts since this protocol is built on top of it i.eIERC20StableCoin(maiVault).createVault()
, it also uses aave flash loans contracts.
- Only one variable is upgradable by the owner :
balanceRewardsByPeriod
which specify how much rewards are to be distributed for a specific period.