Module: controller
This CosmosWasm module is used to execute privileged messages in the Nibiru perp module (see for more details), which can only be executed if the contract has been added to the sudo module. This module also maintains a whitelist of addresses that are allowed to execute the messages in this contract as well as the address of the current admin.
The InsuranceFundWithdraw
, SetMarketEnabled
, and EditOracleParams
messages are simple wrappers that first check if the sender is a member of the whitelist, and if so, they forward the message.
The AddMember
, RemoveMember
, and ChangeAdmin
messages are used to update the whitelist and admin of this module and can only be performed by the current admin. For each message the new address is first validated, then the members list is updated or the admin is changed. When the admin is changed, the new admin is removed from the list of members.
The entry points are
ExecuteMsg::InsuranceFundWithdraw
— with controllable parametersamount
andto
ExecuteMsg::SetMarketEnabled
— with controllable parameterspair
andenabled
ExecuteMsg::EditOracleParams
— with controllable parametersvote_period
,vote_threshold
,reward_band
,whitelist
,slash_fraction
,slash_window
,min_valid_per_window
,twap_lookback_window
,min_voters
, andvalidator_fee_ratio
ExecuteMsg::AddMember
— with controllable parameteraddress
ExecuteMsg::RemoveMember
— with controllable parameteraddress
ExecuteMsg::ChangeAdmin
— with controllable parameteraddress