Search…
Admin Manager
Admin Manager contract is owned by Gov contract, and is responsible for executing contract migrations and admin key transfers, which are used in order to execute time sensitive migrations such as Terra's columbus network upgrades.
All operations in admin manager contract can only be executed by submitting and executing a poll on Mirror governance (one of migration_poll or auth_admin_poll).

Config

Key
Type
Description
owner
String
Address of owner of admin manager (Gov contract)
admin_claim_period
u64
The duration of admin privilege delegation to a defined address when AuthorizeClaim occurs.

InstantiateMsg

1
#[derive(Serialize, Deserialize, Clone, Debug, PartialEq, JsonSchema)]
2
pub struct InstantiateMsg {
3
pub owner: String,
4
pub admin_claim_period: u64,
5
}
Copied!
Key
Type
Description
owner
String
Address of owner of admin manager (Gov contract)
admin_claim_period
u64
The duration of admin privilege delegation to a defined address when AuthorizeClaim occurs

ExecuteMsg

UpdateOwner

Replaces the owner address of the admin manager contract to a new one
Rust
JSON
1
#[derive(Serialize, Deserialize, Clone, Debug, PartialEq, JsonSchema)]
2
#[serde(rename_all = "snake_case")]
3
pub enum ExecuteMsg {
4
UpdateOwner {
5
owner: String,
6
}
Copied!
Key
Type
Description
owner
String
Address of the owner of admin manager
1
{
2
"update_owner": {
3
"owner": "terra1..."
4
}
5
}
Copied!
Key
Type
Description
owner
String
Address of the owner of admin manager

ExecuteMigrations

Contract migration is executed when the Gov contract sends an ExecuteMigrations message.
Rust
JSON
1
#[derive(Serialize, Deserialize, Clone, Debug, PartialEq, JsonSchema)]
2
#[serde(rename_all = "snake_case")]
3
pub enum ExecuteMsg {
4
ExecuteMigrations {
5
migrations: Vec<(String, u64, Binary)>,
6
},
Copied!

migrations

Type
Description
String
Address of the current Mirror contract to be migrated
u64
Token code ID of the new contracts
Binary
Migration execution message
1
{
2
"execute_migrations": {
3
"migrations": [
4
("terra1...", 123, eBdwav...),
5
("terra1...", 123, eBdwav...)
6
]
7
}
8
}
Copied!

migrations

Type
Description
String
Address of the current Mirror contract to be migrated
u64
Token code ID of the new contracts
Binary
Migration execution message

AuthorizeClaim

Delegates admin privileges to migrate contracts to a specified address until admin_claim_period ends.
Rust
JSON
1
#[derive(Serialize, Deserialize, Clone, Debug, PartialEq, JsonSchema)]
2
#[serde(rename_all = "snake_case")]
3
pub enum ExecuteMsg {
4
AuthorizeClaim {
5
authorized_addr: String,
6
},
Copied!
Key
Type
Description
authorized_addr
String
Address to temporarily delegate the admin privilege to
1
{
2
"authorize_claim": {
3
"authrized_addr": "terra1..."
4
}
5
}
Copied!
Key
Type
Description
authorized_addr
String
Address to temporarily delegate the admin privilege to

ClaimAdmin

Once AuthorizeClaim is executed, the authorized_addr can send this transaction to claim the rights to the admin keys until the admin_claim_period ends.
Rust
JSON
1
#[derive(Serialize, Deserialize, Clone, Debug, PartialEq, JsonSchema)]
2
#[serde(rename_all = "snake_case")]
3
pub enum ExecuteMsg {
4
ClaimAdmin {
5
contract: String,
6
},
Copied!
Key
Type
Description
contract
String
Address of contracts that the authorized_addr has right to migrate
1
{
2
"claim_admin": {
3
"contract": "terra1..."
4
}
5
}
Copied!
Key
Type
Description
contract
String
Address of contracts that the authorized_addr has right to migrate

QueryMsg

Config

Returns the configuration of the admin manager contract
Rust
JSON
1
#[derive(Serialize, Deserialize, Clone, Debug, PartialEq, JsonSchema)]
2
#[serde(rename_all = "snake_case")]
3
pub enum QueryMsg {
4
Config {},
Copied!

ConfigResponse

1
#[derive(Serialize, Deserialize, Clone, Debug, PartialEq, JsonSchema)]
2
pub struct ConfigResponse {
3
pub owner: String,
4
pub admin_claim_period: u64,
5
}
Copied!
Key
Type
Description
owner
String
Address of the owner of admin manager contract (Gov contract)
admin_claim_period
String
Length of time which the admin key is claimed and used for (in seconds)
1
{
2
"config": {}
3
}
Copied!

ConfigResponse

1
{
2
"config_response": {
3
"owner": "terra1...",
4
"admin_claim_period": 8
5
}
6
}
Copied!
Key
Type
Description
owner
String
Address of the owner of admin manager contract (Gov contract)
admin_claim_period
u64
Length of time which the admin key is claimed and used for (in seconds)

MigrationRecords

Returns the history of execute_migrations records.
Rust
JSON
1
#[derive(Serialize, Deserialize, Clone, Debug, PartialEq, JsonSchema)]
2
#[serde(rename_all = "snake_case")]
3
pub enum QueryMsg {
4
MigrationRecords {
5
start_after: Option<u64>, // timestamp (seconds)
6
limit: Option<u32>,
7
},
Copied!
Key
Type
Description
start_after
u64
Optional timestamp to return the migration history from
limit
u32
Max number of migration records to return

Response

1
#[derive(Serialize, Deserialize, Clone, Debug, PartialEq, JsonSchema)]
2
pub struct MigrationRecordResponse {
3
pub executor: String,
4
pub time: u64,
5
pub migrations: Vec<MigrationItem>,
6
}
Copied!
Key
Type
Description
executor
String
Address of the migration executor
time
u64
UNIX timestamp of when the migration was executed
migrations
MigrationItem
Migration specific details including migrated contract address, token code ID and binary message used for the migration.
1
{
2
"migration_records": {
3
"start_after": 12341234,
4
"limit": 8
5
}
6
}
Copied!
Key
Type
Description
start_after
u64
Optional timestamp to return the migration history from
limit
u32
Max number of migration records to return

Response

1
{
2
"executor": "terra1...",
3
"time": 12341234,
4
"migrations": {
5
"contract": "terra1...",
6
"new_code_id": 234,
7
"msg": "evDw12549..."
8
}
9
}
Copied!
Key
Type
Description
executor
String
Address of the migration executor
time
u64
UNIX timestamp of when the migration was executed
migrations
Vec<MigrationItem>
Migration specific details including migrated contract address, token code ID and binary message used for the migration

AuthRecords

Returns the history of AuthorizeClaim transactions
Rust
JSON
1
#[derive(Serialize, Deserialize, Clone, Debug, PartialEq, JsonSchema)]
2
#[serde(rename_all = "snake_case")]
3
pub enum QueryMsg {
4
AuthRecords {
5
start_after: Option<u64>, // timestamp (seconds)
6
limit: Option<u32>,
7
},
Copied!
Key
Type
Description
start_after
u64
Optional timestamp of when to return the history from
limit
u32
Max number of records to return

Response

1
#[derive(Serialize, Deserialize, Clone, Debug, PartialEq, JsonSchema)]
2
pub struct AuthRecordResponse {
3
pub address: String,
4
pub start_time: u64,
5
pub end_time: u64,
6
}
Copied!
Key
Type
Description
address
String
The address at which the admin key was authorized to
start_time
u64
UNIX timestamp of when the admin_claim_period started
end_time
u64
UNIX timestamp of when the admin_claim_period ended
1
{
2
"auth_records": {
3
"start_after": 12341234,
4
"limit": 8
5
}
6
}
Copied!
Key
Type
Description
start_after
u64
Optional timestamp of when to return the history from
limit
u32
Max number of records to return

Response

1
{
2
"address": "terra1...",
3
"start_time": 12341234,
4
"end_time": 12341234
5
}
Copied!
Key
Type
Description
address
String
The address which the admin key was authorized to
start_time
u64
UNIX timestamp of when the admin_claim_period started
end_time
u64
UNIX timestamp of when the admin_claim_period ended