Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Release v2.2.x #82

Merged
merged 25 commits into from
Jan 10, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
25 commits
Select commit Hold shift + click to select a range
ea414ec
new mirror_admin_manager contract
csanti Oct 20, 2021
138d6ab
integrate admin_manager with governance, multiple poll types with dif…
csanti Nov 30, 2021
35ba077
add the hability to change the mir-ust pair on collector
csanti Nov 30, 2021
45654af
add collector migration logic
csanti Nov 30, 2021
870035f
feat: ability to deprecate a staking token
csanti Dec 1, 2021
f7e3ad0
add migration loogic for staking pool_infos
csanti Dec 1, 2021
c4a45eb
feat: integrate collateral_oracle with new tefi_oracle
csanti Dec 1, 2021
ad978b7
fix test and typos, closes #77
csanti Dec 1, 2021
da52940
feat: integrate mint contract with new oracle and preIPO mech
csanti Dec 1, 2021
66f0e18
feat: update mAsset whitelisting process to use new oracle and preIPO…
csanti Dec 1, 2021
51e9561
chore: update admin_manager schema
csanti Dec 1, 2021
02959ae
chore: fmt and clippy
csanti Dec 1, 2021
49bbce1
chore: fmt, clippy and generate schemas
csanti Dec 1, 2021
89dab55
Merge pull request #80 from Mirror-Protocol/dev/astroport-mir-incentives
csanti Dec 1, 2021
23825e4
Merge pull request #81 from Mirror-Protocol/dev/decentralization
csanti Dec 1, 2021
dadf0c3
fix(col_oracle): change is_revoked migration to consider rewly revoke…
csanti Dec 16, 2021
871b7df
fix(col_oracle): add missing migrate_config funtion to migration entr…
csanti Dec 16, 2021
8787915
fix(gov): minor fixes
csanti Dec 16, 2021
0f38091
make gov update_config an admin action
csanti Dec 20, 2021
e47fa0d
chore: fmt & clippy fixes
csanti Dec 20, 2021
3ed3a76
fix typos
csanti Dec 22, 2021
79201f9
gov: add poll_gas_limit parameter to prevent ghost failed polls
csanti Dec 26, 2021
ce68f98
gov: add unit tests for new poll configs
csanti Dec 26, 2021
6123f1d
migrate MIR-UST pair on contract migration (collector, staking) + add…
csanti Dec 28, 2021
e6c0b79
fix: modify bond migration check to have new addresses marked as migr…
csanti Jan 5, 2022
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions contracts/mirror_admin_manager/.cargo/config
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
[alias]
wasm = "build --release --target wasm32-unknown-unknown"
wasm-debug = "build --target wasm32-unknown-unknown"
unit-test = "test --lib"
integration-test = "test --test integration"
schema = "run --example schema"
47 changes: 47 additions & 0 deletions contracts/mirror_admin_manager/Cargo.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
[package]
name = "mirror-admin-manager"
version = "2.1.1"
authors = ["Terraform Labs, PTE."]
edition = "2018"
description = "Admin manager contract for Mirror Protocol - holds and manages admin privileges for Mirror contracts"
license = "Apache-2.0"

exclude = [
# Those files are rust-optimizer artifacts. You might want to commit them for convenience but they should not be part of the source code publication.
"contract.wasm",
"hash.txt",
]

# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html

[lib]
crate-type = ["cdylib", "rlib"]

[profile.release]
opt-level = 3
debug = false
rpath = false
lto = true
debug-assertions = false
codegen-units = 1
panic = 'abort'
incremental = false
overflow-checks = true

[features]
# for quicker tests, cargo test --lib
# for more explicit tests, cargo test --features=backtraces
backtraces = ["cosmwasm-std/backtraces"]

[dependencies]
cw20 = { version = "0.8.0" }
cosmwasm-std = { version = "0.16.0", features = ["iterator"] }
cosmwasm-storage = { version = "0.16.0", features = ["iterator"] }
mirror-protocol = { version = "2.1.1", path = "../../packages/mirror_protocol" }
schemars = "0.8.1"
serde = { version = "1.0.103", default-features = false, features = ["derive"] }
cw-storage-plus = { version = "0.8.0", features = ["iterator"]}
thiserror = { version = "1.0.20" }

[dev-dependencies]
cosmwasm-schema = "0.16.0"
1 change: 1 addition & 0 deletions contracts/mirror_admin_manager/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
# Mirror Admin Manager <!-- omit in toc -->
23 changes: 23 additions & 0 deletions contracts/mirror_admin_manager/examples/schema.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
use std::env::current_dir;
use std::fs::create_dir_all;

use cosmwasm_schema::{export_schema, remove_schemas, schema_for};

use mirror_protocol::admin_manager::{
AuthRecordResponse, ConfigResponse, ExecuteMsg, InstantiateMsg, MigrationRecordResponse,
QueryMsg,
};

