Mars Protocol
Search…
πŸ“«
Address Provider
The Address Provider contract holds addresses of the main contracts of the core protocol.

Links

Config

Key
Type
Description
owner
CanonicalAddr
Contract owner
council_address
CanonicalAddr
Council contract address
incentives_address
CanonicalAddr
Incentives contract address
safety_fund_address
CanonicalAddr
Safety fund contract address
mars_token_address
CanonicalAddr
Mars token address
oracle_address
CanonicalAddr
Oracle address
protocol_admin_address
CanonicalAddr
Protocol admin address (admin for all the contracts)
protocol_rewards_collector_address
CanonicalAddr
Protocol Rewards Collector address
red_bank_address
CanonicalAddr
Red bank contract address
staking_address
CanonicalAddr
Staking contract address
treasury_address
CanonicalAddr
Treasury contract address
vesting_address
CanonicalAddr
Vesting contract address
xmars_token_address
CanonicalAddr
xMars token address

MarsContract

Contracts from Mars protocol.
#[derive(Serialize, Deserialize, Clone, Debug, PartialEq, JsonSchema)]
pub enum MarsContract {
Council,
Incentives,
SafetyFund,
MarsToken,
Oracle,
ProtocolAdmin,
ProtocolRewardsCollector,
RedBank,
Staking,
Treasury,
Vesting,
XMarsToken
}

InstantiateMsg

Rust
JSON
#[derive(Serialize, Deserialize, Clone, Debug, PartialEq, JsonSchema)]
pub struct InstantiateMsg {
pub owner: String
}
{
"owner": "terra...",
}
Key
Type
Description
owner
String
Contract owner

ExecuteMsg

UpdateConfig

Update address provider config.
Rust
JSON
#[derive(Serialize, Deserialize, Clone, Debug, PartialEq, JsonSchema)]
#[serde(rename_all = "snake_case")]
pub enum ExecuteMsg {
UpdateConfig {
config: ConfigParams
}
}
{
"update_config": {
"config": {
"owner": "terra...",
"council_address": "terra...",
"incentives_address": "terra...",
"safety_fund_address": "terra...",
"mars_token_address": "terra...",
"oracle_address": "terra...",
"protocol_admin_address": "terra...",
"protocol_rewards_collector_address": "terra...",
"red_bank_address": "terra...",
"staking_address": "terra...",
"treasury_address": "terra...",
"vesting_address": "terra...",
"xmars_token_address": "terra..."
}
}
}

ConfigParams

#[derive(Serialize, Deserialize, Clone, Debug, Default, PartialEq, JsonSchema)]
pub struct ConfigParams {
pub owner: Option<String>,
pub council_address: Option<String>,
pub incentives_address: Option<String>,
pub safety_fund_address: Otion<String>,
pub mars_token_address: Option<String>,
pub oracle_address: Option<String>,
pub protocol_admin_address: Option<String>,
pub protocol_rewards_collector_address: Option<String>,
pub red_bank_address: Option<String>,
pub staking_address: Option<String>,
pub treasury_address: Option<String>,
pub vesting_address: Option<String>,
pub xmars_token_address: Option<String>
}
Key
Type
Description
owner*
String
Contract owner (has special permissions to update parameters)
council_address*
String
Council contract handles the submission and execution of proposals
incentives_address*
String
Incentives contract handles incentives to depositors on the red bank
safety_fund_address*
String
Safety fund contract accumulates UST to protect the protocol from shortfall events
mars_token_address*
String
Mars token cw20 contract
oracle_address*
String
Oracle contract provides prices in uusd for assets used in the protocol
protocol_admin_address*
String
Protocol admin is the Cosmos level contract admin that has permissions to migrate contracts
protocol_rewards_collector_address*
String
Protocol Rewards Collector receives and distributes protocl rewards
red_bank_address*
String
Red Bank contract handles user's depositing/borrowing and holds the protocol's liquidity
staking_address*
String
Staking address handles Mars staking and xMars minting
treasury_address*
String
Treasury contract accumulates protocol fees that can be spent by the council through the voting of proposals
vesting_address*
String
Vesting contract
xmars_token_address*
String
xMars token cw20 contract
* = optional

QueryMsg

Config

Get contract config.
Rust
JSON
#[derive(Serialize, Deserialize, Clone, Debug, PartialEq, JsonSchema)]
#[serde(rename_all = "snake_case")]
pub enum QueryMsg {
Config {}
}
{
"config": {}
}

Address

Get a single address.
Rust
JSON
#[derive(Serialize, Deserialize, Clone, Debug, PartialEq, JsonSchema)]
#[serde(rename_all = "snake_case")]
pub enum QueryMsg {
Address {
contract: MarsContract
}
}
{
"address": {
"contract": "..."
}
}
Key
Type
Description
contract
String
Contract to query address

Addresses

Get a list of addresses.
Rust
JSON
#[derive(Serialize, Deserialize, Clone, Debug, PartialEq, JsonSchema)]
#[serde(rename_all = "snake_case")]
pub enum QueryMsg {
Addresses {
contracts: Vec<MarsContract>
}
}
{
"addresses": {
"contracts": [
["..."],
["..."]
]
}
}
Key
Type
Description
contracts
Vec<MarsContract>
Vector of Mars contracts to query addresses for
Copy link
On this page
Links
Config
MarsContract
InstantiateMsg
ExecuteMsg
UpdateConfig
ConfigParams
QueryMsg
Config
Address
Addresses