Corecontract keeps track of all the
StableMastercontracts associated to the different stablecoins of the protocol. Its main role is to facilitate governance and to allow changes at the level of the protocol (like a change in a governance address) to be propagated across all the underlying contracts of the protocol.
Corewhich then propagates this change to all the
StableMastercontracts of the protocol. Each
StableMasterthen notifies the
AgTokencontract it relates to as well as all the
Corecontract is however not linked to all the contracts of the protocol. Among other things, The following functions do not propagate the changes they induce to some bricks of the protocol like the
BondingCurve, the staking and rewards distribution contracts and the oracle contracts using Uniswap. Governance should be wary when calling these functions and make equivalent changes in these contracts to maintain consistency at the scale of the protocol.
setCorefunction in governance can call in the
_governorList: List of all the governor addresses of Angle's protocol. Initially, only the timelock will be appointed governor but it may not be the only one
guardian: Address of the guardian of the protocol
_stablecoinList: List of all the stablecoins accepted by the system represented with the address of the corresponding
governorMap: Map to track the addresses with a
GOVERNOR_ROLEwithin Angle protocol. It has been defined to facilitate the Access Control logic in the
deployedStableMasterMap: Map to track the addresses of the
stableMastercontracts that have already been deployed. This is used to avoid deploying a revoked
stableMastercontract again and hence potentially creating inconsistencies in the
grantRole / revokeRole. Custom modifiers have thus been defined to act as equivalents to OpenZeppelin modifiers
Corecontract of the protocol, thus making the current
Corecontract useless. The governance of the new
Corecontract should be exactly the same of this one.
newCore: Address of the new
StableMastercontract corresponding to the
AgTokenis automatically retrieved. The
StableMasterreceives the reference to the governor and guardian addresses of the protocol.
StableMastercontracts should have previously been initialized with correct references in it, with for the
StableMastera reference to the
Corecontract and for the
AgTokena reference to the
agToken: Address of the new
StableMastercontract. This function just removes a
StableMastercontract from the
stablecoinList. The consequence is that the
StableMastercontract will no longer be affected by changes in governor or guardian occuring from the protocol
stableMaster: Address of the
Corecontract has the ability to add a new governor or remove a governor from the system and propagate this change across all underlying contracts of the protocol. The two functions existing governors can interact with to do that are:
removeGovernor: there must however always be one remaining governor in the protocol
Corecontract. The guardian is indeed able to transfer its power to another address or to revoke itself. Changing or revoking a guardian from the
Corewill automatically echo this change across all core modules of the protocol.
Corecontract implements a getter
_governorList: this is used in different places of the protocol, notably when a new collateral is deployed, for the
StableMasterto fetch correct info about the governors of the protocol.
_stablecoinList: a getter called
stablecoinList()has been implemented.