fn main() {
let mut out_dir = current_dir().unwrap();
out_dir.push("schema");
create_dir_all(&out_dir).unwrap();
remove_schemas(&out_dir).unwrap();

export_schema(&schema_for!(InstantiateMsg), &out_dir);
export_schema(&schema_for!(ExecuteMsg), &out_dir);
export_schema(&schema_for!(QueryMsg), &out_dir);
export_schema(&schema_for!(ConfigResponse), &out_dir);
export_schema(&schema_for!(AuthRecordResponse), &out_dir);
export_schema(&schema_for!(MigrationRecordResponse), &out_dir);
}
15 changes: 15 additions & 0 deletions contracts/mirror_admin_manager/rustfmt.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
# stable
newline_style = "unix"
hard_tabs = false
tab_spaces = 4

# unstable... should we require `rustup run nightly cargo fmt` ?
# or just update the style guide when they are stable?
#fn_single_line = true
#format_code_in_doc_comments = true
#overflow_delimited_expr = true
#reorder_impl_items = true
#struct_field_align_threshold = 20
#struct_lit_single_line = true
#report_todo = "Always"

25 changes: 25 additions & 0 deletions contracts/mirror_admin_manager/schema/auth_record_response.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
{
"$schema": "http://json-schema.org/draft-07/schema#",
"title": "AuthRecordResponse",
"type": "object",
"required": [
"address",
"end_time",
"start_time"
],
"properties": {
"address": {
"type": "string"
},
"end_time": {
"type": "integer",
"format": "uint64",
"minimum": 0.0
},
"start_time": {
"type": "integer",
"format": "uint64",
"minimum": 0.0
}
}
}
19 changes: 19 additions & 0 deletions contracts/mirror_admin_manager/schema/config_response.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
{
"$schema": "http://json-schema.org/draft-07/schema#",
"title": "ConfigResponse",
"type": "object",
"required": [
"admin_claim_period",
"owner"
],
"properties": {
"admin_claim_period": {
"type": "integer",
"format": "uint64",
"minimum": 0.0
},
"owner": {
"type": "string"
}
}
}
110 changes: 110 additions & 0 deletions contracts/mirror_admin_manager/schema/execute_msg.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,110 @@
{
"$schema": "http://json-schema.org/draft-07/schema#",
"title": "ExecuteMsg",
"oneOf": [
{
"type": "object",
"required": [
"update_owner"
],
"properties": {
"update_owner": {
"type": "object",
"required": [
"owner"
],
"properties": {
"owner": {
"type": "string"
}
}
}
},
"additionalProperties": false
},
{
"type": "object",
"required": [
"execute_migrations"
],
"properties": {
"execute_migrations": {
"type": "object",
"required": [
"migrations"
],
"properties": {
"migrations": {
"type": "array",
"items": {
"type": "array",
"items": [
{
"type": "string"
},
{
"type": "integer",
"format": "uint64",
"minimum": 0.0
},
{
"$ref": "#/definitions/Binary"
}
],
"maxItems": 3,
"minItems": 3
}
}
}
}
},
"additionalProperties": false
},
{
"type": "object",
"required": [
"authorize_claim"
],
"properties": {
"authorize_claim": {
"type": "object",
"required": [
"authorized_addr"
],
"properties": {
"authorized_addr": {
"type": "string"
}
}
}
},
"additionalProperties": false
},
{
"type": "object",
"required": [
"claim_admin"
],
"properties": {
"claim_admin": {
"type": "object",
"required": [
"contract"
],
"properties": {
"contract": {
"type": "string"
}
}
}
},
"additionalProperties": false
}
],
"definitions": {
"Binary": {
"description": "Binary is a wrapper around Vec<u8> to add base64 de/serialization with serde. It also adds some helper methods to help encode inline.\n\nThis is only needed as serde-json-{core,wasm} has a horrible encoding for Vec<u8>",
"type": "string"
}
}
}
19 changes: 19 additions & 0 deletions contracts/mirror_admin_manager/schema/instantiate_msg.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
{
"$schema": "http://json-schema.org/draft-07/schema#",
"title": "InstantiateMsg",
"type": "object",
"required": [
"admin_claim_period",
"owner"
],
"properties": {
"admin_claim_period": {
"type": "integer",
"format": "uint64",
"minimum": 0.0
},
"owner": {
"type": "string"
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
{
"$schema": "http://json-schema.org/draft-07/schema#",
"title": "MigrationRecordResponse",
"type": "object",
"required": [
"executor",
"migrations",
"time"
],
"properties": {
"executor": {
"type": "string"
},
"migrations": {
"type": "array",
"items": {
"$ref": "#/definitions/MigrationItem"
}
},
"time": {
"type": "integer",
"format": "uint64",
"minimum": 0.0
}
},
"definitions": {
"Binary": {
"description": "Binary is a wrapper around Vec<u8> to add base64 de/serialization with serde. It also adds some helper methods to help encode inline.\n\nThis is only needed as serde-json-{core,wasm} has a horrible encoding for Vec<u8>",
"type": "string"
},
"MigrationItem": {
"type": "object",
"required": [
"contract",
"msg",
"new_code_id"
],
"properties": {
"contract": {
"type": "string"
},
"msg": {
"$ref": "#/definitions/Binary"
},
"new_code_id": {
"type": "integer",
"format": "uint64",
"minimum": 0.0
}
}
}
}
}
Loading