Ownabledesign 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 contractHelperAdminand 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.
HelperAdminandVaultLongMaiFinanceBasecontracts inherits the OpenZeppelinOwnablecontract to enable ownership for one managing user/party.VaultLongMaiFinanceBaseis an abstract contract and all the vault types such asWethVaultLong,GhstVaultLongetc... inherits from it.
VaultLongMaiFinanceBasemake 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 :
balanceRewardsByPeriodwhich specify how much rewards are to be distributed for a specific period.