Global Configuration
Overview
The global_config
module handles access control for vaults and strategies.
satay
is a friend of global_config
, and can access its friend-only functions.
Global Config
The GlobalConfig
struct stores information about the dao_admin
and governor
accounts.
The initialize
function is called by satay::initialize
and creates the GlobalConfig
object with @satay
as dao_admin_address
and new_governance_address
. The function asserts that signer::address_of(satay_admin) == @satay
.
The governance_address
account - the governor
- has the ability to call initialize_vault
, initialize_strategy
, and set_governance
on the global_config
module. On the satay
module, the governor
can call new_vault
, update_vault_fee
, and approve_strategy
. Additionally, the governor
has access to all of the functions of the vault_manager
, strategist
, and the keeper
detailed later.
The dao_admin_address
account - the dao_admin
- has the ability to withdraw CoinType
from satay::dao_storage::Storage<CoinType>
storage and update the dao_admin_address
.
Vault Config
The VaultConfig
struct stores information about the vault_manager
of Vault<BaseCoin>
The initialize_vault<BaseCoin>
function is called by satay::new_vault<BaseCoin>
to create the VaultConfig<BaseCoin>
resource, which can only be called by the governor
.
The vault_manager
can call set_vault_manager
function on the global_config
module, as well as base_strategy:update_debt_ratio
, base_strategy::update_credit_threshold
, and base_strategy::force_harvest_trigger_once
. Additionally, the vault_manager
has access to all of the functions of the strategist
and keeper
.
StrategyConfig
The StrategyConfig
struct stores information about the strategist
and keeper
for StrategyType
on Vault<BaseCoin>
. The BaseCoin
type is required as multiple vaults with a different BaseCoin
may utilize the same strategy.
The initialize_strategy<StrategyType, BaseCoin>
function is called by satay::approve_strategy<StrategyType, BaseCoin>
to create the StrategyConfig<StrategyType, BaseCoin>
resource, and can only be called by the governor
.
The strategist
can call set_strategist
on the global_config
module, as well as base_strategy::update_max_report_delay
. Additionally, the strategies
has access to all of the functions of the keeper
.
The keeper
function can call the set_keeper
function on the global_config
module, as well as harvest
and tend
on strategies.
Assertions
assert_dao_admin
passes if the signer is dao_admin
, aborts otherwise. Called by dao_storage::withdraw
.
assert_governance
passes if the signer is the governor
, aborts otherwise.
assert_vault_manager
passes if the signer is the governor
or vault_manager
of the Vault
for BaseCoin
, aborts otherwise.
assert_strategist
passes if the signer is the governor
, vault_manager
, or strategist
, aborts otherwise.
assert_keeper
passes if the signer is the governor
, vault_manager
, strategist
, or keeper
, aborts otherwise.
Last updated