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.
1
#[derive(Serialize, Deserialize, Clone, Debug, PartialEq, JsonSchema)]
2
pub enum MarsContract {
3
Council,
4
Incentives,
5
SafetyFund,
6
MarsToken,
7
Oracle,
8
ProtocolAdmin,
9
ProtocolRewardsCollector,
10
RedBank,
11
Staking,
12
Treasury,
13
Vesting,
14
XMarsToken
15
}
Copied!

InstantiateMsg

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

ExecuteMsg

UpdateConfig

Update address provider config.
Rust
JSON
1
#[derive(Serialize, Deserialize, Clone, Debug, PartialEq, JsonSchema)]
2
#[serde(rename_all = "snake_case")]
3
pub enum ExecuteMsg {
4
UpdateConfig {
5
config: ConfigParams
6
}
7
}
Copied!
1
{
2
"update_config": {
3
"config": {
4
"owner": "terra...",
5
"council_address": "terra...",
6
"incentives_address": "terra...",
7
"safety_fund_address": "terra...",
8
"mars_token_address": "terra...",
9
"oracle_address": "terra...",
10
"protocol_admin_address": "terra...",
11
"protocol_rewards_collector_address": "terra...",
12
"red_bank_address": "terra...",
13
"staking_address": "terra...",
14
"treasury_address": "terra...",
15
"vesting_address": "terra...",
16
"xmars_token_address": "terra..."
17
}
18
}
19
}
Copied!

ConfigParams

1
#[derive(Serialize, Deserialize, Clone, Debug, Default, PartialEq, JsonSchema)]
2
pub struct ConfigParams {
3
pub owner: Option<String>,
4
pub council_address: Option<String>,
5
pub incentives_address: Option<String>,
6
pub safety_fund_address: Otion<String>,
7
pub mars_token_address: Option<String>,
8
pub oracle_address: Option<String>,
9
pub protocol_admin_address: Option<String>,
10
pub protocol_rewards_collector_address: Option<String>,
11
pub red_bank_address: Option<String>,
12
pub staking_address: Option<String>,
13
pub treasury_address: Option<String>,
14
pub vesting_address: Option<String>,
15
pub xmars_token_address: Option<String>
16
}
Copied!
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
1
#[derive(Serialize, Deserialize, Clone, Debug, PartialEq, JsonSchema)]
2
#[serde(rename_all = "snake_case")]
3
pub enum QueryMsg {
4
Config {}
5
}
Copied!
1
{
2
"config": {}
3
}
Copied!

Address

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

Addresses

Get a list of addresses.
Rust
JSON
1
#[derive(Serialize, Deserialize, Clone, Debug, PartialEq, JsonSchema)]
2
#[serde(rename_all = "snake_case")]
3
pub enum QueryMsg {
4
Addresses {
5
contracts: Vec<MarsContract>
6
}
7
}
Copied!
1
{
2
"addresses": {
3
"contracts": [
4
["..."],
5
["..."]
6
]
7
}
8
}
Copied!
Key
Type
Description
contracts
Vec<MarsContract>
Vector of Mars contracts to query addresses for