TermMax 角色
This document outlines the various roles defined in the TermMax protocol, their responsibilities, and the specific functions each role controls.
Core Roles for Access Control
1. Default Admin (DEFAULT_ADMIN_ROLE)
DEFAULT_ADMIN_ROLE)Description: The highest administrative role with privileges to manage other roles and system-critical operations.Controlled Functions:
Gearing Token (GT)
Set Gearing Token Implementation
// AccessManager.sol function setGtImplement(ITermMaxFactory factory, string memory gtImplementName, address gtImplement) external onlyRole(DEFAULT_ADMIN_ROLE)Updates the Gearing Token implementation reference in the factory.
Market
Create and deploy new markets
// AccessManager.sol function createMarket( ITermMaxFactory factory, bytes32 gtKey, MarketInitialParams calldata deployParams, uint256 salt ) external onlyRole(DEFAULT_ADMIN_ROLE) returns (address market)Deploys new markets
Ownership
Transfer ownership of an contract
Transfers ownership of ownable contracts
Accept ownership of an contract
Accepts ownership of contracts
Upgradability
Upgrade contracts
Upgrades proxies using UUPS pattern
Contract Integration
Whitelist external adapters for contract integrations
Controls which swap adapters are allowed
Oracles
Update oracle source for an asset
Submits new oracles
Accept new submitted oracle source for an asset
Accepts pending oracles
2. Pauser (PAUSER_ROLE)
PAUSER_ROLE)Description: Role with permissions to pause/unpause contracts as a safety measure during emergencies.Controlled Functions:
Pause or Unpause a pausable contract
Pauses or unpauses protocol functionalities
3. Configurator (CONFIGURATOR_ROLE)
CONFIGURATOR_ROLE)Description: Role with permissions to configure aspects of the system such as market parameters and fee settings.Controlled Functions:
Update market config including treasury address and fee configs
Updates market configuration
Update Gearing Token (GT) config to set collateral capacity
Updates Gearing Token configuration
Update fee rate of an specific order
Updates fee rates for orders
4. Vault Admin (VAULT_ROLE)
VAULT_ROLE)Description: Role with specific permissions to manage vaults.Controlled Functions:
Submit a new guaridan to a vault for apending apprvoval
Revoke the pending guradian of a vault
Revoke the pending timelock settings of a vault
Revoke the pending market to be whitelisted of a vault
Set and update curator to a vault
Set and whitelist allocators of a vault
Vault-Specific Roles
Curator
Description: Role responsible for managing vault market relationships and parameters.Controlled Functions:
Create an order under the vault
Update multiple orders including the rates and supplies
Redeem Fixed-Rate Tokens (FT) of the order after maturity
Withdraw the performance fee
Submit a new timelock to be accepted after the original timelock
Set and update the capacity of the vault
Submit the new performance fee rate to be accepted after timelock
Submit and whitelist a new market to be accepted after timelock
All allocator functions (acts as a super-allocator)
Guardian
Description: A protective role for vaults with permissions to approve or prevent sensitive operations.Controlled Functions:
Revoke the new submitted timelock
Revoke the new submitted guradian
Revoke the new submitted market to be whitelisted
Revoke the new submitted performance fee
Allocator
Description: Role responsible for managing funds allocation within vaults.Controlled Functions:
Update the order of supply queue
Update the order of withdraw queue
Architecture


