From 1599890f39b6810cf45528d711e716d22e767daa Mon Sep 17 00:00:00 2001 From: Sturdy <91910406+apollo-sturdy@users.noreply.github.com> Date: Thu, 23 Mar 2023 15:25:57 +0100 Subject: [PATCH 01/17] feat: Add original swapper contract --- .github/workflows/artifacts.yml | 37 + .github/workflows/coverage.yml | 44 + .github/workflows/main.yml | 46 + .github/workflows/scripts.yml | 57 + .gitignore | 30 + CHANGELOG.md | 3 + Cargo.lock | 1794 +++++++++++++++++ Cargo.toml | 61 + LICENSE | 674 +++++++ Makefile.toml | 70 + README.md | 1 + clippy.toml | 1 + codecov.yml | 10 + contracts/swapper/base/Cargo.toml | 30 + contracts/swapper/base/examples/schema.rs | 11 + contracts/swapper/base/src/contract.rs | 252 +++ contracts/swapper/base/src/error.rs | 40 + contracts/swapper/base/src/lib.rs | 7 + contracts/swapper/base/src/traits.rs | 40 + contracts/swapper/mock/Cargo.toml | 29 + contracts/swapper/mock/src/contract.rs | 91 + contracts/swapper/mock/src/lib.rs | 1 + contracts/swapper/osmosis/Cargo.toml | 36 + contracts/swapper/osmosis/examples/schema.rs | 11 + contracts/swapper/osmosis/src/contract.rs | 38 + contracts/swapper/osmosis/src/helpers.rs | 18 + contracts/swapper/osmosis/src/lib.rs | 3 + contracts/swapper/osmosis/src/route.rs | 180 ++ contracts/swapper/osmosis/tests/helpers.rs | 139 ++ .../osmosis/tests/test_enumerate_routes.rs | 185 ++ .../swapper/osmosis/tests/test_estimate.rs | 183 ++ .../swapper/osmosis/tests/test_instantiate.rs | 46 + .../swapper/osmosis/tests/test_set_route.rs | 373 ++++ contracts/swapper/osmosis/tests/test_swap.rs | 170 ++ .../osmosis/tests/test_update_admin.rs | 201 ++ coverage_grcov.Makefile.toml | 53 + packages/mars-swapper/Cargo.toml | 28 + packages/mars-swapper/src/adapter.rs | 52 + packages/mars-swapper/src/lib.rs | 4 + packages/mars-swapper/src/msgs.rs | 77 + rustfmt.toml | 4 + schema.Makefile.toml | 45 + 42 files changed, 5175 insertions(+) create mode 100644 .github/workflows/artifacts.yml create mode 100644 .github/workflows/coverage.yml create mode 100644 .github/workflows/main.yml create mode 100644 .github/workflows/scripts.yml create mode 100644 .gitignore create mode 100644 CHANGELOG.md create mode 100644 Cargo.lock create mode 100644 Cargo.toml create mode 100644 LICENSE create mode 100644 Makefile.toml create mode 100644 README.md create mode 100644 clippy.toml create mode 100644 codecov.yml create mode 100644 contracts/swapper/base/Cargo.toml create mode 100644 contracts/swapper/base/examples/schema.rs create mode 100644 contracts/swapper/base/src/contract.rs create mode 100644 contracts/swapper/base/src/error.rs create mode 100644 contracts/swapper/base/src/lib.rs create mode 100644 contracts/swapper/base/src/traits.rs create mode 100644 contracts/swapper/mock/Cargo.toml create mode 100644 contracts/swapper/mock/src/contract.rs create mode 100644 contracts/swapper/mock/src/lib.rs create mode 100644 contracts/swapper/osmosis/Cargo.toml create mode 100644 contracts/swapper/osmosis/examples/schema.rs create mode 100644 contracts/swapper/osmosis/src/contract.rs create mode 100644 contracts/swapper/osmosis/src/helpers.rs create mode 100644 contracts/swapper/osmosis/src/lib.rs create mode 100644 contracts/swapper/osmosis/src/route.rs create mode 100644 contracts/swapper/osmosis/tests/helpers.rs create mode 100644 contracts/swapper/osmosis/tests/test_enumerate_routes.rs create mode 100644 contracts/swapper/osmosis/tests/test_estimate.rs create mode 100644 contracts/swapper/osmosis/tests/test_instantiate.rs create mode 100644 contracts/swapper/osmosis/tests/test_set_route.rs create mode 100644 contracts/swapper/osmosis/tests/test_swap.rs create mode 100644 contracts/swapper/osmosis/tests/test_update_admin.rs create mode 100644 coverage_grcov.Makefile.toml create mode 100644 packages/mars-swapper/Cargo.toml create mode 100644 packages/mars-swapper/src/adapter.rs create mode 100644 packages/mars-swapper/src/lib.rs create mode 100644 packages/mars-swapper/src/msgs.rs create mode 100644 rustfmt.toml create mode 100644 schema.Makefile.toml diff --git a/.github/workflows/artifacts.yml b/.github/workflows/artifacts.yml new file mode 100644 index 000000000..a732d4d45 --- /dev/null +++ b/.github/workflows/artifacts.yml @@ -0,0 +1,37 @@ +name: Artifacts + +on: + push: + branches: + - master + - main + pull_request: + +env: + RUST_BACKTRACE: 1 + CARGO_TERM_COLOR: always + +jobs: + artifacts: + runs-on: ubuntu-latest + steps: + - name: Checkout sources + uses: actions/checkout@v3 + + - name: Install Rust + uses: actions-rs/toolchain@v1 + with: + toolchain: stable + target: wasm32-unknown-unknown + profile: minimal + override: true + + # selecting a toolchain should happen before the plugin, as the cache uses the current rustc version as its cache key + - name: Cache dependencies + uses: Swatinem/rust-cache@v2 + + - name: Install cargo make + uses: davidB/rust-cargo-make@v1 + + - name: Compile contracts to wasm + run: cargo make rust-optimizer diff --git a/.github/workflows/coverage.yml b/.github/workflows/coverage.yml new file mode 100644 index 000000000..0c7d6e83c --- /dev/null +++ b/.github/workflows/coverage.yml @@ -0,0 +1,44 @@ +name: Coverage + +on: + push: + branches: + - master + - main + pull_request: + +env: + RUST_BACKTRACE: 1 + CARGO_TERM_COLOR: always + +jobs: + coverage: + runs-on: ubuntu-latest + steps: + - name: Checkout sources + uses: actions/checkout@v3 + + - name: Install Rust + uses: actions-rs/toolchain@v1 + with: + toolchain: stable + target: wasm32-unknown-unknown + profile: minimal + override: true + components: llvm-tools-preview + + - name: Install cargo make + uses: davidB/rust-cargo-make@v1 + + # artifacts used by tests + - name: Compile workspace + run: cargo make build + + - name: Run test coverage + run: cargo make coverage-lcov + + - name: Upload coverage to Codecov + uses: codecov/codecov-action@v3 + with: + token: ${{ secrets.CODECOV_TOKEN }} + files: target/coverage/lcov.info diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml new file mode 100644 index 000000000..7def88a60 --- /dev/null +++ b/.github/workflows/main.yml @@ -0,0 +1,46 @@ +name: Main + +on: + push: + branches: + - master + - main + pull_request: + +env: + RUST_BACKTRACE: 1 + CARGO_TERM_COLOR: always + +jobs: + check: + runs-on: ubuntu-latest + steps: + - name: Checkout sources + uses: actions/checkout@v3 + + - name: Install Rust + uses: actions-rs/toolchain@v1 + with: + toolchain: nightly + target: wasm32-unknown-unknown + components: rustfmt, clippy + profile: minimal + override: true + + # selecting a toolchain should happen before the plugin, as the cache uses the current rustc version as its cache key + - name: Cache dependencies + uses: Swatinem/rust-cache@v2 + + - name: Install cargo make + uses: davidB/rust-cargo-make@v1 + + - name: Format + run: cargo make fmt + + - name: Clippy + run: cargo make clippy + + - name: Audit dependencies + run: | + cargo install --locked cargo-audit + cargo make audit diff --git a/.github/workflows/scripts.yml b/.github/workflows/scripts.yml new file mode 100644 index 000000000..f01588bb3 --- /dev/null +++ b/.github/workflows/scripts.yml @@ -0,0 +1,57 @@ +name: Scripts + +on: + push: + branches: + - master + - main + pull_request: + +env: + RUST_BACKTRACE: 1 + CARGO_TERM_COLOR: always + +jobs: + scripts: + runs-on: ubuntu-latest + defaults: + run: + working-directory: ./scripts + steps: + - name: Checkout sources + uses: actions/checkout@v3 + + - name: Install Rust + uses: actions-rs/toolchain@v1 + with: + toolchain: stable + target: wasm32-unknown-unknown + components: rustfmt, clippy + profile: minimal + override: true + + # selecting a toolchain should happen before the plugin, as the cache uses the current rustc version as its cache key + - name: Cache dependencies + uses: Swatinem/rust-cache@v2 + + - name: Install cargo make + uses: davidB/rust-cargo-make@v1 + + - uses: actions/setup-node@v3 + with: + node-version: 18 + + - name: Install yarn + run: npm install --global yarn + + - name: Install dependencies + run: yarn install + + # fails if schema changes not committed + - name: Generate latest schemas + run: | + yarn generate-types + git diff --exit-code + + - name: Check build + run: yarn build diff --git a/.gitignore b/.gitignore new file mode 100644 index 000000000..edb207ff5 --- /dev/null +++ b/.gitignore @@ -0,0 +1,30 @@ +# Build results +target/ +build/ + +# Cargo+Git helper file (https://github.com/rust-lang/cargo/blob/0.44.1/src/cargo/sources/git/utils.rs#L320-L327) +.cargo-ok + +# Text file backups +**/*.rs.bk + +# macOS +.DS_Store + +# IDEs +*.iml +.idea + +# Environment +*.env +jsconfig.json + +# Scripts +node_modules/ +whitelists/ + +# Artifacts +artifacts/ +schemas/ + +yarn-error.log diff --git a/CHANGELOG.md b/CHANGELOG.md new file mode 100644 index 000000000..6361e43e8 --- /dev/null +++ b/CHANGELOG.md @@ -0,0 +1,3 @@ +# Changelog + +All notable changes to this project will be documented in this file. diff --git a/Cargo.lock b/Cargo.lock new file mode 100644 index 000000000..0bfe31759 --- /dev/null +++ b/Cargo.lock @@ -0,0 +1,1794 @@ +# This file is automatically @generated by Cargo. +# It is not intended for manual editing. +version = 3 + +[[package]] +name = "ahash" +version = "0.7.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fcb51a0695d8f838b1ee009b3fbf66bda078cd64590202a864a8f3e8c4315c47" +dependencies = [ + "getrandom", + "once_cell", + "version_check", +] + +[[package]] +name = "aho-corasick" +version = "0.7.20" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cc936419f96fa211c1b9166887b38e5e40b19958e5b895be7c1f93adec7071ac" +dependencies = [ + "memchr", +] + +[[package]] +name = "anyhow" +version = "1.0.70" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7de8ce5e0f9f8d88245311066a578d72b7af3e7088f32783804676302df237e4" + +[[package]] +name = "async-trait" +version = "0.1.67" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "86ea188f25f0255d8f92797797c97ebf5631fa88178beb1a46fdf5622c9a00e4" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.5", +] + +[[package]] +name = "atty" +version = "0.2.14" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d9b39be18770d11421cdb1b9947a45dd3f37e93092cbf377614828a319d5fee8" +dependencies = [ + "hermit-abi", + "libc", + "winapi", +] + +[[package]] +name = "autocfg" +version = "1.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d468802bab17cbc0cc575e9b053f41e72aa36bfa6b7f55e3529ffa43161b97fa" + +[[package]] +name = "base16ct" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "349a06037c7bf932dd7e7d1f653678b2038b9ad46a74102f1fc7bd7872678cce" + +[[package]] +name = "base64" +version = "0.13.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9e1b586273c5702936fe7b7d6896644d8be71e6314cfe09d3167c95f712589e8" + +[[package]] +name = "base64ct" +version = "1.6.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8c3c1a368f70d6cf7302d78f8f7093da241fb8e8807c05cc9e51a125895a6d5b" + +[[package]] +name = "bindgen" +version = "0.60.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "062dddbc1ba4aca46de6338e2bf87771414c335f7b2f2036e8f3e9befebf88e6" +dependencies = [ + "bitflags", + "cexpr", + "clang-sys", + "clap", + "env_logger", + "lazy_static", + "lazycell", + "log", + "peeking_take_while", + "proc-macro2", + "quote", + "regex", + "rustc-hash", + "shlex", + "which", +] + +[[package]] +name = "bip32" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b30ed1d6f8437a487a266c8293aeb95b61a23261273e3e02912cdb8b68bf798b" +dependencies = [ + "bs58", + "hmac", + "k256", + "once_cell", + "pbkdf2", + "rand_core 0.6.4", + "ripemd", + "sha2 0.10.6", + "subtle", + "zeroize", +] + +[[package]] +name = "bitflags" +version = "1.3.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bef38d45163c2f1dde094a7dfd33ccf595c92905c8f8f4fdc18d06fb1037718a" + +[[package]] +name = "block-buffer" +version = "0.9.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4152116fd6e9dadb291ae18fc1ec3575ed6d84c29642d97890f4b4a3417297e4" +dependencies = [ + "generic-array", +] + +[[package]] +name = "block-buffer" +version = "0.10.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3078c7629b62d3f0439517fa394996acacc5cbc91c5a20d8c658e77abd503a71" +dependencies = [ + "generic-array", +] + +[[package]] +name = "bs58" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "771fe0050b883fcc3ea2359b1a96bcfbc090b7116eae7c3c512c7a083fdf23d3" +dependencies = [ + "sha2 0.9.9", +] + +[[package]] +name = "bumpalo" +version = "3.12.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0d261e256854913907f67ed06efbc3338dfe6179796deefc1ff763fc1aee5535" + +[[package]] +name = "byteorder" +version = "1.4.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "14c189c53d098945499cdfa7ecc63567cf3886b3332b312a5b4585d8d3a6a610" + +[[package]] +name = "bytes" +version = "1.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "89b2fd2a0dcf38d7971e2194b6b6eebab45ae01067456a7fd93d5547a61b70be" + +[[package]] +name = "cexpr" +version = "0.6.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6fac387a98bb7c37292057cffc56d62ecb629900026402633ae9160df93a8766" +dependencies = [ + "nom", +] + +[[package]] +name = "cfg-if" +version = "1.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd" + +[[package]] +name = "chrono" +version = "0.4.24" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4e3c5919066adf22df73762e50cffcde3a758f2a848b113b586d1f86728b673b" +dependencies = [ + "num-integer", + "num-traits", +] + +[[package]] +name = "clang-sys" +version = "1.6.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "77ed9a53e5d4d9c573ae844bfac6872b159cb1d1585a83b29e7a64b7eef7332a" +dependencies = [ + "glob", + "libc", + "libloading", +] + +[[package]] +name = "clap" +version = "3.2.23" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "71655c45cb9845d3270c9d6df84ebe72b4dad3c2ba3f7023ad47c144e4e473a5" +dependencies = [ + "atty", + "bitflags", + "clap_lex", + "indexmap", + "strsim", + "termcolor", + "textwrap", +] + +[[package]] +name = "clap_lex" +version = "0.2.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2850f2f5a82cbf437dd5af4d49848fbdfc27c157c3d010345776f952765261c5" +dependencies = [ + "os_str_bytes", +] + +[[package]] +name = "const-oid" +version = "0.9.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "520fbf3c07483f94e3e3ca9d0cfd913d7718ef2483d2cfd91c0d9e91474ab913" + +[[package]] +name = "cosmos-sdk-proto" +version = "0.14.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "20b42021d8488665b1a0d9748f1f81df7235362d194f44481e2e61bf376b77b4" +dependencies = [ + "prost 0.11.8", + "prost-types", + "tendermint-proto", +] + +[[package]] +name = "cosmrs" +version = "0.9.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3903590099dcf1ea580d9353034c9ba1dbf55d1389a5bd2ade98535c3445d1f9" +dependencies = [ + "bip32", + "cosmos-sdk-proto", + "ecdsa", + "eyre", + "getrandom", + "k256", + "rand_core 0.6.4", + "serde", + "serde_json", + "subtle-encoding", + "tendermint", + "thiserror", +] + +[[package]] +name = "cosmwasm-crypto" +version = "1.2.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f22add0f9b2a5416df98c1d0248a8d8eedb882c38fbf0c5052b64eebe865df6d" +dependencies = [ + "digest 0.10.6", + "ed25519-zebra", + "k256", + "rand_core 0.6.4", + "thiserror", +] + +[[package]] +name = "cosmwasm-derive" +version = "1.2.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c2e64f710a18ef90d0a632cf27842e98ffc2d005a38a6f76c12fd0bc03bc1a2d" +dependencies = [ + "syn 1.0.109", +] + +[[package]] +name = "cosmwasm-schema" +version = "1.2.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fe5ad2e23a971b9e4cd57b20cee3e2e79c33799bed4b128e473aca3702bfe5dd" +dependencies = [ + "cosmwasm-schema-derive", + "schemars", + "serde", + "serde_json", + "thiserror", +] + +[[package]] +name = "cosmwasm-schema-derive" +version = "1.2.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2926d159a9bb1a716a592b40280f1663f2491a9de3b6da77c0933cee2a2655b8" +dependencies = [ + "proc-macro2", + "quote", + "syn 1.0.109", +] + +[[package]] +name = "cosmwasm-std" +version = "1.2.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "76fee88ff5bf7bef55bd37ac0619974701b99bf6bd4b16cf56ee8810718abd71" +dependencies = [ + "base64", + "cosmwasm-crypto", + "cosmwasm-derive", + "derivative", + "forward_ref", + "hex", + "schemars", + "serde", + "serde-json-wasm", + "sha2 0.10.6", + "thiserror", + "uint", +] + +[[package]] +name = "cpufeatures" +version = "0.2.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "28d997bd5e24a5928dd43e46dc529867e207907fe0b239c3477d924f7f2ca320" +dependencies = [ + "libc", +] + +[[package]] +name = "crunchy" +version = "0.2.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7a81dae078cea95a014a339291cec439d2f232ebe854a9d672b796c6afafa9b7" + +[[package]] +name = "crypto-bigint" +version = "0.4.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ef2b4b23cddf68b89b8f8069890e8c270d54e2d5fe1b143820234805e4cb17ef" +dependencies = [ + "generic-array", + "rand_core 0.6.4", + "subtle", + "zeroize", +] + +[[package]] +name = "crypto-common" +version = "0.1.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1bfb12502f3fc46cca1bb51ac28df9d618d813cdc3d2f25b9fe775a34af26bb3" +dependencies = [ + "generic-array", + "typenum", +] + +[[package]] +name = "curve25519-dalek" +version = "3.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0b9fdf9972b2bd6af2d913799d9ebc165ea4d2e65878e329d9c6b372c4491b61" +dependencies = [ + "byteorder", + "digest 0.9.0", + "rand_core 0.5.1", + "subtle", + "zeroize", +] + +[[package]] +name = "cw-multi-test" +version = "0.16.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c2eb84554bbfa6b66736abcd6a9bfdf237ee0ecb83910f746dff7f799093c80a" +dependencies = [ + "anyhow", + "cosmwasm-std", + "cw-storage-plus", + "cw-utils", + "derivative", + "itertools", + "k256", + "prost 0.9.0", + "schemars", + "serde", + "thiserror", +] + +[[package]] +name = "cw-paginate" +version = "0.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "add278617f6251be1a35c781eb0fbffd44f899d8bb4dc5a9e420273a90684c4e" +dependencies = [ + "cosmwasm-std", + "cw-storage-plus", + "serde", +] + +[[package]] +name = "cw-storage-plus" +version = "1.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "053a5083c258acd68386734f428a5a171b29f7d733151ae83090c6fcc9417ffa" +dependencies = [ + "cosmwasm-std", + "schemars", + "serde", +] + +[[package]] +name = "cw-utils" +version = "1.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c80e93d1deccb8588db03945016a292c3c631e6325d349ebb35d2db6f4f946f7" +dependencies = [ + "cosmwasm-schema", + "cosmwasm-std", + "cw2", + "schemars", + "semver", + "serde", + "thiserror", +] + +[[package]] +name = "cw2" +version = "1.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8fb70cee2cf0b4a8ff7253e6bc6647107905e8eb37208f87d54f67810faa62f8" +dependencies = [ + "cosmwasm-schema", + "cosmwasm-std", + "cw-storage-plus", + "schemars", + "serde", +] + +[[package]] +name = "der" +version = "0.6.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f1a467a65c5e759bce6e65eaf91cc29f466cdc57cb65777bd646872a8a1fd4de" +dependencies = [ + "const-oid", + "zeroize", +] + +[[package]] +name = "derivative" +version = "2.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fcc3dd5e9e9c0b295d6e1e4d811fb6f157d5ffd784b8d202fc62eac8035a770b" +dependencies = [ + "proc-macro2", + "quote", + "syn 1.0.109", +] + +[[package]] +name = "digest" +version = "0.9.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d3dd60d1080a57a05ab032377049e0591415d2b31afd7028356dbf3cc6dcb066" +dependencies = [ + "generic-array", +] + +[[package]] +name = "digest" +version = "0.10.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8168378f4e5023e7218c89c891c0fd8ecdb5e5e4f18cb78f38cf245dd021e76f" +dependencies = [ + "block-buffer 0.10.4", + "crypto-common", + "subtle", +] + +[[package]] +name = "dyn-clone" +version = "1.0.11" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "68b0cf012f1230e43cd00ebb729c6bb58707ecfa8ad08b52ef3a4ccd2697fc30" + +[[package]] +name = "ecdsa" +version = "0.14.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "413301934810f597c1d19ca71c8710e99a3f1ba28a0d2ebc01551a2daeea3c5c" +dependencies = [ + "der", + "elliptic-curve", + "rfc6979", + "signature", +] + +[[package]] +name = "ed25519" +version = "1.5.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "91cff35c70bba8a626e3185d8cd48cc11b5437e1a5bcd15b9b5fa3c64b6dfee7" +dependencies = [ + "signature", +] + +[[package]] +name = "ed25519-dalek" +version = "1.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c762bae6dcaf24c4c84667b8579785430908723d5c889f469d76a41d59cc7a9d" +dependencies = [ + "curve25519-dalek", + "ed25519", + "sha2 0.9.9", + "zeroize", +] + +[[package]] +name = "ed25519-zebra" +version = "3.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7c24f403d068ad0b359e577a77f92392118be3f3c927538f2bb544a5ecd828c6" +dependencies = [ + "curve25519-dalek", + "hashbrown", + "hex", + "rand_core 0.6.4", + "serde", + "sha2 0.9.9", + "zeroize", +] + +[[package]] +name = "either" +version = "1.8.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7fcaabb2fef8c910e7f4c7ce9f67a1283a1715879a7c230ca9d6d1ae31f16d91" + +[[package]] +name = "elliptic-curve" +version = "0.12.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e7bb888ab5300a19b8e5bceef25ac745ad065f3c9f7efc6de1b91958110891d3" +dependencies = [ + "base16ct", + "crypto-bigint", + "der", + "digest 0.10.6", + "ff", + "generic-array", + "group", + "pkcs8", + "rand_core 0.6.4", + "sec1", + "subtle", + "zeroize", +] + +[[package]] +name = "env_logger" +version = "0.9.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a12e6657c4c97ebab115a42dcee77225f7f482cdd841cf7088c657a42e9e00e7" +dependencies = [ + "atty", + "humantime", + "log", + "regex", + "termcolor", +] + +[[package]] +name = "eyre" +version = "0.6.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4c2b6b5a29c02cdc822728b7d7b8ae1bab3e3b05d44522770ddd49722eeac7eb" +dependencies = [ + "indenter", + "once_cell", +] + +[[package]] +name = "ff" +version = "0.12.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d013fc25338cc558c5c2cfbad646908fb23591e2404481826742b651c9af7160" +dependencies = [ + "rand_core 0.6.4", + "subtle", +] + +[[package]] +name = "flex-error" +version = "0.4.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c606d892c9de11507fa0dcffc116434f94e105d0bbdc4e405b61519464c49d7b" +dependencies = [ + "eyre", + "paste", +] + +[[package]] +name = "forward_ref" +version = "1.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c8cbd1169bd7b4a0a20d92b9af7a7e0422888bd38a6f5ec29c1fd8c1558a272e" + +[[package]] +name = "futures" +version = "0.3.27" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "531ac96c6ff5fd7c62263c5e3c67a603af4fcaee2e1a0ae5565ba3a11e69e549" +dependencies = [ + "futures-channel", + "futures-core", + "futures-io", + "futures-sink", + "futures-task", + "futures-util", +] + +[[package]] +name = "futures-channel" +version = "0.3.27" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "164713a5a0dcc3e7b4b1ed7d3b433cabc18025386f9339346e8daf15963cf7ac" +dependencies = [ + "futures-core", + "futures-sink", +] + +[[package]] +name = "futures-core" +version = "0.3.27" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "86d7a0c1aa76363dac491de0ee99faf6941128376f1cf96f07db7603b7de69dd" + +[[package]] +name = "futures-io" +version = "0.3.27" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "89d422fa3cbe3b40dca574ab087abb5bc98258ea57eea3fd6f1fa7162c778b91" + +[[package]] +name = "futures-sink" +version = "0.3.27" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ec93083a4aecafb2a80a885c9de1f0ccae9dbd32c2bb54b0c3a65690e0b8d2f2" + +[[package]] +name = "futures-task" +version = "0.3.27" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fd65540d33b37b16542a0438c12e6aeead10d4ac5d05bd3f805b8f35ab592879" + +[[package]] +name = "futures-util" +version = "0.3.27" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3ef6b17e481503ec85211fed8f39d1970f128935ca1f814cd32ac4a6842e84ab" +dependencies = [ + "futures-core", + "futures-sink", + "futures-task", + "pin-project-lite", + "pin-utils", +] + +[[package]] +name = "generic-array" +version = "0.14.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bff49e947297f3312447abdca79f45f4738097cc82b06e72054d2223f601f1b9" +dependencies = [ + "typenum", + "version_check", +] + +[[package]] +name = "getrandom" +version = "0.2.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c05aeb6a22b8f62540c194aac980f2115af067bfe15a0734d7277a768d396b31" +dependencies = [ + "cfg-if", + "js-sys", + "libc", + "wasi", + "wasm-bindgen", +] + +[[package]] +name = "glob" +version = "0.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d2fabcfbdc87f4758337ca535fb41a6d701b65693ce38287d856d1674551ec9b" + +[[package]] +name = "group" +version = "0.12.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5dfbfb3a6cfbd390d5c9564ab283a0349b9b9fcd46a706c1eb10e0db70bfbac7" +dependencies = [ + "ff", + "rand_core 0.6.4", + "subtle", +] + +[[package]] +name = "hashbrown" +version = "0.12.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8a9ee70c43aaf417c914396645a0fa852624801b24ebb7ae78fe8272889ac888" +dependencies = [ + "ahash", +] + +[[package]] +name = "hermit-abi" +version = "0.1.19" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "62b467343b94ba476dcb2500d242dadbb39557df889310ac77c5d99100aaac33" +dependencies = [ + "libc", +] + +[[package]] +name = "hex" +version = "0.4.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7f24254aa9a54b5c858eaee2f5bccdb46aaf0e486a595ed5fd8f86ba55232a70" + +[[package]] +name = "hmac" +version = "0.12.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6c49c37c09c17a53d937dfbb742eb3a961d65a994e6bcdcf37e7399d0cc8ab5e" +dependencies = [ + "digest 0.10.6", +] + +[[package]] +name = "humantime" +version = "2.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9a3a5bfb195931eeb336b2a7b4d761daec841b97f947d34394601737a7bba5e4" + +[[package]] +name = "indenter" +version = "0.3.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ce23b50ad8242c51a442f3ff322d56b02f08852c77e4c0b4d3fd684abc89c683" + +[[package]] +name = "indexmap" +version = "1.9.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1885e79c1fc4b10f0e172c475f458b7f7b93061064d98c3293e98c5ba0c8b399" +dependencies = [ + "autocfg", + "hashbrown", +] + +[[package]] +name = "itertools" +version = "0.10.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b0fd2260e829bddf4cb6ea802289de2f86d6a7a690192fbe91b3f46e0f2c8473" +dependencies = [ + "either", +] + +[[package]] +name = "itoa" +version = "1.0.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "453ad9f582a441959e5f0d088b02ce04cfe8d51a8eaf077f12ac6d3e94164ca6" + +[[package]] +name = "js-sys" +version = "0.3.61" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "445dde2150c55e483f3d8416706b97ec8e8237c307e5b7b4b8dd15e6af2a0730" +dependencies = [ + "wasm-bindgen", +] + +[[package]] +name = "k256" +version = "0.11.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "72c1e0b51e7ec0a97369623508396067a486bd0cbed95a2659a4b863d28cfc8b" +dependencies = [ + "cfg-if", + "ecdsa", + "elliptic-curve", + "sha2 0.10.6", + "sha3", +] + +[[package]] +name = "keccak" +version = "0.1.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3afef3b6eff9ce9d8ff9b3601125eec7f0c8cbac7abd14f355d053fa56c98768" +dependencies = [ + "cpufeatures", +] + +[[package]] +name = "lazy_static" +version = "1.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e2abad23fbc42b3700f2f279844dc832adb2b2eb069b2df918f455c4e18cc646" + +[[package]] +name = "lazycell" +version = "1.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "830d08ce1d1d941e6b30645f1a0eb5643013d835ce3779a5fc208261dbe10f55" + +[[package]] +name = "libc" +version = "0.2.140" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "99227334921fae1a979cf0bfdfcc6b3e5ce376ef57e16fb6fb3ea2ed6095f80c" + +[[package]] +name = "libloading" +version = "0.7.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b67380fd3b2fbe7527a606e18729d21c6f3951633d0500574c4dc22d2d638b9f" +dependencies = [ + "cfg-if", + "winapi", +] + +[[package]] +name = "log" +version = "0.4.17" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "abb12e687cfb44aa40f41fc3978ef76448f9b6038cad6aef4259d3c095a2382e" +dependencies = [ + "cfg-if", +] + +[[package]] +name = "mars-osmosis" +version = "1.0.1" +source = "git+https://github.com/mars-protocol/red-bank?rev=00301d60c38af09d8eb7980355009e2f00c6f41f#00301d60c38af09d8eb7980355009e2f00c6f41f" +dependencies = [ + "cosmwasm-std", + "osmosis-std 0.14.0", + "serde", +] + +[[package]] +name = "mars-owner" +version = "1.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8ca010da465b4a5ea7274f59132d22b7c10765295c73d5744add2c1fea6c5e38" +dependencies = [ + "cosmwasm-schema", + "cosmwasm-std", + "cw-storage-plus", + "schemars", + "thiserror", +] + +[[package]] +name = "mars-swapper" +version = "1.0.0" +dependencies = [ + "cosmwasm-schema", + "cosmwasm-std", + "cw-storage-plus", + "cw-utils", + "mars-owner", + "schemars", + "serde", + "thiserror", +] + +[[package]] +name = "mars-swapper-base" +version = "1.0.0" +dependencies = [ + "cosmwasm-schema", + "cosmwasm-std", + "cw-paginate", + "cw-storage-plus", + "mars-owner", + "mars-swapper", + "schemars", + "serde", + "thiserror", +] + +[[package]] +name = "mars-swapper-mock" +version = "1.0.0" +dependencies = [ + "anyhow", + "cosmwasm-std", + "cw-multi-test", + "cw-storage-plus", + "mars-swapper", + "thiserror", +] + +[[package]] +name = "mars-swapper-osmosis" +version = "1.0.0" +dependencies = [ + "anyhow", + "cosmwasm-schema", + "cosmwasm-std", + "cw-storage-plus", + "cw2", + "mars-osmosis", + "mars-owner", + "mars-swapper", + "mars-swapper-base", + "osmosis-std 0.14.0", + "osmosis-test-tube", + "schemars", + "thiserror", +] + +[[package]] +name = "memchr" +version = "2.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2dffe52ecf27772e601905b7522cb4ef790d2cc203488bbd0e2fe85fcb74566d" + +[[package]] +name = "minimal-lexical" +version = "0.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "68354c5c6bd36d73ff3feceb05efa59b6acb7626617f4962be322a825e61f79a" + +[[package]] +name = "nom" +version = "7.1.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d273983c5a657a70a3e8f2a01329822f3b8c8172b73826411a55751e404a0a4a" +dependencies = [ + "memchr", + "minimal-lexical", +] + +[[package]] +name = "num-derive" +version = "0.3.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "876a53fff98e03a936a674b29568b0e605f06b29372c2489ff4de23f1949743d" +dependencies = [ + "proc-macro2", + "quote", + "syn 1.0.109", +] + +[[package]] +name = "num-integer" +version = "0.1.45" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "225d3389fb3509a24c93f5c29eb6bde2586b98d9f016636dff58d7c6f7569cd9" +dependencies = [ + "autocfg", + "num-traits", +] + +[[package]] +name = "num-traits" +version = "0.2.15" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "578ede34cf02f8924ab9447f50c28075b4d3e5b269972345e7e0372b38c6cdcd" +dependencies = [ + "autocfg", +] + +[[package]] +name = "num_threads" +version = "0.1.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2819ce041d2ee131036f4fc9d6ae7ae125a3a40e97ba64d04fe799ad9dabbb44" +dependencies = [ + "libc", +] + +[[package]] +name = "once_cell" +version = "1.17.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b7e5500299e16ebb147ae15a00a942af264cf3688f47923b8fc2cd5858f23ad3" + +[[package]] +name = "opaque-debug" +version = "0.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "624a8340c38c1b80fd549087862da4ba43e08858af025b236e509b6649fc13d5" + +[[package]] +name = "os_str_bytes" +version = "6.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ceedf44fb00f2d1984b0bc98102627ce622e083e49a5bacdb3e514fa4238e267" + +[[package]] +name = "osmosis-std" +version = "0.13.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "10d6fe6ac7fcba45ed61d738091d33c838c4cabbcf4892dc7aa56d19d39cc976" +dependencies = [ + "chrono", + "cosmwasm-std", + "osmosis-std-derive", + "prost 0.11.8", + "prost-types", + "schemars", + "serde", + "serde-cw-value", +] + +[[package]] +name = "osmosis-std" +version = "0.14.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2fc0a9075efd64ed5a8be3bf134cbf1080570d68384f2ad58ffaac6c00d063fd" +dependencies = [ + "chrono", + "cosmwasm-std", + "osmosis-std-derive", + "prost 0.11.8", + "prost-types", + "schemars", + "serde", + "serde-cw-value", +] + +[[package]] +name = "osmosis-std-derive" +version = "0.13.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a455e262a6fdfd3914f3a4e11e6bc0ce491901cb9d507d7856d7ef6e129e90c6" +dependencies = [ + "itertools", + "proc-macro2", + "quote", + "syn 1.0.109", +] + +[[package]] +name = "osmosis-test-tube" +version = "14.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "37e7d470a607f4016906fee20ff51275b399ffad9903240dc462c0f5226650c7" +dependencies = [ + "base64", + "bindgen", + "cosmrs", + "cosmwasm-std", + "osmosis-std 0.13.2", + "prost 0.11.8", + "serde", + "serde_json", + "test-tube", + "thiserror", +] + +[[package]] +name = "paste" +version = "1.0.12" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9f746c4065a8fa3fe23974dd82f15431cc8d40779821001404d10d2e79ca7d79" + +[[package]] +name = "pbkdf2" +version = "0.11.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "83a0692ec44e4cf1ef28ca317f14f8f07da2d95ec3fa01f86e4467b725e60917" +dependencies = [ + "digest 0.10.6", +] + +[[package]] +name = "peeking_take_while" +version = "0.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "19b17cddbe7ec3f8bc800887bab5e717348c95ea2ca0b1bf0837fb964dc67099" + +[[package]] +name = "pin-project-lite" +version = "0.2.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e0a7ae3ac2f1173085d398531c705756c94a4c56843785df85a60c1a0afac116" + +[[package]] +name = "pin-utils" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8b870d8c151b6f2fb93e84a13146138f05d02ed11c7e7c54f8826aaaf7c9f184" + +[[package]] +name = "pkcs8" +version = "0.9.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9eca2c590a5f85da82668fa685c09ce2888b9430e83299debf1f34b65fd4a4ba" +dependencies = [ + "der", + "spki", +] + +[[package]] +name = "proc-macro2" +version = "1.0.53" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ba466839c78239c09faf015484e5cc04860f88242cff4d03eb038f04b4699b73" +dependencies = [ + "unicode-ident", +] + +[[package]] +name = "prost" +version = "0.9.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "444879275cb4fd84958b1a1d5420d15e6fcf7c235fe47f053c9c2a80aceb6001" +dependencies = [ + "bytes", + "prost-derive 0.9.0", +] + +[[package]] +name = "prost" +version = "0.11.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e48e50df39172a3e7eb17e14642445da64996989bc212b583015435d39a58537" +dependencies = [ + "bytes", + "prost-derive 0.11.8", +] + +[[package]] +name = "prost-derive" +version = "0.9.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f9cc1a3263e07e0bf68e96268f37665207b49560d98739662cdfaae215c720fe" +dependencies = [ + "anyhow", + "itertools", + "proc-macro2", + "quote", + "syn 1.0.109", +] + +[[package]] +name = "prost-derive" +version = "0.11.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4ea9b0f8cbe5e15a8a042d030bd96668db28ecb567ec37d691971ff5731d2b1b" +dependencies = [ + "anyhow", + "itertools", + "proc-macro2", + "quote", + "syn 1.0.109", +] + +[[package]] +name = "prost-types" +version = "0.11.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "379119666929a1afd7a043aa6cf96fa67a6dce9af60c88095a4686dbce4c9c88" +dependencies = [ + "prost 0.11.8", +] + +[[package]] +name = "quote" +version = "1.0.26" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4424af4bf778aae2051a77b60283332f386554255d722233d09fbfc7e30da2fc" +dependencies = [ + "proc-macro2", +] + +[[package]] +name = "rand_core" +version = "0.5.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "90bde5296fc891b0cef12a6d03ddccc162ce7b2aff54160af9338f8d40df6d19" + +[[package]] +name = "rand_core" +version = "0.6.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ec0be4795e2f6a28069bec0b5ff3e2ac9bafc99e6a9a7dc3547996c5c816922c" +dependencies = [ + "getrandom", +] + +[[package]] +name = "regex" +version = "1.7.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cce168fea28d3e05f158bda4576cf0c844d5045bc2cc3620fa0292ed5bb5814c" +dependencies = [ + "aho-corasick", + "memchr", + "regex-syntax", +] + +[[package]] +name = "regex-syntax" +version = "0.6.29" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f162c6dd7b008981e4d40210aca20b4bd0f9b60ca9271061b07f78537722f2e1" + +[[package]] +name = "rfc6979" +version = "0.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7743f17af12fa0b03b803ba12cd6a8d9483a587e89c69445e3909655c0b9fabb" +dependencies = [ + "crypto-bigint", + "hmac", + "zeroize", +] + +[[package]] +name = "ripemd" +version = "0.1.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bd124222d17ad93a644ed9d011a40f4fb64aa54275c08cc216524a9ea82fb09f" +dependencies = [ + "digest 0.10.6", +] + +[[package]] +name = "ripemd160" +version = "0.9.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2eca4ecc81b7f313189bf73ce724400a07da2a6dac19588b03c8bd76a2dcc251" +dependencies = [ + "block-buffer 0.9.0", + "digest 0.9.0", + "opaque-debug", +] + +[[package]] +name = "rustc-hash" +version = "1.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "08d43f7aa6b08d49f382cde6a7982047c3426db949b1424bc4b7ec9ae12c6ce2" + +[[package]] +name = "ryu" +version = "1.0.13" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f91339c0467de62360649f8d3e185ca8de4224ff281f66000de5eb2a77a79041" + +[[package]] +name = "schemars" +version = "0.8.12" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "02c613288622e5f0c3fdc5dbd4db1c5fbe752746b1d1a56a0630b78fd00de44f" +dependencies = [ + "dyn-clone", + "schemars_derive", + "serde", + "serde_json", +] + +[[package]] +name = "schemars_derive" +version = "0.8.12" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "109da1e6b197438deb6db99952990c7f959572794b80ff93707d55a232545e7c" +dependencies = [ + "proc-macro2", + "quote", + "serde_derive_internals", + "syn 1.0.109", +] + +[[package]] +name = "sec1" +version = "0.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3be24c1842290c45df0a7bf069e0c268a747ad05a192f2fd7dcfdbc1cba40928" +dependencies = [ + "base16ct", + "der", + "generic-array", + "pkcs8", + "subtle", + "zeroize", +] + +[[package]] +name = "semver" +version = "1.0.17" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bebd363326d05ec3e2f532ab7660680f3b02130d780c299bca73469d521bc0ed" + +[[package]] +name = "serde" +version = "1.0.158" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "771d4d9c4163ee138805e12c710dd365e4f44be8be0503cb1bb9eb989425d9c9" +dependencies = [ + "serde_derive", +] + +[[package]] +name = "serde-cw-value" +version = "0.7.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a75d32da6b8ed758b7d850b6c3c08f1d7df51a4df3cb201296e63e34a78e99d4" +dependencies = [ + "serde", +] + +[[package]] +name = "serde-json-wasm" +version = "0.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a15bee9b04dd165c3f4e142628982ddde884c2022a89e8ddf99c4829bf2c3a58" +dependencies = [ + "serde", +] + +[[package]] +name = "serde_bytes" +version = "0.11.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "416bda436f9aab92e02c8e10d49a15ddd339cea90b6e340fe51ed97abb548294" +dependencies = [ + "serde", +] + +[[package]] +name = "serde_derive" +version = "1.0.158" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e801c1712f48475582b7696ac71e0ca34ebb30e09338425384269d9717c62cad" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.5", +] + +[[package]] +name = "serde_derive_internals" +version = "0.26.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "85bf8229e7920a9f636479437026331ce11aa132b4dde37d121944a44d6e5f3c" +dependencies = [ + "proc-macro2", + "quote", + "syn 1.0.109", +] + +[[package]] +name = "serde_json" +version = "1.0.94" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1c533a59c9d8a93a09c6ab31f0fd5e5f4dd1b8fc9434804029839884765d04ea" +dependencies = [ + "itoa", + "ryu", + "serde", +] + +[[package]] +name = "serde_repr" +version = "0.1.12" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bcec881020c684085e55a25f7fd888954d56609ef363479dc5a1305eb0d40cab" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.5", +] + +[[package]] +name = "sha2" +version = "0.9.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4d58a1e1bf39749807d89cf2d98ac2dfa0ff1cb3faa38fbb64dd88ac8013d800" +dependencies = [ + "block-buffer 0.9.0", + "cfg-if", + "cpufeatures", + "digest 0.9.0", + "opaque-debug", +] + +[[package]] +name = "sha2" +version = "0.10.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "82e6b795fe2e3b1e845bafcb27aa35405c4d47cdfc92af5fc8d3002f76cebdc0" +dependencies = [ + "cfg-if", + "cpufeatures", + "digest 0.10.6", +] + +[[package]] +name = "sha3" +version = "0.10.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bdf0c33fae925bdc080598b84bc15c55e7b9a4a43b3c704da051f977469691c9" +dependencies = [ + "digest 0.10.6", + "keccak", +] + +[[package]] +name = "shlex" +version = "1.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "43b2853a4d09f215c24cc5489c992ce46052d359b5109343cbafbf26bc62f8a3" + +[[package]] +name = "signature" +version = "1.6.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "74233d3b3b2f6d4b006dc19dee745e73e2a6bfb6f93607cd3b02bd5b00797d7c" +dependencies = [ + "digest 0.10.6", + "rand_core 0.6.4", +] + +[[package]] +name = "spki" +version = "0.6.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "67cf02bbac7a337dc36e4f5a693db6c21e7863f45070f7064577eb4367a3212b" +dependencies = [ + "base64ct", + "der", +] + +[[package]] +name = "static_assertions" +version = "1.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a2eb9349b6444b326872e140eb1cf5e7c522154d69e7a0ffb0fb81c06b37543f" + +[[package]] +name = "strsim" +version = "0.10.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "73473c0e59e6d5812c5dfe2a064a6444949f089e20eec9a2e5506596494e4623" + +[[package]] +name = "subtle" +version = "2.4.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6bdef32e8150c2a081110b42772ffe7d7c9032b606bc226c8260fd97e0976601" + +[[package]] +name = "subtle-encoding" +version = "0.5.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7dcb1ed7b8330c5eed5441052651dd7a12c75e2ed88f2ec024ae1fa3a5e59945" +dependencies = [ + "zeroize", +] + +[[package]] +name = "syn" +version = "1.0.109" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "72b64191b275b66ffe2469e8af2c1cfe3bafa67b529ead792a6d0160888b4237" +dependencies = [ + "proc-macro2", + "quote", + "unicode-ident", +] + +[[package]] +name = "syn" +version = "2.0.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "89c2d1c76a26822187a1fbb5964e3fff108bc208f02e820ab9dac1234f6b388a" +dependencies = [ + "proc-macro2", + "quote", + "unicode-ident", +] + +[[package]] +name = "synstructure" +version = "0.12.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f36bdaa60a83aca3921b5259d5400cbf5e90fc51931376a9bd4a0eb79aa7210f" +dependencies = [ + "proc-macro2", + "quote", + "syn 1.0.109", + "unicode-xid", +] + +[[package]] +name = "tendermint" +version = "0.23.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "467f82178deeebcd357e1273a0c0b77b9a8a0313ef7c07074baebe99d87851f4" +dependencies = [ + "async-trait", + "bytes", + "ed25519", + "ed25519-dalek", + "flex-error", + "futures", + "k256", + "num-traits", + "once_cell", + "prost 0.11.8", + "prost-types", + "ripemd160", + "serde", + "serde_bytes", + "serde_json", + "serde_repr", + "sha2 0.9.9", + "signature", + "subtle", + "subtle-encoding", + "tendermint-proto", + "time", + "zeroize", +] + +[[package]] +name = "tendermint-proto" +version = "0.23.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "68ce80bf536476db81ecc9ebab834dc329c9c1509a694f211a73858814bfe023" +dependencies = [ + "bytes", + "flex-error", + "num-derive", + "num-traits", + "prost 0.11.8", + "prost-types", + "serde", + "serde_bytes", + "subtle-encoding", + "time", +] + +[[package]] +name = "termcolor" +version = "1.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "be55cf8942feac5c765c2c993422806843c9a9a45d4d5c407ad6dd2ea95eb9b6" +dependencies = [ + "winapi-util", +] + +[[package]] +name = "test-tube" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2791215b77f72c219df4d3e95d78539ee66950a0449961ba6d0ab1c7b538673f" +dependencies = [ + "base64", + "cosmrs", + "cosmwasm-std", + "osmosis-std 0.13.2", + "prost 0.11.8", + "serde", + "serde_json", + "thiserror", +] + +[[package]] +name = "textwrap" +version = "0.16.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "222a222a5bfe1bba4a77b45ec488a741b3cb8872e5e499451fd7d0129c9c7c3d" + +[[package]] +name = "thiserror" +version = "1.0.40" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "978c9a314bd8dc99be594bc3c175faaa9794be04a5a5e153caba6915336cebac" +dependencies = [ + "thiserror-impl", +] + +[[package]] +name = "thiserror-impl" +version = "1.0.40" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f9456a42c5b0d803c8cd86e73dd7cc9edd429499f37a3550d286d5e86720569f" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.5", +] + +[[package]] +name = "time" +version = "0.3.11" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "72c91f41dcb2f096c05f0873d667dceec1087ce5bcf984ec8ffb19acddbb3217" +dependencies = [ + "libc", + "num_threads", + "time-macros", +] + +[[package]] +name = "time-macros" +version = "0.2.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "42657b1a6f4d817cda8e7a0ace261fe0cc946cf3a80314390b22cc61ae080792" + +[[package]] +name = "typenum" +version = "1.16.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "497961ef93d974e23eb6f433eb5fe1b7930b659f06d12dec6fc44a8f554c0bba" + +[[package]] +name = "uint" +version = "0.9.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "76f64bba2c53b04fcab63c01a7d7427eadc821e3bc48c34dc9ba29c501164b52" +dependencies = [ + "byteorder", + "crunchy", + "hex", + "static_assertions", +] + +[[package]] +name = "unicode-ident" +version = "1.0.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e5464a87b239f13a63a501f2701565754bae92d243d4bb7eb12f6d57d2269bf4" + +[[package]] +name = "unicode-xid" +version = "0.2.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f962df74c8c05a667b5ee8bcf162993134c104e96440b663c8daa176dc772d8c" + +[[package]] +name = "version_check" +version = "0.9.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "49874b5167b65d7193b8aba1567f5c7d93d001cafc34600cee003eda787e483f" + +[[package]] +name = "wasi" +version = "0.11.0+wasi-snapshot-preview1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9c8d87e72b64a3b4db28d11ce29237c246188f4f51057d65a7eab63b7987e423" + +[[package]] +name = "wasm-bindgen" +version = "0.2.84" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "31f8dcbc21f30d9b8f2ea926ecb58f6b91192c17e9d33594b3df58b2007ca53b" +dependencies = [ + "cfg-if", + "wasm-bindgen-macro", +] + +[[package]] +name = "wasm-bindgen-backend" +version = "0.2.84" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "95ce90fd5bcc06af55a641a86428ee4229e44e07033963a2290a8e241607ccb9" +dependencies = [ + "bumpalo", + "log", + "once_cell", + "proc-macro2", + "quote", + "syn 1.0.109", + "wasm-bindgen-shared", +] + +[[package]] +name = "wasm-bindgen-macro" +version = "0.2.84" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4c21f77c0bedc37fd5dc21f897894a5ca01e7bb159884559461862ae90c0b4c5" +dependencies = [ + "quote", + "wasm-bindgen-macro-support", +] + +[[package]] +name = "wasm-bindgen-macro-support" +version = "0.2.84" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2aff81306fcac3c7515ad4e177f521b5c9a15f2b08f4e32d823066102f35a5f6" +dependencies = [ + "proc-macro2", + "quote", + "syn 1.0.109", + "wasm-bindgen-backend", + "wasm-bindgen-shared", +] + +[[package]] +name = "wasm-bindgen-shared" +version = "0.2.84" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0046fef7e28c3804e5e38bfa31ea2a0f73905319b677e57ebe37e49358989b5d" + +[[package]] +name = "which" +version = "4.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2441c784c52b289a054b7201fc93253e288f094e2f4be9058343127c4226a269" +dependencies = [ + "either", + "libc", + "once_cell", +] + +[[package]] +name = "winapi" +version = "0.3.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5c839a674fcd7a98952e593242ea400abe93992746761e38641405d28b00f419" +dependencies = [ + "winapi-i686-pc-windows-gnu", + "winapi-x86_64-pc-windows-gnu", +] + +[[package]] +name = "winapi-i686-pc-windows-gnu" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ac3b87c63620426dd9b991e5ce0329eff545bccbbb34f3be09ff6fb6ab51b7b6" + +[[package]] +name = "winapi-util" +version = "0.1.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "70ec6ce85bb158151cae5e5c87f95a8e97d2c0c4b001223f33a334e3ce5de178" +dependencies = [ + "winapi", +] + +[[package]] +name = "winapi-x86_64-pc-windows-gnu" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "712e227841d057c1ee1cd2fb22fa7e5a5461ae8e48fa2ca79ec42cfc1931183f" + +[[package]] +name = "zeroize" +version = "1.5.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c394b5bd0c6f669e7275d9c20aa90ae064cb22e75a1cad54e1b34088034b149f" +dependencies = [ + "zeroize_derive", +] + +[[package]] +name = "zeroize_derive" +version = "1.3.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "44bf07cb3e50ea2003396695d58bf46bc9887a1f362260446fad6bc4e79bd36c" +dependencies = [ + "proc-macro2", + "quote", + "syn 1.0.109", + "synstructure", +] diff --git a/Cargo.toml b/Cargo.toml new file mode 100644 index 000000000..320c6d4b2 --- /dev/null +++ b/Cargo.toml @@ -0,0 +1,61 @@ +[workspace] +members = [ + "contracts/swapper/*", + "packages/*" +] + +[workspace.package] +version = "1.0.0" +authors = [ + "Gabe R. ", + "Larry Engineer ", + "Piotr Babel ", +] +license = "GPL-3.0-or-later" +edition = "2021" +repository = "https://github.com/mars-protocol/mars-common" +homepage = "https://marsprotocol.io" +documentation = "https://docs.marsprotocol.io/" +keywords = ["mars", "cosmos", "cosmwasm"] + +[workspace.dependencies] +anyhow = "1.0.69" +cosmwasm-schema = "1.2.2" +cosmwasm-std = "1.2.2" +cw2 = "1.0.1" +cw721 = "0.16.0" +cw721-base = { version = "0.16.0", features = ["library"] } +cw-item-set = { version = "0.7.1", default-features = false, features = ["iterator"] } +cw-multi-test = "0.16.2" +cw-paginate = "0.2.1" +cw-utils = "1.0.1" +cw-storage-plus = "1.0.1" +itertools = "0.10.5" +osmosis-std = "0.14.0" +osmosis-test-tube = "14.1.1" +schemars = "0.8.12" +serde = { version = "1.0.155", default-features = false, features = ["derive"] } +serde_json = "1.0.94" +serde-wasm-bindgen = "0.5.0" +thiserror = "1.0.39" +wasm-bindgen = "0.2.84" + +# packages +mars-osmosis = { git = "https://github.com/mars-protocol/red-bank", rev = "00301d60c38af09d8eb7980355009e2f00c6f41f" } +mars-red-bank-types = "1.0.0" +mars-owner = "1.0.0" +mars-swapper = { path = "packages/mars-swapper" } + +# contracts +mars-swapper-base = { version = "1.0.0", path = "contracts/swapper/base" } + +[profile.release] +codegen-units = 1 +debug = false +debug-assertions = false +incremental = false +lto = true +overflow-checks = true +opt-level = 3 +panic = "abort" +rpath = false diff --git a/LICENSE b/LICENSE new file mode 100644 index 000000000..f288702d2 --- /dev/null +++ b/LICENSE @@ -0,0 +1,674 @@ + GNU GENERAL PUBLIC LICENSE + Version 3, 29 June 2007 + + Copyright (C) 2007 Free Software Foundation, Inc. + Everyone is permitted to copy and distribute verbatim copies + of this license document, but changing it is not allowed. + + Preamble + + The GNU General Public License is a free, copyleft license for +software and other kinds of works. + + The licenses for most software and other practical works are designed +to take away your freedom to share and change the works. By contrast, +the GNU General Public License is intended to guarantee your freedom to +share and change all versions of a program--to make sure it remains free +software for all its users. We, the Free Software Foundation, use the +GNU General Public License for most of our software; it applies also to +any other work released this way by its authors. You can apply it to +your programs, too. + + When we speak of free software, we are referring to freedom, not +price. Our General Public Licenses are designed to make sure that you +have the freedom to distribute copies of free software (and charge for +them if you wish), that you receive source code or can get it if you +want it, that you can change the software or use pieces of it in new +free programs, and that you know you can do these things. + + To protect your rights, we need to prevent others from denying you +these rights or asking you to surrender the rights. Therefore, you have +certain responsibilities if you distribute copies of the software, or if +you modify it: responsibilities to respect the freedom of others. + + For example, if you distribute copies of such a program, whether +gratis or for a fee, you must pass on to the recipients the same +freedoms that you received. You must make sure that they, too, receive +or can get the source code. And you must show them these terms so they +know their rights. + + Developers that use the GNU GPL protect your rights with two steps: +(1) assert copyright on the software, and (2) offer you this License +giving you legal permission to copy, distribute and/or modify it. + + For the developers' and authors' protection, the GPL clearly explains +that there is no warranty for this free software. For both users' and +authors' sake, the GPL requires that modified versions be marked as +changed, so that their problems will not be attributed erroneously to +authors of previous versions. + + Some devices are designed to deny users access to install or run +modified versions of the software inside them, although the manufacturer +can do so. This is fundamentally incompatible with the aim of +protecting users' freedom to change the software. The systematic +pattern of such abuse occurs in the area of products for individuals to +use, which is precisely where it is most unacceptable. Therefore, we +have designed this version of the GPL to prohibit the practice for those +products. If such problems arise substantially in other domains, we +stand ready to extend this provision to those domains in future versions +of the GPL, as needed to protect the freedom of users. + + Finally, every program is threatened constantly by software patents. +States should not allow patents to restrict development and use of +software on general-purpose computers, but in those that do, we wish to +avoid the special danger that patents applied to a free program could +make it effectively proprietary. To prevent this, the GPL assures that +patents cannot be used to render the program non-free. + + The precise terms and conditions for copying, distribution and +modification follow. + + TERMS AND CONDITIONS + + 0. Definitions. + + "This License" refers to version 3 of the GNU General Public License. + + "Copyright" also means copyright-like laws that apply to other kinds of +works, such as semiconductor masks. + + "The Program" refers to any copyrightable work licensed under this +License. Each licensee is addressed as "you". "Licensees" and +"recipients" may be individuals or organizations. + + To "modify" a work means to copy from or adapt all or part of the work +in a fashion requiring copyright permission, other than the making of an +exact copy. The resulting work is called a "modified version" of the +earlier work or a work "based on" the earlier work. + + A "covered work" means either the unmodified Program or a work based +on the Program. + + To "propagate" a work means to do anything with it that, without +permission, would make you directly or secondarily liable for +infringement under applicable copyright law, except executing it on a +computer or modifying a private copy. Propagation includes copying, +distribution (with or without modification), making available to the +public, and in some countries other activities as well. + + To "convey" a work means any kind of propagation that enables other +parties to make or receive copies. Mere interaction with a user through +a computer network, with no transfer of a copy, is not conveying. + + An interactive user interface displays "Appropriate Legal Notices" +to the extent that it includes a convenient and prominently visible +feature that (1) displays an appropriate copyright notice, and (2) +tells the user that there is no warranty for the work (except to the +extent that warranties are provided), that licensees may convey the +work under this License, and how to view a copy of this License. If +the interface presents a list of user commands or options, such as a +menu, a prominent item in the list meets this criterion. + + 1. Source Code. + + The "source code" for a work means the preferred form of the work +for making modifications to it. "Object code" means any non-source +form of a work. + + A "Standard Interface" means an interface that either is an official +standard defined by a recognized standards body, or, in the case of +interfaces specified for a particular programming language, one that +is widely used among developers working in that language. + + The "System Libraries" of an executable work include anything, other +than the work as a whole, that (a) is included in the normal form of +packaging a Major Component, but which is not part of that Major +Component, and (b) serves only to enable use of the work with that +Major Component, or to implement a Standard Interface for which an +implementation is available to the public in source code form. A +"Major Component", in this context, means a major essential component +(kernel, window system, and so on) of the specific operating system +(if any) on which the executable work runs, or a compiler used to +produce the work, or an object code interpreter used to run it. + + The "Corresponding Source" for a work in object code form means all +the source code needed to generate, install, and (for an executable +work) run the object code and to modify the work, including scripts to +control those activities. However, it does not include the work's +System Libraries, or general-purpose tools or generally available free +programs which are used unmodified in performing those activities but +which are not part of the work. For example, Corresponding Source +includes interface definition files associated with source files for +the work, and the source code for shared libraries and dynamically +linked subprograms that the work is specifically designed to require, +such as by intimate data communication or control flow between those +subprograms and other parts of the work. + + The Corresponding Source need not include anything that users +can regenerate automatically from other parts of the Corresponding +Source. + + The Corresponding Source for a work in source code form is that +same work. + + 2. Basic Permissions. + + All rights granted under this License are granted for the term of +copyright on the Program, and are irrevocable provided the stated +conditions are met. This License explicitly affirms your unlimited +permission to run the unmodified Program. The output from running a +covered work is covered by this License only if the output, given its +content, constitutes a covered work. This License acknowledges your +rights of fair use or other equivalent, as provided by copyright law. + + You may make, run and propagate covered works that you do not +convey, without conditions so long as your license otherwise remains +in force. You may convey covered works to others for the sole purpose +of having them make modifications exclusively for you, or provide you +with facilities for running those works, provided that you comply with +the terms of this License in conveying all material for which you do +not control copyright. Those thus making or running the covered works +for you must do so exclusively on your behalf, under your direction +and control, on terms that prohibit them from making any copies of +your copyrighted material outside their relationship with you. + + Conveying under any other circumstances is permitted solely under +the conditions stated below. Sublicensing is not allowed; section 10 +makes it unnecessary. + + 3. Protecting Users' Legal Rights From Anti-Circumvention Law. + + No covered work shall be deemed part of an effective technological +measure under any applicable law fulfilling obligations under article +11 of the WIPO copyright treaty adopted on 20 December 1996, or +similar laws prohibiting or restricting circumvention of such +measures. + + When you convey a covered work, you waive any legal power to forbid +circumvention of technological measures to the extent such circumvention +is effected by exercising rights under this License with respect to +the covered work, and you disclaim any intention to limit operation or +modification of the work as a means of enforcing, against the work's +users, your or third parties' legal rights to forbid circumvention of +technological measures. + + 4. Conveying Verbatim Copies. + + You may convey verbatim copies of the Program's source code as you +receive it, in any medium, provided that you conspicuously and +appropriately publish on each copy an appropriate copyright notice; +keep intact all notices stating that this License and any +non-permissive terms added in accord with section 7 apply to the code; +keep intact all notices of the absence of any warranty; and give all +recipients a copy of this License along with the Program. + + You may charge any price or no price for each copy that you convey, +and you may offer support or warranty protection for a fee. + + 5. Conveying Modified Source Versions. + + You may convey a work based on the Program, or the modifications to +produce it from the Program, in the form of source code under the +terms of section 4, provided that you also meet all of these conditions: + + a) The work must carry prominent notices stating that you modified + it, and giving a relevant date. + + b) The work must carry prominent notices stating that it is + released under this License and any conditions added under section + 7. This requirement modifies the requirement in section 4 to + "keep intact all notices". + + c) You must license the entire work, as a whole, under this + License to anyone who comes into possession of a copy. This + License will therefore apply, along with any applicable section 7 + additional terms, to the whole of the work, and all its parts, + regardless of how they are packaged. This License gives no + permission to license the work in any other way, but it does not + invalidate such permission if you have separately received it. + + d) If the work has interactive user interfaces, each must display + Appropriate Legal Notices; however, if the Program has interactive + interfaces that do not display Appropriate Legal Notices, your + work need not make them do so. + + A compilation of a covered work with other separate and independent +works, which are not by their nature extensions of the covered work, +and which are not combined with it such as to form a larger program, +in or on a volume of a storage or distribution medium, is called an +"aggregate" if the compilation and its resulting copyright are not +used to limit the access or legal rights of the compilation's users +beyond what the individual works permit. Inclusion of a covered work +in an aggregate does not cause this License to apply to the other +parts of the aggregate. + + 6. Conveying Non-Source Forms. + + You may convey a covered work in object code form under the terms +of sections 4 and 5, provided that you also convey the +machine-readable Corresponding Source under the terms of this License, +in one of these ways: + + a) Convey the object code in, or embodied in, a physical product + (including a physical distribution medium), accompanied by the + Corresponding Source fixed on a durable physical medium + customarily used for software interchange. + + b) Convey the object code in, or embodied in, a physical product + (including a physical distribution medium), accompanied by a + written offer, valid for at least three years and valid for as + long as you offer spare parts or customer support for that product + model, to give anyone who possesses the object code either (1) a + copy of the Corresponding Source for all the software in the + product that is covered by this License, on a durable physical + medium customarily used for software interchange, for a price no + more than your reasonable cost of physically performing this + conveying of source, or (2) access to copy the + Corresponding Source from a network server at no charge. + + c) Convey individual copies of the object code with a copy of the + written offer to provide the Corresponding Source. This + alternative is allowed only occasionally and noncommercially, and + only if you received the object code with such an offer, in accord + with subsection 6b. + + d) Convey the object code by offering access from a designated + place (gratis or for a charge), and offer equivalent access to the + Corresponding Source in the same way through the same place at no + further charge. You need not require recipients to copy the + Corresponding Source along with the object code. If the place to + copy the object code is a network server, the Corresponding Source + may be on a different server (operated by you or a third party) + that supports equivalent copying facilities, provided you maintain + clear directions next to the object code saying where to find the + Corresponding Source. Regardless of what server hosts the + Corresponding Source, you remain obligated to ensure that it is + available for as long as needed to satisfy these requirements. + + e) Convey the object code using peer-to-peer transmission, provided + you inform other peers where the object code and Corresponding + Source of the work are being offered to the general public at no + charge under subsection 6d. + + A separable portion of the object code, whose source code is excluded +from the Corresponding Source as a System Library, need not be +included in conveying the object code work. + + A "User Product" is either (1) a "consumer product", which means any +tangible personal property which is normally used for personal, family, +or household purposes, or (2) anything designed or sold for incorporation +into a dwelling. In determining whether a product is a consumer product, +doubtful cases shall be resolved in favor of coverage. For a particular +product received by a particular user, "normally used" refers to a +typical or common use of that class of product, regardless of the status +of the particular user or of the way in which the particular user +actually uses, or expects or is expected to use, the product. A product +is a consumer product regardless of whether the product has substantial +commercial, industrial or non-consumer uses, unless such uses represent +the only significant mode of use of the product. + + "Installation Information" for a User Product means any methods, +procedures, authorization keys, or other information required to install +and execute modified versions of a covered work in that User Product from +a modified version of its Corresponding Source. The information must +suffice to ensure that the continued functioning of the modified object +code is in no case prevented or interfered with solely because +modification has been made. + + If you convey an object code work under this section in, or with, or +specifically for use in, a User Product, and the conveying occurs as +part of a transaction in which the right of possession and use of the +User Product is transferred to the recipient in perpetuity or for a +fixed term (regardless of how the transaction is characterized), the +Corresponding Source conveyed under this section must be accompanied +by the Installation Information. But this requirement does not apply +if neither you nor any third party retains the ability to install +modified object code on the User Product (for example, the work has +been installed in ROM). + + The requirement to provide Installation Information does not include a +requirement to continue to provide support service, warranty, or updates +for a work that has been modified or installed by the recipient, or for +the User Product in which it has been modified or installed. Access to a +network may be denied when the modification itself materially and +adversely affects the operation of the network or violates the rules and +protocols for communication across the network. + + Corresponding Source conveyed, and Installation Information provided, +in accord with this section must be in a format that is publicly +documented (and with an implementation available to the public in +source code form), and must require no special password or key for +unpacking, reading or copying. + + 7. Additional Terms. + + "Additional permissions" are terms that supplement the terms of this +License by making exceptions from one or more of its conditions. +Additional permissions that are applicable to the entire Program shall +be treated as though they were included in this License, to the extent +that they are valid under applicable law. If additional permissions +apply only to part of the Program, that part may be used separately +under those permissions, but the entire Program remains governed by +this License without regard to the additional permissions. + + When you convey a copy of a covered work, you may at your option +remove any additional permissions from that copy, or from any part of +it. (Additional permissions may be written to require their own +removal in certain cases when you modify the work.) You may place +additional permissions on material, added by you to a covered work, +for which you have or can give appropriate copyright permission. + + Notwithstanding any other provision of this License, for material you +add to a covered work, you may (if authorized by the copyright holders of +that material) supplement the terms of this License with terms: + + a) Disclaiming warranty or limiting liability differently from the + terms of sections 15 and 16 of this License; or + + b) Requiring preservation of specified reasonable legal notices or + author attributions in that material or in the Appropriate Legal + Notices displayed by works containing it; or + + c) Prohibiting misrepresentation of the origin of that material, or + requiring that modified versions of such material be marked in + reasonable ways as different from the original version; or + + d) Limiting the use for publicity purposes of names of licensors or + authors of the material; or + + e) Declining to grant rights under trademark law for use of some + trade names, trademarks, or service marks; or + + f) Requiring indemnification of licensors and authors of that + material by anyone who conveys the material (or modified versions of + it) with contractual assumptions of liability to the recipient, for + any liability that these contractual assumptions directly impose on + those licensors and authors. + + All other non-permissive additional terms are considered "further +restrictions" within the meaning of section 10. If the Program as you +received it, or any part of it, contains a notice stating that it is +governed by this License along with a term that is a further +restriction, you may remove that term. If a license document contains +a further restriction but permits relicensing or conveying under this +License, you may add to a covered work material governed by the terms +of that license document, provided that the further restriction does +not survive such relicensing or conveying. + + If you add terms to a covered work in accord with this section, you +must place, in the relevant source files, a statement of the +additional terms that apply to those files, or a notice indicating +where to find the applicable terms. + + Additional terms, permissive or non-permissive, may be stated in the +form of a separately written license, or stated as exceptions; +the above requirements apply either way. + + 8. Termination. + + You may not propagate or modify a covered work except as expressly +provided under this License. Any attempt otherwise to propagate or +modify it is void, and will automatically terminate your rights under +this License (including any patent licenses granted under the third +paragraph of section 11). + + However, if you cease all violation of this License, then your +license from a particular copyright holder is reinstated (a) +provisionally, unless and until the copyright holder explicitly and +finally terminates your license, and (b) permanently, if the copyright +holder fails to notify you of the violation by some reasonable means +prior to 60 days after the cessation. + + Moreover, your license from a particular copyright holder is +reinstated permanently if the copyright holder notifies you of the +violation by some reasonable means, this is the first time you have +received notice of violation of this License (for any work) from that +copyright holder, and you cure the violation prior to 30 days after +your receipt of the notice. + + Termination of your rights under this section does not terminate the +licenses of parties who have received copies or rights from you under +this License. If your rights have been terminated and not permanently +reinstated, you do not qualify to receive new licenses for the same +material under section 10. + + 9. Acceptance Not Required for Having Copies. + + You are not required to accept this License in order to receive or +run a copy of the Program. Ancillary propagation of a covered work +occurring solely as a consequence of using peer-to-peer transmission +to receive a copy likewise does not require acceptance. However, +nothing other than this License grants you permission to propagate or +modify any covered work. These actions infringe copyright if you do +not accept this License. Therefore, by modifying or propagating a +covered work, you indicate your acceptance of this License to do so. + + 10. Automatic Licensing of Downstream Recipients. + + Each time you convey a covered work, the recipient automatically +receives a license from the original licensors, to run, modify and +propagate that work, subject to this License. You are not responsible +for enforcing compliance by third parties with this License. + + An "entity transaction" is a transaction transferring control of an +organization, or substantially all assets of one, or subdividing an +organization, or merging organizations. If propagation of a covered +work results from an entity transaction, each party to that +transaction who receives a copy of the work also receives whatever +licenses to the work the party's predecessor in interest had or could +give under the previous paragraph, plus a right to possession of the +Corresponding Source of the work from the predecessor in interest, if +the predecessor has it or can get it with reasonable efforts. + + You may not impose any further restrictions on the exercise of the +rights granted or affirmed under this License. For example, you may +not impose a license fee, royalty, or other charge for exercise of +rights granted under this License, and you may not initiate litigation +(including a cross-claim or counterclaim in a lawsuit) alleging that +any patent claim is infringed by making, using, selling, offering for +sale, or importing the Program or any portion of it. + + 11. Patents. + + A "contributor" is a copyright holder who authorizes use under this +License of the Program or a work on which the Program is based. The +work thus licensed is called the contributor's "contributor version". + + A contributor's "essential patent claims" are all patent claims +owned or controlled by the contributor, whether already acquired or +hereafter acquired, that would be infringed by some manner, permitted +by this License, of making, using, or selling its contributor version, +but do not include claims that would be infringed only as a +consequence of further modification of the contributor version. For +purposes of this definition, "control" includes the right to grant +patent sublicenses in a manner consistent with the requirements of +this License. + + Each contributor grants you a non-exclusive, worldwide, royalty-free +patent license under the contributor's essential patent claims, to +make, use, sell, offer for sale, import and otherwise run, modify and +propagate the contents of its contributor version. + + In the following three paragraphs, a "patent license" is any express +agreement or commitment, however denominated, not to enforce a patent +(such as an express permission to practice a patent or covenant not to +sue for patent infringement). To "grant" such a patent license to a +party means to make such an agreement or commitment not to enforce a +patent against the party. + + If you convey a covered work, knowingly relying on a patent license, +and the Corresponding Source of the work is not available for anyone +to copy, free of charge and under the terms of this License, through a +publicly available network server or other readily accessible means, +then you must either (1) cause the Corresponding Source to be so +available, or (2) arrange to deprive yourself of the benefit of the +patent license for this particular work, or (3) arrange, in a manner +consistent with the requirements of this License, to extend the patent +license to downstream recipients. "Knowingly relying" means you have +actual knowledge that, but for the patent license, your conveying the +covered work in a country, or your recipient's use of the covered work +in a country, would infringe one or more identifiable patents in that +country that you have reason to believe are valid. + + If, pursuant to or in connection with a single transaction or +arrangement, you convey, or propagate by procuring conveyance of, a +covered work, and grant a patent license to some of the parties +receiving the covered work authorizing them to use, propagate, modify +or convey a specific copy of the covered work, then the patent license +you grant is automatically extended to all recipients of the covered +work and works based on it. + + A patent license is "discriminatory" if it does not include within +the scope of its coverage, prohibits the exercise of, or is +conditioned on the non-exercise of one or more of the rights that are +specifically granted under this License. You may not convey a covered +work if you are a party to an arrangement with a third party that is +in the business of distributing software, under which you make payment +to the third party based on the extent of your activity of conveying +the work, and under which the third party grants, to any of the +parties who would receive the covered work from you, a discriminatory +patent license (a) in connection with copies of the covered work +conveyed by you (or copies made from those copies), or (b) primarily +for and in connection with specific products or compilations that +contain the covered work, unless you entered into that arrangement, +or that patent license was granted, prior to 28 March 2007. + + Nothing in this License shall be construed as excluding or limiting +any implied license or other defenses to infringement that may +otherwise be available to you under applicable patent law. + + 12. No Surrender of Others' Freedom. + + If conditions are imposed on you (whether by court order, agreement or +otherwise) that contradict the conditions of this License, they do not +excuse you from the conditions of this License. If you cannot convey a +covered work so as to satisfy simultaneously your obligations under this +License and any other pertinent obligations, then as a consequence you may +not convey it at all. For example, if you agree to terms that obligate you +to collect a royalty for further conveying from those to whom you convey +the Program, the only way you could satisfy both those terms and this +License would be to refrain entirely from conveying the Program. + + 13. Use with the GNU Affero General Public License. + + Notwithstanding any other provision of this License, you have +permission to link or combine any covered work with a work licensed +under version 3 of the GNU Affero General Public License into a single +combined work, and to convey the resulting work. The terms of this +License will continue to apply to the part which is the covered work, +but the special requirements of the GNU Affero General Public License, +section 13, concerning interaction through a network will apply to the +combination as such. + + 14. Revised Versions of this License. + + The Free Software Foundation may publish revised and/or new versions of +the GNU General Public License from time to time. Such new versions will +be similar in spirit to the present version, but may differ in detail to +address new problems or concerns. + + Each version is given a distinguishing version number. If the +Program specifies that a certain numbered version of the GNU General +Public License "or any later version" applies to it, you have the +option of following the terms and conditions either of that numbered +version or of any later version published by the Free Software +Foundation. If the Program does not specify a version number of the +GNU General Public License, you may choose any version ever published +by the Free Software Foundation. + + If the Program specifies that a proxy can decide which future +versions of the GNU General Public License can be used, that proxy's +public statement of acceptance of a version permanently authorizes you +to choose that version for the Program. + + Later license versions may give you additional or different +permissions. However, no additional obligations are imposed on any +author or copyright holder as a result of your choosing to follow a +later version. + + 15. Disclaimer of Warranty. + + THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY +APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT +HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY +OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, +THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR +PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM +IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF +ALL NECESSARY SERVICING, REPAIR OR CORRECTION. + + 16. Limitation of Liability. + + IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING +WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS +THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY +GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE +USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF +DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD +PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), +EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF +SUCH DAMAGES. + + 17. Interpretation of Sections 15 and 16. + + If the disclaimer of warranty and limitation of liability provided +above cannot be given local legal effect according to their terms, +reviewing courts shall apply local law that most closely approximates +an absolute waiver of all civil liability in connection with the +Program, unless a warranty or assumption of liability accompanies a +copy of the Program in return for a fee. + + END OF TERMS AND CONDITIONS + + How to Apply These Terms to Your New Programs + + If you develop a new program, and you want it to be of the greatest +possible use to the public, the best way to achieve this is to make it +free software which everyone can redistribute and change under these terms. + + To do so, attach the following notices to the program. It is safest +to attach them to the start of each source file to most effectively +state the exclusion of warranty; and each file should have at least +the "copyright" line and a pointer to where the full notice is found. + + + Copyright (C) + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU General Public License as published by + the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU General Public License for more details. + + You should have received a copy of the GNU General Public License + along with this program. If not, see . + +Also add information on how to contact you by electronic and paper mail. + + If the program does terminal interaction, make it output a short +notice like this when it starts in an interactive mode: + + Copyright (C) + This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'. + This is free software, and you are welcome to redistribute it + under certain conditions; type `show c' for details. + +The hypothetical commands `show w' and `show c' should show the appropriate +parts of the General Public License. Of course, your program's commands +might be different; for a GUI interface, you would use an "about box". + + You should also get your employer (if you work as a programmer) or school, +if any, to sign a "copyright disclaimer" for the program, if necessary. +For more information on this, and how to apply and follow the GNU GPL, see +. + + The GNU General Public License does not permit incorporating your program +into proprietary programs. If your program is a subroutine library, you +may consider it more useful to permit linking proprietary applications with +the library. If this is what you want to do, use the GNU Lesser General +Public License instead of this License. But first, please read +. diff --git a/Makefile.toml b/Makefile.toml new file mode 100644 index 000000000..303a15b2d --- /dev/null +++ b/Makefile.toml @@ -0,0 +1,70 @@ +extend = [ + { path = "schema.Makefile.toml" }, + { path = "coverage_grcov.Makefile.toml" } +] + +[config] +default_to_workspace = false + +[env] +# Directory with wasm files used by integration tests (another directory can be used instead, for example 'artifacts' from rust-optimizer) +ARTIFACTS_DIR_PATH = "target/wasm32-unknown-unknown/release" + +[tasks.build] +command = "cargo" +args = ["build", "--release", "--target", "wasm32-unknown-unknown", "--locked"] + +[tasks.rust-optimizer] +script = """ +if [[ $(arch) == "arm64" ]]; then + image="cosmwasm/workspace-optimizer-arm64:0.12.11" +else + image="cosmwasm/workspace-optimizer:0.12.11" +fi +docker run --rm -v "$(pwd)":/code \ + --mount type=volume,source="$(basename "$(pwd)")_cache",target=/code/target \ + --mount type=volume,source=registry_cache,target=/usr/local/cargo/registry \ + ${image} +""" + +[tasks.test] +command = "cargo" +args = ["test", "--locked"] + +[tasks.unit-test] +command = "cargo" +args = ["test", "--locked", "--workspace", "--exclude", "mars-integration-tests"] + +[tasks.integration-test] +command = "cargo" +args = ["test", "--locked", "--package", "mars-integration-tests"] + +[tasks.fmt] +toolchain = "nightly" +command = "cargo" +args = ["fmt", "--all", "--check"] + +[tasks.clippy] +command = "cargo" +args = ["clippy", "--tests", "--", "-D", "warnings"] + +[tasks.audit] +command = "cargo" +args = ["audit"] + +[tasks.coverage-html] +alias = "coverage-grcov-html" + +[tasks.coverage-lcov] +alias = "coverage-grcov-lcov" + +[tasks.all-actions] +dependencies = [ + "fmt", + "clippy", + "build", + "test", + "audit", + "generate-all-schemas", + "rust-optimizer", +] diff --git a/README.md b/README.md new file mode 100644 index 000000000..44dc94fc3 --- /dev/null +++ b/README.md @@ -0,0 +1 @@ +# Mars Protocol: Common Contracts diff --git a/clippy.toml b/clippy.toml new file mode 100644 index 000000000..ba34bf464 --- /dev/null +++ b/clippy.toml @@ -0,0 +1 @@ +too-many-arguments-threshold = 8 diff --git a/codecov.yml b/codecov.yml new file mode 100644 index 000000000..8555bf2c4 --- /dev/null +++ b/codecov.yml @@ -0,0 +1,10 @@ +comment: false + +coverage: + status: + project: + default: + threshold: 0.05% + patch: + default: + threshold: 0.05% diff --git a/contracts/swapper/base/Cargo.toml b/contracts/swapper/base/Cargo.toml new file mode 100644 index 000000000..97804a11b --- /dev/null +++ b/contracts/swapper/base/Cargo.toml @@ -0,0 +1,30 @@ +[package] +name = "mars-swapper-base" +version = { workspace = true } +authors = { workspace = true } +license = { workspace = true } +edition = { workspace = true } +repository = { workspace = true } +homepage = { workspace = true } +documentation = { workspace = true } +keywords = { workspace = true } + +[lib] +crate-type = ["cdylib", "rlib"] + +[features] +# for quicker tests, cargo test --lib +# for more explicit tests, cargo test --features=backtraces +backtraces = ["cosmwasm-std/backtraces"] +library = [] + +[dependencies] +cosmwasm-schema = { workspace = true } +cosmwasm-std = { workspace = true } +cw-paginate = { workspace = true } +cw-storage-plus = { workspace = true } +mars-owner = { workspace = true } +schemars = { workspace = true } +serde = { workspace = true } +thiserror = { workspace = true } +mars-swapper = { workspace = true } diff --git a/contracts/swapper/base/examples/schema.rs b/contracts/swapper/base/examples/schema.rs new file mode 100644 index 000000000..a98b255fd --- /dev/null +++ b/contracts/swapper/base/examples/schema.rs @@ -0,0 +1,11 @@ +use cosmwasm_schema::write_api; +use cosmwasm_std::Empty; +use mars_swapper::msgs::{ExecuteMsg, InstantiateMsg, QueryMsg}; + +fn main() { + write_api! { + instantiate: InstantiateMsg, + query: QueryMsg, + execute: ExecuteMsg, + } +} diff --git a/contracts/swapper/base/src/contract.rs b/contracts/swapper/base/src/contract.rs new file mode 100644 index 000000000..ec6c402ec --- /dev/null +++ b/contracts/swapper/base/src/contract.rs @@ -0,0 +1,252 @@ +use std::marker::PhantomData; + +use cosmwasm_std::{ + to_binary, Addr, BankMsg, Binary, Coin, CosmosMsg, CustomMsg, CustomQuery, Decimal, Deps, + DepsMut, Env, MessageInfo, Response, WasmMsg, +}; +use cw_paginate::paginate_map; +use cw_storage_plus::{Bound, Map}; +use mars_owner::{Owner, OwnerInit::SetInitialOwner, OwnerUpdate}; +use mars_swapper::msgs::{ + EstimateExactInSwapResponse, ExecuteMsg, InstantiateMsg, QueryMsg, RouteResponse, + RoutesResponse, +}; + +use crate::{ContractError, ContractResult, Route}; + +pub struct SwapBase<'a, Q, M, R> +where + Q: CustomQuery, + M: CustomMsg, + R: Route, +{ + /// The contract's owner who has special rights to update contract + pub owner: Owner<'a>, + /// The trade route for each pair of input/output assets + pub routes: Map<'a, (String, String), R>, + /// Phantom data holds generics + pub custom_query: PhantomData, + pub custom_message: PhantomData, +} + +impl<'a, Q, M, R> Default for SwapBase<'a, Q, M, R> +where + Q: CustomQuery, + M: CustomMsg, + R: Route, +{ + fn default() -> Self { + Self { + owner: Owner::new("owner"), + routes: Map::new("routes"), + custom_query: PhantomData, + custom_message: PhantomData, + } + } +} + +impl<'a, Q, M, R> SwapBase<'a, Q, M, R> +where + Q: CustomQuery, + M: CustomMsg, + R: Route, +{ + pub fn instantiate( + &self, + deps: DepsMut, + msg: InstantiateMsg, + ) -> ContractResult> { + self.owner.initialize( + deps.storage, + deps.api, + SetInitialOwner { + owner: msg.owner, + }, + )?; + Ok(Response::default()) + } + + pub fn execute( + &self, + deps: DepsMut, + env: Env, + info: MessageInfo, + msg: ExecuteMsg, + ) -> ContractResult> { + match msg { + ExecuteMsg::UpdateOwner(update) => self.update_owner(deps, info, update), + ExecuteMsg::SetRoute { + denom_in, + denom_out, + route, + } => self.set_route(deps, info.sender, denom_in, denom_out, route), + ExecuteMsg::SwapExactIn { + coin_in, + denom_out, + slippage, + } => self.swap_exact_in(deps, env, info, coin_in, denom_out, slippage), + ExecuteMsg::TransferResult { + recipient, + denom_in, + denom_out, + } => self.transfer_result(deps, env, info, recipient, denom_in, denom_out), + } + } + + pub fn query(&self, deps: Deps, env: Env, msg: QueryMsg) -> ContractResult { + let res = match msg { + QueryMsg::Owner {} => to_binary(&self.owner.query(deps.storage)?), + QueryMsg::EstimateExactInSwap { + coin_in, + denom_out, + } => to_binary(&self.estimate_exact_in_swap(deps, env, coin_in, denom_out)?), + QueryMsg::Route { + denom_in, + denom_out, + } => to_binary(&self.query_route(deps, denom_in, denom_out)?), + QueryMsg::Routes { + start_after, + limit, + } => to_binary(&self.query_routes(deps, start_after, limit)?), + }; + res.map_err(Into::into) + } + + fn query_route( + &self, + deps: Deps, + denom_in: String, + denom_out: String, + ) -> ContractResult> { + Ok(RouteResponse { + denom_in: denom_in.clone(), + denom_out: denom_out.clone(), + route: self.routes.load(deps.storage, (denom_in, denom_out))?, + }) + } + + fn query_routes( + &self, + deps: Deps, + start_after: Option<(String, String)>, + limit: Option, + ) -> ContractResult> { + let start = start_after.map(Bound::exclusive); + paginate_map(&self.routes, deps.storage, start, limit, |(denom_in, denom_out), route| { + Ok(RouteResponse { + denom_in, + denom_out, + route, + }) + }) + } + + fn estimate_exact_in_swap( + &self, + deps: Deps, + env: Env, + coin_in: Coin, + denom_out: String, + ) -> ContractResult { + let route = self.routes.load(deps.storage, (coin_in.denom.clone(), denom_out))?; + route.estimate_exact_in_swap(&deps.querier, &env, &coin_in) + } + + fn swap_exact_in( + &self, + deps: DepsMut, + env: Env, + info: MessageInfo, + coin_in: Coin, + denom_out: String, + slippage: Decimal, + ) -> ContractResult> { + let swap_msg = self + .routes + .load(deps.storage, (coin_in.denom.clone(), denom_out.clone()))? + .build_exact_in_swap_msg(&deps.querier, &env, &coin_in, slippage)?; + + // Check balance of result of swapper and send back result to sender + let transfer_msg = CosmosMsg::Wasm(WasmMsg::Execute { + contract_addr: env.contract.address.to_string(), + funds: vec![], + msg: to_binary(&ExecuteMsg::::TransferResult { + recipient: info.sender, + denom_in: coin_in.denom.clone(), + denom_out: denom_out.clone(), + })?, + }); + + Ok(Response::new() + .add_message(swap_msg) + .add_message(transfer_msg) + .add_attribute("action", "swap_fn") + .add_attribute("denom_in", coin_in.denom) + .add_attribute("amount_in", coin_in.amount) + .add_attribute("denom_out", denom_out) + .add_attribute("slippage", slippage.to_string())) + } + + fn transfer_result( + &self, + deps: DepsMut, + env: Env, + info: MessageInfo, + recipient: Addr, + denom_in: String, + denom_out: String, + ) -> ContractResult> { + // Internal callback only + if info.sender != env.contract.address { + return Err(ContractError::Unauthorized { + user: info.sender.to_string(), + action: "transfer result".to_string(), + }); + }; + + let denom_in_balance = + deps.querier.query_balance(env.contract.address.clone(), denom_in)?; + let denom_out_balance = deps.querier.query_balance(env.contract.address, denom_out)?; + + let transfer_msg = CosmosMsg::Bank(BankMsg::Send { + to_address: recipient.to_string(), + amount: vec![denom_in_balance, denom_out_balance] + .iter() + .filter(|c| !c.amount.is_zero()) + .cloned() + .collect(), + }); + + Ok(Response::new().add_attribute("action", "transfer_result").add_message(transfer_msg)) + } + + fn set_route( + &self, + deps: DepsMut, + sender: Addr, + denom_in: String, + denom_out: String, + route: R, + ) -> ContractResult> { + self.owner.assert_owner(deps.storage, &sender)?; + + route.validate(&deps.querier, &denom_in, &denom_out)?; + + self.routes.save(deps.storage, (denom_in.clone(), denom_out.clone()), &route)?; + + Ok(Response::new() + .add_attribute("action", "rover/base/set_route") + .add_attribute("denom_in", denom_in) + .add_attribute("denom_out", denom_out) + .add_attribute("route", route.to_string())) + } + + fn update_owner( + &self, + deps: DepsMut, + info: MessageInfo, + update: OwnerUpdate, + ) -> ContractResult> { + Ok(self.owner.update(deps, info, update)?) + } +} diff --git a/contracts/swapper/base/src/error.rs b/contracts/swapper/base/src/error.rs new file mode 100644 index 000000000..8156d5edc --- /dev/null +++ b/contracts/swapper/base/src/error.rs @@ -0,0 +1,40 @@ +use cosmwasm_std::{CheckedMultiplyRatioError, DecimalRangeExceeded, OverflowError, StdError}; +use mars_owner::OwnerError; +use thiserror::Error; + +#[derive(Error, Debug, PartialEq)] +pub enum ContractError { + #[error("{0}")] + OwnerError(#[from] OwnerError), + + #[error("{0}")] + DecimalRangeExceeded(#[from] DecimalRangeExceeded), + + #[error("Invalid route: {reason}")] + InvalidRoute { + reason: String, + }, + + #[error("{0}")] + Overflow(#[from] OverflowError), + + #[error("{0}")] + CheckedMultiplyRatio(#[from] CheckedMultiplyRatioError), + + #[error("{denom_a:?}-{denom_b:?} is not an available pool")] + PoolNotFound { + denom_a: String, + denom_b: String, + }, + + #[error("{0}")] + Std(#[from] StdError), + + #[error("{user:?} is not authorized to {action:?}")] + Unauthorized { + user: String, + action: String, + }, +} + +pub type ContractResult = Result; diff --git a/contracts/swapper/base/src/lib.rs b/contracts/swapper/base/src/lib.rs new file mode 100644 index 000000000..d0ca995d1 --- /dev/null +++ b/contracts/swapper/base/src/lib.rs @@ -0,0 +1,7 @@ +mod contract; +mod error; +mod traits; + +pub use contract::*; +pub use error::*; +pub use traits::*; diff --git a/contracts/swapper/base/src/traits.rs b/contracts/swapper/base/src/traits.rs new file mode 100644 index 000000000..aa9a74d64 --- /dev/null +++ b/contracts/swapper/base/src/traits.rs @@ -0,0 +1,40 @@ +use std::fmt::{Debug, Display}; + +use cosmwasm_std::{Coin, CosmosMsg, CustomMsg, CustomQuery, Decimal, Env, QuerierWrapper}; +use mars_swapper::msgs::EstimateExactInSwapResponse; +use schemars::JsonSchema; +use serde::{de::DeserializeOwned, Serialize}; + +use crate::ContractResult; + +pub trait Route: + Serialize + DeserializeOwned + Clone + Debug + Display + PartialEq + JsonSchema +where + M: CustomMsg, + Q: CustomQuery, +{ + /// Determine whether the route is valid, given a pair of input and output denoms + fn validate( + &self, + querier: &QuerierWrapper, + denom_in: &str, + denom_out: &str, + ) -> ContractResult<()>; + + /// Build a message for executing the trade, given an input denom and amount + fn build_exact_in_swap_msg( + &self, + querier: &QuerierWrapper, + env: &Env, + coin_in: &Coin, + slippage: Decimal, + ) -> ContractResult>; + + /// Query to get the estimate result of a swap + fn estimate_exact_in_swap( + &self, + querier: &QuerierWrapper, + env: &Env, + coin_in: &Coin, + ) -> ContractResult; +} diff --git a/contracts/swapper/mock/Cargo.toml b/contracts/swapper/mock/Cargo.toml new file mode 100644 index 000000000..1c613b509 --- /dev/null +++ b/contracts/swapper/mock/Cargo.toml @@ -0,0 +1,29 @@ +[package] +name = "mars-swapper-mock" +version = { workspace = true } +authors = { workspace = true } +license = { workspace = true } +edition = { workspace = true } +repository = { workspace = true } +homepage = { workspace = true } +documentation = { workspace = true } +keywords = { workspace = true } + +[lib] +crate-type = ["cdylib", "rlib"] + +[features] +# for quicker tests, cargo test --lib +# for more explicit tests, cargo test --features=backtraces +backtraces = ["cosmwasm-std/backtraces"] +library = [] + +[dependencies] +cosmwasm-std = { workspace = true } +cw-storage-plus = { workspace = true } +thiserror = { workspace = true } +mars-swapper = { workspace = true } + +[dev-dependencies] +anyhow = { workspace = true } +cw-multi-test = { workspace = true } diff --git a/contracts/swapper/mock/src/contract.rs b/contracts/swapper/mock/src/contract.rs new file mode 100644 index 000000000..902c627b7 --- /dev/null +++ b/contracts/swapper/mock/src/contract.rs @@ -0,0 +1,91 @@ +use cosmwasm_std::{ + coins, to_binary, BankMsg, Binary, Coin, CosmosMsg, Decimal, Deps, DepsMut, Empty, Env, + MessageInfo, Response, StdError, StdResult, Uint128, +}; +use mars_swapper::msgs::{EstimateExactInSwapResponse, ExecuteMsg, InstantiateMsg, QueryMsg}; + +pub const MOCK_SWAP_RESULT: Uint128 = Uint128::new(1337); + +#[cfg_attr(not(feature = "library"), cosmwasm_std::entry_point)] +pub fn instantiate( + _deps: DepsMut, + _env: Env, + _info: MessageInfo, + _msg: InstantiateMsg, +) -> StdResult { + Ok(Response::default()) +} + +#[cfg_attr(not(feature = "library"), cosmwasm_std::entry_point)] +pub fn execute( + deps: DepsMut, + env: Env, + info: MessageInfo, + msg: ExecuteMsg, +) -> StdResult { + match msg { + ExecuteMsg::UpdateOwner(_) => unimplemented!("not implemented"), + ExecuteMsg::SetRoute { + .. + } => unimplemented!("not implemented"), + ExecuteMsg::TransferResult { + .. + } => unimplemented!("not implemented"), + ExecuteMsg::SwapExactIn { + coin_in, + denom_out, + slippage, + } => swap_exact_in(deps, env, info, coin_in, denom_out, slippage), + } +} + +#[cfg_attr(not(feature = "library"), cosmwasm_std::entry_point)] +pub fn query(_deps: Deps, _env: Env, msg: QueryMsg) -> StdResult { + match msg { + QueryMsg::Owner { + .. + } => unimplemented!("not implemented"), + QueryMsg::Route { + .. + } => unimplemented!("not implemented"), + QueryMsg::Routes { + .. + } => unimplemented!("not implemented"), + QueryMsg::EstimateExactInSwap { + .. + } => to_binary(&estimate_exact_in_swap()), + } +} + +pub fn estimate_exact_in_swap() -> EstimateExactInSwapResponse { + EstimateExactInSwapResponse { + amount: MOCK_SWAP_RESULT, + } +} + +pub fn swap_exact_in( + deps: DepsMut, + env: Env, + info: MessageInfo, + coin_in: Coin, + denom_out: String, + _slippage: Decimal, +) -> StdResult { + let denom_in_balance = deps.querier.query_balance(env.contract.address, coin_in.denom)?; + if denom_in_balance.amount < coin_in.amount { + return Err(StdError::generic_err("Did not send funds")); + } + + if denom_out != "uosmo" { + return Err(StdError::generic_err("Mock swapper can only have uosmo as denom out")); + } + + // This is dependent on the mock env to pre-fund this contract with uosmo coins + // simulating a swap has taken place + let transfer_msg = CosmosMsg::Bank(BankMsg::Send { + to_address: info.sender.to_string(), + amount: coins(MOCK_SWAP_RESULT.u128(), denom_out), + }); + + Ok(Response::new().add_attribute("action", "transfer_result").add_message(transfer_msg)) +} diff --git a/contracts/swapper/mock/src/lib.rs b/contracts/swapper/mock/src/lib.rs new file mode 100644 index 000000000..2943dbb50 --- /dev/null +++ b/contracts/swapper/mock/src/lib.rs @@ -0,0 +1 @@ +pub mod contract; diff --git a/contracts/swapper/osmosis/Cargo.toml b/contracts/swapper/osmosis/Cargo.toml new file mode 100644 index 000000000..6110ee1ef --- /dev/null +++ b/contracts/swapper/osmosis/Cargo.toml @@ -0,0 +1,36 @@ +[package] +name = "mars-swapper-osmosis" +version = { workspace = true } +authors = { workspace = true } +license = { workspace = true } +edition = { workspace = true } +repository = { workspace = true } +homepage = { workspace = true } +documentation = { workspace = true } +keywords = { workspace = true } + +[lib] +crate-type = ["cdylib", "rlib"] + +[features] +# for quicker tests, cargo test --lib +# for more explicit tests, cargo test --features=backtraces +backtraces = ["cosmwasm-std/backtraces"] +library = [] + +[dependencies] +cosmwasm-schema = { workspace = true } +cosmwasm-std = { workspace = true } +cw2 = { workspace = true } +cw-storage-plus = { workspace = true } +mars-osmosis = { workspace = true } +mars-owner = { workspace = true } +mars-swapper-base = { workspace = true } +osmosis-std = { workspace = true } +schemars = { workspace = true } +thiserror = { workspace = true } +mars-swapper = { workspace = true } + +[dev-dependencies] +anyhow = { workspace = true } +osmosis-test-tube = { workspace = true } diff --git a/contracts/swapper/osmosis/examples/schema.rs b/contracts/swapper/osmosis/examples/schema.rs new file mode 100644 index 000000000..c9d47e062 --- /dev/null +++ b/contracts/swapper/osmosis/examples/schema.rs @@ -0,0 +1,11 @@ +use cosmwasm_schema::write_api; +use mars_swapper::msgs::{ExecuteMsg, InstantiateMsg, QueryMsg}; +use mars_swapper_osmosis::route::OsmosisRoute; + +fn main() { + write_api! { + instantiate: InstantiateMsg, + execute: ExecuteMsg, + query: QueryMsg, + } +} diff --git a/contracts/swapper/osmosis/src/contract.rs b/contracts/swapper/osmosis/src/contract.rs new file mode 100644 index 000000000..85b34afba --- /dev/null +++ b/contracts/swapper/osmosis/src/contract.rs @@ -0,0 +1,38 @@ +use cosmwasm_std::{entry_point, Binary, Deps, DepsMut, Empty, Env, MessageInfo, Response}; +use cw2::set_contract_version; +use mars_swapper::msgs::{ExecuteMsg, InstantiateMsg, QueryMsg}; +use mars_swapper_base::{ContractResult, SwapBase}; + +use crate::route::OsmosisRoute; + +/// The Osmosis swapper contract inherits logic from the base swapper contract +pub type OsmosisSwap<'a> = SwapBase<'a, Empty, Empty, OsmosisRoute>; + +const CONTRACT_NAME: &str = env!("CARGO_PKG_NAME"); +const CONTRACT_VERSION: &str = env!("CARGO_PKG_VERSION"); + +#[cfg_attr(not(feature = "library"), entry_point)] +pub fn instantiate( + deps: DepsMut, + _env: Env, + _info: MessageInfo, + msg: InstantiateMsg, +) -> ContractResult { + set_contract_version(deps.storage, format!("crates.io:{CONTRACT_NAME}"), CONTRACT_VERSION)?; + OsmosisSwap::default().instantiate(deps, msg) +} + +#[cfg_attr(not(feature = "library"), entry_point)] +pub fn execute( + deps: DepsMut, + env: Env, + info: MessageInfo, + msg: ExecuteMsg, +) -> ContractResult { + OsmosisSwap::default().execute(deps, env, info, msg) +} + +#[cfg_attr(not(feature = "library"), entry_point)] +pub fn query(deps: Deps, env: Env, msg: QueryMsg) -> ContractResult { + OsmosisSwap::default().query(deps, env, msg) +} diff --git a/contracts/swapper/osmosis/src/helpers.rs b/contracts/swapper/osmosis/src/helpers.rs new file mode 100644 index 000000000..5f09f658e --- /dev/null +++ b/contracts/swapper/osmosis/src/helpers.rs @@ -0,0 +1,18 @@ +use std::{collections::HashSet, hash::Hash}; + +use cosmwasm_std::{Decimal, Uint128}; + +/// Build a hashset from array data +pub(crate) fn hashset(data: &[T]) -> HashSet { + data.iter().cloned().collect() +} + +pub trait IntoUint128 { + fn uint128(&self) -> Uint128; +} + +impl IntoUint128 for Decimal { + fn uint128(&self) -> Uint128 { + *self * Uint128::new(1) + } +} diff --git a/contracts/swapper/osmosis/src/lib.rs b/contracts/swapper/osmosis/src/lib.rs new file mode 100644 index 000000000..fdbe29de5 --- /dev/null +++ b/contracts/swapper/osmosis/src/lib.rs @@ -0,0 +1,3 @@ +pub mod contract; +pub mod helpers; +pub mod route; diff --git a/contracts/swapper/osmosis/src/route.rs b/contracts/swapper/osmosis/src/route.rs new file mode 100644 index 000000000..f9ebb2a87 --- /dev/null +++ b/contracts/swapper/osmosis/src/route.rs @@ -0,0 +1,180 @@ +use std::fmt; + +use cosmwasm_schema::cw_serde; +use cosmwasm_std::{ + BlockInfo, Coin, CosmosMsg, Decimal, Empty, Env, Fraction, QuerierWrapper, Uint128, +}; +use mars_osmosis::helpers::{has_denom, query_arithmetic_twap_price, query_pool}; +use mars_swapper::msgs::EstimateExactInSwapResponse; +use mars_swapper_base::{ContractError, ContractResult, Route}; +use osmosis_std::types::osmosis::gamm::v1beta1::{MsgSwapExactAmountIn, SwapAmountInRoute}; + +use crate::helpers::hashset; + +/// 10 min in seconds (Risk Team recommendation) +const TWAP_WINDOW_SIZE_SECONDS: u64 = 600u64; + +#[cw_serde] +pub struct OsmosisRoute(pub Vec); + +impl fmt::Display for OsmosisRoute { + fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result { + let s = self + .0 + .iter() + .map(|step| format!("{}:{}", step.pool_id, step.token_out_denom)) + .collect::>() + .join("|"); + write!(f, "{s}") + } +} + +impl Route for OsmosisRoute { + // Perform basic validation of the swap steps + fn validate( + &self, + querier: &QuerierWrapper, + denom_in: &str, + denom_out: &str, + ) -> ContractResult<()> { + let steps = &self.0; + + // there must be at least one step + if steps.is_empty() { + return Err(ContractError::InvalidRoute { + reason: "the route must contain at least one step".to_string(), + }); + } + + // for each step: + // - the pool must contain the input and output denoms + // - the output denom must not be the same as the input denom of a previous step (i.e. the route must not contain a loop) + let mut prev_denom_out = denom_in; + let mut seen_denoms = hashset(&[denom_in]); + for (i, step) in steps.iter().enumerate() { + let pool = query_pool(querier, step.pool_id)?; + + if !has_denom(prev_denom_out, &pool.pool_assets) { + return Err(ContractError::InvalidRoute { + reason: format!( + "step {}: pool {} does not contain input denom {}", + i + 1, + step.pool_id, + prev_denom_out + ), + }); + } + + if !has_denom(&step.token_out_denom, &pool.pool_assets) { + return Err(ContractError::InvalidRoute { + reason: format!( + "step {}: pool {} does not contain output denom {}", + i + 1, + step.pool_id, + &step.token_out_denom + ), + }); + } + + if seen_denoms.contains(step.token_out_denom.as_str()) { + return Err(ContractError::InvalidRoute { + reason: format!( + "route contains a loop: denom {} seen twice", + step.token_out_denom + ), + }); + } + + prev_denom_out = &step.token_out_denom; + seen_denoms.insert(&step.token_out_denom); + } + + // the route's final output denom must match the desired output denom + if prev_denom_out != denom_out { + return Err(ContractError::InvalidRoute { + reason: format!( + "the route's output denom {prev_denom_out} does not match the desired output {denom_out}", + ), + }); + } + + Ok(()) + } + + /// Build a CosmosMsg that swaps given an input denom and amount + fn build_exact_in_swap_msg( + &self, + querier: &QuerierWrapper, + env: &Env, + coin_in: &Coin, + slippage: Decimal, + ) -> ContractResult { + let steps = &self.0; + + steps.first().ok_or(ContractError::InvalidRoute { + reason: "the route must contain at least one step".to_string(), + })?; + + let out_amount = query_out_amount(querier, &env.block, coin_in, steps)?; + let min_out_amount = (Decimal::one() - slippage) * out_amount; + + let swap_msg: CosmosMsg = MsgSwapExactAmountIn { + sender: env.contract.address.to_string(), + routes: steps.to_vec(), + token_in: Some(osmosis_std::types::cosmos::base::v1beta1::Coin { + denom: coin_in.denom.clone(), + amount: coin_in.amount.to_string(), + }), + token_out_min_amount: min_out_amount.to_string(), + } + .into(); + Ok(swap_msg) + } + + fn estimate_exact_in_swap( + &self, + querier: &QuerierWrapper, + env: &Env, + coin_in: &Coin, + ) -> ContractResult { + let out_amount = query_out_amount(querier, &env.block, coin_in, &self.0)?; + Ok(EstimateExactInSwapResponse { + amount: out_amount, + }) + } +} + +/// Query how much amount of denom_out we get for denom_in. +/// +/// Example calculation: +/// If we want to swap atom to usdc and configured routes are [pool_1 (atom/osmo), pool_69 (osmo/usdc)] (no direct pool of atom/usdc): +/// 1) query pool_1 to get price for atom/osmo +/// 2) query pool_69 to get price for osmo/usdc +/// 3) atom/usdc = (price for atom/osmo) * (price for osmo/usdc) +/// 4) usdc_out_amount = (atom amount) * (price for atom/usdc) +fn query_out_amount( + querier: &QuerierWrapper, + block: &BlockInfo, + coin_in: &Coin, + steps: &[SwapAmountInRoute], +) -> ContractResult { + let start_time = block.time.seconds() - TWAP_WINDOW_SIZE_SECONDS; + + let mut price = Decimal::one(); + let mut denom_in = coin_in.denom.clone(); + for step in steps { + let step_price = query_arithmetic_twap_price( + querier, + step.pool_id, + &denom_in, + &step.token_out_denom, + start_time, + )?; + price = price.checked_mul(step_price)?; + denom_in = step.token_out_denom.clone(); + } + + let out_amount = + coin_in.amount.checked_multiply_ratio(price.numerator(), price.denominator())?; + Ok(out_amount) +} diff --git a/contracts/swapper/osmosis/tests/helpers.rs b/contracts/swapper/osmosis/tests/helpers.rs new file mode 100644 index 000000000..f32815979 --- /dev/null +++ b/contracts/swapper/osmosis/tests/helpers.rs @@ -0,0 +1,139 @@ +use std::{fmt::Display, str::FromStr}; + +use cosmwasm_std::{Coin, Decimal, Uint128}; +use mars_swapper::msgs::InstantiateMsg; +use osmosis_std::types::osmosis::gamm::v1beta1::{ + MsgSwapExactAmountIn, MsgSwapExactAmountInResponse, SwapAmountInRoute, +}; +use osmosis_test_tube::{ + cosmrs::proto::cosmos::bank::v1beta1::QueryBalanceRequest, Account, Bank, ExecuteResponse, + Gamm, OsmosisTestApp, Runner, RunnerError, SigningAccount, Wasm, +}; + +const CONTRACT_NAME: &str = env!("CARGO_PKG_NAME"); + +pub fn wasm_file() -> String { + let artifacts_dir = + std::env::var("ARTIFACTS_DIR_PATH").unwrap_or_else(|_| "artifacts".to_string()); + let snaked_name = CONTRACT_NAME.replace('-', "_"); + format!("../../../{artifacts_dir}/{snaked_name}.wasm") +} + +pub fn instantiate_contract(wasm: &Wasm, owner: &SigningAccount) -> String { + let wasm_byte_code = std::fs::read(wasm_file()).unwrap(); + let code_id = wasm.store_code(&wasm_byte_code, None, owner).unwrap().data.code_id; + + wasm.instantiate( + code_id, + &InstantiateMsg { + owner: owner.address(), + }, + None, + Some("swapper-osmosis-contract"), + &[], + owner, + ) + .unwrap() + .data + .address +} + +/// Every execution creates new block and block timestamp will +5 secs from last block +/// (see https://github.com/osmosis-labs/osmosis-rust/issues/53#issuecomment-1311451418). +/// +/// We need to swap n times to pass TWAP_WINDOW_SIZE_SECONDS (10 min). Every swap moves block 5 sec so +/// n = TWAP_WINDOW_SIZE_SECONDS / 5 sec = 600 sec / 5 sec = 120. +/// We need to swap at least 120 times to create historical index for TWAP. +pub fn swap_to_create_twap_records( + app: &OsmosisTestApp, + signer: &SigningAccount, + pool_id: u64, + coin_in: Coin, + denom_out: &str, +) { + swap_n_times(app, signer, pool_id, coin_in, denom_out, 120u64); +} + +pub fn swap_n_times( + app: &OsmosisTestApp, + signer: &SigningAccount, + pool_id: u64, + coin_in: Coin, + denom_out: &str, + n: u64, +) { + for _ in 0..n { + swap(app, signer, pool_id, coin_in.clone(), denom_out); + } +} + +fn swap( + app: &OsmosisTestApp, + signer: &SigningAccount, + pool_id: u64, + coin_in: Coin, + denom_out: &str, +) -> ExecuteResponse { + app.execute::<_, MsgSwapExactAmountInResponse>( + MsgSwapExactAmountIn { + sender: signer.address(), + routes: vec![SwapAmountInRoute { + pool_id, + token_out_denom: denom_out.to_string(), + }], + token_in: Some(coin_in.into()), + token_out_min_amount: "1".to_string(), + }, + MsgSwapExactAmountIn::TYPE_URL, + signer, + ) + .unwrap() +} + +/// Query price for 1 denom from pool_id (quoted in second denom from the pool). +/// +/// Example: +/// pool consists of: 250 uosmo and 100 uatom +/// query price for uatom so 1 uatom = 2.5 uosmo +pub fn query_price_from_pool(gamm: &Gamm, pool_id: u64, denom: &str) -> Decimal { + let pool_assets = &gamm.query_pool(pool_id).unwrap().pool_assets; + let coin_1 = pool_assets[0].token.as_ref().unwrap(); + let coin_2 = &pool_assets[1].token.as_ref().unwrap(); + let coin_1_amt = Uint128::from_str(&coin_1.amount).unwrap(); + let coin_2_amt = Uint128::from_str(&coin_2.amount).unwrap(); + + if coin_1.denom == denom { + Decimal::from_ratio(coin_2_amt, coin_1_amt) + } else if coin_2.denom == denom { + Decimal::from_ratio(coin_1_amt, coin_2_amt) + } else { + panic!("{denom} not found in the pool {pool_id}") + } +} + +pub fn query_balance(bank: &Bank, addr: &str, denom: &str) -> u128 { + bank.query_balance(&QueryBalanceRequest { + address: addr.to_string(), + denom: denom.to_string(), + }) + .unwrap() + .balance + .map(|c| u128::from_str(&c.amount).unwrap()) + .unwrap_or(0) +} + +pub fn assert_err(actual: RunnerError, expected: impl Display) { + match actual { + RunnerError::ExecuteError { + msg, + } => { + assert!(msg.contains(&format!("{expected}"))) + } + RunnerError::QueryError { + msg, + } => { + assert!(msg.contains(&format!("{expected}"))) + } + _ => panic!("Unhandled error"), + } +} diff --git a/contracts/swapper/osmosis/tests/test_enumerate_routes.rs b/contracts/swapper/osmosis/tests/test_enumerate_routes.rs new file mode 100644 index 000000000..9660c8bc2 --- /dev/null +++ b/contracts/swapper/osmosis/tests/test_enumerate_routes.rs @@ -0,0 +1,185 @@ +extern crate core; + +use std::collections::HashMap; + +use cosmwasm_std::coin; +use mars_swapper::msgs::{ExecuteMsg, QueryMsg, RouteResponse}; +use mars_swapper_osmosis::route::OsmosisRoute; +use osmosis_std::types::osmosis::gamm::v1beta1::SwapAmountInRoute; +use osmosis_test_tube::{Gamm, Module, OsmosisTestApp, SigningAccount, Wasm}; + +use crate::helpers::instantiate_contract; + +pub mod helpers; + +#[test] +fn enumerating_routes() { + let app = OsmosisTestApp::new(); + let wasm = Wasm::new(&app); + let signer = app + .init_account(&[ + coin(1_000_000_000_000, "uatom"), + coin(1_000_000_000_000, "uosmo"), + coin(1_000_000_000_000, "umars"), + coin(1_000_000_000_000, "uusdc"), + ]) + .unwrap(); + + let contract_addr = instantiate_contract(&wasm, &signer); + + let routes = create_pools_and_routes(&app, &signer); + + wasm.execute( + &contract_addr, + &ExecuteMsg::SetRoute { + denom_in: "uatom".to_string(), + denom_out: "umars".to_string(), + route: routes.get(&("uatom", "umars")).unwrap().clone(), + }, + &[], + &signer, + ) + .unwrap(); + + wasm.execute( + &contract_addr, + &ExecuteMsg::SetRoute { + denom_in: "uatom".to_string(), + denom_out: "uusdc".to_string(), + route: routes.get(&("uatom", "uusdc")).unwrap().clone(), + }, + &[], + &signer, + ) + .unwrap(); + + wasm.execute( + &contract_addr, + &ExecuteMsg::SetRoute { + denom_in: "uosmo".to_string(), + denom_out: "umars".to_string(), + route: routes.get(&("uosmo", "umars")).unwrap().clone(), + }, + &[], + &signer, + ) + .unwrap(); + + // NOTE: the response is ordered alphabetically + let expected = vec![ + RouteResponse { + denom_in: "uatom".to_string(), + denom_out: "umars".to_string(), + route: routes.get(&("uatom", "umars")).unwrap().clone(), + }, + RouteResponse { + denom_in: "uatom".to_string(), + denom_out: "uusdc".to_string(), + route: routes.get(&("uatom", "uusdc")).unwrap().clone(), + }, + RouteResponse { + denom_in: "uosmo".to_string(), + denom_out: "umars".to_string(), + route: routes.get(&("uosmo", "umars")).unwrap().clone(), + }, + ]; + + let res: Vec> = wasm + .query( + &contract_addr, + &QueryMsg::Routes { + start_after: None, + limit: None, + }, + ) + .unwrap(); + assert_eq!(res, expected); + + let res: Vec> = wasm + .query( + &contract_addr, + &QueryMsg::Routes { + start_after: None, + limit: Some(1), + }, + ) + .unwrap(); + assert_eq!(res, expected[..1]); + + let res: Vec> = wasm + .query( + &contract_addr, + &QueryMsg::Routes { + start_after: Some(("uatom".to_string(), "uosmo".to_string())), + limit: None, + }, + ) + .unwrap(); + assert_eq!(res, expected[1..]); +} + +fn create_pools_and_routes( + app: &OsmosisTestApp, + signer: &SigningAccount, +) -> HashMap<(&'static str, &'static str), OsmosisRoute> { + let gamm = Gamm::new(app); + + let pool_atom_osmo = gamm + .create_basic_pool(&[coin(6_000_000, "uatom"), coin(1_500_000, "uosmo")], signer) + .unwrap() + .data + .pool_id; + let pool_osmo_mars = gamm + .create_basic_pool(&[coin(100_000, "uosmo"), coin(1_000_000, "umars")], signer) + .unwrap() + .data + .pool_id; + let pool_osmo_usdc = gamm + .create_basic_pool(&[coin(100_000, "uosmo"), coin(1_000_000, "uusdc")], signer) + .unwrap() + .data + .pool_id; + + let mut map = HashMap::new(); + + // uosmo -> umars + map.insert( + ("uosmo", "umars"), + OsmosisRoute(vec![SwapAmountInRoute { + pool_id: pool_osmo_mars, + token_out_denom: "umars".to_string(), + }]), + ); + + // uatom -> uosmo -> umars + map.insert( + ("uatom", "umars"), + OsmosisRoute(vec![ + SwapAmountInRoute { + pool_id: pool_atom_osmo, + token_out_denom: "uosmo".to_string(), + }, + SwapAmountInRoute { + pool_id: pool_osmo_mars, + token_out_denom: "umars".to_string(), + }, + ]), + ); + + // uatom -> uosmo -> uusdc + map.insert( + ("uatom", "uusdc"), + OsmosisRoute(vec![ + SwapAmountInRoute { + pool_id: pool_atom_osmo, + token_out_denom: "uosmo".to_string(), + }, + SwapAmountInRoute { + pool_id: pool_osmo_usdc, + token_out_denom: "uusdc".to_string(), + }, + ]), + ); + + map +} diff --git a/contracts/swapper/osmosis/tests/test_estimate.rs b/contracts/swapper/osmosis/tests/test_estimate.rs new file mode 100644 index 000000000..004fbfd49 --- /dev/null +++ b/contracts/swapper/osmosis/tests/test_estimate.rs @@ -0,0 +1,183 @@ +use cosmwasm_std::{coin, Uint128}; +use mars_swapper::msgs::{EstimateExactInSwapResponse, ExecuteMsg, QueryMsg}; +use mars_swapper_osmosis::route::OsmosisRoute; +use osmosis_std::types::osmosis::gamm::v1beta1::SwapAmountInRoute; +use osmosis_test_tube::{Gamm, Module, OsmosisTestApp, RunnerResult, Wasm}; + +use crate::helpers::{ + assert_err, instantiate_contract, query_price_from_pool, swap_to_create_twap_records, +}; + +pub mod helpers; + +#[test] +fn error_on_route_not_found() { + let app = OsmosisTestApp::new(); + let wasm = Wasm::new(&app); + let owner = app.init_account(&[coin(1_000_000_000_000, "uosmo")]).unwrap(); + + let contract_addr = instantiate_contract(&wasm, &owner); + + let res: RunnerResult = wasm.query( + &contract_addr, + &QueryMsg::EstimateExactInSwap { + coin_in: coin(1000, "jake"), + denom_out: "mars".to_string(), + }, + ); + + assert_err(res.unwrap_err(), "swapper_osmosis::route::OsmosisRoute not found"); +} + +#[test] +fn estimate_swap_one_step() { + let app = OsmosisTestApp::new(); + let wasm = Wasm::new(&app); + + let signer = app + .init_account(&[coin(1_000_000_000_000, "uatom"), coin(1_000_000_000_000, "uosmo")]) + .unwrap(); + + let contract_addr = instantiate_contract(&wasm, &signer); + + let gamm = Gamm::new(&app); + let pool_atom_osmo = gamm + .create_basic_pool(&[coin(1_500_000, "uatom"), coin(6_000_000, "uosmo")], &signer) + .unwrap() + .data + .pool_id; + + swap_to_create_twap_records(&app, &signer, pool_atom_osmo, coin(10u128, "uatom"), "uosmo"); + + wasm.execute( + &contract_addr, + &ExecuteMsg::SetRoute { + denom_in: "uosmo".to_string(), + denom_out: "uatom".to_string(), + route: OsmosisRoute(vec![SwapAmountInRoute { + pool_id: pool_atom_osmo, + token_out_denom: "uatom".to_string(), + }]), + }, + &[], + &signer, + ) + .unwrap(); + + let coin_in_amount = Uint128::from(1000u128); + let uosmo_price = query_price_from_pool(&gamm, pool_atom_osmo, "uosmo"); + let expected_output = coin_in_amount * uosmo_price; + + let res: EstimateExactInSwapResponse = wasm + .query( + &contract_addr, + &QueryMsg::EstimateExactInSwap { + coin_in: coin(coin_in_amount.u128(), "uosmo"), + denom_out: "uatom".to_string(), + }, + ) + .unwrap(); + assert_eq!(res.amount, expected_output); +} + +#[test] +fn estimate_swap_multi_step() { + let app = OsmosisTestApp::new(); + let wasm = Wasm::new(&app); + + let signer = app + .init_account(&[ + coin(1_000_000_000_000, "uatom"), + coin(1_000_000_000_000, "uosmo"), + coin(1_000_000_000_000, "umars"), + coin(1_000_000_000_000, "uusdc"), + ]) + .unwrap(); + + let contract_addr = instantiate_contract(&wasm, &signer); + + let gamm = Gamm::new(&app); + let pool_atom_osmo = gamm + .create_basic_pool(&[coin(6_000_000, "uatom"), coin(1_500_000, "uosmo")], &signer) + .unwrap() + .data + .pool_id; + let pool_osmo_mars = gamm + .create_basic_pool(&[coin(100_000, "uosmo"), coin(1_000_000, "umars")], &signer) + .unwrap() + .data + .pool_id; + let pool_osmo_usdc = gamm + .create_basic_pool(&[coin(100_000, "uosmo"), coin(1_000_000, "uusdc")], &signer) + .unwrap() + .data + .pool_id; + + swap_to_create_twap_records(&app, &signer, pool_atom_osmo, coin(4u128, "uosmo"), "uatom"); + + wasm.execute( + &contract_addr, + &ExecuteMsg::SetRoute { + denom_in: "uatom".to_string(), + denom_out: "umars".to_string(), + route: OsmosisRoute(vec![ + SwapAmountInRoute { + pool_id: pool_atom_osmo, + token_out_denom: "uosmo".to_string(), + }, + SwapAmountInRoute { + pool_id: pool_osmo_mars, + token_out_denom: "umars".to_string(), + }, + ]), + }, + &[], + &signer, + ) + .unwrap(); + + wasm.execute( + &contract_addr, + &ExecuteMsg::SetRoute { + denom_in: "uatom".to_string(), + denom_out: "uusdc".to_string(), + route: OsmosisRoute(vec![ + SwapAmountInRoute { + pool_id: pool_atom_osmo, + token_out_denom: "uosmo".to_string(), + }, + SwapAmountInRoute { + pool_id: pool_osmo_usdc, + token_out_denom: "uusdc".to_string(), + }, + ]), + }, + &[], + &signer, + ) + .unwrap(); + + let coin_in_amount = Uint128::from(1000u128); + let uatom_price = query_price_from_pool(&gamm, pool_atom_osmo, "uatom"); + let uosmo_price = query_price_from_pool(&gamm, pool_osmo_usdc, "uosmo"); + let expected_output = coin_in_amount * uatom_price * uosmo_price; + + // atom/usdc = (price for atom/osmo) * (price for osmo/usdc) + // usdc_out_amount = (atom amount) * (price for atom/usdc) + // + // 1 osmo = 4 atom => atom/osmo = 0.25 + // 1 osmo = 10 usdc => osmo/usdc = 10 + // + // atom/usdc = 0.25 * 10 = 2.5 + // usdc_out_amount = 1000 * 2.5 = 2500 + let res: EstimateExactInSwapResponse = wasm + .query( + &contract_addr, + &QueryMsg::EstimateExactInSwap { + coin_in: coin(coin_in_amount.u128(), "uatom"), + denom_out: "uusdc".to_string(), + }, + ) + .unwrap(); + assert_eq!(res.amount, expected_output); +} diff --git a/contracts/swapper/osmosis/tests/test_instantiate.rs b/contracts/swapper/osmosis/tests/test_instantiate.rs new file mode 100644 index 000000000..02ff699af --- /dev/null +++ b/contracts/swapper/osmosis/tests/test_instantiate.rs @@ -0,0 +1,46 @@ +use cosmwasm_std::coin; +use mars_owner::OwnerResponse; +use mars_swapper::msgs::{InstantiateMsg, QueryMsg}; +use osmosis_test_tube::{Account, Module, OsmosisTestApp, Wasm}; + +use crate::helpers::{instantiate_contract, wasm_file}; + +pub mod helpers; + +#[test] +fn owner_set_on_instantiate() { + let app = OsmosisTestApp::new(); + let wasm = Wasm::new(&app); + let signer = app.init_account(&[coin(1_000_000_000_000, "uosmo")]).unwrap(); + + let contract_addr = instantiate_contract(&wasm, &signer); + + let res: OwnerResponse = wasm.query(&contract_addr, &QueryMsg::Owner {}).unwrap(); + assert_eq!(res.owner, Some(signer.address())); +} + +#[test] +fn raises_on_invalid_owner_addr() { + let app = OsmosisTestApp::new(); + let wasm = Wasm::new(&app); + let signer = app.init_account(&[coin(1_000_000_000_000, "uosmo")]).unwrap(); + + let wasm_byte_code = std::fs::read(wasm_file()).unwrap(); + let code_id = wasm.store_code(&wasm_byte_code, None, &signer).unwrap().data.code_id; + + let owner = "%%%INVALID%%%"; + let res = wasm.instantiate( + code_id, + &InstantiateMsg { + owner: owner.to_string(), + }, + None, + Some("swapper-osmosis-contract"), + &[], + &signer, + ); + + if res.is_ok() { + panic!("Should have thrown an error"); + } +} diff --git a/contracts/swapper/osmosis/tests/test_set_route.rs b/contracts/swapper/osmosis/tests/test_set_route.rs new file mode 100644 index 000000000..4b4f818ae --- /dev/null +++ b/contracts/swapper/osmosis/tests/test_set_route.rs @@ -0,0 +1,373 @@ +use cosmwasm_std::{coin, StdError::GenericErr}; +use mars_owner::OwnerError; +use mars_swapper::msgs::{ExecuteMsg, QueryMsg, RouteResponse}; +use mars_swapper_base::ContractError; +use mars_swapper_osmosis::route::OsmosisRoute; +use osmosis_std::types::osmosis::gamm::v1beta1::SwapAmountInRoute; +use osmosis_test_tube::{Gamm, Module, OsmosisTestApp, Wasm}; + +use crate::helpers::{assert_err, instantiate_contract}; + +pub mod helpers; + +#[test] +fn only_owner_can_set_routes() { + let app = OsmosisTestApp::new(); + let wasm = Wasm::new(&app); + + let accs = app.init_accounts(&[coin(1_000_000_000_000, "uosmo")], 2).unwrap(); + let owner = &accs[0]; + let bad_guy = &accs[1]; + + let contract_addr = instantiate_contract(&wasm, owner); + + let res_err = wasm + .execute( + &contract_addr, + &ExecuteMsg::SetRoute { + denom_in: "mars".to_string(), + denom_out: "weth".to_string(), + route: OsmosisRoute(vec![ + SwapAmountInRoute { + pool_id: 1, + token_out_denom: "osmo".to_string(), + }, + SwapAmountInRoute { + pool_id: 2, + token_out_denom: "weth".to_string(), + }, + ]), + }, + &[], + bad_guy, + ) + .unwrap_err(); + + assert_err(res_err, OwnerError::NotOwner {}); +} + +#[test] +fn must_pass_at_least_one_step() { + let app = OsmosisTestApp::new(); + let wasm = Wasm::new(&app); + + let signer = app.init_account(&[coin(1_000_000_000_000, "uosmo")]).unwrap(); + + let contract_addr = instantiate_contract(&wasm, &signer); + + let res_err = wasm + .execute( + &contract_addr, + &ExecuteMsg::SetRoute { + denom_in: "mars".to_string(), + denom_out: "weth".to_string(), + route: OsmosisRoute(vec![]), + }, + &[], + &signer, + ) + .unwrap_err(); + + assert_err( + res_err, + ContractError::InvalidRoute { + reason: "the route must contain at least one step".to_string(), + }, + ); +} + +#[test] +fn must_be_available_in_osmosis() { + let app = OsmosisTestApp::new(); + let wasm = Wasm::new(&app); + + let signer = app.init_account(&[coin(1_000_000_000_000, "uosmo")]).unwrap(); + + let contract_addr = instantiate_contract(&wasm, &signer); + + let res_err = wasm + .execute( + &contract_addr, + &ExecuteMsg::SetRoute { + denom_in: "mars".to_string(), + denom_out: "weth".to_string(), + route: OsmosisRoute(vec![SwapAmountInRoute { + pool_id: 1, + token_out_denom: "osmo".to_string(), + }]), + }, + &[], + &signer, + ) + .unwrap_err(); + + assert_err( + res_err, + ContractError::Std(GenericErr { + msg: "Querier contract error".to_string(), + }), + ); +} + +#[test] +fn step_does_not_contain_input_denom() { + let app = OsmosisTestApp::new(); + let wasm = Wasm::new(&app); + + let signer = app + .init_account(&[coin(1_000_000_000_000, "uatom"), coin(1_000_000_000_000, "uosmo")]) + .unwrap(); + + let contract_addr = instantiate_contract(&wasm, &signer); + + let gamm = Gamm::new(&app); + let pool_atom_osmo = gamm + .create_basic_pool(&[coin(6_000_000, "uatom"), coin(1_500_000, "uosmo")], &signer) + .unwrap() + .data + .pool_id; + + let res_err = wasm + .execute( + &contract_addr, + &ExecuteMsg::SetRoute { + denom_in: "umars".to_string(), + denom_out: "uweth".to_string(), + route: OsmosisRoute(vec![SwapAmountInRoute { + pool_id: pool_atom_osmo, + token_out_denom: "uosmo".to_string(), + }]), + }, + &[], + &signer, + ) + .unwrap_err(); + + assert_err( + res_err, + ContractError::InvalidRoute { + reason: format!("step 1: pool {pool_atom_osmo} does not contain input denom umars",), + }, + ); +} + +#[test] +fn step_does_not_contain_output_denom() { + let app = OsmosisTestApp::new(); + let wasm = Wasm::new(&app); + + let signer = app + .init_account(&[coin(1_000_000_000_000, "umars"), coin(1_000_000_000_000, "uosmo")]) + .unwrap(); + + let contract_addr = instantiate_contract(&wasm, &signer); + + let gamm = Gamm::new(&app); + let pool_mars_osmo = gamm + .create_basic_pool(&[coin(6_000_000, "umars"), coin(1_500_000, "uosmo")], &signer) + .unwrap() + .data + .pool_id; + + let res_err = wasm + .execute( + &contract_addr, + &ExecuteMsg::SetRoute { + denom_in: "umars".to_string(), + denom_out: "uweth".to_string(), + route: OsmosisRoute(vec![SwapAmountInRoute { + pool_id: pool_mars_osmo, + token_out_denom: "uweth".to_string(), + }]), + }, + &[], + &signer, + ) + .unwrap_err(); + + assert_err( + res_err, + ContractError::InvalidRoute { + reason: format!("step 1: pool {pool_mars_osmo} does not contain output denom uweth"), + }, + ); +} + +#[test] +fn steps_do_not_loop() { + let app = OsmosisTestApp::new(); + let wasm = Wasm::new(&app); + + let signer = app + .init_account(&[ + coin(1_000_000_000_000, "uatom"), + coin(1_000_000_000_000, "uosmo"), + coin(1_000_000_000_000, "umars"), + coin(1_000_000_000_000, "uusdc"), + ]) + .unwrap(); + + let contract_addr = instantiate_contract(&wasm, &signer); + + let gamm = Gamm::new(&app); + let pool_atom_osmo = gamm + .create_basic_pool(&[coin(6_000_000, "uatom"), coin(1_500_000, "uosmo")], &signer) + .unwrap() + .data + .pool_id; + let pool_osmo_usdc = gamm + .create_basic_pool(&[coin(6_000_000, "uosmo"), coin(1_500_000, "uusdc")], &signer) + .unwrap() + .data + .pool_id; + let pool_osmo_mars = gamm + .create_basic_pool(&[coin(6_000_000, "uosmo"), coin(1_500_000, "umars")], &signer) + .unwrap() + .data + .pool_id; + + let res_err = wasm + .execute( + &contract_addr, + &ExecuteMsg::SetRoute { + denom_in: "uatom".to_string(), + denom_out: "umars".to_string(), + route: OsmosisRoute(vec![ + SwapAmountInRoute { + pool_id: pool_atom_osmo, + token_out_denom: "uosmo".to_string(), + }, + SwapAmountInRoute { + pool_id: pool_osmo_usdc, + token_out_denom: "uusdc".to_string(), + }, + SwapAmountInRoute { + pool_id: pool_osmo_usdc, + token_out_denom: "uosmo".to_string(), + }, + SwapAmountInRoute { + pool_id: pool_osmo_mars, + token_out_denom: "umars".to_string(), + }, + ]), + }, + &[], + &signer, + ) + .unwrap_err(); + + // invalid - route contains a loop + // this example: ATOM -> OSMO -> USDC -> OSMO -> MARS + assert_err( + res_err, + ContractError::InvalidRoute { + reason: "route contains a loop: denom uosmo seen twice".to_string(), + }, + ); +} + +#[test] +fn step_output_does_not_match() { + let app = OsmosisTestApp::new(); + let wasm = Wasm::new(&app); + + let signer = app + .init_account(&[coin(1_000_000_000_000, "uatom"), coin(1_000_000_000_000, "uosmo")]) + .unwrap(); + + let contract_addr = instantiate_contract(&wasm, &signer); + + let gamm = Gamm::new(&app); + let pool_atom_osmo = gamm + .create_basic_pool(&[coin(6_000_000, "uatom"), coin(1_500_000, "uosmo")], &signer) + .unwrap() + .data + .pool_id; + + let res_err = wasm + .execute( + &contract_addr, + &ExecuteMsg::SetRoute { + denom_in: "uatom".to_string(), + denom_out: "umars".to_string(), + route: OsmosisRoute(vec![SwapAmountInRoute { + pool_id: pool_atom_osmo, + token_out_denom: "uosmo".to_string(), + }]), + }, + &[], + &signer, + ) + .unwrap_err(); + + assert_err( + res_err, + ContractError::InvalidRoute { + reason: "the route's output denom uosmo does not match the desired output umars" + .to_string(), + }, + ); +} + +#[test] +fn set_route_success() { + let app = OsmosisTestApp::new(); + let wasm = Wasm::new(&app); + + let signer = app + .init_account(&[ + coin(1_000_000_000_000, "uosmo"), + coin(1_000_000_000_000, "umars"), + coin(1_000_000_000_000, "uweth"), + ]) + .unwrap(); + + let contract_addr = instantiate_contract(&wasm, &signer); + + let gamm = Gamm::new(&app); + let pool_mars_osmo = gamm + .create_basic_pool(&[coin(6_000_000, "umars"), coin(1_500_000, "uosmo")], &signer) + .unwrap() + .data + .pool_id; + let pool_weth_osmo = gamm + .create_basic_pool(&[coin(100_000, "uweth"), coin(1_000_000, "uosmo")], &signer) + .unwrap() + .data + .pool_id; + + wasm.execute( + &contract_addr, + &ExecuteMsg::SetRoute { + denom_in: "umars".to_string(), + denom_out: "uweth".to_string(), + route: OsmosisRoute(vec![ + SwapAmountInRoute { + pool_id: pool_mars_osmo, + token_out_denom: "uosmo".to_string(), + }, + SwapAmountInRoute { + pool_id: pool_weth_osmo, + token_out_denom: "uweth".to_string(), + }, + ]), + }, + &[], + &signer, + ) + .unwrap(); + + let res: RouteResponse = wasm + .query( + &contract_addr, + &QueryMsg::Route { + denom_in: "umars".to_string(), + denom_out: "uweth".to_string(), + }, + ) + .unwrap(); + + assert_eq!(res.denom_in, "umars".to_string()); + assert_eq!(res.denom_out, "uweth".to_string()); + assert_eq!(res.route.to_string(), format!("{pool_mars_osmo}:uosmo|{pool_weth_osmo}:uweth")); +} diff --git a/contracts/swapper/osmosis/tests/test_swap.rs b/contracts/swapper/osmosis/tests/test_swap.rs new file mode 100644 index 000000000..42f910d7b --- /dev/null +++ b/contracts/swapper/osmosis/tests/test_swap.rs @@ -0,0 +1,170 @@ +use cosmwasm_std::{coin, Addr, Decimal}; +use mars_swapper::msgs::ExecuteMsg; +use mars_swapper_base::ContractError; +use mars_swapper_osmosis::route::OsmosisRoute; +use osmosis_std::types::osmosis::gamm::v1beta1::SwapAmountInRoute; +use osmosis_test_tube::{Account, Bank, Gamm, Module, OsmosisTestApp, Wasm}; + +use crate::helpers::{ + assert_err, instantiate_contract, query_balance, swap_to_create_twap_records, +}; + +pub mod helpers; + +#[test] +fn transfer_callback_only_internal() { + let app = OsmosisTestApp::new(); + let wasm = Wasm::new(&app); + + let accs = app.init_accounts(&[coin(1_000_000_000_000, "uosmo")], 2).unwrap(); + let owner = &accs[0]; + let bad_guy = &accs[1]; + + let contract_addr = instantiate_contract(&wasm, owner); + + let res_err = wasm + .execute( + &contract_addr, + &ExecuteMsg::::TransferResult { + recipient: Addr::unchecked(bad_guy.address()), + denom_in: "mars".to_string(), + denom_out: "osmo".to_string(), + }, + &[], + bad_guy, + ) + .unwrap_err(); + + assert_err( + res_err, + ContractError::Unauthorized { + user: bad_guy.address(), + action: "transfer result".to_string(), + }, + ); +} + +#[test] +fn swap_exact_in_slippage_too_high() { + let app = OsmosisTestApp::new(); + let wasm = Wasm::new(&app); + + let signer = app + .init_account(&[coin(1_000_000_000_000, "uosmo"), coin(1_000_000_000_000, "umars")]) + .unwrap(); + let whale = app.init_account(&[coin(1_000_000, "umars")]).unwrap(); + + let contract_addr = instantiate_contract(&wasm, &signer); + + let gamm = Gamm::new(&app); + let pool_mars_osmo = gamm + .create_basic_pool(&[coin(6_000_000, "umars"), coin(1_500_000, "uosmo")], &signer) + .unwrap() + .data + .pool_id; + + swap_to_create_twap_records(&app, &signer, pool_mars_osmo, coin(10u128, "umars"), "uosmo"); + + let route = OsmosisRoute(vec![SwapAmountInRoute { + pool_id: pool_mars_osmo, + token_out_denom: "uosmo".to_string(), + }]); + + wasm.execute( + &contract_addr, + &ExecuteMsg::SetRoute { + denom_in: "umars".to_string(), + denom_out: "uosmo".to_string(), + route, + }, + &[], + &signer, + ) + .unwrap(); + + // whale does a huge trade + let res_err = wasm + .execute( + &contract_addr, + &ExecuteMsg::::SwapExactIn { + coin_in: coin(1_000_000, "umars"), + denom_out: "uosmo".to_string(), + slippage: Decimal::percent(5), + }, + &[coin(1_000_000, "umars")], + &whale, + ) + .unwrap_err(); + + assert_err( + res_err, + "uosmo token is lesser than min amount: calculated amount is lesser than min amount", + ) +} + +#[test] +fn swap_exact_in_success() { + let app = OsmosisTestApp::new(); + let wasm = Wasm::new(&app); + + let signer = app + .init_account(&[coin(1_000_000_000_000, "uosmo"), coin(1_000_000_000_000, "umars")]) + .unwrap(); + let user = app.init_account(&[coin(10_000, "umars")]).unwrap(); + + let contract_addr = instantiate_contract(&wasm, &signer); + + let gamm = Gamm::new(&app); + let pool_mars_osmo = gamm + .create_basic_pool(&[coin(6_000_000, "umars"), coin(1_500_000, "uosmo")], &signer) + .unwrap() + .data + .pool_id; + + swap_to_create_twap_records(&app, &signer, pool_mars_osmo, coin(10u128, "umars"), "uosmo"); + + wasm.execute( + &contract_addr, + &ExecuteMsg::SetRoute { + denom_in: "umars".to_string(), + denom_out: "uosmo".to_string(), + route: OsmosisRoute(vec![SwapAmountInRoute { + pool_id: pool_mars_osmo, + token_out_denom: "uosmo".to_string(), + }]), + }, + &[], + &signer, + ) + .unwrap(); + + let bank = Bank::new(&app); + let osmo_balance = query_balance(&bank, &user.address(), "uosmo"); + let mars_balance = query_balance(&bank, &user.address(), "umars"); + assert_eq!(osmo_balance, 0); + assert_eq!(mars_balance, 10_000); + + wasm.execute( + &contract_addr, + &ExecuteMsg::::SwapExactIn { + coin_in: coin(10_000, "umars"), + denom_out: "uosmo".to_string(), + slippage: Decimal::percent(6), + }, + &[coin(10_000, "umars")], + &user, + ) + .unwrap(); + + // Assert user receives their new tokens + let osmo_balance = query_balance(&bank, &user.address(), "uosmo"); + let mars_balance = query_balance(&bank, &user.address(), "umars"); + assert_eq!(osmo_balance, 2470); + assert_eq!(mars_balance, 0); + + // Assert no tokens in contract left over + let osmo_balance = query_balance(&bank, &contract_addr, "uosmo"); + let mars_balance = query_balance(&bank, &contract_addr, "umars"); + assert_eq!(osmo_balance, 0); + assert_eq!(mars_balance, 0); +} diff --git a/contracts/swapper/osmosis/tests/test_update_admin.rs b/contracts/swapper/osmosis/tests/test_update_admin.rs new file mode 100644 index 000000000..eac397970 --- /dev/null +++ b/contracts/swapper/osmosis/tests/test_update_admin.rs @@ -0,0 +1,201 @@ +use cosmwasm_std::coin; +use mars_owner::{OwnerResponse, OwnerUpdate}; +use mars_swapper::msgs::{ExecuteMsg, QueryMsg}; +use mars_swapper_osmosis::route::OsmosisRoute; +use osmosis_test_tube::{Account, Module, OsmosisTestApp, Wasm}; + +use crate::helpers::instantiate_contract; + +pub mod helpers; + +#[test] +fn initial_state() { + let app = OsmosisTestApp::new(); + let wasm = Wasm::new(&app); + + let accs = app.init_accounts(&[coin(1_000_000_000_000, "uosmo")], 2).unwrap(); + let owner = &accs[0]; + + let contract_addr = instantiate_contract(&wasm, owner); + + let res: OwnerResponse = wasm.query(&contract_addr, &QueryMsg::Owner {}).unwrap(); + assert_eq!(res.owner.unwrap(), owner.address()); + assert_eq!(res.proposed, None); +} + +#[test] +fn only_owner_can_propose() { + let app = OsmosisTestApp::new(); + let wasm = Wasm::new(&app); + + let accs = app.init_accounts(&[coin(1_000_000_000_000, "uosmo")], 3).unwrap(); + let owner = &accs[0]; + let bad_guy = &accs[1]; + + let contract_addr = instantiate_contract(&wasm, owner); + + wasm.execute( + &contract_addr, + &ExecuteMsg::::UpdateOwner(OwnerUpdate::ProposeNewOwner { + proposed: bad_guy.address(), + }), + &[], + bad_guy, + ) + .unwrap_err(); +} + +#[test] +fn propose_new_owner() { + let app = OsmosisTestApp::new(); + let wasm = Wasm::new(&app); + + let accs = app.init_accounts(&[coin(1_000_000_000_000, "uosmo")], 2).unwrap(); + let owner = &accs[0]; + let new_owner = &accs[1]; + + let contract_addr = instantiate_contract(&wasm, owner); + + wasm.execute( + &contract_addr, + &ExecuteMsg::::UpdateOwner(OwnerUpdate::ProposeNewOwner { + proposed: new_owner.address(), + }), + &[], + owner, + ) + .unwrap(); + + let res: OwnerResponse = wasm.query(&contract_addr, &QueryMsg::Owner {}).unwrap(); + assert_eq!(res.owner.unwrap(), owner.address()); + assert_eq!(res.proposed.unwrap(), new_owner.address()); +} + +#[test] +fn only_owner_can_clear_proposed() { + let app = OsmosisTestApp::new(); + let wasm = Wasm::new(&app); + + let accs = app.init_accounts(&[coin(1_000_000_000_000, "uosmo")], 3).unwrap(); + let owner = &accs[0]; + let bad_guy = &accs[1]; + let new_owner = &accs[2]; + + let contract_addr = instantiate_contract(&wasm, owner); + + wasm.execute( + &contract_addr, + &ExecuteMsg::::UpdateOwner(OwnerUpdate::ProposeNewOwner { + proposed: new_owner.address(), + }), + &[], + owner, + ) + .unwrap(); + + wasm.execute( + &contract_addr, + &ExecuteMsg::::UpdateOwner(OwnerUpdate::ClearProposed), + &[], + bad_guy, + ) + .unwrap_err(); +} + +#[test] +fn clear_proposed() { + let app = OsmosisTestApp::new(); + let wasm = Wasm::new(&app); + + let accs = app.init_accounts(&[coin(1_000_000_000_000, "uosmo")], 2).unwrap(); + let owner = &accs[0]; + let new_owner = &accs[1]; + + let contract_addr = instantiate_contract(&wasm, owner); + + wasm.execute( + &contract_addr, + &ExecuteMsg::::UpdateOwner(OwnerUpdate::ProposeNewOwner { + proposed: new_owner.address(), + }), + &[], + owner, + ) + .unwrap(); + + wasm.execute( + &contract_addr, + &ExecuteMsg::::UpdateOwner(OwnerUpdate::ClearProposed), + &[], + owner, + ) + .unwrap(); + + let res: OwnerResponse = wasm.query(&contract_addr, &QueryMsg::Owner {}).unwrap(); + assert_eq!(res.owner.unwrap(), owner.address()); + assert_eq!(res.proposed, None); +} + +#[test] +fn only_proposed_owner_can_accept_role() { + let app = OsmosisTestApp::new(); + let wasm = Wasm::new(&app); + + let accs = app.init_accounts(&[coin(1_000_000_000_000, "uosmo")], 2).unwrap(); + let owner = &accs[0]; + let new_owner = &accs[1]; + + let contract_addr = instantiate_contract(&wasm, owner); + + wasm.execute( + &contract_addr, + &ExecuteMsg::::UpdateOwner(OwnerUpdate::ProposeNewOwner { + proposed: new_owner.address(), + }), + &[], + owner, + ) + .unwrap(); + + wasm.execute( + &contract_addr, + &ExecuteMsg::::UpdateOwner(OwnerUpdate::AcceptProposed), + &[], + owner, + ) + .unwrap_err(); +} + +#[test] +fn accept_owner_role() { + let app = OsmosisTestApp::new(); + let wasm = Wasm::new(&app); + + let accs = app.init_accounts(&[coin(1_000_000_000_000, "uosmo")], 2).unwrap(); + let owner = &accs[0]; + let new_owner = &accs[1]; + + let contract_addr = instantiate_contract(&wasm, owner); + + wasm.execute( + &contract_addr, + &ExecuteMsg::::UpdateOwner(OwnerUpdate::ProposeNewOwner { + proposed: new_owner.address(), + }), + &[], + owner, + ) + .unwrap(); + + wasm.execute( + &contract_addr, + &ExecuteMsg::::UpdateOwner(OwnerUpdate::AcceptProposed), + &[], + new_owner, + ) + .unwrap(); + + let res: OwnerResponse = wasm.query(&contract_addr, &QueryMsg::Owner {}).unwrap(); + assert_eq!(res.owner.unwrap(), new_owner.address()); + assert_eq!(res.proposed, None); +} diff --git a/coverage_grcov.Makefile.toml b/coverage_grcov.Makefile.toml new file mode 100644 index 000000000..77dc8dd45 --- /dev/null +++ b/coverage_grcov.Makefile.toml @@ -0,0 +1,53 @@ +# https://crates.io/crates/grcov + +[env] +COVERAGE_TARGET_DIRECTORY = "${CARGO_MAKE_WORKSPACE_WORKING_DIRECTORY}/target/coverage" +COVERAGE_BINARIES = "${COVERAGE_TARGET_DIRECTORY}/debug/deps" +COVERAGE_PROF_OUTPUT = "${COVERAGE_TARGET_DIRECTORY}/profraw" + +[tasks.coverage-grcov-prepare-outdir] +private = true +script=''' +#!/usr/bin/env bash +set -eux + +rm -rf ${COVERAGE_PROF_OUTPUT} +mkdir -p ${COVERAGE_PROF_OUTPUT} +''' + +[tasks.coverage-grcov-run-test] +condition = { rust_version = { min = "1.60.0" } } +private = true +run_task = "test" + +[tasks.coverage-grcov-run-test.env] +CARGO_BUILD_TARGET_DIR = "${COVERAGE_TARGET_DIRECTORY}" +CARGO_INCREMENTAL = "0" +RUSTFLAGS = "-Cinstrument-coverage" +LLVM_PROFILE_FILE = "${COVERAGE_PROF_OUTPUT}/coverage-%p-%m.profraw" + +[tasks.install-grcov] +condition = { env_not_set = ["SKIP_INSTALL_GRCOV"] } +private = true +install_crate = { crate_name = "grcov" } + +[tasks.coverage-grcov] +condition = { rust_version = { min = "1.60.0" } } +private = true +script = ''' +#!/usr/bin/env bash +set -eux + +grcov ${COVERAGE_PROF_OUTPUT} \ + -b ${COVERAGE_BINARIES} -s ${CARGO_MAKE_WORKSPACE_WORKING_DIRECTORY} \ + -t ${GRCOV_OUTPUT_TYPE} --llvm --branch --ignore-not-existing --ignore "/*" --ignore "*/tests/*" --ignore "*/testing/*" --ignore "target/*" -o ${GRCOV_OUTPUT_PATH} +''' +dependencies = ["install-grcov", "coverage-grcov-prepare-outdir", "coverage-grcov-run-test"] + +[tasks.coverage-grcov-html] +env = { GRCOV_OUTPUT_TYPE = "html", GRCOV_OUTPUT_PATH = "${COVERAGE_TARGET_DIRECTORY}/html" } +run_task = "coverage-grcov" + +[tasks.coverage-grcov-lcov] +env = { GRCOV_OUTPUT_TYPE = "lcov", GRCOV_OUTPUT_PATH = "${COVERAGE_TARGET_DIRECTORY}/lcov.info" } +run_task = "coverage-grcov" diff --git a/packages/mars-swapper/Cargo.toml b/packages/mars-swapper/Cargo.toml new file mode 100644 index 000000000..044f56dbe --- /dev/null +++ b/packages/mars-swapper/Cargo.toml @@ -0,0 +1,28 @@ +[package] +name = "mars-swapper" +version = { workspace = true } +authors = { workspace = true } +license = { workspace = true } +edition = { workspace = true } +repository = { workspace = true } +homepage = { workspace = true } +documentation = { workspace = true } +keywords = { workspace = true } + +[lib] +doctest = false + +[features] +# for quicker tests, cargo test --lib +# for more explicit tests, cargo test --features=backtraces +backtraces = ["cosmwasm-std/backtraces"] + +[dependencies] +cosmwasm-schema = { workspace = true } +cosmwasm-std = { workspace = true } +cw-storage-plus = { workspace = true } +cw-utils = { workspace = true } +mars-owner = { workspace = true } +schemars = { workspace = true } +serde = { workspace = true } +thiserror = { workspace = true } diff --git a/packages/mars-swapper/src/adapter.rs b/packages/mars-swapper/src/adapter.rs new file mode 100644 index 000000000..29a48488c --- /dev/null +++ b/packages/mars-swapper/src/adapter.rs @@ -0,0 +1,52 @@ +use cosmwasm_schema::cw_serde; +use cosmwasm_std::{to_binary, Addr, Api, Coin, CosmosMsg, Decimal, Empty, StdResult, WasmMsg}; + +use crate::msgs::ExecuteMsg; + +#[cw_serde] +pub struct SwapperBase(T); + +impl SwapperBase { + pub fn new(address: T) -> SwapperBase { + SwapperBase(address) + } + + pub fn address(&self) -> &T { + &self.0 + } +} + +pub type SwapperUnchecked = SwapperBase; +pub type Swapper = SwapperBase; + +impl From for SwapperUnchecked { + fn from(s: Swapper) -> Self { + Self(s.address().to_string()) + } +} + +impl SwapperUnchecked { + pub fn check(&self, api: &dyn Api) -> StdResult { + Ok(SwapperBase::new(api.addr_validate(self.address())?)) + } +} + +impl Swapper { + /// Generate message for performing a swapper + pub fn swap_exact_in_msg( + &self, + coin_in: &Coin, + denom_out: &str, + slippage: Decimal, + ) -> StdResult { + Ok(CosmosMsg::Wasm(WasmMsg::Execute { + contract_addr: self.address().to_string(), + msg: to_binary(&ExecuteMsg::::SwapExactIn { + coin_in: coin_in.clone(), + denom_out: denom_out.to_string(), + slippage, + })?, + funds: vec![coin_in.clone()], + })) + } +} diff --git a/packages/mars-swapper/src/lib.rs b/packages/mars-swapper/src/lib.rs new file mode 100644 index 000000000..6071d7839 --- /dev/null +++ b/packages/mars-swapper/src/lib.rs @@ -0,0 +1,4 @@ +pub mod adapter; +pub mod msgs; + +pub use self::{adapter::*, msgs::*}; diff --git a/packages/mars-swapper/src/msgs.rs b/packages/mars-swapper/src/msgs.rs new file mode 100644 index 000000000..bd270548a --- /dev/null +++ b/packages/mars-swapper/src/msgs.rs @@ -0,0 +1,77 @@ +use cosmwasm_schema::{cw_serde, QueryResponses}; +use cosmwasm_std::{Addr, Coin, Decimal, Uint128}; +use mars_owner::OwnerUpdate; + +#[cw_serde] +pub struct InstantiateMsg { + /// The contract's owner, who can update config + pub owner: String, +} + +#[cw_serde] +pub enum ExecuteMsg { + /// Manges owner role state + UpdateOwner(OwnerUpdate), + /// Configure the route for swapping an asset + /// + /// This is chain-specific, and can include parameters such as slippage tolerance and the routes + /// for multi-step swaps + SetRoute { + denom_in: String, + denom_out: String, + route: Route, + }, + /// Perform a swapper with an exact-in amount. Requires slippage allowance %. + SwapExactIn { + coin_in: Coin, + denom_out: String, + slippage: Decimal, + }, + /// Send swapper results back to swapper. Also refunds extra if sent more than needed. Internal use only. + TransferResult { + recipient: Addr, + denom_in: String, + denom_out: String, + }, +} + +#[cw_serde] +#[derive(QueryResponses)] +pub enum QueryMsg { + /// Query contract owner config + #[returns(mars_owner::OwnerResponse)] + Owner {}, + /// Get route for swapping an input denom into an output denom + #[returns(RouteResponse)] + Route { + denom_in: String, + denom_out: String, + }, + /// Enumerate all swapper routes + #[returns(RoutesResponse)] + Routes { + start_after: Option<(String, String)>, + limit: Option, + }, + /// Return current spot price swapping In for Out + /// Warning: Do not use this as an oracle price feed. Use Mars-Oracle for pricing. + #[returns(EstimateExactInSwapResponse)] + EstimateExactInSwap { + coin_in: Coin, + denom_out: String, + }, +} + +#[cw_serde] +pub struct RouteResponse { + pub denom_in: String, + pub denom_out: String, + pub route: Route, +} + +pub type RoutesResponse = Vec>; + +#[cw_serde] +pub struct EstimateExactInSwapResponse { + pub amount: Uint128, +} diff --git a/rustfmt.toml b/rustfmt.toml new file mode 100644 index 000000000..c218077f7 --- /dev/null +++ b/rustfmt.toml @@ -0,0 +1,4 @@ +group_imports = "StdExternalCrate" # nightly feature +imports_granularity = "Crate" # nightly feature +max_width = 100 +use_small_heuristics = "off" diff --git a/schema.Makefile.toml b/schema.Makefile.toml new file mode 100644 index 000000000..52a17327b --- /dev/null +++ b/schema.Makefile.toml @@ -0,0 +1,45 @@ +[tasks.generate-all-schemas] +script_runner = "@rust" +script = ''' +use std::fs; +use std::process::Command; + +fn main() -> std::io::Result<()> { + fs::remove_dir_all("schema"); + fs::remove_dir_all("schemas"); + fs::create_dir("schemas")?; + println!("Done"); + + let contracts = vec![ + "mars-swapper-osmosis", + ]; + + for contract in contracts { + println!("{}", contract); + + let output = Command::new("cargo") + .arg("run") + .arg("--package") + .arg(contract) + .arg("--example") + .arg("schema") + .output() + .expect("failed to execute process"); + + println!("status: {}", output.status); + println!("stdout: {}", String::from_utf8_lossy(&output.stdout)); + println!("stderr: {}", String::from_utf8_lossy(&output.stderr)); + + fs::create_dir(format!("schemas/{}", contract))?; + + fs::rename( + format!("schema/{}.json", contract), + format!("schemas/{}/{}.json", contract, contract), + )?; + } + + fs::remove_dir_all("schema"); + + Ok(()) +} +''' From 7633026e022598244c05d959c7c910c2c6f3be16 Mon Sep 17 00:00:00 2001 From: Sturdy <91910406+apollo-sturdy@users.noreply.github.com> Date: Thu, 23 Mar 2023 17:33:26 +0100 Subject: [PATCH 02/17] feat: Add scripts from red bank --- .gitignore | 1 - .../mars-swapper-osmosis.json | 479 +++ scripts/.eslintignore | 2 + scripts/.eslintrc.cjs | 22 + scripts/.prettierrc | 7 + scripts/codegen-tsconfig.json | 5 + scripts/codegen/index.ts | 39 + scripts/codegen/insertIgnores.ts | 24 + scripts/deploy/addresses/osmo-test-4.json | 7 + scripts/deploy/addresses/osmosis-1.json | 7 + scripts/deploy/base/deployer.ts | 147 + scripts/deploy/base/index.ts | 46 + scripts/deploy/base/setupDeployer.ts | 32 + scripts/deploy/base/storage.ts | 42 + scripts/deploy/osmosis/config.ts | 223 + scripts/deploy/osmosis/mainIndex.ts | 6 + scripts/deploy/osmosis/multisig.ts | 6 + scripts/deploy/osmosis/testIndex.ts | 6 + scripts/multisig/mars/README.md | 321 ++ scripts/multisig/osmosis/README.md | 429 ++ scripts/package.json | 34 + scripts/tsconfig.json | 32 + scripts/types/config.ts | 60 + .../MarsSwapperOsmosis.client.ts | 286 ++ .../MarsSwapperOsmosis.react-query.ts | 245 ++ .../MarsSwapperOsmosis.types.ts | 98 + .../generated/mars-swapper-osmosis/bundle.ts | 13 + .../MarsOracleOsmosis.client.ts | 221 + .../MarsOracleOsmosis.react-query.ts | 232 + .../MarsOracleOsmosis.types.ts | 152 + scripts/types/mars-oracle-osmosis/bundle.ts | 13 + scripts/types/msg.ts | 46 + scripts/types/storageItems.ts | 26 + scripts/utils/chalk.ts | 17 + scripts/yarn.lock | 3732 +++++++++++++++++ 35 files changed, 7057 insertions(+), 1 deletion(-) create mode 100644 schemas/mars-swapper-osmosis/mars-swapper-osmosis.json create mode 100644 scripts/.eslintignore create mode 100644 scripts/.eslintrc.cjs create mode 100644 scripts/.prettierrc create mode 100644 scripts/codegen-tsconfig.json create mode 100644 scripts/codegen/index.ts create mode 100644 scripts/codegen/insertIgnores.ts create mode 100644 scripts/deploy/addresses/osmo-test-4.json create mode 100644 scripts/deploy/addresses/osmosis-1.json create mode 100644 scripts/deploy/base/deployer.ts create mode 100644 scripts/deploy/base/index.ts create mode 100644 scripts/deploy/base/setupDeployer.ts create mode 100644 scripts/deploy/base/storage.ts create mode 100644 scripts/deploy/osmosis/config.ts create mode 100644 scripts/deploy/osmosis/mainIndex.ts create mode 100644 scripts/deploy/osmosis/multisig.ts create mode 100644 scripts/deploy/osmosis/testIndex.ts create mode 100644 scripts/multisig/mars/README.md create mode 100644 scripts/multisig/osmosis/README.md create mode 100644 scripts/package.json create mode 100644 scripts/tsconfig.json create mode 100644 scripts/types/config.ts create mode 100644 scripts/types/generated/mars-swapper-osmosis/MarsSwapperOsmosis.client.ts create mode 100644 scripts/types/generated/mars-swapper-osmosis/MarsSwapperOsmosis.react-query.ts create mode 100644 scripts/types/generated/mars-swapper-osmosis/MarsSwapperOsmosis.types.ts create mode 100644 scripts/types/generated/mars-swapper-osmosis/bundle.ts create mode 100644 scripts/types/mars-oracle-osmosis/MarsOracleOsmosis.client.ts create mode 100644 scripts/types/mars-oracle-osmosis/MarsOracleOsmosis.react-query.ts create mode 100644 scripts/types/mars-oracle-osmosis/MarsOracleOsmosis.types.ts create mode 100644 scripts/types/mars-oracle-osmosis/bundle.ts create mode 100644 scripts/types/msg.ts create mode 100644 scripts/types/storageItems.ts create mode 100644 scripts/utils/chalk.ts create mode 100644 scripts/yarn.lock diff --git a/.gitignore b/.gitignore index edb207ff5..f59407e03 100644 --- a/.gitignore +++ b/.gitignore @@ -25,6 +25,5 @@ whitelists/ # Artifacts artifacts/ -schemas/ yarn-error.log diff --git a/schemas/mars-swapper-osmosis/mars-swapper-osmosis.json b/schemas/mars-swapper-osmosis/mars-swapper-osmosis.json new file mode 100644 index 000000000..88892296a --- /dev/null +++ b/schemas/mars-swapper-osmosis/mars-swapper-osmosis.json @@ -0,0 +1,479 @@ +{ + "contract_name": "mars-swapper-osmosis", + "contract_version": "1.0.0", + "idl_version": "1.0.0", + "instantiate": { + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "InstantiateMsg", + "type": "object", + "required": [ + "owner" + ], + "properties": { + "owner": { + "description": "The contract's owner, who can update config", + "type": "string" + } + }, + "additionalProperties": false + }, + "execute": { + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "ExecuteMsg", + "oneOf": [ + { + "description": "Manges owner role state", + "type": "object", + "required": [ + "update_owner" + ], + "properties": { + "update_owner": { + "$ref": "#/definitions/OwnerUpdate" + } + }, + "additionalProperties": false + }, + { + "description": "Configure the route for swapping an asset\n\nThis is chain-specific, and can include parameters such as slippage tolerance and the routes for multi-step swaps", + "type": "object", + "required": [ + "set_route" + ], + "properties": { + "set_route": { + "type": "object", + "required": [ + "denom_in", + "denom_out", + "route" + ], + "properties": { + "denom_in": { + "type": "string" + }, + "denom_out": { + "type": "string" + }, + "route": { + "$ref": "#/definitions/OsmosisRoute" + } + }, + "additionalProperties": false + } + }, + "additionalProperties": false + }, + { + "description": "Perform a swapper with an exact-in amount. Requires slippage allowance %.", + "type": "object", + "required": [ + "swap_exact_in" + ], + "properties": { + "swap_exact_in": { + "type": "object", + "required": [ + "coin_in", + "denom_out", + "slippage" + ], + "properties": { + "coin_in": { + "$ref": "#/definitions/Coin" + }, + "denom_out": { + "type": "string" + }, + "slippage": { + "$ref": "#/definitions/Decimal" + } + }, + "additionalProperties": false + } + }, + "additionalProperties": false + }, + { + "description": "Send swapper results back to swapper. Also refunds extra if sent more than needed. Internal use only.", + "type": "object", + "required": [ + "transfer_result" + ], + "properties": { + "transfer_result": { + "type": "object", + "required": [ + "denom_in", + "denom_out", + "recipient" + ], + "properties": { + "denom_in": { + "type": "string" + }, + "denom_out": { + "type": "string" + }, + "recipient": { + "$ref": "#/definitions/Addr" + } + }, + "additionalProperties": false + } + }, + "additionalProperties": false + } + ], + "definitions": { + "Addr": { + "description": "A human readable address.\n\nIn Cosmos, this is typically bech32 encoded. But for multi-chain smart contracts no assumptions should be made other than being UTF-8 encoded and of reasonable length.\n\nThis type represents a validated address. It can be created in the following ways 1. Use `Addr::unchecked(input)` 2. Use `let checked: Addr = deps.api.addr_validate(input)?` 3. Use `let checked: Addr = deps.api.addr_humanize(canonical_addr)?` 4. Deserialize from JSON. This must only be done from JSON that was validated before such as a contract's state. `Addr` must not be used in messages sent by the user because this would result in unvalidated instances.\n\nThis type is immutable. If you really need to mutate it (Really? Are you sure?), create a mutable copy using `let mut mutable = Addr::to_string()` and operate on that `String` instance.", + "type": "string" + }, + "Coin": { + "type": "object", + "required": [ + "amount", + "denom" + ], + "properties": { + "amount": { + "$ref": "#/definitions/Uint128" + }, + "denom": { + "type": "string" + } + } + }, + "Decimal": { + "description": "A fixed-point decimal value with 18 fractional digits, i.e. Decimal(1_000_000_000_000_000_000) == 1.0\n\nThe greatest possible value that can be represented is 340282366920938463463.374607431768211455 (which is (2^128 - 1) / 10^18)", + "type": "string" + }, + "OsmosisRoute": { + "type": "array", + "items": { + "$ref": "#/definitions/SwapAmountInRoute" + } + }, + "OwnerUpdate": { + "oneOf": [ + { + "description": "Proposes a new owner to take role. Only current owner can execute.", + "type": "object", + "required": [ + "propose_new_owner" + ], + "properties": { + "propose_new_owner": { + "type": "object", + "required": [ + "proposed" + ], + "properties": { + "proposed": { + "type": "string" + } + }, + "additionalProperties": false + } + }, + "additionalProperties": false + }, + { + "description": "Clears the currently proposed owner. Only current owner can execute.", + "type": "string", + "enum": [ + "clear_proposed" + ] + }, + { + "description": "Promotes the proposed owner to be the current one. Only the proposed owner can execute.", + "type": "string", + "enum": [ + "accept_proposed" + ] + }, + { + "description": "Throws away the keys to the Owner role forever. Once done, no owner can ever be set later.", + "type": "string", + "enum": [ + "abolish_owner_role" + ] + } + ] + }, + "SwapAmountInRoute": { + "description": "===================== MsgSwapExactAmountIn", + "type": "object", + "required": [ + "pool_id", + "token_out_denom" + ], + "properties": { + "pool_id": { + "type": "integer", + "format": "uint64", + "minimum": 0.0 + }, + "token_out_denom": { + "type": "string" + } + } + }, + "Uint128": { + "description": "A thin wrapper around u128 that is using strings for JSON encoding/decoding, such that the full u128 range can be used for clients that convert JSON numbers to floats, like JavaScript and jq.\n\n# Examples\n\nUse `from` to create instances of this and `u128` to get the value out:\n\n``` # use cosmwasm_std::Uint128; let a = Uint128::from(123u128); assert_eq!(a.u128(), 123);\n\nlet b = Uint128::from(42u64); assert_eq!(b.u128(), 42);\n\nlet c = Uint128::from(70u32); assert_eq!(c.u128(), 70); ```", + "type": "string" + } + } + }, + "query": { + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "QueryMsg", + "oneOf": [ + { + "description": "Query contract owner config", + "type": "object", + "required": [ + "owner" + ], + "properties": { + "owner": { + "type": "object", + "additionalProperties": false + } + }, + "additionalProperties": false + }, + { + "description": "Get route for swapping an input denom into an output denom", + "type": "object", + "required": [ + "route" + ], + "properties": { + "route": { + "type": "object", + "required": [ + "denom_in", + "denom_out" + ], + "properties": { + "denom_in": { + "type": "string" + }, + "denom_out": { + "type": "string" + } + }, + "additionalProperties": false + } + }, + "additionalProperties": false + }, + { + "description": "Enumerate all swapper routes", + "type": "object", + "required": [ + "routes" + ], + "properties": { + "routes": { + "type": "object", + "properties": { + "limit": { + "type": [ + "integer", + "null" + ], + "format": "uint32", + "minimum": 0.0 + }, + "start_after": { + "type": [ + "array", + "null" + ], + "items": [ + { + "type": "string" + }, + { + "type": "string" + } + ], + "maxItems": 2, + "minItems": 2 + } + }, + "additionalProperties": false + } + }, + "additionalProperties": false + }, + { + "description": "Return current spot price swapping In for Out Warning: Do not use this as an oracle price feed. Use Mars-Oracle for pricing.", + "type": "object", + "required": [ + "estimate_exact_in_swap" + ], + "properties": { + "estimate_exact_in_swap": { + "type": "object", + "required": [ + "coin_in", + "denom_out" + ], + "properties": { + "coin_in": { + "$ref": "#/definitions/Coin" + }, + "denom_out": { + "type": "string" + } + }, + "additionalProperties": false + } + }, + "additionalProperties": false + } + ], + "definitions": { + "Coin": { + "type": "object", + "required": [ + "amount", + "denom" + ], + "properties": { + "amount": { + "$ref": "#/definitions/Uint128" + }, + "denom": { + "type": "string" + } + } + }, + "Uint128": { + "description": "A thin wrapper around u128 that is using strings for JSON encoding/decoding, such that the full u128 range can be used for clients that convert JSON numbers to floats, like JavaScript and jq.\n\n# Examples\n\nUse `from` to create instances of this and `u128` to get the value out:\n\n``` # use cosmwasm_std::Uint128; let a = Uint128::from(123u128); assert_eq!(a.u128(), 123);\n\nlet b = Uint128::from(42u64); assert_eq!(b.u128(), 42);\n\nlet c = Uint128::from(70u32); assert_eq!(c.u128(), 70); ```", + "type": "string" + } + } + }, + "migrate": null, + "sudo": null, + "responses": { + "estimate_exact_in_swap": { + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "EstimateExactInSwapResponse", + "type": "object", + "required": [ + "amount" + ], + "properties": { + "amount": { + "$ref": "#/definitions/Uint128" + } + }, + "additionalProperties": false, + "definitions": { + "Uint128": { + "description": "A thin wrapper around u128 that is using strings for JSON encoding/decoding, such that the full u128 range can be used for clients that convert JSON numbers to floats, like JavaScript and jq.\n\n# Examples\n\nUse `from` to create instances of this and `u128` to get the value out:\n\n``` # use cosmwasm_std::Uint128; let a = Uint128::from(123u128); assert_eq!(a.u128(), 123);\n\nlet b = Uint128::from(42u64); assert_eq!(b.u128(), 42);\n\nlet c = Uint128::from(70u32); assert_eq!(c.u128(), 70); ```", + "type": "string" + } + } + }, + "owner": { + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "OwnerResponse", + "description": "Returned from Owner.query()", + "type": "object", + "required": [ + "abolished", + "initialized" + ], + "properties": { + "abolished": { + "type": "boolean" + }, + "initialized": { + "type": "boolean" + }, + "owner": { + "type": [ + "string", + "null" + ] + }, + "proposed": { + "type": [ + "string", + "null" + ] + } + }, + "additionalProperties": false + }, + "route": { + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "RouteResponse_for_Empty", + "type": "object", + "required": [ + "denom_in", + "denom_out", + "route" + ], + "properties": { + "denom_in": { + "type": "string" + }, + "denom_out": { + "type": "string" + }, + "route": { + "$ref": "#/definitions/Empty" + } + }, + "additionalProperties": false, + "definitions": { + "Empty": { + "description": "An empty struct that serves as a placeholder in different places, such as contracts that don't set a custom message.\n\nIt is designed to be expressable in correct JSON and JSON Schema but contains no meaningful data. Previously we used enums without cases, but those cannot represented as valid JSON Schema (https://github.com/CosmWasm/cosmwasm/issues/451)", + "type": "object" + } + } + }, + "routes": { + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "Array_of_RouteResponse_for_Empty", + "type": "array", + "items": { + "$ref": "#/definitions/RouteResponse_for_Empty" + }, + "definitions": { + "Empty": { + "description": "An empty struct that serves as a placeholder in different places, such as contracts that don't set a custom message.\n\nIt is designed to be expressable in correct JSON and JSON Schema but contains no meaningful data. Previously we used enums without cases, but those cannot represented as valid JSON Schema (https://github.com/CosmWasm/cosmwasm/issues/451)", + "type": "object" + }, + "RouteResponse_for_Empty": { + "type": "object", + "required": [ + "denom_in", + "denom_out", + "route" + ], + "properties": { + "denom_in": { + "type": "string" + }, + "denom_out": { + "type": "string" + }, + "route": { + "$ref": "#/definitions/Empty" + } + }, + "additionalProperties": false + } + } + } + } +} diff --git a/scripts/.eslintignore b/scripts/.eslintignore new file mode 100644 index 000000000..1c8a8cb57 --- /dev/null +++ b/scripts/.eslintignore @@ -0,0 +1,2 @@ +# No checking of built files +build/ diff --git a/scripts/.eslintrc.cjs b/scripts/.eslintrc.cjs new file mode 100644 index 000000000..88a5fb312 --- /dev/null +++ b/scripts/.eslintrc.cjs @@ -0,0 +1,22 @@ +module.exports = { + root: true, + parser: '@typescript-eslint/parser', + parserOptions: { + tsconfigRootDir: __dirname, + project: ['./tsconfig.json'], + }, + plugins: ['@typescript-eslint'], + extends: [ + 'eslint:recommended', + 'plugin:@typescript-eslint/recommended', + 'plugin:@typescript-eslint/recommended-requiring-type-checking', + 'plugin:@typescript-eslint/strict', + 'prettier', + ], + rules: { + '@typescript-eslint/restrict-template-expressions': 'off', + '@typescript-eslint/no-non-null-assertion': 'off', + '@typescript-eslint/consistent-type-definitions': 'off', + }, + ignorePatterns: ['.eslintrc.cjs', 'build', 'node_modules', 'generated', 'mars-oracle-osmosis'], +} diff --git a/scripts/.prettierrc b/scripts/.prettierrc new file mode 100644 index 000000000..8c32ca31a --- /dev/null +++ b/scripts/.prettierrc @@ -0,0 +1,7 @@ +{ + "singleQuote": true, + "jsxSingleQuote": true, + "semi": false, + "printWidth": 100, + "trailingComma": "all" +} diff --git a/scripts/codegen-tsconfig.json b/scripts/codegen-tsconfig.json new file mode 100644 index 000000000..f27757e2e --- /dev/null +++ b/scripts/codegen-tsconfig.json @@ -0,0 +1,5 @@ +{ + "extends": "./tsconfig.json", + "include": ["codegen"], + "exclude": ["deploy", "types", "utils", "build"] +} diff --git a/scripts/codegen/index.ts b/scripts/codegen/index.ts new file mode 100644 index 000000000..e8a73f7ee --- /dev/null +++ b/scripts/codegen/index.ts @@ -0,0 +1,39 @@ +import codegen from '@cosmwasm/ts-codegen' +import { join, resolve } from 'path' +import { printGreen, printRed } from '../utils/chalk' +import { readdir } from 'fs/promises' + +void (async function () { + const schemasDir = resolve(join(__dirname, '../../../schemas')) + const schemas = await readdir(schemasDir) + + for (const schema of schemas) { + try { + await codegen({ + contracts: [`${schemasDir}/${schema}`], + outPath: `./types/generated/${schema}`, + options: { + types: { + enabled: true, + }, + client: { + enabled: true, + }, + reactQuery: { + enabled: true, + optionalClient: true, + version: 'v4', + mutations: true, + queryKeys: true, + }, + messageComposer: { + enabled: false, + }, + }, + }) + printGreen(`Success ✨ ${schema} types generated`) + } catch (e) { + printRed(`Error with ${schema}: ${e}`) + } + } +})() diff --git a/scripts/codegen/insertIgnores.ts b/scripts/codegen/insertIgnores.ts new file mode 100644 index 000000000..960608e87 --- /dev/null +++ b/scripts/codegen/insertIgnores.ts @@ -0,0 +1,24 @@ +import { readdir } from 'fs/promises' +import { join, resolve } from 'path' +import prependFile from 'prepend-file' + +// Unfortunately ts-codegen spits out code that does not compile well with typescript +// This adds an ignore at the top of those files so no compile error is thrown +void (async function () { + const generatedTypesDir = resolve(join(__dirname, '../../types/generated')) + const typeFiles = await getFiles(generatedTypesDir) + for (const file of typeFiles) { + await prependFile(file, '// @ts-nocheck\n') + } +})() + +async function getFiles(dir: string): Promise { + const dirents = await readdir(dir, { withFileTypes: true }) + const files = await Promise.all( + dirents.map((dirent) => { + const res = resolve(dir, dirent.name) + return dirent.isDirectory() ? getFiles(res) : res + }), + ) + return Array.prototype.concat(...files) as string[] +} diff --git a/scripts/deploy/addresses/osmo-test-4.json b/scripts/deploy/addresses/osmo-test-4.json new file mode 100644 index 000000000..7c92a21be --- /dev/null +++ b/scripts/deploy/addresses/osmo-test-4.json @@ -0,0 +1,7 @@ +{ + "address-provider": "osmo17dyy6hyzzy6u5khy5lau7afa2y9kwknu0aprwqn8twndw2qhv8ls6msnjr", + "red-bank": "osmo1t0dl6r27phqetfu0geaxrng0u9zn8qgrdwztapt5xr32adtwptaq6vwg36", + "incentives": "osmo1zxs8fry3m8j94pqg7h4muunyx86en27cl0xgk76fc839xg2qnn6qtpjs48", + "oracle": "osmo1dqz2u3c8rs5e7w5fnchsr2mpzzsxew69wtdy0aq4jsd76w7upmsstqe0s8", + "rewards-collector": "osmo14kzsqw5tatdvwlkj383lgkh6gcdetwn7kfqm7488uargyy2lpucqsyv53j" +} diff --git a/scripts/deploy/addresses/osmosis-1.json b/scripts/deploy/addresses/osmosis-1.json new file mode 100644 index 000000000..6440a4f4d --- /dev/null +++ b/scripts/deploy/addresses/osmosis-1.json @@ -0,0 +1,7 @@ +{ + "address-provider": "osmo1g677w7mfvn78eeudzwylxzlyz69fsgumqrscj6tekhdvs8fye3asufmvxr", + "red-bank": "osmo1c3ljch9dfw5kf52nfwpxd2zmj2ese7agnx0p9tenkrryasrle5sqf3ftpg", + "incentives": "osmo1nkahswfr8shg8rlxqwup0vgahp0dk4x8w6tkv3rra8rratnut36sk22vrm", + "oracle": "osmo1mhznfr60vjdp2gejhyv2gax9nvyyzhd3z0qcwseyetkfustjauzqycsy2g", + "rewards-collector": "osmo1urvqe5mw00ws25yqdd4c4hlh8kdyf567mpcml7cdve9w08z0ydcqvsrgdy" +} diff --git a/scripts/deploy/base/deployer.ts b/scripts/deploy/base/deployer.ts new file mode 100644 index 000000000..31a95a02a --- /dev/null +++ b/scripts/deploy/base/deployer.ts @@ -0,0 +1,147 @@ +import { DeploymentConfig, OracleConfig } from '../../types/config' +import { SigningCosmWasmClient } from '@cosmjs/cosmwasm-stargate' +import * as fs from 'fs' +import { printBlue, printGreen, printRed, printYellow } from '../../utils/chalk' +import { ARTIFACTS_PATH, Storage } from './storage' +import { InstantiateMsgs } from '../../types/msg' +import assert from 'assert' + +export class Deployer { + constructor( + public config: DeploymentConfig, + public client: SigningCosmWasmClient, + public deployerAddress: string, + private storage: Storage, + ) {} + + async saveStorage() { + await this.storage.save() + } + + async assertDeployerBalance() { + const accountBalance = await this.client.getBalance( + this.deployerAddress, + this.config.baseAssetDenom, + ) + printYellow( + `${this.config.baseAssetDenom} account balance is: ${accountBalance.amount} (${ + Number(accountBalance.amount) / 1e6 + } ${this.config.chainPrefix})`, + ) + if (Number(accountBalance.amount) < 1_000_000 && this.config.chainId === 'osmo-test-4') { + printRed( + `not enough ${this.config.chainPrefix} tokens to complete action, you may need to go to a test faucet to get more tokens.`, + ) + } + } + + async upload(name: keyof Storage['codeIds'], file: string) { + if (this.storage.codeIds[name]) { + printBlue(`Wasm already uploaded :: ${name} :: ${this.storage.codeIds[name]}`) + return + } + + const wasm = fs.readFileSync(ARTIFACTS_PATH + file) + const uploadResult = await this.client.upload(this.deployerAddress, wasm, 'auto') + this.storage.codeIds[name] = uploadResult.codeId + printGreen(`${this.config.chainId} :: ${name} : ${this.storage.codeIds[name]}`) + } + + setOwnerAddr() { + if (this.config.multisigAddr) { + this.storage.owner = this.config.multisigAddr + } else { + this.storage.owner = this.deployerAddress + } + printGreen(`Owner is set to: ${this.storage.owner}`) + } + + async instantiate(name: keyof Storage['addresses'], codeId: number, msg: InstantiateMsgs) { + if (this.storage.addresses[name]) { + printBlue(`Contract already instantiated :: ${name} :: ${this.storage.addresses[name]}`) + return + } + + const { contractAddress } = await this.client.instantiate( + this.deployerAddress, + codeId, + msg, + `mars-${name}`, + 'auto', + { admin: this.storage.owner }, + ) + + this.storage.addresses[name] = contractAddress + printGreen( + `${this.config.chainId} :: ${name} Contract Address : ${this.storage.addresses[name]}`, + ) + } + + async instantiateOracle() { + const msg = { + owner: this.deployerAddress, + base_denom: this.config.baseAssetDenom, + } + await this.instantiate('oracle', this.storage.codeIds.oracle!, msg) + } + + async setOracle(oracleConfig: OracleConfig) { + if (oracleConfig.price) { + const msg = { + set_price_source: { + denom: oracleConfig.denom, + price_source: { + fixed: { price: oracleConfig.price }, + }, + }, + } + await this.client.execute(this.deployerAddress, this.storage.addresses.oracle!, msg, 'auto') + } else { + const msg = { + set_price_source: { + denom: oracleConfig.denom, + price_source: { + geometric_twap: { + pool_id: oracleConfig.pool_id, + window_size: oracleConfig.window_size, + downtime_detector: oracleConfig.downtime_detector, + }, + }, + }, + } + // see if we need fixed price for osmo - remove fixed price + await this.client.execute(this.deployerAddress, this.storage.addresses.oracle!, msg, 'auto') + } + + printYellow('Oracle Price is set.') + + this.storage.execute.oraclePriceSet = true + + const oracleResult = (await this.client.queryContractSmart(this.storage.addresses.oracle!, { + price: { denom: oracleConfig.denom }, + })) as { price: number; denom: string } + + printGreen( + `${this.config.chainId} :: ${oracleConfig.denom} oracle price : ${JSON.stringify( + oracleResult, + )}`, + ) + } + + async updateOracleContractOwner() { + const msg = { + update_owner: { + propose_new_owner: { + proposed: this.storage.owner, + }, + }, + } + await this.client.execute(this.deployerAddress, this.storage.addresses.oracle!, msg, 'auto') + printYellow('Owner updated to Mutlisig for Oracle') + const oracleConfig = (await this.client.queryContractSmart(this.storage.addresses.oracle!, { + config: {}, + })) as { proposed_new_owner: string; prefix: string } + + assert.equal(oracleConfig.proposed_new_owner, this.config.multisigAddr) + } +} diff --git a/scripts/deploy/base/index.ts b/scripts/deploy/base/index.ts new file mode 100644 index 000000000..e983284ee --- /dev/null +++ b/scripts/deploy/base/index.ts @@ -0,0 +1,46 @@ +import { setupDeployer } from './setupDeployer' +import { DeploymentConfig } from '../../types/config' +import { printGreen, printRed } from '../../utils/chalk' +import { atomOracle, axlUSDCOracle } from '../osmosis/config' + +export const taskRunner = async (config: DeploymentConfig) => { + const deployer = await setupDeployer(config) + + try { + await deployer.saveStorage() + await deployer.assertDeployerBalance() + + // Upload contracts + await deployer.upload('oracle', `mars_oracle_${config.chainName}.wasm`) + // TODO: upload swapper contract + + // Instantiate contracts + deployer.setOwnerAddr() + await deployer.instantiateOracle() + // TODO: instantiate swapper contract + + // setup + await deployer.setOracle(atomOracle) + if (config.mainnet) { + await deployer.setOracle(axlUSDCOracle) + } + // TODO: setup contract + + //run tests + if (config.runTests) { + // TODO: run tests + } + + if (config.multisigAddr) { + await deployer.updateOracleContractOwner() + // TODO: transfer swapper contract ownership to multisig + printGreen('It is confirmed that all contracts have transferred ownership to the Multisig') + } else { + printGreen('Owner remains the deployer address.') + } + } catch (e) { + printRed(e) + } finally { + await deployer.saveStorage() + } +} diff --git a/scripts/deploy/base/setupDeployer.ts b/scripts/deploy/base/setupDeployer.ts new file mode 100644 index 000000000..5e6621b6e --- /dev/null +++ b/scripts/deploy/base/setupDeployer.ts @@ -0,0 +1,32 @@ +import { DeploymentConfig } from '../../types/config' +import { SigningCosmWasmClient, SigningCosmWasmClientOptions } from '@cosmjs/cosmwasm-stargate' +import { DirectSecp256k1HdWallet } from '@cosmjs/proto-signing' +import { GasPrice } from '@cosmjs/stargate' +import { Deployer } from './deployer' +import { Storage } from './storage' + +const getWallet = async (config: DeploymentConfig) => { + return await DirectSecp256k1HdWallet.fromMnemonic(config.deployerMnemonic, { + prefix: config.chainPrefix, + }) +} + +const getDeployer = async (wallet: DirectSecp256k1HdWallet) => { + const accounts = await wallet.getAccounts() + return accounts[0].address +} + +const setupClient = async (config: DeploymentConfig, wallet: DirectSecp256k1HdWallet) => { + const clientOption: SigningCosmWasmClientOptions = { + gasPrice: GasPrice.fromString(`0.1${config.baseAssetDenom}`), + } + return await SigningCosmWasmClient.connectWithSigner(config.rpcEndpoint, wallet, clientOption) +} + +export const setupDeployer = async (config: DeploymentConfig) => { + const wallet = await getWallet(config) + const client = await setupClient(config, wallet) + const deployerAddr = await getDeployer(wallet) + const storage = await Storage.load(config.chainId) + return new Deployer(config, client, deployerAddr, storage) +} diff --git a/scripts/deploy/base/storage.ts b/scripts/deploy/base/storage.ts new file mode 100644 index 000000000..a32fe0ffa --- /dev/null +++ b/scripts/deploy/base/storage.ts @@ -0,0 +1,42 @@ +import { readFile, writeFile } from 'fs/promises' +import path from 'path' +import { StorageItems } from '../../types/storageItems' + +export const ARTIFACTS_PATH = '../artifacts/' + +export class Storage implements StorageItems { + public addresses: StorageItems['addresses'] + public codeIds: StorageItems['codeIds'] + public execute: StorageItems['execute'] + public owner: StorageItems['owner'] + private readonly chainId: string + + constructor(chainId: string, items: StorageItems) { + this.addresses = items.addresses + this.codeIds = items.codeIds + this.execute = items.execute + this.owner = items.owner + this.chainId = chainId + } + + static async load(chainId: string): Promise { + try { + const data = await readFile(path.join(ARTIFACTS_PATH, `${chainId}.json`), 'utf8') + const items = JSON.parse(data) as StorageItems + return new this(chainId, items) + } catch (e) { + return new this(chainId, { + addresses: {}, + codeIds: {}, + execute: { assetsInitialized: [] }, + }) + } + } + + async save() { + await writeFile( + path.join(ARTIFACTS_PATH, `${this.chainId}.json`), + JSON.stringify(this, null, 2), + ) + } +} diff --git a/scripts/deploy/osmosis/config.ts b/scripts/deploy/osmosis/config.ts new file mode 100644 index 000000000..8921da478 --- /dev/null +++ b/scripts/deploy/osmosis/config.ts @@ -0,0 +1,223 @@ +import { DeploymentConfig, AssetConfig, OracleConfig } from '../../types/config' + +const axlUSDC = 'ibc/D189335C6E4A68B513C10AB227BF1C1D38C746766278BA3EEB4FB14124F1D858' +const atom = 'ibc/27394FB092D2ECCD56123C74F36E4C1F926001CEADA9CA97EA622B25F41E5EB2' +const marsTestnet = 'ibc/ACA4C8A815A053CC027DB90D15915ADA31939FA331CE745862CDD00A2904FA17' +const marsMainnet = 'ibc/573FCD90FACEE750F55A8864EF7D38265F07E5A9273FA0E8DAFD39951332B580' +// note the following three addresses are all 'mars' bech32 prefix +const safetyFundAddr = 'mars1s4hgh56can3e33e0zqpnjxh0t5wdf7u3pze575' +const protocolAdminAddr = 'osmo14w4x949nwcrqgfe53pxs3k7x53p0gvlrq34l5n' +const feeCollectorAddr = 'mars17xpfvakm2amg962yls6f84z3kell8c5ldy6e7x' +const marsOsmoPool = 907 + +// axlUSDC does not have a pool on testnet so config can't have swapRoutes configured correctly +export const osmosisTestnetConfig: DeploymentConfig = { + chainName: 'osmosis', + atomDenom: atom, + baseAssetDenom: 'uosmo', + chainId: 'osmo-test-4', + chainPrefix: 'osmo', + channelId: 'channel-2083', + marsDenom: marsTestnet, + rewardCollectorTimeoutSeconds: 600, + rpcEndpoint: 'https://rpc-test.osmosis.zone', + safetyFundFeeShare: '0.5', + deployerMnemonic: + 'elevator august inherit simple buddy giggle zone despair marine rich swim danger blur people hundred faint ladder wet toe strong blade utility trial process', + slippage_tolerance: '0.01', + base_asset_symbol: 'OSMO', + second_asset_symbol: 'ATOM', + runTests: false, + mainnet: false, + feeCollectorDenom: marsTestnet, + safetyFundDenom: axlUSDC, + swapRoutes: [ + { denom_in: atom, denom_out: 'uosmo', route: [{ pool_id: 1, token_out_denom: 'uosmo' }] }, + ], + safetyFundAddr: safetyFundAddr, + protocolAdminAddr: protocolAdminAddr, + feeCollectorAddr: feeCollectorAddr, +} + +// axlUSDC does not have a pool on testnet so config can't have swapRoutes configured correctly +export const osmosisTestMultisig: DeploymentConfig = { + chainName: 'osmosis', + atomDenom: atom, + baseAssetDenom: 'uosmo', + chainId: 'osmo-test-4', + chainPrefix: 'osmo', + channelId: 'channel-2083', + marsDenom: marsTestnet, + rewardCollectorTimeoutSeconds: 600, + rpcEndpoint: 'https://rpc-test.osmosis.zone', + safetyFundFeeShare: '0.5', + deployerMnemonic: + 'elevator august inherit simple buddy giggle zone despair marine rich swim danger blur people hundred faint ladder wet toe strong blade utility trial process', + slippage_tolerance: '0.01', + base_asset_symbol: 'OSMO', + second_asset_symbol: 'ATOM', + multisigAddr: 'osmo14w4x949nwcrqgfe53pxs3k7x53p0gvlrq34l5n', + runTests: false, + mainnet: false, + feeCollectorDenom: marsTestnet, + safetyFundDenom: axlUSDC, + swapRoutes: [ + { denom_in: atom, denom_out: 'uosmo', route: [{ pool_id: 1, token_out_denom: 'uosmo' }] }, + ], + safetyFundAddr: safetyFundAddr, + protocolAdminAddr: protocolAdminAddr, + feeCollectorAddr: feeCollectorAddr, +} + +export const osmosisMainnet: DeploymentConfig = { + chainName: 'osmosis', + atomDenom: atom, + baseAssetDenom: 'uosmo', + chainId: 'osmosis-1', + chainPrefix: 'osmo', + channelId: 'channel-557', + marsDenom: marsMainnet, + rewardCollectorTimeoutSeconds: 600, + rpcEndpoint: 'https://rpc.osmosis.zone', + safetyFundFeeShare: '0.5', + deployerMnemonic: 'TO BE INSERTED AT TIME OF DEPLOYMENT', + slippage_tolerance: '0.01', + base_asset_symbol: 'OSMO', + second_asset_symbol: 'ATOM', + multisigAddr: 'osmo14w4x949nwcrqgfe53pxs3k7x53p0gvlrq34l5n', + runTests: false, + mainnet: true, + feeCollectorDenom: marsMainnet, + safetyFundDenom: axlUSDC, + swapRoutes: [ + { denom_in: 'uosmo', denom_out: axlUSDC, route: [{ pool_id: 678, token_out_denom: axlUSDC }] }, + { + denom_in: atom, + denom_out: axlUSDC, + route: [ + { pool_id: 1, token_out_denom: 'uosmo' }, + { pool_id: 678, token_out_denom: axlUSDC }, + ], + }, + { + denom_in: 'uosmo', + denom_out: marsMainnet, + route: [{ pool_id: marsOsmoPool, token_out_denom: marsMainnet }], + }, + { + denom_in: atom, + denom_out: marsMainnet, + route: [ + { pool_id: 1, token_out_denom: 'uosmo' }, + { pool_id: marsOsmoPool, token_out_denom: marsMainnet }, + ], + }, + { + denom_in: axlUSDC, + denom_out: marsMainnet, + route: [ + { pool_id: 678, token_out_denom: 'uosmo' }, + { pool_id: marsOsmoPool, token_out_denom: marsMainnet }, + ], + }, + ], + safetyFundAddr: safetyFundAddr, + protocolAdminAddr: protocolAdminAddr, + feeCollectorAddr: feeCollectorAddr, +} + +export const osmosisLocalConfig: DeploymentConfig = { + chainName: 'osmosis', + atomDenom: atom, + baseAssetDenom: 'uosmo', + chainId: 'localosmosis', + chainPrefix: 'osmo', + channelId: 'channel-1', + marsDenom: 'umars', + rewardCollectorTimeoutSeconds: 600, + rpcEndpoint: 'http://localhost:26657', + safetyFundFeeShare: '0.2', + deployerMnemonic: + 'notice oak worry limit wrap speak medal online prefer cluster roof addict wrist behave treat actual wasp year salad speed social layer crew genius', + slippage_tolerance: '0.05', + base_asset_symbol: 'OSMO', + second_asset_symbol: 'ATOM', + runTests: false, + mainnet: false, + feeCollectorDenom: axlUSDC, + safetyFundDenom: axlUSDC, + swapRoutes: [ + { denom_in: atom, denom_out: 'uosmo', route: [{ pool_id: 1, token_out_denom: 'uosmo' }] }, + ], + safetyFundAddr: safetyFundAddr, + protocolAdminAddr: protocolAdminAddr, + feeCollectorAddr: feeCollectorAddr, +} + +export const osmoAsset: AssetConfig = { + denom: 'uosmo', + max_loan_to_value: '0.59', + reserve_factor: '0.2', + liquidation_threshold: '0.61', + liquidation_bonus: '0.15', + interest_rate_model: { + optimal_utilization_rate: '0.6', + base: '0', + slope_1: '0.15', + slope_2: '3', + }, + deposit_cap: '2500000000000', + deposit_enabled: true, + borrow_enabled: true, + symbol: 'OSMO', +} + +export const atomAsset: AssetConfig = { + denom: 'ibc/27394FB092D2ECCD56123C74F36E4C1F926001CEADA9CA97EA622B25F41E5EB2', + max_loan_to_value: '0.68', + reserve_factor: '0.2', + liquidation_threshold: '0.7', + liquidation_bonus: '0.15', + interest_rate_model: { + optimal_utilization_rate: '0.6', + base: '0', + slope_1: '0.15', + slope_2: '3', + }, + deposit_cap: '100000000000', + deposit_enabled: true, + borrow_enabled: true, + symbol: 'ATOM', +} + +export const axlUSDCAsset: AssetConfig = { + denom: 'ibc/D189335C6E4A68B513C10AB227BF1C1D38C746766278BA3EEB4FB14124F1D858', + max_loan_to_value: '0.74', + reserve_factor: '0.2', + liquidation_threshold: '0.75', + liquidation_bonus: '0.1', + interest_rate_model: { + optimal_utilization_rate: '0.8', + base: '0', + slope_1: '0.2', + slope_2: '2', + }, + deposit_cap: '500000000000', + deposit_enabled: true, + borrow_enabled: true, + symbol: 'axlUSDC', +} + +export const atomOracle: OracleConfig = { + denom: 'ibc/27394FB092D2ECCD56123C74F36E4C1F926001CEADA9CA97EA622B25F41E5EB2', + pool_id: 1, + window_size: 1800, + downtime_detector: { downtime: 'duration30m', recovery: 7200 }, +} + +export const axlUSDCOracle: OracleConfig = { + denom: 'ibc/D189335C6E4A68B513C10AB227BF1C1D38C746766278BA3EEB4FB14124F1D858', + pool_id: 678, + window_size: 1800, + downtime_detector: { downtime: 'duration30m', recovery: 7200 }, +} diff --git a/scripts/deploy/osmosis/mainIndex.ts b/scripts/deploy/osmosis/mainIndex.ts new file mode 100644 index 000000000..6b0cb614c --- /dev/null +++ b/scripts/deploy/osmosis/mainIndex.ts @@ -0,0 +1,6 @@ +import { taskRunner } from '../base' +import { osmosisMainnet } from './config.js' + +void (async function () { + await taskRunner(osmosisMainnet) +})() diff --git a/scripts/deploy/osmosis/multisig.ts b/scripts/deploy/osmosis/multisig.ts new file mode 100644 index 000000000..78676d111 --- /dev/null +++ b/scripts/deploy/osmosis/multisig.ts @@ -0,0 +1,6 @@ +import { taskRunner } from '../base' +import { osmosisTestMultisig } from './config.js' + +void (async function () { + await taskRunner(osmosisTestMultisig) +})() diff --git a/scripts/deploy/osmosis/testIndex.ts b/scripts/deploy/osmosis/testIndex.ts new file mode 100644 index 000000000..ead3a96be --- /dev/null +++ b/scripts/deploy/osmosis/testIndex.ts @@ -0,0 +1,6 @@ +import { taskRunner } from '../base' +import { osmosisTestnetConfig } from './config.js' + +void (async function () { + await taskRunner(osmosisTestnetConfig) +})() diff --git a/scripts/multisig/mars/README.md b/scripts/multisig/mars/README.md new file mode 100644 index 000000000..9bf2d0d1c --- /dev/null +++ b/scripts/multisig/mars/README.md @@ -0,0 +1,321 @@ +# Mars Hub Multisig + +The multisig on Mars Hub is set to have 5 multisig holders with a threshold of 3, meaning that 3 signatures are needed for any transaction to pass. + +## Installing marsd + +1. Install homebrew: + +2. Clone the following repository: + +3. Check out to the latest stable release: + + ```bash + git checkout + ``` + +4. `make install` + +## Set up the multisig on your local network + +_Steps 2-4 must be completed by ALL multisig holders to properly set up their local keyring in their machine._ + +1. Generate the public keys of each of the 5 multisig holder's wallets. In order to generate a public key, the wallet must be active and have made at least one transaction on the specified network to return a public key. + + ```bash + marsd query account [address] --node=[node_URL] + ``` + +2. Add each public key to the keys list in your local network. + + ```bash + marsd keys add [name] --pubkey=[pubkey] + ``` + + Note: The pubkey must be entered with the same syntax as shown in Step 1. + +3. Generate the multisig. + + ```bash + marsd keys add mars_multisig \ + --multisig=[name1],[name2],[name3],[name4],[name5] \ + --multisig-threshold=3 + ``` + +4. Assert that it was completed correctly. + + ```bash + marsd keys show mars_multisig + ``` + +## Set up environment variables + +These variables change based on the network, transaction, time, and user. Therefore, they should be provided to the multisig holders before each transaction and updated as needed on your machine. + +For `bash`: + +```bash +# Mars Testnet variables +export MARS_MULTISIG="mars1skwmcsesjj99hye93smjz88rh0qndhvahewr60" +export MARS_TEST_NODE="https://testnet-rpc.marsprotocol.io:443" +export MARS_TEST_VESTING="mars14hj2tavq8fpesdwxxcu44rty3hh90vhujrvcmstl4zr3txmfvw9smxjtde" +export MARS_TEST_AIRDROP="mars1nc5tatafv6eyq7llkr2gv50ff9e22mnf70qgjlv737ktmt4eswrqhnhf0l" +export MARS_TEST_DELEGATOR="mars17p9rzwnnfxcjp32un9ug7yhhzgtkhvl9jfksztgw5uh69wac2pgs0gfvxm" +export MARS_TEST_CHAIN_ID="ares-1" + +# Transaction specific variables (must be created at time of transaction) +export CODEID="new_code_ID_to_migrate_to" +export MARS_SEQUENCE="current_account_sequence" +export UNSIGNED="unsignedTX_filename.JSON" +export SIGNEDTX="signedTX_filenme.JSON" +export EXECUTE="msg_to_execute" + +# User specific variables +export SINGLE_SIGN="your_name.JSON" +export MARS_ADDR="your_wallet_address" +``` + +**Note:** `MARS_ACCOUNT` and `MARS_SEQUENCE` can be found by running: + +```bash +marsd query account $MARS_MULTI \ + --node=$MARS_TEST_NODE \ + --chain-id=$MARS_TEST_CHAINID +``` + +## Verifying contracts + +1. Get the wasm binary executable on your local machine. + + ```bash + git clone https://github.com/mars-protocol/periphery + git checkout + cargo make rust-optimizer + ``` + + Note: Intel/AMD 64-bit processor is required. While there is experimental ARM support for CosmWasm/rust-optimizer, it's discouraged to use in production and the wasm bytecode will not match up to an Intel compiled wasm file. + +2. Download the wasm from the chain. + + ```bash + marsd query wasm code $CODEID --$NODE download.wasm + ``` + +3. Verify that the diff is empty between them. If any value is returned, then the wasm files differ. + + ```bash + diff artifacts/$CONTRACTNAME.wasm download.wasm + ``` + +## Query contract configs + +- Airdrop Contract Config: + + ```shell + QUERY='{"config":{}}' + marsd query wasm contract-state smart $MARS_TEST_AIRDROP "$QUERY" --output json --node=$MARS_TEST_NODE + ``` + +- Vesting Config: + + ```shell + QUERY='{"config":{}}' + marsd query wasm contract-state smart $MARS_TEST_VESTING "$QUERY" --output json --node=$MARS_TEST_NODE + ``` + +- Delegator Config: + + ```shell + QUERY='{"config":{}}' + marsd query wasm contract-state smart $MARS_TEST_DELEGATOR "$QUERY" --output json --node=$MARS_TEST_NODE + ``` + +## Signing a tx with the multisig - testnet migrate msg example + +**Every multisig holder is responsible for verifying the contract's newly uploaded code for every migrate msg.** + +_Note: The multisig must have at least one tx against it for the address to exist in Mars' state._ + +1. If the multisig has no txs against it, send some tokens to the account. Otherwise, the account does not exist in Mars' state. + +2. Assert that you have both your own wallet and multisig wallet in your keyring. + + ```bash + marsd keys list + ``` + + If they're missing, follow steps 2-4 from the "Set up multisig on your local network" section. + +3. Ensure the newly uploaded code has a migration entry point. + + ```rust + use cosmwasm_schema::cw_serde; + use cosmwasm_std::{entry_point, DepsMut, Env, Response, StdResult}; + + #[cw_serde] + struct MigrateMsg {} + + #[entry_point] + fn migrate(_deps: DepsMut, _env: Env, _msg: MigrateMsg) -> StdResult { + Ok(Response::default()) + } + ``` + +4. Initiate the multisig migrate tx. This can be done by any one of the multisig holders. + + Signing over a node: + + ```bash + marsd tx wasm migrate $CONTRACT $CODEID '{}' \ + --from=$MARS_MULTI \ + --chain-id=$MARS_TEST_CHAINID \ + --generate-only > $UNSIGNED \ + --node=$MARS_TEST_NODE + ``` + + Or do an offline sign mode: + + _Recommended when signing many transactions in a sequence before they are executed._ + + ```bash + marsd tx wasm migrate $CONTRACT $CODEID '{}' \ + --from=$MARS_MULTI\ + --chain-id=$MARS_TEST_CHAINID \ + --generate-only > $UNSIGNED \ + --offline \ + --sequence=$MARS_SEQUENCE \ + --account-number=$MARS_ACCOUNT + ``` + +5. Distribute the generated file to all signers. + +6. Individually sign the transaction. + Signing over a node: + + ```bash + marsd tx sign $UNSIGNED \ + --multisig=$MARS_MULTI \ + --from=$MARS_ADDR \ + --output-document=$SINGLE_SIGN \ + --chain-id=$MARS_TEST_CHAINID \ + --node=$MARS_TEST_NODE + + ## When using a ledger: + --sign-mode=amino-json + ``` + +7. Complete the multisign. There must be a total of 3 signers for the transaction to be successful. + Signing over a node: + + ```bash + marsd tx multisign $UNSIGNED $MARS_MULTI `$SINGER1`.json `$SIGNER2`.json `$SIGNER3`.json \ + --output-document=$SIGNED \ + --chain-id=$MARS_TEST_CHAINID \ + --node=$MARS_TEST_NODE + ``` + +8. Broadcast the transaction. + + ```bash + marsd tx broadcast $SIGNED \ + --chain-id=$MARS_TEST_CHAINID \ + --broadcast-mode=block + --node=$MARS_TEST_NODE + ``` + + Note: For the tx to be able to broadcast, the newly uploaded code needs to have a migration entry point, meaning you have to put an empty (returning Ok) migration method. + +9. Verify the new contract. Get the wasm binary executable on your local machine. + + ```bash + git clone https://github.com/mars-protocol/periphery + git checkout + ``` + + ```bash + docker run --rm -v "$(pwd)":/code \ + --mount type=volume,source="$(basename "$(pwd)")_cache",target=/code/target \ + --mount type=volume,source=registry_cache,target=/usr/local/cargo/registry \ + cosmwasm/workspace-optimizer:0.12.10 + ``` + + Note: Intel/Amd 64-bit processor is required. While there is experimental ARM support for CosmWasm/rust-optimizer, it's discouraged to use in production and the wasm bytecode will not match up to an Intel compiled wasm file. + + Download the wasm from the chain. + + ```bash + marsd query wasm code $CODEID --$NODE download.wasm + ``` + + Verify that the diff is empty between them. If any value is returned, then the wasm files differ. + + ```bash + diff artifacts/$CONTRACTNAME.wasm download.wasm + ``` + +## Signing a tx with the multisig - testnet execute msg example + +**Every multisig holder is responsible for verifying the contract's newly uploaded code for every migrate msg.** + +_Note: The multisig must have at least one tx against it or be registered in the auth module for the address to exist in Mars' state._ + +1. If the multisig does not exist in Mars' state, send some tokens to the account. Otherwise, the account cannot run the following commands. + +2. Assert that you have both your own wallet and multisig wallet in your keyring. + + ```bash + marsd keys list + ``` + + If they're missing, follow steps 2-4 from the "Set up multisig on your local network" section. + +3. Initiate the multisig execute tx. This can be done by any one of the multisig holders. + + ```bash + marsd tx wasm execute $CONTRACTADDR $EXECUTE \ + --from=$MARS_MULTI \ + --chain-id=$MARS_TEST_CHAINID \ + --generate-only > $UNSIGNED \ + --node=$MARS_TEST_NODE + ``` + +4. Distribute the generated file to all signers. + +5. Individually sign the transaction. + + ```bash + marsd tx sign $UNSIGNED \ + --multisig=$MARS_MULTI \ + --from=$MARS_ADDR \ + --output-document=$SINGLE_SIGN \ + --chain-id=$MARS_TEST_CHAINID \ + --node=$MARS_TEST_NODE + ``` + +6. Complete the multisign. There must be a total of 3 signers for the transaction to be successful. + + ```bash + marsd tx multisign $UNSIGNED $MARS_MULTI `$SINGER1`.json `$SIGNER2`.json `$SIGNER3`.json \ + --output-document=$SIGNED \ + --chain-id=$OSMO_TEST_CHAINID \ + --node=$MARS_TEST_NODE + ``` + +7. Broadcast the transaction. + + ```bash + marsd tx broadcast $SIGNED \ + --chain-id=$MARS_TEST_CHAINID \ + --broadcast-mode=block + --node=$MARS_TEST_NODE + ``` + +## Examples of execute args + +For this to be completed as a multisig tx, the flags and steps from the previous section must be used. + +```bash +# VESTING +EXECUTE='{"create_position":{"user":"$ADDR,"vest_schedule":"$VEST_SCHEDULE}}' +marsd tx wasm execute $MARS_TEST_VESTING "$EXECUTE" +``` diff --git a/scripts/multisig/osmosis/README.md b/scripts/multisig/osmosis/README.md new file mode 100644 index 000000000..73bf82d00 --- /dev/null +++ b/scripts/multisig/osmosis/README.md @@ -0,0 +1,429 @@ +# Osmosis Multisig Overview + +The multisig on Osmosis is set to have 5 multisig holders with a threshold of 3, meaning that 3 signatures are needed for any transaction to pass. + +## Set up Osmosisd + +Osmosisd is the daemon for the osmosis blockchain. To install, follow [this documentation](https://docs.osmosis.zone/osmosis-core/osmosisd/). + +## Set up the multisig on your local network + +_Steps 2-4 must be completed by ALL multisig holders to properly set up their local keyring in their machine._ + +1. Generate the public keys of each of the 5 multisig holder's wallets. In order to generate a public key, the wallet must be active and have made at least one transaction on the specified network to return a public key. + + ```bash + osmosisd query account [address] --node=[node_URL] + ``` + +2. Add each public key to the keys list in your local network. + + ```bash + osmosisd keys add [name] --pubkey=[pubkey] + ``` + + Note: The pubkey must be entered with the same syntax as shown in Step 1. + +3. Generate the multisig. + + ```bash + osmosisd keys add osmosis_multisig \ + --multisig=[name1],[name2],[name3],[name4],[name5] \ + --multisig-threshold=3 + ``` + +4. Assert that it was completed correctly. + + ```bash + osmosisd keys show osmosis_multisig + ``` + +5. Update the config with the new mutlisig address in `red-bank/scripts/deploy/osmosis/config`, which will set the owner and admin of the smart contracts to the multisig upon deployment. + +## Set up environment variables + +These variables change based on the network, transaction, time, and user. Therefore, they should be provided to the multisig holders before each transaction and updated as needed on your machine. + +For `# bash`: + +```bash +# Osmosis Testnet variables +export OSMO_MULTI="osmo1nxs5fw53jwh7epqnj5ypyqkdhga4lnnmng6ln5" +export OSMO_TEST_CHAINID="osmo-test-4" +export OSMO_TEST_NODE="https://rpc-test.osmosis.zone:443" +export OSMO_ACCOUNT="278179" +export OSMO_TEST_ADDR_PROVIDER="osmo17dyy6hyzzy6u5khy5lau7afa2y9kwknu0aprwqn8twndw2qhv8ls6msnjr" +export OSMO_TEST_REDBANK="osmo1t0dl6r27phqetfu0geaxrng0u9zn8qgrdwztapt5xr32adtwptaq6vwg36" +export OSMO_TEST_INCENTIVES="osmo1zxs8fry3m8j94pqg7h4muunyx86en27cl0xgk76fc839xg2qnn6qtpjs48" +export OSMO_TEST_ORACLE="osmo1eeg2uuuxk9agv8slskmhay3h5929vkfu9gfk0egwtfg9qs86w5dqty96cf" +export OSMO_TEST_REWARDS_COLLECTOR="osmo14kzsqw5tatdvwlkj383lgkh6gcdetwn7kfqm7488uargyy2lpucqsyv53j" +export OSMO_TEST_LIQUIDATION_FILTERER="osmo1djyfwh886gmwsdgr3w0jnzdgwudem9kqxte2f5mc20sxcmy029ss8r4ldq" + +# Transaction specific variables (must be created at time of transaction) +export CODEID="new_code_ID_to_migrate_to" +export SEQUENCE="current_account_sequence" +export UNSIGNED="unsignedTX_filename.JSON" +export SIGNEDTX="signedTX_filenme.JSON" +export EXECUTE="msg_to_execute" + +# User specific variables +export SINGLE_SIGN="your_name.JSON" +export OSMO_ADDR="your_wallet_address" +``` + +**Note:** + +`OSMO_ACCOUNT` and `SEQUENCE` can be found by running: + +```bash +osmosisd query account \ +--node=$OSMO_TEST_NODE \ +--chain-id=$OSMO_TEST_CHAINID \ +$OSMO_MULTI +``` + +## Verifying Contracts + +1. Get the wasm binary executable on your local machine. + + For address-provider, incentives, oracle, red-bank, rewards-collector contracts: + + ```bash + git clone https://github.com/mars-protocol/red-bank.git + git checkout + cargo make rust-optimizer + ``` + + For liquidation-filterer contract + + ```bash + git clone https://github.com/mars-protocol/liquidation-helpers + git checkout + cargo make rust-optimizer + ``` + + Note: Intel/AMD 64-bit processor is required. While there is experimental ARM support for CosmWasm/rust-optimizer, it's discouraged to use in production and the wasm bytecode will not match up to an Intel compiled wasm file. + +2. Download the wasm from the chain. + + ```bash + osmosisd query wasm code $CODEID -- $NODE download.wasm + ``` + +3. Verify that the diff is empty between them. If any value is returned, then the wasm files differ. + + ```bash + diff artifacts/$CONTRACTNAME.wasm download.wasm + ``` + +## Query contract configs + +- Red Bank Contract Config: + + ```bash + QUERY='{"config": {}}' + osmosisd query wasm contract-state smart $OSMO_TEST_REDBANK "$QUERY" --output json --node=$OSMO_TEST_NODE + ``` + +- Oracle Config: + + ```bash + QUERY='{"config": {}}' + osmosisd query wasm contract-state smart $OSMO_TEST_ORACLE "$QUERY" --output json --node=$OSMO_TEST_NODE + ``` + +- Incentives Config: + + ```bash + QUERY='{"config": {}}' + osmosisd query wasm contract-state smart $OSMO_TEST_INCENTIVES "$QUERY" --output json --node=$OSMO_TEST_NODE + ``` + +- Address Provider Config: + + ```bash + QUERY='{"config": {}}' + osmosisd query wasm contract-state smart $OSMO_TEST_ADDR_PROVIDER "$QUERY" --output json --node=$OSMO_TEST_NODE + ``` + +- Rewards Collector Config: + + ```bash + QUERY='{"config": {}}' + osmosisd query wasm contract-state smart $OSMO_TEST_REWARDS_COLLECTOR "$QUERY" --output json --node=$OSMO_TEST_NODE + ``` + +- Liquidation Filterer Config: + + ```bash + QUERY='{"config": {}}' + osmosisd query wasm contract-state smart $OSMO_TEST_LIQUIDATION_FILTERER "$QUERY" --output json --node=$OSMO_TEST_NODE + ``` + +- Verify OSMO, ATOM, and axlUSDC are initialized in the red bank market and have the correct params: + + ```bash + QUERY='{"market":{"denom":"uosmo"}}' + osmosisd query wasm contract-state smart $OSMO_TEST_REDBANK "$QUERY" --output json --node=$OSMO_TEST_NODE + + QUERY='{"market":{"denom":"ibc/27394FB092D2ECCD56123C74F36E4C1F926001CEADA9CA97EA622B25F41E5EB2"}}' + osmosisd query wasm contract-state smart $OSMO_TEST_REDBANK "$QUERY" --output json --node=$OSMO_TEST_NODE + + QUERY='{"market":{"denom":"ibc/D189335C6E4A68B513C10AB227BF1C1D38C746766278BA3EEB4FB14124F1D858"}}' + osmosisd query wasm contract-state smart $OSMO_TEST_REDBANK "$QUERY" --output json --node=$OSMO_TEST_NODE + ``` + +- Verify Oracle Price Source is set correctly: + + ```bash + QUERY='{"price_sources":{}}' + osmosisd query wasm contract-state smart $OSMO_TEST_ORACLE "$QUERY" --output json --node=$OSMO_TEST_NODE + ``` + +- Verify Rewards Collector Routes are set correctly: + + ```bash + QUERY='{"routes":{}}' + osmosisd query wasm contract-state smart $OSMO_TEST_REWARDS_COLLECTOR "$QUERY" --output json --node=$OSMO_TEST_NODE + ``` + +- Verify Admin is set correctly: + + _Note: If admin is not set, contracts are immutable_ + + ```bash + QUERY='{"routes":{}}' + osmosisd query wasm contract $OSMO_TEST_REWARDS_COLLECTOR + osmosisd query wasm contract $OSMO_TEST_RED_BANK + osmosisd query wasm contract $OSMO_TEST_ADDR_PROVIDER + osmosisd query wasm contract $OSMO_TEST_ORACLE + osmosisd query wasm contract $OSMO_TEST_INCENTIVES + ``` + +## Signing a TX with the multisig - Testnet Migrate Msg Example + +**Every multisig holder is responsible for verifying the contract's newly uploaded code for every migrate msg.** + +_Note: The multisig must have at least one tx against it for the address to exist in Osmosis' state._ + +1. If the multisig has no txs against it, send some tokens to the account. Otherwise, the account does not exist in Osmosis' state. + +2. Assert that you have both your own wallet and multisig wallet in your keyring. + + ```bash + osmosisd keys list + ``` + + If they're missing, follow steps 2-4 from the "Set up multisig on your local network" section. + +3. Ensure the newly uploaded code has a migration entry point. + + ```rust + #[cw_serde] + pub struct MigrateMsg {} + + #[entry_point] + pub fn migrate(_deps: DepsMut, _env: Env, _msg: MigrateMsg) -> StdResult { + Ok(Response::default()) + } + ``` + +4. Initiate the multisig migrate tx. This can be done by any one of the multisig holders. + + Signing over a node: + + ```bash + osmosisd tx wasm migrate $CONTRACT $CODEID '{}' \ + --from=$OSMO_MULTI \ + --chain-id=$OSMO_TEST_CHAINID \ + --generate-only > $UNSIGNED \ + --node=$OSMO_TEST_NODE + ``` + + Or do an offline sign mode: + + _Recommended when signing many transactions in a sequence before they are executed._ + + ```bash + osmosisd tx wasm migrate $CONTRACT $CODEID '{}' \ + --from=$OSMO_MULTI\ + --chain-id=$OSMO_TEST_CHAINID \ + --generate-only > $UNSIGNED \ + --offline \ + --sequence=$SEQUENCE \ + --account-number=$OSMO_ACCOUNT + ``` + +5. Distribute the generated file to all signers. + +6. Individually sign the transaction. + Signing over a node: + + ```bash + osmosisd tx sign $UNSIGNED \ + --multisig=$OSMO_MULTI \ + --from=$OSMO_ADDR \ + --output-document=$SINGLE_SIGN \ + --chain-id=$OSMO_TEST_CHAINID \ + --node=$OSMO_TEST_NODE + + # When using a ledger: + --sign-mode=amino-json + ``` + + Or do an offline sign mode: + + _Recommended when signing many transactions in a sequence before they are executed._ + + ```bash + osmosisd tx sign $UNSIGNED \ + --multisig=$OSMO_MULTI \ + --from=$OSMO_ADDR \ + --output-document=$SINGLE_SIGN \ + --chain-id=$OSMO_TEST_CHAINID \ + --offline \ + --sequence=$SEQUENCE \ + --account=$OSMO_ACCOUNT + + # When using a ledger: + --sign-mode=amino-json + ``` + +7. Complete the multisign. There must be a total of 3 signers for the transaction to be successful. + Signing over a node: + + ```bash + osmosisd tx multisign $UNSIGNED $OSMO_MULTI `$SINGER1`.json `$SIGNER2`.json `$SIGNER3`.json \ + --output-document=$SIGNED \ + --chain-id=$OSMO_TEST_CHAINID \ + --node=$OSMO_TEST_NODE + ``` + + Or do an offline sign mode: + + _Recommended when signing many transactions in a sequence before they are executed._ + + ```bash + osmosisd tx multisign $UNSIGNED $OSMO_MULTI `$SINGER1`.json `$SIGNER2`.json `$SIGNER3`.json \ + --output-document=$SIGNED \ + --chain-id=$OSMO_TEST_CHAINID \ + --offline \ + --sequence=$SEQUENCE \ + --account=$OSMO_ACCOUNT + ``` + +8. Broadcast the transaction. + + ```bash + osmosisd tx broadcast $SIGNED \ + --chain-id=$OSMO_TEST_CHAINID \ + --broadcast-mode=block + --node=$OSMO_TEST_NODE + ``` + + Note: For the tx to be able to broadcast when migrating contracts, the newly uploaded code needs to have a migration entry point, meaning you have to put an empty (returning Ok) migration method. + +9. Verify the new contract. + + ```bash + git clone https://github.com/mars-protocol/red-bank.git + git checkout + cargo make rust-optimizer + ``` + + ```bash + osmosisd query wasm code $CODEID $OSMO_TEST_NODE download.wasm + ``` + + ```bash + diff artifacts/$CONTRACTNAME.wasm download.wasm + ``` + +## Signing a TX with the multisig - Testnet Execute Msg Example + +Every multisig holder is responsible for verifying the execute msg inside the json file of their unsigned tx. + +1. Assert that you have both your own wallet and multisig wallet in your keyring. + + ```bash + osmosisd keys list + ``` + + If they're missing, follow steps 2-4 from the "Set up multisig on your local network" section. + +2. Initiate the multisig execute tx. This can be done by any one of the multisig holders. + + ```bash + osmosisd tx wasm execute $CONTRACTADDR $EXECUTE \ + --from=$OSMO_MULTI \ + --chain-id=$OSMO_TEST_CHAINID \ + --generate-only > $UNSIGNED \ + --node=$OSMO_TEST_NODE + ``` + +3. Distribute the generated file to all signers. + +4. Individually sign the transaction. + + ```bash + osmosisd tx sign $UNSIGNED \ + --multisig=$OSMO_MULTI \ + --from=$OSMO_ADDR \ + --output-document=$SINGLE_SIGN \ + --chain-id=$OSMO_TEST_CHAINID \ + --node=$OSMO_TEST_NODE + + ## When using a ledger: + --sign-mode=amino-json + ``` + +5. Complete the multisign. There must be a total of 3 signers for the transaction to be successful. + + ```bash + osmosisd tx multisign $UNSIGNED $OSMO_MULTI `$SINGER1`.json `$SIGNER2`.json `$SIGNER3`.json \ + --output-document=$SIGNED \ + --chain-id=$OSMO_TEST_CHAINID \ + --node=$OSMO_TEST_NODE + ``` + +6. Broadcast the transaction. + + ```bash + osmosisd tx broadcast $SIGNED \ + --chain-id=$OSMO_TEST_CHAINID \ + --broadcast-mode=block + --node=$OSMO_TEST_NODE + ``` + +## Examples of Execute Args + +For this to be completed as a multisig tx, the flags and steps from the previous section must be used. + +```bash +# Red Bank +EXECUTE='{"deposit":{}}' +osmosisd tx wasm execute $REDBANKADDR "$EXECUTE" + +EXECUTE='{"update_uncollateralized_loan_limit":{"user":"$ADDR","denom":"$DENOM","new_limit":"1000000000"}}' +osmosisd tx wasm execute $REDBANKADDR "$EXECUTE" + +# Rewards Collector +EXECUTE='{"update_config":{"new_cfg": {"safety_fund_denom":"ibc/27394FB092D2ECCD56123C74F36E4C1F926001CEADA9CA97EA622B25F41E5EB2","fee_collector_denom":"ibc/27394FB092D2ECCD56123C74F36E4C1F926001CEADA9CA97EA622B25F41E5EB2"}}}' +osmosisd tx wasm execute $REWARDSADDR "$EXECUTE" + +EXECUTE='{"set_route":{"denom_in":"uosmo","denom_out":"ibc/27394FB092D2ECCD56123C74F36E4C1F926001CEADA9CA97EA622B25F41E5EB2","route":[{"token_out_denom":"ibc/27394FB092D2ECCD56123C74F36E4C1F926001CEADA9CA97EA622B25F41E5EB2","pool_id":"1"}]}}' +osmosisd tx wasm execute $REWARDSADDR "$EXECUTE" + +EXECUTE='{"swap_asset":{"denom":"uosmo"}}' +osmosisd tx wasm execute $REWARDSADDR "$EXECUTE" + +# Oracle +EXECUTE='{"set_price_source":{"denom":"uosmo","price_source":{"fixed":{"price":"1.0"}}}}' +osmosisd tx wasm execute $ORACLEADDR "$EXECUTE" + +EXECUTE='{"set_price_source":{"denom":"ibc/27394FB092D2ECCD56123C74F36E4C1F926001CEADA9CA97EA622B25F41E5EB2","price_source":{"spot":{"pool_id":1}}}}' +osmosisd tx wasm execute $ORACLEADDR "$EXECUTE" + +EXECUTE='{"set_price_source":{"denom":"ibc/27394FB092D2ECCD56123C74F36E4C1F926001CEADA9CA97EA622B25F41E5EB2","price_source":{"twap":{"pool_id":1,"window_size":86400}}}}' +osmosisd tx wasm execute $ORACLEADDR "$EXECUTE" +``` diff --git a/scripts/package.json b/scripts/package.json new file mode 100644 index 000000000..c20fcf870 --- /dev/null +++ b/scripts/package.json @@ -0,0 +1,34 @@ +{ + "name": "scripts", + "version": "1.0.0", + "scripts": { + "deploy:osmosis-testnet": "yarn build && node build/deploy/osmosis/testIndex.js", + "deploy:osmosis-mainnet": "yarn build && node build/deploy/osmosis/mainIndex.js", + "deploy:osmosis-testnet-multisig": "yarn build && node build/deploy/osmosis/multisig.js", + "generate-types": "yarn rust-schema && tsc --project codegen-tsconfig.json && rm -rf types/generated && node build/codegen && node build/codegen/insertIgnores.js && yarn format", + "rust-schema": "cd ../ && cargo make generate-all-schemas && cd scripts", + "build": "tsc", + "lint": "yarn format-check && eslint . && yarn build", + "format": "prettier --write .", + "format-check": "prettier --ignore-path .gitignore --check ." + }, + "dependencies": { + "@cosmjs/cosmwasm-stargate": "^0.29.5", + "@cosmjs/proto-signing": "^0.29.5", + "@cosmjs/stargate": "^0.29.5", + "@cosmwasm/ts-codegen": "^0.24.0", + "chalk": "4.1.2", + "cosmjs-types": "^0.6.1", + "prepend-file": "^2.0.1" + }, + "devDependencies": { + "@types/node": "^18.11.18", + "@typescript-eslint/eslint-plugin": "^5.49.0", + "@typescript-eslint/parser": "^5.49.0", + "cosmjs-types": "^0.6.1", + "eslint": "^8.32.0", + "eslint-config-prettier": "^8.6.0", + "prettier": "^2.8.3", + "typescript": "^4.9.4" + } +} diff --git a/scripts/tsconfig.json b/scripts/tsconfig.json new file mode 100644 index 000000000..7b3570c4a --- /dev/null +++ b/scripts/tsconfig.json @@ -0,0 +1,32 @@ +{ + "compilerOptions": { + "target": "ES2021", + "lib": ["ES2021"], + "types": ["node"], + "module": "NodeNext", + "declaration": true, + "noImplicitAny": true, + "removeComments": true, + "experimentalDecorators": true, + "outDir": "./build", + "sourceMap": true, + "noEmitOnError": true, + "esModuleInterop": true, + "forceConsistentCasingInFileNames": true, + "strict": true, + "noEmit": false, + "moduleResolution": "node", + "isolatedModules": true, + "resolveJsonModule": true, + "noUnusedLocals": true, + "noUnusedParameters": true, + "noImplicitReturns": true, + "noImplicitThis": true, + "strictNullChecks": true, + "suppressImplicitAnyIndexErrors": true, + "allowSyntheticDefaultImports": true, + "skipLibCheck": true + }, + "include": ["**/*.ts", "**/*.tsx", "types.d.ts"], + "exclude": ["node_modules", "./build/**/*"] +} diff --git a/scripts/types/config.ts b/scripts/types/config.ts new file mode 100644 index 000000000..a68dfd307 --- /dev/null +++ b/scripts/types/config.ts @@ -0,0 +1,60 @@ +import { DowntimeDetector } from './mars-oracle-osmosis/MarsOracleOsmosis.types' +import { OsmosisRoute } from './generated/mars-swapper-osmosis/MarsSwapperOsmosis.types' + +type SwapRoute = { + denom_in: string + denom_out: string + route: OsmosisRoute +} + +export interface DeploymentConfig { + chainName: string + rewardCollectorTimeoutSeconds: number + marsDenom: string + baseAssetDenom: string + atomDenom: string + chainPrefix: string + safetyFundFeeShare: string + channelId: string + feeCollectorDenom: string + safetyFundDenom: string + chainId: string + rpcEndpoint: string + deployerMnemonic: string + slippage_tolerance: string + base_asset_symbol: string + second_asset_symbol: string + multisigAddr?: string + runTests: boolean + mainnet: boolean + swapRoutes: SwapRoute[] + safetyFundAddr: string + protocolAdminAddr: string + feeCollectorAddr: string +} + +export interface AssetConfig { + denom: string + max_loan_to_value: string + reserve_factor: string + liquidation_threshold: string + liquidation_bonus: string + interest_rate_model: { + optimal_utilization_rate: string + base: string + slope_1: string + slope_2: string + } + deposit_cap: string + deposit_enabled: boolean + borrow_enabled: boolean + symbol: string +} + +export interface OracleConfig { + denom: string + price?: string + pool_id?: number + window_size?: number + downtime_detector?: DowntimeDetector | null +} diff --git a/scripts/types/generated/mars-swapper-osmosis/MarsSwapperOsmosis.client.ts b/scripts/types/generated/mars-swapper-osmosis/MarsSwapperOsmosis.client.ts new file mode 100644 index 000000000..df141b095 --- /dev/null +++ b/scripts/types/generated/mars-swapper-osmosis/MarsSwapperOsmosis.client.ts @@ -0,0 +1,286 @@ +// @ts-nocheck +/** + * This file was automatically generated by @cosmwasm/ts-codegen@0.24.0. + * DO NOT MODIFY IT BY HAND. Instead, modify the source JSONSchema file, + * and run the @cosmwasm/ts-codegen generate command to regenerate this file. + */ + +import { CosmWasmClient, SigningCosmWasmClient, ExecuteResult } from '@cosmjs/cosmwasm-stargate' +import { StdFee } from '@cosmjs/amino' +import { + InstantiateMsg, + ExecuteMsg, + OwnerUpdate, + OsmosisRoute, + Uint128, + Decimal, + Addr, + SwapAmountInRoute, + Coin, + QueryMsg, + EstimateExactInSwapResponse, + OwnerResponse, + RouteResponseForEmpty, + Empty, + ArrayOfRouteResponseForEmpty, +} from './MarsSwapperOsmosis.types' +export interface MarsSwapperOsmosisReadOnlyInterface { + contractAddress: string + owner: () => Promise + route: ({ + denomIn, + denomOut, + }: { + denomIn: string + denomOut: string + }) => Promise + routes: ({ + limit, + startAfter, + }: { + limit?: number + startAfter?: string[][] + }) => Promise + estimateExactInSwap: ({ + coinIn, + denomOut, + }: { + coinIn: Coin + denomOut: string + }) => Promise +} +export class MarsSwapperOsmosisQueryClient implements MarsSwapperOsmosisReadOnlyInterface { + client: CosmWasmClient + contractAddress: string + + constructor(client: CosmWasmClient, contractAddress: string) { + this.client = client + this.contractAddress = contractAddress + this.owner = this.owner.bind(this) + this.route = this.route.bind(this) + this.routes = this.routes.bind(this) + this.estimateExactInSwap = this.estimateExactInSwap.bind(this) + } + + owner = async (): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + owner: {}, + }) + } + route = async ({ + denomIn, + denomOut, + }: { + denomIn: string + denomOut: string + }): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + route: { + denom_in: denomIn, + denom_out: denomOut, + }, + }) + } + routes = async ({ + limit, + startAfter, + }: { + limit?: number + startAfter?: string[][] + }): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + routes: { + limit, + start_after: startAfter, + }, + }) + } + estimateExactInSwap = async ({ + coinIn, + denomOut, + }: { + coinIn: Coin + denomOut: string + }): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + estimate_exact_in_swap: { + coin_in: coinIn, + denom_out: denomOut, + }, + }) + } +} +export interface MarsSwapperOsmosisInterface extends MarsSwapperOsmosisReadOnlyInterface { + contractAddress: string + sender: string + updateOwner: ( + fee?: number | StdFee | 'auto', + memo?: string, + funds?: Coin[], + ) => Promise + setRoute: ( + { + denomIn, + denomOut, + route, + }: { + denomIn: string + denomOut: string + route: OsmosisRoute + }, + fee?: number | StdFee | 'auto', + memo?: string, + funds?: Coin[], + ) => Promise + swapExactIn: ( + { + coinIn, + denomOut, + slippage, + }: { + coinIn: Coin + denomOut: string + slippage: Decimal + }, + fee?: number | StdFee | 'auto', + memo?: string, + funds?: Coin[], + ) => Promise + transferResult: ( + { + denomIn, + denomOut, + recipient, + }: { + denomIn: string + denomOut: string + recipient: Addr + }, + fee?: number | StdFee | 'auto', + memo?: string, + funds?: Coin[], + ) => Promise +} +export class MarsSwapperOsmosisClient + extends MarsSwapperOsmosisQueryClient + implements MarsSwapperOsmosisInterface +{ + client: SigningCosmWasmClient + sender: string + contractAddress: string + + constructor(client: SigningCosmWasmClient, sender: string, contractAddress: string) { + super(client, contractAddress) + this.client = client + this.sender = sender + this.contractAddress = contractAddress + this.updateOwner = this.updateOwner.bind(this) + this.setRoute = this.setRoute.bind(this) + this.swapExactIn = this.swapExactIn.bind(this) + this.transferResult = this.transferResult.bind(this) + } + + updateOwner = async ( + fee: number | StdFee | 'auto' = 'auto', + memo?: string, + funds?: Coin[], + ): Promise => { + return await this.client.execute( + this.sender, + this.contractAddress, + { + update_owner: {}, + }, + fee, + memo, + funds, + ) + } + setRoute = async ( + { + denomIn, + denomOut, + route, + }: { + denomIn: string + denomOut: string + route: OsmosisRoute + }, + fee: number | StdFee | 'auto' = 'auto', + memo?: string, + funds?: Coin[], + ): Promise => { + return await this.client.execute( + this.sender, + this.contractAddress, + { + set_route: { + denom_in: denomIn, + denom_out: denomOut, + route, + }, + }, + fee, + memo, + funds, + ) + } + swapExactIn = async ( + { + coinIn, + denomOut, + slippage, + }: { + coinIn: Coin + denomOut: string + slippage: Decimal + }, + fee: number | StdFee | 'auto' = 'auto', + memo?: string, + funds?: Coin[], + ): Promise => { + return await this.client.execute( + this.sender, + this.contractAddress, + { + swap_exact_in: { + coin_in: coinIn, + denom_out: denomOut, + slippage, + }, + }, + fee, + memo, + funds, + ) + } + transferResult = async ( + { + denomIn, + denomOut, + recipient, + }: { + denomIn: string + denomOut: string + recipient: Addr + }, + fee: number | StdFee | 'auto' = 'auto', + memo?: string, + funds?: Coin[], + ): Promise => { + return await this.client.execute( + this.sender, + this.contractAddress, + { + transfer_result: { + denom_in: denomIn, + denom_out: denomOut, + recipient, + }, + }, + fee, + memo, + funds, + ) + } +} diff --git a/scripts/types/generated/mars-swapper-osmosis/MarsSwapperOsmosis.react-query.ts b/scripts/types/generated/mars-swapper-osmosis/MarsSwapperOsmosis.react-query.ts new file mode 100644 index 000000000..7ddaa0e81 --- /dev/null +++ b/scripts/types/generated/mars-swapper-osmosis/MarsSwapperOsmosis.react-query.ts @@ -0,0 +1,245 @@ +// @ts-nocheck +/** + * This file was automatically generated by @cosmwasm/ts-codegen@0.24.0. + * DO NOT MODIFY IT BY HAND. Instead, modify the source JSONSchema file, + * and run the @cosmwasm/ts-codegen generate command to regenerate this file. + */ + +import { UseQueryOptions, useQuery, useMutation, UseMutationOptions } from '@tanstack/react-query' +import { ExecuteResult } from '@cosmjs/cosmwasm-stargate' +import { StdFee } from '@cosmjs/amino' +import { + InstantiateMsg, + ExecuteMsg, + OwnerUpdate, + OsmosisRoute, + Uint128, + Decimal, + Addr, + SwapAmountInRoute, + Coin, + QueryMsg, + EstimateExactInSwapResponse, + OwnerResponse, + RouteResponseForEmpty, + Empty, + ArrayOfRouteResponseForEmpty, +} from './MarsSwapperOsmosis.types' +import { + MarsSwapperOsmosisQueryClient, + MarsSwapperOsmosisClient, +} from './MarsSwapperOsmosis.client' +export const marsSwapperOsmosisQueryKeys = { + contract: [ + { + contract: 'marsSwapperOsmosis', + }, + ] as const, + address: (contractAddress: string | undefined) => + [{ ...marsSwapperOsmosisQueryKeys.contract[0], address: contractAddress }] as const, + owner: (contractAddress: string | undefined, args?: Record) => + [ + { ...marsSwapperOsmosisQueryKeys.address(contractAddress)[0], method: 'owner', args }, + ] as const, + route: (contractAddress: string | undefined, args?: Record) => + [ + { ...marsSwapperOsmosisQueryKeys.address(contractAddress)[0], method: 'route', args }, + ] as const, + routes: (contractAddress: string | undefined, args?: Record) => + [ + { ...marsSwapperOsmosisQueryKeys.address(contractAddress)[0], method: 'routes', args }, + ] as const, + estimateExactInSwap: (contractAddress: string | undefined, args?: Record) => + [ + { + ...marsSwapperOsmosisQueryKeys.address(contractAddress)[0], + method: 'estimate_exact_in_swap', + args, + }, + ] as const, +} +export interface MarsSwapperOsmosisReactQuery { + client: MarsSwapperOsmosisQueryClient | undefined + options?: Omit< + UseQueryOptions, + "'queryKey' | 'queryFn' | 'initialData'" + > & { + initialData?: undefined + } +} +export interface MarsSwapperOsmosisEstimateExactInSwapQuery + extends MarsSwapperOsmosisReactQuery { + args: { + coinIn: Coin + denomOut: string + } +} +export function useMarsSwapperOsmosisEstimateExactInSwapQuery({ + client, + args, + options, +}: MarsSwapperOsmosisEstimateExactInSwapQuery) { + return useQuery( + marsSwapperOsmosisQueryKeys.estimateExactInSwap(client?.contractAddress, args), + () => + client + ? client.estimateExactInSwap({ + coinIn: args.coinIn, + denomOut: args.denomOut, + }) + : Promise.reject(new Error('Invalid client')), + { ...options, enabled: !!client && (options?.enabled != undefined ? options.enabled : true) }, + ) +} +export interface MarsSwapperOsmosisRoutesQuery + extends MarsSwapperOsmosisReactQuery { + args: { + limit?: number + startAfter?: string[][] + } +} +export function useMarsSwapperOsmosisRoutesQuery({ + client, + args, + options, +}: MarsSwapperOsmosisRoutesQuery) { + return useQuery( + marsSwapperOsmosisQueryKeys.routes(client?.contractAddress, args), + () => + client + ? client.routes({ + limit: args.limit, + startAfter: args.startAfter, + }) + : Promise.reject(new Error('Invalid client')), + { ...options, enabled: !!client && (options?.enabled != undefined ? options.enabled : true) }, + ) +} +export interface MarsSwapperOsmosisRouteQuery + extends MarsSwapperOsmosisReactQuery { + args: { + denomIn: string + denomOut: string + } +} +export function useMarsSwapperOsmosisRouteQuery({ + client, + args, + options, +}: MarsSwapperOsmosisRouteQuery) { + return useQuery( + marsSwapperOsmosisQueryKeys.route(client?.contractAddress, args), + () => + client + ? client.route({ + denomIn: args.denomIn, + denomOut: args.denomOut, + }) + : Promise.reject(new Error('Invalid client')), + { ...options, enabled: !!client && (options?.enabled != undefined ? options.enabled : true) }, + ) +} +export interface MarsSwapperOsmosisOwnerQuery + extends MarsSwapperOsmosisReactQuery {} +export function useMarsSwapperOsmosisOwnerQuery({ + client, + options, +}: MarsSwapperOsmosisOwnerQuery) { + return useQuery( + marsSwapperOsmosisQueryKeys.owner(client?.contractAddress), + () => (client ? client.owner() : Promise.reject(new Error('Invalid client'))), + { ...options, enabled: !!client && (options?.enabled != undefined ? options.enabled : true) }, + ) +} +export interface MarsSwapperOsmosisTransferResultMutation { + client: MarsSwapperOsmosisClient + msg: { + denomIn: string + denomOut: string + recipient: Addr + } + args?: { + fee?: number | StdFee | 'auto' + memo?: string + funds?: Coin[] + } +} +export function useMarsSwapperOsmosisTransferResultMutation( + options?: Omit< + UseMutationOptions, + 'mutationFn' + >, +) { + return useMutation( + ({ client, msg, args: { fee, memo, funds } = {} }) => + client.transferResult(msg, fee, memo, funds), + options, + ) +} +export interface MarsSwapperOsmosisSwapExactInMutation { + client: MarsSwapperOsmosisClient + msg: { + coinIn: Coin + denomOut: string + slippage: Decimal + } + args?: { + fee?: number | StdFee | 'auto' + memo?: string + funds?: Coin[] + } +} +export function useMarsSwapperOsmosisSwapExactInMutation( + options?: Omit< + UseMutationOptions, + 'mutationFn' + >, +) { + return useMutation( + ({ client, msg, args: { fee, memo, funds } = {} }) => client.swapExactIn(msg, fee, memo, funds), + options, + ) +} +export interface MarsSwapperOsmosisSetRouteMutation { + client: MarsSwapperOsmosisClient + msg: { + denomIn: string + denomOut: string + route: OsmosisRoute + } + args?: { + fee?: number | StdFee | 'auto' + memo?: string + funds?: Coin[] + } +} +export function useMarsSwapperOsmosisSetRouteMutation( + options?: Omit< + UseMutationOptions, + 'mutationFn' + >, +) { + return useMutation( + ({ client, msg, args: { fee, memo, funds } = {} }) => client.setRoute(msg, fee, memo, funds), + options, + ) +} +export interface MarsSwapperOsmosisUpdateOwnerMutation { + client: MarsSwapperOsmosisClient + args?: { + fee?: number | StdFee | 'auto' + memo?: string + funds?: Coin[] + } +} +export function useMarsSwapperOsmosisUpdateOwnerMutation( + options?: Omit< + UseMutationOptions, + 'mutationFn' + >, +) { + return useMutation( + ({ client, msg, args: { fee, memo, funds } = {} }) => client.updateOwner(msg, fee, memo, funds), + options, + ) +} diff --git a/scripts/types/generated/mars-swapper-osmosis/MarsSwapperOsmosis.types.ts b/scripts/types/generated/mars-swapper-osmosis/MarsSwapperOsmosis.types.ts new file mode 100644 index 000000000..95070c230 --- /dev/null +++ b/scripts/types/generated/mars-swapper-osmosis/MarsSwapperOsmosis.types.ts @@ -0,0 +1,98 @@ +// @ts-nocheck +/** + * This file was automatically generated by @cosmwasm/ts-codegen@0.24.0. + * DO NOT MODIFY IT BY HAND. Instead, modify the source JSONSchema file, + * and run the @cosmwasm/ts-codegen generate command to regenerate this file. + */ + +export interface InstantiateMsg { + owner: string +} +export type ExecuteMsg = + | { + update_owner: OwnerUpdate + } + | { + set_route: { + denom_in: string + denom_out: string + route: OsmosisRoute + } + } + | { + swap_exact_in: { + coin_in: Coin + denom_out: string + slippage: Decimal + } + } + | { + transfer_result: { + denom_in: string + denom_out: string + recipient: Addr + } + } +export type OwnerUpdate = + | { + propose_new_owner: { + proposed: string + } + } + | 'clear_proposed' + | 'accept_proposed' + | 'abolish_owner_role' +export type OsmosisRoute = SwapAmountInRoute[] +export type Uint128 = string +export type Decimal = string +export type Addr = string +export interface SwapAmountInRoute { + pool_id: number + token_out_denom: string + [k: string]: unknown +} +export interface Coin { + amount: Uint128 + denom: string + [k: string]: unknown +} +export type QueryMsg = + | { + owner: {} + } + | { + route: { + denom_in: string + denom_out: string + } + } + | { + routes: { + limit?: number | null + start_after?: [string, string] | null + } + } + | { + estimate_exact_in_swap: { + coin_in: Coin + denom_out: string + } + } +export interface EstimateExactInSwapResponse { + amount: Uint128 +} +export interface OwnerResponse { + abolished: boolean + initialized: boolean + owner?: string | null + proposed?: string | null +} +export interface RouteResponseForEmpty { + denom_in: string + denom_out: string + route: Empty +} +export interface Empty { + [k: string]: unknown +} +export type ArrayOfRouteResponseForEmpty = RouteResponseForEmpty[] diff --git a/scripts/types/generated/mars-swapper-osmosis/bundle.ts b/scripts/types/generated/mars-swapper-osmosis/bundle.ts new file mode 100644 index 000000000..717bb2225 --- /dev/null +++ b/scripts/types/generated/mars-swapper-osmosis/bundle.ts @@ -0,0 +1,13 @@ +// @ts-nocheck +/** + * This file was automatically generated by @cosmwasm/ts-codegen@0.24.0. + * DO NOT MODIFY IT BY HAND. Instead, modify the source JSONSchema file, + * and run the @cosmwasm/ts-codegen generate command to regenerate this file. + */ + +import * as _0 from './MarsSwapperOsmosis.types' +import * as _1 from './MarsSwapperOsmosis.client' +import * as _2 from './MarsSwapperOsmosis.react-query' +export namespace contracts { + export const MarsSwapperOsmosis = { ..._0, ..._1, ..._2 } +} diff --git a/scripts/types/mars-oracle-osmosis/MarsOracleOsmosis.client.ts b/scripts/types/mars-oracle-osmosis/MarsOracleOsmosis.client.ts new file mode 100644 index 000000000..da96b3af3 --- /dev/null +++ b/scripts/types/mars-oracle-osmosis/MarsOracleOsmosis.client.ts @@ -0,0 +1,221 @@ +// @ts-nocheck +/** + * This file was automatically generated by @cosmwasm/ts-codegen@0.24.0. + * DO NOT MODIFY IT BY HAND. Instead, modify the source JSONSchema file, + * and run the @cosmwasm/ts-codegen generate command to regenerate this file. + */ + +import { CosmWasmClient, SigningCosmWasmClient, ExecuteResult } from '@cosmjs/cosmwasm-stargate' +import { Coin, StdFee } from '@cosmjs/amino' +import { + InstantiateMsg, + ExecuteMsg, + OsmosisPriceSource, + Decimal, + Downtime, + OwnerUpdate, + DowntimeDetector, + QueryMsg, + ConfigResponse, + PriceResponse, + PriceSourceResponseForString, + ArrayOfPriceSourceResponseForString, + ArrayOfPriceResponse, +} from './MarsOracleOsmosis.types' +export interface MarsOracleOsmosisReadOnlyInterface { + contractAddress: string + config: () => Promise + priceSource: ({ denom }: { denom: string }) => Promise + priceSources: ({ + limit, + startAfter, + }: { + limit?: number + startAfter?: string + }) => Promise + price: ({ denom }: { denom: string }) => Promise + prices: ({ + limit, + startAfter, + }: { + limit?: number + startAfter?: string + }) => Promise +} +export class MarsOracleOsmosisQueryClient implements MarsOracleOsmosisReadOnlyInterface { + client: CosmWasmClient + contractAddress: string + + constructor(client: CosmWasmClient, contractAddress: string) { + this.client = client + this.contractAddress = contractAddress + this.config = this.config.bind(this) + this.priceSource = this.priceSource.bind(this) + this.priceSources = this.priceSources.bind(this) + this.price = this.price.bind(this) + this.prices = this.prices.bind(this) + } + + config = async (): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + config: {}, + }) + } + priceSource = async ({ denom }: { denom: string }): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + price_source: { + denom, + }, + }) + } + priceSources = async ({ + limit, + startAfter, + }: { + limit?: number + startAfter?: string + }): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + price_sources: { + limit, + start_after: startAfter, + }, + }) + } + price = async ({ denom }: { denom: string }): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + price: { + denom, + }, + }) + } + prices = async ({ + limit, + startAfter, + }: { + limit?: number + startAfter?: string + }): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + prices: { + limit, + start_after: startAfter, + }, + }) + } +} +export interface MarsOracleOsmosisInterface extends MarsOracleOsmosisReadOnlyInterface { + contractAddress: string + sender: string + setPriceSource: ( + { + denom, + priceSource, + }: { + denom: string + priceSource: OsmosisPriceSource + }, + fee?: number | StdFee | 'auto', + memo?: string, + funds?: Coin[], + ) => Promise + removePriceSource: ( + { + denom, + }: { + denom: string + }, + fee?: number | StdFee | 'auto', + memo?: string, + funds?: Coin[], + ) => Promise + updateOwner: ( + fee?: number | StdFee | 'auto', + memo?: string, + funds?: Coin[], + ) => Promise +} +export class MarsOracleOsmosisClient + extends MarsOracleOsmosisQueryClient + implements MarsOracleOsmosisInterface +{ + client: SigningCosmWasmClient + sender: string + contractAddress: string + + constructor(client: SigningCosmWasmClient, sender: string, contractAddress: string) { + super(client, contractAddress) + this.client = client + this.sender = sender + this.contractAddress = contractAddress + this.setPriceSource = this.setPriceSource.bind(this) + this.removePriceSource = this.removePriceSource.bind(this) + this.updateOwner = this.updateOwner.bind(this) + } + + setPriceSource = async ( + { + denom, + priceSource, + }: { + denom: string + priceSource: OsmosisPriceSource + }, + fee: number | StdFee | 'auto' = 'auto', + memo?: string, + funds?: Coin[], + ): Promise => { + return await this.client.execute( + this.sender, + this.contractAddress, + { + set_price_source: { + denom, + price_source: priceSource, + }, + }, + fee, + memo, + funds, + ) + } + removePriceSource = async ( + { + denom, + }: { + denom: string + }, + fee: number | StdFee | 'auto' = 'auto', + memo?: string, + funds?: Coin[], + ): Promise => { + return await this.client.execute( + this.sender, + this.contractAddress, + { + remove_price_source: { + denom, + }, + }, + fee, + memo, + funds, + ) + } + updateOwner = async ( + fee: number | StdFee | 'auto' = 'auto', + memo?: string, + funds?: Coin[], + ): Promise => { + return await this.client.execute( + this.sender, + this.contractAddress, + { + update_owner: {}, + }, + fee, + memo, + funds, + ) + } +} diff --git a/scripts/types/mars-oracle-osmosis/MarsOracleOsmosis.react-query.ts b/scripts/types/mars-oracle-osmosis/MarsOracleOsmosis.react-query.ts new file mode 100644 index 000000000..ca1a977ae --- /dev/null +++ b/scripts/types/mars-oracle-osmosis/MarsOracleOsmosis.react-query.ts @@ -0,0 +1,232 @@ +// @ts-nocheck +/** + * This file was automatically generated by @cosmwasm/ts-codegen@0.24.0. + * DO NOT MODIFY IT BY HAND. Instead, modify the source JSONSchema file, + * and run the @cosmwasm/ts-codegen generate command to regenerate this file. + */ + +import { UseQueryOptions, useQuery, useMutation, UseMutationOptions } from '@tanstack/react-query' +import { ExecuteResult } from '@cosmjs/cosmwasm-stargate' +import { StdFee, Coin } from '@cosmjs/amino' +import { + InstantiateMsg, + ExecuteMsg, + OsmosisPriceSource, + Decimal, + Downtime, + OwnerUpdate, + DowntimeDetector, + QueryMsg, + ConfigResponse, + PriceResponse, + PriceSourceResponseForString, + ArrayOfPriceSourceResponseForString, + ArrayOfPriceResponse, +} from './MarsOracleOsmosis.types' +import { MarsOracleOsmosisQueryClient, MarsOracleOsmosisClient } from './MarsOracleOsmosis.client' +export const marsOracleOsmosisQueryKeys = { + contract: [ + { + contract: 'marsOracleOsmosis', + }, + ] as const, + address: (contractAddress: string | undefined) => + [{ ...marsOracleOsmosisQueryKeys.contract[0], address: contractAddress }] as const, + config: (contractAddress: string | undefined, args?: Record) => + [ + { ...marsOracleOsmosisQueryKeys.address(contractAddress)[0], method: 'config', args }, + ] as const, + priceSource: (contractAddress: string | undefined, args?: Record) => + [ + { ...marsOracleOsmosisQueryKeys.address(contractAddress)[0], method: 'price_source', args }, + ] as const, + priceSources: (contractAddress: string | undefined, args?: Record) => + [ + { ...marsOracleOsmosisQueryKeys.address(contractAddress)[0], method: 'price_sources', args }, + ] as const, + price: (contractAddress: string | undefined, args?: Record) => + [{ ...marsOracleOsmosisQueryKeys.address(contractAddress)[0], method: 'price', args }] as const, + prices: (contractAddress: string | undefined, args?: Record) => + [ + { ...marsOracleOsmosisQueryKeys.address(contractAddress)[0], method: 'prices', args }, + ] as const, +} +export interface MarsOracleOsmosisReactQuery { + client: MarsOracleOsmosisQueryClient | undefined + options?: Omit< + UseQueryOptions, + "'queryKey' | 'queryFn' | 'initialData'" + > & { + initialData?: undefined + } +} +export interface MarsOracleOsmosisPricesQuery + extends MarsOracleOsmosisReactQuery { + args: { + limit?: number + startAfter?: string + } +} +export function useMarsOracleOsmosisPricesQuery({ + client, + args, + options, +}: MarsOracleOsmosisPricesQuery) { + return useQuery( + marsOracleOsmosisQueryKeys.prices(client?.contractAddress, args), + () => + client + ? client.prices({ + limit: args.limit, + startAfter: args.startAfter, + }) + : Promise.reject(new Error('Invalid client')), + { ...options, enabled: !!client && (options?.enabled != undefined ? options.enabled : true) }, + ) +} +export interface MarsOracleOsmosisPriceQuery + extends MarsOracleOsmosisReactQuery { + args: { + denom: string + } +} +export function useMarsOracleOsmosisPriceQuery({ + client, + args, + options, +}: MarsOracleOsmosisPriceQuery) { + return useQuery( + marsOracleOsmosisQueryKeys.price(client?.contractAddress, args), + () => + client + ? client.price({ + denom: args.denom, + }) + : Promise.reject(new Error('Invalid client')), + { ...options, enabled: !!client && (options?.enabled != undefined ? options.enabled : true) }, + ) +} +export interface MarsOracleOsmosisPriceSourcesQuery + extends MarsOracleOsmosisReactQuery { + args: { + limit?: number + startAfter?: string + } +} +export function useMarsOracleOsmosisPriceSourcesQuery({ + client, + args, + options, +}: MarsOracleOsmosisPriceSourcesQuery) { + return useQuery( + marsOracleOsmosisQueryKeys.priceSources(client?.contractAddress, args), + () => + client + ? client.priceSources({ + limit: args.limit, + startAfter: args.startAfter, + }) + : Promise.reject(new Error('Invalid client')), + { ...options, enabled: !!client && (options?.enabled != undefined ? options.enabled : true) }, + ) +} +export interface MarsOracleOsmosisPriceSourceQuery + extends MarsOracleOsmosisReactQuery { + args: { + denom: string + } +} +export function useMarsOracleOsmosisPriceSourceQuery({ + client, + args, + options, +}: MarsOracleOsmosisPriceSourceQuery) { + return useQuery( + marsOracleOsmosisQueryKeys.priceSource(client?.contractAddress, args), + () => + client + ? client.priceSource({ + denom: args.denom, + }) + : Promise.reject(new Error('Invalid client')), + { ...options, enabled: !!client && (options?.enabled != undefined ? options.enabled : true) }, + ) +} +export interface MarsOracleOsmosisConfigQuery + extends MarsOracleOsmosisReactQuery {} +export function useMarsOracleOsmosisConfigQuery({ + client, + options, +}: MarsOracleOsmosisConfigQuery) { + return useQuery( + marsOracleOsmosisQueryKeys.config(client?.contractAddress), + () => (client ? client.config() : Promise.reject(new Error('Invalid client'))), + { ...options, enabled: !!client && (options?.enabled != undefined ? options.enabled : true) }, + ) +} +export interface MarsOracleOsmosisUpdateOwnerMutation { + client: MarsOracleOsmosisClient + args?: { + fee?: number | StdFee | 'auto' + memo?: string + funds?: Coin[] + } +} +export function useMarsOracleOsmosisUpdateOwnerMutation( + options?: Omit< + UseMutationOptions, + 'mutationFn' + >, +) { + return useMutation( + ({ client, msg, args: { fee, memo, funds } = {} }) => client.updateOwner(msg, fee, memo, funds), + options, + ) +} +export interface MarsOracleOsmosisRemovePriceSourceMutation { + client: MarsOracleOsmosisClient + msg: { + denom: string + } + args?: { + fee?: number | StdFee | 'auto' + memo?: string + funds?: Coin[] + } +} +export function useMarsOracleOsmosisRemovePriceSourceMutation( + options?: Omit< + UseMutationOptions, + 'mutationFn' + >, +) { + return useMutation( + ({ client, msg, args: { fee, memo, funds } = {} }) => + client.removePriceSource(msg, fee, memo, funds), + options, + ) +} +export interface MarsOracleOsmosisSetPriceSourceMutation { + client: MarsOracleOsmosisClient + msg: { + denom: string + priceSource: OsmosisPriceSource + } + args?: { + fee?: number | StdFee | 'auto' + memo?: string + funds?: Coin[] + } +} +export function useMarsOracleOsmosisSetPriceSourceMutation( + options?: Omit< + UseMutationOptions, + 'mutationFn' + >, +) { + return useMutation( + ({ client, msg, args: { fee, memo, funds } = {} }) => + client.setPriceSource(msg, fee, memo, funds), + options, + ) +} diff --git a/scripts/types/mars-oracle-osmosis/MarsOracleOsmosis.types.ts b/scripts/types/mars-oracle-osmosis/MarsOracleOsmosis.types.ts new file mode 100644 index 000000000..9b65cb2b7 --- /dev/null +++ b/scripts/types/mars-oracle-osmosis/MarsOracleOsmosis.types.ts @@ -0,0 +1,152 @@ +// @ts-nocheck +/** + * This file was automatically generated by @cosmwasm/ts-codegen@0.24.0. + * DO NOT MODIFY IT BY HAND. Instead, modify the source JSONSchema file, + * and run the @cosmwasm/ts-codegen generate command to regenerate this file. + */ + +export interface InstantiateMsg { + base_denom: string + owner: string +} +export type ExecuteMsg = + | { + set_price_source: { + denom: string + price_source: OsmosisPriceSource + } + } + | { + remove_price_source: { + denom: string + } + } + | { + update_owner: OwnerUpdate + } +export type OsmosisPriceSource = + | { + fixed: { + price: Decimal + [k: string]: unknown + } + } + | { + spot: { + pool_id: number + [k: string]: unknown + } + } + | { + arithmetic_twap: { + downtime_detector?: DowntimeDetector | null + pool_id: number + window_size: number + [k: string]: unknown + } + } + | { + geometric_twap: { + downtime_detector?: DowntimeDetector | null + pool_id: number + window_size: number + [k: string]: unknown + } + } + | { + xyk_liquidity_token: { + pool_id: number + [k: string]: unknown + } + } + | { + staked_geometric_twap: { + downtime_detector?: DowntimeDetector | null + pool_id: number + transitive_denom: string + window_size: number + [k: string]: unknown + } + } +export type Decimal = string +export type Downtime = + | 'duration30s' + | 'duration1m' + | 'duration2m' + | 'duration3m' + | 'duration4m' + | 'duration5m' + | 'duration10m' + | 'duration20m' + | 'duration30m' + | 'duration40m' + | 'duration50m' + | 'duration1h' + | 'duration15h' + | 'duration2h' + | 'duration25h' + | 'duration3h' + | 'duration4h' + | 'duration5h' + | 'duration6h' + | 'duration9h' + | 'duration12h' + | 'duration18h' + | 'duration24h' + | 'duration36h' + | 'duration48h' +export type OwnerUpdate = + | { + propose_new_owner: { + proposed: string + } + } + | 'clear_proposed' + | 'accept_proposed' + | 'abolish_owner_role' +export interface DowntimeDetector { + downtime: Downtime + recovery: number + [k: string]: unknown +} +export type QueryMsg = + | { + config: {} + } + | { + price_source: { + denom: string + } + } + | { + price_sources: { + limit?: number | null + start_after?: string | null + } + } + | { + price: { + denom: string + } + } + | { + prices: { + limit?: number | null + start_after?: string | null + } + } +export interface ConfigResponse { + base_denom: string + owner?: string | null + proposed_new_owner?: string | null +} +export interface PriceResponse { + denom: string + price: Decimal +} +export interface PriceSourceResponseForString { + denom: string + price_source: string +} +export type ArrayOfPriceSourceResponseForString = PriceSourceResponseForString[] +export type ArrayOfPriceResponse = PriceResponse[] diff --git a/scripts/types/mars-oracle-osmosis/bundle.ts b/scripts/types/mars-oracle-osmosis/bundle.ts new file mode 100644 index 000000000..aaf9bb266 --- /dev/null +++ b/scripts/types/mars-oracle-osmosis/bundle.ts @@ -0,0 +1,13 @@ +// @ts-nocheck +/** + * This file was automatically generated by @cosmwasm/ts-codegen@0.24.0. + * DO NOT MODIFY IT BY HAND. Instead, modify the source JSONSchema file, + * and run the @cosmwasm/ts-codegen generate command to regenerate this file. + */ + +import * as _6 from './MarsOracleOsmosis.types' +import * as _7 from './MarsOracleOsmosis.client' +import * as _8 from './MarsOracleOsmosis.react-query' +export namespace contracts { + export const MarsOracleOsmosis = { ..._6, ..._7, ..._8 } +} diff --git a/scripts/types/msg.ts b/scripts/types/msg.ts new file mode 100644 index 000000000..a5f513f5e --- /dev/null +++ b/scripts/types/msg.ts @@ -0,0 +1,46 @@ +export type InstantiateMsgs = + | RedBankInstantiateMsg + | AddressProviderInstantiateMsg + | IncentivesInstantiateMsg + | OracleInstantiateMsg + | RewardsInstantiateMsg + +export interface RedBankInstantiateMsg { + owner: string + emergency_owner: string + config: { + address_provider: string + close_factor: string + } +} + +export interface AddressProviderInstantiateMsg { + owner: string + prefix: string +} + +export interface IncentivesInstantiateMsg { + owner: string + address_provider: string + mars_denom: string +} + +export interface OracleInstantiateMsg { + owner: string + base_denom: string +} + +export interface RewardsInstantiateMsg { + owner: string + safety_fund_denom: string + address_provider: string + slippage_tolerance: string + safety_tax_rate: string + timeout_seconds: number + fee_collector_denom: string + channel_id: string +} + +export interface UpdateOwner { + owner: string +} diff --git a/scripts/types/storageItems.ts b/scripts/types/storageItems.ts new file mode 100644 index 000000000..82ebad04a --- /dev/null +++ b/scripts/types/storageItems.ts @@ -0,0 +1,26 @@ +export interface StorageItems { + codeIds: { + 'red-bank'?: number + 'rewards-collector'?: number + 'address-provider'?: number + incentives?: number + oracle?: number + } + addresses: { + 'address-provider'?: string + 'rewards-collector'?: string + 'red-bank'?: string + incentives?: string + oracle?: string + } + + execute: { + addressProviderUpdated?: boolean + assetsInitialized: string[] + secondAssetInitialized?: boolean + oraclePriceSet?: boolean + smokeTest?: boolean + } + + owner?: string +} diff --git a/scripts/utils/chalk.ts b/scripts/utils/chalk.ts new file mode 100644 index 000000000..e7a6acd4e --- /dev/null +++ b/scripts/utils/chalk.ts @@ -0,0 +1,17 @@ +import chalk from 'chalk' + +export const printRed = (text: unknown) => { + console.log(chalk.red(text)) +} + +export const printBlue = (text: string) => { + console.log(chalk.blue(text)) +} + +export const printGreen = (text: string) => { + console.log(chalk.green(text)) +} + +export const printYellow = (text: string) => { + console.log(chalk.yellow(text)) +} diff --git a/scripts/yarn.lock b/scripts/yarn.lock new file mode 100644 index 000000000..2deefce00 --- /dev/null +++ b/scripts/yarn.lock @@ -0,0 +1,3732 @@ +# THIS IS AN AUTOGENERATED FILE. DO NOT EDIT THIS FILE DIRECTLY. +# yarn lockfile v1 + + +"@ampproject/remapping@^2.1.0": + version "2.2.0" + resolved "https://registry.yarnpkg.com/@ampproject/remapping/-/remapping-2.2.0.tgz#56c133824780de3174aed5ab6834f3026790154d" + integrity sha512-qRmjj8nj9qmLTQXXmaR1cck3UXSRMPrbsLJAasZpF+t3riI71BXed5ebIOYwQntykeZuhjsdweEc9BxH5Jc26w== + dependencies: + "@jridgewell/gen-mapping" "^0.1.0" + "@jridgewell/trace-mapping" "^0.3.9" + +"@babel/code-frame@^7.18.6": + version "7.18.6" + resolved "https://registry.yarnpkg.com/@babel/code-frame/-/code-frame-7.18.6.tgz#3b25d38c89600baa2dcc219edfa88a74eb2c427a" + integrity sha512-TDCmlK5eOvH+eH7cdAFlNXeVJqWIQ7gW9tY1GJIpUtFb6CmjVyq2VM3u71bOyR8CRihcCgMUYoDNyLXao3+70Q== + dependencies: + "@babel/highlight" "^7.18.6" + +"@babel/compat-data@^7.17.7", "@babel/compat-data@^7.18.8", "@babel/compat-data@^7.20.5": + version "7.20.10" + resolved "https://registry.yarnpkg.com/@babel/compat-data/-/compat-data-7.20.10.tgz#9d92fa81b87542fff50e848ed585b4212c1d34ec" + integrity sha512-sEnuDPpOJR/fcafHMjpcpGN5M2jbUGUHwmuWKM/YdPzeEDJg8bgmbcWQFUfE32MQjti1koACvoPVsDe8Uq+idg== + +"@babel/core@7.18.10": + version "7.18.10" + resolved "https://registry.yarnpkg.com/@babel/core/-/core-7.18.10.tgz#39ad504991d77f1f3da91be0b8b949a5bc466fb8" + integrity sha512-JQM6k6ENcBFKVtWvLavlvi/mPcpYZ3+R+2EySDEMSMbp7Mn4FexlbbJVrx2R7Ijhr01T8gyqrOaABWIOgxeUyw== + dependencies: + "@ampproject/remapping" "^2.1.0" + "@babel/code-frame" "^7.18.6" + "@babel/generator" "^7.18.10" + "@babel/helper-compilation-targets" "^7.18.9" + "@babel/helper-module-transforms" "^7.18.9" + "@babel/helpers" "^7.18.9" + "@babel/parser" "^7.18.10" + "@babel/template" "^7.18.10" + "@babel/traverse" "^7.18.10" + "@babel/types" "^7.18.10" + convert-source-map "^1.7.0" + debug "^4.1.0" + gensync "^1.0.0-beta.2" + json5 "^2.2.1" + semver "^6.3.0" + +"@babel/core@^7.11.6", "@babel/core@^7.12.3": + version "7.20.12" + resolved "https://registry.yarnpkg.com/@babel/core/-/core-7.20.12.tgz#7930db57443c6714ad216953d1356dac0eb8496d" + integrity sha512-XsMfHovsUYHFMdrIHkZphTN/2Hzzi78R08NuHfDBehym2VsPDL6Zn/JAD/JQdnRvbSsbQc4mVaU1m6JgtTEElg== + dependencies: + "@ampproject/remapping" "^2.1.0" + "@babel/code-frame" "^7.18.6" + "@babel/generator" "^7.20.7" + "@babel/helper-compilation-targets" "^7.20.7" + "@babel/helper-module-transforms" "^7.20.11" + "@babel/helpers" "^7.20.7" + "@babel/parser" "^7.20.7" + "@babel/template" "^7.20.7" + "@babel/traverse" "^7.20.12" + "@babel/types" "^7.20.7" + convert-source-map "^1.7.0" + debug "^4.1.0" + gensync "^1.0.0-beta.2" + json5 "^2.2.2" + semver "^6.3.0" + +"@babel/generator@7.18.12": + version "7.18.12" + resolved "https://registry.yarnpkg.com/@babel/generator/-/generator-7.18.12.tgz#fa58daa303757bd6f5e4bbca91b342040463d9f4" + integrity sha512-dfQ8ebCN98SvyL7IxNMCUtZQSq5R7kxgN+r8qYTGDmmSion1hX2C0zq2yo1bsCDhXixokv1SAWTZUMYbO/V5zg== + dependencies: + "@babel/types" "^7.18.10" + "@jridgewell/gen-mapping" "^0.3.2" + jsesc "^2.5.1" + +"@babel/generator@^7.18.10", "@babel/generator@^7.20.7": + version "7.20.7" + resolved "https://registry.yarnpkg.com/@babel/generator/-/generator-7.20.7.tgz#f8ef57c8242665c5929fe2e8d82ba75460187b4a" + integrity sha512-7wqMOJq8doJMZmP4ApXTzLxSr7+oO2jroJURrVEp6XShrQUObV8Tq/D0NCcoYg2uHqUrjzO0zwBjoYzelxK+sw== + dependencies: + "@babel/types" "^7.20.7" + "@jridgewell/gen-mapping" "^0.3.2" + jsesc "^2.5.1" + +"@babel/helper-annotate-as-pure@^7.18.6": + version "7.18.6" + resolved "https://registry.yarnpkg.com/@babel/helper-annotate-as-pure/-/helper-annotate-as-pure-7.18.6.tgz#eaa49f6f80d5a33f9a5dd2276e6d6e451be0a6bb" + integrity sha512-duORpUiYrEpzKIop6iNbjnwKLAKnJ47csTyRACyEmWj0QdUrm5aqNJGHSSEQSUAvNW0ojX0dOmK9dZduvkfeXA== + dependencies: + "@babel/types" "^7.18.6" + +"@babel/helper-builder-binary-assignment-operator-visitor@^7.18.6": + version "7.18.9" + resolved "https://registry.yarnpkg.com/@babel/helper-builder-binary-assignment-operator-visitor/-/helper-builder-binary-assignment-operator-visitor-7.18.9.tgz#acd4edfd7a566d1d51ea975dff38fd52906981bb" + integrity sha512-yFQ0YCHoIqarl8BCRwBL8ulYUaZpz3bNsA7oFepAzee+8/+ImtADXNOmO5vJvsPff3qi+hvpkY/NYBTrBQgdNw== + dependencies: + "@babel/helper-explode-assignable-expression" "^7.18.6" + "@babel/types" "^7.18.9" + +"@babel/helper-compilation-targets@^7.17.7", "@babel/helper-compilation-targets@^7.18.9", "@babel/helper-compilation-targets@^7.20.7": + version "7.20.7" + resolved "https://registry.yarnpkg.com/@babel/helper-compilation-targets/-/helper-compilation-targets-7.20.7.tgz#a6cd33e93629f5eb473b021aac05df62c4cd09bb" + integrity sha512-4tGORmfQcrc+bvrjb5y3dG9Mx1IOZjsHqQVUz7XCNHO+iTmqxWnVg3KRygjGmpRLJGdQSKuvFinbIb0CnZwHAQ== + dependencies: + "@babel/compat-data" "^7.20.5" + "@babel/helper-validator-option" "^7.18.6" + browserslist "^4.21.3" + lru-cache "^5.1.1" + semver "^6.3.0" + +"@babel/helper-create-class-features-plugin@^7.18.6", "@babel/helper-create-class-features-plugin@^7.20.12", "@babel/helper-create-class-features-plugin@^7.20.5", "@babel/helper-create-class-features-plugin@^7.20.7": + version "7.20.12" + resolved "https://registry.yarnpkg.com/@babel/helper-create-class-features-plugin/-/helper-create-class-features-plugin-7.20.12.tgz#4349b928e79be05ed2d1643b20b99bb87c503819" + integrity sha512-9OunRkbT0JQcednL0UFvbfXpAsUXiGjUk0a7sN8fUXX7Mue79cUSMjHGDRRi/Vz9vYlpIhLV5fMD5dKoMhhsNQ== + dependencies: + "@babel/helper-annotate-as-pure" "^7.18.6" + "@babel/helper-environment-visitor" "^7.18.9" + "@babel/helper-function-name" "^7.19.0" + "@babel/helper-member-expression-to-functions" "^7.20.7" + "@babel/helper-optimise-call-expression" "^7.18.6" + "@babel/helper-replace-supers" "^7.20.7" + "@babel/helper-skip-transparent-expression-wrappers" "^7.20.0" + "@babel/helper-split-export-declaration" "^7.18.6" + +"@babel/helper-create-regexp-features-plugin@^7.18.6", "@babel/helper-create-regexp-features-plugin@^7.20.5": + version "7.20.5" + resolved "https://registry.yarnpkg.com/@babel/helper-create-regexp-features-plugin/-/helper-create-regexp-features-plugin-7.20.5.tgz#5ea79b59962a09ec2acf20a963a01ab4d076ccca" + integrity sha512-m68B1lkg3XDGX5yCvGO0kPx3v9WIYLnzjKfPcQiwntEQa5ZeRkPmo2X/ISJc8qxWGfwUr+kvZAeEzAwLec2r2w== + dependencies: + "@babel/helper-annotate-as-pure" "^7.18.6" + regexpu-core "^5.2.1" + +"@babel/helper-define-polyfill-provider@^0.3.2", "@babel/helper-define-polyfill-provider@^0.3.3": + version "0.3.3" + resolved "https://registry.yarnpkg.com/@babel/helper-define-polyfill-provider/-/helper-define-polyfill-provider-0.3.3.tgz#8612e55be5d51f0cd1f36b4a5a83924e89884b7a" + integrity sha512-z5aQKU4IzbqCC1XH0nAqfsFLMVSo22SBKUc0BxGrLkolTdPTructy0ToNnlO2zA4j9Q/7pjMZf0DSY+DSTYzww== + dependencies: + "@babel/helper-compilation-targets" "^7.17.7" + "@babel/helper-plugin-utils" "^7.16.7" + debug "^4.1.1" + lodash.debounce "^4.0.8" + resolve "^1.14.2" + semver "^6.1.2" + +"@babel/helper-environment-visitor@^7.18.9": + version "7.18.9" + resolved "https://registry.yarnpkg.com/@babel/helper-environment-visitor/-/helper-environment-visitor-7.18.9.tgz#0c0cee9b35d2ca190478756865bb3528422f51be" + integrity sha512-3r/aACDJ3fhQ/EVgFy0hpj8oHyHpQc+LPtJoY9SzTThAsStm4Ptegq92vqKoE3vD706ZVFWITnMnxucw+S9Ipg== + +"@babel/helper-explode-assignable-expression@^7.18.6": + version "7.18.6" + resolved "https://registry.yarnpkg.com/@babel/helper-explode-assignable-expression/-/helper-explode-assignable-expression-7.18.6.tgz#41f8228ef0a6f1a036b8dfdfec7ce94f9a6bc096" + integrity sha512-eyAYAsQmB80jNfg4baAtLeWAQHfHFiR483rzFK+BhETlGZaQC9bsfrugfXDCbRHLQbIA7U5NxhhOxN7p/dWIcg== + dependencies: + "@babel/types" "^7.18.6" + +"@babel/helper-function-name@^7.18.9", "@babel/helper-function-name@^7.19.0": + version "7.19.0" + resolved "https://registry.yarnpkg.com/@babel/helper-function-name/-/helper-function-name-7.19.0.tgz#941574ed5390682e872e52d3f38ce9d1bef4648c" + integrity sha512-WAwHBINyrpqywkUH0nTnNgI5ina5TFn85HKS0pbPDfxFfhyR/aNQEn4hGi1P1JyT//I0t4OgXUlofzWILRvS5w== + dependencies: + "@babel/template" "^7.18.10" + "@babel/types" "^7.19.0" + +"@babel/helper-hoist-variables@^7.18.6": + version "7.18.6" + resolved "https://registry.yarnpkg.com/@babel/helper-hoist-variables/-/helper-hoist-variables-7.18.6.tgz#d4d2c8fb4baeaa5c68b99cc8245c56554f926678" + integrity sha512-UlJQPkFqFULIcyW5sbzgbkxn2FKRgwWiRexcuaR8RNJRy8+LLveqPjwZV/bwrLZCN0eUHD/x8D0heK1ozuoo6Q== + dependencies: + "@babel/types" "^7.18.6" + +"@babel/helper-member-expression-to-functions@^7.20.7": + version "7.20.7" + resolved "https://registry.yarnpkg.com/@babel/helper-member-expression-to-functions/-/helper-member-expression-to-functions-7.20.7.tgz#a6f26e919582275a93c3aa6594756d71b0bb7f05" + integrity sha512-9J0CxJLq315fEdi4s7xK5TQaNYjZw+nDVpVqr1axNGKzdrdwYBD5b4uKv3n75aABG0rCCTK8Im8Ww7eYfMrZgw== + dependencies: + "@babel/types" "^7.20.7" + +"@babel/helper-module-imports@^7.18.6": + version "7.18.6" + resolved "https://registry.yarnpkg.com/@babel/helper-module-imports/-/helper-module-imports-7.18.6.tgz#1e3ebdbbd08aad1437b428c50204db13c5a3ca6e" + integrity sha512-0NFvs3VkuSYbFi1x2Vd6tKrywq+z/cLeYC/RJNFrIX/30Bf5aiGYbtvGXolEktzJH8o5E5KJ3tT+nkxuuZFVlA== + dependencies: + "@babel/types" "^7.18.6" + +"@babel/helper-module-transforms@^7.18.6", "@babel/helper-module-transforms@^7.18.9", "@babel/helper-module-transforms@^7.20.11": + version "7.20.11" + resolved "https://registry.yarnpkg.com/@babel/helper-module-transforms/-/helper-module-transforms-7.20.11.tgz#df4c7af713c557938c50ea3ad0117a7944b2f1b0" + integrity sha512-uRy78kN4psmji1s2QtbtcCSaj/LILFDp0f/ymhpQH5QY3nljUZCaNWz9X1dEj/8MBdBEFECs7yRhKn8i7NjZgg== + dependencies: + "@babel/helper-environment-visitor" "^7.18.9" + "@babel/helper-module-imports" "^7.18.6" + "@babel/helper-simple-access" "^7.20.2" + "@babel/helper-split-export-declaration" "^7.18.6" + "@babel/helper-validator-identifier" "^7.19.1" + "@babel/template" "^7.20.7" + "@babel/traverse" "^7.20.10" + "@babel/types" "^7.20.7" + +"@babel/helper-optimise-call-expression@^7.18.6": + version "7.18.6" + resolved "https://registry.yarnpkg.com/@babel/helper-optimise-call-expression/-/helper-optimise-call-expression-7.18.6.tgz#9369aa943ee7da47edab2cb4e838acf09d290ffe" + integrity sha512-HP59oD9/fEHQkdcbgFCnbmgH5vIQTJbxh2yf+CdM89/glUNnuzr87Q8GIjGEnOktTROemO0Pe0iPAYbqZuOUiA== + dependencies: + "@babel/types" "^7.18.6" + +"@babel/helper-plugin-utils@^7.0.0", "@babel/helper-plugin-utils@^7.10.4", "@babel/helper-plugin-utils@^7.12.13", "@babel/helper-plugin-utils@^7.14.5", "@babel/helper-plugin-utils@^7.16.7", "@babel/helper-plugin-utils@^7.18.6", "@babel/helper-plugin-utils@^7.18.9", "@babel/helper-plugin-utils@^7.19.0", "@babel/helper-plugin-utils@^7.20.2", "@babel/helper-plugin-utils@^7.8.0", "@babel/helper-plugin-utils@^7.8.3": + version "7.20.2" + resolved "https://registry.yarnpkg.com/@babel/helper-plugin-utils/-/helper-plugin-utils-7.20.2.tgz#d1b9000752b18d0877cff85a5c376ce5c3121629" + integrity sha512-8RvlJG2mj4huQ4pZ+rU9lqKi9ZKiRmuvGuM2HlWmkmgOhbs6zEAw6IEiJ5cQqGbDzGZOhwuOQNtZMi/ENLjZoQ== + +"@babel/helper-remap-async-to-generator@^7.18.9": + version "7.18.9" + resolved "https://registry.yarnpkg.com/@babel/helper-remap-async-to-generator/-/helper-remap-async-to-generator-7.18.9.tgz#997458a0e3357080e54e1d79ec347f8a8cd28519" + integrity sha512-dI7q50YKd8BAv3VEfgg7PS7yD3Rtbi2J1XMXaalXO0W0164hYLnh8zpjRS0mte9MfVp/tltvr/cfdXPvJr1opA== + dependencies: + "@babel/helper-annotate-as-pure" "^7.18.6" + "@babel/helper-environment-visitor" "^7.18.9" + "@babel/helper-wrap-function" "^7.18.9" + "@babel/types" "^7.18.9" + +"@babel/helper-replace-supers@^7.18.6", "@babel/helper-replace-supers@^7.20.7": + version "7.20.7" + resolved "https://registry.yarnpkg.com/@babel/helper-replace-supers/-/helper-replace-supers-7.20.7.tgz#243ecd2724d2071532b2c8ad2f0f9f083bcae331" + integrity sha512-vujDMtB6LVfNW13jhlCrp48QNslK6JXi7lQG736HVbHz/mbf4Dc7tIRh1Xf5C0rF7BP8iiSxGMCmY6Ci1ven3A== + dependencies: + "@babel/helper-environment-visitor" "^7.18.9" + "@babel/helper-member-expression-to-functions" "^7.20.7" + "@babel/helper-optimise-call-expression" "^7.18.6" + "@babel/template" "^7.20.7" + "@babel/traverse" "^7.20.7" + "@babel/types" "^7.20.7" + +"@babel/helper-simple-access@^7.20.2": + version "7.20.2" + resolved "https://registry.yarnpkg.com/@babel/helper-simple-access/-/helper-simple-access-7.20.2.tgz#0ab452687fe0c2cfb1e2b9e0015de07fc2d62dd9" + integrity sha512-+0woI/WPq59IrqDYbVGfshjT5Dmk/nnbdpcF8SnMhhXObpTq2KNBdLFRFrkVdbDOyUmHBCxzm5FHV1rACIkIbA== + dependencies: + "@babel/types" "^7.20.2" + +"@babel/helper-skip-transparent-expression-wrappers@^7.20.0": + version "7.20.0" + resolved "https://registry.yarnpkg.com/@babel/helper-skip-transparent-expression-wrappers/-/helper-skip-transparent-expression-wrappers-7.20.0.tgz#fbe4c52f60518cab8140d77101f0e63a8a230684" + integrity sha512-5y1JYeNKfvnT8sZcK9DVRtpTbGiomYIHviSP3OQWmDPU3DeH4a1ZlT/N2lyQ5P8egjcRaT/Y9aNqUxK0WsnIIg== + dependencies: + "@babel/types" "^7.20.0" + +"@babel/helper-split-export-declaration@^7.18.6": + version "7.18.6" + resolved "https://registry.yarnpkg.com/@babel/helper-split-export-declaration/-/helper-split-export-declaration-7.18.6.tgz#7367949bc75b20c6d5a5d4a97bba2824ae8ef075" + integrity sha512-bde1etTx6ZyTmobl9LLMMQsaizFVZrquTEHOqKeQESMKo4PlObf+8+JA25ZsIpZhT/WEd39+vOdLXAFG/nELpA== + dependencies: + "@babel/types" "^7.18.6" + +"@babel/helper-string-parser@^7.18.10", "@babel/helper-string-parser@^7.19.4": + version "7.19.4" + resolved "https://registry.yarnpkg.com/@babel/helper-string-parser/-/helper-string-parser-7.19.4.tgz#38d3acb654b4701a9b77fb0615a96f775c3a9e63" + integrity sha512-nHtDoQcuqFmwYNYPz3Rah5ph2p8PFeFCsZk9A/48dPc/rGocJ5J3hAAZ7pb76VWX3fZKu+uEr/FhH5jLx7umrw== + +"@babel/helper-validator-identifier@^7.18.6", "@babel/helper-validator-identifier@^7.19.1": + version "7.19.1" + resolved "https://registry.yarnpkg.com/@babel/helper-validator-identifier/-/helper-validator-identifier-7.19.1.tgz#7eea834cf32901ffdc1a7ee555e2f9c27e249ca2" + integrity sha512-awrNfaMtnHUr653GgGEs++LlAvW6w+DcPrOliSMXWCKo597CwL5Acf/wWdNkf/tfEQE3mjkeD1YOVZOUV/od1w== + +"@babel/helper-validator-option@^7.18.6": + version "7.18.6" + resolved "https://registry.yarnpkg.com/@babel/helper-validator-option/-/helper-validator-option-7.18.6.tgz#bf0d2b5a509b1f336099e4ff36e1a63aa5db4db8" + integrity sha512-XO7gESt5ouv/LRJdrVjkShckw6STTaB7l9BrpBaAHDeF5YZT+01PCwmR0SJHnkW6i8OwW/EVWRShfi4j2x+KQw== + +"@babel/helper-wrap-function@^7.18.9": + version "7.20.5" + resolved "https://registry.yarnpkg.com/@babel/helper-wrap-function/-/helper-wrap-function-7.20.5.tgz#75e2d84d499a0ab3b31c33bcfe59d6b8a45f62e3" + integrity sha512-bYMxIWK5mh+TgXGVqAtnu5Yn1un+v8DDZtqyzKRLUzrh70Eal2O3aZ7aPYiMADO4uKlkzOiRiZ6GX5q3qxvW9Q== + dependencies: + "@babel/helper-function-name" "^7.19.0" + "@babel/template" "^7.18.10" + "@babel/traverse" "^7.20.5" + "@babel/types" "^7.20.5" + +"@babel/helpers@^7.18.9", "@babel/helpers@^7.20.7": + version "7.20.13" + resolved "https://registry.yarnpkg.com/@babel/helpers/-/helpers-7.20.13.tgz#e3cb731fb70dc5337134cadc24cbbad31cc87ad2" + integrity sha512-nzJ0DWCL3gB5RCXbUO3KIMMsBY2Eqbx8mBpKGE/02PgyRQFcPQLbkQ1vyy596mZLaP+dAfD+R4ckASzNVmW3jg== + dependencies: + "@babel/template" "^7.20.7" + "@babel/traverse" "^7.20.13" + "@babel/types" "^7.20.7" + +"@babel/highlight@^7.18.6": + version "7.18.6" + resolved "https://registry.yarnpkg.com/@babel/highlight/-/highlight-7.18.6.tgz#81158601e93e2563795adcbfbdf5d64be3f2ecdf" + integrity sha512-u7stbOuYjaPezCuLj29hNW1v64M2Md2qupEKP1fHc7WdOA3DgLh37suiSrZYY7haUB7iBeQZ9P1uiRF359do3g== + dependencies: + "@babel/helper-validator-identifier" "^7.18.6" + chalk "^2.0.0" + js-tokens "^4.0.0" + +"@babel/parser@7.18.11": + version "7.18.11" + resolved "https://registry.yarnpkg.com/@babel/parser/-/parser-7.18.11.tgz#68bb07ab3d380affa9a3f96728df07969645d2d9" + integrity sha512-9JKn5vN+hDt0Hdqn1PiJ2guflwP+B6Ga8qbDuoF0PzzVhrzsKIJo8yGqVk6CmMHiMei9w1C1Bp9IMJSIK+HPIQ== + +"@babel/parser@^7.14.7", "@babel/parser@^7.18.10", "@babel/parser@^7.18.11", "@babel/parser@^7.20.13", "@babel/parser@^7.20.7": + version "7.20.13" + resolved "https://registry.yarnpkg.com/@babel/parser/-/parser-7.20.13.tgz#ddf1eb5a813588d2fb1692b70c6fce75b945c088" + integrity sha512-gFDLKMfpiXCsjt4za2JA9oTMn70CeseCehb11kRZgvd7+F67Hih3OHOK24cRrWECJ/ljfPGac6ygXAs/C8kIvw== + +"@babel/plugin-bugfix-safari-id-destructuring-collision-in-function-expression@^7.18.6": + version "7.18.6" + resolved "https://registry.yarnpkg.com/@babel/plugin-bugfix-safari-id-destructuring-collision-in-function-expression/-/plugin-bugfix-safari-id-destructuring-collision-in-function-expression-7.18.6.tgz#da5b8f9a580acdfbe53494dba45ea389fb09a4d2" + integrity sha512-Dgxsyg54Fx1d4Nge8UnvTrED63vrwOdPmyvPzlNN/boaliRP54pm3pGzZD1SJUwrBA+Cs/xdG8kXX6Mn/RfISQ== + dependencies: + "@babel/helper-plugin-utils" "^7.18.6" + +"@babel/plugin-bugfix-v8-spread-parameters-in-optional-chaining@^7.18.9": + version "7.20.7" + resolved "https://registry.yarnpkg.com/@babel/plugin-bugfix-v8-spread-parameters-in-optional-chaining/-/plugin-bugfix-v8-spread-parameters-in-optional-chaining-7.20.7.tgz#d9c85589258539a22a901033853101a6198d4ef1" + integrity sha512-sbr9+wNE5aXMBBFBICk01tt7sBf2Oc9ikRFEcem/ZORup9IMUdNhW7/wVLEbbtlWOsEubJet46mHAL2C8+2jKQ== + dependencies: + "@babel/helper-plugin-utils" "^7.20.2" + "@babel/helper-skip-transparent-expression-wrappers" "^7.20.0" + "@babel/plugin-proposal-optional-chaining" "^7.20.7" + +"@babel/plugin-proposal-async-generator-functions@^7.18.10": + version "7.20.7" + resolved "https://registry.yarnpkg.com/@babel/plugin-proposal-async-generator-functions/-/plugin-proposal-async-generator-functions-7.20.7.tgz#bfb7276d2d573cb67ba379984a2334e262ba5326" + integrity sha512-xMbiLsn/8RK7Wq7VeVytytS2L6qE69bXPB10YCmMdDZbKF4okCqY74pI/jJQ/8U0b/F6NrT2+14b8/P9/3AMGA== + dependencies: + "@babel/helper-environment-visitor" "^7.18.9" + "@babel/helper-plugin-utils" "^7.20.2" + "@babel/helper-remap-async-to-generator" "^7.18.9" + "@babel/plugin-syntax-async-generators" "^7.8.4" + +"@babel/plugin-proposal-class-properties@7.18.6", "@babel/plugin-proposal-class-properties@^7.18.6": + version "7.18.6" + resolved "https://registry.yarnpkg.com/@babel/plugin-proposal-class-properties/-/plugin-proposal-class-properties-7.18.6.tgz#b110f59741895f7ec21a6fff696ec46265c446a3" + integrity sha512-cumfXOF0+nzZrrN8Rf0t7M+tF6sZc7vhQwYQck9q1/5w2OExlD+b4v4RpMJFaV1Z7WcDRgO6FqvxqxGlwo+RHQ== + dependencies: + "@babel/helper-create-class-features-plugin" "^7.18.6" + "@babel/helper-plugin-utils" "^7.18.6" + +"@babel/plugin-proposal-class-static-block@^7.18.6": + version "7.20.7" + resolved "https://registry.yarnpkg.com/@babel/plugin-proposal-class-static-block/-/plugin-proposal-class-static-block-7.20.7.tgz#92592e9029b13b15be0f7ce6a7aedc2879ca45a7" + integrity sha512-AveGOoi9DAjUYYuUAG//Ig69GlazLnoyzMw68VCDux+c1tsnnH/OkYcpz/5xzMkEFC6UxjR5Gw1c+iY2wOGVeQ== + dependencies: + "@babel/helper-create-class-features-plugin" "^7.20.7" + "@babel/helper-plugin-utils" "^7.20.2" + "@babel/plugin-syntax-class-static-block" "^7.14.5" + +"@babel/plugin-proposal-dynamic-import@^7.18.6": + version "7.18.6" + resolved "https://registry.yarnpkg.com/@babel/plugin-proposal-dynamic-import/-/plugin-proposal-dynamic-import-7.18.6.tgz#72bcf8d408799f547d759298c3c27c7e7faa4d94" + integrity sha512-1auuwmK+Rz13SJj36R+jqFPMJWyKEDd7lLSdOj4oJK0UTgGueSAtkrCvz9ewmgyU/P941Rv2fQwZJN8s6QruXw== + dependencies: + "@babel/helper-plugin-utils" "^7.18.6" + "@babel/plugin-syntax-dynamic-import" "^7.8.3" + +"@babel/plugin-proposal-export-default-from@7.18.10": + version "7.18.10" + resolved "https://registry.yarnpkg.com/@babel/plugin-proposal-export-default-from/-/plugin-proposal-export-default-from-7.18.10.tgz#091f4794dbce4027c03cf4ebc64d3fb96b75c206" + integrity sha512-5H2N3R2aQFxkV4PIBUR/i7PUSwgTZjouJKzI8eKswfIjT0PhvzkPn0t0wIS5zn6maQuvtT0t1oHtMUz61LOuow== + dependencies: + "@babel/helper-plugin-utils" "^7.18.9" + "@babel/plugin-syntax-export-default-from" "^7.18.6" + +"@babel/plugin-proposal-export-namespace-from@^7.18.9": + version "7.18.9" + resolved "https://registry.yarnpkg.com/@babel/plugin-proposal-export-namespace-from/-/plugin-proposal-export-namespace-from-7.18.9.tgz#5f7313ab348cdb19d590145f9247540e94761203" + integrity sha512-k1NtHyOMvlDDFeb9G5PhUXuGj8m/wiwojgQVEhJ/fsVsMCpLyOP4h0uGEjYJKrRI+EVPlb5Jk+Gt9P97lOGwtA== + dependencies: + "@babel/helper-plugin-utils" "^7.18.9" + "@babel/plugin-syntax-export-namespace-from" "^7.8.3" + +"@babel/plugin-proposal-json-strings@^7.18.6": + version "7.18.6" + resolved "https://registry.yarnpkg.com/@babel/plugin-proposal-json-strings/-/plugin-proposal-json-strings-7.18.6.tgz#7e8788c1811c393aff762817e7dbf1ebd0c05f0b" + integrity sha512-lr1peyn9kOdbYc0xr0OdHTZ5FMqS6Di+H0Fz2I/JwMzGmzJETNeOFq2pBySw6X/KFL5EWDjlJuMsUGRFb8fQgQ== + dependencies: + "@babel/helper-plugin-utils" "^7.18.6" + "@babel/plugin-syntax-json-strings" "^7.8.3" + +"@babel/plugin-proposal-logical-assignment-operators@^7.18.9": + version "7.20.7" + resolved "https://registry.yarnpkg.com/@babel/plugin-proposal-logical-assignment-operators/-/plugin-proposal-logical-assignment-operators-7.20.7.tgz#dfbcaa8f7b4d37b51e8bfb46d94a5aea2bb89d83" + integrity sha512-y7C7cZgpMIjWlKE5T7eJwp+tnRYM89HmRvWM5EQuB5BoHEONjmQ8lSNmBUwOyy/GFRsohJED51YBF79hE1djug== + dependencies: + "@babel/helper-plugin-utils" "^7.20.2" + "@babel/plugin-syntax-logical-assignment-operators" "^7.10.4" + +"@babel/plugin-proposal-nullish-coalescing-operator@^7.18.6": + version "7.18.6" + resolved "https://registry.yarnpkg.com/@babel/plugin-proposal-nullish-coalescing-operator/-/plugin-proposal-nullish-coalescing-operator-7.18.6.tgz#fdd940a99a740e577d6c753ab6fbb43fdb9467e1" + integrity sha512-wQxQzxYeJqHcfppzBDnm1yAY0jSRkUXR2z8RePZYrKwMKgMlE8+Z6LUno+bd6LvbGh8Gltvy74+9pIYkr+XkKA== + dependencies: + "@babel/helper-plugin-utils" "^7.18.6" + "@babel/plugin-syntax-nullish-coalescing-operator" "^7.8.3" + +"@babel/plugin-proposal-numeric-separator@^7.18.6": + version "7.18.6" + resolved "https://registry.yarnpkg.com/@babel/plugin-proposal-numeric-separator/-/plugin-proposal-numeric-separator-7.18.6.tgz#899b14fbafe87f053d2c5ff05b36029c62e13c75" + integrity sha512-ozlZFogPqoLm8WBr5Z8UckIoE4YQ5KESVcNudyXOR8uqIkliTEgJ3RoketfG6pmzLdeZF0H/wjE9/cCEitBl7Q== + dependencies: + "@babel/helper-plugin-utils" "^7.18.6" + "@babel/plugin-syntax-numeric-separator" "^7.10.4" + +"@babel/plugin-proposal-object-rest-spread@7.18.9": + version "7.18.9" + resolved "https://registry.yarnpkg.com/@babel/plugin-proposal-object-rest-spread/-/plugin-proposal-object-rest-spread-7.18.9.tgz#f9434f6beb2c8cae9dfcf97d2a5941bbbf9ad4e7" + integrity sha512-kDDHQ5rflIeY5xl69CEqGEZ0KY369ehsCIEbTGb4siHG5BE9sga/T0r0OUwyZNLMmZE79E1kbsqAjwFCW4ds6Q== + dependencies: + "@babel/compat-data" "^7.18.8" + "@babel/helper-compilation-targets" "^7.18.9" + "@babel/helper-plugin-utils" "^7.18.9" + "@babel/plugin-syntax-object-rest-spread" "^7.8.3" + "@babel/plugin-transform-parameters" "^7.18.8" + +"@babel/plugin-proposal-object-rest-spread@^7.18.9": + version "7.20.7" + resolved "https://registry.yarnpkg.com/@babel/plugin-proposal-object-rest-spread/-/plugin-proposal-object-rest-spread-7.20.7.tgz#aa662940ef425779c75534a5c41e9d936edc390a" + integrity sha512-d2S98yCiLxDVmBmE8UjGcfPvNEUbA1U5q5WxaWFUGRzJSVAZqm5W6MbPct0jxnegUZ0niLeNX+IOzEs7wYg9Dg== + dependencies: + "@babel/compat-data" "^7.20.5" + "@babel/helper-compilation-targets" "^7.20.7" + "@babel/helper-plugin-utils" "^7.20.2" + "@babel/plugin-syntax-object-rest-spread" "^7.8.3" + "@babel/plugin-transform-parameters" "^7.20.7" + +"@babel/plugin-proposal-optional-catch-binding@^7.18.6": + version "7.18.6" + resolved "https://registry.yarnpkg.com/@babel/plugin-proposal-optional-catch-binding/-/plugin-proposal-optional-catch-binding-7.18.6.tgz#f9400d0e6a3ea93ba9ef70b09e72dd6da638a2cb" + integrity sha512-Q40HEhs9DJQyaZfUjjn6vE8Cv4GmMHCYuMGIWUnlxH6400VGxOuwWsPt4FxXxJkC/5eOzgn0z21M9gMT4MOhbw== + dependencies: + "@babel/helper-plugin-utils" "^7.18.6" + "@babel/plugin-syntax-optional-catch-binding" "^7.8.3" + +"@babel/plugin-proposal-optional-chaining@^7.18.9", "@babel/plugin-proposal-optional-chaining@^7.20.7": + version "7.20.7" + resolved "https://registry.yarnpkg.com/@babel/plugin-proposal-optional-chaining/-/plugin-proposal-optional-chaining-7.20.7.tgz#49f2b372519ab31728cc14115bb0998b15bfda55" + integrity sha512-T+A7b1kfjtRM51ssoOfS1+wbyCVqorfyZhT99TvxxLMirPShD8CzKMRepMlCBGM5RpHMbn8s+5MMHnPstJH6mQ== + dependencies: + "@babel/helper-plugin-utils" "^7.20.2" + "@babel/helper-skip-transparent-expression-wrappers" "^7.20.0" + "@babel/plugin-syntax-optional-chaining" "^7.8.3" + +"@babel/plugin-proposal-private-methods@^7.18.6": + version "7.18.6" + resolved "https://registry.yarnpkg.com/@babel/plugin-proposal-private-methods/-/plugin-proposal-private-methods-7.18.6.tgz#5209de7d213457548a98436fa2882f52f4be6bea" + integrity sha512-nutsvktDItsNn4rpGItSNV2sz1XwS+nfU0Rg8aCx3W3NOKVzdMjJRu0O5OkgDp3ZGICSTbgRpxZoWsxoKRvbeA== + dependencies: + "@babel/helper-create-class-features-plugin" "^7.18.6" + "@babel/helper-plugin-utils" "^7.18.6" + +"@babel/plugin-proposal-private-property-in-object@^7.18.6": + version "7.20.5" + resolved "https://registry.yarnpkg.com/@babel/plugin-proposal-private-property-in-object/-/plugin-proposal-private-property-in-object-7.20.5.tgz#309c7668f2263f1c711aa399b5a9a6291eef6135" + integrity sha512-Vq7b9dUA12ByzB4EjQTPo25sFhY+08pQDBSZRtUAkj7lb7jahaHR5igera16QZ+3my1nYR4dKsNdYj5IjPHilQ== + dependencies: + "@babel/helper-annotate-as-pure" "^7.18.6" + "@babel/helper-create-class-features-plugin" "^7.20.5" + "@babel/helper-plugin-utils" "^7.20.2" + "@babel/plugin-syntax-private-property-in-object" "^7.14.5" + +"@babel/plugin-proposal-unicode-property-regex@^7.18.6", "@babel/plugin-proposal-unicode-property-regex@^7.4.4": + version "7.18.6" + resolved "https://registry.yarnpkg.com/@babel/plugin-proposal-unicode-property-regex/-/plugin-proposal-unicode-property-regex-7.18.6.tgz#af613d2cd5e643643b65cded64207b15c85cb78e" + integrity sha512-2BShG/d5yoZyXZfVePH91urL5wTG6ASZU9M4o03lKK8u8UW1y08OMttBSOADTcJrnPMpvDXRG3G8fyLh4ovs8w== + dependencies: + "@babel/helper-create-regexp-features-plugin" "^7.18.6" + "@babel/helper-plugin-utils" "^7.18.6" + +"@babel/plugin-syntax-async-generators@^7.8.4": + version "7.8.4" + resolved "https://registry.yarnpkg.com/@babel/plugin-syntax-async-generators/-/plugin-syntax-async-generators-7.8.4.tgz#a983fb1aeb2ec3f6ed042a210f640e90e786fe0d" + integrity sha512-tycmZxkGfZaxhMRbXlPXuVFpdWlXpir2W4AMhSJgRKzk/eDlIXOhb2LHWoLpDF7TEHylV5zNhykX6KAgHJmTNw== + dependencies: + "@babel/helper-plugin-utils" "^7.8.0" + +"@babel/plugin-syntax-class-properties@^7.12.13": + version "7.12.13" + resolved "https://registry.yarnpkg.com/@babel/plugin-syntax-class-properties/-/plugin-syntax-class-properties-7.12.13.tgz#b5c987274c4a3a82b89714796931a6b53544ae10" + integrity sha512-fm4idjKla0YahUNgFNLCB0qySdsoPiZP3iQE3rky0mBUtMZ23yDJ9SJdg6dXTSDnulOVqiF3Hgr9nbXvXTQZYA== + dependencies: + "@babel/helper-plugin-utils" "^7.12.13" + +"@babel/plugin-syntax-class-static-block@^7.14.5": + version "7.14.5" + resolved "https://registry.yarnpkg.com/@babel/plugin-syntax-class-static-block/-/plugin-syntax-class-static-block-7.14.5.tgz#195df89b146b4b78b3bf897fd7a257c84659d406" + integrity sha512-b+YyPmr6ldyNnM6sqYeMWE+bgJcJpO6yS4QD7ymxgH34GBPNDM/THBh8iunyvKIZztiwLH4CJZ0RxTk9emgpjw== + dependencies: + "@babel/helper-plugin-utils" "^7.14.5" + +"@babel/plugin-syntax-dynamic-import@^7.8.3": + version "7.8.3" + resolved "https://registry.yarnpkg.com/@babel/plugin-syntax-dynamic-import/-/plugin-syntax-dynamic-import-7.8.3.tgz#62bf98b2da3cd21d626154fc96ee5b3cb68eacb3" + integrity sha512-5gdGbFon+PszYzqs83S3E5mpi7/y/8M9eC90MRTZfduQOYW76ig6SOSPNe41IG5LoP3FGBn2N0RjVDSQiS94kQ== + dependencies: + "@babel/helper-plugin-utils" "^7.8.0" + +"@babel/plugin-syntax-export-default-from@^7.18.6": + version "7.18.6" + resolved "https://registry.yarnpkg.com/@babel/plugin-syntax-export-default-from/-/plugin-syntax-export-default-from-7.18.6.tgz#8df076711a4818c4ce4f23e61d622b0ba2ff84bc" + integrity sha512-Kr//z3ujSVNx6E9z9ih5xXXMqK07VVTuqPmqGe6Mss/zW5XPeLZeSDZoP9ab/hT4wPKqAgjl2PnhPrcpk8Seew== + dependencies: + "@babel/helper-plugin-utils" "^7.18.6" + +"@babel/plugin-syntax-export-namespace-from@^7.8.3": + version "7.8.3" + resolved "https://registry.yarnpkg.com/@babel/plugin-syntax-export-namespace-from/-/plugin-syntax-export-namespace-from-7.8.3.tgz#028964a9ba80dbc094c915c487ad7c4e7a66465a" + integrity sha512-MXf5laXo6c1IbEbegDmzGPwGNTsHZmEy6QGznu5Sh2UCWvueywb2ee+CCE4zQiZstxU9BMoQO9i6zUFSY0Kj0Q== + dependencies: + "@babel/helper-plugin-utils" "^7.8.3" + +"@babel/plugin-syntax-import-assertions@^7.18.6": + version "7.20.0" + resolved "https://registry.yarnpkg.com/@babel/plugin-syntax-import-assertions/-/plugin-syntax-import-assertions-7.20.0.tgz#bb50e0d4bea0957235390641209394e87bdb9cc4" + integrity sha512-IUh1vakzNoWalR8ch/areW7qFopR2AEw03JlG7BbrDqmQ4X3q9uuipQwSGrUn7oGiemKjtSLDhNtQHzMHr1JdQ== + dependencies: + "@babel/helper-plugin-utils" "^7.19.0" + +"@babel/plugin-syntax-json-strings@^7.8.3": + version "7.8.3" + resolved "https://registry.yarnpkg.com/@babel/plugin-syntax-json-strings/-/plugin-syntax-json-strings-7.8.3.tgz#01ca21b668cd8218c9e640cb6dd88c5412b2c96a" + integrity sha512-lY6kdGpWHvjoe2vk4WrAapEuBR69EMxZl+RoGRhrFGNYVK8mOPAW8VfbT/ZgrFbXlDNiiaxQnAtgVCZ6jv30EA== + dependencies: + "@babel/helper-plugin-utils" "^7.8.0" + +"@babel/plugin-syntax-logical-assignment-operators@^7.10.4": + version "7.10.4" + resolved "https://registry.yarnpkg.com/@babel/plugin-syntax-logical-assignment-operators/-/plugin-syntax-logical-assignment-operators-7.10.4.tgz#ca91ef46303530448b906652bac2e9fe9941f699" + integrity sha512-d8waShlpFDinQ5MtvGU9xDAOzKH47+FFoney2baFIoMr952hKOLp1HR7VszoZvOsV/4+RRszNY7D17ba0te0ig== + dependencies: + "@babel/helper-plugin-utils" "^7.10.4" + +"@babel/plugin-syntax-nullish-coalescing-operator@^7.8.3": + version "7.8.3" + resolved "https://registry.yarnpkg.com/@babel/plugin-syntax-nullish-coalescing-operator/-/plugin-syntax-nullish-coalescing-operator-7.8.3.tgz#167ed70368886081f74b5c36c65a88c03b66d1a9" + integrity sha512-aSff4zPII1u2QD7y+F8oDsz19ew4IGEJg9SVW+bqwpwtfFleiQDMdzA/R+UlWDzfnHFCxxleFT0PMIrR36XLNQ== + dependencies: + "@babel/helper-plugin-utils" "^7.8.0" + +"@babel/plugin-syntax-numeric-separator@^7.10.4": + version "7.10.4" + resolved "https://registry.yarnpkg.com/@babel/plugin-syntax-numeric-separator/-/plugin-syntax-numeric-separator-7.10.4.tgz#b9b070b3e33570cd9fd07ba7fa91c0dd37b9af97" + integrity sha512-9H6YdfkcK/uOnY/K7/aA2xpzaAgkQn37yzWUMRK7OaPOqOpGS1+n0H5hxT9AUw9EsSjPW8SVyMJwYRtWs3X3ug== + dependencies: + "@babel/helper-plugin-utils" "^7.10.4" + +"@babel/plugin-syntax-object-rest-spread@^7.8.3": + version "7.8.3" + resolved "https://registry.yarnpkg.com/@babel/plugin-syntax-object-rest-spread/-/plugin-syntax-object-rest-spread-7.8.3.tgz#60e225edcbd98a640332a2e72dd3e66f1af55871" + integrity sha512-XoqMijGZb9y3y2XskN+P1wUGiVwWZ5JmoDRwx5+3GmEplNyVM2s2Dg8ILFQm8rWM48orGy5YpI5Bl8U1y7ydlA== + dependencies: + "@babel/helper-plugin-utils" "^7.8.0" + +"@babel/plugin-syntax-optional-catch-binding@^7.8.3": + version "7.8.3" + resolved "https://registry.yarnpkg.com/@babel/plugin-syntax-optional-catch-binding/-/plugin-syntax-optional-catch-binding-7.8.3.tgz#6111a265bcfb020eb9efd0fdfd7d26402b9ed6c1" + integrity sha512-6VPD0Pc1lpTqw0aKoeRTMiB+kWhAoT24PA+ksWSBrFtl5SIRVpZlwN3NNPQjehA2E/91FV3RjLWoVTglWcSV3Q== + dependencies: + "@babel/helper-plugin-utils" "^7.8.0" + +"@babel/plugin-syntax-optional-chaining@^7.8.3": + version "7.8.3" + resolved "https://registry.yarnpkg.com/@babel/plugin-syntax-optional-chaining/-/plugin-syntax-optional-chaining-7.8.3.tgz#4f69c2ab95167e0180cd5336613f8c5788f7d48a" + integrity sha512-KoK9ErH1MBlCPxV0VANkXW2/dw4vlbGDrFgz8bmUsBGYkFRcbRwMh6cIJubdPrkxRwuGdtCk0v/wPTKbQgBjkg== + dependencies: + "@babel/helper-plugin-utils" "^7.8.0" + +"@babel/plugin-syntax-private-property-in-object@^7.14.5": + version "7.14.5" + resolved "https://registry.yarnpkg.com/@babel/plugin-syntax-private-property-in-object/-/plugin-syntax-private-property-in-object-7.14.5.tgz#0dc6671ec0ea22b6e94a1114f857970cd39de1ad" + integrity sha512-0wVnp9dxJ72ZUJDV27ZfbSj6iHLoytYZmh3rFcxNnvsJF3ktkzLDZPy/mA17HGsaQT3/DQsWYX1f1QGWkCoVUg== + dependencies: + "@babel/helper-plugin-utils" "^7.14.5" + +"@babel/plugin-syntax-top-level-await@^7.14.5": + version "7.14.5" + resolved "https://registry.yarnpkg.com/@babel/plugin-syntax-top-level-await/-/plugin-syntax-top-level-await-7.14.5.tgz#c1cfdadc35a646240001f06138247b741c34d94c" + integrity sha512-hx++upLv5U1rgYfwe1xBQUhRmU41NEvpUvrp8jkrSCdvGSnM5/qdRMtylJ6PG5OFkBaHkbTAKTnd3/YyESRHFw== + dependencies: + "@babel/helper-plugin-utils" "^7.14.5" + +"@babel/plugin-syntax-typescript@^7.20.0": + version "7.20.0" + resolved "https://registry.yarnpkg.com/@babel/plugin-syntax-typescript/-/plugin-syntax-typescript-7.20.0.tgz#4e9a0cfc769c85689b77a2e642d24e9f697fc8c7" + integrity sha512-rd9TkG+u1CExzS4SM1BlMEhMXwFLKVjOAFFCDx9PbX5ycJWDoWMcwdJH9RhkPu1dOgn5TrxLot/Gx6lWFuAUNQ== + dependencies: + "@babel/helper-plugin-utils" "^7.19.0" + +"@babel/plugin-transform-arrow-functions@^7.18.6": + version "7.20.7" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-arrow-functions/-/plugin-transform-arrow-functions-7.20.7.tgz#bea332b0e8b2dab3dafe55a163d8227531ab0551" + integrity sha512-3poA5E7dzDomxj9WXWwuD6A5F3kc7VXwIJO+E+J8qtDtS+pXPAhrgEyh+9GBwBgPq1Z+bB+/JD60lp5jsN7JPQ== + dependencies: + "@babel/helper-plugin-utils" "^7.20.2" + +"@babel/plugin-transform-async-to-generator@^7.18.6": + version "7.20.7" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-async-to-generator/-/plugin-transform-async-to-generator-7.20.7.tgz#dfee18623c8cb31deb796aa3ca84dda9cea94354" + integrity sha512-Uo5gwHPT9vgnSXQxqGtpdufUiWp96gk7yiP4Mp5bm1QMkEmLXBO7PAGYbKoJ6DhAwiNkcHFBol/x5zZZkL/t0Q== + dependencies: + "@babel/helper-module-imports" "^7.18.6" + "@babel/helper-plugin-utils" "^7.20.2" + "@babel/helper-remap-async-to-generator" "^7.18.9" + +"@babel/plugin-transform-block-scoped-functions@^7.18.6": + version "7.18.6" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-block-scoped-functions/-/plugin-transform-block-scoped-functions-7.18.6.tgz#9187bf4ba302635b9d70d986ad70f038726216a8" + integrity sha512-ExUcOqpPWnliRcPqves5HJcJOvHvIIWfuS4sroBUenPuMdmW+SMHDakmtS7qOo13sVppmUijqeTv7qqGsvURpQ== + dependencies: + "@babel/helper-plugin-utils" "^7.18.6" + +"@babel/plugin-transform-block-scoping@^7.18.9": + version "7.20.11" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-block-scoping/-/plugin-transform-block-scoping-7.20.11.tgz#9f5a3424bd112a3f32fe0cf9364fbb155cff262a" + integrity sha512-tA4N427a7fjf1P0/2I4ScsHGc5jcHPbb30xMbaTke2gxDuWpUfXDuX1FEymJwKk4tuGUvGcejAR6HdZVqmmPyw== + dependencies: + "@babel/helper-plugin-utils" "^7.20.2" + +"@babel/plugin-transform-classes@^7.18.9": + version "7.20.7" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-classes/-/plugin-transform-classes-7.20.7.tgz#f438216f094f6bb31dc266ebfab8ff05aecad073" + integrity sha512-LWYbsiXTPKl+oBlXUGlwNlJZetXD5Am+CyBdqhPsDVjM9Jc8jwBJFrKhHf900Kfk2eZG1y9MAG3UNajol7A4VQ== + dependencies: + "@babel/helper-annotate-as-pure" "^7.18.6" + "@babel/helper-compilation-targets" "^7.20.7" + "@babel/helper-environment-visitor" "^7.18.9" + "@babel/helper-function-name" "^7.19.0" + "@babel/helper-optimise-call-expression" "^7.18.6" + "@babel/helper-plugin-utils" "^7.20.2" + "@babel/helper-replace-supers" "^7.20.7" + "@babel/helper-split-export-declaration" "^7.18.6" + globals "^11.1.0" + +"@babel/plugin-transform-computed-properties@^7.18.9": + version "7.20.7" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-computed-properties/-/plugin-transform-computed-properties-7.20.7.tgz#704cc2fd155d1c996551db8276d55b9d46e4d0aa" + integrity sha512-Lz7MvBK6DTjElHAmfu6bfANzKcxpyNPeYBGEafyA6E5HtRpjpZwU+u7Qrgz/2OR0z+5TvKYbPdphfSaAcZBrYQ== + dependencies: + "@babel/helper-plugin-utils" "^7.20.2" + "@babel/template" "^7.20.7" + +"@babel/plugin-transform-destructuring@^7.18.9": + version "7.20.7" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-destructuring/-/plugin-transform-destructuring-7.20.7.tgz#8bda578f71620c7de7c93af590154ba331415454" + integrity sha512-Xwg403sRrZb81IVB79ZPqNQME23yhugYVqgTxAhT99h485F4f+GMELFhhOsscDUB7HCswepKeCKLn/GZvUKoBA== + dependencies: + "@babel/helper-plugin-utils" "^7.20.2" + +"@babel/plugin-transform-dotall-regex@^7.18.6", "@babel/plugin-transform-dotall-regex@^7.4.4": + version "7.18.6" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-dotall-regex/-/plugin-transform-dotall-regex-7.18.6.tgz#b286b3e7aae6c7b861e45bed0a2fafd6b1a4fef8" + integrity sha512-6S3jpun1eEbAxq7TdjLotAsl4WpQI9DxfkycRcKrjhQYzU87qpXdknpBg/e+TdcMehqGnLFi7tnFUBR02Vq6wg== + dependencies: + "@babel/helper-create-regexp-features-plugin" "^7.18.6" + "@babel/helper-plugin-utils" "^7.18.6" + +"@babel/plugin-transform-duplicate-keys@^7.18.9": + version "7.18.9" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-duplicate-keys/-/plugin-transform-duplicate-keys-7.18.9.tgz#687f15ee3cdad6d85191eb2a372c4528eaa0ae0e" + integrity sha512-d2bmXCtZXYc59/0SanQKbiWINadaJXqtvIQIzd4+hNwkWBgyCd5F/2t1kXoUdvPMrxzPvhK6EMQRROxsue+mfw== + dependencies: + "@babel/helper-plugin-utils" "^7.18.9" + +"@babel/plugin-transform-exponentiation-operator@^7.18.6": + version "7.18.6" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-exponentiation-operator/-/plugin-transform-exponentiation-operator-7.18.6.tgz#421c705f4521888c65e91fdd1af951bfefd4dacd" + integrity sha512-wzEtc0+2c88FVR34aQmiz56dxEkxr2g8DQb/KfaFa1JYXOFVsbhvAonFN6PwVWj++fKmku8NP80plJ5Et4wqHw== + dependencies: + "@babel/helper-builder-binary-assignment-operator-visitor" "^7.18.6" + "@babel/helper-plugin-utils" "^7.18.6" + +"@babel/plugin-transform-for-of@^7.18.8": + version "7.18.8" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-for-of/-/plugin-transform-for-of-7.18.8.tgz#6ef8a50b244eb6a0bdbad0c7c61877e4e30097c1" + integrity sha512-yEfTRnjuskWYo0k1mHUqrVWaZwrdq8AYbfrpqULOJOaucGSp4mNMVps+YtA8byoevxS/urwU75vyhQIxcCgiBQ== + dependencies: + "@babel/helper-plugin-utils" "^7.18.6" + +"@babel/plugin-transform-function-name@^7.18.9": + version "7.18.9" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-function-name/-/plugin-transform-function-name-7.18.9.tgz#cc354f8234e62968946c61a46d6365440fc764e0" + integrity sha512-WvIBoRPaJQ5yVHzcnJFor7oS5Ls0PYixlTYE63lCj2RtdQEl15M68FXQlxnG6wdraJIXRdR7KI+hQ7q/9QjrCQ== + dependencies: + "@babel/helper-compilation-targets" "^7.18.9" + "@babel/helper-function-name" "^7.18.9" + "@babel/helper-plugin-utils" "^7.18.9" + +"@babel/plugin-transform-literals@^7.18.9": + version "7.18.9" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-literals/-/plugin-transform-literals-7.18.9.tgz#72796fdbef80e56fba3c6a699d54f0de557444bc" + integrity sha512-IFQDSRoTPnrAIrI5zoZv73IFeZu2dhu6irxQjY9rNjTT53VmKg9fenjvoiOWOkJ6mm4jKVPtdMzBY98Fp4Z4cg== + dependencies: + "@babel/helper-plugin-utils" "^7.18.9" + +"@babel/plugin-transform-member-expression-literals@^7.18.6": + version "7.18.6" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-member-expression-literals/-/plugin-transform-member-expression-literals-7.18.6.tgz#ac9fdc1a118620ac49b7e7a5d2dc177a1bfee88e" + integrity sha512-qSF1ihLGO3q+/g48k85tUjD033C29TNTVB2paCwZPVmOsjn9pClvYYrM2VeJpBY2bcNkuny0YUyTNRyRxJ54KA== + dependencies: + "@babel/helper-plugin-utils" "^7.18.6" + +"@babel/plugin-transform-modules-amd@^7.18.6": + version "7.20.11" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-modules-amd/-/plugin-transform-modules-amd-7.20.11.tgz#3daccca8e4cc309f03c3a0c4b41dc4b26f55214a" + integrity sha512-NuzCt5IIYOW0O30UvqktzHYR2ud5bOWbY0yaxWZ6G+aFzOMJvrs5YHNikrbdaT15+KNO31nPOy5Fim3ku6Zb5g== + dependencies: + "@babel/helper-module-transforms" "^7.20.11" + "@babel/helper-plugin-utils" "^7.20.2" + +"@babel/plugin-transform-modules-commonjs@^7.18.6": + version "7.20.11" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-modules-commonjs/-/plugin-transform-modules-commonjs-7.20.11.tgz#8cb23010869bf7669fd4b3098598b6b2be6dc607" + integrity sha512-S8e1f7WQ7cimJQ51JkAaDrEtohVEitXjgCGAS2N8S31Y42E+kWwfSz83LYz57QdBm7q9diARVqanIaH2oVgQnw== + dependencies: + "@babel/helper-module-transforms" "^7.20.11" + "@babel/helper-plugin-utils" "^7.20.2" + "@babel/helper-simple-access" "^7.20.2" + +"@babel/plugin-transform-modules-systemjs@^7.18.9": + version "7.20.11" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-modules-systemjs/-/plugin-transform-modules-systemjs-7.20.11.tgz#467ec6bba6b6a50634eea61c9c232654d8a4696e" + integrity sha512-vVu5g9BPQKSFEmvt2TA4Da5N+QVS66EX21d8uoOihC+OCpUoGvzVsXeqFdtAEfVa5BILAeFt+U7yVmLbQnAJmw== + dependencies: + "@babel/helper-hoist-variables" "^7.18.6" + "@babel/helper-module-transforms" "^7.20.11" + "@babel/helper-plugin-utils" "^7.20.2" + "@babel/helper-validator-identifier" "^7.19.1" + +"@babel/plugin-transform-modules-umd@^7.18.6": + version "7.18.6" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-modules-umd/-/plugin-transform-modules-umd-7.18.6.tgz#81d3832d6034b75b54e62821ba58f28ed0aab4b9" + integrity sha512-dcegErExVeXcRqNtkRU/z8WlBLnvD4MRnHgNs3MytRO1Mn1sHRyhbcpYbVMGclAqOjdW+9cfkdZno9dFdfKLfQ== + dependencies: + "@babel/helper-module-transforms" "^7.18.6" + "@babel/helper-plugin-utils" "^7.18.6" + +"@babel/plugin-transform-named-capturing-groups-regex@^7.18.6": + version "7.20.5" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-named-capturing-groups-regex/-/plugin-transform-named-capturing-groups-regex-7.20.5.tgz#626298dd62ea51d452c3be58b285d23195ba69a8" + integrity sha512-mOW4tTzi5iTLnw+78iEq3gr8Aoq4WNRGpmSlrogqaiCBoR1HFhpU4JkpQFOHfeYx3ReVIFWOQJS4aZBRvuZ6mA== + dependencies: + "@babel/helper-create-regexp-features-plugin" "^7.20.5" + "@babel/helper-plugin-utils" "^7.20.2" + +"@babel/plugin-transform-new-target@^7.18.6": + version "7.18.6" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-new-target/-/plugin-transform-new-target-7.18.6.tgz#d128f376ae200477f37c4ddfcc722a8a1b3246a8" + integrity sha512-DjwFA/9Iu3Z+vrAn+8pBUGcjhxKguSMlsFqeCKbhb9BAV756v0krzVK04CRDi/4aqmk8BsHb4a/gFcaA5joXRw== + dependencies: + "@babel/helper-plugin-utils" "^7.18.6" + +"@babel/plugin-transform-object-super@^7.18.6": + version "7.18.6" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-object-super/-/plugin-transform-object-super-7.18.6.tgz#fb3c6ccdd15939b6ff7939944b51971ddc35912c" + integrity sha512-uvGz6zk+pZoS1aTZrOvrbj6Pp/kK2mp45t2B+bTDre2UgsZZ8EZLSJtUg7m/no0zOJUWgFONpB7Zv9W2tSaFlA== + dependencies: + "@babel/helper-plugin-utils" "^7.18.6" + "@babel/helper-replace-supers" "^7.18.6" + +"@babel/plugin-transform-parameters@^7.18.8", "@babel/plugin-transform-parameters@^7.20.7": + version "7.20.7" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-parameters/-/plugin-transform-parameters-7.20.7.tgz#0ee349e9d1bc96e78e3b37a7af423a4078a7083f" + integrity sha512-WiWBIkeHKVOSYPO0pWkxGPfKeWrCJyD3NJ53+Lrp/QMSZbsVPovrVl2aWZ19D/LTVnaDv5Ap7GJ/B2CTOZdrfA== + dependencies: + "@babel/helper-plugin-utils" "^7.20.2" + +"@babel/plugin-transform-property-literals@^7.18.6": + version "7.18.6" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-property-literals/-/plugin-transform-property-literals-7.18.6.tgz#e22498903a483448e94e032e9bbb9c5ccbfc93a3" + integrity sha512-cYcs6qlgafTud3PAzrrRNbQtfpQ8+y/+M5tKmksS9+M1ckbH6kzY8MrexEM9mcA6JDsukE19iIRvAyYl463sMg== + dependencies: + "@babel/helper-plugin-utils" "^7.18.6" + +"@babel/plugin-transform-regenerator@^7.18.6": + version "7.20.5" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-regenerator/-/plugin-transform-regenerator-7.20.5.tgz#57cda588c7ffb7f4f8483cc83bdcea02a907f04d" + integrity sha512-kW/oO7HPBtntbsahzQ0qSE3tFvkFwnbozz3NWFhLGqH75vLEg+sCGngLlhVkePlCs3Jv0dBBHDzCHxNiFAQKCQ== + dependencies: + "@babel/helper-plugin-utils" "^7.20.2" + regenerator-transform "^0.15.1" + +"@babel/plugin-transform-reserved-words@^7.18.6": + version "7.18.6" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-reserved-words/-/plugin-transform-reserved-words-7.18.6.tgz#b1abd8ebf8edaa5f7fe6bbb8d2133d23b6a6f76a" + integrity sha512-oX/4MyMoypzHjFrT1CdivfKZ+XvIPMFXwwxHp/r0Ddy2Vuomt4HDFGmft1TAY2yiTKiNSsh3kjBAzcM8kSdsjA== + dependencies: + "@babel/helper-plugin-utils" "^7.18.6" + +"@babel/plugin-transform-runtime@7.18.10": + version "7.18.10" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-runtime/-/plugin-transform-runtime-7.18.10.tgz#37d14d1fa810a368fd635d4d1476c0154144a96f" + integrity sha512-q5mMeYAdfEbpBAgzl7tBre/la3LeCxmDO1+wMXRdPWbcoMjR3GiXlCLk7JBZVVye0bqTGNMbt0yYVXX1B1jEWQ== + dependencies: + "@babel/helper-module-imports" "^7.18.6" + "@babel/helper-plugin-utils" "^7.18.9" + babel-plugin-polyfill-corejs2 "^0.3.2" + babel-plugin-polyfill-corejs3 "^0.5.3" + babel-plugin-polyfill-regenerator "^0.4.0" + semver "^6.3.0" + +"@babel/plugin-transform-shorthand-properties@^7.18.6": + version "7.18.6" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-shorthand-properties/-/plugin-transform-shorthand-properties-7.18.6.tgz#6d6df7983d67b195289be24909e3f12a8f664dc9" + integrity sha512-eCLXXJqv8okzg86ywZJbRn19YJHU4XUa55oz2wbHhaQVn/MM+XhukiT7SYqp/7o00dg52Rj51Ny+Ecw4oyoygw== + dependencies: + "@babel/helper-plugin-utils" "^7.18.6" + +"@babel/plugin-transform-spread@^7.18.9": + version "7.20.7" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-spread/-/plugin-transform-spread-7.20.7.tgz#c2d83e0b99d3bf83e07b11995ee24bf7ca09401e" + integrity sha512-ewBbHQ+1U/VnH1fxltbJqDeWBU1oNLG8Dj11uIv3xVf7nrQu0bPGe5Rf716r7K5Qz+SqtAOVswoVunoiBtGhxw== + dependencies: + "@babel/helper-plugin-utils" "^7.20.2" + "@babel/helper-skip-transparent-expression-wrappers" "^7.20.0" + +"@babel/plugin-transform-sticky-regex@^7.18.6": + version "7.18.6" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-sticky-regex/-/plugin-transform-sticky-regex-7.18.6.tgz#c6706eb2b1524028e317720339583ad0f444adcc" + integrity sha512-kfiDrDQ+PBsQDO85yj1icueWMfGfJFKN1KCkndygtu/C9+XUfydLC8Iv5UYJqRwy4zk8EcplRxEOeLyjq1gm6Q== + dependencies: + "@babel/helper-plugin-utils" "^7.18.6" + +"@babel/plugin-transform-template-literals@^7.18.9": + version "7.18.9" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-template-literals/-/plugin-transform-template-literals-7.18.9.tgz#04ec6f10acdaa81846689d63fae117dd9c243a5e" + integrity sha512-S8cOWfT82gTezpYOiVaGHrCbhlHgKhQt8XH5ES46P2XWmX92yisoZywf5km75wv5sYcXDUCLMmMxOLCtthDgMA== + dependencies: + "@babel/helper-plugin-utils" "^7.18.9" + +"@babel/plugin-transform-typeof-symbol@^7.18.9": + version "7.18.9" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-typeof-symbol/-/plugin-transform-typeof-symbol-7.18.9.tgz#c8cea68263e45addcd6afc9091429f80925762c0" + integrity sha512-SRfwTtF11G2aemAZWivL7PD+C9z52v9EvMqH9BuYbabyPuKUvSWks3oCg6041pT925L4zVFqaVBeECwsmlguEw== + dependencies: + "@babel/helper-plugin-utils" "^7.18.9" + +"@babel/plugin-transform-typescript@^7.18.6": + version "7.20.13" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-typescript/-/plugin-transform-typescript-7.20.13.tgz#e3581b356b8694f6ff450211fe6774eaff8d25ab" + integrity sha512-O7I/THxarGcDZxkgWKMUrk7NK1/WbHAg3Xx86gqS6x9MTrNL6AwIluuZ96ms4xeDe6AVx6rjHbWHP7x26EPQBA== + dependencies: + "@babel/helper-create-class-features-plugin" "^7.20.12" + "@babel/helper-plugin-utils" "^7.20.2" + "@babel/plugin-syntax-typescript" "^7.20.0" + +"@babel/plugin-transform-unicode-escapes@^7.18.10": + version "7.18.10" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-unicode-escapes/-/plugin-transform-unicode-escapes-7.18.10.tgz#1ecfb0eda83d09bbcb77c09970c2dd55832aa246" + integrity sha512-kKAdAI+YzPgGY/ftStBFXTI1LZFju38rYThnfMykS+IXy8BVx+res7s2fxf1l8I35DV2T97ezo6+SGrXz6B3iQ== + dependencies: + "@babel/helper-plugin-utils" "^7.18.9" + +"@babel/plugin-transform-unicode-regex@^7.18.6": + version "7.18.6" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-unicode-regex/-/plugin-transform-unicode-regex-7.18.6.tgz#194317225d8c201bbae103364ffe9e2cea36cdca" + integrity sha512-gE7A6Lt7YLnNOL3Pb9BNeZvi+d8l7tcRrG4+pwJjK9hD2xX4mEvjlQW60G9EEmfXVYRPv9VRQcyegIVHCql/AA== + dependencies: + "@babel/helper-create-regexp-features-plugin" "^7.18.6" + "@babel/helper-plugin-utils" "^7.18.6" + +"@babel/preset-env@7.18.10": + version "7.18.10" + resolved "https://registry.yarnpkg.com/@babel/preset-env/-/preset-env-7.18.10.tgz#83b8dfe70d7eea1aae5a10635ab0a5fe60dfc0f4" + integrity sha512-wVxs1yjFdW3Z/XkNfXKoblxoHgbtUF7/l3PvvP4m02Qz9TZ6uZGxRVYjSQeR87oQmHco9zWitW5J82DJ7sCjvA== + dependencies: + "@babel/compat-data" "^7.18.8" + "@babel/helper-compilation-targets" "^7.18.9" + "@babel/helper-plugin-utils" "^7.18.9" + "@babel/helper-validator-option" "^7.18.6" + "@babel/plugin-bugfix-safari-id-destructuring-collision-in-function-expression" "^7.18.6" + "@babel/plugin-bugfix-v8-spread-parameters-in-optional-chaining" "^7.18.9" + "@babel/plugin-proposal-async-generator-functions" "^7.18.10" + "@babel/plugin-proposal-class-properties" "^7.18.6" + "@babel/plugin-proposal-class-static-block" "^7.18.6" + "@babel/plugin-proposal-dynamic-import" "^7.18.6" + "@babel/plugin-proposal-export-namespace-from" "^7.18.9" + "@babel/plugin-proposal-json-strings" "^7.18.6" + "@babel/plugin-proposal-logical-assignment-operators" "^7.18.9" + "@babel/plugin-proposal-nullish-coalescing-operator" "^7.18.6" + "@babel/plugin-proposal-numeric-separator" "^7.18.6" + "@babel/plugin-proposal-object-rest-spread" "^7.18.9" + "@babel/plugin-proposal-optional-catch-binding" "^7.18.6" + "@babel/plugin-proposal-optional-chaining" "^7.18.9" + "@babel/plugin-proposal-private-methods" "^7.18.6" + "@babel/plugin-proposal-private-property-in-object" "^7.18.6" + "@babel/plugin-proposal-unicode-property-regex" "^7.18.6" + "@babel/plugin-syntax-async-generators" "^7.8.4" + "@babel/plugin-syntax-class-properties" "^7.12.13" + "@babel/plugin-syntax-class-static-block" "^7.14.5" + "@babel/plugin-syntax-dynamic-import" "^7.8.3" + "@babel/plugin-syntax-export-namespace-from" "^7.8.3" + "@babel/plugin-syntax-import-assertions" "^7.18.6" + "@babel/plugin-syntax-json-strings" "^7.8.3" + "@babel/plugin-syntax-logical-assignment-operators" "^7.10.4" + "@babel/plugin-syntax-nullish-coalescing-operator" "^7.8.3" + "@babel/plugin-syntax-numeric-separator" "^7.10.4" + "@babel/plugin-syntax-object-rest-spread" "^7.8.3" + "@babel/plugin-syntax-optional-catch-binding" "^7.8.3" + "@babel/plugin-syntax-optional-chaining" "^7.8.3" + "@babel/plugin-syntax-private-property-in-object" "^7.14.5" + "@babel/plugin-syntax-top-level-await" "^7.14.5" + "@babel/plugin-transform-arrow-functions" "^7.18.6" + "@babel/plugin-transform-async-to-generator" "^7.18.6" + "@babel/plugin-transform-block-scoped-functions" "^7.18.6" + "@babel/plugin-transform-block-scoping" "^7.18.9" + "@babel/plugin-transform-classes" "^7.18.9" + "@babel/plugin-transform-computed-properties" "^7.18.9" + "@babel/plugin-transform-destructuring" "^7.18.9" + "@babel/plugin-transform-dotall-regex" "^7.18.6" + "@babel/plugin-transform-duplicate-keys" "^7.18.9" + "@babel/plugin-transform-exponentiation-operator" "^7.18.6" + "@babel/plugin-transform-for-of" "^7.18.8" + "@babel/plugin-transform-function-name" "^7.18.9" + "@babel/plugin-transform-literals" "^7.18.9" + "@babel/plugin-transform-member-expression-literals" "^7.18.6" + "@babel/plugin-transform-modules-amd" "^7.18.6" + "@babel/plugin-transform-modules-commonjs" "^7.18.6" + "@babel/plugin-transform-modules-systemjs" "^7.18.9" + "@babel/plugin-transform-modules-umd" "^7.18.6" + "@babel/plugin-transform-named-capturing-groups-regex" "^7.18.6" + "@babel/plugin-transform-new-target" "^7.18.6" + "@babel/plugin-transform-object-super" "^7.18.6" + "@babel/plugin-transform-parameters" "^7.18.8" + "@babel/plugin-transform-property-literals" "^7.18.6" + "@babel/plugin-transform-regenerator" "^7.18.6" + "@babel/plugin-transform-reserved-words" "^7.18.6" + "@babel/plugin-transform-shorthand-properties" "^7.18.6" + "@babel/plugin-transform-spread" "^7.18.9" + "@babel/plugin-transform-sticky-regex" "^7.18.6" + "@babel/plugin-transform-template-literals" "^7.18.9" + "@babel/plugin-transform-typeof-symbol" "^7.18.9" + "@babel/plugin-transform-unicode-escapes" "^7.18.10" + "@babel/plugin-transform-unicode-regex" "^7.18.6" + "@babel/preset-modules" "^0.1.5" + "@babel/types" "^7.18.10" + babel-plugin-polyfill-corejs2 "^0.3.2" + babel-plugin-polyfill-corejs3 "^0.5.3" + babel-plugin-polyfill-regenerator "^0.4.0" + core-js-compat "^3.22.1" + semver "^6.3.0" + +"@babel/preset-modules@^0.1.5": + version "0.1.5" + resolved "https://registry.yarnpkg.com/@babel/preset-modules/-/preset-modules-0.1.5.tgz#ef939d6e7f268827e1841638dc6ff95515e115d9" + integrity sha512-A57th6YRG7oR3cq/yt/Y84MvGgE0eJG2F1JLhKuyG+jFxEgrd/HAMJatiFtmOiZurz+0DkrvbheCLaV5f2JfjA== + dependencies: + "@babel/helper-plugin-utils" "^7.0.0" + "@babel/plugin-proposal-unicode-property-regex" "^7.4.4" + "@babel/plugin-transform-dotall-regex" "^7.4.4" + "@babel/types" "^7.4.4" + esutils "^2.0.2" + +"@babel/preset-typescript@^7.18.6": + version "7.18.6" + resolved "https://registry.yarnpkg.com/@babel/preset-typescript/-/preset-typescript-7.18.6.tgz#ce64be3e63eddc44240c6358daefac17b3186399" + integrity sha512-s9ik86kXBAnD760aybBucdpnLsAt0jK1xqJn2juOn9lkOvSHV60os5hxoVJsPzMQxvnUJFAlkont2DvvaYEBtQ== + dependencies: + "@babel/helper-plugin-utils" "^7.18.6" + "@babel/helper-validator-option" "^7.18.6" + "@babel/plugin-transform-typescript" "^7.18.6" + +"@babel/runtime@^7.11.2", "@babel/runtime@^7.18.9", "@babel/runtime@^7.8.4": + version "7.20.13" + resolved "https://registry.yarnpkg.com/@babel/runtime/-/runtime-7.20.13.tgz#7055ab8a7cff2b8f6058bf6ae45ff84ad2aded4b" + integrity sha512-gt3PKXs0DBoL9xCvOIIZ2NEqAGZqHjAnmVbfQtB620V0uReIQutpel14KcneZuer7UioY8ALKZ7iocavvzTNFA== + dependencies: + regenerator-runtime "^0.13.11" + +"@babel/template@^7.18.10", "@babel/template@^7.20.7": + version "7.20.7" + resolved "https://registry.yarnpkg.com/@babel/template/-/template-7.20.7.tgz#a15090c2839a83b02aa996c0b4994005841fd5a8" + integrity sha512-8SegXApWe6VoNw0r9JHpSteLKTpTiLZ4rMlGIm9JQ18KiCtyQiAMEazujAHrUS5flrcqYZa75ukev3P6QmUwUw== + dependencies: + "@babel/code-frame" "^7.18.6" + "@babel/parser" "^7.20.7" + "@babel/types" "^7.20.7" + +"@babel/traverse@7.18.11": + version "7.18.11" + resolved "https://registry.yarnpkg.com/@babel/traverse/-/traverse-7.18.11.tgz#3d51f2afbd83ecf9912bcbb5c4d94e3d2ddaa16f" + integrity sha512-TG9PiM2R/cWCAy6BPJKeHzNbu4lPzOSZpeMfeNErskGpTJx6trEvFaVCbDvpcxwy49BKWmEPwiW8mrysNiDvIQ== + dependencies: + "@babel/code-frame" "^7.18.6" + "@babel/generator" "^7.18.10" + "@babel/helper-environment-visitor" "^7.18.9" + "@babel/helper-function-name" "^7.18.9" + "@babel/helper-hoist-variables" "^7.18.6" + "@babel/helper-split-export-declaration" "^7.18.6" + "@babel/parser" "^7.18.11" + "@babel/types" "^7.18.10" + debug "^4.1.0" + globals "^11.1.0" + +"@babel/traverse@^7.18.10", "@babel/traverse@^7.20.10", "@babel/traverse@^7.20.12", "@babel/traverse@^7.20.13", "@babel/traverse@^7.20.5", "@babel/traverse@^7.20.7": + version "7.20.13" + resolved "https://registry.yarnpkg.com/@babel/traverse/-/traverse-7.20.13.tgz#817c1ba13d11accca89478bd5481b2d168d07473" + integrity sha512-kMJXfF0T6DIS9E8cgdLCSAL+cuCK+YEZHWiLK0SXpTo8YRj5lpJu3CDNKiIBCne4m9hhTIqUg6SYTAI39tAiVQ== + dependencies: + "@babel/code-frame" "^7.18.6" + "@babel/generator" "^7.20.7" + "@babel/helper-environment-visitor" "^7.18.9" + "@babel/helper-function-name" "^7.19.0" + "@babel/helper-hoist-variables" "^7.18.6" + "@babel/helper-split-export-declaration" "^7.18.6" + "@babel/parser" "^7.20.13" + "@babel/types" "^7.20.7" + debug "^4.1.0" + globals "^11.1.0" + +"@babel/types@7.18.10": + version "7.18.10" + resolved "https://registry.yarnpkg.com/@babel/types/-/types-7.18.10.tgz#4908e81b6b339ca7c6b7a555a5fc29446f26dde6" + integrity sha512-MJvnbEiiNkpjo+LknnmRrqbY1GPUUggjv+wQVjetM/AONoupqRALB7I6jGqNUAZsKcRIEu2J6FRFvsczljjsaQ== + dependencies: + "@babel/helper-string-parser" "^7.18.10" + "@babel/helper-validator-identifier" "^7.18.6" + to-fast-properties "^2.0.0" + +"@babel/types@^7.18.10", "@babel/types@^7.18.6", "@babel/types@^7.18.9", "@babel/types@^7.19.0", "@babel/types@^7.20.0", "@babel/types@^7.20.2", "@babel/types@^7.20.5", "@babel/types@^7.20.7", "@babel/types@^7.4.4": + version "7.20.7" + resolved "https://registry.yarnpkg.com/@babel/types/-/types-7.20.7.tgz#54ec75e252318423fc07fb644dc6a58a64c09b7f" + integrity sha512-69OnhBxSSgK0OzTJai4kyPDiKTIe3j+ctaHdIGVbRahTLAT7L3R9oeXHC2aVSuGYt3cVnoAMDmOCgJ2yaiLMvg== + dependencies: + "@babel/helper-string-parser" "^7.19.4" + "@babel/helper-validator-identifier" "^7.19.1" + to-fast-properties "^2.0.0" + +"@confio/ics23@^0.6.8": + version "0.6.8" + resolved "https://registry.yarnpkg.com/@confio/ics23/-/ics23-0.6.8.tgz#2a6b4f1f2b7b20a35d9a0745bb5a446e72930b3d" + integrity sha512-wB6uo+3A50m0sW/EWcU64xpV/8wShZ6bMTa7pF8eYsTrSkQA7oLUIJcs/wb8g4y2Oyq701BaGiO6n/ak5WXO1w== + dependencies: + "@noble/hashes" "^1.0.0" + protobufjs "^6.8.8" + +"@cosmjs/amino@^0.29.5": + version "0.29.5" + resolved "https://registry.yarnpkg.com/@cosmjs/amino/-/amino-0.29.5.tgz#053b4739a90b15b9e2b781ccd484faf64bd49aec" + integrity sha512-Qo8jpC0BiziTSUqpkNatBcwtKNhCovUnFul9SlT/74JUCdLYaeG5hxr3q1cssQt++l4LvlcpF+OUXL48XjNjLw== + dependencies: + "@cosmjs/crypto" "^0.29.5" + "@cosmjs/encoding" "^0.29.5" + "@cosmjs/math" "^0.29.5" + "@cosmjs/utils" "^0.29.5" + +"@cosmjs/cosmwasm-stargate@^0.29.5": + version "0.29.5" + resolved "https://registry.yarnpkg.com/@cosmjs/cosmwasm-stargate/-/cosmwasm-stargate-0.29.5.tgz#3f257da682658833e0f4eb9e8ff758e4d927663a" + integrity sha512-TNdSvm2tEE3XMCuxHxquzls56t40hC8qnLeYJWHsY2ECZmRK3KrnpRReEr7N7bLtODToK7X/riYrV0JaYxjrYA== + dependencies: + "@cosmjs/amino" "^0.29.5" + "@cosmjs/crypto" "^0.29.5" + "@cosmjs/encoding" "^0.29.5" + "@cosmjs/math" "^0.29.5" + "@cosmjs/proto-signing" "^0.29.5" + "@cosmjs/stargate" "^0.29.5" + "@cosmjs/tendermint-rpc" "^0.29.5" + "@cosmjs/utils" "^0.29.5" + cosmjs-types "^0.5.2" + long "^4.0.0" + pako "^2.0.2" + +"@cosmjs/crypto@^0.29.5": + version "0.29.5" + resolved "https://registry.yarnpkg.com/@cosmjs/crypto/-/crypto-0.29.5.tgz#ab99fc382b93d8a8db075780cf07487a0f9519fd" + integrity sha512-2bKkaLGictaNL0UipQCL6C1afaisv6k8Wr/GCLx9FqiyFkh9ZgRHDyetD64ZsjnWV/N/D44s/esI+k6oPREaiQ== + dependencies: + "@cosmjs/encoding" "^0.29.5" + "@cosmjs/math" "^0.29.5" + "@cosmjs/utils" "^0.29.5" + "@noble/hashes" "^1" + bn.js "^5.2.0" + elliptic "^6.5.4" + libsodium-wrappers "^0.7.6" + +"@cosmjs/encoding@^0.29.5": + version "0.29.5" + resolved "https://registry.yarnpkg.com/@cosmjs/encoding/-/encoding-0.29.5.tgz#009a4b1c596cdfd326f30ccfa79f5e56daa264f2" + integrity sha512-G4rGl/Jg4dMCw5u6PEZHZcoHnUBlukZODHbm/wcL4Uu91fkn5jVo5cXXZcvs4VCkArVGrEj/52eUgTZCmOBGWQ== + dependencies: + base64-js "^1.3.0" + bech32 "^1.1.4" + readonly-date "^1.0.0" + +"@cosmjs/json-rpc@^0.29.5": + version "0.29.5" + resolved "https://registry.yarnpkg.com/@cosmjs/json-rpc/-/json-rpc-0.29.5.tgz#5e483a9bd98a6270f935adf0dfd8a1e7eb777fe4" + integrity sha512-C78+X06l+r9xwdM1yFWIpGl03LhB9NdM1xvZpQHwgCOl0Ir/WV8pw48y3Ez2awAoUBRfTeejPe4KvrE6NoIi/w== + dependencies: + "@cosmjs/stream" "^0.29.5" + xstream "^11.14.0" + +"@cosmjs/math@^0.29.5": + version "0.29.5" + resolved "https://registry.yarnpkg.com/@cosmjs/math/-/math-0.29.5.tgz#722c96e080d6c2b62215ce9f4c70da7625b241b6" + integrity sha512-2GjKcv+A9f86MAWYLUkjhw1/WpRl2R1BTb3m9qPG7lzMA7ioYff9jY5SPCfafKdxM4TIQGxXQlYGewQL16O68Q== + dependencies: + bn.js "^5.2.0" + +"@cosmjs/proto-signing@^0.29.5": + version "0.29.5" + resolved "https://registry.yarnpkg.com/@cosmjs/proto-signing/-/proto-signing-0.29.5.tgz#af3b62a46c2c2f1d2327d678b13b7262db1fe87c" + integrity sha512-QRrS7CiKaoETdgIqvi/7JC2qCwCR7lnWaUsTzh/XfRy3McLkEd+cXbKAW3cygykv7IN0VAEIhZd2lyIfT8KwNA== + dependencies: + "@cosmjs/amino" "^0.29.5" + "@cosmjs/crypto" "^0.29.5" + "@cosmjs/encoding" "^0.29.5" + "@cosmjs/math" "^0.29.5" + "@cosmjs/utils" "^0.29.5" + cosmjs-types "^0.5.2" + long "^4.0.0" + +"@cosmjs/socket@^0.29.5": + version "0.29.5" + resolved "https://registry.yarnpkg.com/@cosmjs/socket/-/socket-0.29.5.tgz#a48df6b4c45dc6a6ef8e47232725dd4aa556ac2d" + integrity sha512-5VYDupIWbIXq3ftPV1LkS5Ya/T7Ol/AzWVhNxZ79hPe/mBfv1bGau/LqIYOm2zxGlgm9hBHOTmWGqNYDwr9LNQ== + dependencies: + "@cosmjs/stream" "^0.29.5" + isomorphic-ws "^4.0.1" + ws "^7" + xstream "^11.14.0" + +"@cosmjs/stargate@^0.29.5": + version "0.29.5" + resolved "https://registry.yarnpkg.com/@cosmjs/stargate/-/stargate-0.29.5.tgz#d597af1c85a3c2af7b5bdbec34d5d40692cc09e4" + integrity sha512-hjEv8UUlJruLrYGJcUZXM/CziaINOKwfVm2BoSdUnNTMxGvY/jC1ABHKeZUYt9oXHxEJ1n9+pDqzbKc8pT0nBw== + dependencies: + "@confio/ics23" "^0.6.8" + "@cosmjs/amino" "^0.29.5" + "@cosmjs/encoding" "^0.29.5" + "@cosmjs/math" "^0.29.5" + "@cosmjs/proto-signing" "^0.29.5" + "@cosmjs/stream" "^0.29.5" + "@cosmjs/tendermint-rpc" "^0.29.5" + "@cosmjs/utils" "^0.29.5" + cosmjs-types "^0.5.2" + long "^4.0.0" + protobufjs "~6.11.3" + xstream "^11.14.0" + +"@cosmjs/stream@^0.29.5": + version "0.29.5" + resolved "https://registry.yarnpkg.com/@cosmjs/stream/-/stream-0.29.5.tgz#350981cac496d04939b92ee793b9b19f44bc1d4e" + integrity sha512-TToTDWyH1p05GBtF0Y8jFw2C+4783ueDCmDyxOMM6EU82IqpmIbfwcdMOCAm0JhnyMh+ocdebbFvnX/sGKzRAA== + dependencies: + xstream "^11.14.0" + +"@cosmjs/tendermint-rpc@^0.29.5": + version "0.29.5" + resolved "https://registry.yarnpkg.com/@cosmjs/tendermint-rpc/-/tendermint-rpc-0.29.5.tgz#f205c10464212bdf843f91bb2e4a093b618cb5c2" + integrity sha512-ar80twieuAxsy0x2za/aO3kBr2DFPAXDmk2ikDbmkda+qqfXgl35l9CVAAjKRqd9d+cRvbQyb5M4wy6XQpEV6w== + dependencies: + "@cosmjs/crypto" "^0.29.5" + "@cosmjs/encoding" "^0.29.5" + "@cosmjs/json-rpc" "^0.29.5" + "@cosmjs/math" "^0.29.5" + "@cosmjs/socket" "^0.29.5" + "@cosmjs/stream" "^0.29.5" + "@cosmjs/utils" "^0.29.5" + axios "^0.21.2" + readonly-date "^1.0.0" + xstream "^11.14.0" + +"@cosmjs/utils@^0.29.5": + version "0.29.5" + resolved "https://registry.yarnpkg.com/@cosmjs/utils/-/utils-0.29.5.tgz#3fed1b3528ae8c5f1eb5d29b68755bebfd3294ee" + integrity sha512-m7h+RXDUxOzEOGt4P+3OVPX7PuakZT3GBmaM/Y2u+abN3xZkziykD/NvedYFvvCCdQo714XcGl33bwifS9FZPQ== + +"@cosmwasm/ts-codegen@^0.24.0": + version "0.24.0" + resolved "https://registry.yarnpkg.com/@cosmwasm/ts-codegen/-/ts-codegen-0.24.0.tgz#61015220a9dccfd35dec46bcb67786441111f096" + integrity sha512-g5ufDroLzOzsMvnKyAz7i5M3Z3k8XYetRv9PnGW0Zbgj4sziw6jDimPJ3Ubnput+i380day7LnCwVT7zLIEzCQ== + dependencies: + "@babel/core" "7.18.10" + "@babel/generator" "7.18.12" + "@babel/parser" "7.18.11" + "@babel/plugin-proposal-class-properties" "7.18.6" + "@babel/plugin-proposal-export-default-from" "7.18.10" + "@babel/plugin-proposal-object-rest-spread" "7.18.9" + "@babel/plugin-transform-runtime" "7.18.10" + "@babel/preset-env" "7.18.10" + "@babel/preset-typescript" "^7.18.6" + "@babel/runtime" "^7.18.9" + "@babel/traverse" "7.18.11" + "@babel/types" "7.18.10" + "@pyramation/json-schema-to-typescript" " 11.0.4" + case "1.6.3" + dargs "7.0.0" + deepmerge "4.2.2" + dotty "0.1.2" + fuzzy "0.1.3" + glob "8.0.3" + inquirerer "0.1.3" + long "^5.2.0" + minimist "1.2.6" + mkdirp "1.0.4" + parse-package-name "1.0.0" + rimraf "3.0.2" + shelljs "0.8.5" + wasm-ast-types "^0.17.0" + +"@eslint/eslintrc@^1.4.1": + version "1.4.1" + resolved "https://registry.yarnpkg.com/@eslint/eslintrc/-/eslintrc-1.4.1.tgz#af58772019a2d271b7e2d4c23ff4ddcba3ccfb3e" + integrity sha512-XXrH9Uarn0stsyldqDYq8r++mROmWRI1xKMXa640Bb//SY1+ECYX6VzT6Lcx5frD0V30XieqJ0oX9I2Xj5aoMA== + dependencies: + ajv "^6.12.4" + debug "^4.3.2" + espree "^9.4.0" + globals "^13.19.0" + ignore "^5.2.0" + import-fresh "^3.2.1" + js-yaml "^4.1.0" + minimatch "^3.1.2" + strip-json-comments "^3.1.1" + +"@humanwhocodes/config-array@^0.11.8": + version "0.11.8" + resolved "https://registry.yarnpkg.com/@humanwhocodes/config-array/-/config-array-0.11.8.tgz#03595ac2075a4dc0f191cc2131de14fbd7d410b9" + integrity sha512-UybHIJzJnR5Qc/MsD9Kr+RpO2h+/P1GhOwdiLPXK5TWk5sgTdu88bTD9UP+CKbPPh5Rni1u0GjAdYQLemG8g+g== + dependencies: + "@humanwhocodes/object-schema" "^1.2.1" + debug "^4.1.1" + minimatch "^3.0.5" + +"@humanwhocodes/module-importer@^1.0.1": + version "1.0.1" + resolved "https://registry.yarnpkg.com/@humanwhocodes/module-importer/-/module-importer-1.0.1.tgz#af5b2691a22b44be847b0ca81641c5fb6ad0172c" + integrity sha512-bxveV4V8v5Yb4ncFTT3rPSgZBOpCkjfK0y4oVVVJwIuDVBRMDXrPyXRL988i5ap9m9bnyEEjWfm5WkBmtffLfA== + +"@humanwhocodes/object-schema@^1.2.1": + version "1.2.1" + resolved "https://registry.yarnpkg.com/@humanwhocodes/object-schema/-/object-schema-1.2.1.tgz#b520529ec21d8e5945a1851dfd1c32e94e39ff45" + integrity sha512-ZnQMnLV4e7hDlUvw8H+U8ASL02SS2Gn6+9Ac3wGGLIe7+je2AeAOxPY+izIPJDfFDb7eDjev0Us8MO1iFRN8hA== + +"@istanbuljs/load-nyc-config@^1.0.0": + version "1.1.0" + resolved "https://registry.yarnpkg.com/@istanbuljs/load-nyc-config/-/load-nyc-config-1.1.0.tgz#fd3db1d59ecf7cf121e80650bb86712f9b55eced" + integrity sha512-VjeHSlIzpv/NyD3N0YuHfXOPDIixcA1q2ZV98wsMqcYlPmv2n3Yb2lYP9XMElnaFVXg5A7YLTeLu6V84uQDjmQ== + dependencies: + camelcase "^5.3.1" + find-up "^4.1.0" + get-package-type "^0.1.0" + js-yaml "^3.13.1" + resolve-from "^5.0.0" + +"@istanbuljs/schema@^0.1.2": + version "0.1.3" + resolved "https://registry.yarnpkg.com/@istanbuljs/schema/-/schema-0.1.3.tgz#e45e384e4b8ec16bce2fd903af78450f6bf7ec98" + integrity sha512-ZXRY4jNvVgSVQ8DL3LTcakaAtXwTVUxE81hslsyD2AtoXW/wVob10HkOJ1X/pAlcI7D+2YoZKg5do8G/w6RYgA== + +"@jest/schemas@^28.1.3": + version "28.1.3" + resolved "https://registry.yarnpkg.com/@jest/schemas/-/schemas-28.1.3.tgz#ad8b86a66f11f33619e3d7e1dcddd7f2d40ff905" + integrity sha512-/l/VWsdt/aBXgjshLWOFyFt3IVdYypu5y2Wn2rOO1un6nkqIn8SLXzgIMYXFyYsRWDyF5EthmKJMIdJvk08grg== + dependencies: + "@sinclair/typebox" "^0.24.1" + +"@jest/transform@28.1.3": + version "28.1.3" + resolved "https://registry.yarnpkg.com/@jest/transform/-/transform-28.1.3.tgz#59d8098e50ab07950e0f2fc0fc7ec462371281b0" + integrity sha512-u5dT5di+oFI6hfcLOHGTAfmUxFRrjK+vnaP0kkVow9Md/M7V/MxqQMOz/VV25UZO8pzeA9PjfTpOu6BDuwSPQA== + dependencies: + "@babel/core" "^7.11.6" + "@jest/types" "^28.1.3" + "@jridgewell/trace-mapping" "^0.3.13" + babel-plugin-istanbul "^6.1.1" + chalk "^4.0.0" + convert-source-map "^1.4.0" + fast-json-stable-stringify "^2.0.0" + graceful-fs "^4.2.9" + jest-haste-map "^28.1.3" + jest-regex-util "^28.0.2" + jest-util "^28.1.3" + micromatch "^4.0.4" + pirates "^4.0.4" + slash "^3.0.0" + write-file-atomic "^4.0.1" + +"@jest/types@^28.1.3": + version "28.1.3" + resolved "https://registry.yarnpkg.com/@jest/types/-/types-28.1.3.tgz#b05de80996ff12512bc5ceb1d208285a7d11748b" + integrity sha512-RyjiyMUZrKz/c+zlMFO1pm70DcIlST8AeWTkoUdZevew44wcNZQHsEVOiCVtgVnlFFD82FPaXycys58cf2muVQ== + dependencies: + "@jest/schemas" "^28.1.3" + "@types/istanbul-lib-coverage" "^2.0.0" + "@types/istanbul-reports" "^3.0.0" + "@types/node" "*" + "@types/yargs" "^17.0.8" + chalk "^4.0.0" + +"@jridgewell/gen-mapping@^0.1.0": + version "0.1.1" + resolved "https://registry.yarnpkg.com/@jridgewell/gen-mapping/-/gen-mapping-0.1.1.tgz#e5d2e450306a9491e3bd77e323e38d7aff315996" + integrity sha512-sQXCasFk+U8lWYEe66WxRDOE9PjVz4vSM51fTu3Hw+ClTpUSQb718772vH3pyS5pShp6lvQM7SxgIDXXXmOX7w== + dependencies: + "@jridgewell/set-array" "^1.0.0" + "@jridgewell/sourcemap-codec" "^1.4.10" + +"@jridgewell/gen-mapping@^0.3.2": + version "0.3.2" + resolved "https://registry.yarnpkg.com/@jridgewell/gen-mapping/-/gen-mapping-0.3.2.tgz#c1aedc61e853f2bb9f5dfe6d4442d3b565b253b9" + integrity sha512-mh65xKQAzI6iBcFzwv28KVWSmCkdRBWoOh+bYQGW3+6OZvbbN3TqMGo5hqYxQniRcH9F2VZIoJCm4pa3BPDK/A== + dependencies: + "@jridgewell/set-array" "^1.0.1" + "@jridgewell/sourcemap-codec" "^1.4.10" + "@jridgewell/trace-mapping" "^0.3.9" + +"@jridgewell/resolve-uri@3.1.0": + version "3.1.0" + resolved "https://registry.yarnpkg.com/@jridgewell/resolve-uri/-/resolve-uri-3.1.0.tgz#2203b118c157721addfe69d47b70465463066d78" + integrity sha512-F2msla3tad+Mfht5cJq7LSXcdudKTWCVYUgw6pLFOOHSTtZlj6SWNYAp+AhuqLmWdBO2X5hPrLcu8cVP8fy28w== + +"@jridgewell/set-array@^1.0.0", "@jridgewell/set-array@^1.0.1": + version "1.1.2" + resolved "https://registry.yarnpkg.com/@jridgewell/set-array/-/set-array-1.1.2.tgz#7c6cf998d6d20b914c0a55a91ae928ff25965e72" + integrity sha512-xnkseuNADM0gt2bs+BvhO0p78Mk762YnZdsuzFV018NoG1Sj1SCQvpSqa7XUaTam5vAGasABV9qXASMKnFMwMw== + +"@jridgewell/sourcemap-codec@1.4.14", "@jridgewell/sourcemap-codec@^1.4.10": + version "1.4.14" + resolved "https://registry.yarnpkg.com/@jridgewell/sourcemap-codec/-/sourcemap-codec-1.4.14.tgz#add4c98d341472a289190b424efbdb096991bb24" + integrity sha512-XPSJHWmi394fuUuzDnGz1wiKqWfo1yXecHQMRf2l6hztTO+nPru658AyDngaBe7isIxEkRsPR3FZh+s7iVa4Uw== + +"@jridgewell/trace-mapping@^0.3.13", "@jridgewell/trace-mapping@^0.3.9": + version "0.3.17" + resolved "https://registry.yarnpkg.com/@jridgewell/trace-mapping/-/trace-mapping-0.3.17.tgz#793041277af9073b0951a7fe0f0d8c4c98c36985" + integrity sha512-MCNzAp77qzKca9+W/+I0+sEpaUnZoeasnghNeVc41VZCEKaCH73Vq3BZZ/SzWIgrqE4H4ceI+p+b6C0mHf9T4g== + dependencies: + "@jridgewell/resolve-uri" "3.1.0" + "@jridgewell/sourcemap-codec" "1.4.14" + +"@jsdevtools/ono@^7.1.3": + version "7.1.3" + resolved "https://registry.yarnpkg.com/@jsdevtools/ono/-/ono-7.1.3.tgz#9df03bbd7c696a5c58885c34aa06da41c8543796" + integrity sha512-4JQNk+3mVzK3xh2rqd6RB4J46qUR19azEHBneZyTZM+c456qOrbbM/5xcR8huNCCcbVt7+UmizG6GuUvPvKUYg== + +"@noble/hashes@^1", "@noble/hashes@^1.0.0": + version "1.1.5" + resolved "https://registry.yarnpkg.com/@noble/hashes/-/hashes-1.1.5.tgz#1a0377f3b9020efe2fae03290bd2a12140c95c11" + integrity sha512-LTMZiiLc+V4v1Yi16TD6aX2gmtKszNye0pQgbaLqkvhIqP7nVsSaJsWloGQjJfJ8offaoP5GtX3yY5swbcJxxQ== + +"@nodelib/fs.scandir@2.1.5": + version "2.1.5" + resolved "https://registry.yarnpkg.com/@nodelib/fs.scandir/-/fs.scandir-2.1.5.tgz#7619c2eb21b25483f6d167548b4cfd5a7488c3d5" + integrity sha512-vq24Bq3ym5HEQm2NKCr3yXDwjc7vTsEThRDnkp2DK9p1uqLR+DHurm/NOTo0KG7HYHU7eppKZj3MyqYuMBf62g== + dependencies: + "@nodelib/fs.stat" "2.0.5" + run-parallel "^1.1.9" + +"@nodelib/fs.stat@2.0.5", "@nodelib/fs.stat@^2.0.2": + version "2.0.5" + resolved "https://registry.yarnpkg.com/@nodelib/fs.stat/-/fs.stat-2.0.5.tgz#5bd262af94e9d25bd1e71b05deed44876a222e8b" + integrity sha512-RkhPPp2zrqDAQA/2jNhnztcPAlv64XdhIp7a7454A5ovI7Bukxgt7MX7udwAu3zg1DcpPU0rz3VV1SeaqvY4+A== + +"@nodelib/fs.walk@^1.2.3", "@nodelib/fs.walk@^1.2.8": + version "1.2.8" + resolved "https://registry.yarnpkg.com/@nodelib/fs.walk/-/fs.walk-1.2.8.tgz#e95737e8bb6746ddedf69c556953494f196fe69a" + integrity sha512-oGB+UxlgWcgQkgwo8GcEGwemoTFt3FIO9ababBmaGwXIoBKZ+GTy0pP185beGg7Llih/NSHSV2XAs1lnznocSg== + dependencies: + "@nodelib/fs.scandir" "2.1.5" + fastq "^1.6.0" + +"@protobufjs/aspromise@^1.1.1", "@protobufjs/aspromise@^1.1.2": + version "1.1.2" + resolved "https://registry.yarnpkg.com/@protobufjs/aspromise/-/aspromise-1.1.2.tgz#9b8b0cc663d669a7d8f6f5d0893a14d348f30fbf" + integrity sha512-j+gKExEuLmKwvz3OgROXtrJ2UG2x8Ch2YZUxahh+s1F2HZ+wAceUNLkvy6zKCPVRkU++ZWQrdxsUeQXmcg4uoQ== + +"@protobufjs/base64@^1.1.2": + version "1.1.2" + resolved "https://registry.yarnpkg.com/@protobufjs/base64/-/base64-1.1.2.tgz#4c85730e59b9a1f1f349047dbf24296034bb2735" + integrity sha512-AZkcAA5vnN/v4PDqKyMR5lx7hZttPDgClv83E//FMNhR2TMcLUhfRUBHCmSl0oi9zMgDDqRUJkSxO3wm85+XLg== + +"@protobufjs/codegen@^2.0.4": + version "2.0.4" + resolved "https://registry.yarnpkg.com/@protobufjs/codegen/-/codegen-2.0.4.tgz#7ef37f0d010fb028ad1ad59722e506d9262815cb" + integrity sha512-YyFaikqM5sH0ziFZCN3xDC7zeGaB/d0IUb9CATugHWbd1FRFwWwt4ld4OYMPWu5a3Xe01mGAULCdqhMlPl29Jg== + +"@protobufjs/eventemitter@^1.1.0": + version "1.1.0" + resolved "https://registry.yarnpkg.com/@protobufjs/eventemitter/-/eventemitter-1.1.0.tgz#355cbc98bafad5978f9ed095f397621f1d066b70" + integrity sha512-j9ednRT81vYJ9OfVuXG6ERSTdEL1xVsNgqpkxMsbIabzSo3goCjDIveeGv5d03om39ML71RdmrGNjG5SReBP/Q== + +"@protobufjs/fetch@^1.1.0": + version "1.1.0" + resolved "https://registry.yarnpkg.com/@protobufjs/fetch/-/fetch-1.1.0.tgz#ba99fb598614af65700c1619ff06d454b0d84c45" + integrity sha512-lljVXpqXebpsijW71PZaCYeIcE5on1w5DlQy5WH6GLbFryLUrBD4932W/E2BSpfRJWseIL4v/KPgBFxDOIdKpQ== + dependencies: + "@protobufjs/aspromise" "^1.1.1" + "@protobufjs/inquire" "^1.1.0" + +"@protobufjs/float@^1.0.2": + version "1.0.2" + resolved "https://registry.yarnpkg.com/@protobufjs/float/-/float-1.0.2.tgz#5e9e1abdcb73fc0a7cb8b291df78c8cbd97b87d1" + integrity sha512-Ddb+kVXlXst9d+R9PfTIxh1EdNkgoRe5tOX6t01f1lYWOvJnSPDBlG241QLzcyPdoNTsblLUdujGSE4RzrTZGQ== + +"@protobufjs/inquire@^1.1.0": + version "1.1.0" + resolved "https://registry.yarnpkg.com/@protobufjs/inquire/-/inquire-1.1.0.tgz#ff200e3e7cf2429e2dcafc1140828e8cc638f089" + integrity sha512-kdSefcPdruJiFMVSbn801t4vFK7KB/5gd2fYvrxhuJYg8ILrmn9SKSX2tZdV6V+ksulWqS7aXjBcRXl3wHoD9Q== + +"@protobufjs/path@^1.1.2": + version "1.1.2" + resolved "https://registry.yarnpkg.com/@protobufjs/path/-/path-1.1.2.tgz#6cc2b20c5c9ad6ad0dccfd21ca7673d8d7fbf68d" + integrity sha512-6JOcJ5Tm08dOHAbdR3GrvP+yUUfkjG5ePsHYczMFLq3ZmMkAD98cDgcT2iA1lJ9NVwFd4tH/iSSoe44YWkltEA== + +"@protobufjs/pool@^1.1.0": + version "1.1.0" + resolved "https://registry.yarnpkg.com/@protobufjs/pool/-/pool-1.1.0.tgz#09fd15f2d6d3abfa9b65bc366506d6ad7846ff54" + integrity sha512-0kELaGSIDBKvcgS4zkjz1PeddatrjYcmMWOlAuAPwAeccUrPHdUqo/J6LiymHHEiJT5NrF1UVwxY14f+fy4WQw== + +"@protobufjs/utf8@^1.1.0": + version "1.1.0" + resolved "https://registry.yarnpkg.com/@protobufjs/utf8/-/utf8-1.1.0.tgz#a777360b5b39a1a2e5106f8e858f2fd2d060c570" + integrity sha512-Vvn3zZrhQZkkBE8LSuW3em98c0FwgO4nxzv6OdSxPKJIEKY2bGbHn+mhGIPerzI4twdxaP8/0+06HBpwf345Lw== + +"@pyramation/json-schema-ref-parser@9.0.6": + version "9.0.6" + resolved "https://registry.yarnpkg.com/@pyramation/json-schema-ref-parser/-/json-schema-ref-parser-9.0.6.tgz#556e416ce7dcc15a3c1afd04d6a059e03ed09aeb" + integrity sha512-L5kToHAEc1Q87R8ZwWFaNa4tPHr8Hnm+U+DRdUVq3tUtk+EX4pCqSd34Z6EMxNi/bjTzt1syAG9J2Oo1YFlqSg== + dependencies: + "@jsdevtools/ono" "^7.1.3" + call-me-maybe "^1.0.1" + js-yaml "^3.13.1" + +"@pyramation/json-schema-to-typescript@ 11.0.4": + version "11.0.4" + resolved "https://registry.yarnpkg.com/@pyramation/json-schema-to-typescript/-/json-schema-to-typescript-11.0.4.tgz#959bdb631dad336e1fdbf608a9b5908ab0da1d6b" + integrity sha512-+aSzXDLhMHOEdV2cJ7Tjg/9YenjHU5BCmClVygzwxJZ1R16NOfEn7lTAwVzb/2jivOSnhjHzMJbnSf8b6rd1zg== + dependencies: + "@pyramation/json-schema-ref-parser" "9.0.6" + "@types/json-schema" "^7.0.11" + "@types/lodash" "^4.14.182" + "@types/prettier" "^2.6.1" + cli-color "^2.0.2" + get-stdin "^8.0.0" + glob "^7.1.6" + glob-promise "^4.2.2" + is-glob "^4.0.3" + lodash "^4.17.21" + minimist "^1.2.6" + mkdirp "^1.0.4" + mz "^2.7.0" + prettier "^2.6.2" + +"@sinclair/typebox@^0.24.1": + version "0.24.51" + resolved "https://registry.yarnpkg.com/@sinclair/typebox/-/typebox-0.24.51.tgz#645f33fe4e02defe26f2f5c0410e1c094eac7f5f" + integrity sha512-1P1OROm/rdubP5aFDSZQILU0vrLCJ4fvHt6EoqHEM+2D/G5MK3bIaymUKLit8Js9gbns5UyJnkP/TZROLw4tUA== + +"@types/glob@^7.1.3": + version "7.2.0" + resolved "https://registry.yarnpkg.com/@types/glob/-/glob-7.2.0.tgz#bc1b5bf3aa92f25bd5dd39f35c57361bdce5b2eb" + integrity sha512-ZUxbzKl0IfJILTS6t7ip5fQQM/J3TJYubDm3nMbgubNNYS62eXeUpoLUC8/7fJNiFYHTrGPQn7hspDUzIHX3UA== + dependencies: + "@types/minimatch" "*" + "@types/node" "*" + +"@types/graceful-fs@^4.1.3": + version "4.1.6" + resolved "https://registry.yarnpkg.com/@types/graceful-fs/-/graceful-fs-4.1.6.tgz#e14b2576a1c25026b7f02ede1de3b84c3a1efeae" + integrity sha512-Sig0SNORX9fdW+bQuTEovKj3uHcUL6LQKbCrrqb1X7J6/ReAbhCXRAhc+SMejhLELFj2QcyuxmUooZ4bt5ReSw== + dependencies: + "@types/node" "*" + +"@types/istanbul-lib-coverage@*", "@types/istanbul-lib-coverage@^2.0.0": + version "2.0.4" + resolved "https://registry.yarnpkg.com/@types/istanbul-lib-coverage/-/istanbul-lib-coverage-2.0.4.tgz#8467d4b3c087805d63580480890791277ce35c44" + integrity sha512-z/QT1XN4K4KYuslS23k62yDIDLwLFkzxOuMplDtObz0+y7VqJCaO2o+SPwHCvLFZh7xazvvoor2tA/hPz9ee7g== + +"@types/istanbul-lib-report@*": + version "3.0.0" + resolved "https://registry.yarnpkg.com/@types/istanbul-lib-report/-/istanbul-lib-report-3.0.0.tgz#c14c24f18ea8190c118ee7562b7ff99a36552686" + integrity sha512-plGgXAPfVKFoYfa9NpYDAkseG+g6Jr294RqeqcqDixSbU34MZVJRi/P+7Y8GDpzkEwLaGZZOpKIEmeVZNtKsrg== + dependencies: + "@types/istanbul-lib-coverage" "*" + +"@types/istanbul-reports@^3.0.0": + version "3.0.1" + resolved "https://registry.yarnpkg.com/@types/istanbul-reports/-/istanbul-reports-3.0.1.tgz#9153fe98bba2bd565a63add9436d6f0d7f8468ff" + integrity sha512-c3mAZEuK0lvBp8tmuL74XRKn1+y2dcwOUpH7x4WrF6gk1GIgiluDRgMYQtw2OFcBvAJWlt6ASU3tSqxp0Uu0Aw== + dependencies: + "@types/istanbul-lib-report" "*" + +"@types/json-schema@^7.0.11", "@types/json-schema@^7.0.9": + version "7.0.11" + resolved "https://registry.yarnpkg.com/@types/json-schema/-/json-schema-7.0.11.tgz#d421b6c527a3037f7c84433fd2c4229e016863d3" + integrity sha512-wOuvG1SN4Us4rez+tylwwwCV1psiNVOkJeM3AUWUNWg/jDQY2+HE/444y5gc+jBmRqASOm2Oeh5c1axHobwRKQ== + +"@types/lodash@^4.14.182": + version "4.14.191" + resolved "https://registry.yarnpkg.com/@types/lodash/-/lodash-4.14.191.tgz#09511e7f7cba275acd8b419ddac8da9a6a79e2fa" + integrity sha512-BdZ5BCCvho3EIXw6wUCXHe7rS53AIDPLE+JzwgT+OsJk53oBfbSmZZ7CX4VaRoN78N+TJpFi9QPlfIVNmJYWxQ== + +"@types/long@^4.0.1": + version "4.0.2" + resolved "https://registry.yarnpkg.com/@types/long/-/long-4.0.2.tgz#b74129719fc8d11c01868010082d483b7545591a" + integrity sha512-MqTGEo5bj5t157U6fA/BiDynNkn0YknVdh48CMPkTSpFTVmvao5UQmm7uEF6xBEo7qIMAlY/JSleYaE6VOdpaA== + +"@types/minimatch@*": + version "5.1.2" + resolved "https://registry.yarnpkg.com/@types/minimatch/-/minimatch-5.1.2.tgz#07508b45797cb81ec3f273011b054cd0755eddca" + integrity sha512-K0VQKziLUWkVKiRVrx4a40iPaxTUefQmjtkQofBkYRcoaaL/8rhwDWww9qWbrgicNOgnpIsMxyNIUM4+n6dUIA== + +"@types/node@*", "@types/node@>=13.7.0", "@types/node@^18.11.18": + version "18.11.18" + resolved "https://registry.yarnpkg.com/@types/node/-/node-18.11.18.tgz#8dfb97f0da23c2293e554c5a50d61ef134d7697f" + integrity sha512-DHQpWGjyQKSHj3ebjFI/wRKcqQcdR+MoFBygntYOZytCqNfkd2ZC4ARDJ2DQqhjH5p85Nnd3jhUJIXrszFX/JA== + +"@types/prettier@^2.6.1": + version "2.7.2" + resolved "https://registry.yarnpkg.com/@types/prettier/-/prettier-2.7.2.tgz#6c2324641cc4ba050a8c710b2b251b377581fbf0" + integrity sha512-KufADq8uQqo1pYKVIYzfKbJfBAc0sOeXqGbFaSpv8MRmC/zXgowNZmFcbngndGk922QDmOASEXUZCaY48gs4cg== + +"@types/semver@^7.3.12": + version "7.3.13" + resolved "https://registry.yarnpkg.com/@types/semver/-/semver-7.3.13.tgz#da4bfd73f49bd541d28920ab0e2bf0ee80f71c91" + integrity sha512-21cFJr9z3g5dW8B0CVI9g2O9beqaThGQ6ZFBqHfwhzLDKUxaqTIy3vnfah/UPkfOiF2pLq+tGz+W8RyCskuslw== + +"@types/yargs-parser@*": + version "21.0.0" + resolved "https://registry.yarnpkg.com/@types/yargs-parser/-/yargs-parser-21.0.0.tgz#0c60e537fa790f5f9472ed2776c2b71ec117351b" + integrity sha512-iO9ZQHkZxHn4mSakYV0vFHAVDyEOIJQrV2uZ06HxEPcx+mt8swXoZHIbaaJ2crJYFfErySgktuTZ3BeLz+XmFA== + +"@types/yargs@^17.0.8": + version "17.0.20" + resolved "https://registry.yarnpkg.com/@types/yargs/-/yargs-17.0.20.tgz#107f0fcc13bd4a524e352b41c49fe88aab5c54d5" + integrity sha512-eknWrTHofQuPk2iuqDm1waA7V6xPlbgBoaaXEgYkClhLOnB0TtbW+srJaOToAgawPxPlHQzwypFA2bhZaUGP5A== + dependencies: + "@types/yargs-parser" "*" + +"@typescript-eslint/eslint-plugin@^5.49.0": + version "5.49.0" + resolved "https://registry.yarnpkg.com/@typescript-eslint/eslint-plugin/-/eslint-plugin-5.49.0.tgz#d0b4556f0792194bf0c2fb297897efa321492389" + integrity sha512-IhxabIpcf++TBaBa1h7jtOWyon80SXPRLDq0dVz5SLFC/eW6tofkw/O7Ar3lkx5z5U6wzbKDrl2larprp5kk5Q== + dependencies: + "@typescript-eslint/scope-manager" "5.49.0" + "@typescript-eslint/type-utils" "5.49.0" + "@typescript-eslint/utils" "5.49.0" + debug "^4.3.4" + ignore "^5.2.0" + natural-compare-lite "^1.4.0" + regexpp "^3.2.0" + semver "^7.3.7" + tsutils "^3.21.0" + +"@typescript-eslint/parser@^5.49.0": + version "5.49.0" + resolved "https://registry.yarnpkg.com/@typescript-eslint/parser/-/parser-5.49.0.tgz#d699734b2f20e16351e117417d34a2bc9d7c4b90" + integrity sha512-veDlZN9mUhGqU31Qiv2qEp+XrJj5fgZpJ8PW30sHU+j/8/e5ruAhLaVDAeznS7A7i4ucb/s8IozpDtt9NqCkZg== + dependencies: + "@typescript-eslint/scope-manager" "5.49.0" + "@typescript-eslint/types" "5.49.0" + "@typescript-eslint/typescript-estree" "5.49.0" + debug "^4.3.4" + +"@typescript-eslint/scope-manager@5.49.0": + version "5.49.0" + resolved "https://registry.yarnpkg.com/@typescript-eslint/scope-manager/-/scope-manager-5.49.0.tgz#81b5d899cdae446c26ddf18bd47a2f5484a8af3e" + integrity sha512-clpROBOiMIzpbWNxCe1xDK14uPZh35u4QaZO1GddilEzoCLAEz4szb51rBpdgurs5k2YzPtJeTEN3qVbG+LRUQ== + dependencies: + "@typescript-eslint/types" "5.49.0" + "@typescript-eslint/visitor-keys" "5.49.0" + +"@typescript-eslint/type-utils@5.49.0": + version "5.49.0" + resolved "https://registry.yarnpkg.com/@typescript-eslint/type-utils/-/type-utils-5.49.0.tgz#8d5dcc8d422881e2ccf4ebdc6b1d4cc61aa64125" + integrity sha512-eUgLTYq0tR0FGU5g1YHm4rt5H/+V2IPVkP0cBmbhRyEmyGe4XvJ2YJ6sYTmONfjmdMqyMLad7SB8GvblbeESZA== + dependencies: + "@typescript-eslint/typescript-estree" "5.49.0" + "@typescript-eslint/utils" "5.49.0" + debug "^4.3.4" + tsutils "^3.21.0" + +"@typescript-eslint/types@5.49.0": + version "5.49.0" + resolved "https://registry.yarnpkg.com/@typescript-eslint/types/-/types-5.49.0.tgz#ad66766cb36ca1c89fcb6ac8b87ec2e6dac435c3" + integrity sha512-7If46kusG+sSnEpu0yOz2xFv5nRz158nzEXnJFCGVEHWnuzolXKwrH5Bsf9zsNlOQkyZuk0BZKKoJQI+1JPBBg== + +"@typescript-eslint/typescript-estree@5.49.0": + version "5.49.0" + resolved "https://registry.yarnpkg.com/@typescript-eslint/typescript-estree/-/typescript-estree-5.49.0.tgz#ebd6294c0ea97891fce6af536048181e23d729c8" + integrity sha512-PBdx+V7deZT/3GjNYPVQv1Nc0U46dAHbIuOG8AZ3on3vuEKiPDwFE/lG1snN2eUB9IhF7EyF7K1hmTcLztNIsA== + dependencies: + "@typescript-eslint/types" "5.49.0" + "@typescript-eslint/visitor-keys" "5.49.0" + debug "^4.3.4" + globby "^11.1.0" + is-glob "^4.0.3" + semver "^7.3.7" + tsutils "^3.21.0" + +"@typescript-eslint/utils@5.49.0": + version "5.49.0" + resolved "https://registry.yarnpkg.com/@typescript-eslint/utils/-/utils-5.49.0.tgz#1c07923bc55ff7834dfcde487fff8d8624a87b32" + integrity sha512-cPJue/4Si25FViIb74sHCLtM4nTSBXtLx1d3/QT6mirQ/c65bV8arBEebBJJizfq8W2YyMoPI/WWPFWitmNqnQ== + dependencies: + "@types/json-schema" "^7.0.9" + "@types/semver" "^7.3.12" + "@typescript-eslint/scope-manager" "5.49.0" + "@typescript-eslint/types" "5.49.0" + "@typescript-eslint/typescript-estree" "5.49.0" + eslint-scope "^5.1.1" + eslint-utils "^3.0.0" + semver "^7.3.7" + +"@typescript-eslint/visitor-keys@5.49.0": + version "5.49.0" + resolved "https://registry.yarnpkg.com/@typescript-eslint/visitor-keys/-/visitor-keys-5.49.0.tgz#2561c4da3f235f5c852759bf6c5faec7524f90fe" + integrity sha512-v9jBMjpNWyn8B6k/Mjt6VbUS4J1GvUlR4x3Y+ibnP1z7y7V4n0WRz+50DY6+Myj0UaXVSuUlHohO+eZ8IJEnkg== + dependencies: + "@typescript-eslint/types" "5.49.0" + eslint-visitor-keys "^3.3.0" + +acorn-jsx@^5.3.2: + version "5.3.2" + resolved "https://registry.yarnpkg.com/acorn-jsx/-/acorn-jsx-5.3.2.tgz#7ed5bb55908b3b2f1bc55c6af1653bada7f07937" + integrity sha512-rq9s+JNhf0IChjtDXxllJ7g41oZk5SlXtp0LHwyA5cejwn7vKmKp4pPri6YEePv2PU65sAsegbXtIinmDFDXgQ== + +acorn@^8.8.0: + version "8.8.2" + resolved "https://registry.yarnpkg.com/acorn/-/acorn-8.8.2.tgz#1b2f25db02af965399b9776b0c2c391276d37c4a" + integrity sha512-xjIYgE8HBrkpd/sJqOGNspf8uHG+NOHGOw6a/Urj8taM2EXfdNAH2oFcPeIFfsv3+kz/mJrS5VuMqbNLjCa2vw== + +ajv@^6.10.0, ajv@^6.12.4: + version "6.12.6" + resolved "https://registry.yarnpkg.com/ajv/-/ajv-6.12.6.tgz#baf5a62e802b07d977034586f8c3baf5adf26df4" + integrity sha512-j3fVLgvTo527anyYyJOGTYJbG+vnnQYvE0m5mmkc1TK+nxAppkCLMIL0aZ4dblVCNoGShhm+kzE4ZUykBoMg4g== + dependencies: + fast-deep-equal "^3.1.1" + fast-json-stable-stringify "^2.0.0" + json-schema-traverse "^0.4.1" + uri-js "^4.2.2" + +ansi-escapes@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/ansi-escapes/-/ansi-escapes-2.0.0.tgz#5bae52be424878dd9783e8910e3fc2922e83c81b" + integrity sha512-tH/fSoQp4DrEodDK3QpdiWiZTSe7sBJ9eOqcQBZ0o9HTM+5M/viSEn+sPMoTuPjQQ8n++w3QJoPEjt8LVPcrCg== + +ansi-escapes@^3.2.0: + version "3.2.0" + resolved "https://registry.yarnpkg.com/ansi-escapes/-/ansi-escapes-3.2.0.tgz#8780b98ff9dbf5638152d1f1fe5c1d7b4442976b" + integrity sha512-cBhpre4ma+U0T1oM5fXg7Dy1Jw7zzwv7lt/GoCpr+hDQJoYnKVPLL4dCvSEFMmQurOQvSrwT7SL/DAlhBI97RQ== + +ansi-regex@^2.0.0: + version "2.1.1" + resolved "https://registry.yarnpkg.com/ansi-regex/-/ansi-regex-2.1.1.tgz#c3b33ab5ee360d86e0e628f0468ae7ef27d654df" + integrity sha512-TIGnTpdo+E3+pCyAluZvtED5p5wCqLdezCyhPZzKPcxvFplEt4i+W7OONCKgeZFT3+y5NZZfOOS/Bdcanm1MYA== + +ansi-regex@^3.0.0: + version "3.0.1" + resolved "https://registry.yarnpkg.com/ansi-regex/-/ansi-regex-3.0.1.tgz#123d6479e92ad45ad897d4054e3c7ca7db4944e1" + integrity sha512-+O9Jct8wf++lXxxFc4hc8LsjaSq0HFzzL7cVsw8pRDIPdjKD2mT4ytDZlLuSBZ4cLKZFXIrMGO7DbQCtMJJMKw== + +ansi-regex@^4.1.0: + version "4.1.1" + resolved "https://registry.yarnpkg.com/ansi-regex/-/ansi-regex-4.1.1.tgz#164daac87ab2d6f6db3a29875e2d1766582dabed" + integrity sha512-ILlv4k/3f6vfQ4OoP2AGvirOktlQ98ZEL1k9FaQjxa3L1abBgbuTDAdPOpvbGncC0BTVQrl+OM8xZGK6tWXt7g== + +ansi-regex@^5.0.1: + version "5.0.1" + resolved "https://registry.yarnpkg.com/ansi-regex/-/ansi-regex-5.0.1.tgz#082cb2c89c9fe8659a311a53bd6a4dc5301db304" + integrity sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ== + +ansi-styles@^2.2.1: + version "2.2.1" + resolved "https://registry.yarnpkg.com/ansi-styles/-/ansi-styles-2.2.1.tgz#b432dd3358b634cf75e1e4664368240533c1ddbe" + integrity sha512-kmCevFghRiWM7HB5zTPULl4r9bVFSWjz62MhqizDGUrq2NWuNMQyuv4tHHoKJHs69M/MF64lEcHdYIocrdWQYA== + +ansi-styles@^3.2.1: + version "3.2.1" + resolved "https://registry.yarnpkg.com/ansi-styles/-/ansi-styles-3.2.1.tgz#41fbb20243e50b12be0f04b8dedbf07520ce841d" + integrity sha512-VT0ZI6kZRdTh8YyJw3SMbYm/u+NqfsAxEpWO0Pf9sq8/e94WxxOpPKx9FR1FlyCtOVDNOQ+8ntlqFxiRc+r5qA== + dependencies: + color-convert "^1.9.0" + +ansi-styles@^4.1.0: + version "4.3.0" + resolved "https://registry.yarnpkg.com/ansi-styles/-/ansi-styles-4.3.0.tgz#edd803628ae71c04c85ae7a0906edad34b648937" + integrity sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg== + dependencies: + color-convert "^2.0.1" + +any-promise@^1.0.0: + version "1.3.0" + resolved "https://registry.yarnpkg.com/any-promise/-/any-promise-1.3.0.tgz#abc6afeedcea52e809cdc0376aed3ce39635d17f" + integrity sha512-7UvmKalWRt1wgjL1RrGxoSJW/0QZFIegpeGvZG9kjp8vrRu55XTHbwnqq2GpXm9uLbcuhxm3IqX9OB4MZR1b2A== + +anymatch@^3.0.3: + version "3.1.3" + resolved "https://registry.yarnpkg.com/anymatch/-/anymatch-3.1.3.tgz#790c58b19ba1720a84205b57c618d5ad8524973e" + integrity sha512-KMReFUr0B4t+D+OBkjR3KYqvocp2XaSzO55UcB6mgQMd3KbcE+mWTyvVV7D/zsdEbNnV6acZUutkiHQXvTr1Rw== + dependencies: + normalize-path "^3.0.0" + picomatch "^2.0.4" + +argparse@^1.0.7: + version "1.0.10" + resolved "https://registry.yarnpkg.com/argparse/-/argparse-1.0.10.tgz#bcd6791ea5ae09725e17e5ad988134cd40b3d911" + integrity sha512-o5Roy6tNG4SL/FOkCAN6RzjiakZS25RLYFrcMttJqbdd8BWrnA+fGz57iN5Pb06pvBGvl5gQ0B48dJlslXvoTg== + dependencies: + sprintf-js "~1.0.2" + +argparse@^2.0.1: + version "2.0.1" + resolved "https://registry.yarnpkg.com/argparse/-/argparse-2.0.1.tgz#246f50f3ca78a3240f6c997e8a9bd1eac49e4b38" + integrity sha512-8+9WqebbFzpX9OR+Wa6O29asIogeRMzcGtAINdpMHHyAg10f05aSFVBbcEqGf/PXw1EjAZ+q2/bEBg3DvurK3Q== + +array-union@^2.1.0: + version "2.1.0" + resolved "https://registry.yarnpkg.com/array-union/-/array-union-2.1.0.tgz#b798420adbeb1de828d84acd8a2e23d3efe85e8d" + integrity sha512-HGyxoOTYUyCM6stUe6EJgnd4EoewAI7zMdfqO+kGjnlZmBDz/cR5pf8r/cR4Wq60sL/p0IkcjUEEPwS3GFrIyw== + +ast-stringify@0.1.0: + version "0.1.0" + resolved "https://registry.yarnpkg.com/ast-stringify/-/ast-stringify-0.1.0.tgz#5c6439fbfb4513dcc26c7d34464ccd084ed91cb7" + integrity sha512-J1PgFYV3RG6r37+M6ySZJH406hR82okwGvFM9hLXpOvdx4WC4GEW8/qiw6pi1hKTrqcRvoHP8a7mp87egYr6iA== + dependencies: + "@babel/runtime" "^7.11.2" + +axios@^0.21.2: + version "0.21.4" + resolved "https://registry.yarnpkg.com/axios/-/axios-0.21.4.tgz#c67b90dc0568e5c1cf2b0b858c43ba28e2eda575" + integrity sha512-ut5vewkiu8jjGBdqpM44XxjuCjq9LAKeHVmoVfHVzy8eHgxxq8SbAVQNovDA8mVi05kP0Ea/n/UzcSHcTJQfNg== + dependencies: + follow-redirects "^1.14.0" + +babel-plugin-istanbul@^6.1.1: + version "6.1.1" + resolved "https://registry.yarnpkg.com/babel-plugin-istanbul/-/babel-plugin-istanbul-6.1.1.tgz#fa88ec59232fd9b4e36dbbc540a8ec9a9b47da73" + integrity sha512-Y1IQok9821cC9onCx5otgFfRm7Lm+I+wwxOx738M/WLPZ9Q42m4IG5W0FNX8WLL2gYMZo3JkuXIH2DOpWM+qwA== + dependencies: + "@babel/helper-plugin-utils" "^7.0.0" + "@istanbuljs/load-nyc-config" "^1.0.0" + "@istanbuljs/schema" "^0.1.2" + istanbul-lib-instrument "^5.0.4" + test-exclude "^6.0.0" + +babel-plugin-polyfill-corejs2@^0.3.2: + version "0.3.3" + resolved "https://registry.yarnpkg.com/babel-plugin-polyfill-corejs2/-/babel-plugin-polyfill-corejs2-0.3.3.tgz#5d1bd3836d0a19e1b84bbf2d9640ccb6f951c122" + integrity sha512-8hOdmFYFSZhqg2C/JgLUQ+t52o5nirNwaWM2B9LWteozwIvM14VSwdsCAUET10qT+kmySAlseadmfeeSWFCy+Q== + dependencies: + "@babel/compat-data" "^7.17.7" + "@babel/helper-define-polyfill-provider" "^0.3.3" + semver "^6.1.1" + +babel-plugin-polyfill-corejs3@^0.5.3: + version "0.5.3" + resolved "https://registry.yarnpkg.com/babel-plugin-polyfill-corejs3/-/babel-plugin-polyfill-corejs3-0.5.3.tgz#d7e09c9a899079d71a8b670c6181af56ec19c5c7" + integrity sha512-zKsXDh0XjnrUEW0mxIHLfjBfnXSMr5Q/goMe/fxpQnLm07mcOZiIZHBNWCMx60HmdvjxfXcalac0tfFg0wqxyw== + dependencies: + "@babel/helper-define-polyfill-provider" "^0.3.2" + core-js-compat "^3.21.0" + +babel-plugin-polyfill-regenerator@^0.4.0: + version "0.4.1" + resolved "https://registry.yarnpkg.com/babel-plugin-polyfill-regenerator/-/babel-plugin-polyfill-regenerator-0.4.1.tgz#390f91c38d90473592ed43351e801a9d3e0fd747" + integrity sha512-NtQGmyQDXjQqQ+IzRkBVwEOz9lQ4zxAQZgoAYEtU9dJjnl1Oc98qnN7jcp+bE7O7aYzVpavXE3/VKXNzUbh7aw== + dependencies: + "@babel/helper-define-polyfill-provider" "^0.3.3" + +balanced-match@^1.0.0: + version "1.0.2" + resolved "https://registry.yarnpkg.com/balanced-match/-/balanced-match-1.0.2.tgz#e83e3a7e3f300b34cb9d87f615fa0cbf357690ee" + integrity sha512-3oSeUO0TMV67hN1AmbXsK4yaqU7tjiHlbxRDZOpH0KW9+CeX4bRAaX0Anxt0tx2MrpRpWwQaPwIlISEJhYU5Pw== + +base64-js@^1.3.0: + version "1.5.1" + resolved "https://registry.yarnpkg.com/base64-js/-/base64-js-1.5.1.tgz#1b1b440160a5bf7ad40b650f095963481903930a" + integrity sha512-AKpaYlHn8t4SVbOHCy+b5+KKgvR4vrsD8vbvrbiQJps7fKDTkjkDry6ji0rUJjC0kzbNePLwzxq8iypo41qeWA== + +bech32@^1.1.4: + version "1.1.4" + resolved "https://registry.yarnpkg.com/bech32/-/bech32-1.1.4.tgz#e38c9f37bf179b8eb16ae3a772b40c356d4832e9" + integrity sha512-s0IrSOzLlbvX7yp4WBfPITzpAU8sqQcpsmwXDiKwrG4r491vwCO/XpejasRNl0piBMe/DvP4Tz0mIS/X1DPJBQ== + +bn.js@^4.11.9: + version "4.12.0" + resolved "https://registry.yarnpkg.com/bn.js/-/bn.js-4.12.0.tgz#775b3f278efbb9718eec7361f483fb36fbbfea88" + integrity sha512-c98Bf3tPniI+scsdk237ku1Dc3ujXQTSgyiPUDEOe7tRkhrqridvh8klBv0HCEso1OLOYcHuCv/cS6DNxKH+ZA== + +bn.js@^5.2.0: + version "5.2.1" + resolved "https://registry.yarnpkg.com/bn.js/-/bn.js-5.2.1.tgz#0bc527a6a0d18d0aa8d5b0538ce4a77dccfa7b70" + integrity sha512-eXRvHzWyYPBuB4NBy0cmYQjGitUrtqwbvlzP3G6VFnNRbsZQIxQ10PbKKHt8gZ/HW/D/747aDl+QkDqg3KQLMQ== + +brace-expansion@^1.1.7: + version "1.1.11" + resolved "https://registry.yarnpkg.com/brace-expansion/-/brace-expansion-1.1.11.tgz#3c7fcbf529d87226f3d2f52b966ff5271eb441dd" + integrity sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA== + dependencies: + balanced-match "^1.0.0" + concat-map "0.0.1" + +brace-expansion@^2.0.1: + version "2.0.1" + resolved "https://registry.yarnpkg.com/brace-expansion/-/brace-expansion-2.0.1.tgz#1edc459e0f0c548486ecf9fc99f2221364b9a0ae" + integrity sha512-XnAIvQ8eM+kC6aULx6wuQiwVsnzsi9d3WxzV3FpWTGA19F621kwdbsAcFKXgKUHZWsy+mY6iL1sHTxWEFCytDA== + dependencies: + balanced-match "^1.0.0" + +braces@^3.0.2: + version "3.0.2" + resolved "https://registry.yarnpkg.com/braces/-/braces-3.0.2.tgz#3454e1a462ee8d599e236df336cd9ea4f8afe107" + integrity sha512-b8um+L1RzM3WDSzvhm6gIz1yfTbBt6YTlcEKAvsmqCZZFw46z626lVj9j1yEPW33H5H+lBQpZMP1k8l+78Ha0A== + dependencies: + fill-range "^7.0.1" + +brorand@^1.1.0: + version "1.1.0" + resolved "https://registry.yarnpkg.com/brorand/-/brorand-1.1.0.tgz#12c25efe40a45e3c323eb8675a0a0ce57b22371f" + integrity sha512-cKV8tMCEpQs4hK/ik71d6LrPOnpkpGBR0wzxqr68g2m/LB2GxVYQroAjMJZRVM1Y4BCjCKc3vAamxSzOY2RP+w== + +browserslist@^4.21.3, browserslist@^4.21.4: + version "4.21.4" + resolved "https://registry.yarnpkg.com/browserslist/-/browserslist-4.21.4.tgz#e7496bbc67b9e39dd0f98565feccdcb0d4ff6987" + integrity sha512-CBHJJdDmgjl3daYjN5Cp5kbTf1mUhZoS+beLklHIvkOWscs83YAhLlF3Wsh/lciQYAcbBJgTOD44VtG31ZM4Hw== + dependencies: + caniuse-lite "^1.0.30001400" + electron-to-chromium "^1.4.251" + node-releases "^2.0.6" + update-browserslist-db "^1.0.9" + +bser@2.1.1: + version "2.1.1" + resolved "https://registry.yarnpkg.com/bser/-/bser-2.1.1.tgz#e6787da20ece9d07998533cfd9de6f5c38f4bc05" + integrity sha512-gQxTNE/GAfIIrmHLUE3oJyp5FO6HRBfhjnw4/wMmA63ZGDJnWBmgY/lyQBpnDUkGmAhbSe39tx2d/iTOAfglwQ== + dependencies: + node-int64 "^0.4.0" + +call-me-maybe@^1.0.1: + version "1.0.2" + resolved "https://registry.yarnpkg.com/call-me-maybe/-/call-me-maybe-1.0.2.tgz#03f964f19522ba643b1b0693acb9152fe2074baa" + integrity sha512-HpX65o1Hnr9HH25ojC1YGs7HCQLq0GCOibSaWER0eNpgJ/Z1MZv2mTc7+xh6WOPxbRVcmgbv4hGU+uSQ/2xFZQ== + +callsites@^3.0.0: + version "3.1.0" + resolved "https://registry.yarnpkg.com/callsites/-/callsites-3.1.0.tgz#b3630abd8943432f54b3f0519238e33cd7df2f73" + integrity sha512-P8BjAsXvZS+VIDUI11hHCQEv74YT67YUi5JJFNWIqL235sBmjX4+qx9Muvls5ivyNENctx46xQLQ3aTuE7ssaQ== + +camelcase@^5.3.1: + version "5.3.1" + resolved "https://registry.yarnpkg.com/camelcase/-/camelcase-5.3.1.tgz#e3c9b31569e106811df242f715725a1f4c494320" + integrity sha512-L28STB170nwWS63UjtlEOE3dldQApaJXZkOI1uMFfzf3rRuPegHaHesyee+YxQ+W6SvRDQV6UrdOdRiR153wJg== + +caniuse-lite@^1.0.30001400: + version "1.0.30001447" + resolved "https://registry.yarnpkg.com/caniuse-lite/-/caniuse-lite-1.0.30001447.tgz#ef1f39ae38d839d7176713735a8e467a0a2523bd" + integrity sha512-bdKU1BQDPeEXe9A39xJnGtY0uRq/z5osrnXUw0TcK+EYno45Y+U7QU9HhHEyzvMDffpYadFXi3idnSNkcwLkTw== + +case@1.6.3: + version "1.6.3" + resolved "https://registry.yarnpkg.com/case/-/case-1.6.3.tgz#0a4386e3e9825351ca2e6216c60467ff5f1ea1c9" + integrity sha512-mzDSXIPaFwVDvZAHqZ9VlbyF4yyXRuX6IvB06WvPYkqJVO24kX1PPhv9bfpKNFZyxYFmmgo03HUiD8iklmJYRQ== + +chalk@4.1.2, chalk@^4.0.0: + version "4.1.2" + resolved "https://registry.yarnpkg.com/chalk/-/chalk-4.1.2.tgz#aac4e2b7734a740867aeb16bf02aad556a1e7a01" + integrity sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA== + dependencies: + ansi-styles "^4.1.0" + supports-color "^7.1.0" + +chalk@^1.0.0, chalk@^1.1.3: + version "1.1.3" + resolved "https://registry.yarnpkg.com/chalk/-/chalk-1.1.3.tgz#a8115c55e4a702fe4d150abd3872822a7e09fc98" + integrity sha512-U3lRVLMSlsCfjqYPbLyVv11M9CPW4I728d6TCKMAOJueEeB9/8o+eSsMnxPJD+Q+K909sdESg7C+tIkoH6on1A== + dependencies: + ansi-styles "^2.2.1" + escape-string-regexp "^1.0.2" + has-ansi "^2.0.0" + strip-ansi "^3.0.0" + supports-color "^2.0.0" + +chalk@^2.0.0, chalk@^2.4.2: + version "2.4.2" + resolved "https://registry.yarnpkg.com/chalk/-/chalk-2.4.2.tgz#cd42541677a54333cf541a49108c1432b44c9424" + integrity sha512-Mti+f9lpJNcwF4tWV8/OrTTtF1gZi+f8FqlyAdouralcFWFQWF2+NgCHShjkCb+IFBLq9buZwE1xckQU4peSuQ== + dependencies: + ansi-styles "^3.2.1" + escape-string-regexp "^1.0.5" + supports-color "^5.3.0" + +chardet@^0.4.0: + version "0.4.2" + resolved "https://registry.yarnpkg.com/chardet/-/chardet-0.4.2.tgz#b5473b33dc97c424e5d98dc87d55d4d8a29c8bf2" + integrity sha512-j/Toj7f1z98Hh2cYo2BVr85EpIRWqUi7rtRSGxh/cqUjqrnJe9l9UE7IUGd2vQ2p+kSHLkSzObQPZPLUC6TQwg== + +chardet@^0.7.0: + version "0.7.0" + resolved "https://registry.yarnpkg.com/chardet/-/chardet-0.7.0.tgz#90094849f0937f2eedc2425d0d28a9e5f0cbad9e" + integrity sha512-mT8iDcrh03qDGRRmoA2hmBJnxpllMR+0/0qlzjqZES6NdiWDcZkCNAk4rPFZ9Q85r27unkiNNg8ZOiwZXBHwcA== + +ci-info@^3.2.0: + version "3.7.1" + resolved "https://registry.yarnpkg.com/ci-info/-/ci-info-3.7.1.tgz#708a6cdae38915d597afdf3b145f2f8e1ff55f3f" + integrity sha512-4jYS4MOAaCIStSRwiuxc4B8MYhIe676yO1sYGzARnjXkWpmzZMMYxY6zu8WYWDhSuth5zhrQ1rhNSibyyvv4/w== + +cli-color@^2.0.2: + version "2.0.3" + resolved "https://registry.yarnpkg.com/cli-color/-/cli-color-2.0.3.tgz#73769ba969080629670f3f2ef69a4bf4e7cc1879" + integrity sha512-OkoZnxyC4ERN3zLzZaY9Emb7f/MhBOIpePv0Ycok0fJYT+Ouo00UBEIwsVsr0yoow++n5YWlSUgST9GKhNHiRQ== + dependencies: + d "^1.0.1" + es5-ext "^0.10.61" + es6-iterator "^2.0.3" + memoizee "^0.4.15" + timers-ext "^0.1.7" + +cli-cursor@^2.1.0: + version "2.1.0" + resolved "https://registry.yarnpkg.com/cli-cursor/-/cli-cursor-2.1.0.tgz#b35dac376479facc3e94747d41d0d0f5238ffcb5" + integrity sha512-8lgKz8LmCRYZZQDpRyT2m5rKJ08TnU4tR9FFFW2rxpxR1FzWi4PQ/NfyODchAatHaUgnSPVcx/R5w6NuTBzFiw== + dependencies: + restore-cursor "^2.0.0" + +cli-width@^2.0.0: + version "2.2.1" + resolved "https://registry.yarnpkg.com/cli-width/-/cli-width-2.2.1.tgz#b0433d0b4e9c847ef18868a4ef16fd5fc8271c48" + integrity sha512-GRMWDxpOB6Dgk2E5Uo+3eEBvtOOlimMmpbFiKuLFnQzYDavtLFY3K5ona41jgN/WdRZtG7utuVSVTL4HbZHGkw== + +color-convert@^1.9.0: + version "1.9.3" + resolved "https://registry.yarnpkg.com/color-convert/-/color-convert-1.9.3.tgz#bb71850690e1f136567de629d2d5471deda4c1e8" + integrity sha512-QfAUtd+vFdAtFQcC8CCyYt1fYWxSqAiK2cSD6zDB8N3cpsEBAvRxp9zOGg6G/SHHJYAT88/az/IuDGALsNVbGg== + dependencies: + color-name "1.1.3" + +color-convert@^2.0.1: + version "2.0.1" + resolved "https://registry.yarnpkg.com/color-convert/-/color-convert-2.0.1.tgz#72d3a68d598c9bdb3af2ad1e84f21d896abd4de3" + integrity sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ== + dependencies: + color-name "~1.1.4" + +color-name@1.1.3: + version "1.1.3" + resolved "https://registry.yarnpkg.com/color-name/-/color-name-1.1.3.tgz#a7d0558bd89c42f795dd42328f740831ca53bc25" + integrity sha512-72fSenhMw2HZMTVHeCA9KCmpEIbzWiQsjN+BHcBbS9vr1mtt+vJjPdksIBNUmKAW8TFUDPJK5SUU3QhE9NEXDw== + +color-name@~1.1.4: + version "1.1.4" + resolved "https://registry.yarnpkg.com/color-name/-/color-name-1.1.4.tgz#c2a09a87acbde69543de6f63fa3995c826c536a2" + integrity sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA== + +colors@^1.1.2: + version "1.4.0" + resolved "https://registry.yarnpkg.com/colors/-/colors-1.4.0.tgz#c50491479d4c1bdaed2c9ced32cf7c7dc2360f78" + integrity sha512-a+UqTh4kgZg/SlGvfbzDHpgRu7AAQOmmqRHJnxhRZICKFUT91brVhNNt58CMWU9PsBbv3PDCZUHbVxuDiH2mtA== + +concat-map@0.0.1: + version "0.0.1" + resolved "https://registry.yarnpkg.com/concat-map/-/concat-map-0.0.1.tgz#d8a96bd77fd68df7793a73036a3ba0d5405d477b" + integrity sha512-/Srv4dswyQNBfohGpz9o6Yb3Gz3SrUDqBH5rTuhGR7ahtlbYKnVxw2bCFMRljaA7EXHaXZ8wsHdodFvbkhKmqg== + +convert-source-map@^1.4.0, convert-source-map@^1.7.0: + version "1.9.0" + resolved "https://registry.yarnpkg.com/convert-source-map/-/convert-source-map-1.9.0.tgz#7faae62353fb4213366d0ca98358d22e8368b05f" + integrity sha512-ASFBup0Mz1uyiIjANan1jzLQami9z1PoYSZCiiYW2FczPbenXc45FZdBZLzOT+r6+iciuEModtmCti+hjaAk0A== + +core-js-compat@^3.21.0, core-js-compat@^3.22.1: + version "3.27.2" + resolved "https://registry.yarnpkg.com/core-js-compat/-/core-js-compat-3.27.2.tgz#607c50ad6db8fd8326af0b2883ebb987be3786da" + integrity sha512-welaYuF7ZtbYKGrIy7y3eb40d37rG1FvzEOfe7hSLd2iD6duMDqUhRfSvCGyC46HhR6Y8JXXdZ2lnRUMkPBpvg== + dependencies: + browserslist "^4.21.4" + +cosmjs-types@^0.5.2: + version "0.5.2" + resolved "https://registry.yarnpkg.com/cosmjs-types/-/cosmjs-types-0.5.2.tgz#2d42b354946f330dfb5c90a87fdc2a36f97b965d" + integrity sha512-zxCtIJj8v3Di7s39uN4LNcN3HIE1z0B9Z0SPE8ZNQR0oSzsuSe1ACgxoFkvhkS7WBasCAFcglS11G2hyfd5tPg== + dependencies: + long "^4.0.0" + protobufjs "~6.11.2" + +cosmjs-types@^0.6.1: + version "0.6.1" + resolved "https://registry.yarnpkg.com/cosmjs-types/-/cosmjs-types-0.6.1.tgz#4944e83d0fa87880243a11813bdff0e313d39a68" + integrity sha512-fRz6yzElHHBULDyLArF/G1UkkTWW4r3RondBUGnmSsZWYI5NpfDn32MVa5aRmpaaf4tJI2cbnXHs9fykwU7Ttg== + dependencies: + long "^4.0.0" + protobufjs "~6.11.2" + +cross-spawn@^7.0.2: + version "7.0.3" + resolved "https://registry.yarnpkg.com/cross-spawn/-/cross-spawn-7.0.3.tgz#f73a85b9d5d41d045551c177e2882d4ac85728a6" + integrity sha512-iRDPJKUPVEND7dHPO8rkbOnPpyDygcDFtWjpeWNCgy8WP2rXcxXL8TskReQl6OrB2G7+UJrags1q15Fudc7G6w== + dependencies: + path-key "^3.1.0" + shebang-command "^2.0.0" + which "^2.0.1" + +d@1, d@^1.0.1: + version "1.0.1" + resolved "https://registry.yarnpkg.com/d/-/d-1.0.1.tgz#8698095372d58dbee346ffd0c7093f99f8f9eb5a" + integrity sha512-m62ShEObQ39CfralilEQRjH6oAMtNCV1xJyEx5LpRYUVN+EviphDgUc/F3hnYbADmkiNs67Y+3ylmlG7Lnu+FA== + dependencies: + es5-ext "^0.10.50" + type "^1.0.1" + +dargs@7.0.0: + version "7.0.0" + resolved "https://registry.yarnpkg.com/dargs/-/dargs-7.0.0.tgz#04015c41de0bcb69ec84050f3d9be0caf8d6d5cc" + integrity sha512-2iy1EkLdlBzQGvbweYRFxmFath8+K7+AKB0TlhHWkNuH+TmovaMH/Wp7V7R4u7f4SnX3OgLsU9t1NI9ioDnUpg== + +debug@^4.1.0, debug@^4.1.1, debug@^4.3.2, debug@^4.3.4: + version "4.3.4" + resolved "https://registry.yarnpkg.com/debug/-/debug-4.3.4.tgz#1319f6579357f2338d3337d2cdd4914bb5dcc865" + integrity sha512-PRWFHuSU3eDtQJPvnNY7Jcket1j0t5OuOsFzPPzsekD52Zl8qUfFIPEiswXqIvHWGVHOgX+7G/vCNNhehwxfkQ== + dependencies: + ms "2.1.2" + +deep-is@^0.1.3: + version "0.1.4" + resolved "https://registry.yarnpkg.com/deep-is/-/deep-is-0.1.4.tgz#a6f2dce612fadd2ef1f519b73551f17e85199831" + integrity sha512-oIPzksmTg4/MriiaYGO+okXDT7ztn/w3Eptv/+gSIdMdKsJo0u4CfYNFJPy+4SKMuCqGw2wxnA+URMg3t8a/bQ== + +deepmerge@4.2.2: + version "4.2.2" + resolved "https://registry.yarnpkg.com/deepmerge/-/deepmerge-4.2.2.tgz#44d2ea3679b8f4d4ffba33f03d865fc1e7bf4955" + integrity sha512-FJ3UgI4gIl+PHZm53knsuSFpE+nESMr7M4v9QcgB7S63Kj/6WqMiFQJpBBYz1Pt+66bZpP3Q7Lye0Oo9MPKEdg== + +define-properties@^1.1.3: + version "1.1.4" + resolved "https://registry.yarnpkg.com/define-properties/-/define-properties-1.1.4.tgz#0b14d7bd7fbeb2f3572c3a7eda80ea5d57fb05b1" + integrity sha512-uckOqKcfaVvtBdsVkdPv3XjveQJsNQqmhXgRi8uhvWWuPYZCNlzT8qAyblUgNoXdHdjMTzAqeGjAoli8f+bzPA== + dependencies: + has-property-descriptors "^1.0.0" + object-keys "^1.1.1" + +dir-glob@^3.0.1: + version "3.0.1" + resolved "https://registry.yarnpkg.com/dir-glob/-/dir-glob-3.0.1.tgz#56dbf73d992a4a93ba1584f4534063fd2e41717f" + integrity sha512-WkrWp9GR4KXfKGYzOLmTuGVi1UWFfws377n9cc55/tb6DuqyF6pcQ5AbiHEshaDpY9v6oaSr2XCDidGmMwdzIA== + dependencies: + path-type "^4.0.0" + +doctrine@^3.0.0: + version "3.0.0" + resolved "https://registry.yarnpkg.com/doctrine/-/doctrine-3.0.0.tgz#addebead72a6574db783639dc87a121773973961" + integrity sha512-yS+Q5i3hBf7GBkd4KG8a7eBNNWNGLTaEwwYWUijIYM7zrlYDM0BFXHjjPWlWZ1Rg7UaddZeIDmi9jF3HmqiQ2w== + dependencies: + esutils "^2.0.2" + +dotty@0.1.2: + version "0.1.2" + resolved "https://registry.yarnpkg.com/dotty/-/dotty-0.1.2.tgz#512d44cc4111a724931226259297f235e8484f6f" + integrity sha512-V0EWmKeH3DEhMwAZ+8ZB2Ao4OK6p++Z0hsDtZq3N0+0ZMVqkzrcEGROvOnZpLnvBg5PTNG23JEDLAm64gPaotQ== + +electron-to-chromium@^1.4.251: + version "1.4.284" + resolved "https://registry.yarnpkg.com/electron-to-chromium/-/electron-to-chromium-1.4.284.tgz#61046d1e4cab3a25238f6bf7413795270f125592" + integrity sha512-M8WEXFuKXMYMVr45fo8mq0wUrrJHheiKZf6BArTKk9ZBYCKJEOU5H8cdWgDT+qCVZf7Na4lVUaZsA+h6uA9+PA== + +elliptic@^6.5.4: + version "6.5.4" + resolved "https://registry.yarnpkg.com/elliptic/-/elliptic-6.5.4.tgz#da37cebd31e79a1367e941b592ed1fbebd58abbb" + integrity sha512-iLhC6ULemrljPZb+QutR5TQGB+pdW6KGD5RSegS+8sorOZT+rdQFbsQFJgvN3eRqNALqJer4oQ16YvJHlU8hzQ== + dependencies: + bn.js "^4.11.9" + brorand "^1.1.0" + hash.js "^1.0.0" + hmac-drbg "^1.0.1" + inherits "^2.0.4" + minimalistic-assert "^1.0.1" + minimalistic-crypto-utils "^1.0.1" + +es5-ext@^0.10.35, es5-ext@^0.10.46, es5-ext@^0.10.50, es5-ext@^0.10.53, es5-ext@^0.10.61, es5-ext@~0.10.14, es5-ext@~0.10.2, es5-ext@~0.10.46: + version "0.10.62" + resolved "https://registry.yarnpkg.com/es5-ext/-/es5-ext-0.10.62.tgz#5e6adc19a6da524bf3d1e02bbc8960e5eb49a9a5" + integrity sha512-BHLqn0klhEpnOKSrzn/Xsz2UIW8j+cGmo9JLzr8BiUapV8hPL9+FliFqjwr9ngW7jWdnxv6eO+/LqyhJVqgrjA== + dependencies: + es6-iterator "^2.0.3" + es6-symbol "^3.1.3" + next-tick "^1.1.0" + +es6-iterator@^2.0.3: + version "2.0.3" + resolved "https://registry.yarnpkg.com/es6-iterator/-/es6-iterator-2.0.3.tgz#a7de889141a05a94b0854403b2d0a0fbfa98f3b7" + integrity sha512-zw4SRzoUkd+cl+ZoE15A9o1oQd920Bb0iOJMQkQhl3jNc03YqVjAhG7scf9C5KWRU/R13Orf588uCC6525o02g== + dependencies: + d "1" + es5-ext "^0.10.35" + es6-symbol "^3.1.1" + +es6-symbol@^3.1.1, es6-symbol@^3.1.3: + version "3.1.3" + resolved "https://registry.yarnpkg.com/es6-symbol/-/es6-symbol-3.1.3.tgz#bad5d3c1bcdac28269f4cb331e431c78ac705d18" + integrity sha512-NJ6Yn3FuDinBaBRWl/q5X/s4koRHBrgKAu+yGI6JCBeiu3qrcbJhwT2GeR/EXVfylRk8dpQVJoLEFhK+Mu31NA== + dependencies: + d "^1.0.1" + ext "^1.1.2" + +es6-weak-map@^2.0.3: + version "2.0.3" + resolved "https://registry.yarnpkg.com/es6-weak-map/-/es6-weak-map-2.0.3.tgz#b6da1f16cc2cc0d9be43e6bdbfc5e7dfcdf31d53" + integrity sha512-p5um32HOTO1kP+w7PRnB+5lQ43Z6muuMuIMffvDN8ZB4GcnjLBV6zGStpbASIMk4DCAvEaamhe2zhyCb/QXXsA== + dependencies: + d "1" + es5-ext "^0.10.46" + es6-iterator "^2.0.3" + es6-symbol "^3.1.1" + +escalade@^3.1.1: + version "3.1.1" + resolved "https://registry.yarnpkg.com/escalade/-/escalade-3.1.1.tgz#d8cfdc7000965c5a0174b4a82eaa5c0552742e40" + integrity sha512-k0er2gUkLf8O0zKJiAhmkTnJlTvINGv7ygDNPbeIsX/TJjGJZHuh9B2UxbsaEkmlEo9MfhrSzmhIlhRlI2GXnw== + +escape-string-regexp@^1.0.2, escape-string-regexp@^1.0.5: + version "1.0.5" + resolved "https://registry.yarnpkg.com/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz#1b61c0562190a8dff6ae3bb2cf0200ca130b86d4" + integrity sha512-vbRorB5FUQWvla16U8R/qgaFIya2qGzwDrNmCZuYKrbdSUMG6I1ZCGQRefkRVhuOkIGVne7BQ35DSfo1qvJqFg== + +escape-string-regexp@^4.0.0: + version "4.0.0" + resolved "https://registry.yarnpkg.com/escape-string-regexp/-/escape-string-regexp-4.0.0.tgz#14ba83a5d373e3d311e5afca29cf5bfad965bf34" + integrity sha512-TtpcNJ3XAzx3Gq8sWRzJaVajRs0uVxA2YAkdb1jm2YkPz4G6egUFAyA3n5vtEIZefPk5Wa4UXbKuS5fKkJWdgA== + +eslint-config-prettier@^8.6.0: + version "8.6.0" + resolved "https://registry.yarnpkg.com/eslint-config-prettier/-/eslint-config-prettier-8.6.0.tgz#dec1d29ab728f4fa63061774e1672ac4e363d207" + integrity sha512-bAF0eLpLVqP5oEVUFKpMA+NnRFICwn9X8B5jrR9FcqnYBuPbqWEjTEspPWMj5ye6czoSLDweCzSo3Ko7gGrZaA== + +eslint-scope@^5.1.1: + version "5.1.1" + resolved "https://registry.yarnpkg.com/eslint-scope/-/eslint-scope-5.1.1.tgz#e786e59a66cb92b3f6c1fb0d508aab174848f48c" + integrity sha512-2NxwbF/hZ0KpepYN0cNbo+FN6XoK7GaHlQhgx/hIZl6Va0bF45RQOOwhLIy8lQDbuCiadSLCBnH2CFYquit5bw== + dependencies: + esrecurse "^4.3.0" + estraverse "^4.1.1" + +eslint-scope@^7.1.1: + version "7.1.1" + resolved "https://registry.yarnpkg.com/eslint-scope/-/eslint-scope-7.1.1.tgz#fff34894c2f65e5226d3041ac480b4513a163642" + integrity sha512-QKQM/UXpIiHcLqJ5AOyIW7XZmzjkzQXYE54n1++wb0u9V/abW3l9uQnxX8Z5Xd18xyKIMTUAyQ0k1e8pz6LUrw== + dependencies: + esrecurse "^4.3.0" + estraverse "^5.2.0" + +eslint-utils@^3.0.0: + version "3.0.0" + resolved "https://registry.yarnpkg.com/eslint-utils/-/eslint-utils-3.0.0.tgz#8aebaface7345bb33559db0a1f13a1d2d48c3672" + integrity sha512-uuQC43IGctw68pJA1RgbQS8/NP7rch6Cwd4j3ZBtgo4/8Flj4eGE7ZYSZRN3iq5pVUv6GPdW5Z1RFleo84uLDA== + dependencies: + eslint-visitor-keys "^2.0.0" + +eslint-visitor-keys@^2.0.0: + version "2.1.0" + resolved "https://registry.yarnpkg.com/eslint-visitor-keys/-/eslint-visitor-keys-2.1.0.tgz#f65328259305927392c938ed44eb0a5c9b2bd303" + integrity sha512-0rSmRBzXgDzIsD6mGdJgevzgezI534Cer5L/vyMX0kHzT/jiB43jRhd9YUlMGYLQy2zprNmoT8qasCGtY+QaKw== + +eslint-visitor-keys@^3.3.0: + version "3.3.0" + resolved "https://registry.yarnpkg.com/eslint-visitor-keys/-/eslint-visitor-keys-3.3.0.tgz#f6480fa6b1f30efe2d1968aa8ac745b862469826" + integrity sha512-mQ+suqKJVyeuwGYHAdjMFqjCyfl8+Ldnxuyp3ldiMBFKkvytrXUZWaiPCEav8qDHKty44bD+qV1IP4T+w+xXRA== + +eslint@^8.32.0: + version "8.32.0" + resolved "https://registry.yarnpkg.com/eslint/-/eslint-8.32.0.tgz#d9690056bb6f1a302bd991e7090f5b68fbaea861" + integrity sha512-nETVXpnthqKPFyuY2FNjz/bEd6nbosRgKbkgS/y1C7LJop96gYHWpiguLecMHQ2XCPxn77DS0P+68WzG6vkZSQ== + dependencies: + "@eslint/eslintrc" "^1.4.1" + "@humanwhocodes/config-array" "^0.11.8" + "@humanwhocodes/module-importer" "^1.0.1" + "@nodelib/fs.walk" "^1.2.8" + ajv "^6.10.0" + chalk "^4.0.0" + cross-spawn "^7.0.2" + debug "^4.3.2" + doctrine "^3.0.0" + escape-string-regexp "^4.0.0" + eslint-scope "^7.1.1" + eslint-utils "^3.0.0" + eslint-visitor-keys "^3.3.0" + espree "^9.4.0" + esquery "^1.4.0" + esutils "^2.0.2" + fast-deep-equal "^3.1.3" + file-entry-cache "^6.0.1" + find-up "^5.0.0" + glob-parent "^6.0.2" + globals "^13.19.0" + grapheme-splitter "^1.0.4" + ignore "^5.2.0" + import-fresh "^3.0.0" + imurmurhash "^0.1.4" + is-glob "^4.0.0" + is-path-inside "^3.0.3" + js-sdsl "^4.1.4" + js-yaml "^4.1.0" + json-stable-stringify-without-jsonify "^1.0.1" + levn "^0.4.1" + lodash.merge "^4.6.2" + minimatch "^3.1.2" + natural-compare "^1.4.0" + optionator "^0.9.1" + regexpp "^3.2.0" + strip-ansi "^6.0.1" + strip-json-comments "^3.1.0" + text-table "^0.2.0" + +espree@^9.4.0: + version "9.4.1" + resolved "https://registry.yarnpkg.com/espree/-/espree-9.4.1.tgz#51d6092615567a2c2cff7833445e37c28c0065bd" + integrity sha512-XwctdmTO6SIvCzd9810yyNzIrOrqNYV9Koizx4C/mRhf9uq0o4yHoCEU/670pOxOL/MSraektvSAji79kX90Vg== + dependencies: + acorn "^8.8.0" + acorn-jsx "^5.3.2" + eslint-visitor-keys "^3.3.0" + +esprima@^4.0.0: + version "4.0.1" + resolved "https://registry.yarnpkg.com/esprima/-/esprima-4.0.1.tgz#13b04cdb3e6c5d19df91ab6987a8695619b0aa71" + integrity sha512-eGuFFw7Upda+g4p+QHvnW0RyTX/SVeJBDM/gCtMARO0cLuT2HcEKnTPvhjV6aGeqrCB/sbNop0Kszm0jsaWU4A== + +esquery@^1.4.0: + version "1.4.0" + resolved "https://registry.yarnpkg.com/esquery/-/esquery-1.4.0.tgz#2148ffc38b82e8c7057dfed48425b3e61f0f24a5" + integrity sha512-cCDispWt5vHHtwMY2YrAQ4ibFkAL8RbH5YGBnZBc90MolvvfkkQcJro/aZiAQUlQ3qgrYS6D6v8Gc5G5CQsc9w== + dependencies: + estraverse "^5.1.0" + +esrecurse@^4.3.0: + version "4.3.0" + resolved "https://registry.yarnpkg.com/esrecurse/-/esrecurse-4.3.0.tgz#7ad7964d679abb28bee72cec63758b1c5d2c9921" + integrity sha512-KmfKL3b6G+RXvP8N1vr3Tq1kL/oCFgn2NYXEtqP8/L3pKapUA4G8cFVaoF3SU323CD4XypR/ffioHmkti6/Tag== + dependencies: + estraverse "^5.2.0" + +estraverse@^4.1.1: + version "4.3.0" + resolved "https://registry.yarnpkg.com/estraverse/-/estraverse-4.3.0.tgz#398ad3f3c5a24948be7725e83d11a7de28cdbd1d" + integrity sha512-39nnKffWz8xN1BU/2c79n9nB9HDzo0niYUqx6xyqUnyoAnQyyWpOTdZEeiCch8BBu515t4wp9ZmgVfVhn9EBpw== + +estraverse@^5.1.0, estraverse@^5.2.0: + version "5.3.0" + resolved "https://registry.yarnpkg.com/estraverse/-/estraverse-5.3.0.tgz#2eea5290702f26ab8fe5370370ff86c965d21123" + integrity sha512-MMdARuVEQziNTeJD8DgMqmhwR11BRQ/cBP+pLtYdSTnf3MIO8fFeiINEbX36ZdNlfU/7A9f3gUw49B3oQsvwBA== + +esutils@^2.0.2: + version "2.0.3" + resolved "https://registry.yarnpkg.com/esutils/-/esutils-2.0.3.tgz#74d2eb4de0b8da1293711910d50775b9b710ef64" + integrity sha512-kVscqXk4OCp68SZ0dkgEKVi6/8ij300KBWTJq32P/dYeWTSwK41WyTxalN1eRmA5Z9UU/LX9D7FWSmV9SAYx6g== + +event-emitter@^0.3.5: + version "0.3.5" + resolved "https://registry.yarnpkg.com/event-emitter/-/event-emitter-0.3.5.tgz#df8c69eef1647923c7157b9ce83840610b02cc39" + integrity sha512-D9rRn9y7kLPnJ+hMq7S/nhvoKwwvVJahBi2BPmx3bvbsEdK3W9ii8cBSGjP+72/LnM4n6fo3+dkCX5FeTQruXA== + dependencies: + d "1" + es5-ext "~0.10.14" + +ext@^1.1.2: + version "1.7.0" + resolved "https://registry.yarnpkg.com/ext/-/ext-1.7.0.tgz#0ea4383c0103d60e70be99e9a7f11027a33c4f5f" + integrity sha512-6hxeJYaL110a9b5TEJSj0gojyHQAmA2ch5Os+ySCiA1QGdS697XWY1pzsrSjqA9LDEEgdB/KypIlR59RcLuHYw== + dependencies: + type "^2.7.2" + +external-editor@^2.0.4: + version "2.2.0" + resolved "https://registry.yarnpkg.com/external-editor/-/external-editor-2.2.0.tgz#045511cfd8d133f3846673d1047c154e214ad3d5" + integrity sha512-bSn6gvGxKt+b7+6TKEv1ZycHleA7aHhRHyAqJyp5pbUFuYYNIzpZnQDk7AsYckyWdEnTeAnay0aCy2aV6iTk9A== + dependencies: + chardet "^0.4.0" + iconv-lite "^0.4.17" + tmp "^0.0.33" + +external-editor@^3.0.3: + version "3.1.0" + resolved "https://registry.yarnpkg.com/external-editor/-/external-editor-3.1.0.tgz#cb03f740befae03ea4d283caed2741a83f335495" + integrity sha512-hMQ4CX1p1izmuLYyZqLMO/qGNw10wSv9QDCPfzXfyFrOaCSSoRfqE1Kf1s5an66J5JZC62NewG+mK49jOCtQew== + dependencies: + chardet "^0.7.0" + iconv-lite "^0.4.24" + tmp "^0.0.33" + +fast-deep-equal@^3.1.1, fast-deep-equal@^3.1.3: + version "3.1.3" + resolved "https://registry.yarnpkg.com/fast-deep-equal/-/fast-deep-equal-3.1.3.tgz#3a7d56b559d6cbc3eb512325244e619a65c6c525" + integrity sha512-f3qQ9oQy9j2AhBe/H9VC91wLmKBCCU/gDOnKNAYG5hswO7BLKj09Hc5HYNz9cGI++xlpDCIgDaitVs03ATR84Q== + +fast-glob@^3.2.9: + version "3.2.12" + resolved "https://registry.yarnpkg.com/fast-glob/-/fast-glob-3.2.12.tgz#7f39ec99c2e6ab030337142da9e0c18f37afae80" + integrity sha512-DVj4CQIYYow0BlaelwK1pHl5n5cRSJfM60UA0zK891sVInoPri2Ekj7+e1CT3/3qxXenpI+nBBmQAcJPJgaj4w== + dependencies: + "@nodelib/fs.stat" "^2.0.2" + "@nodelib/fs.walk" "^1.2.3" + glob-parent "^5.1.2" + merge2 "^1.3.0" + micromatch "^4.0.4" + +fast-json-stable-stringify@^2.0.0: + version "2.1.0" + resolved "https://registry.yarnpkg.com/fast-json-stable-stringify/-/fast-json-stable-stringify-2.1.0.tgz#874bf69c6f404c2b5d99c481341399fd55892633" + integrity sha512-lhd/wF+Lk98HZoTCtlVraHtfh5XYijIjalXck7saUtuanSDyLMxnHhSXEDJqHxD7msR8D0uCmqlkwjCV8xvwHw== + +fast-levenshtein@^2.0.6: + version "2.0.6" + resolved "https://registry.yarnpkg.com/fast-levenshtein/-/fast-levenshtein-2.0.6.tgz#3d8a5c66883a16a30ca8643e851f19baa7797917" + integrity sha512-DCXu6Ifhqcks7TZKY3Hxp3y6qphY5SJZmrWMDrKcERSOXWQdMhU9Ig/PYrzyw/ul9jOIyh0N4M0tbC5hodg8dw== + +fastq@^1.6.0: + version "1.15.0" + resolved "https://registry.yarnpkg.com/fastq/-/fastq-1.15.0.tgz#d04d07c6a2a68fe4599fea8d2e103a937fae6b3a" + integrity sha512-wBrocU2LCXXa+lWBt8RoIRD89Fi8OdABODa/kEnyeyjS5aZO5/GNvI5sEINADqP/h8M29UHTHUb53sUu5Ihqdw== + dependencies: + reusify "^1.0.4" + +fb-watchman@^2.0.0: + version "2.0.2" + resolved "https://registry.yarnpkg.com/fb-watchman/-/fb-watchman-2.0.2.tgz#e9524ee6b5c77e9e5001af0f85f3adbb8623255c" + integrity sha512-p5161BqbuCaSnB8jIbzQHOlpgsPmK5rJVDfDKO91Axs5NC1uu3HRQm6wt9cd9/+GtQQIO53JdGXXoyDpTAsgYA== + dependencies: + bser "2.1.1" + +figures@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/figures/-/figures-2.0.0.tgz#3ab1a2d2a62c8bfb431a0c94cb797a2fce27c962" + integrity sha512-Oa2M9atig69ZkfwiApY8F2Yy+tzMbazyvqv21R0NsSC8floSOC09BbT1ITWAdoMGQvJ/aZnR1KMwdx9tvHnTNA== + dependencies: + escape-string-regexp "^1.0.5" + +file-entry-cache@^6.0.1: + version "6.0.1" + resolved "https://registry.yarnpkg.com/file-entry-cache/-/file-entry-cache-6.0.1.tgz#211b2dd9659cb0394b073e7323ac3c933d522027" + integrity sha512-7Gps/XWymbLk2QLYK4NzpMOrYjMhdIxXuIvy2QBsLE6ljuodKvdkWs/cpyJJ3CVIVpH0Oi1Hvg1ovbMzLdFBBg== + dependencies: + flat-cache "^3.0.4" + +fill-range@^7.0.1: + version "7.0.1" + resolved "https://registry.yarnpkg.com/fill-range/-/fill-range-7.0.1.tgz#1919a6a7c75fe38b2c7c77e5198535da9acdda40" + integrity sha512-qOo9F+dMUmC2Lcb4BbVvnKJxTPjCm+RRpe4gDuGrzkL7mEVl/djYSu2OdQ2Pa302N4oqkSg9ir6jaLWJ2USVpQ== + dependencies: + to-regex-range "^5.0.1" + +find-up@^4.1.0: + version "4.1.0" + resolved "https://registry.yarnpkg.com/find-up/-/find-up-4.1.0.tgz#97afe7d6cdc0bc5928584b7c8d7b16e8a9aa5d19" + integrity sha512-PpOwAdQ/YlXQ2vj8a3h8IipDuYRi3wceVQQGYWxNINccq40Anw7BlsEXCMbt1Zt+OLA6Fq9suIpIWD0OsnISlw== + dependencies: + locate-path "^5.0.0" + path-exists "^4.0.0" + +find-up@^5.0.0: + version "5.0.0" + resolved "https://registry.yarnpkg.com/find-up/-/find-up-5.0.0.tgz#4c92819ecb7083561e4f4a240a86be5198f536fc" + integrity sha512-78/PXT1wlLLDgTzDs7sjq9hzz0vXD+zn+7wypEe4fXQxCmdmqfGsEPQxmiCSQI3ajFV91bVSsvNtrJRiW6nGng== + dependencies: + locate-path "^6.0.0" + path-exists "^4.0.0" + +flat-cache@^3.0.4: + version "3.0.4" + resolved "https://registry.yarnpkg.com/flat-cache/-/flat-cache-3.0.4.tgz#61b0338302b2fe9f957dcc32fc2a87f1c3048b11" + integrity sha512-dm9s5Pw7Jc0GvMYbshN6zchCA9RgQlzzEZX3vylR9IqFfS8XciblUXOKfW6SiuJ0e13eDYZoZV5wdrev7P3Nwg== + dependencies: + flatted "^3.1.0" + rimraf "^3.0.2" + +flatted@^3.1.0: + version "3.2.7" + resolved "https://registry.yarnpkg.com/flatted/-/flatted-3.2.7.tgz#609f39207cb614b89d0765b477cb2d437fbf9787" + integrity sha512-5nqDSxl8nn5BSNxyR3n4I6eDmbolI6WT+QqR547RwxQapgjQBmtktdP+HTBb/a/zLsbzERTONyUB5pefh5TtjQ== + +follow-redirects@^1.14.0: + version "1.15.2" + resolved "https://registry.yarnpkg.com/follow-redirects/-/follow-redirects-1.15.2.tgz#b460864144ba63f2681096f274c4e57026da2c13" + integrity sha512-VQLG33o04KaQ8uYi2tVNbdrWp1QWxNNea+nmIB4EVM28v0hmP17z7aG1+wAkNzVq4KeXTq3221ye5qTJP91JwA== + +fs.realpath@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/fs.realpath/-/fs.realpath-1.0.0.tgz#1504ad2523158caa40db4a2787cb01411994ea4f" + integrity sha512-OO0pH2lK6a0hZnAdau5ItzHPI6pUlvI7jMVnxUQRtw4owF2wk8lOSabtGDCTP4Ggrg2MbGnWO9X8K1t4+fGMDw== + +fsevents@^2.3.2: + version "2.3.2" + resolved "https://registry.yarnpkg.com/fsevents/-/fsevents-2.3.2.tgz#8a526f78b8fdf4623b709e0b975c52c24c02fd1a" + integrity sha512-xiqMQR4xAeHTuB9uWm+fFRcIOgKBMiOBP+eXiyT7jsgVCq1bkVygt00oASowB7EdtpOHaaPgKt812P9ab+DDKA== + +function-bind@^1.1.1: + version "1.1.1" + resolved "https://registry.yarnpkg.com/function-bind/-/function-bind-1.1.1.tgz#a56899d3ea3c9bab874bb9773b7c5ede92f4895d" + integrity sha512-yIovAzMX49sF8Yl58fSCWJ5svSLuaibPxXQJFLmBObTuCr0Mf1KiPopGM9NiFjiYBCbfaa2Fh6breQ6ANVTI0A== + +fuzzy@0.1.3: + version "0.1.3" + resolved "https://registry.yarnpkg.com/fuzzy/-/fuzzy-0.1.3.tgz#4c76ec2ff0ac1a36a9dccf9a00df8623078d4ed8" + integrity sha512-/gZffu4ykarLrCiP3Ygsa86UAo1E5vEVlvTrpkKywXSbP9Xhln3oSp9QSV57gEq3JFFpGJ4GZ+5zdEp3FcUh4w== + +gensync@^1.0.0-beta.2: + version "1.0.0-beta.2" + resolved "https://registry.yarnpkg.com/gensync/-/gensync-1.0.0-beta.2.tgz#32a6ee76c3d7f52d46b2b1ae5d93fea8580a25e0" + integrity sha512-3hN7NaskYvMDLQY55gnW3NQ+mesEAepTqlg+VEbj7zzqEMBVNhzcGYYeqFo/TlYz6eQiFcp1HcsCZO+nGgS8zg== + +get-intrinsic@^1.1.1: + version "1.2.0" + resolved "https://registry.yarnpkg.com/get-intrinsic/-/get-intrinsic-1.2.0.tgz#7ad1dc0535f3a2904bba075772763e5051f6d05f" + integrity sha512-L049y6nFOuom5wGyRc3/gdTLO94dySVKRACj1RmJZBQXlbTMhtNIgkWkUHq+jYmZvKf14EW1EoJnnjbmoHij0Q== + dependencies: + function-bind "^1.1.1" + has "^1.0.3" + has-symbols "^1.0.3" + +get-package-type@^0.1.0: + version "0.1.0" + resolved "https://registry.yarnpkg.com/get-package-type/-/get-package-type-0.1.0.tgz#8de2d803cff44df3bc6c456e6668b36c3926e11a" + integrity sha512-pjzuKtY64GYfWizNAJ0fr9VqttZkNiK2iS430LtIHzjBEr6bX8Am2zm4sW4Ro5wjWW5cAlRL1qAMTcXbjNAO2Q== + +get-stdin@^8.0.0: + version "8.0.0" + resolved "https://registry.yarnpkg.com/get-stdin/-/get-stdin-8.0.0.tgz#cbad6a73feb75f6eeb22ba9e01f89aa28aa97a53" + integrity sha512-sY22aA6xchAzprjyqmSEQv4UbAAzRN0L2dQB0NlN5acTTK9Don6nhoc3eAbUnpZiCANAMfd/+40kVdKfFygohg== + +glob-parent@^5.1.2: + version "5.1.2" + resolved "https://registry.yarnpkg.com/glob-parent/-/glob-parent-5.1.2.tgz#869832c58034fe68a4093c17dc15e8340d8401c4" + integrity sha512-AOIgSQCepiJYwP3ARnGx+5VnTu2HBYdzbGP45eLw1vr3zB3vZLeyed1sC9hnbcOc9/SrMyM5RPQrkGz4aS9Zow== + dependencies: + is-glob "^4.0.1" + +glob-parent@^6.0.2: + version "6.0.2" + resolved "https://registry.yarnpkg.com/glob-parent/-/glob-parent-6.0.2.tgz#6d237d99083950c79290f24c7642a3de9a28f9e3" + integrity sha512-XxwI8EOhVQgWp6iDL+3b0r86f4d6AX6zSU55HfB4ydCEuXLXc5FcYeOu+nnGftS4TEju/11rt4KJPTMgbfmv4A== + dependencies: + is-glob "^4.0.3" + +glob-promise@^4.2.2: + version "4.2.2" + resolved "https://registry.yarnpkg.com/glob-promise/-/glob-promise-4.2.2.tgz#15f44bcba0e14219cd93af36da6bb905ff007877" + integrity sha512-xcUzJ8NWN5bktoTIX7eOclO1Npxd/dyVqUJxlLIDasT4C7KZyqlPIwkdJ0Ypiy3p2ZKahTjK4M9uC3sNSfNMzw== + dependencies: + "@types/glob" "^7.1.3" + +glob@8.0.3: + version "8.0.3" + resolved "https://registry.yarnpkg.com/glob/-/glob-8.0.3.tgz#415c6eb2deed9e502c68fa44a272e6da6eeca42e" + integrity sha512-ull455NHSHI/Y1FqGaaYFaLGkNMMJbavMrEGFXG/PGrg6y7sutWHUHrz6gy6WEBH6akM1M414dWKCNs+IhKdiQ== + dependencies: + fs.realpath "^1.0.0" + inflight "^1.0.4" + inherits "2" + minimatch "^5.0.1" + once "^1.3.0" + +glob@^7.0.0, glob@^7.1.3, glob@^7.1.4, glob@^7.1.6: + version "7.2.3" + resolved "https://registry.yarnpkg.com/glob/-/glob-7.2.3.tgz#b8df0fb802bbfa8e89bd1d938b4e16578ed44f2b" + integrity sha512-nFR0zLpU2YCaRxwoCJvL6UvCH2JFyFVIvwTLsIf21AuHlMskA1hhTdk+LlYJtOlYt9v6dvszD2BGRqBL+iQK9Q== + dependencies: + fs.realpath "^1.0.0" + inflight "^1.0.4" + inherits "2" + minimatch "^3.1.1" + once "^1.3.0" + path-is-absolute "^1.0.0" + +globals@^11.1.0: + version "11.12.0" + resolved "https://registry.yarnpkg.com/globals/-/globals-11.12.0.tgz#ab8795338868a0babd8525758018c2a7eb95c42e" + integrity sha512-WOBp/EEGUiIsJSp7wcv/y6MO+lV9UoncWqxuFfm8eBwzWNgyfBd6Gz+IeKQ9jCmyhoH99g15M3T+QaVHFjizVA== + +globals@^13.19.0: + version "13.19.0" + resolved "https://registry.yarnpkg.com/globals/-/globals-13.19.0.tgz#7a42de8e6ad4f7242fbcca27ea5b23aca367b5c8" + integrity sha512-dkQ957uSRWHw7CFXLUtUHQI3g3aWApYhfNR2O6jn/907riyTYKVBmxYVROkBcY614FSSeSJh7Xm7SrUWCxvJMQ== + dependencies: + type-fest "^0.20.2" + +globalthis@^1.0.1: + version "1.0.3" + resolved "https://registry.yarnpkg.com/globalthis/-/globalthis-1.0.3.tgz#5852882a52b80dc301b0660273e1ed082f0b6ccf" + integrity sha512-sFdI5LyBiNTHjRd7cGPWapiHWMOXKyuBNX/cWJ3NfzrZQVa8GI/8cofCl74AOVqq9W5kNmguTIzJ/1s2gyI9wA== + dependencies: + define-properties "^1.1.3" + +globby@^11.1.0: + version "11.1.0" + resolved "https://registry.yarnpkg.com/globby/-/globby-11.1.0.tgz#bd4be98bb042f83d796f7e3811991fbe82a0d34b" + integrity sha512-jhIXaOzy1sb8IyocaruWSn1TjmnBVs8Ayhcy83rmxNJ8q2uWKCAj3CnJY+KpGSXCueAPc0i05kVvVKtP1t9S3g== + dependencies: + array-union "^2.1.0" + dir-glob "^3.0.1" + fast-glob "^3.2.9" + ignore "^5.2.0" + merge2 "^1.4.1" + slash "^3.0.0" + +graceful-fs@^4.1.15, graceful-fs@^4.2.9: + version "4.2.10" + resolved "https://registry.yarnpkg.com/graceful-fs/-/graceful-fs-4.2.10.tgz#147d3a006da4ca3ce14728c7aefc287c367d7a6c" + integrity sha512-9ByhssR2fPVsNZj478qUUbKfmL0+t5BDVyjShtyZZLiK7ZDAArFFfopyOTj0M05wE2tJPisA4iTnnXl2YoPvOA== + +grapheme-splitter@^1.0.4: + version "1.0.4" + resolved "https://registry.yarnpkg.com/grapheme-splitter/-/grapheme-splitter-1.0.4.tgz#9cf3a665c6247479896834af35cf1dbb4400767e" + integrity sha512-bzh50DW9kTPM00T8y4o8vQg89Di9oLJVLW/KaOGIXJWP/iqCN6WKYkbNOF04vFLJhwcpYUh9ydh/+5vpOqV4YQ== + +has-ansi@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/has-ansi/-/has-ansi-2.0.0.tgz#34f5049ce1ecdf2b0649af3ef24e45ed35416d91" + integrity sha512-C8vBJ8DwUCx19vhm7urhTuUsr4/IyP6l4VzNQDv+ryHQObW3TTTp9yB68WpYgRe2bbaGuZ/se74IqFeVnMnLZg== + dependencies: + ansi-regex "^2.0.0" + +has-flag@^3.0.0: + version "3.0.0" + resolved "https://registry.yarnpkg.com/has-flag/-/has-flag-3.0.0.tgz#b5d454dc2199ae225699f3467e5a07f3b955bafd" + integrity sha512-sKJf1+ceQBr4SMkvQnBDNDtf4TXpVhVGateu0t918bl30FnbE2m4vNLX+VWe/dpjlb+HugGYzW7uQXH98HPEYw== + +has-flag@^4.0.0: + version "4.0.0" + resolved "https://registry.yarnpkg.com/has-flag/-/has-flag-4.0.0.tgz#944771fd9c81c81265c4d6941860da06bb59479b" + integrity sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ== + +has-property-descriptors@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/has-property-descriptors/-/has-property-descriptors-1.0.0.tgz#610708600606d36961ed04c196193b6a607fa861" + integrity sha512-62DVLZGoiEBDHQyqG4w9xCuZ7eJEwNmJRWw2VY84Oedb7WFcA27fiEVe8oUQx9hAUJ4ekurquucTGwsyO1XGdQ== + dependencies: + get-intrinsic "^1.1.1" + +has-symbols@^1.0.3: + version "1.0.3" + resolved "https://registry.yarnpkg.com/has-symbols/-/has-symbols-1.0.3.tgz#bb7b2c4349251dce87b125f7bdf874aa7c8b39f8" + integrity sha512-l3LCuF6MgDNwTDKkdYGEihYjt5pRPbEg46rtlmnSPlUbgmB8LOIrKJbYYFBSbnPaJexMKtiPO8hmeRjRz2Td+A== + +has@^1.0.3: + version "1.0.3" + resolved "https://registry.yarnpkg.com/has/-/has-1.0.3.tgz#722d7cbfc1f6aa8241f16dd814e011e1f41e8796" + integrity sha512-f2dvO0VU6Oej7RkWJGrehjbzMAjFp5/VKPp5tTpWIV4JHHZK1/BxbFRtf/siA2SWTe09caDmVtYYzWEIbBS4zw== + dependencies: + function-bind "^1.1.1" + +hash.js@^1.0.0, hash.js@^1.0.3: + version "1.1.7" + resolved "https://registry.yarnpkg.com/hash.js/-/hash.js-1.1.7.tgz#0babca538e8d4ee4a0f8988d68866537a003cf42" + integrity sha512-taOaskGt4z4SOANNseOviYDvjEJinIkRgmp7LbKP2YTTmVxWBl87s/uzK9r+44BclBSp2X7K1hqeNfz9JbBeXA== + dependencies: + inherits "^2.0.3" + minimalistic-assert "^1.0.1" + +hmac-drbg@^1.0.1: + version "1.0.1" + resolved "https://registry.yarnpkg.com/hmac-drbg/-/hmac-drbg-1.0.1.tgz#d2745701025a6c775a6c545793ed502fc0c649a1" + integrity sha512-Tti3gMqLdZfhOQY1Mzf/AanLiqh1WTiJgEj26ZuYQ9fbkLomzGchCws4FyrSd4VkpBfiNhaE1On+lOz894jvXg== + dependencies: + hash.js "^1.0.3" + minimalistic-assert "^1.0.0" + minimalistic-crypto-utils "^1.0.1" + +iconv-lite@^0.4.17, iconv-lite@^0.4.24: + version "0.4.24" + resolved "https://registry.yarnpkg.com/iconv-lite/-/iconv-lite-0.4.24.tgz#2022b4b25fbddc21d2f524974a474aafe733908b" + integrity sha512-v3MXnZAcvnywkTUEZomIActle7RXXeedOR31wwl7VlyoXO4Qi9arvSenNQWne1TcRwhCL1HwLI21bEqdpj8/rA== + dependencies: + safer-buffer ">= 2.1.2 < 3" + +ignore@^5.2.0: + version "5.2.4" + resolved "https://registry.yarnpkg.com/ignore/-/ignore-5.2.4.tgz#a291c0c6178ff1b960befe47fcdec301674a6324" + integrity sha512-MAb38BcSbH0eHNBxn7ql2NH/kX33OkB3lZ1BNdh7ENeRChHTYsTvWrMubiIAMNS2llXEEgZ1MUOBtXChP3kaFQ== + +import-fresh@^3.0.0, import-fresh@^3.2.1: + version "3.3.0" + resolved "https://registry.yarnpkg.com/import-fresh/-/import-fresh-3.3.0.tgz#37162c25fcb9ebaa2e6e53d5b4d88ce17d9e0c2b" + integrity sha512-veYYhQa+D1QBKznvhUHxb8faxlrwUnxseDAbAp457E0wLNio2bOSKnjYDhMj+YiAq61xrMGhQk9iXVk5FzgQMw== + dependencies: + parent-module "^1.0.0" + resolve-from "^4.0.0" + +imurmurhash@^0.1.4: + version "0.1.4" + resolved "https://registry.yarnpkg.com/imurmurhash/-/imurmurhash-0.1.4.tgz#9218b9b2b928a238b13dc4fb6b6d576f231453ea" + integrity sha512-JmXMZ6wuvDmLiHEml9ykzqO6lwFbof0GG4IkcGaENdCRDDmMVnny7s5HsIgHCbaq0w2MyPhDqkhTUgS2LU2PHA== + +inflight@^1.0.4: + version "1.0.6" + resolved "https://registry.yarnpkg.com/inflight/-/inflight-1.0.6.tgz#49bd6331d7d02d0c09bc910a1075ba8165b56df9" + integrity sha512-k92I/b08q4wvFscXCLvqfsHCrjrF7yiXsQuIVvVE7N82W3+aqpzuUdBbfhWcy/FZR3/4IgflMgKLOsvPDrGCJA== + dependencies: + once "^1.3.0" + wrappy "1" + +inherits@2, inherits@^2.0.3, inherits@^2.0.4: + version "2.0.4" + resolved "https://registry.yarnpkg.com/inherits/-/inherits-2.0.4.tgz#0fa2c64f932917c3433a0ded55363aae37416b7c" + integrity sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ== + +inherits@2.0.3: + version "2.0.3" + resolved "https://registry.yarnpkg.com/inherits/-/inherits-2.0.3.tgz#633c2c83e3da42a502f52466022480f4208261de" + integrity sha512-x00IRNXNy63jwGkJmzPigoySHbaqpNuzKbBOmzK+g2OdZpQ9w+sxCN+VSB3ja7IAge2OP2qpfxTjeNcyjmW1uw== + +inquirer-autocomplete-prompt@^0.11.1: + version "0.11.1" + resolved "https://registry.yarnpkg.com/inquirer-autocomplete-prompt/-/inquirer-autocomplete-prompt-0.11.1.tgz#f90ca9510a4c489882e9be294934bd8c2e575e09" + integrity sha512-VM4eNiyRD4CeUc2cyKni+F8qgHwL9WC4LdOr+mEC85qP/QNsDV+ysVqUrJYhw1TmDQu1QVhc8hbaL7wfk8SJxw== + dependencies: + ansi-escapes "^2.0.0" + chalk "^1.1.3" + figures "^2.0.0" + inquirer "3.1.1" + lodash "^4.17.4" + run-async "^2.3.0" + util "^0.10.3" + +inquirer@3.1.1: + version "3.1.1" + resolved "https://registry.yarnpkg.com/inquirer/-/inquirer-3.1.1.tgz#87621c4fba4072f48a8dd71c9f9df6f100b2d534" + integrity sha512-H50sHQwgvvaTBd3HpKMVtL/u6LoHDvYym51gd7bGQe/+9HkCE+J0/3N5FJLfd6O6oz44hHewC2Pc2LodzWVafQ== + dependencies: + ansi-escapes "^2.0.0" + chalk "^1.0.0" + cli-cursor "^2.1.0" + cli-width "^2.0.0" + external-editor "^2.0.4" + figures "^2.0.0" + lodash "^4.3.0" + mute-stream "0.0.7" + run-async "^2.2.0" + rx-lite "^4.0.8" + rx-lite-aggregates "^4.0.8" + string-width "^2.0.0" + strip-ansi "^3.0.0" + through "^2.3.6" + +inquirer@^6.0.0: + version "6.5.2" + resolved "https://registry.yarnpkg.com/inquirer/-/inquirer-6.5.2.tgz#ad50942375d036d327ff528c08bd5fab089928ca" + integrity sha512-cntlB5ghuB0iuO65Ovoi8ogLHiWGs/5yNrtUcKjFhSSiVeAIVpD7koaSU9RM8mpXw5YDi9RdYXGQMaOURB7ycQ== + dependencies: + ansi-escapes "^3.2.0" + chalk "^2.4.2" + cli-cursor "^2.1.0" + cli-width "^2.0.0" + external-editor "^3.0.3" + figures "^2.0.0" + lodash "^4.17.12" + mute-stream "0.0.7" + run-async "^2.2.0" + rxjs "^6.4.0" + string-width "^2.1.0" + strip-ansi "^5.1.0" + through "^2.3.6" + +inquirerer@0.1.3: + version "0.1.3" + resolved "https://registry.yarnpkg.com/inquirerer/-/inquirerer-0.1.3.tgz#ecf91dc672b3bf45211d7f64bf5e8d5e171fd2ad" + integrity sha512-yGgLUOqPxTsINBjZNZeLi3cv2zgxXtw9feaAOSJf2j6AqIT5Uxs5ZOqOrfAf+xP65Sicla1FD3iDxa3D6TsCAQ== + dependencies: + colors "^1.1.2" + inquirer "^6.0.0" + inquirer-autocomplete-prompt "^0.11.1" + +interpret@^1.0.0: + version "1.4.0" + resolved "https://registry.yarnpkg.com/interpret/-/interpret-1.4.0.tgz#665ab8bc4da27a774a40584e812e3e0fa45b1a1e" + integrity sha512-agE4QfB2Lkp9uICn7BAqoscw4SZP9kTE2hxiFI3jBPmXJfdqiahTbUuKGsMoN2GtqL9AxhYioAcVvgsb1HvRbA== + +is-core-module@^2.9.0: + version "2.11.0" + resolved "https://registry.yarnpkg.com/is-core-module/-/is-core-module-2.11.0.tgz#ad4cb3e3863e814523c96f3f58d26cc570ff0144" + integrity sha512-RRjxlvLDkD1YJwDbroBHMb+cukurkDWNyHx7D3oNB5x9rb5ogcksMC5wHCadcXoo67gVr/+3GFySh3134zi6rw== + dependencies: + has "^1.0.3" + +is-extglob@^2.1.1: + version "2.1.1" + resolved "https://registry.yarnpkg.com/is-extglob/-/is-extglob-2.1.1.tgz#a88c02535791f02ed37c76a1b9ea9773c833f8c2" + integrity sha512-SbKbANkN603Vi4jEZv49LeVJMn4yGwsbzZworEoyEiutsN3nJYdbO36zfhGJ6QEDpOZIFkDtnq5JRxmvl3jsoQ== + +is-fullwidth-code-point@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/is-fullwidth-code-point/-/is-fullwidth-code-point-2.0.0.tgz#a3b30a5c4f199183167aaab93beefae3ddfb654f" + integrity sha512-VHskAKYM8RfSFXwee5t5cbN5PZeq1Wrh6qd5bkyiXIf6UQcN6w/A0eXM9r6t8d+GYOh+o6ZhiEnb88LN/Y8m2w== + +is-glob@^4.0.0, is-glob@^4.0.1, is-glob@^4.0.3: + version "4.0.3" + resolved "https://registry.yarnpkg.com/is-glob/-/is-glob-4.0.3.tgz#64f61e42cbbb2eec2071a9dac0b28ba1e65d5084" + integrity sha512-xelSayHH36ZgE7ZWhli7pW34hNbNl8Ojv5KVmkJD4hBdD3th8Tfk9vYasLM+mXWOZhFkgZfxhLSnrwRr4elSSg== + dependencies: + is-extglob "^2.1.1" + +is-number@^7.0.0: + version "7.0.0" + resolved "https://registry.yarnpkg.com/is-number/-/is-number-7.0.0.tgz#7535345b896734d5f80c4d06c50955527a14f12b" + integrity sha512-41Cifkg6e8TylSpdtTpeLVMqvSBEVzTttHvERD741+pnZ8ANv0004MRL43QKPDlK9cGvNp6NZWZUBlbGXYxxng== + +is-path-inside@^3.0.3: + version "3.0.3" + resolved "https://registry.yarnpkg.com/is-path-inside/-/is-path-inside-3.0.3.tgz#d231362e53a07ff2b0e0ea7fed049161ffd16283" + integrity sha512-Fd4gABb+ycGAmKou8eMftCupSir5lRxqf4aD/vd0cD2qc4HL07OjCeuHMr8Ro4CoMaeCKDB0/ECBOVWjTwUvPQ== + +is-promise@^2.2.2: + version "2.2.2" + resolved "https://registry.yarnpkg.com/is-promise/-/is-promise-2.2.2.tgz#39ab959ccbf9a774cf079f7b40c7a26f763135f1" + integrity sha512-+lP4/6lKUBfQjZ2pdxThZvLUAafmZb8OAxFb8XXtiQmS35INgr85hdOGoEs124ez1FCnZJt6jau/T+alh58QFQ== + +is-stream@^2.0.0: + version "2.0.1" + resolved "https://registry.yarnpkg.com/is-stream/-/is-stream-2.0.1.tgz#fac1e3d53b97ad5a9d0ae9cef2389f5810a5c077" + integrity sha512-hFoiJiTl63nn+kstHGBtewWSKnQLpyb155KHheA1l39uvtO9nWIop1p3udqPcUd/xbF1VLMO4n7OI6p7RbngDg== + +isexe@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/isexe/-/isexe-2.0.0.tgz#e8fbf374dc556ff8947a10dcb0572d633f2cfa10" + integrity sha512-RHxMLp9lnKHGHRng9QFhRCMbYAcVpn69smSGcq3f36xjgVVWThj4qqLbTLlq7Ssj8B+fIQ1EuCEGI2lKsyQeIw== + +isomorphic-ws@^4.0.1: + version "4.0.1" + resolved "https://registry.yarnpkg.com/isomorphic-ws/-/isomorphic-ws-4.0.1.tgz#55fd4cd6c5e6491e76dc125938dd863f5cd4f2dc" + integrity sha512-BhBvN2MBpWTaSHdWRb/bwdZJ1WaehQ2L1KngkCkfLUGF0mAWAT1sQUQacEmQ0jXkFw/czDXPNQSL5u2/Krsz1w== + +istanbul-lib-coverage@^3.2.0: + version "3.2.0" + resolved "https://registry.yarnpkg.com/istanbul-lib-coverage/-/istanbul-lib-coverage-3.2.0.tgz#189e7909d0a39fa5a3dfad5b03f71947770191d3" + integrity sha512-eOeJ5BHCmHYvQK7xt9GkdHuzuCGS1Y6g9Gvnx3Ym33fz/HpLRYxiS0wHNr+m/MBC8B647Xt608vCDEvhl9c6Mw== + +istanbul-lib-instrument@^5.0.4: + version "5.2.1" + resolved "https://registry.yarnpkg.com/istanbul-lib-instrument/-/istanbul-lib-instrument-5.2.1.tgz#d10c8885c2125574e1c231cacadf955675e1ce3d" + integrity sha512-pzqtp31nLv/XFOzXGuvhCb8qhjmTVo5vjVk19XE4CRlSWz0KoeJ3bw9XsA7nOp9YBf4qHjwBxkDzKcME/J29Yg== + dependencies: + "@babel/core" "^7.12.3" + "@babel/parser" "^7.14.7" + "@istanbuljs/schema" "^0.1.2" + istanbul-lib-coverage "^3.2.0" + semver "^6.3.0" + +jest-haste-map@^28.1.3: + version "28.1.3" + resolved "https://registry.yarnpkg.com/jest-haste-map/-/jest-haste-map-28.1.3.tgz#abd5451129a38d9841049644f34b034308944e2b" + integrity sha512-3S+RQWDXccXDKSWnkHa/dPwt+2qwA8CJzR61w3FoYCvoo3Pn8tvGcysmMF0Bj0EX5RYvAI2EIvC57OmotfdtKA== + dependencies: + "@jest/types" "^28.1.3" + "@types/graceful-fs" "^4.1.3" + "@types/node" "*" + anymatch "^3.0.3" + fb-watchman "^2.0.0" + graceful-fs "^4.2.9" + jest-regex-util "^28.0.2" + jest-util "^28.1.3" + jest-worker "^28.1.3" + micromatch "^4.0.4" + walker "^1.0.8" + optionalDependencies: + fsevents "^2.3.2" + +jest-regex-util@^28.0.2: + version "28.0.2" + resolved "https://registry.yarnpkg.com/jest-regex-util/-/jest-regex-util-28.0.2.tgz#afdc377a3b25fb6e80825adcf76c854e5bf47ead" + integrity sha512-4s0IgyNIy0y9FK+cjoVYoxamT7Zeo7MhzqRGx7YDYmaQn1wucY9rotiGkBzzcMXTtjrCAP/f7f+E0F7+fxPNdw== + +jest-util@^28.1.3: + version "28.1.3" + resolved "https://registry.yarnpkg.com/jest-util/-/jest-util-28.1.3.tgz#f4f932aa0074f0679943220ff9cbba7e497028b0" + integrity sha512-XdqfpHwpcSRko/C35uLYFM2emRAltIIKZiJ9eAmhjsj0CqZMa0p1ib0R5fWIqGhn1a103DebTbpqIaP1qCQ6tQ== + dependencies: + "@jest/types" "^28.1.3" + "@types/node" "*" + chalk "^4.0.0" + ci-info "^3.2.0" + graceful-fs "^4.2.9" + picomatch "^2.2.3" + +jest-worker@^28.1.3: + version "28.1.3" + resolved "https://registry.yarnpkg.com/jest-worker/-/jest-worker-28.1.3.tgz#7e3c4ce3fa23d1bb6accb169e7f396f98ed4bb98" + integrity sha512-CqRA220YV/6jCo8VWvAt1KKx6eek1VIHMPeLEbpcfSfkEeWyBNppynM/o6q+Wmw+sOhos2ml34wZbSX3G13//g== + dependencies: + "@types/node" "*" + merge-stream "^2.0.0" + supports-color "^8.0.0" + +js-sdsl@^4.1.4: + version "4.3.0" + resolved "https://registry.yarnpkg.com/js-sdsl/-/js-sdsl-4.3.0.tgz#aeefe32a451f7af88425b11fdb5f58c90ae1d711" + integrity sha512-mifzlm2+5nZ+lEcLJMoBK0/IH/bDg8XnJfd/Wq6IP+xoCjLZsTOnV2QpxlVbX9bMnkl5PdEjNtBJ9Cj1NjifhQ== + +js-tokens@^4.0.0: + version "4.0.0" + resolved "https://registry.yarnpkg.com/js-tokens/-/js-tokens-4.0.0.tgz#19203fb59991df98e3a287050d4647cdeaf32499" + integrity sha512-RdJUflcE3cUzKiMqQgsCu06FPu9UdIJO0beYbPhHN4k6apgJtifcoCtT9bcxOpYBtpD2kCM6Sbzg4CausW/PKQ== + +js-yaml@^3.13.1: + version "3.14.1" + resolved "https://registry.yarnpkg.com/js-yaml/-/js-yaml-3.14.1.tgz#dae812fdb3825fa306609a8717383c50c36a0537" + integrity sha512-okMH7OXXJ7YrN9Ok3/SXrnu4iX9yOk+25nqX4imS2npuvTYDmo/QEZoqwZkYaIDk3jVvBOTOIEgEhaLOynBS9g== + dependencies: + argparse "^1.0.7" + esprima "^4.0.0" + +js-yaml@^4.1.0: + version "4.1.0" + resolved "https://registry.yarnpkg.com/js-yaml/-/js-yaml-4.1.0.tgz#c1fb65f8f5017901cdd2c951864ba18458a10602" + integrity sha512-wpxZs9NoxZaJESJGIZTyDEaYpl0FKSA+FB9aJiyemKhMwkxQg63h4T1KJgUGHpTqPDNRcmmYLugrRjJlBtWvRA== + dependencies: + argparse "^2.0.1" + +jsesc@^2.5.1: + version "2.5.2" + resolved "https://registry.yarnpkg.com/jsesc/-/jsesc-2.5.2.tgz#80564d2e483dacf6e8ef209650a67df3f0c283a4" + integrity sha512-OYu7XEzjkCQ3C5Ps3QIZsQfNpqoJyZZA99wd9aWd05NCtC5pWOkShK2mkL6HXQR6/Cy2lbNdPlZBpuQHXE63gA== + +jsesc@~0.5.0: + version "0.5.0" + resolved "https://registry.yarnpkg.com/jsesc/-/jsesc-0.5.0.tgz#e7dee66e35d6fc16f710fe91d5cf69f70f08911d" + integrity sha512-uZz5UnB7u4T9LvwmFqXii7pZSouaRPorGs5who1Ip7VO0wxanFvBL7GkM6dTHlgX+jhBApRetaWpnDabOeTcnA== + +json-schema-traverse@^0.4.1: + version "0.4.1" + resolved "https://registry.yarnpkg.com/json-schema-traverse/-/json-schema-traverse-0.4.1.tgz#69f6a87d9513ab8bb8fe63bdb0979c448e684660" + integrity sha512-xbbCH5dCYU5T8LcEhhuh7HJ88HXuW3qsI3Y0zOZFKfZEHcpWiHU/Jxzk629Brsab/mMiHQti9wMP+845RPe3Vg== + +json-stable-stringify-without-jsonify@^1.0.1: + version "1.0.1" + resolved "https://registry.yarnpkg.com/json-stable-stringify-without-jsonify/-/json-stable-stringify-without-jsonify-1.0.1.tgz#9db7b59496ad3f3cfef30a75142d2d930ad72651" + integrity sha512-Bdboy+l7tA3OGW6FjyFHWkP5LuByj1Tk33Ljyq0axyzdk9//JSi2u3fP1QSmd1KNwq6VOKYGlAu87CisVir6Pw== + +json5@^2.2.1, json5@^2.2.2: + version "2.2.3" + resolved "https://registry.yarnpkg.com/json5/-/json5-2.2.3.tgz#78cd6f1a19bdc12b73db5ad0c61efd66c1e29283" + integrity sha512-XmOWe7eyHYH14cLdVPoyg+GOH3rYX++KpzrylJwSW98t3Nk+U8XOl8FWKOgwtzdb8lXGf6zYwDUzeHMWfxasyg== + +levn@^0.4.1: + version "0.4.1" + resolved "https://registry.yarnpkg.com/levn/-/levn-0.4.1.tgz#ae4562c007473b932a6200d403268dd2fffc6ade" + integrity sha512-+bT2uH4E5LGE7h/n3evcS/sQlJXCpIp6ym8OWJ5eV6+67Dsql/LaaT7qJBAt2rzfoa/5QBGBhxDix1dMt2kQKQ== + dependencies: + prelude-ls "^1.2.1" + type-check "~0.4.0" + +libsodium-wrappers@^0.7.6: + version "0.7.10" + resolved "https://registry.yarnpkg.com/libsodium-wrappers/-/libsodium-wrappers-0.7.10.tgz#13ced44cacb0fc44d6ac9ce67d725956089ce733" + integrity sha512-pO3F1Q9NPLB/MWIhehim42b/Fwb30JNScCNh8TcQ/kIc+qGLQch8ag8wb0keK3EP5kbGakk1H8Wwo7v+36rNQg== + dependencies: + libsodium "^0.7.0" + +libsodium@^0.7.0: + version "0.7.10" + resolved "https://registry.yarnpkg.com/libsodium/-/libsodium-0.7.10.tgz#c2429a7e4c0836f879d701fec2c8a208af024159" + integrity sha512-eY+z7hDrDKxkAK+QKZVNv92A5KYkxfvIshtBJkmg5TSiCnYqZP3i9OO9whE79Pwgm4jGaoHgkM4ao/b9Cyu4zQ== + +locate-path@^5.0.0: + version "5.0.0" + resolved "https://registry.yarnpkg.com/locate-path/-/locate-path-5.0.0.tgz#1afba396afd676a6d42504d0a67a3a7eb9f62aa0" + integrity sha512-t7hw9pI+WvuwNJXwk5zVHpyhIqzg2qTlklJOf0mVxGSbe3Fp2VieZcduNYjaLDoy6p9uGpQEGWG87WpMKlNq8g== + dependencies: + p-locate "^4.1.0" + +locate-path@^6.0.0: + version "6.0.0" + resolved "https://registry.yarnpkg.com/locate-path/-/locate-path-6.0.0.tgz#55321eb309febbc59c4801d931a72452a681d286" + integrity sha512-iPZK6eYjbxRu3uB4/WZ3EsEIMJFMqAoopl3R+zuq0UjcAm/MO6KCweDgPfP3elTztoKP3KtnVHxTn2NHBSDVUw== + dependencies: + p-locate "^5.0.0" + +lodash.debounce@^4.0.8: + version "4.0.8" + resolved "https://registry.yarnpkg.com/lodash.debounce/-/lodash.debounce-4.0.8.tgz#82d79bff30a67c4005ffd5e2515300ad9ca4d7af" + integrity sha512-FT1yDzDYEoYWhnSGnpE/4Kj1fLZkDFyqRb7fNt6FdYOSxlUWAtp42Eh6Wb0rGIv/m9Bgo7x4GhQbm5Ys4SG5ow== + +lodash.merge@^4.6.2: + version "4.6.2" + resolved "https://registry.yarnpkg.com/lodash.merge/-/lodash.merge-4.6.2.tgz#558aa53b43b661e1925a0afdfa36a9a1085fe57a" + integrity sha512-0KpjqXRVvrYyCsX1swR/XTK0va6VQkQM6MNo7PqW77ByjAhoARA8EfrP1N4+KlKj8YS0ZUCtRT/YUuhyYDujIQ== + +lodash@^4.17.12, lodash@^4.17.21, lodash@^4.17.4, lodash@^4.3.0: + version "4.17.21" + resolved "https://registry.yarnpkg.com/lodash/-/lodash-4.17.21.tgz#679591c564c3bffaae8454cf0b3df370c3d6911c" + integrity sha512-v2kDEe57lecTulaDIuNTPy3Ry4gLGJ6Z1O3vE1krgXZNrsQ+LFTGHVxVjcXPs17LhbZVGedAJv8XZ1tvj5FvSg== + +long@^4.0.0: + version "4.0.0" + resolved "https://registry.yarnpkg.com/long/-/long-4.0.0.tgz#9a7b71cfb7d361a194ea555241c92f7468d5bf28" + integrity sha512-XsP+KhQif4bjX1kbuSiySJFNAehNxgLb6hPRGJ9QsUr8ajHkuXGdrHmFUTUUXhDwVX2R5bY4JNZEwbUiMhV+MA== + +long@^5.2.0: + version "5.2.1" + resolved "https://registry.yarnpkg.com/long/-/long-5.2.1.tgz#e27595d0083d103d2fa2c20c7699f8e0c92b897f" + integrity sha512-GKSNGeNAtw8IryjjkhZxuKB3JzlcLTwjtiQCHKvqQet81I93kXslhDQruGI/QsddO83mcDToBVy7GqGS/zYf/A== + +lru-cache@^5.1.1: + version "5.1.1" + resolved "https://registry.yarnpkg.com/lru-cache/-/lru-cache-5.1.1.tgz#1da27e6710271947695daf6848e847f01d84b920" + integrity sha512-KpNARQA3Iwv+jTA0utUVVbrh+Jlrr1Fv0e56GGzAFOXN7dk/FviaDW8LHmK52DlcH4WP2n6gI8vN1aesBFgo9w== + dependencies: + yallist "^3.0.2" + +lru-cache@^6.0.0: + version "6.0.0" + resolved "https://registry.yarnpkg.com/lru-cache/-/lru-cache-6.0.0.tgz#6d6fe6570ebd96aaf90fcad1dafa3b2566db3a94" + integrity sha512-Jo6dJ04CmSjuznwJSS3pUeWmd/H0ffTlkXXgwZi+eq1UCmqQwCh+eLsYOYCwY991i2Fah4h1BEMCx4qThGbsiA== + dependencies: + yallist "^4.0.0" + +lru-queue@^0.1.0: + version "0.1.0" + resolved "https://registry.yarnpkg.com/lru-queue/-/lru-queue-0.1.0.tgz#2738bd9f0d3cf4f84490c5736c48699ac632cda3" + integrity sha512-BpdYkt9EvGl8OfWHDQPISVpcl5xZthb+XPsbELj5AQXxIC8IriDZIQYjBJPEm5rS420sjZ0TLEzRcq5KdBhYrQ== + dependencies: + es5-ext "~0.10.2" + +make-dir@^3.0.0: + version "3.1.0" + resolved "https://registry.yarnpkg.com/make-dir/-/make-dir-3.1.0.tgz#415e967046b3a7f1d185277d84aa58203726a13f" + integrity sha512-g3FeP20LNwhALb/6Cz6Dd4F2ngze0jz7tbzrD2wAV+o9FeNHe4rL+yK2md0J/fiSf1sa1ADhXqi5+oVwOM/eGw== + dependencies: + semver "^6.0.0" + +makeerror@1.0.12: + version "1.0.12" + resolved "https://registry.yarnpkg.com/makeerror/-/makeerror-1.0.12.tgz#3e5dd2079a82e812e983cc6610c4a2cb0eaa801a" + integrity sha512-JmqCvUhmt43madlpFzG4BQzG2Z3m6tvQDNKdClZnO3VbIudJYmxsT0FNJMeiB2+JTSlTQTSbU8QdesVmwJcmLg== + dependencies: + tmpl "1.0.5" + +memoizee@^0.4.15: + version "0.4.15" + resolved "https://registry.yarnpkg.com/memoizee/-/memoizee-0.4.15.tgz#e6f3d2da863f318d02225391829a6c5956555b72" + integrity sha512-UBWmJpLZd5STPm7PMUlOw/TSy972M+z8gcyQ5veOnSDRREz/0bmpyTfKt3/51DhEBqCZQn1udM/5flcSPYhkdQ== + dependencies: + d "^1.0.1" + es5-ext "^0.10.53" + es6-weak-map "^2.0.3" + event-emitter "^0.3.5" + is-promise "^2.2.2" + lru-queue "^0.1.0" + next-tick "^1.1.0" + timers-ext "^0.1.7" + +merge-stream@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/merge-stream/-/merge-stream-2.0.0.tgz#52823629a14dd00c9770fb6ad47dc6310f2c1f60" + integrity sha512-abv/qOcuPfk3URPfDzmZU1LKmuw8kT+0nIHvKrKgFrwifol/doWcdA4ZqsWQ8ENrFKkd67Mfpo/LovbIUsbt3w== + +merge2@^1.3.0, merge2@^1.4.1: + version "1.4.1" + resolved "https://registry.yarnpkg.com/merge2/-/merge2-1.4.1.tgz#4368892f885e907455a6fd7dc55c0c9d404990ae" + integrity sha512-8q7VEgMJW4J8tcfVPy8g09NcQwZdbwFEqhe/WZkoIzjn/3TGDwtOCYtXGxA3O8tPzpczCCDgv+P2P5y00ZJOOg== + +micromatch@^4.0.4: + version "4.0.5" + resolved "https://registry.yarnpkg.com/micromatch/-/micromatch-4.0.5.tgz#bc8999a7cbbf77cdc89f132f6e467051b49090c6" + integrity sha512-DMy+ERcEW2q8Z2Po+WNXuw3c5YaUSFjAO5GsJqfEl7UjvtIuFKO6ZrKvcItdy98dwFI2N1tg3zNIdKaQT+aNdA== + dependencies: + braces "^3.0.2" + picomatch "^2.3.1" + +mimic-fn@^1.0.0: + version "1.2.0" + resolved "https://registry.yarnpkg.com/mimic-fn/-/mimic-fn-1.2.0.tgz#820c86a39334640e99516928bd03fca88057d022" + integrity sha512-jf84uxzwiuiIVKiOLpfYk7N46TSy8ubTonmneY9vrpHNAnp0QBt2BxWV9dO3/j+BoVAb+a5G6YDPW3M5HOdMWQ== + +minimalistic-assert@^1.0.0, minimalistic-assert@^1.0.1: + version "1.0.1" + resolved "https://registry.yarnpkg.com/minimalistic-assert/-/minimalistic-assert-1.0.1.tgz#2e194de044626d4a10e7f7fbc00ce73e83e4d5c7" + integrity sha512-UtJcAD4yEaGtjPezWuO9wC4nwUnVH/8/Im3yEHQP4b67cXlD/Qr9hdITCU1xDbSEXg2XKNaP8jsReV7vQd00/A== + +minimalistic-crypto-utils@^1.0.1: + version "1.0.1" + resolved "https://registry.yarnpkg.com/minimalistic-crypto-utils/-/minimalistic-crypto-utils-1.0.1.tgz#f6c00c1c0b082246e5c4d99dfb8c7c083b2b582a" + integrity sha512-JIYlbt6g8i5jKfJ3xz7rF0LXmv2TkDxBLUkiBeZ7bAx4GnnNMr8xFpGnOxn6GhTEHx3SjRrZEoU+j04prX1ktg== + +minimatch@^3.0.4, minimatch@^3.0.5, minimatch@^3.1.1, minimatch@^3.1.2: + version "3.1.2" + resolved "https://registry.yarnpkg.com/minimatch/-/minimatch-3.1.2.tgz#19cd194bfd3e428f049a70817c038d89ab4be35b" + integrity sha512-J7p63hRiAjw1NDEww1W7i37+ByIrOWO5XQQAzZ3VOcL0PNybwpfmV/N05zFAzwQ9USyEcX6t3UO+K5aqBQOIHw== + dependencies: + brace-expansion "^1.1.7" + +minimatch@^5.0.1: + version "5.1.6" + resolved "https://registry.yarnpkg.com/minimatch/-/minimatch-5.1.6.tgz#1cfcb8cf5522ea69952cd2af95ae09477f122a96" + integrity sha512-lKwV/1brpG6mBUFHtb7NUmtABCb2WZZmm2wNiOA5hAb8VdCS4B3dtMWyvcoViccwAW/COERjXLt0zP1zXUN26g== + dependencies: + brace-expansion "^2.0.1" + +minimist@1.2.6: + version "1.2.6" + resolved "https://registry.yarnpkg.com/minimist/-/minimist-1.2.6.tgz#8637a5b759ea0d6e98702cfb3a9283323c93af44" + integrity sha512-Jsjnk4bw3YJqYzbdyBiNsPWHPfO++UGG749Cxs6peCu5Xg4nrena6OVxOYxrQTqww0Jmwt+Ref8rggumkTLz9Q== + +minimist@^1.2.6: + version "1.2.7" + resolved "https://registry.yarnpkg.com/minimist/-/minimist-1.2.7.tgz#daa1c4d91f507390437c6a8bc01078e7000c4d18" + integrity sha512-bzfL1YUZsP41gmu/qjrEk0Q6i2ix/cVeAhbCbqH9u3zYutS1cLg00qhrD0M2MVdCcx4Sc0UpP2eBWo9rotpq6g== + +mkdirp@1.0.4, mkdirp@^1.0.4: + version "1.0.4" + resolved "https://registry.yarnpkg.com/mkdirp/-/mkdirp-1.0.4.tgz#3eb5ed62622756d79a5f0e2a221dfebad75c2f7e" + integrity sha512-vVqVZQyf3WLx2Shd0qJ9xuvqgAyKPLAiqITEtqW0oIUjzo3PePDd6fW9iFz30ef7Ysp/oiWqbhszeGWW2T6Gzw== + +ms@2.1.2: + version "2.1.2" + resolved "https://registry.yarnpkg.com/ms/-/ms-2.1.2.tgz#d09d1f357b443f493382a8eb3ccd183872ae6009" + integrity sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w== + +mute-stream@0.0.7: + version "0.0.7" + resolved "https://registry.yarnpkg.com/mute-stream/-/mute-stream-0.0.7.tgz#3075ce93bc21b8fab43e1bc4da7e8115ed1e7bab" + integrity sha512-r65nCZhrbXXb6dXOACihYApHw2Q6pV0M3V0PSxd74N0+D8nzAdEAITq2oAjA1jVnKI+tGvEBUpqiMh0+rW6zDQ== + +mz@^2.7.0: + version "2.7.0" + resolved "https://registry.yarnpkg.com/mz/-/mz-2.7.0.tgz#95008057a56cafadc2bc63dde7f9ff6955948e32" + integrity sha512-z81GNO7nnYMEhrGh9LeymoE4+Yr0Wn5McHIZMK5cfQCl+NDX08sCZgUc9/6MHni9IWuFLm1Z3HTCXu2z9fN62Q== + dependencies: + any-promise "^1.0.0" + object-assign "^4.0.1" + thenify-all "^1.0.0" + +natural-compare-lite@^1.4.0: + version "1.4.0" + resolved "https://registry.yarnpkg.com/natural-compare-lite/-/natural-compare-lite-1.4.0.tgz#17b09581988979fddafe0201e931ba933c96cbb4" + integrity sha512-Tj+HTDSJJKaZnfiuw+iaF9skdPpTo2GtEly5JHnWV/hfv2Qj/9RKsGISQtLh2ox3l5EAGw487hnBee0sIJ6v2g== + +natural-compare@^1.4.0: + version "1.4.0" + resolved "https://registry.yarnpkg.com/natural-compare/-/natural-compare-1.4.0.tgz#4abebfeed7541f2c27acfb29bdbbd15c8d5ba4f7" + integrity sha512-OWND8ei3VtNC9h7V60qff3SVobHr996CTwgxubgyQYEpg290h9J0buyECNNJexkFm5sOajh5G116RYA1c8ZMSw== + +next-tick@1, next-tick@^1.1.0: + version "1.1.0" + resolved "https://registry.yarnpkg.com/next-tick/-/next-tick-1.1.0.tgz#1836ee30ad56d67ef281b22bd199f709449b35eb" + integrity sha512-CXdUiJembsNjuToQvxayPZF9Vqht7hewsvy2sOWafLvi2awflj9mOC6bHIg50orX8IJvWKY9wYQ/zB2kogPslQ== + +node-int64@^0.4.0: + version "0.4.0" + resolved "https://registry.yarnpkg.com/node-int64/-/node-int64-0.4.0.tgz#87a9065cdb355d3182d8f94ce11188b825c68a3b" + integrity sha512-O5lz91xSOeoXP6DulyHfllpq+Eg00MWitZIbtPfoSEvqIHdl5gfcY6hYzDWnj0qD5tz52PI08u9qUvSVeUBeHw== + +node-releases@^2.0.6: + version "2.0.8" + resolved "https://registry.yarnpkg.com/node-releases/-/node-releases-2.0.8.tgz#0f349cdc8fcfa39a92ac0be9bc48b7706292b9ae" + integrity sha512-dFSmB8fFHEH/s81Xi+Y/15DQY6VHW81nXRj86EMSL3lmuTmK1e+aT4wrFCkTbm+gSwkw4KpX+rT/pMM2c1mF+A== + +normalize-path@^3.0.0: + version "3.0.0" + resolved "https://registry.yarnpkg.com/normalize-path/-/normalize-path-3.0.0.tgz#0dcd69ff23a1c9b11fd0978316644a0388216a65" + integrity sha512-6eZs5Ls3WtCisHWp9S2GUy8dqkpGi4BVSz3GaqiE6ezub0512ESztXUwUB6C6IKbQkY2Pnb/mD4WYojCRwcwLA== + +object-assign@^4.0.1: + version "4.1.1" + resolved "https://registry.yarnpkg.com/object-assign/-/object-assign-4.1.1.tgz#2109adc7965887cfc05cbbd442cac8bfbb360863" + integrity sha512-rJgTQnkUnH1sFw8yT6VSU3zD3sWmu6sZhIseY8VX+GRu3P6F7Fu+JNDoXfklElbLJSnc3FUQHVe4cU5hj+BcUg== + +object-keys@^1.1.1: + version "1.1.1" + resolved "https://registry.yarnpkg.com/object-keys/-/object-keys-1.1.1.tgz#1c47f272df277f3b1daf061677d9c82e2322c60e" + integrity sha512-NuAESUOUMrlIXOfHKzD6bpPu3tYt3xvjNdRIQ+FeT0lNb4K8WR70CaDxhuNguS2XG+GjkyMwOzsN5ZktImfhLA== + +once@^1.3.0: + version "1.4.0" + resolved "https://registry.yarnpkg.com/once/-/once-1.4.0.tgz#583b1aa775961d4b113ac17d9c50baef9dd76bd1" + integrity sha512-lNaJgI+2Q5URQBkccEKHTQOPaXdUxnZZElQTZY0MFUAuaEqe1E+Nyvgdz/aIyNi6Z9MzO5dv1H8n58/GELp3+w== + dependencies: + wrappy "1" + +onetime@^2.0.0: + version "2.0.1" + resolved "https://registry.yarnpkg.com/onetime/-/onetime-2.0.1.tgz#067428230fd67443b2794b22bba528b6867962d4" + integrity sha512-oyyPpiMaKARvvcgip+JV+7zci5L8D1W9RZIz2l1o08AM3pfspitVWnPt3mzHcBPp12oYMTy0pqrFs/C+m3EwsQ== + dependencies: + mimic-fn "^1.0.0" + +optionator@^0.9.1: + version "0.9.1" + resolved "https://registry.yarnpkg.com/optionator/-/optionator-0.9.1.tgz#4f236a6373dae0566a6d43e1326674f50c291499" + integrity sha512-74RlY5FCnhq4jRxVUPKDaRwrVNXMqsGsiW6AJw4XK8hmtm10wC0ypZBLw5IIp85NZMr91+qd1RvvENwg7jjRFw== + dependencies: + deep-is "^0.1.3" + fast-levenshtein "^2.0.6" + levn "^0.4.1" + prelude-ls "^1.2.1" + type-check "^0.4.0" + word-wrap "^1.2.3" + +os-tmpdir@~1.0.2: + version "1.0.2" + resolved "https://registry.yarnpkg.com/os-tmpdir/-/os-tmpdir-1.0.2.tgz#bbe67406c79aa85c5cfec766fe5734555dfa1274" + integrity sha512-D2FR03Vir7FIu45XBY20mTb+/ZSWB00sjU9jdQXt83gDrI4Ztz5Fs7/yy74g2N5SVQY4xY1qDr4rNddwYRVX0g== + +p-limit@^2.2.0: + version "2.3.0" + resolved "https://registry.yarnpkg.com/p-limit/-/p-limit-2.3.0.tgz#3dd33c647a214fdfffd835933eb086da0dc21db1" + integrity sha512-//88mFWSJx8lxCzwdAABTJL2MyWB12+eIY7MDL2SqLmAkeKU9qxRvWuSyTjm3FUmpBEMuFfckAIqEaVGUDxb6w== + dependencies: + p-try "^2.0.0" + +p-limit@^3.0.2: + version "3.1.0" + resolved "https://registry.yarnpkg.com/p-limit/-/p-limit-3.1.0.tgz#e1daccbe78d0d1388ca18c64fea38e3e57e3706b" + integrity sha512-TYOanM3wGwNGsZN2cVTYPArw454xnXj5qmWF1bEoAc4+cU/ol7GVh7odevjp1FNHduHc3KZMcFduxU5Xc6uJRQ== + dependencies: + yocto-queue "^0.1.0" + +p-locate@^4.1.0: + version "4.1.0" + resolved "https://registry.yarnpkg.com/p-locate/-/p-locate-4.1.0.tgz#a3428bb7088b3a60292f66919278b7c297ad4f07" + integrity sha512-R79ZZ/0wAxKGu3oYMlz8jy/kbhsNrS7SKZ7PxEHBgJ5+F2mtFW2fK2cOtBh1cHYkQsbzFV7I+EoRKe6Yt0oK7A== + dependencies: + p-limit "^2.2.0" + +p-locate@^5.0.0: + version "5.0.0" + resolved "https://registry.yarnpkg.com/p-locate/-/p-locate-5.0.0.tgz#83c8315c6785005e3bd021839411c9e110e6d834" + integrity sha512-LaNjtRWUBY++zB5nE/NwcaoMylSPk+S+ZHNB1TzdbMJMny6dynpAGt7X/tl/QYq3TIeE6nxHppbo2LGymrG5Pw== + dependencies: + p-limit "^3.0.2" + +p-try@^2.0.0: + version "2.2.0" + resolved "https://registry.yarnpkg.com/p-try/-/p-try-2.2.0.tgz#cb2868540e313d61de58fafbe35ce9004d5540e6" + integrity sha512-R4nPAVTAU0B9D35/Gk3uJf/7XYbQcyohSKdvAxIRSNghFl4e71hVoGnBNQz9cWaXxO2I10KTC+3jMdvvoKw6dQ== + +pako@^2.0.2: + version "2.1.0" + resolved "https://registry.yarnpkg.com/pako/-/pako-2.1.0.tgz#266cc37f98c7d883545d11335c00fbd4062c9a86" + integrity sha512-w+eufiZ1WuJYgPXbV/PO3NCMEc3xqylkKHzp8bxp1uW4qaSNQUkwmLLEc3kKsfz8lpV1F8Ht3U1Cm+9Srog2ug== + +parent-module@^1.0.0: + version "1.0.1" + resolved "https://registry.yarnpkg.com/parent-module/-/parent-module-1.0.1.tgz#691d2709e78c79fae3a156622452d00762caaaa2" + integrity sha512-GQ2EWRpQV8/o+Aw8YqtfZZPfNRWZYkbidE9k5rpl/hC3vtHHBfGm2Ifi6qWV+coDGkrUKZAxE3Lot5kcsRlh+g== + dependencies: + callsites "^3.0.0" + +parse-package-name@1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/parse-package-name/-/parse-package-name-1.0.0.tgz#1a108757e4ffc6889d5e78bcc4932a97c097a5a7" + integrity sha512-kBeTUtcj+SkyfaW4+KBe0HtsloBJ/mKTPoxpVdA57GZiPerREsUWJOhVj9anXweFiJkm5y8FG1sxFZkZ0SN6wg== + +path-exists@^4.0.0: + version "4.0.0" + resolved "https://registry.yarnpkg.com/path-exists/-/path-exists-4.0.0.tgz#513bdbe2d3b95d7762e8c1137efa195c6c61b5b3" + integrity sha512-ak9Qy5Q7jYb2Wwcey5Fpvg2KoAc/ZIhLSLOSBmRmygPsGwkVVt0fZa0qrtMz+m6tJTAHfZQ8FnmB4MG4LWy7/w== + +path-is-absolute@^1.0.0: + version "1.0.1" + resolved "https://registry.yarnpkg.com/path-is-absolute/-/path-is-absolute-1.0.1.tgz#174b9268735534ffbc7ace6bf53a5a9e1b5c5f5f" + integrity sha512-AVbw3UJ2e9bq64vSaS9Am0fje1Pa8pbGqTTsmXfaIiMpnr5DlDhfJOuLj9Sf95ZPVDAUerDfEk88MPmPe7UCQg== + +path-key@^3.1.0: + version "3.1.1" + resolved "https://registry.yarnpkg.com/path-key/-/path-key-3.1.1.tgz#581f6ade658cbba65a0d3380de7753295054f375" + integrity sha512-ojmeN0qd+y0jszEtoY48r0Peq5dwMEkIlCOu6Q5f41lfkswXuKtYrhgoTpLnyIcHm24Uhqx+5Tqm2InSwLhE6Q== + +path-parse@^1.0.7: + version "1.0.7" + resolved "https://registry.yarnpkg.com/path-parse/-/path-parse-1.0.7.tgz#fbc114b60ca42b30d9daf5858e4bd68bbedb6735" + integrity sha512-LDJzPVEEEPR+y48z93A0Ed0yXb8pAByGWo/k5YYdYgpY2/2EsOsksJrq7lOHxryrVOn1ejG6oAp8ahvOIQD8sw== + +path-type@^4.0.0: + version "4.0.0" + resolved "https://registry.yarnpkg.com/path-type/-/path-type-4.0.0.tgz#84ed01c0a7ba380afe09d90a8c180dcd9d03043b" + integrity sha512-gDKb8aZMDeD/tZWs9P6+q0J9Mwkdl6xMV8TjnGP3qJVJ06bdMgkbBlLU8IdfOsIsFz2BW1rNVT3XuNEl8zPAvw== + +picocolors@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/picocolors/-/picocolors-1.0.0.tgz#cb5bdc74ff3f51892236eaf79d68bc44564ab81c" + integrity sha512-1fygroTLlHu66zi26VoTDv8yRgm0Fccecssto+MhsZ0D/DGW2sm8E8AjW7NU5VVTRt5GxbeZ5qBuJr+HyLYkjQ== + +picomatch@^2.0.4, picomatch@^2.2.3, picomatch@^2.3.1: + version "2.3.1" + resolved "https://registry.yarnpkg.com/picomatch/-/picomatch-2.3.1.tgz#3ba3833733646d9d3e4995946c1365a67fb07a42" + integrity sha512-JU3teHTNjmE2VCGFzuY8EXzCDVwEqB2a8fsIvwaStHhAWJEeVd1o1QD80CU6+ZdEXXSLbSsuLwJjkCBWqRQUVA== + +pirates@^4.0.4: + version "4.0.5" + resolved "https://registry.yarnpkg.com/pirates/-/pirates-4.0.5.tgz#feec352ea5c3268fb23a37c702ab1699f35a5f3b" + integrity sha512-8V9+HQPupnaXMA23c5hvl69zXvTwTzyAYasnkb0Tts4XvO4CliqONMOnvlq26rkhLC3nWDFBJf73LU1e1VZLaQ== + +prelude-ls@^1.2.1: + version "1.2.1" + resolved "https://registry.yarnpkg.com/prelude-ls/-/prelude-ls-1.2.1.tgz#debc6489d7a6e6b0e7611888cec880337d316396" + integrity sha512-vkcDPrRZo1QZLbn5RLGPpg/WmIQ65qoWWhcGKf/b5eplkkarX0m9z8ppCat4mlOqUsWpyNuYgO3VRyrYHSzX5g== + +prepend-file@^2.0.1: + version "2.0.1" + resolved "https://registry.yarnpkg.com/prepend-file/-/prepend-file-2.0.1.tgz#6a624b474a65ab1f87dc24d1757d5a6d989eb2db" + integrity sha512-0hXWjmOpz5YBIk6xujS0lYtCw6IAA0wCR3fw49UGTLc3E9BIhcxgqdMa8rzGvrtt2F8wFiGP42oEpQ8fo9zhRw== + dependencies: + temp-write "^4.0.0" + +prettier@^2.6.2, prettier@^2.8.3: + version "2.8.3" + resolved "https://registry.yarnpkg.com/prettier/-/prettier-2.8.3.tgz#ab697b1d3dd46fb4626fbe2f543afe0cc98d8632" + integrity sha512-tJ/oJ4amDihPoufT5sM0Z1SKEuKay8LfVAMlbbhnnkvt6BUserZylqo2PN+p9KeljLr0OHa2rXHU1T8reeoTrw== + +protobufjs@^6.8.8, protobufjs@~6.11.2, protobufjs@~6.11.3: + version "6.11.3" + resolved "https://registry.yarnpkg.com/protobufjs/-/protobufjs-6.11.3.tgz#637a527205a35caa4f3e2a9a4a13ddffe0e7af74" + integrity sha512-xL96WDdCZYdU7Slin569tFX712BxsxslWwAfAhCYjQKGTq7dAU91Lomy6nLLhh/dyGhk/YH4TwTSRxTzhuHyZg== + dependencies: + "@protobufjs/aspromise" "^1.1.2" + "@protobufjs/base64" "^1.1.2" + "@protobufjs/codegen" "^2.0.4" + "@protobufjs/eventemitter" "^1.1.0" + "@protobufjs/fetch" "^1.1.0" + "@protobufjs/float" "^1.0.2" + "@protobufjs/inquire" "^1.1.0" + "@protobufjs/path" "^1.1.2" + "@protobufjs/pool" "^1.1.0" + "@protobufjs/utf8" "^1.1.0" + "@types/long" "^4.0.1" + "@types/node" ">=13.7.0" + long "^4.0.0" + +punycode@^2.1.0: + version "2.3.0" + resolved "https://registry.yarnpkg.com/punycode/-/punycode-2.3.0.tgz#f67fa67c94da8f4d0cfff981aee4118064199b8f" + integrity sha512-rRV+zQD8tVFys26lAGR9WUuS4iUAngJScM+ZRSKtvl5tKeZ2t5bvdNFdNHBW9FWR4guGHlgmsZ1G7BSm2wTbuA== + +queue-microtask@^1.2.2: + version "1.2.3" + resolved "https://registry.yarnpkg.com/queue-microtask/-/queue-microtask-1.2.3.tgz#4929228bbc724dfac43e0efb058caf7b6cfb6243" + integrity sha512-NuaNSa6flKT5JaSYQzJok04JzTL1CA6aGhv5rfLW3PgqA+M2ChpZQnAC8h8i4ZFkBS8X5RqkDBHA7r4hej3K9A== + +readonly-date@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/readonly-date/-/readonly-date-1.0.0.tgz#5af785464d8c7d7c40b9d738cbde8c646f97dcd9" + integrity sha512-tMKIV7hlk0h4mO3JTmmVuIlJVXjKk3Sep9Bf5OH0O+758ruuVkUy2J9SttDLm91IEX/WHlXPSpxMGjPj4beMIQ== + +rechoir@^0.6.2: + version "0.6.2" + resolved "https://registry.yarnpkg.com/rechoir/-/rechoir-0.6.2.tgz#85204b54dba82d5742e28c96756ef43af50e3384" + integrity sha512-HFM8rkZ+i3zrV+4LQjwQ0W+ez98pApMGM3HUrN04j3CqzPOzl9nmP15Y8YXNm8QHGv/eacOVEjqhmWpkRV0NAw== + dependencies: + resolve "^1.1.6" + +regenerate-unicode-properties@^10.1.0: + version "10.1.0" + resolved "https://registry.yarnpkg.com/regenerate-unicode-properties/-/regenerate-unicode-properties-10.1.0.tgz#7c3192cab6dd24e21cb4461e5ddd7dd24fa8374c" + integrity sha512-d1VudCLoIGitcU/hEg2QqvyGZQmdC0Lf8BqdOMXGFSvJP4bNV1+XqbPQeHHLD51Jh4QJJ225dlIFvY4Ly6MXmQ== + dependencies: + regenerate "^1.4.2" + +regenerate@^1.4.2: + version "1.4.2" + resolved "https://registry.yarnpkg.com/regenerate/-/regenerate-1.4.2.tgz#b9346d8827e8f5a32f7ba29637d398b69014848a" + integrity sha512-zrceR/XhGYU/d/opr2EKO7aRHUeiBI8qjtfHqADTwZd6Szfy16la6kqD0MIUs5z5hx6AaKa+PixpPrR289+I0A== + +regenerator-runtime@^0.13.11: + version "0.13.11" + resolved "https://registry.yarnpkg.com/regenerator-runtime/-/regenerator-runtime-0.13.11.tgz#f6dca3e7ceec20590d07ada785636a90cdca17f9" + integrity sha512-kY1AZVr2Ra+t+piVaJ4gxaFaReZVH40AKNo7UCX6W+dEwBo/2oZJzqfuN1qLq1oL45o56cPaTXELwrTh8Fpggg== + +regenerator-transform@^0.15.1: + version "0.15.1" + resolved "https://registry.yarnpkg.com/regenerator-transform/-/regenerator-transform-0.15.1.tgz#f6c4e99fc1b4591f780db2586328e4d9a9d8dc56" + integrity sha512-knzmNAcuyxV+gQCufkYcvOqX/qIIfHLv0u5x79kRxuGojfYVky1f15TzZEu2Avte8QGepvUNTnLskf8E6X6Vyg== + dependencies: + "@babel/runtime" "^7.8.4" + +regexpp@^3.2.0: + version "3.2.0" + resolved "https://registry.yarnpkg.com/regexpp/-/regexpp-3.2.0.tgz#0425a2768d8f23bad70ca4b90461fa2f1213e1b2" + integrity sha512-pq2bWo9mVD43nbts2wGv17XLiNLya+GklZ8kaDLV2Z08gDCsGpnKn9BFMepvWuHCbyVvY7J5o5+BVvoQbmlJLg== + +regexpu-core@^5.2.1: + version "5.2.2" + resolved "https://registry.yarnpkg.com/regexpu-core/-/regexpu-core-5.2.2.tgz#3e4e5d12103b64748711c3aad69934d7718e75fc" + integrity sha512-T0+1Zp2wjF/juXMrMxHxidqGYn8U4R+zleSJhX9tQ1PUsS8a9UtYfbsF9LdiVgNX3kiX8RNaKM42nfSgvFJjmw== + dependencies: + regenerate "^1.4.2" + regenerate-unicode-properties "^10.1.0" + regjsgen "^0.7.1" + regjsparser "^0.9.1" + unicode-match-property-ecmascript "^2.0.0" + unicode-match-property-value-ecmascript "^2.1.0" + +regjsgen@^0.7.1: + version "0.7.1" + resolved "https://registry.yarnpkg.com/regjsgen/-/regjsgen-0.7.1.tgz#ee5ef30e18d3f09b7c369b76e7c2373ed25546f6" + integrity sha512-RAt+8H2ZEzHeYWxZ3H2z6tF18zyyOnlcdaafLrm21Bguj7uZy6ULibiAFdXEtKQY4Sy7wDTwDiOazasMLc4KPA== + +regjsparser@^0.9.1: + version "0.9.1" + resolved "https://registry.yarnpkg.com/regjsparser/-/regjsparser-0.9.1.tgz#272d05aa10c7c1f67095b1ff0addae8442fc5709" + integrity sha512-dQUtn90WanSNl+7mQKcXAgZxvUe7Z0SqXlgzv0za4LwiUhyzBC58yQO3liFoUgu8GiJVInAhJjkj1N0EtQ5nkQ== + dependencies: + jsesc "~0.5.0" + +resolve-from@^4.0.0: + version "4.0.0" + resolved "https://registry.yarnpkg.com/resolve-from/-/resolve-from-4.0.0.tgz#4abcd852ad32dd7baabfe9b40e00a36db5f392e6" + integrity sha512-pb/MYmXstAkysRFx8piNI1tGFNQIFA3vkE3Gq4EuA1dF6gHp/+vgZqsCGJapvy8N3Q+4o7FwvquPJcnZ7RYy4g== + +resolve-from@^5.0.0: + version "5.0.0" + resolved "https://registry.yarnpkg.com/resolve-from/-/resolve-from-5.0.0.tgz#c35225843df8f776df21c57557bc087e9dfdfc69" + integrity sha512-qYg9KP24dD5qka9J47d0aVky0N+b4fTU89LN9iDnjB5waksiC49rvMB0PrUJQGoTmH50XPiqOvAjDfaijGxYZw== + +resolve@^1.1.6, resolve@^1.14.2: + version "1.22.1" + resolved "https://registry.yarnpkg.com/resolve/-/resolve-1.22.1.tgz#27cb2ebb53f91abb49470a928bba7558066ac177" + integrity sha512-nBpuuYuY5jFsli/JIs1oldw6fOQCBioohqWZg/2hiaOybXOft4lonv85uDOKXdf8rhyK159cxU5cDcK/NKk8zw== + dependencies: + is-core-module "^2.9.0" + path-parse "^1.0.7" + supports-preserve-symlinks-flag "^1.0.0" + +restore-cursor@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/restore-cursor/-/restore-cursor-2.0.0.tgz#9f7ee287f82fd326d4fd162923d62129eee0dfaf" + integrity sha512-6IzJLuGi4+R14vwagDHX+JrXmPVtPpn4mffDJ1UdR7/Edm87fl6yi8mMBIVvFtJaNTUvjughmW4hwLhRG7gC1Q== + dependencies: + onetime "^2.0.0" + signal-exit "^3.0.2" + +reusify@^1.0.4: + version "1.0.4" + resolved "https://registry.yarnpkg.com/reusify/-/reusify-1.0.4.tgz#90da382b1e126efc02146e90845a88db12925d76" + integrity sha512-U9nH88a3fc/ekCF1l0/UP1IosiuIjyTh7hBvXVMHYgVcfGvt897Xguj2UOLDeI5BG2m7/uwyaLVT6fbtCwTyzw== + +rimraf@3.0.2, rimraf@^3.0.2: + version "3.0.2" + resolved "https://registry.yarnpkg.com/rimraf/-/rimraf-3.0.2.tgz#f1a5402ba6220ad52cc1282bac1ae3aa49fd061a" + integrity sha512-JZkJMZkAGFFPP2YqXZXPbMlMBgsxzE8ILs4lMIX/2o0L9UBw9O/Y3o6wFw/i9YLapcUJWwqbi3kdxIPdC62TIA== + dependencies: + glob "^7.1.3" + +run-async@^2.2.0, run-async@^2.3.0: + version "2.4.1" + resolved "https://registry.yarnpkg.com/run-async/-/run-async-2.4.1.tgz#8440eccf99ea3e70bd409d49aab88e10c189a455" + integrity sha512-tvVnVv01b8c1RrA6Ep7JkStj85Guv/YrMcwqYQnwjsAS2cTmmPGBBjAjpCW7RrSodNSoE2/qg9O4bceNvUuDgQ== + +run-parallel@^1.1.9: + version "1.2.0" + resolved "https://registry.yarnpkg.com/run-parallel/-/run-parallel-1.2.0.tgz#66d1368da7bdf921eb9d95bd1a9229e7f21a43ee" + integrity sha512-5l4VyZR86LZ/lDxZTR6jqL8AFE2S0IFLMP26AbjsLVADxHdhB/c0GUsH+y39UfCi3dzz8OlQuPmnaJOMoDHQBA== + dependencies: + queue-microtask "^1.2.2" + +rx-lite-aggregates@^4.0.8: + version "4.0.8" + resolved "https://registry.yarnpkg.com/rx-lite-aggregates/-/rx-lite-aggregates-4.0.8.tgz#753b87a89a11c95467c4ac1626c4efc4e05c67be" + integrity sha512-3xPNZGW93oCjiO7PtKxRK6iOVYBWBvtf9QHDfU23Oc+dLIQmAV//UnyXV/yihv81VS/UqoQPk4NegS8EFi55Hg== + dependencies: + rx-lite "*" + +rx-lite@*, rx-lite@^4.0.8: + version "4.0.8" + resolved "https://registry.yarnpkg.com/rx-lite/-/rx-lite-4.0.8.tgz#0b1e11af8bc44836f04a6407e92da42467b79444" + integrity sha512-Cun9QucwK6MIrp3mry/Y7hqD1oFqTYLQ4pGxaHTjIdaFDWRGGLikqp6u8LcWJnzpoALg9hap+JGk8sFIUuEGNA== + +rxjs@^6.4.0: + version "6.6.7" + resolved "https://registry.yarnpkg.com/rxjs/-/rxjs-6.6.7.tgz#90ac018acabf491bf65044235d5863c4dab804c9" + integrity sha512-hTdwr+7yYNIT5n4AMYp85KA6yw2Va0FLa3Rguvbpa4W3I5xynaBZo41cM3XM+4Q6fRMj3sBYIR1VAmZMXYJvRQ== + dependencies: + tslib "^1.9.0" + +"safer-buffer@>= 2.1.2 < 3": + version "2.1.2" + resolved "https://registry.yarnpkg.com/safer-buffer/-/safer-buffer-2.1.2.tgz#44fa161b0187b9549dd84bb91802f9bd8385cd6a" + integrity sha512-YZo3K82SD7Riyi0E1EQPojLz7kpepnSQI9IyPbHHg1XXXevb5dJI7tpyN2ADxGcQbHG7vcyRHk0cbwqcQriUtg== + +semver@^6.0.0, semver@^6.1.1, semver@^6.1.2, semver@^6.3.0: + version "6.3.0" + resolved "https://registry.yarnpkg.com/semver/-/semver-6.3.0.tgz#ee0a64c8af5e8ceea67687b133761e1becbd1d3d" + integrity sha512-b39TBaTSfV6yBrapU89p5fKekE2m/NwnDocOVruQFS1/veMgdzuPcnOM34M6CwxW8jH/lxEa5rBoDeUwu5HHTw== + +semver@^7.3.7: + version "7.3.8" + resolved "https://registry.yarnpkg.com/semver/-/semver-7.3.8.tgz#07a78feafb3f7b32347d725e33de7e2a2df67798" + integrity sha512-NB1ctGL5rlHrPJtFDVIVzTyQylMLu9N9VICA6HSFJo8MCGVTMW6gfpicwKmmK/dAjTOrqu5l63JJOpDSrAis3A== + dependencies: + lru-cache "^6.0.0" + +shebang-command@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/shebang-command/-/shebang-command-2.0.0.tgz#ccd0af4f8835fbdc265b82461aaf0c36663f34ea" + integrity sha512-kHxr2zZpYtdmrN1qDjrrX/Z1rR1kG8Dx+gkpK1G4eXmvXswmcE1hTWBWYUzlraYw1/yZp6YuDY77YtvbN0dmDA== + dependencies: + shebang-regex "^3.0.0" + +shebang-regex@^3.0.0: + version "3.0.0" + resolved "https://registry.yarnpkg.com/shebang-regex/-/shebang-regex-3.0.0.tgz#ae16f1644d873ecad843b0307b143362d4c42172" + integrity sha512-7++dFhtcx3353uBaq8DDR4NuxBetBzC7ZQOhmTQInHEd6bSrXdiEyzCvG07Z44UYdLShWUyXt5M/yhz8ekcb1A== + +shelljs@0.8.5: + version "0.8.5" + resolved "https://registry.yarnpkg.com/shelljs/-/shelljs-0.8.5.tgz#de055408d8361bed66c669d2f000538ced8ee20c" + integrity sha512-TiwcRcrkhHvbrZbnRcFYMLl30Dfov3HKqzp5tO5b4pt6G/SezKcYhmDg15zXVBswHmctSAQKznqNW2LO5tTDow== + dependencies: + glob "^7.0.0" + interpret "^1.0.0" + rechoir "^0.6.2" + +signal-exit@^3.0.2, signal-exit@^3.0.7: + version "3.0.7" + resolved "https://registry.yarnpkg.com/signal-exit/-/signal-exit-3.0.7.tgz#a9a1767f8af84155114eaabd73f99273c8f59ad9" + integrity sha512-wnD2ZE+l+SPC/uoS0vXeE9L1+0wuaMqKlfz9AMUo38JsyLSBWSFcHR1Rri62LZc12vLr1gb3jl7iwQhgwpAbGQ== + +slash@^3.0.0: + version "3.0.0" + resolved "https://registry.yarnpkg.com/slash/-/slash-3.0.0.tgz#6539be870c165adbd5240220dbe361f1bc4d4634" + integrity sha512-g9Q1haeby36OSStwb4ntCGGGaKsaVSjQ68fBxoQcutl5fS1vuY18H3wSt3jFyFtrkx+Kz0V1G85A4MyAdDMi2Q== + +sprintf-js@~1.0.2: + version "1.0.3" + resolved "https://registry.yarnpkg.com/sprintf-js/-/sprintf-js-1.0.3.tgz#04e6926f662895354f3dd015203633b857297e2c" + integrity sha512-D9cPgkvLlV3t3IzL0D0YLvGA9Ahk4PcvVwUbN0dSGr1aP0Nrt4AEnTUbuGvquEC0mA64Gqt1fzirlRs5ibXx8g== + +string-width@^2.0.0, string-width@^2.1.0: + version "2.1.1" + resolved "https://registry.yarnpkg.com/string-width/-/string-width-2.1.1.tgz#ab93f27a8dc13d28cac815c462143a6d9012ae9e" + integrity sha512-nOqH59deCq9SRHlxq1Aw85Jnt4w6KvLKqWVik6oA9ZklXLNIOlqg4F2yrT1MVaTjAqvVwdfeZ7w7aCvJD7ugkw== + dependencies: + is-fullwidth-code-point "^2.0.0" + strip-ansi "^4.0.0" + +strip-ansi@^3.0.0: + version "3.0.1" + resolved "https://registry.yarnpkg.com/strip-ansi/-/strip-ansi-3.0.1.tgz#6a385fb8853d952d5ff05d0e8aaf94278dc63dcf" + integrity sha512-VhumSSbBqDTP8p2ZLKj40UjBCV4+v8bUSEpUb4KjRgWk9pbqGF4REFj6KEagidb2f/M6AzC0EmFyDNGaw9OCzg== + dependencies: + ansi-regex "^2.0.0" + +strip-ansi@^4.0.0: + version "4.0.0" + resolved "https://registry.yarnpkg.com/strip-ansi/-/strip-ansi-4.0.0.tgz#a8479022eb1ac368a871389b635262c505ee368f" + integrity sha512-4XaJ2zQdCzROZDivEVIDPkcQn8LMFSa8kj8Gxb/Lnwzv9A8VctNZ+lfivC/sV3ivW8ElJTERXZoPBRrZKkNKow== + dependencies: + ansi-regex "^3.0.0" + +strip-ansi@^5.1.0: + version "5.2.0" + resolved "https://registry.yarnpkg.com/strip-ansi/-/strip-ansi-5.2.0.tgz#8c9a536feb6afc962bdfa5b104a5091c1ad9c0ae" + integrity sha512-DuRs1gKbBqsMKIZlrffwlug8MHkcnpjs5VPmL1PAh+mA30U0DTotfDZ0d2UUsXpPmPmMMJ6W773MaA3J+lbiWA== + dependencies: + ansi-regex "^4.1.0" + +strip-ansi@^6.0.1: + version "6.0.1" + resolved "https://registry.yarnpkg.com/strip-ansi/-/strip-ansi-6.0.1.tgz#9e26c63d30f53443e9489495b2105d37b67a85d9" + integrity sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A== + dependencies: + ansi-regex "^5.0.1" + +strip-json-comments@^3.1.0, strip-json-comments@^3.1.1: + version "3.1.1" + resolved "https://registry.yarnpkg.com/strip-json-comments/-/strip-json-comments-3.1.1.tgz#31f1281b3832630434831c310c01cccda8cbe006" + integrity sha512-6fPc+R4ihwqP6N/aIv2f1gMH8lOVtWQHoqC4yK6oSDVVocumAsfCqjkXnqiYMhmMwS/mEHLp7Vehlt3ql6lEig== + +supports-color@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/supports-color/-/supports-color-2.0.0.tgz#535d045ce6b6363fa40117084629995e9df324c7" + integrity sha512-KKNVtd6pCYgPIKU4cp2733HWYCpplQhddZLBUryaAHou723x+FRzQ5Df824Fj+IyyuiQTRoub4SnIFfIcrp70g== + +supports-color@^5.3.0: + version "5.5.0" + resolved "https://registry.yarnpkg.com/supports-color/-/supports-color-5.5.0.tgz#e2e69a44ac8772f78a1ec0b35b689df6530efc8f" + integrity sha512-QjVjwdXIt408MIiAqCX4oUKsgU2EqAGzs2Ppkm4aQYbjm+ZEWEcW4SfFNTr4uMNZma0ey4f5lgLrkB0aX0QMow== + dependencies: + has-flag "^3.0.0" + +supports-color@^7.1.0: + version "7.2.0" + resolved "https://registry.yarnpkg.com/supports-color/-/supports-color-7.2.0.tgz#1b7dcdcb32b8138801b3e478ba6a51caa89648da" + integrity sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw== + dependencies: + has-flag "^4.0.0" + +supports-color@^8.0.0: + version "8.1.1" + resolved "https://registry.yarnpkg.com/supports-color/-/supports-color-8.1.1.tgz#cd6fc17e28500cff56c1b86c0a7fd4a54a73005c" + integrity sha512-MpUEN2OodtUzxvKQl72cUF7RQ5EiHsGvSsVG0ia9c5RbWGL2CI4C7EpPS8UTBIplnlzZiNuV56w+FuNxy3ty2Q== + dependencies: + has-flag "^4.0.0" + +supports-preserve-symlinks-flag@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/supports-preserve-symlinks-flag/-/supports-preserve-symlinks-flag-1.0.0.tgz#6eda4bd344a3c94aea376d4cc31bc77311039e09" + integrity sha512-ot0WnXS9fgdkgIcePe6RHNk1WA8+muPa6cSjeR3V8K27q9BB1rTE3R1p7Hv0z1ZyAc8s6Vvv8DIyWf681MAt0w== + +symbol-observable@^2.0.3: + version "2.0.3" + resolved "https://registry.yarnpkg.com/symbol-observable/-/symbol-observable-2.0.3.tgz#5b521d3d07a43c351055fa43b8355b62d33fd16a" + integrity sha512-sQV7phh2WCYAn81oAkakC5qjq2Ml0g8ozqz03wOGnx9dDlG1de6yrF+0RAzSJD8fPUow3PTSMf2SAbOGxb93BA== + +temp-dir@^1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/temp-dir/-/temp-dir-1.0.0.tgz#0a7c0ea26d3a39afa7e0ebea9c1fc0bc4daa011d" + integrity sha512-xZFXEGbG7SNC3itwBzI3RYjq/cEhBkx2hJuKGIUOcEULmkQExXiHat2z/qkISYsuR+IKumhEfKKbV5qXmhICFQ== + +temp-write@^4.0.0: + version "4.0.0" + resolved "https://registry.yarnpkg.com/temp-write/-/temp-write-4.0.0.tgz#cd2e0825fc826ae72d201dc26eef3bf7e6fc9320" + integrity sha512-HIeWmj77uOOHb0QX7siN3OtwV3CTntquin6TNVg6SHOqCP3hYKmox90eeFOGaY1MqJ9WYDDjkyZrW6qS5AWpbw== + dependencies: + graceful-fs "^4.1.15" + is-stream "^2.0.0" + make-dir "^3.0.0" + temp-dir "^1.0.0" + uuid "^3.3.2" + +test-exclude@^6.0.0: + version "6.0.0" + resolved "https://registry.yarnpkg.com/test-exclude/-/test-exclude-6.0.0.tgz#04a8698661d805ea6fa293b6cb9e63ac044ef15e" + integrity sha512-cAGWPIyOHU6zlmg88jwm7VRyXnMN7iV68OGAbYDk/Mh/xC/pzVPlQtY6ngoIH/5/tciuhGfvESU8GrHrcxD56w== + dependencies: + "@istanbuljs/schema" "^0.1.2" + glob "^7.1.4" + minimatch "^3.0.4" + +text-table@^0.2.0: + version "0.2.0" + resolved "https://registry.yarnpkg.com/text-table/-/text-table-0.2.0.tgz#7f5ee823ae805207c00af2df4a84ec3fcfa570b4" + integrity sha512-N+8UisAXDGk8PFXP4HAzVR9nbfmVJ3zYLAWiTIoqC5v5isinhr+r5uaO8+7r3BMfuNIufIsA7RdpVgacC2cSpw== + +thenify-all@^1.0.0: + version "1.6.0" + resolved "https://registry.yarnpkg.com/thenify-all/-/thenify-all-1.6.0.tgz#1a1918d402d8fc3f98fbf234db0bcc8cc10e9726" + integrity sha512-RNxQH/qI8/t3thXJDwcstUO4zeqo64+Uy/+sNVRBx4Xn2OX+OZ9oP+iJnNFqplFra2ZUVeKCSa2oVWi3T4uVmA== + dependencies: + thenify ">= 3.1.0 < 4" + +"thenify@>= 3.1.0 < 4": + version "3.3.1" + resolved "https://registry.yarnpkg.com/thenify/-/thenify-3.3.1.tgz#8932e686a4066038a016dd9e2ca46add9838a95f" + integrity sha512-RVZSIV5IG10Hk3enotrhvz0T9em6cyHBLkH/YAZuKqd8hRkKhSfCGIcP2KUY0EPxndzANBmNllzWPwak+bheSw== + dependencies: + any-promise "^1.0.0" + +through@^2.3.6: + version "2.3.8" + resolved "https://registry.yarnpkg.com/through/-/through-2.3.8.tgz#0dd4c9ffaabc357960b1b724115d7e0e86a2e1f5" + integrity sha512-w89qg7PI8wAdvX60bMDP+bFoD5Dvhm9oLheFp5O4a2QF0cSBGsBX4qZmadPMvVqlLJBBci+WqGGOAPvcDeNSVg== + +timers-ext@^0.1.7: + version "0.1.7" + resolved "https://registry.yarnpkg.com/timers-ext/-/timers-ext-0.1.7.tgz#6f57ad8578e07a3fb9f91d9387d65647555e25c6" + integrity sha512-b85NUNzTSdodShTIbky6ZF02e8STtVVfD+fu4aXXShEELpozH+bCpJLYMPZbsABN2wDH7fJpqIoXxJpzbf0NqQ== + dependencies: + es5-ext "~0.10.46" + next-tick "1" + +tmp@^0.0.33: + version "0.0.33" + resolved "https://registry.yarnpkg.com/tmp/-/tmp-0.0.33.tgz#6d34335889768d21b2bcda0aa277ced3b1bfadf9" + integrity sha512-jRCJlojKnZ3addtTOjdIqoRuPEKBvNXcGYqzO6zWZX8KfKEpnGY5jfggJQ3EjKuu8D4bJRr0y+cYJFmYbImXGw== + dependencies: + os-tmpdir "~1.0.2" + +tmpl@1.0.5: + version "1.0.5" + resolved "https://registry.yarnpkg.com/tmpl/-/tmpl-1.0.5.tgz#8683e0b902bb9c20c4f726e3c0b69f36518c07cc" + integrity sha512-3f0uOEAQwIqGuWW2MVzYg8fV/QNnc/IpuJNG837rLuczAaLVHslWHZQj4IGiEl5Hs3kkbhwL9Ab7Hrsmuj+Smw== + +to-fast-properties@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/to-fast-properties/-/to-fast-properties-2.0.0.tgz#dc5e698cbd079265bc73e0377681a4e4e83f616e" + integrity sha512-/OaKK0xYrs3DmxRYqL/yDc+FxFUVYhDlXMhRmv3z915w2HF1tnN1omB354j8VUGO/hbRzyD6Y3sA7v7GS/ceog== + +to-regex-range@^5.0.1: + version "5.0.1" + resolved "https://registry.yarnpkg.com/to-regex-range/-/to-regex-range-5.0.1.tgz#1648c44aae7c8d988a326018ed72f5b4dd0392e4" + integrity sha512-65P7iz6X5yEr1cwcgvQxbbIw7Uk3gOy5dIdtZ4rDveLqhrdJP+Li/Hx6tyK0NEb+2GCyneCMJiGqrADCSNk8sQ== + dependencies: + is-number "^7.0.0" + +tslib@^1.8.1, tslib@^1.9.0: + version "1.14.1" + resolved "https://registry.yarnpkg.com/tslib/-/tslib-1.14.1.tgz#cf2d38bdc34a134bcaf1091c41f6619e2f672d00" + integrity sha512-Xni35NKzjgMrwevysHTCArtLDpPvye8zV/0E4EyYn43P7/7qvQwPh9BGkHewbMulVntbigmcT7rdX3BNo9wRJg== + +tsutils@^3.21.0: + version "3.21.0" + resolved "https://registry.yarnpkg.com/tsutils/-/tsutils-3.21.0.tgz#b48717d394cea6c1e096983eed58e9d61715b623" + integrity sha512-mHKK3iUXL+3UF6xL5k0PEhKRUBKPBCv/+RkEOpjRWxxx27KKRBmmA60A9pgOUvMi8GKhRMPEmjBRPzs2W7O1OA== + dependencies: + tslib "^1.8.1" + +type-check@^0.4.0, type-check@~0.4.0: + version "0.4.0" + resolved "https://registry.yarnpkg.com/type-check/-/type-check-0.4.0.tgz#07b8203bfa7056c0657050e3ccd2c37730bab8f1" + integrity sha512-XleUoc9uwGXqjWwXaUTZAmzMcFZ5858QA2vvx1Ur5xIcixXIP+8LnFDgRplU30us6teqdlskFfu+ae4K79Ooew== + dependencies: + prelude-ls "^1.2.1" + +type-fest@^0.20.2: + version "0.20.2" + resolved "https://registry.yarnpkg.com/type-fest/-/type-fest-0.20.2.tgz#1bf207f4b28f91583666cb5fbd327887301cd5f4" + integrity sha512-Ne+eE4r0/iWnpAxD852z3A+N0Bt5RN//NjJwRd2VFHEmrywxf5vsZlh4R6lixl6B+wz/8d+maTSAkN1FIkI3LQ== + +type@^1.0.1: + version "1.2.0" + resolved "https://registry.yarnpkg.com/type/-/type-1.2.0.tgz#848dd7698dafa3e54a6c479e759c4bc3f18847a0" + integrity sha512-+5nt5AAniqsCnu2cEQQdpzCAh33kVx8n0VoFidKpB1dVVLAN/F+bgVOqOJqOnEnrhp222clB5p3vUlD+1QAnfg== + +type@^2.7.2: + version "2.7.2" + resolved "https://registry.yarnpkg.com/type/-/type-2.7.2.tgz#2376a15a3a28b1efa0f5350dcf72d24df6ef98d0" + integrity sha512-dzlvlNlt6AXU7EBSfpAscydQ7gXB+pPGsPnfJnZpiNJBDj7IaJzQlBZYGdEi4R9HmPdBv2XmWJ6YUtoTa7lmCw== + +typescript@^4.9.4: + version "4.9.4" + resolved "https://registry.yarnpkg.com/typescript/-/typescript-4.9.4.tgz#a2a3d2756c079abda241d75f149df9d561091e78" + integrity sha512-Uz+dTXYzxXXbsFpM86Wh3dKCxrQqUcVMxwU54orwlJjOpO3ao8L7j5lH+dWfTwgCwIuM9GQ2kvVotzYJMXTBZg== + +unicode-canonical-property-names-ecmascript@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/unicode-canonical-property-names-ecmascript/-/unicode-canonical-property-names-ecmascript-2.0.0.tgz#301acdc525631670d39f6146e0e77ff6bbdebddc" + integrity sha512-yY5PpDlfVIU5+y/BSCxAJRBIS1Zc2dDG3Ujq+sR0U+JjUevW2JhocOF+soROYDSaAezOzOKuyyixhD6mBknSmQ== + +unicode-match-property-ecmascript@^2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/unicode-match-property-ecmascript/-/unicode-match-property-ecmascript-2.0.0.tgz#54fd16e0ecb167cf04cf1f756bdcc92eba7976c3" + integrity sha512-5kaZCrbp5mmbz5ulBkDkbY0SsPOjKqVS35VpL9ulMPfSl0J0Xsm+9Evphv9CoIZFwre7aJoa94AY6seMKGVN5Q== + dependencies: + unicode-canonical-property-names-ecmascript "^2.0.0" + unicode-property-aliases-ecmascript "^2.0.0" + +unicode-match-property-value-ecmascript@^2.1.0: + version "2.1.0" + resolved "https://registry.yarnpkg.com/unicode-match-property-value-ecmascript/-/unicode-match-property-value-ecmascript-2.1.0.tgz#cb5fffdcd16a05124f5a4b0bf7c3770208acbbe0" + integrity sha512-qxkjQt6qjg/mYscYMC0XKRn3Rh0wFPlfxB0xkt9CfyTvpX1Ra0+rAmdX2QyAobptSEvuy4RtpPRui6XkV+8wjA== + +unicode-property-aliases-ecmascript@^2.0.0: + version "2.1.0" + resolved "https://registry.yarnpkg.com/unicode-property-aliases-ecmascript/-/unicode-property-aliases-ecmascript-2.1.0.tgz#43d41e3be698bd493ef911077c9b131f827e8ccd" + integrity sha512-6t3foTQI9qne+OZoVQB/8x8rk2k1eVy1gRXhV3oFQ5T6R1dqQ1xtin3XqSlx3+ATBkliTaR/hHyJBm+LVPNM8w== + +update-browserslist-db@^1.0.9: + version "1.0.10" + resolved "https://registry.yarnpkg.com/update-browserslist-db/-/update-browserslist-db-1.0.10.tgz#0f54b876545726f17d00cd9a2561e6dade943ff3" + integrity sha512-OztqDenkfFkbSG+tRxBeAnCVPckDBcvibKd35yDONx6OU8N7sqgwc7rCbkJ/WcYtVRZ4ba68d6byhC21GFh7sQ== + dependencies: + escalade "^3.1.1" + picocolors "^1.0.0" + +uri-js@^4.2.2: + version "4.4.1" + resolved "https://registry.yarnpkg.com/uri-js/-/uri-js-4.4.1.tgz#9b1a52595225859e55f669d928f88c6c57f2a77e" + integrity sha512-7rKUyy33Q1yc98pQ1DAmLtwX109F7TIfWlW1Ydo8Wl1ii1SeHieeh0HHfPeL2fMXK6z0s8ecKs9frCuLJvndBg== + dependencies: + punycode "^2.1.0" + +util@^0.10.3: + version "0.10.4" + resolved "https://registry.yarnpkg.com/util/-/util-0.10.4.tgz#3aa0125bfe668a4672de58857d3ace27ecb76901" + integrity sha512-0Pm9hTQ3se5ll1XihRic3FDIku70C+iHUdT/W926rSgHV5QgXsYbKZN8MSC3tJtSkhuROzvsQjAaFENRXr+19A== + dependencies: + inherits "2.0.3" + +uuid@^3.3.2: + version "3.4.0" + resolved "https://registry.yarnpkg.com/uuid/-/uuid-3.4.0.tgz#b23e4358afa8a202fe7a100af1f5f883f02007ee" + integrity sha512-HjSDRw6gZE5JMggctHBcjVak08+KEVhSIiDzFnT9S9aegmp85S/bReBVTb4QTFaRNptJ9kuYaNhnbNEOkbKb/A== + +walker@^1.0.8: + version "1.0.8" + resolved "https://registry.yarnpkg.com/walker/-/walker-1.0.8.tgz#bd498db477afe573dc04185f011d3ab8a8d7653f" + integrity sha512-ts/8E8l5b7kY0vlWLewOkDXMmPdLcVV4GmOQLyxuSswIJsweeFZtAsMF7k1Nszz+TYBQrlYRmzOnr398y1JemQ== + dependencies: + makeerror "1.0.12" + +wasm-ast-types@^0.17.0: + version "0.17.0" + resolved "https://registry.yarnpkg.com/wasm-ast-types/-/wasm-ast-types-0.17.0.tgz#417280a61d60ea9964667cf2edb8f5281dc295d7" + integrity sha512-WeriXPbG67iI51Mf/5qRR0xcpEaTO/Wyjpl+vsmjZ5K6q/0W6iO03zHsESNIH/hpc5FPTpb0Y0L9xAtnnNe9Ow== + dependencies: + "@babel/runtime" "^7.18.9" + "@babel/types" "7.18.10" + "@jest/transform" "28.1.3" + ast-stringify "0.1.0" + case "1.6.3" + deepmerge "4.2.2" + +which@^2.0.1: + version "2.0.2" + resolved "https://registry.yarnpkg.com/which/-/which-2.0.2.tgz#7c6a8dd0a636a0327e10b59c9286eee93f3f51b1" + integrity sha512-BLI3Tl1TW3Pvl70l3yq3Y64i+awpwXqsGBYWkkqMtnbXgrMD+yj7rhW0kuEDxzJaYXGjEW5ogapKNMEKNMjibA== + dependencies: + isexe "^2.0.0" + +word-wrap@^1.2.3: + version "1.2.3" + resolved "https://registry.yarnpkg.com/word-wrap/-/word-wrap-1.2.3.tgz#610636f6b1f703891bd34771ccb17fb93b47079c" + integrity sha512-Hz/mrNwitNRh/HUAtM/VT/5VH+ygD6DV7mYKZAtHOrbs8U7lvPS6xf7EJKMF0uW1KJCl0H701g3ZGus+muE5vQ== + +wrappy@1: + version "1.0.2" + resolved "https://registry.yarnpkg.com/wrappy/-/wrappy-1.0.2.tgz#b5243d8f3ec1aa35f1364605bc0d1036e30ab69f" + integrity sha512-l4Sp/DRseor9wL6EvV2+TuQn63dMkPjZ/sp9XkghTEbV9KlPS1xUsZ3u7/IQO4wxtcFB4bgpQPRcR3QCvezPcQ== + +write-file-atomic@^4.0.1: + version "4.0.2" + resolved "https://registry.yarnpkg.com/write-file-atomic/-/write-file-atomic-4.0.2.tgz#a9df01ae5b77858a027fd2e80768ee433555fcfd" + integrity sha512-7KxauUdBmSdWnmpaGFg+ppNjKF8uNLry8LyzjauQDOVONfFLNKrKvQOxZ/VuTIcS/gge/YNahf5RIIQWTSarlg== + dependencies: + imurmurhash "^0.1.4" + signal-exit "^3.0.7" + +ws@^7: + version "7.5.9" + resolved "https://registry.yarnpkg.com/ws/-/ws-7.5.9.tgz#54fa7db29f4c7cec68b1ddd3a89de099942bb591" + integrity sha512-F+P9Jil7UiSKSkppIiD94dN07AwvFixvLIj1Og1Rl9GGMuNipJnV9JzjD6XuqmAeiswGvUmNLjr5cFuXwNS77Q== + +xstream@^11.14.0: + version "11.14.0" + resolved "https://registry.yarnpkg.com/xstream/-/xstream-11.14.0.tgz#2c071d26b18310523b6877e86b4e54df068a9ae5" + integrity sha512-1bLb+kKKtKPbgTK6i/BaoAn03g47PpFstlbe1BA+y3pNS/LfvcaghS5BFf9+EE1J+KwSQsEpfJvFN5GqFtiNmw== + dependencies: + globalthis "^1.0.1" + symbol-observable "^2.0.3" + +yallist@^3.0.2: + version "3.1.1" + resolved "https://registry.yarnpkg.com/yallist/-/yallist-3.1.1.tgz#dbb7daf9bfd8bac9ab45ebf602b8cbad0d5d08fd" + integrity sha512-a4UGQaWPH59mOXUYnAG2ewncQS4i4F43Tv3JoAM+s2VDAmS9NsK8GpDMLrCHPksFT7h3K6TOoUNn2pb7RoXx4g== + +yallist@^4.0.0: + version "4.0.0" + resolved "https://registry.yarnpkg.com/yallist/-/yallist-4.0.0.tgz#9bb92790d9c0effec63be73519e11a35019a3a72" + integrity sha512-3wdGidZyq5PB084XLES5TpOSRA3wjXAlIWMhum2kRcv/41Sn2emQ0dycQW4uZXLejwKvg6EsvbdlVL+FYEct7A== + +yocto-queue@^0.1.0: + version "0.1.0" + resolved "https://registry.yarnpkg.com/yocto-queue/-/yocto-queue-0.1.0.tgz#0294eb3dee05028d31ee1a5fa2c556a6aaf10a1b" + integrity sha512-rVksvsnNCdJ/ohGc6xgPwyN8eheCxsiLM8mxuE/t/mOVqJewPuO1miLpTHQiRgTKCLexL4MeAFVagts7HmNZ2Q== From bb5ddc507bcde6bf853be075bc31dc81841d060c Mon Sep 17 00:00:00 2001 From: brimigs Date: Thu, 23 Mar 2023 23:19:56 -0400 Subject: [PATCH 03/17] setup contract --- Cargo.lock | 239 +++++++++- Cargo.toml | 6 +- README.md | 16 + contracts/asset-params/Cargo.toml | 38 ++ contracts/asset-params/src/contract.rs | 88 ++++ contracts/asset-params/src/error.rs | 32 ++ contracts/asset-params/src/execute.rs | 220 +++++++++ contracts/asset-params/src/lib.rs | 7 + contracts/asset-params/src/msg.rs | 64 +++ contracts/asset-params/src/query.rs | 40 ++ contracts/asset-params/src/state.rs | 9 + contracts/asset-params/src/types.rs | 61 +++ contracts/asset-params/tests/test_admin.rs | 213 +++++++++ contracts/asset-params/tests/test_assets.rs | 490 ++++++++++++++++++++ contracts/asset-params/tests/test_vaults.rs | 0 15 files changed, 1520 insertions(+), 3 deletions(-) create mode 100644 contracts/asset-params/Cargo.toml create mode 100644 contracts/asset-params/src/contract.rs create mode 100644 contracts/asset-params/src/error.rs create mode 100644 contracts/asset-params/src/execute.rs create mode 100644 contracts/asset-params/src/lib.rs create mode 100644 contracts/asset-params/src/msg.rs create mode 100644 contracts/asset-params/src/query.rs create mode 100644 contracts/asset-params/src/state.rs create mode 100644 contracts/asset-params/src/types.rs create mode 100644 contracts/asset-params/tests/test_admin.rs create mode 100644 contracts/asset-params/tests/test_assets.rs create mode 100644 contracts/asset-params/tests/test_vaults.rs diff --git a/Cargo.lock b/Cargo.lock index 0bfe31759..2c37bb245 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -74,6 +74,12 @@ version = "1.6.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8c3c1a368f70d6cf7302d78f8f7093da241fb8e8807c05cc9e51a125895a6d5b" +[[package]] +name = "bech32" +version = "0.9.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d86b93f97252c47b41663388e6d155714a9d0c398b99f1005cbc5f978b29f445" + [[package]] name = "bindgen" version = "0.60.1" @@ -379,6 +385,16 @@ dependencies = [ "zeroize", ] +[[package]] +name = "cw-item-set" +version = "0.7.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "dea5a233bd67babedbe96a514178a64b0c597f1f38bc474fa8d63e3f26bdceb2" +dependencies = [ + "cosmwasm-std", + "cw-storage-plus", +] + [[package]] name = "cw-multi-test" version = "0.16.2" @@ -428,7 +444,7 @@ checksum = "c80e93d1deccb8588db03945016a292c3c631e6325d349ebb35d2db6f4f946f7" dependencies = [ "cosmwasm-schema", "cosmwasm-std", - "cw2", + "cw2 1.0.1 (registry+https://github.com/rust-lang/crates.io-index)", "schemars", "semver", "serde", @@ -448,6 +464,19 @@ dependencies = [ "serde", ] +[[package]] +name = "cw2" +version = "1.0.1" +source = "git+https://github.com/mars-protocol/cw-plus?rev=4014255#4014255fc2d79486e332e02d1ab1421db86f4f0b" +dependencies = [ + "cosmwasm-schema", + "cosmwasm-std", + "cw-storage-plus", + "schemars", + "serde", + "thiserror", +] + [[package]] name = "der" version = "0.6.1" @@ -857,6 +886,77 @@ dependencies = [ "cfg-if", ] +[[package]] +name = "mars-address-provider" +version = "1.0.1" +source = "git+https://github.com/mars-protocol/red-bank?rev=00301d60c38af09d8eb7980355009e2f00c6f41f#00301d60c38af09d8eb7980355009e2f00c6f41f" +dependencies = [ + "bech32", + "cosmwasm-std", + "cw-storage-plus", + "cw2 1.0.1 (git+https://github.com/mars-protocol/cw-plus?rev=4014255)", + "mars-owner", + "mars-red-bank-types 1.0.1", + "thiserror", +] + +[[package]] +name = "mars-health" +version = "1.0.1" +source = "git+https://github.com/mars-protocol/red-bank?rev=00301d60c38af09d8eb7980355009e2f00c6f41f#00301d60c38af09d8eb7980355009e2f00c6f41f" +dependencies = [ + "cosmwasm-std", + "mars-red-bank-types 1.0.1", + "thiserror", +] + +[[package]] +name = "mars-incentives" +version = "1.0.1" +source = "git+https://github.com/mars-protocol/red-bank?rev=00301d60c38af09d8eb7980355009e2f00c6f41f#00301d60c38af09d8eb7980355009e2f00c6f41f" +dependencies = [ + "cosmwasm-std", + "cw-storage-plus", + "cw2 1.0.1 (git+https://github.com/mars-protocol/cw-plus?rev=4014255)", + "mars-owner", + "mars-red-bank-types 1.0.1", + "mars-utils 1.0.1", + "thiserror", +] + +[[package]] +name = "mars-oracle-base" +version = "1.0.1" +source = "git+https://github.com/mars-protocol/red-bank?rev=00301d60c38af09d8eb7980355009e2f00c6f41f#00301d60c38af09d8eb7980355009e2f00c6f41f" +dependencies = [ + "cosmwasm-std", + "cw-storage-plus", + "cw2 1.0.1 (git+https://github.com/mars-protocol/cw-plus?rev=4014255)", + "mars-owner", + "mars-red-bank-types 1.0.1", + "mars-utils 1.0.1", + "schemars", + "serde", + "thiserror", +] + +[[package]] +name = "mars-oracle-osmosis" +version = "1.0.1" +source = "git+https://github.com/mars-protocol/red-bank?rev=00301d60c38af09d8eb7980355009e2f00c6f41f#00301d60c38af09d8eb7980355009e2f00c6f41f" +dependencies = [ + "cosmwasm-std", + "cw-storage-plus", + "cw2 1.0.1 (git+https://github.com/mars-protocol/cw-plus?rev=4014255)", + "mars-oracle-base", + "mars-osmosis", + "mars-red-bank-types 1.0.1", + "osmosis-std 0.14.0", + "schemars", + "serde", + "thiserror", +] + [[package]] name = "mars-osmosis" version = "1.0.1" @@ -880,6 +980,100 @@ dependencies = [ "thiserror", ] +[[package]] +name = "mars-params" +version = "1.0.0" +dependencies = [ + "anyhow", + "cosmwasm-schema", + "cosmwasm-std", + "cw-item-set", + "cw-multi-test", + "cw-paginate", + "cw-storage-plus", + "cw2 1.0.1 (registry+https://github.com/rust-lang/crates.io-index)", + "mars-owner", + "mars-red-bank-types 1.0.0", + "mars-testing", + "mars-utils 1.0.0", + "schemars", + "serde", + "thiserror", +] + +[[package]] +name = "mars-red-bank" +version = "1.0.1" +source = "git+https://github.com/mars-protocol/red-bank?rev=00301d60c38af09d8eb7980355009e2f00c6f41f#00301d60c38af09d8eb7980355009e2f00c6f41f" +dependencies = [ + "cosmwasm-std", + "cw-storage-plus", + "cw-utils", + "cw2 1.0.1 (git+https://github.com/mars-protocol/cw-plus?rev=4014255)", + "mars-health", + "mars-owner", + "mars-red-bank-types 1.0.1", + "mars-utils 1.0.1", + "thiserror", +] + +[[package]] +name = "mars-red-bank-types" +version = "1.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cca59bb17daa753c30d3c934e0779736200708cb89a34020fa805b1cb05e7278" +dependencies = [ + "cosmwasm-schema", + "cosmwasm-std", + "mars-owner", + "mars-utils 1.0.0", + "thiserror", +] + +[[package]] +name = "mars-red-bank-types" +version = "1.0.1" +source = "git+https://github.com/mars-protocol/red-bank?rev=00301d60c38af09d8eb7980355009e2f00c6f41f#00301d60c38af09d8eb7980355009e2f00c6f41f" +dependencies = [ + "cosmwasm-schema", + "cosmwasm-std", + "mars-owner", + "mars-utils 1.0.1", + "thiserror", +] + +[[package]] +name = "mars-rewards-collector-base" +version = "1.0.1" +source = "git+https://github.com/mars-protocol/red-bank?rev=00301d60c38af09d8eb7980355009e2f00c6f41f#00301d60c38af09d8eb7980355009e2f00c6f41f" +dependencies = [ + "cosmwasm-std", + "cw-storage-plus", + "mars-owner", + "mars-red-bank-types 1.0.1", + "mars-utils 1.0.1", + "schemars", + "serde", + "thiserror", +] + +[[package]] +name = "mars-rewards-collector-osmosis" +version = "1.0.1" +source = "git+https://github.com/mars-protocol/red-bank?rev=00301d60c38af09d8eb7980355009e2f00c6f41f#00301d60c38af09d8eb7980355009e2f00c6f41f" +dependencies = [ + "cosmwasm-std", + "cw-storage-plus", + "cw2 1.0.1 (git+https://github.com/mars-protocol/cw-plus?rev=4014255)", + "mars-osmosis", + "mars-red-bank-types 1.0.1", + "mars-rewards-collector-base", + "osmosis-std 0.14.0", + "schemars", + "serde", + "thiserror", +] + [[package]] name = "mars-swapper" version = "1.0.0" @@ -929,7 +1123,7 @@ dependencies = [ "cosmwasm-schema", "cosmwasm-std", "cw-storage-plus", - "cw2", + "cw2 1.0.1 (registry+https://github.com/rust-lang/crates.io-index)", "mars-osmosis", "mars-owner", "mars-swapper", @@ -940,6 +1134,47 @@ dependencies = [ "thiserror", ] +[[package]] +name = "mars-testing" +version = "1.0.1" +source = "git+https://github.com/mars-protocol/red-bank?rev=00301d60c38af09d8eb7980355009e2f00c6f41f#00301d60c38af09d8eb7980355009e2f00c6f41f" +dependencies = [ + "anyhow", + "cosmwasm-std", + "cw-multi-test", + "mars-address-provider", + "mars-incentives", + "mars-oracle-osmosis", + "mars-osmosis", + "mars-red-bank", + "mars-red-bank-types 1.0.1", + "mars-rewards-collector-osmosis", + "osmosis-std 0.14.0", + "prost 0.11.8", + "schemars", + "serde", + "thiserror", +] + +[[package]] +name = "mars-utils" +version = "1.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "12bae572eda20842ade4bf8ab09ce0856cae5cff89dbeb7c51e9123489e48256" +dependencies = [ + "cosmwasm-std", + "thiserror", +] + +[[package]] +name = "mars-utils" +version = "1.0.1" +source = "git+https://github.com/mars-protocol/red-bank?rev=00301d60c38af09d8eb7980355009e2f00c6f41f#00301d60c38af09d8eb7980355009e2f00c6f41f" +dependencies = [ + "cosmwasm-std", + "thiserror", +] + [[package]] name = "memchr" version = "2.5.0" diff --git a/Cargo.toml b/Cargo.toml index 320c6d4b2..878886568 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,6 +1,7 @@ [workspace] members = [ "contracts/swapper/*", + "contracts/asset-params", "packages/*" ] @@ -10,6 +11,7 @@ authors = [ "Gabe R. ", "Larry Engineer ", "Piotr Babel ", + "Brianna M. " ] license = "GPL-3.0-or-later" edition = "2021" @@ -43,8 +45,10 @@ wasm-bindgen = "0.2.84" # packages mars-osmosis = { git = "https://github.com/mars-protocol/red-bank", rev = "00301d60c38af09d8eb7980355009e2f00c6f41f" } mars-red-bank-types = "1.0.0" -mars-owner = "1.0.0" +mars-owner = { version = "1.0.0", features = ["emergency-owner"] } mars-swapper = { path = "packages/mars-swapper" } +mars-utils = "1.0.0" +mars-testing = { git = "https://github.com/mars-protocol/red-bank", rev = "00301d60c38af09d8eb7980355009e2f00c6f41f" } # contracts mars-swapper-base = { version = "1.0.0", path = "contracts/swapper/base" } diff --git a/README.md b/README.md index 44dc94fc3..774bc4507 100644 --- a/README.md +++ b/README.md @@ -1 +1,17 @@ # Mars Protocol: Common Contracts + +## Asset-Params Contract +This contract holds the following values for all the assets in Mars Protocol. +- **Reserve Factor:** Percentage of borrowed interest that stays in the protocol as fees +- **Max Loan To Value:** Max percentage of collateral that can be borrowed +- **Liquidation Threshold:** LTV at which the loan is defined as under collateralized and can be liquidated +- **Liquidation Bonus:** Percentage of extra collateral the liquidator gets as a bonus +- **Deposit Enabled:** Is the asset able to be deposited into the Red Bank +- **Borrow Enabled:** Is the asset able to be borrowed from the Red Bank +- **Target Utilization Rate:** + - Base: Interest Rate at 0 utilization rate + - slope 1: Slope for when U < Uoptimal + - slope 2: Slope for when U > Uoptimal +- **Deposit Cap:** Max amount that can be deposited into the Red Bank + +Note: Rover Vaults only utilize max loan to value, liquidation threshold, and deposit cap parameters, while Red Bank Markets utilize all of the above parameters. \ No newline at end of file diff --git a/contracts/asset-params/Cargo.toml b/contracts/asset-params/Cargo.toml new file mode 100644 index 000000000..05eb2c411 --- /dev/null +++ b/contracts/asset-params/Cargo.toml @@ -0,0 +1,38 @@ +[package] +name = "mars-params" +version = { workspace = true } +authors = { workspace = true } +license = { workspace = true } +edition = { workspace = true } +repository = { workspace = true } +homepage = { workspace = true } +documentation = { workspace = true } +keywords = { workspace = true } + +[lib] +crate-type = ["cdylib", "rlib"] + +[features] +# for quicker tests, cargo test --lib +# for more explicit tests, cargo test --features=backtraces +backtraces = ["cosmwasm-std/backtraces"] +library = [] + +[dependencies] +cosmwasm-schema = { workspace = true } +cosmwasm-std = { workspace = true } +cw2 = { workspace = true } +cw-item-set = { workspace = true } +cw-paginate = { workspace = true } +cw-storage-plus = { workspace = true } +mars-red-bank-types = { workspace = true } +mars-owner = { workspace = true } +mars-utils = { workspace = true } +schemars = { workspace = true } +serde = { workspace = true } +thiserror = { workspace = true } +mars-testing = { workspace = true } + +[dev-dependencies] +anyhow = { workspace = true } +cw-multi-test = { workspace = true } \ No newline at end of file diff --git a/contracts/asset-params/src/contract.rs b/contracts/asset-params/src/contract.rs new file mode 100644 index 000000000..e44d3cc7b --- /dev/null +++ b/contracts/asset-params/src/contract.rs @@ -0,0 +1,88 @@ +use cosmwasm_std::{Binary, Decimal, Deps, DepsMut, entry_point, Env, MessageInfo, Response, to_binary}; +use cw2::set_contract_version; +use mars_owner::OwnerInit::SetInitialOwner; +use mars_utils::error::ValidationError; +use mars_utils::helpers::decimal_param_le_one; +use crate::execute::{init_asset, init_or_update_vault, update_asset, update_close_factor, update_owner}; +use crate::query::{query_asset_params, query_config, query_vault_config}; +use crate::error::{ContractError, ContractResult}; +use crate::msg::{ExecuteMsg, InstantiateMsg, QueryMsg}; +use crate::state::{CLOSE_FACTOR, OWNER}; + +const CONTRACT_NAME: &str = env!("CARGO_PKG_NAME"); +const CONTRACT_VERSION: &str = env!("CARGO_PKG_VERSION"); + +#[entry_point] +pub fn instantiate( + deps: DepsMut, + _env: Env, + _info: MessageInfo, + msg: InstantiateMsg, +) -> ContractResult { + set_contract_version(deps.storage, format!("crates.io:{CONTRACT_NAME}"), CONTRACT_VERSION)?; + + validate_cf(msg.close_factor,"close-factor")?; + + CLOSE_FACTOR.save(deps.storage, &msg.close_factor)?; + + OWNER.initialize( + deps.storage, + deps.api, + SetInitialOwner { + owner: msg.owner.clone(), + }, + )?; + Ok(Response::default()) +} + +#[entry_point] +pub fn execute( + deps: DepsMut, + info: MessageInfo, + msg: ExecuteMsg, +) -> ContractResult { + match msg { + ExecuteMsg::UpdateOwner(update) => update_owner(deps, info, update), + ExecuteMsg::UpdateCloseFactor { + close_factor, + } => update_close_factor(deps, info, close_factor), + ExecuteMsg::InitAsset { + denom, + params, + } => init_asset(deps, info, denom, params), + ExecuteMsg::UpdateAsset { + denom, + params, + } => update_asset(deps, info, denom, params), + ExecuteMsg::InitOrUpdateVault { + address, + config, + } => init_or_update_vault(deps, info, address, config), + } +} + +#[entry_point] +pub fn query(deps: Deps, msg: QueryMsg) -> Result { + let res = match msg { + QueryMsg::Config {} => to_binary(&query_config(deps)?), + QueryMsg::AssetParamsResponse { + denom, + } => to_binary(&query_asset_params(deps, denom)?), + QueryMsg::VaultConfigsResponse { + address, + } => to_binary(&query_vault_config(deps, address)?), + }; + res.map_err(Into::into) +} + +pub fn validate_cf(param_value: Decimal, param_name: &str) -> Result<(), ValidationError> { + if !param_value.le(&Decimal::one()) { + Err(ValidationError::InvalidParam { + param_name: param_name.to_string(), + invalid_value: param_value.to_string(), + predicate: "<= 1".to_string(), + }) + } else { + Ok(()) + } +} \ No newline at end of file diff --git a/contracts/asset-params/src/error.rs b/contracts/asset-params/src/error.rs new file mode 100644 index 000000000..0d29ad384 --- /dev/null +++ b/contracts/asset-params/src/error.rs @@ -0,0 +1,32 @@ +use cosmwasm_std::StdError; +use mars_owner::OwnerError; +use thiserror::Error; +pub use mars_utils::error::ValidationError; + +pub type ContractResult = Result; + +#[derive(Error, Debug, PartialEq)] +pub enum ContractError { + #[error("{0}")] + Std(#[from] StdError), + + #[error("{0}")] + Owner(#[from] OwnerError), + + #[error("Asset is already initialized")] + AssetAlreadyInitialized {}, + + #[error("Asset not initialized")] + AssetNotInitialized {}, + + #[error("{reason:?}")] + InvalidConfig { + reason: String, + }, + + #[error("Unauthorized")] + Unauthorized {}, + + #[error("{0}")] + Validation(#[from] ValidationError), +} diff --git a/contracts/asset-params/src/execute.rs b/contracts/asset-params/src/execute.rs new file mode 100644 index 000000000..56103da49 --- /dev/null +++ b/contracts/asset-params/src/execute.rs @@ -0,0 +1,220 @@ +use cosmwasm_std::{Addr, Decimal, Env, Uint128}; + +pub const CONTRACT_NAME: &str = "crates.io:mars-asset-params"; +pub const CONTRACT_VERSION: &str = env!("CARGO_PKG_VERSION"); + +use crate::state::{ASSET_PARAMS, VAULT_CONFIGS}; +use crate::state::{ + CLOSE_FACTOR, OWNER, +}; +use cosmwasm_std::{DepsMut, MessageInfo, Response}; +use mars_owner::{OwnerError, OwnerUpdate}; +use mars_red_bank_types::address_provider::MarsAddressType; +use mars_red_bank_types::error::MarsError; +use mars_red_bank_types::red_bank::{InitOrUpdateAssetParams, Market}; +use mars_utils::helpers::validate_native_denom; +use crate::error::{ContractError, ContractResult}; +use crate::error::ContractError::InvalidConfig; +use crate::types::{AssetParams, VaultConfigs}; + +pub fn update_owner( + deps: DepsMut, + info: MessageInfo, + update: OwnerUpdate, +) -> ContractResult { + Ok(OWNER.update(deps, info, update)?) +} + +pub fn update_close_factor( + deps: DepsMut, + info: MessageInfo, + max_close_factor: Decimal, +) -> Result { + OWNER.assert_owner(deps.storage, &info.sender)?; + + assert_lte_to_one(&max_close_factor)?; + + CLOSE_FACTOR.save(deps.storage, &max_close_factor)?; + let response = Response::new() + .add_attribute("key", "max_close_factor") + .add_attribute("value", max_close_factor.to_string()); + + Ok(response) +} + +/// Initialize asset if it does not exist. +/// Initialization requires that all params are provided and there is no asset in state. +pub fn init_asset( + deps: DepsMut, + info: MessageInfo, + denom: String, + params: AssetParams, +) -> Result { + OWNER.assert_owner(deps.storage, &info.sender)?; + + validate_native_denom(&denom)?; + + if ASSET_PARAMS.may_load(deps.storage, &denom)?.is_some() { + return Err(ContractError::AssetAlreadyInitialized {}); + } + + params.validate()?; + + ASSET_PARAMS.save(deps.storage, &denom, ¶ms)?; + + Ok(Response::new().add_attribute("action", "init_asset").add_attribute("denom", denom)) +} + +/// Update asset with new params. +/// Updating an asset allows you to update just some params. +pub fn update_asset( + deps: DepsMut, + info: MessageInfo, + denom: String, + params: AssetParams, +) -> Result { + if OWNER.is_owner(deps.storage, &info.sender)? { + update_asset_by_owner(deps, &denom, params) + } else if OWNER.is_emergency_owner(deps.storage, &info.sender)? { + update_asset_by_emergency_owner(deps, &denom, params) + } else { + Err(OwnerError::NotOwner {}.into()) + } +} + +fn update_asset_by_owner( + deps: DepsMut, + denom: &str, + params: AssetParams, +) -> Result { + let current_params = ASSET_PARAMS.may_load(deps.storage, denom)?; + match current_params { + None => Err(ContractError::AssetNotInitialized {}), + Some(mut asset) => { + + // need two structs - one optional and one not optional + + // Destructuring a struct’s fields into separate variables in order to force + // compile error if we add more params + let AssetParams { + max_loan_to_value, + liquidation_threshold, + liquidation_bonus, + rover_whitelisted, + red_bank_deposit_enabled, + red_bank_borrow_enabled, + red_bank_deposit_cap, + interest_rate_model, + reserve_factor, + uncollateralized_loan_limit, + } = params; + + let mut response = Response::new(); + + let mut updated_asset = AssetParams { + max_loan_to_value: max_loan_to_value.unwrap_or(asset.max_loan_to_value), + liquidation_threshold: liquidation_threshold.unwrap_or(asset.liquidation_threshold), + liquidation_bonus: liquidation_bonus.unwrap_or(asset.liquidation_bonus), + rover_whitelisted: rover_whitelisted.unwrap_or(asset.rover_whitelisted), + red_bank_deposit_enabled: red_bank_deposit_enabled.unwrap_or(asset.red_bank_deposit_enabled), + red_bank_borrow_enabled: red_bank_borrow_enabled.unwrap_or(asset.red_bank_borrow_enabled), + red_bank_deposit_cap: red_bank_deposit_cap.unwrap_or(asset.red_bank_deposit_cap), + interest_rate_model: interest_rate_model.unwrap_or(asset.interest_rate_model), + reserve_factor: reserve_factor.unwrap_or(asset.reserve_factor), + uncollateralized_loan_limit: uncollateralized_loan_limit.unwrap_or(asset.uncollateralized_loan_limit), + }; + + ASSET_PARAMS.save(deps.storage, denom, &updated_asset)?; + + Ok(response.add_attribute("action", "update_asset").add_attribute("denom", denom)) + } + } +} +/// Emergency owner can only DISABLE BORROWING. +fn update_asset_by_emergency_owner( + deps: DepsMut, + denom: &str, + params: AssetParams, +) -> Result { + if let Some(mut asset) = ASSET_PARAMS.may_load(deps.storage, denom)? { + match params.red_bank_borrow_enabled { + Some(borrow_enabled) if !borrow_enabled => { + asset.red_bank_borrow_enabled = borrow_enabled; + ASSET_PARAMS.save(deps.storage, denom, &asset)?; + + Ok(Response::new() + .add_attribute("action", "emergency_update_asset") + .add_attribute("denom", denom)) + } + _ => ContractError::Unauthorized {}.into(), + } + } else { + ContractError::AssetNotInitialized {} + } +} + +pub fn assert_lte_to_one(dec: &Decimal) -> ContractResult<()> { + if dec > &Decimal::one() { + return ContractError(InvalidConfig { + reason: "value greater than one".to_string(), + }); + } + Ok(()) +} + +pub fn init_or_update_vault( + deps: DepsMut, + info: MessageInfo, + address: Addr, + config: VaultConfigs, +) -> Result { + OWNER.assert_owner(deps.storage, &info.sender)?; + + // Destructuring a struct’s fields into separate variables in order to force + // compile error if we add more params + let VaultConfigs { + deposit_cap, + max_loan_to_value, + liquidation_threshold, + rover_whitelisted, + } = config; + + let config_status = VAULT_CONFIGS.may_load(deps.storage, &address)?; + match config_status { + None => { + // All fields should be available + let available = max_loan_to_value.is_some() + && deposit_cap.is_some() + && liquidation_threshold.is_some() + && rover_whitelisted.is_some(); + + if !available { + return Err(MarsError::InstantiateParamsUnavailable {}.into()); + } + let mut response = Response::new(); + let new_config = VaultConfigs { + deposit_cap: deposit_cap.unwrap(), + max_loan_to_value: max_loan_to_value.unwrap(), + liquidation_threshold: liquidation_threshold.unwrap(), + rover_whitelisted: rover_whitelisted.unwrap(), + }; + VAULT_CONFIGS.save(deps.storage, &address, &new_config)?; + Ok(response.add_attribute("action", "init_vault").add_attribute("address", address)) + } + Some(mut config) => { + let mut updated_config = VaultConfigs { + deposit_cap: deposit_cap.unwrap_or(config.deposit_cap), + max_loan_to_value: max_loan_to_value.unwrap_or(config.max_loan_to_value), + liquidation_threshold: liquidation_threshold.unwrap_or(config.liquidation_threshold), + rover_whitelisted: rover_whitelisted.unwrap_or(config.rover_whitelisted), + }; + + let mut response = Response::new(); + + VAULT_CONFIGS.save(deps.storage, &address, &updated_config)?; + + Ok(response.add_attribute("action", "update_vault_config").add_attribute("address", address)) + } + } +} + diff --git a/contracts/asset-params/src/lib.rs b/contracts/asset-params/src/lib.rs new file mode 100644 index 000000000..97b02b0ff --- /dev/null +++ b/contracts/asset-params/src/lib.rs @@ -0,0 +1,7 @@ +pub mod contract; +pub mod execute; +pub mod msg; +pub mod query; +pub mod state; +pub mod error; +pub mod types; diff --git a/contracts/asset-params/src/msg.rs b/contracts/asset-params/src/msg.rs new file mode 100644 index 000000000..60c549939 --- /dev/null +++ b/contracts/asset-params/src/msg.rs @@ -0,0 +1,64 @@ +use cosmwasm_schema::{cw_serde, QueryResponses}; +use cosmwasm_std::{Addr, Decimal}; +use mars_owner::OwnerUpdate; +use mars_utils::helpers::decimal_param_le_one; +use crate::error::ValidationError; +use crate::types::{AssetParams, VaultConfigs, ConfigResponse}; + +#[cw_serde] +pub struct InstantiateMsg { + /// Contract's owner + pub owner: String, + /// Contract's emergency owner + pub emergency_owner: String, + /// The maximum percent a liquidator can decrease the debt amount of the liquidatee + pub close_factor: Decimal, +} + +#[cw_serde] +pub enum ExecuteMsg { + /// Manages owner state (only owner can call) + UpdateOwner(OwnerUpdate), + /// Update outpost's universal close factor (only owner can call) + UpdateCloseFactor { + close_factor: Decimal, + }, + /// Initialize an asset on the money market (only owner can call) + InitAsset { + /// Asset related info + denom: String, + /// Asset parameters + params: AssetParams, + }, + /// Update an asset on the money market (only owner can call) + UpdateAsset { + /// Asset related info + denom: String, + /// Asset parameters + params: AssetParams, + }, + /// Init or Update the vault configs on Rover (only owner can call) + InitOrUpdateVault { + /// Vault related info + address: Addr, + /// Vault configuration + config: VaultConfigs, + } +} +#[cw_serde] +#[derive(QueryResponses)] +pub enum QueryMsg { + /// Config returns the owners and close factor + #[returns(ConfigResponse)] + Config {}, + /// Asset Params that are relevant to the Red Bank Markets and Rover + #[returns(AssetParams)] + AssetParamsResponse { + denom: String, + }, + /// Rover vault configs + #[returns(VaultConfigs)] + VaultConfigsResponse { + address: Addr, + }, +} \ No newline at end of file diff --git a/contracts/asset-params/src/query.rs b/contracts/asset-params/src/query.rs new file mode 100644 index 000000000..d01af163c --- /dev/null +++ b/contracts/asset-params/src/query.rs @@ -0,0 +1,40 @@ +use cosmwasm_std::{Addr, Deps}; +use crate::state::{ASSET_PARAMS, CLOSE_FACTOR, OWNER, VAULT_CONFIGS}; +use crate::error::ContractResult; +use crate::types::{AssetParams, ConfigResponse, VaultConfigs}; + +pub fn query_config(deps: Deps) -> ContractResult { + let owner_res = OWNER.query(deps.storage)?; + Ok(ConfigResponse { + owner: owner_res.owner, + proposed_new_owner: owner_res.proposed, + emergency_owner: owner_res.emergency_owner, + close_factor: CLOSE_FACTOR.load(deps.storage)?, + }) +} + +pub fn query_asset_params(deps: Deps, denom: String) -> ContractResult { + let config = ASSET_PARAMS.load(deps.storage, &denom)?; + Ok(AssetParams { + reserve_factor: config.reserve_factor, + max_loan_to_value: config.max_loan_to_value, + liquidation_threshold: config.liquidation_threshold, + liquidation_bonus: config.liquidation_bonus, + interest_rate_model: config.interest_rate_model, + red_bank_deposit_enabled: config.red_bank_deposit_enabled, + red_bank_borrow_enabled: config.red_bank_borrow_enabled, + red_bank_deposit_cap: config.red_bank_deposit_cap, + rover_whitelisted: config.rover_whitelisted, + uncollateralized_loan_limit: config.uncollateralized_loan_limit, + }) +} + +pub fn query_vault_config(deps: Deps, address: Addr) -> ContractResult { + let config = VAULT_CONFIGS.load(deps.storage, &address)?; + Ok(VaultConfigs { + max_loan_to_value: config.max_loan_to_value, + liquidation_threshold: config.liquidation_threshold, + rover_whitelisted: config.rover_whitelisted, + deposit_cap: config.deposit_cap, + }) +} diff --git a/contracts/asset-params/src/state.rs b/contracts/asset-params/src/state.rs new file mode 100644 index 000000000..e85db459d --- /dev/null +++ b/contracts/asset-params/src/state.rs @@ -0,0 +1,9 @@ +use cosmwasm_std::{Addr, Decimal}; +use cw_storage_plus::{Item, Map}; +use mars_owner::Owner; +use crate::types::{AssetParams, VaultConfigs}; + +pub const OWNER: Owner = Owner::new("owner"); +pub const CLOSE_FACTOR: Item = Item::new("max_close_factor"); +pub const ASSET_PARAMS: Map<&str, AssetParams> = Map::new("asset_params"); +pub const VAULT_CONFIGS: Map<&Addr, VaultConfigs> = Map::new("vault_configs"); diff --git a/contracts/asset-params/src/types.rs b/contracts/asset-params/src/types.rs new file mode 100644 index 000000000..787e833ec --- /dev/null +++ b/contracts/asset-params/src/types.rs @@ -0,0 +1,61 @@ +use cosmwasm_schema::cw_serde; +use cosmwasm_std::{Coin, Decimal, Uint128}; +use mars_red_bank_types::red_bank::InterestRateModel; +use mars_utils::error::ValidationError; +use mars_utils::helpers::{decimal_param_le_one, decimal_param_lt_one}; + +#[cw_serde] +pub struct AssetParams { + pub max_loan_to_value: Decimal, + pub liquidation_threshold: Decimal, + pub liquidation_bonus: Decimal, + pub rover_whitelisted: bool, + pub red_bank_deposit_enabled: bool, + pub red_bank_borrow_enabled: bool, + pub red_bank_deposit_cap: Uint128, + pub interest_rate_model: InterestRateModel, + pub reserve_factor: Decimal, + pub uncollateralized_loan_limit: Uint128, +} + +impl AssetParams{ + pub fn validate(&self) -> Result<(), ValidationError> { + decimal_param_lt_one(self.reserve_factor, "reserve_factor")?; + decimal_param_le_one(self.max_loan_to_value, "max_loan_to_value")?; + decimal_param_le_one(self.liquidation_threshold, "liquidation_threshold")?; + decimal_param_le_one(self.liquidation_bonus, "liquidation_bonus")?; + + // liquidation_threshold should be greater than max_loan_to_value + if self.liquidation_threshold <= self.max_loan_to_value { + return Err(ValidationError::InvalidParam { + param_name: "liquidation_threshold".to_string(), + invalid_value: self.liquidation_threshold.to_string(), + predicate: format!("> {} (max LTV)", self.max_loan_to_value), + }); + } + + self.interest_rate_model.validate()?; + + Ok(()) + } +} + +#[cw_serde] +pub struct VaultConfigs { + pub deposit_cap: Coin, + pub max_loan_to_value: Decimal, + pub liquidation_threshold: Decimal, + pub rover_whitelisted: bool, +} + +#[cw_serde] +pub struct ConfigResponse { + /// The contract's owner + pub owner: Option, + /// The contract's proposed owner + pub proposed_new_owner: Option, + /// The contract's emergency owner + pub emergency_owner: Option, + /// Maximum percentage of outstanding debt that can be covered by a liquidator + pub close_factor: Decimal, +} \ No newline at end of file diff --git a/contracts/asset-params/tests/test_admin.rs b/contracts/asset-params/tests/test_admin.rs new file mode 100644 index 000000000..7683ea0cb --- /dev/null +++ b/contracts/asset-params/tests/test_admin.rs @@ -0,0 +1,213 @@ +use cosmwasm_std::{Addr, Decimal, from_binary}; +use mars_owner::OwnerError::{NotOwner, NotProposedOwner, StateTransitionError}; +use mars_owner::OwnerUpdate; +use mars_testing::{mock_dependencies, mock_env, mock_env_at_block_time, mock_info, MockEnvParams}; +use mars_testing::integration::mock_env::MockEnv; +use mars_params::contract::{execute, instantiate, query}; +use mars_params::error::{ContractError, ValidationError}; +use mars_params::error::ContractError::Owner; +use mars_params::msg::{ExecuteMsg, InstantiateMsg, QueryMsg}; +use mars_params::types::ConfigResponse; + +#[test] +fn proper_initialization() { + let mut deps = mock_dependencies(&[]); + + // * + // init config with close_factor greater than 1 + // * + let mut close_factor = Decimal::from_ratio(13u128, 10u128); + let msg = InstantiateMsg { + owner: "owner".to_string(), + emergency_owner: "emergency_owner".to_string(), + close_factor + }; + + let info = mock_info("owner"); + let error_res = instantiate(deps.as_mut(), env.clone(), info, msg).unwrap_err(); + assert_eq!( + error_res, + ValidationError::InvalidParam { + param_name: "close_factor".to_string(), + invalid_value: "1.3".to_string(), + predicate: "<= 1".to_string(), + } + .into() + ); + + // * + // init config with valid params + // * + close_factor = Decimal::from_ratio(1u128, 2u128); + let msg = InstantiateMsg { + owner: "owner".to_string(), + emergency_owner: "emergency_owner".to_string(), + close_factor + }; + + let info = mock_info("owner"); + let res = instantiate(deps.as_mut(), env.clone(), info, msg).unwrap(); + assert_eq!(0, res.messages.len()); + + let res = query(deps.as_ref(), QueryMsg::Config {}).unwrap(); + let value: ConfigResponse = from_binary(&res).unwrap(); + assert_eq!(value.owner.unwrap(), "owner"); + assert_eq!(value.emergency_owner.unwrap(), "emergency_owner"); +} + +#[test] +fn update_close_factor() { + let mut deps = mock_dependencies(&[]); + // * + // init config with valid params + // * + let mut close_factor = Decimal::from_ratio(1u128, 4u128); + let msg = InstantiateMsg { + owner: "owner".to_string(), + emergency_owner: "emergency_owner".to_string(), + close_factor + }; + + let info = mock_info("owner"); + let _res = instantiate(deps.as_mut(), env.clone(), info, msg).unwrap(); + + // * + // non owner is not authorized + // * + let msg = ExecuteMsg::UpdateCloseFactor { + close_factor, + }; + let info = mock_info("somebody"); + let error_res = execute(deps.as_mut(), info, msg).unwrap_err(); + assert_eq!(error_res, ContractError::Owner(NotOwner {})); +} + +#[test] +fn propose_new_owner() { + let mut mock = MockEnv::new().build().unwrap(); + let original_config = mock.query_config(); + + let new_owner = "new_owner".to_string(); + + // only owner can propose new owners + let bad_guy = Addr::unchecked("bad_guy"); + let res = mock.update_owner( + &bad_guy, + OwnerUpdate::ProposeNewOwner { + proposed: bad_guy.to_string(), + }, + ); + assert_err(res, Owner(NotOwner {})); + + mock.update_owner( + &Addr::unchecked(original_config.owner.clone().unwrap()), + OwnerUpdate::ProposeNewOwner { + proposed: new_owner.clone(), + }, + ) + .unwrap(); + + let new_config = mock.query_config(); + + assert_eq!(new_config.owner, original_config.owner); + assert_ne!(new_config.proposed_new_owner, original_config.proposed_new_owner); + assert_eq!(new_config.proposed_new_owner, Some(new_owner)); +} + +#[test] +fn clear_proposed() { + let mut mock = MockEnv::new().build().unwrap(); + let original_config = mock.query_config(); + + let new_owner = "new_owner".to_string(); + + mock.update_owner( + &Addr::unchecked(original_config.owner.clone().unwrap()), + OwnerUpdate::ProposeNewOwner { + proposed: new_owner.clone(), + }, + ) + .unwrap(); + + let interim_config = mock.query_config(); + + assert_eq!(interim_config.proposed_new_owner, Some(new_owner)); + + // only owner can clear + let bad_guy = Addr::unchecked("bad_guy"); + let res = mock.update_owner(&bad_guy, OwnerUpdate::ClearProposed); + assert_err(res, Owner(NotOwner {})); + + mock.update_owner( + &Addr::unchecked(original_config.owner.clone().unwrap()), + OwnerUpdate::ClearProposed, + ) + .unwrap(); + + let latest_config = mock.query_config(); + + assert_eq!(latest_config.owner, original_config.owner); + assert_ne!(latest_config.proposed_new_owner, interim_config.proposed_new_owner); + assert_eq!(latest_config.proposed_new_owner, None); +} + +#[test] +fn accept_owner_role() { + let mut mock = MockEnv::new().build().unwrap(); + let original_config = mock.query_config(); + + let new_owner = "new_owner".to_string(); + + mock.update_owner( + &Addr::unchecked(original_config.owner.clone().unwrap()), + OwnerUpdate::ProposeNewOwner { + proposed: new_owner.clone(), + }, + ) + .unwrap(); + + // Only proposed owner can accept + let res = mock.update_owner( + &Addr::unchecked(original_config.owner.unwrap()), + OwnerUpdate::AcceptProposed, + ); + assert_err(res, Owner(NotProposedOwner {})); + + mock.update_owner(&Addr::unchecked(new_owner.clone()), OwnerUpdate::AcceptProposed).unwrap(); + + let new_config = mock.query_config(); + + assert_eq!(new_config.owner.unwrap(), new_owner); + assert_eq!(new_config.proposed_new_owner, None); +} + +#[test] +fn abolish_owner_role() { + let mut mock = MockEnv::new().build().unwrap(); + let original_config = mock.query_config(); + + // Only owner can abolish role + let bad_guy = Addr::unchecked("bad_guy"); + let res = mock.update_owner(&bad_guy, OwnerUpdate::AbolishOwnerRole); + assert_err(res, Owner(NotOwner {})); + + mock.update_owner( + &Addr::unchecked(original_config.owner.clone().unwrap()), + OwnerUpdate::AbolishOwnerRole, + ) + .unwrap(); + + let new_config = mock.query_config(); + + assert_eq!(new_config.owner, None); + assert_eq!(new_config.proposed_new_owner, None); + + // No new updates can occur + let res = mock.update_owner( + &Addr::unchecked(original_config.owner.clone().unwrap()), + OwnerUpdate::ProposeNewOwner { + proposed: original_config.owner.unwrap(), + }, + ); + assert_err(res, Owner(StateTransitionError {})); +} diff --git a/contracts/asset-params/tests/test_assets.rs b/contracts/asset-params/tests/test_assets.rs new file mode 100644 index 000000000..78c4ee999 --- /dev/null +++ b/contracts/asset-params/tests/test_assets.rs @@ -0,0 +1,490 @@ +use cosmwasm_std::{attr, Decimal, Uint128}; +use mars_owner::OwnerError::NotOwner; +use mars_red_bank_types::error::MarsError; +use mars_red_bank_types::red_bank::InterestRateModel; +use mars_testing::{mock_dependencies, mock_info}; +use mars_utils::error::ValidationError; +use mars_params::contract::{execute, instantiate}; +use mars_params::error::ContractError; +use mars_params::msg::{ExecuteMsg, InstantiateMsg}; +use mars_params::types::AssetParams; + +#[test] +fn init_asset() { + let mut deps = mock_dependencies(&[]); + let mut close_factor = Decimal::from_ratio(1u128, 4u128); + let msg = InstantiateMsg { + owner: "owner".to_string(), + emergency_owner: "emergency_owner".to_string(), + close_factor + }; + let info = mock_info("owner"); + instantiate(deps.as_mut(), env.clone(), info, msg).unwrap(); + + let ir_model = InterestRateModel { + optimal_utilization_rate: Decimal::one(), + base: Decimal::percent(5), + slope_1: Decimal::zero(), + slope_2: Decimal::zero(), + }; + + let params = AssetParams { + max_loan_to_value: Some(Decimal::from_ratio(8u128, 10u128)), + reserve_factor: Some(Decimal::from_ratio(1u128, 100u128)), + liquidation_threshold: Some(Decimal::one()), + liquidation_bonus: Some(Decimal::zero()), + rover_whitelisted: false, + red_bank_deposit_enabled: false, + red_bank_borrow_enabled: false, + red_bank_deposit_cap: Default::default(), + interest_rate_model: Some(ir_model.clone()), + uncollateralized_loan_limit: Default::default(), + }; + + // non owner is not authorized + { + let msg = ExecuteMsg::InitAsset { + denom: "someasset".to_string(), + params: params.clone(), + }; + let info = mock_info("somebody"); + let error_res = execute(deps.as_mut(), info, msg).unwrap_err(); + assert_eq!(error_res, ContractError::Owner(NotOwner {})); + } + + // init incorrect asset denom - error 2 + { + let msg = ExecuteMsg::InitAsset { + denom: "ahdbufenf&*!-".to_string(), + params: params.clone(), + }; + let info = mock_info("owner"); + let err = execute(deps.as_mut(), info, msg); + assert_eq!( + err, + Err(ContractError::Validation(ValidationError::InvalidDenom { + reason: "Not all characters are ASCII alphanumeric or one of: / : . _ -" + .to_string() + })) + ); + } + // init asset with empty params + // NEED OPTIONAL STRUCT + { + let empty_asset_params = AssetParams { + max_loan_to_value: Default::default(), + liquidation_threshold: Default::default(), + liquidation_bonus: Default::default(), + rover_whitelisted: false, + red_bank_deposit_enabled: false, + red_bank_borrow_enabled: false, + red_bank_deposit_cap: Default::default(), + interest_rate_model: Default::default(), + reserve_factor: Default::default(), + uncollateralized_loan_limit: Default::default(), + }; + let msg = ExecuteMsg::InitAsset { + denom: "someasset".to_string(), + params: empty_asset_params, + }; + let info = mock_info("owner"); + let error_res = execute(deps.as_mut(), info, msg).unwrap_err(); + assert_eq!(error_res, MarsError::InstantiateParamsUnavailable {}.into()); + } + + // init asset with max_loan_to_value greater than 1 + { + let invalid_asset_params = AssetParams { + max_loan_to_value: Some(Decimal::from_ratio(11u128, 10u128)), + ..params.clone() + }; + let msg = ExecuteMsg::InitAsset { + denom: "someasset".to_string(), + params: invalid_asset_params, + }; + let info = mock_info("owner", &[]); + let error_res = execute(deps.as_mut(), info, msg).unwrap_err(); + assert_eq!( + error_res, + ValidationError::InvalidParam { + param_name: "max_loan_to_value".to_string(), + invalid_value: "1.1".to_string(), + predicate: "<= 1".to_string(), + } + .into() + ); + } + + // init asset with liquidation_threshold greater than 1 + { + let invalid_asset_params = AssetParams { + liquidation_threshold: Some(Decimal::from_ratio(11u128, 10u128)), + ..params.clone() + }; + let msg = ExecuteMsg::InitAsset { + denom: "someasset".to_string(), + params: invalid_asset_params, + }; + let info = mock_info("owner", &[]); + let error_res = execute(deps.as_mut(), info, msg).unwrap_err(); + assert_eq!( + error_res, + ValidationError::InvalidParam { + param_name: "liquidation_threshold".to_string(), + invalid_value: "1.1".to_string(), + predicate: "<= 1".to_string(), + } + .into() + ); + } + + // init asset with liquidation_bonus greater than 1 + { + let invalid_asset_params = AssetParams { + liquidation_bonus: Some(Decimal::from_ratio(11u128, 10u128)), + ..params.clone() + }; + let msg = ExecuteMsg::InitAsset { + denom: "someasset".to_string(), + params: invalid_asset_params, + }; + let info = mock_info("owner"); + let error_res = execute(deps.as_mut(), info, msg).unwrap_err(); + assert_eq!( + error_res, + ValidationError::InvalidParam { + param_name: "liquidation_bonus".to_string(), + invalid_value: "1.1".to_string(), + predicate: "<= 1".to_string(), + } + .into() + ); + } + + // init asset where LTV >= liquidity threshold + { + let invalid_asset_params = AssetParams { + max_loan_to_value: Some(Decimal::from_ratio(5u128, 10u128)), + liquidation_threshold: Some(Decimal::from_ratio(5u128, 10u128)), + ..params.clone() + }; + let msg = ExecuteMsg::InitAsset { + denom: "someasset".to_string(), + params: invalid_asset_params, + }; + let info = mock_info("owner"); + let error_res = execute(deps.as_mut(), info, msg).unwrap_err(); + assert_eq!( + error_res, + ValidationError::InvalidParam { + param_name: "liquidation_threshold".to_string(), + invalid_value: "0.5".to_string(), + predicate: "> 0.5 (max LTV)".to_string() + } + .into() + ); + } + + + // init asset where optimal utilization rate > 1 + { + let invalid_asset_params = AssetParams { + interest_rate_model: Some(InterestRateModel { + optimal_utilization_rate: Decimal::percent(110), + ..ir_model + }), + ..params + }; + let msg = ExecuteMsg::InitAsset { + denom: "someasset".to_string(), + params: invalid_asset_params, + }; + let info = mock_info("owner"); + let error_res = execute(deps.as_mut(), info, msg).unwrap_err(); + assert_eq!( + error_res, + ValidationError::InvalidParam { + param_name: "optimal_utilization_rate".to_string(), + invalid_value: "1.1".to_string(), + predicate: "<= 1".to_string() + } + .into() + ); + } + + // owner is authorized + { + let msg = ExecuteMsg::InitAsset { + denom: "someasset".to_string(), + params: params.clone(), + }; + let info = mock_info("owner"); + let res = execute(deps.as_mut(), info, msg).unwrap(); + + // should have asset market with Canonical default address + let market = MARKETS.load(&deps.storage, "someasset").unwrap(); + assert_eq!(market.denom, "someasset"); + + // should have unlimited deposit cap + assert_eq!(market.deposit_cap, Uint128::MAX); + + assert_eq!(res.attributes, vec![attr("action", "init_asset"), attr("denom", "someasset")]); + } + + // can't init more than once + { + let msg = ExecuteMsg::InitAsset { + denom: "someasset".to_string(), + params, + }; + let info = mock_info("owner"); + let error_res = execute(deps.as_mut(), info, msg).unwrap_err(); + assert_eq!(error_res, ContractError::AssetAlreadyInitialized {}); + } +} + +#[test] +fn update_asset() { + let mut deps = mock_dependencies(&[]); + let start_time = 100000000; + + let mut close_factor = Decimal::from_ratio(1u128, 4u128); + let msg = InstantiateMsg { + owner: "owner".to_string(), + emergency_owner: "emergency_owner".to_string(), + close_factor + }; + let info = mock_info("owner"); + instantiate(deps.as_mut(), env.clone(), info, msg).unwrap(); + + let ir_model = InterestRateModel { + optimal_utilization_rate: Decimal::one(), + base: Decimal::percent(5), + slope_1: Decimal::zero(), + slope_2: Decimal::zero(), + }; + + let params = AssetParams { + max_loan_to_value: Some(Decimal::from_ratio(50u128, 100u128)), + reserve_factor: Some(Decimal::from_ratio(1u128, 100u128)), + liquidation_threshold: Some(Decimal::from_ratio(80u128, 100u128)), + liquidation_bonus: Some(Decimal::from_ratio(10u128, 100u128)), + rover_whitelisted: false, + red_bank_deposit_enabled: false, + red_bank_borrow_enabled: false, + red_bank_deposit_cap: Default::default(), + interest_rate_model: Some(ir_model.clone()), + uncollateralized_loan_limit: Default::default(), + }; + + // non owner is not authorized + { + let msg = ExecuteMsg::UpdateAsset { + denom: "someasset".to_string(), + params: params.clone(), + }; + let info = mock_info("somebody"); + let error_res = execute(deps.as_mut(), info, msg).unwrap_err(); + assert_eq!(error_res, ContractError::Owner(NotOwner {})); + } + + // owner is authorized but can't update asset if not initialized first + { + let msg = ExecuteMsg::UpdateAsset { + denom: "someasset".to_string(), + params: params.clone(), + }; + let info = mock_info("owner"); + let error_res = execute(deps.as_mut(), info, msg).unwrap_err(); + assert_eq!(error_res, ContractError::AssetNotInitialized {}); + } + + // initialize asset + { + let msg = ExecuteMsg::InitAsset { + denom: "someasset".to_string(), + params: params.clone(), + }; + let info = mock_info("owner"); + let _res = execute(deps.as_mut(), info, msg).unwrap(); + } + + // update asset with max_loan_to_value greater than 1 + { + let invalid_asset_params = AssetParams { + max_loan_to_value: Some(Decimal::from_ratio(11u128, 10u128)), + ..params.clone() + }; + let msg = ExecuteMsg::UpdateAsset { + denom: "someasset".to_string(), + params: invalid_asset_params, + }; + let info = mock_info("owner"); + let error_res = execute(deps.as_mut(), info, msg).unwrap_err(); + assert_eq!( + error_res, + ValidationError::InvalidParam { + param_name: "max_loan_to_value".to_string(), + invalid_value: "1.1".to_string(), + predicate: "<= 1".to_string(), + } + .into() + ); + } + + // update asset with liquidation_threshold greater than 1 + { + let invalid_asset_params = AssetParams { + liquidation_threshold: Some(Decimal::from_ratio(11u128, 10u128)), + ..params.clone() + }; + let msg = ExecuteMsg::UpdateAsset { + denom: "someasset".to_string(), + params: invalid_asset_params, + }; + let info = mock_info("owner"); + let error_res = execute(deps.as_mut(), info, msg).unwrap_err(); + assert_eq!( + error_res, + ValidationError::InvalidParam { + param_name: "liquidation_threshold".to_string(), + invalid_value: "1.1".to_string(), + predicate: "<= 1".to_string(), + } + .into() + ); + } + + // update asset with liquidation_bonus greater than 1 + { + let invalid_asset_params = AssetParams { + liquidation_bonus: Some(Decimal::from_ratio(11u128, 10u128)), + ..params.clone() + }; + let msg = ExecuteMsg::UpdateAsset { + denom: "someasset".to_string(), + params: invalid_asset_params, + }; + let info = mock_info("owner"); + let error_res = execute(deps.as_mut(), info, msg).unwrap_err(); + assert_eq!( + error_res, + ValidationError::InvalidParam { + param_name: "liquidation_bonus".to_string(), + invalid_value: "1.1".to_string(), + predicate: "<= 1".to_string(), + } + .into() + ); + } + + // update asset where LTV >= liquidity threshold + { + let invalid_asset_params = AssetParams { + max_loan_to_value: Some(Decimal::from_ratio(6u128, 10u128)), + liquidation_threshold: Some(Decimal::from_ratio(5u128, 10u128)), + ..params + }; + let msg = ExecuteMsg::UpdateAsset { + denom: "someasset".to_string(), + params: invalid_asset_params, + }; + let info = mock_info("owner"); + let error_res = execute(deps.as_mut(), info, msg).unwrap_err(); + assert_eq!( + error_res, + ValidationError::InvalidParam { + param_name: "liquidation_threshold".to_string(), + invalid_value: "0.5".to_string(), + predicate: "> 0.6 (max LTV)".to_string() + } + .into() + ); + } + + // update asset where optimal utilization rate > 1 + { + let invalid_asset_params = AssetParams { + interest_rate_model: Some(InterestRateModel { + optimal_utilization_rate: Decimal::percent(110), + ..ir_model + }), + ..params + }; + let msg = ExecuteMsg::UpdateAsset { + denom: "someasset".to_string(), + params: invalid_asset_params, + }; + let info = mock_info("owner"); + let error_res = execute(deps.as_mut(),info, msg).unwrap_err(); + assert_eq!( + error_res, + ValidationError::InvalidParam { + param_name: "optimal_utilization_rate".to_string(), + invalid_value: "1.1".to_string(), + predicate: "<= 1".to_string() + } + .into() + ); + } + + // update asset with new params + { + let params = AssetParams { + max_loan_to_value: Some(Decimal::from_ratio(60u128, 100u128)), + reserve_factor: Some(Decimal::from_ratio(10u128, 100u128)), + liquidation_threshold: Some(Decimal::from_ratio(90u128, 100u128)), + liquidation_bonus: Some(Decimal::from_ratio(12u128, 100u128)), + rover_whitelisted: false, + red_bank_deposit_enabled: false, + red_bank_borrow_enabled: false, + red_bank_deposit_cap: Default::default(), + interest_rate_model: Some(ir_model), + uncollateralized_loan_limit: Default::default(), + }; + let msg = ExecuteMsg::UpdateAsset { + denom: "someasset".to_string(), + params: params.clone(), + }; + let info = mock_info("owner"); + + let res = execute(deps.as_mut(), info, msg).unwrap(); + assert_eq!(res.messages, vec![],); + assert_eq!( + res.attributes, + vec![attr("action", "update_asset"), attr("denom", "someasset")], + ); + + let new_market = MARKETS.load(&deps.storage, "someasset").unwrap(); + assert_eq!(params.max_loan_to_value.unwrap(), new_market.max_loan_to_value); + assert_eq!(params.reserve_factor.unwrap(), new_market.reserve_factor); + assert_eq!(params.liquidation_threshold.unwrap(), new_market.liquidation_threshold); + assert_eq!(params.liquidation_bonus.unwrap(), new_market.liquidation_bonus); + assert_eq!(params.interest_rate_model.unwrap(), new_market.interest_rate_model); + } + + // update asset with empty params + { + let market_before = MARKETS.load(&deps.storage, "someasset").unwrap(); + + let empty_asset_params = AssetParams { + max_loan_to_value: None, + reserve_factor: None, + liquidation_threshold: None, + liquidation_bonus: None, + interest_rate_model: None, + deposit_enabled: None, + borrow_enabled: None, + deposit_cap: None, + }; + let msg = ExecuteMsg::UpdateAsset { + denom: "someasset".to_string(), + params: empty_asset_params, + }; + let info = mock_info("owner"); + let res = execute(deps.as_mut(), info, msg).unwrap(); + + // no interest updated event + assert_eq!(res.events.len(), 0); + } +} diff --git a/contracts/asset-params/tests/test_vaults.rs b/contracts/asset-params/tests/test_vaults.rs new file mode 100644 index 000000000..e69de29bb From 23e6fe594f365f13dfe80a7e9b7fae1268d7c906 Mon Sep 17 00:00:00 2001 From: Gabe Rodriguez Date: Mon, 3 Apr 2023 18:40:39 +0200 Subject: [PATCH 04/17] Adding tests --- Cargo.lock | 11 - Cargo.toml | 2 +- README.md | 2 +- contracts/asset-params/src/contract.rs | 88 -- contracts/asset-params/src/execute.rs | 220 ---- contracts/asset-params/src/msg.rs | 64 -- contracts/asset-params/src/query.rs | 40 - contracts/asset-params/src/types.rs | 61 - contracts/asset-params/tests/test_admin.rs | 213 ---- contracts/asset-params/tests/test_assets.rs | 490 -------- contracts/asset-params/tests/test_vaults.rs | 0 contracts/{asset-params => params}/Cargo.toml | 1 - contracts/params/examples/schema.rs | 10 + contracts/params/src/contract.rs | 75 ++ .../{asset-params => params}/src/error.rs | 16 +- contracts/params/src/execute.rs | 144 +++ contracts/{asset-params => params}/src/lib.rs | 2 +- contracts/params/src/msg.rs | 55 + contracts/params/src/query.rs | 62 + .../{asset-params => params}/src/state.rs | 7 +- contracts/params/src/types.rs | 103 ++ contracts/params/tests/helpers/assertions.rs | 25 + contracts/params/tests/helpers/contracts.rs | 11 + contracts/params/tests/helpers/generator.rs | 41 + contracts/params/tests/helpers/mock_env.rs | 204 ++++ contracts/params/tests/helpers/mod.rs | 6 + .../params/tests/test_asset_validation.rs | 168 +++ contracts/params/tests/test_close_factor.rs | 65 ++ .../params/tests/test_emergency_powers.rs | 1 + contracts/params/tests/test_owner.rs | 47 + .../params/tests/test_update_asset_params.rs | 311 +++++ .../params/tests/test_vault_validation.rs | 99 ++ contracts/params/tests/test_vaults.rs | 304 +++++ schema.Makefile.toml | 1 + schemas/mars-params/mars-params.json | 1020 +++++++++++++++++ .../mars-swapper-osmosis.json | 35 + scripts/package.json | 24 +- scripts/tsconfig.json | 1 - .../mars-params/MarsParams.client.ts | 224 ++++ .../mars-params/MarsParams.react-query.ts | 262 +++++ .../generated/mars-params/MarsParams.types.ts | 144 +++ scripts/types/generated/mars-params/bundle.ts | 13 + .../MarsSwapperOsmosis.client.ts | 2 +- .../MarsSwapperOsmosis.react-query.ts | 2 +- .../MarsSwapperOsmosis.types.ts | 9 +- .../generated/mars-swapper-osmosis/bundle.ts | 10 +- scripts/yarn.lock | 439 +++---- 47 files changed, 3689 insertions(+), 1445 deletions(-) delete mode 100644 contracts/asset-params/src/contract.rs delete mode 100644 contracts/asset-params/src/execute.rs delete mode 100644 contracts/asset-params/src/msg.rs delete mode 100644 contracts/asset-params/src/query.rs delete mode 100644 contracts/asset-params/src/types.rs delete mode 100644 contracts/asset-params/tests/test_admin.rs delete mode 100644 contracts/asset-params/tests/test_assets.rs delete mode 100644 contracts/asset-params/tests/test_vaults.rs rename contracts/{asset-params => params}/Cargo.toml (96%) create mode 100644 contracts/params/examples/schema.rs create mode 100644 contracts/params/src/contract.rs rename contracts/{asset-params => params}/src/error.rs (59%) create mode 100644 contracts/params/src/execute.rs rename contracts/{asset-params => params}/src/lib.rs (100%) create mode 100644 contracts/params/src/msg.rs create mode 100644 contracts/params/src/query.rs rename contracts/{asset-params => params}/src/state.rs (51%) create mode 100644 contracts/params/src/types.rs create mode 100644 contracts/params/tests/helpers/assertions.rs create mode 100644 contracts/params/tests/helpers/contracts.rs create mode 100644 contracts/params/tests/helpers/generator.rs create mode 100644 contracts/params/tests/helpers/mock_env.rs create mode 100644 contracts/params/tests/helpers/mod.rs create mode 100644 contracts/params/tests/test_asset_validation.rs create mode 100644 contracts/params/tests/test_close_factor.rs create mode 100644 contracts/params/tests/test_emergency_powers.rs create mode 100644 contracts/params/tests/test_owner.rs create mode 100644 contracts/params/tests/test_update_asset_params.rs create mode 100644 contracts/params/tests/test_vault_validation.rs create mode 100644 contracts/params/tests/test_vaults.rs create mode 100644 schemas/mars-params/mars-params.json create mode 100644 scripts/types/generated/mars-params/MarsParams.client.ts create mode 100644 scripts/types/generated/mars-params/MarsParams.react-query.ts create mode 100644 scripts/types/generated/mars-params/MarsParams.types.ts create mode 100644 scripts/types/generated/mars-params/bundle.ts diff --git a/Cargo.lock b/Cargo.lock index 2c37bb245..e143938e6 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -385,16 +385,6 @@ dependencies = [ "zeroize", ] -[[package]] -name = "cw-item-set" -version = "0.7.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dea5a233bd67babedbe96a514178a64b0c597f1f38bc474fa8d63e3f26bdceb2" -dependencies = [ - "cosmwasm-std", - "cw-storage-plus", -] - [[package]] name = "cw-multi-test" version = "0.16.2" @@ -987,7 +977,6 @@ dependencies = [ "anyhow", "cosmwasm-schema", "cosmwasm-std", - "cw-item-set", "cw-multi-test", "cw-paginate", "cw-storage-plus", diff --git a/Cargo.toml b/Cargo.toml index 878886568..a65ee3c34 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,7 +1,7 @@ [workspace] members = [ "contracts/swapper/*", - "contracts/asset-params", + "contracts/params", "packages/*" ] diff --git a/README.md b/README.md index 774bc4507..9f565cb52 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,6 @@ # Mars Protocol: Common Contracts -## Asset-Params Contract +## Params Contract This contract holds the following values for all the assets in Mars Protocol. - **Reserve Factor:** Percentage of borrowed interest that stays in the protocol as fees - **Max Loan To Value:** Max percentage of collateral that can be borrowed diff --git a/contracts/asset-params/src/contract.rs b/contracts/asset-params/src/contract.rs deleted file mode 100644 index e44d3cc7b..000000000 --- a/contracts/asset-params/src/contract.rs +++ /dev/null @@ -1,88 +0,0 @@ -use cosmwasm_std::{Binary, Decimal, Deps, DepsMut, entry_point, Env, MessageInfo, Response, to_binary}; -use cw2::set_contract_version; -use mars_owner::OwnerInit::SetInitialOwner; -use mars_utils::error::ValidationError; -use mars_utils::helpers::decimal_param_le_one; -use crate::execute::{init_asset, init_or_update_vault, update_asset, update_close_factor, update_owner}; -use crate::query::{query_asset_params, query_config, query_vault_config}; -use crate::error::{ContractError, ContractResult}; -use crate::msg::{ExecuteMsg, InstantiateMsg, QueryMsg}; -use crate::state::{CLOSE_FACTOR, OWNER}; - -const CONTRACT_NAME: &str = env!("CARGO_PKG_NAME"); -const CONTRACT_VERSION: &str = env!("CARGO_PKG_VERSION"); - -#[entry_point] -pub fn instantiate( - deps: DepsMut, - _env: Env, - _info: MessageInfo, - msg: InstantiateMsg, -) -> ContractResult { - set_contract_version(deps.storage, format!("crates.io:{CONTRACT_NAME}"), CONTRACT_VERSION)?; - - validate_cf(msg.close_factor,"close-factor")?; - - CLOSE_FACTOR.save(deps.storage, &msg.close_factor)?; - - OWNER.initialize( - deps.storage, - deps.api, - SetInitialOwner { - owner: msg.owner.clone(), - }, - )?; - Ok(Response::default()) -} - -#[entry_point] -pub fn execute( - deps: DepsMut, - info: MessageInfo, - msg: ExecuteMsg, -) -> ContractResult { - match msg { - ExecuteMsg::UpdateOwner(update) => update_owner(deps, info, update), - ExecuteMsg::UpdateCloseFactor { - close_factor, - } => update_close_factor(deps, info, close_factor), - ExecuteMsg::InitAsset { - denom, - params, - } => init_asset(deps, info, denom, params), - ExecuteMsg::UpdateAsset { - denom, - params, - } => update_asset(deps, info, denom, params), - ExecuteMsg::InitOrUpdateVault { - address, - config, - } => init_or_update_vault(deps, info, address, config), - } -} - -#[entry_point] -pub fn query(deps: Deps, msg: QueryMsg) -> Result { - let res = match msg { - QueryMsg::Config {} => to_binary(&query_config(deps)?), - QueryMsg::AssetParamsResponse { - denom, - } => to_binary(&query_asset_params(deps, denom)?), - QueryMsg::VaultConfigsResponse { - address, - } => to_binary(&query_vault_config(deps, address)?), - }; - res.map_err(Into::into) -} - -pub fn validate_cf(param_value: Decimal, param_name: &str) -> Result<(), ValidationError> { - if !param_value.le(&Decimal::one()) { - Err(ValidationError::InvalidParam { - param_name: param_name.to_string(), - invalid_value: param_value.to_string(), - predicate: "<= 1".to_string(), - }) - } else { - Ok(()) - } -} \ No newline at end of file diff --git a/contracts/asset-params/src/execute.rs b/contracts/asset-params/src/execute.rs deleted file mode 100644 index 56103da49..000000000 --- a/contracts/asset-params/src/execute.rs +++ /dev/null @@ -1,220 +0,0 @@ -use cosmwasm_std::{Addr, Decimal, Env, Uint128}; - -pub const CONTRACT_NAME: &str = "crates.io:mars-asset-params"; -pub const CONTRACT_VERSION: &str = env!("CARGO_PKG_VERSION"); - -use crate::state::{ASSET_PARAMS, VAULT_CONFIGS}; -use crate::state::{ - CLOSE_FACTOR, OWNER, -}; -use cosmwasm_std::{DepsMut, MessageInfo, Response}; -use mars_owner::{OwnerError, OwnerUpdate}; -use mars_red_bank_types::address_provider::MarsAddressType; -use mars_red_bank_types::error::MarsError; -use mars_red_bank_types::red_bank::{InitOrUpdateAssetParams, Market}; -use mars_utils::helpers::validate_native_denom; -use crate::error::{ContractError, ContractResult}; -use crate::error::ContractError::InvalidConfig; -use crate::types::{AssetParams, VaultConfigs}; - -pub fn update_owner( - deps: DepsMut, - info: MessageInfo, - update: OwnerUpdate, -) -> ContractResult { - Ok(OWNER.update(deps, info, update)?) -} - -pub fn update_close_factor( - deps: DepsMut, - info: MessageInfo, - max_close_factor: Decimal, -) -> Result { - OWNER.assert_owner(deps.storage, &info.sender)?; - - assert_lte_to_one(&max_close_factor)?; - - CLOSE_FACTOR.save(deps.storage, &max_close_factor)?; - let response = Response::new() - .add_attribute("key", "max_close_factor") - .add_attribute("value", max_close_factor.to_string()); - - Ok(response) -} - -/// Initialize asset if it does not exist. -/// Initialization requires that all params are provided and there is no asset in state. -pub fn init_asset( - deps: DepsMut, - info: MessageInfo, - denom: String, - params: AssetParams, -) -> Result { - OWNER.assert_owner(deps.storage, &info.sender)?; - - validate_native_denom(&denom)?; - - if ASSET_PARAMS.may_load(deps.storage, &denom)?.is_some() { - return Err(ContractError::AssetAlreadyInitialized {}); - } - - params.validate()?; - - ASSET_PARAMS.save(deps.storage, &denom, ¶ms)?; - - Ok(Response::new().add_attribute("action", "init_asset").add_attribute("denom", denom)) -} - -/// Update asset with new params. -/// Updating an asset allows you to update just some params. -pub fn update_asset( - deps: DepsMut, - info: MessageInfo, - denom: String, - params: AssetParams, -) -> Result { - if OWNER.is_owner(deps.storage, &info.sender)? { - update_asset_by_owner(deps, &denom, params) - } else if OWNER.is_emergency_owner(deps.storage, &info.sender)? { - update_asset_by_emergency_owner(deps, &denom, params) - } else { - Err(OwnerError::NotOwner {}.into()) - } -} - -fn update_asset_by_owner( - deps: DepsMut, - denom: &str, - params: AssetParams, -) -> Result { - let current_params = ASSET_PARAMS.may_load(deps.storage, denom)?; - match current_params { - None => Err(ContractError::AssetNotInitialized {}), - Some(mut asset) => { - - // need two structs - one optional and one not optional - - // Destructuring a struct’s fields into separate variables in order to force - // compile error if we add more params - let AssetParams { - max_loan_to_value, - liquidation_threshold, - liquidation_bonus, - rover_whitelisted, - red_bank_deposit_enabled, - red_bank_borrow_enabled, - red_bank_deposit_cap, - interest_rate_model, - reserve_factor, - uncollateralized_loan_limit, - } = params; - - let mut response = Response::new(); - - let mut updated_asset = AssetParams { - max_loan_to_value: max_loan_to_value.unwrap_or(asset.max_loan_to_value), - liquidation_threshold: liquidation_threshold.unwrap_or(asset.liquidation_threshold), - liquidation_bonus: liquidation_bonus.unwrap_or(asset.liquidation_bonus), - rover_whitelisted: rover_whitelisted.unwrap_or(asset.rover_whitelisted), - red_bank_deposit_enabled: red_bank_deposit_enabled.unwrap_or(asset.red_bank_deposit_enabled), - red_bank_borrow_enabled: red_bank_borrow_enabled.unwrap_or(asset.red_bank_borrow_enabled), - red_bank_deposit_cap: red_bank_deposit_cap.unwrap_or(asset.red_bank_deposit_cap), - interest_rate_model: interest_rate_model.unwrap_or(asset.interest_rate_model), - reserve_factor: reserve_factor.unwrap_or(asset.reserve_factor), - uncollateralized_loan_limit: uncollateralized_loan_limit.unwrap_or(asset.uncollateralized_loan_limit), - }; - - ASSET_PARAMS.save(deps.storage, denom, &updated_asset)?; - - Ok(response.add_attribute("action", "update_asset").add_attribute("denom", denom)) - } - } -} -/// Emergency owner can only DISABLE BORROWING. -fn update_asset_by_emergency_owner( - deps: DepsMut, - denom: &str, - params: AssetParams, -) -> Result { - if let Some(mut asset) = ASSET_PARAMS.may_load(deps.storage, denom)? { - match params.red_bank_borrow_enabled { - Some(borrow_enabled) if !borrow_enabled => { - asset.red_bank_borrow_enabled = borrow_enabled; - ASSET_PARAMS.save(deps.storage, denom, &asset)?; - - Ok(Response::new() - .add_attribute("action", "emergency_update_asset") - .add_attribute("denom", denom)) - } - _ => ContractError::Unauthorized {}.into(), - } - } else { - ContractError::AssetNotInitialized {} - } -} - -pub fn assert_lte_to_one(dec: &Decimal) -> ContractResult<()> { - if dec > &Decimal::one() { - return ContractError(InvalidConfig { - reason: "value greater than one".to_string(), - }); - } - Ok(()) -} - -pub fn init_or_update_vault( - deps: DepsMut, - info: MessageInfo, - address: Addr, - config: VaultConfigs, -) -> Result { - OWNER.assert_owner(deps.storage, &info.sender)?; - - // Destructuring a struct’s fields into separate variables in order to force - // compile error if we add more params - let VaultConfigs { - deposit_cap, - max_loan_to_value, - liquidation_threshold, - rover_whitelisted, - } = config; - - let config_status = VAULT_CONFIGS.may_load(deps.storage, &address)?; - match config_status { - None => { - // All fields should be available - let available = max_loan_to_value.is_some() - && deposit_cap.is_some() - && liquidation_threshold.is_some() - && rover_whitelisted.is_some(); - - if !available { - return Err(MarsError::InstantiateParamsUnavailable {}.into()); - } - let mut response = Response::new(); - let new_config = VaultConfigs { - deposit_cap: deposit_cap.unwrap(), - max_loan_to_value: max_loan_to_value.unwrap(), - liquidation_threshold: liquidation_threshold.unwrap(), - rover_whitelisted: rover_whitelisted.unwrap(), - }; - VAULT_CONFIGS.save(deps.storage, &address, &new_config)?; - Ok(response.add_attribute("action", "init_vault").add_attribute("address", address)) - } - Some(mut config) => { - let mut updated_config = VaultConfigs { - deposit_cap: deposit_cap.unwrap_or(config.deposit_cap), - max_loan_to_value: max_loan_to_value.unwrap_or(config.max_loan_to_value), - liquidation_threshold: liquidation_threshold.unwrap_or(config.liquidation_threshold), - rover_whitelisted: rover_whitelisted.unwrap_or(config.rover_whitelisted), - }; - - let mut response = Response::new(); - - VAULT_CONFIGS.save(deps.storage, &address, &updated_config)?; - - Ok(response.add_attribute("action", "update_vault_config").add_attribute("address", address)) - } - } -} - diff --git a/contracts/asset-params/src/msg.rs b/contracts/asset-params/src/msg.rs deleted file mode 100644 index 60c549939..000000000 --- a/contracts/asset-params/src/msg.rs +++ /dev/null @@ -1,64 +0,0 @@ -use cosmwasm_schema::{cw_serde, QueryResponses}; -use cosmwasm_std::{Addr, Decimal}; -use mars_owner::OwnerUpdate; -use mars_utils::helpers::decimal_param_le_one; -use crate::error::ValidationError; -use crate::types::{AssetParams, VaultConfigs, ConfigResponse}; - -#[cw_serde] -pub struct InstantiateMsg { - /// Contract's owner - pub owner: String, - /// Contract's emergency owner - pub emergency_owner: String, - /// The maximum percent a liquidator can decrease the debt amount of the liquidatee - pub close_factor: Decimal, -} - -#[cw_serde] -pub enum ExecuteMsg { - /// Manages owner state (only owner can call) - UpdateOwner(OwnerUpdate), - /// Update outpost's universal close factor (only owner can call) - UpdateCloseFactor { - close_factor: Decimal, - }, - /// Initialize an asset on the money market (only owner can call) - InitAsset { - /// Asset related info - denom: String, - /// Asset parameters - params: AssetParams, - }, - /// Update an asset on the money market (only owner can call) - UpdateAsset { - /// Asset related info - denom: String, - /// Asset parameters - params: AssetParams, - }, - /// Init or Update the vault configs on Rover (only owner can call) - InitOrUpdateVault { - /// Vault related info - address: Addr, - /// Vault configuration - config: VaultConfigs, - } -} -#[cw_serde] -#[derive(QueryResponses)] -pub enum QueryMsg { - /// Config returns the owners and close factor - #[returns(ConfigResponse)] - Config {}, - /// Asset Params that are relevant to the Red Bank Markets and Rover - #[returns(AssetParams)] - AssetParamsResponse { - denom: String, - }, - /// Rover vault configs - #[returns(VaultConfigs)] - VaultConfigsResponse { - address: Addr, - }, -} \ No newline at end of file diff --git a/contracts/asset-params/src/query.rs b/contracts/asset-params/src/query.rs deleted file mode 100644 index d01af163c..000000000 --- a/contracts/asset-params/src/query.rs +++ /dev/null @@ -1,40 +0,0 @@ -use cosmwasm_std::{Addr, Deps}; -use crate::state::{ASSET_PARAMS, CLOSE_FACTOR, OWNER, VAULT_CONFIGS}; -use crate::error::ContractResult; -use crate::types::{AssetParams, ConfigResponse, VaultConfigs}; - -pub fn query_config(deps: Deps) -> ContractResult { - let owner_res = OWNER.query(deps.storage)?; - Ok(ConfigResponse { - owner: owner_res.owner, - proposed_new_owner: owner_res.proposed, - emergency_owner: owner_res.emergency_owner, - close_factor: CLOSE_FACTOR.load(deps.storage)?, - }) -} - -pub fn query_asset_params(deps: Deps, denom: String) -> ContractResult { - let config = ASSET_PARAMS.load(deps.storage, &denom)?; - Ok(AssetParams { - reserve_factor: config.reserve_factor, - max_loan_to_value: config.max_loan_to_value, - liquidation_threshold: config.liquidation_threshold, - liquidation_bonus: config.liquidation_bonus, - interest_rate_model: config.interest_rate_model, - red_bank_deposit_enabled: config.red_bank_deposit_enabled, - red_bank_borrow_enabled: config.red_bank_borrow_enabled, - red_bank_deposit_cap: config.red_bank_deposit_cap, - rover_whitelisted: config.rover_whitelisted, - uncollateralized_loan_limit: config.uncollateralized_loan_limit, - }) -} - -pub fn query_vault_config(deps: Deps, address: Addr) -> ContractResult { - let config = VAULT_CONFIGS.load(deps.storage, &address)?; - Ok(VaultConfigs { - max_loan_to_value: config.max_loan_to_value, - liquidation_threshold: config.liquidation_threshold, - rover_whitelisted: config.rover_whitelisted, - deposit_cap: config.deposit_cap, - }) -} diff --git a/contracts/asset-params/src/types.rs b/contracts/asset-params/src/types.rs deleted file mode 100644 index 787e833ec..000000000 --- a/contracts/asset-params/src/types.rs +++ /dev/null @@ -1,61 +0,0 @@ -use cosmwasm_schema::cw_serde; -use cosmwasm_std::{Coin, Decimal, Uint128}; -use mars_red_bank_types::red_bank::InterestRateModel; -use mars_utils::error::ValidationError; -use mars_utils::helpers::{decimal_param_le_one, decimal_param_lt_one}; - -#[cw_serde] -pub struct AssetParams { - pub max_loan_to_value: Decimal, - pub liquidation_threshold: Decimal, - pub liquidation_bonus: Decimal, - pub rover_whitelisted: bool, - pub red_bank_deposit_enabled: bool, - pub red_bank_borrow_enabled: bool, - pub red_bank_deposit_cap: Uint128, - pub interest_rate_model: InterestRateModel, - pub reserve_factor: Decimal, - pub uncollateralized_loan_limit: Uint128, -} - -impl AssetParams{ - pub fn validate(&self) -> Result<(), ValidationError> { - decimal_param_lt_one(self.reserve_factor, "reserve_factor")?; - decimal_param_le_one(self.max_loan_to_value, "max_loan_to_value")?; - decimal_param_le_one(self.liquidation_threshold, "liquidation_threshold")?; - decimal_param_le_one(self.liquidation_bonus, "liquidation_bonus")?; - - // liquidation_threshold should be greater than max_loan_to_value - if self.liquidation_threshold <= self.max_loan_to_value { - return Err(ValidationError::InvalidParam { - param_name: "liquidation_threshold".to_string(), - invalid_value: self.liquidation_threshold.to_string(), - predicate: format!("> {} (max LTV)", self.max_loan_to_value), - }); - } - - self.interest_rate_model.validate()?; - - Ok(()) - } -} - -#[cw_serde] -pub struct VaultConfigs { - pub deposit_cap: Coin, - pub max_loan_to_value: Decimal, - pub liquidation_threshold: Decimal, - pub rover_whitelisted: bool, -} - -#[cw_serde] -pub struct ConfigResponse { - /// The contract's owner - pub owner: Option, - /// The contract's proposed owner - pub proposed_new_owner: Option, - /// The contract's emergency owner - pub emergency_owner: Option, - /// Maximum percentage of outstanding debt that can be covered by a liquidator - pub close_factor: Decimal, -} \ No newline at end of file diff --git a/contracts/asset-params/tests/test_admin.rs b/contracts/asset-params/tests/test_admin.rs deleted file mode 100644 index 7683ea0cb..000000000 --- a/contracts/asset-params/tests/test_admin.rs +++ /dev/null @@ -1,213 +0,0 @@ -use cosmwasm_std::{Addr, Decimal, from_binary}; -use mars_owner::OwnerError::{NotOwner, NotProposedOwner, StateTransitionError}; -use mars_owner::OwnerUpdate; -use mars_testing::{mock_dependencies, mock_env, mock_env_at_block_time, mock_info, MockEnvParams}; -use mars_testing::integration::mock_env::MockEnv; -use mars_params::contract::{execute, instantiate, query}; -use mars_params::error::{ContractError, ValidationError}; -use mars_params::error::ContractError::Owner; -use mars_params::msg::{ExecuteMsg, InstantiateMsg, QueryMsg}; -use mars_params::types::ConfigResponse; - -#[test] -fn proper_initialization() { - let mut deps = mock_dependencies(&[]); - - // * - // init config with close_factor greater than 1 - // * - let mut close_factor = Decimal::from_ratio(13u128, 10u128); - let msg = InstantiateMsg { - owner: "owner".to_string(), - emergency_owner: "emergency_owner".to_string(), - close_factor - }; - - let info = mock_info("owner"); - let error_res = instantiate(deps.as_mut(), env.clone(), info, msg).unwrap_err(); - assert_eq!( - error_res, - ValidationError::InvalidParam { - param_name: "close_factor".to_string(), - invalid_value: "1.3".to_string(), - predicate: "<= 1".to_string(), - } - .into() - ); - - // * - // init config with valid params - // * - close_factor = Decimal::from_ratio(1u128, 2u128); - let msg = InstantiateMsg { - owner: "owner".to_string(), - emergency_owner: "emergency_owner".to_string(), - close_factor - }; - - let info = mock_info("owner"); - let res = instantiate(deps.as_mut(), env.clone(), info, msg).unwrap(); - assert_eq!(0, res.messages.len()); - - let res = query(deps.as_ref(), QueryMsg::Config {}).unwrap(); - let value: ConfigResponse = from_binary(&res).unwrap(); - assert_eq!(value.owner.unwrap(), "owner"); - assert_eq!(value.emergency_owner.unwrap(), "emergency_owner"); -} - -#[test] -fn update_close_factor() { - let mut deps = mock_dependencies(&[]); - // * - // init config with valid params - // * - let mut close_factor = Decimal::from_ratio(1u128, 4u128); - let msg = InstantiateMsg { - owner: "owner".to_string(), - emergency_owner: "emergency_owner".to_string(), - close_factor - }; - - let info = mock_info("owner"); - let _res = instantiate(deps.as_mut(), env.clone(), info, msg).unwrap(); - - // * - // non owner is not authorized - // * - let msg = ExecuteMsg::UpdateCloseFactor { - close_factor, - }; - let info = mock_info("somebody"); - let error_res = execute(deps.as_mut(), info, msg).unwrap_err(); - assert_eq!(error_res, ContractError::Owner(NotOwner {})); -} - -#[test] -fn propose_new_owner() { - let mut mock = MockEnv::new().build().unwrap(); - let original_config = mock.query_config(); - - let new_owner = "new_owner".to_string(); - - // only owner can propose new owners - let bad_guy = Addr::unchecked("bad_guy"); - let res = mock.update_owner( - &bad_guy, - OwnerUpdate::ProposeNewOwner { - proposed: bad_guy.to_string(), - }, - ); - assert_err(res, Owner(NotOwner {})); - - mock.update_owner( - &Addr::unchecked(original_config.owner.clone().unwrap()), - OwnerUpdate::ProposeNewOwner { - proposed: new_owner.clone(), - }, - ) - .unwrap(); - - let new_config = mock.query_config(); - - assert_eq!(new_config.owner, original_config.owner); - assert_ne!(new_config.proposed_new_owner, original_config.proposed_new_owner); - assert_eq!(new_config.proposed_new_owner, Some(new_owner)); -} - -#[test] -fn clear_proposed() { - let mut mock = MockEnv::new().build().unwrap(); - let original_config = mock.query_config(); - - let new_owner = "new_owner".to_string(); - - mock.update_owner( - &Addr::unchecked(original_config.owner.clone().unwrap()), - OwnerUpdate::ProposeNewOwner { - proposed: new_owner.clone(), - }, - ) - .unwrap(); - - let interim_config = mock.query_config(); - - assert_eq!(interim_config.proposed_new_owner, Some(new_owner)); - - // only owner can clear - let bad_guy = Addr::unchecked("bad_guy"); - let res = mock.update_owner(&bad_guy, OwnerUpdate::ClearProposed); - assert_err(res, Owner(NotOwner {})); - - mock.update_owner( - &Addr::unchecked(original_config.owner.clone().unwrap()), - OwnerUpdate::ClearProposed, - ) - .unwrap(); - - let latest_config = mock.query_config(); - - assert_eq!(latest_config.owner, original_config.owner); - assert_ne!(latest_config.proposed_new_owner, interim_config.proposed_new_owner); - assert_eq!(latest_config.proposed_new_owner, None); -} - -#[test] -fn accept_owner_role() { - let mut mock = MockEnv::new().build().unwrap(); - let original_config = mock.query_config(); - - let new_owner = "new_owner".to_string(); - - mock.update_owner( - &Addr::unchecked(original_config.owner.clone().unwrap()), - OwnerUpdate::ProposeNewOwner { - proposed: new_owner.clone(), - }, - ) - .unwrap(); - - // Only proposed owner can accept - let res = mock.update_owner( - &Addr::unchecked(original_config.owner.unwrap()), - OwnerUpdate::AcceptProposed, - ); - assert_err(res, Owner(NotProposedOwner {})); - - mock.update_owner(&Addr::unchecked(new_owner.clone()), OwnerUpdate::AcceptProposed).unwrap(); - - let new_config = mock.query_config(); - - assert_eq!(new_config.owner.unwrap(), new_owner); - assert_eq!(new_config.proposed_new_owner, None); -} - -#[test] -fn abolish_owner_role() { - let mut mock = MockEnv::new().build().unwrap(); - let original_config = mock.query_config(); - - // Only owner can abolish role - let bad_guy = Addr::unchecked("bad_guy"); - let res = mock.update_owner(&bad_guy, OwnerUpdate::AbolishOwnerRole); - assert_err(res, Owner(NotOwner {})); - - mock.update_owner( - &Addr::unchecked(original_config.owner.clone().unwrap()), - OwnerUpdate::AbolishOwnerRole, - ) - .unwrap(); - - let new_config = mock.query_config(); - - assert_eq!(new_config.owner, None); - assert_eq!(new_config.proposed_new_owner, None); - - // No new updates can occur - let res = mock.update_owner( - &Addr::unchecked(original_config.owner.clone().unwrap()), - OwnerUpdate::ProposeNewOwner { - proposed: original_config.owner.unwrap(), - }, - ); - assert_err(res, Owner(StateTransitionError {})); -} diff --git a/contracts/asset-params/tests/test_assets.rs b/contracts/asset-params/tests/test_assets.rs deleted file mode 100644 index 78c4ee999..000000000 --- a/contracts/asset-params/tests/test_assets.rs +++ /dev/null @@ -1,490 +0,0 @@ -use cosmwasm_std::{attr, Decimal, Uint128}; -use mars_owner::OwnerError::NotOwner; -use mars_red_bank_types::error::MarsError; -use mars_red_bank_types::red_bank::InterestRateModel; -use mars_testing::{mock_dependencies, mock_info}; -use mars_utils::error::ValidationError; -use mars_params::contract::{execute, instantiate}; -use mars_params::error::ContractError; -use mars_params::msg::{ExecuteMsg, InstantiateMsg}; -use mars_params::types::AssetParams; - -#[test] -fn init_asset() { - let mut deps = mock_dependencies(&[]); - let mut close_factor = Decimal::from_ratio(1u128, 4u128); - let msg = InstantiateMsg { - owner: "owner".to_string(), - emergency_owner: "emergency_owner".to_string(), - close_factor - }; - let info = mock_info("owner"); - instantiate(deps.as_mut(), env.clone(), info, msg).unwrap(); - - let ir_model = InterestRateModel { - optimal_utilization_rate: Decimal::one(), - base: Decimal::percent(5), - slope_1: Decimal::zero(), - slope_2: Decimal::zero(), - }; - - let params = AssetParams { - max_loan_to_value: Some(Decimal::from_ratio(8u128, 10u128)), - reserve_factor: Some(Decimal::from_ratio(1u128, 100u128)), - liquidation_threshold: Some(Decimal::one()), - liquidation_bonus: Some(Decimal::zero()), - rover_whitelisted: false, - red_bank_deposit_enabled: false, - red_bank_borrow_enabled: false, - red_bank_deposit_cap: Default::default(), - interest_rate_model: Some(ir_model.clone()), - uncollateralized_loan_limit: Default::default(), - }; - - // non owner is not authorized - { - let msg = ExecuteMsg::InitAsset { - denom: "someasset".to_string(), - params: params.clone(), - }; - let info = mock_info("somebody"); - let error_res = execute(deps.as_mut(), info, msg).unwrap_err(); - assert_eq!(error_res, ContractError::Owner(NotOwner {})); - } - - // init incorrect asset denom - error 2 - { - let msg = ExecuteMsg::InitAsset { - denom: "ahdbufenf&*!-".to_string(), - params: params.clone(), - }; - let info = mock_info("owner"); - let err = execute(deps.as_mut(), info, msg); - assert_eq!( - err, - Err(ContractError::Validation(ValidationError::InvalidDenom { - reason: "Not all characters are ASCII alphanumeric or one of: / : . _ -" - .to_string() - })) - ); - } - // init asset with empty params - // NEED OPTIONAL STRUCT - { - let empty_asset_params = AssetParams { - max_loan_to_value: Default::default(), - liquidation_threshold: Default::default(), - liquidation_bonus: Default::default(), - rover_whitelisted: false, - red_bank_deposit_enabled: false, - red_bank_borrow_enabled: false, - red_bank_deposit_cap: Default::default(), - interest_rate_model: Default::default(), - reserve_factor: Default::default(), - uncollateralized_loan_limit: Default::default(), - }; - let msg = ExecuteMsg::InitAsset { - denom: "someasset".to_string(), - params: empty_asset_params, - }; - let info = mock_info("owner"); - let error_res = execute(deps.as_mut(), info, msg).unwrap_err(); - assert_eq!(error_res, MarsError::InstantiateParamsUnavailable {}.into()); - } - - // init asset with max_loan_to_value greater than 1 - { - let invalid_asset_params = AssetParams { - max_loan_to_value: Some(Decimal::from_ratio(11u128, 10u128)), - ..params.clone() - }; - let msg = ExecuteMsg::InitAsset { - denom: "someasset".to_string(), - params: invalid_asset_params, - }; - let info = mock_info("owner", &[]); - let error_res = execute(deps.as_mut(), info, msg).unwrap_err(); - assert_eq!( - error_res, - ValidationError::InvalidParam { - param_name: "max_loan_to_value".to_string(), - invalid_value: "1.1".to_string(), - predicate: "<= 1".to_string(), - } - .into() - ); - } - - // init asset with liquidation_threshold greater than 1 - { - let invalid_asset_params = AssetParams { - liquidation_threshold: Some(Decimal::from_ratio(11u128, 10u128)), - ..params.clone() - }; - let msg = ExecuteMsg::InitAsset { - denom: "someasset".to_string(), - params: invalid_asset_params, - }; - let info = mock_info("owner", &[]); - let error_res = execute(deps.as_mut(), info, msg).unwrap_err(); - assert_eq!( - error_res, - ValidationError::InvalidParam { - param_name: "liquidation_threshold".to_string(), - invalid_value: "1.1".to_string(), - predicate: "<= 1".to_string(), - } - .into() - ); - } - - // init asset with liquidation_bonus greater than 1 - { - let invalid_asset_params = AssetParams { - liquidation_bonus: Some(Decimal::from_ratio(11u128, 10u128)), - ..params.clone() - }; - let msg = ExecuteMsg::InitAsset { - denom: "someasset".to_string(), - params: invalid_asset_params, - }; - let info = mock_info("owner"); - let error_res = execute(deps.as_mut(), info, msg).unwrap_err(); - assert_eq!( - error_res, - ValidationError::InvalidParam { - param_name: "liquidation_bonus".to_string(), - invalid_value: "1.1".to_string(), - predicate: "<= 1".to_string(), - } - .into() - ); - } - - // init asset where LTV >= liquidity threshold - { - let invalid_asset_params = AssetParams { - max_loan_to_value: Some(Decimal::from_ratio(5u128, 10u128)), - liquidation_threshold: Some(Decimal::from_ratio(5u128, 10u128)), - ..params.clone() - }; - let msg = ExecuteMsg::InitAsset { - denom: "someasset".to_string(), - params: invalid_asset_params, - }; - let info = mock_info("owner"); - let error_res = execute(deps.as_mut(), info, msg).unwrap_err(); - assert_eq!( - error_res, - ValidationError::InvalidParam { - param_name: "liquidation_threshold".to_string(), - invalid_value: "0.5".to_string(), - predicate: "> 0.5 (max LTV)".to_string() - } - .into() - ); - } - - - // init asset where optimal utilization rate > 1 - { - let invalid_asset_params = AssetParams { - interest_rate_model: Some(InterestRateModel { - optimal_utilization_rate: Decimal::percent(110), - ..ir_model - }), - ..params - }; - let msg = ExecuteMsg::InitAsset { - denom: "someasset".to_string(), - params: invalid_asset_params, - }; - let info = mock_info("owner"); - let error_res = execute(deps.as_mut(), info, msg).unwrap_err(); - assert_eq!( - error_res, - ValidationError::InvalidParam { - param_name: "optimal_utilization_rate".to_string(), - invalid_value: "1.1".to_string(), - predicate: "<= 1".to_string() - } - .into() - ); - } - - // owner is authorized - { - let msg = ExecuteMsg::InitAsset { - denom: "someasset".to_string(), - params: params.clone(), - }; - let info = mock_info("owner"); - let res = execute(deps.as_mut(), info, msg).unwrap(); - - // should have asset market with Canonical default address - let market = MARKETS.load(&deps.storage, "someasset").unwrap(); - assert_eq!(market.denom, "someasset"); - - // should have unlimited deposit cap - assert_eq!(market.deposit_cap, Uint128::MAX); - - assert_eq!(res.attributes, vec![attr("action", "init_asset"), attr("denom", "someasset")]); - } - - // can't init more than once - { - let msg = ExecuteMsg::InitAsset { - denom: "someasset".to_string(), - params, - }; - let info = mock_info("owner"); - let error_res = execute(deps.as_mut(), info, msg).unwrap_err(); - assert_eq!(error_res, ContractError::AssetAlreadyInitialized {}); - } -} - -#[test] -fn update_asset() { - let mut deps = mock_dependencies(&[]); - let start_time = 100000000; - - let mut close_factor = Decimal::from_ratio(1u128, 4u128); - let msg = InstantiateMsg { - owner: "owner".to_string(), - emergency_owner: "emergency_owner".to_string(), - close_factor - }; - let info = mock_info("owner"); - instantiate(deps.as_mut(), env.clone(), info, msg).unwrap(); - - let ir_model = InterestRateModel { - optimal_utilization_rate: Decimal::one(), - base: Decimal::percent(5), - slope_1: Decimal::zero(), - slope_2: Decimal::zero(), - }; - - let params = AssetParams { - max_loan_to_value: Some(Decimal::from_ratio(50u128, 100u128)), - reserve_factor: Some(Decimal::from_ratio(1u128, 100u128)), - liquidation_threshold: Some(Decimal::from_ratio(80u128, 100u128)), - liquidation_bonus: Some(Decimal::from_ratio(10u128, 100u128)), - rover_whitelisted: false, - red_bank_deposit_enabled: false, - red_bank_borrow_enabled: false, - red_bank_deposit_cap: Default::default(), - interest_rate_model: Some(ir_model.clone()), - uncollateralized_loan_limit: Default::default(), - }; - - // non owner is not authorized - { - let msg = ExecuteMsg::UpdateAsset { - denom: "someasset".to_string(), - params: params.clone(), - }; - let info = mock_info("somebody"); - let error_res = execute(deps.as_mut(), info, msg).unwrap_err(); - assert_eq!(error_res, ContractError::Owner(NotOwner {})); - } - - // owner is authorized but can't update asset if not initialized first - { - let msg = ExecuteMsg::UpdateAsset { - denom: "someasset".to_string(), - params: params.clone(), - }; - let info = mock_info("owner"); - let error_res = execute(deps.as_mut(), info, msg).unwrap_err(); - assert_eq!(error_res, ContractError::AssetNotInitialized {}); - } - - // initialize asset - { - let msg = ExecuteMsg::InitAsset { - denom: "someasset".to_string(), - params: params.clone(), - }; - let info = mock_info("owner"); - let _res = execute(deps.as_mut(), info, msg).unwrap(); - } - - // update asset with max_loan_to_value greater than 1 - { - let invalid_asset_params = AssetParams { - max_loan_to_value: Some(Decimal::from_ratio(11u128, 10u128)), - ..params.clone() - }; - let msg = ExecuteMsg::UpdateAsset { - denom: "someasset".to_string(), - params: invalid_asset_params, - }; - let info = mock_info("owner"); - let error_res = execute(deps.as_mut(), info, msg).unwrap_err(); - assert_eq!( - error_res, - ValidationError::InvalidParam { - param_name: "max_loan_to_value".to_string(), - invalid_value: "1.1".to_string(), - predicate: "<= 1".to_string(), - } - .into() - ); - } - - // update asset with liquidation_threshold greater than 1 - { - let invalid_asset_params = AssetParams { - liquidation_threshold: Some(Decimal::from_ratio(11u128, 10u128)), - ..params.clone() - }; - let msg = ExecuteMsg::UpdateAsset { - denom: "someasset".to_string(), - params: invalid_asset_params, - }; - let info = mock_info("owner"); - let error_res = execute(deps.as_mut(), info, msg).unwrap_err(); - assert_eq!( - error_res, - ValidationError::InvalidParam { - param_name: "liquidation_threshold".to_string(), - invalid_value: "1.1".to_string(), - predicate: "<= 1".to_string(), - } - .into() - ); - } - - // update asset with liquidation_bonus greater than 1 - { - let invalid_asset_params = AssetParams { - liquidation_bonus: Some(Decimal::from_ratio(11u128, 10u128)), - ..params.clone() - }; - let msg = ExecuteMsg::UpdateAsset { - denom: "someasset".to_string(), - params: invalid_asset_params, - }; - let info = mock_info("owner"); - let error_res = execute(deps.as_mut(), info, msg).unwrap_err(); - assert_eq!( - error_res, - ValidationError::InvalidParam { - param_name: "liquidation_bonus".to_string(), - invalid_value: "1.1".to_string(), - predicate: "<= 1".to_string(), - } - .into() - ); - } - - // update asset where LTV >= liquidity threshold - { - let invalid_asset_params = AssetParams { - max_loan_to_value: Some(Decimal::from_ratio(6u128, 10u128)), - liquidation_threshold: Some(Decimal::from_ratio(5u128, 10u128)), - ..params - }; - let msg = ExecuteMsg::UpdateAsset { - denom: "someasset".to_string(), - params: invalid_asset_params, - }; - let info = mock_info("owner"); - let error_res = execute(deps.as_mut(), info, msg).unwrap_err(); - assert_eq!( - error_res, - ValidationError::InvalidParam { - param_name: "liquidation_threshold".to_string(), - invalid_value: "0.5".to_string(), - predicate: "> 0.6 (max LTV)".to_string() - } - .into() - ); - } - - // update asset where optimal utilization rate > 1 - { - let invalid_asset_params = AssetParams { - interest_rate_model: Some(InterestRateModel { - optimal_utilization_rate: Decimal::percent(110), - ..ir_model - }), - ..params - }; - let msg = ExecuteMsg::UpdateAsset { - denom: "someasset".to_string(), - params: invalid_asset_params, - }; - let info = mock_info("owner"); - let error_res = execute(deps.as_mut(),info, msg).unwrap_err(); - assert_eq!( - error_res, - ValidationError::InvalidParam { - param_name: "optimal_utilization_rate".to_string(), - invalid_value: "1.1".to_string(), - predicate: "<= 1".to_string() - } - .into() - ); - } - - // update asset with new params - { - let params = AssetParams { - max_loan_to_value: Some(Decimal::from_ratio(60u128, 100u128)), - reserve_factor: Some(Decimal::from_ratio(10u128, 100u128)), - liquidation_threshold: Some(Decimal::from_ratio(90u128, 100u128)), - liquidation_bonus: Some(Decimal::from_ratio(12u128, 100u128)), - rover_whitelisted: false, - red_bank_deposit_enabled: false, - red_bank_borrow_enabled: false, - red_bank_deposit_cap: Default::default(), - interest_rate_model: Some(ir_model), - uncollateralized_loan_limit: Default::default(), - }; - let msg = ExecuteMsg::UpdateAsset { - denom: "someasset".to_string(), - params: params.clone(), - }; - let info = mock_info("owner"); - - let res = execute(deps.as_mut(), info, msg).unwrap(); - assert_eq!(res.messages, vec![],); - assert_eq!( - res.attributes, - vec![attr("action", "update_asset"), attr("denom", "someasset")], - ); - - let new_market = MARKETS.load(&deps.storage, "someasset").unwrap(); - assert_eq!(params.max_loan_to_value.unwrap(), new_market.max_loan_to_value); - assert_eq!(params.reserve_factor.unwrap(), new_market.reserve_factor); - assert_eq!(params.liquidation_threshold.unwrap(), new_market.liquidation_threshold); - assert_eq!(params.liquidation_bonus.unwrap(), new_market.liquidation_bonus); - assert_eq!(params.interest_rate_model.unwrap(), new_market.interest_rate_model); - } - - // update asset with empty params - { - let market_before = MARKETS.load(&deps.storage, "someasset").unwrap(); - - let empty_asset_params = AssetParams { - max_loan_to_value: None, - reserve_factor: None, - liquidation_threshold: None, - liquidation_bonus: None, - interest_rate_model: None, - deposit_enabled: None, - borrow_enabled: None, - deposit_cap: None, - }; - let msg = ExecuteMsg::UpdateAsset { - denom: "someasset".to_string(), - params: empty_asset_params, - }; - let info = mock_info("owner"); - let res = execute(deps.as_mut(), info, msg).unwrap(); - - // no interest updated event - assert_eq!(res.events.len(), 0); - } -} diff --git a/contracts/asset-params/tests/test_vaults.rs b/contracts/asset-params/tests/test_vaults.rs deleted file mode 100644 index e69de29bb..000000000 diff --git a/contracts/asset-params/Cargo.toml b/contracts/params/Cargo.toml similarity index 96% rename from contracts/asset-params/Cargo.toml rename to contracts/params/Cargo.toml index 05eb2c411..c0d86b366 100644 --- a/contracts/asset-params/Cargo.toml +++ b/contracts/params/Cargo.toml @@ -22,7 +22,6 @@ library = [] cosmwasm-schema = { workspace = true } cosmwasm-std = { workspace = true } cw2 = { workspace = true } -cw-item-set = { workspace = true } cw-paginate = { workspace = true } cw-storage-plus = { workspace = true } mars-red-bank-types = { workspace = true } diff --git a/contracts/params/examples/schema.rs b/contracts/params/examples/schema.rs new file mode 100644 index 000000000..29e8f6f7d --- /dev/null +++ b/contracts/params/examples/schema.rs @@ -0,0 +1,10 @@ +use cosmwasm_schema::write_api; +use mars_params::msg::{ExecuteMsg, InstantiateMsg, QueryMsg}; + +fn main() { + write_api! { + instantiate: InstantiateMsg, + execute: ExecuteMsg, + query: QueryMsg, + } +} diff --git a/contracts/params/src/contract.rs b/contracts/params/src/contract.rs new file mode 100644 index 000000000..9a1cb63da --- /dev/null +++ b/contracts/params/src/contract.rs @@ -0,0 +1,75 @@ +use cosmwasm_std::{entry_point, to_binary, Binary, Deps, DepsMut, Env, MessageInfo, Response}; +use cw2::set_contract_version; +use mars_owner::OwnerInit::SetInitialOwner; + +use crate::{ + error::ContractResult, + execute::{update_asset_params, update_max_close_factor, update_vault_config, validate_mcf}, + msg::{ExecuteMsg, InstantiateMsg, QueryMsg}, + query::{query_all_asset_params, query_all_vault_configs, query_vault_config}, + state::{ASSET_PARAMS, MAX_CLOSE_FACTOR, OWNER}, +}; + +const CONTRACT_NAME: &str = env!("CARGO_PKG_NAME"); +const CONTRACT_VERSION: &str = env!("CARGO_PKG_VERSION"); + +#[entry_point] +pub fn instantiate( + deps: DepsMut, + _: Env, + _: MessageInfo, + msg: InstantiateMsg, +) -> ContractResult { + set_contract_version(deps.storage, format!("crates.io:{CONTRACT_NAME}"), CONTRACT_VERSION)?; + + OWNER.initialize( + deps.storage, + deps.api, + SetInitialOwner { + owner: msg.owner, + }, + )?; + + validate_mcf(msg.max_close_factor)?; + MAX_CLOSE_FACTOR.save(deps.storage, &msg.max_close_factor)?; + + Ok(Response::default()) +} + +#[entry_point] +pub fn execute( + deps: DepsMut, + _: Env, + info: MessageInfo, + msg: ExecuteMsg, +) -> ContractResult { + match msg { + ExecuteMsg::UpdateOwner(update) => Ok(OWNER.update(deps, info, update)?), + ExecuteMsg::UpdateAssetParams(update) => update_asset_params(deps, info, update), + ExecuteMsg::UpdateMaxCloseFactor(mcf) => update_max_close_factor(deps, info, mcf), + ExecuteMsg::UpdateVaultConfig(update) => update_vault_config(deps, info, update), + } +} + +#[entry_point] +pub fn query(deps: Deps, _: Env, msg: QueryMsg) -> ContractResult { + let res = match msg { + QueryMsg::Owner {} => to_binary(&OWNER.query(deps.storage)?), + QueryMsg::AssetParams { + denom, + } => to_binary(&ASSET_PARAMS.load(deps.storage, &denom)?), + QueryMsg::AllAssetParams { + start_after, + limit, + } => to_binary(&query_all_asset_params(deps, start_after, limit)?), + QueryMsg::VaultConfig { + address, + } => to_binary(&query_vault_config(deps, &address)?), + QueryMsg::AllVaultConfigs { + start_after, + limit, + } => to_binary(&query_all_vault_configs(deps, start_after, limit)?), + QueryMsg::MaxCloseFactor {} => to_binary(&MAX_CLOSE_FACTOR.load(deps.storage)?), + }; + res.map_err(Into::into) +} diff --git a/contracts/asset-params/src/error.rs b/contracts/params/src/error.rs similarity index 59% rename from contracts/asset-params/src/error.rs rename to contracts/params/src/error.rs index 0d29ad384..b19167c53 100644 --- a/contracts/asset-params/src/error.rs +++ b/contracts/params/src/error.rs @@ -1,7 +1,7 @@ use cosmwasm_std::StdError; use mars_owner::OwnerError; -use thiserror::Error; pub use mars_utils::error::ValidationError; +use thiserror::Error; pub type ContractResult = Result; @@ -13,20 +13,6 @@ pub enum ContractError { #[error("{0}")] Owner(#[from] OwnerError), - #[error("Asset is already initialized")] - AssetAlreadyInitialized {}, - - #[error("Asset not initialized")] - AssetNotInitialized {}, - - #[error("{reason:?}")] - InvalidConfig { - reason: String, - }, - - #[error("Unauthorized")] - Unauthorized {}, - #[error("{0}")] Validation(#[from] ValidationError), } diff --git a/contracts/params/src/execute.rs b/contracts/params/src/execute.rs new file mode 100644 index 000000000..750e864d0 --- /dev/null +++ b/contracts/params/src/execute.rs @@ -0,0 +1,144 @@ +use cosmwasm_std::{Decimal, DepsMut, MessageInfo, Response}; +use mars_utils::{error::ValidationError, helpers::validate_native_denom}; + +use crate::{ + error::ContractError, + state::{ASSET_PARAMS, MAX_CLOSE_FACTOR, OWNER, VAULT_CONFIGS}, + types::{AssetParamsUpdate, VaultConfigUpdate}, +}; + +pub const CONTRACT_NAME: &str = "crates.io:mars-params"; +pub const CONTRACT_VERSION: &str = env!("CARGO_PKG_VERSION"); + +pub fn update_max_close_factor( + deps: DepsMut, + info: MessageInfo, + max_close_factor: Decimal, +) -> Result { + OWNER.assert_owner(deps.storage, &info.sender)?; + + validate_mcf(max_close_factor)?; + MAX_CLOSE_FACTOR.save(deps.storage, &max_close_factor)?; + + let response = Response::new() + .add_attribute("action", "update_max_close_factor") + .add_attribute("value", max_close_factor.to_string()); + + Ok(response) +} + +pub fn update_asset_params( + deps: DepsMut, + info: MessageInfo, + update: AssetParamsUpdate, +) -> Result { + OWNER.assert_owner(deps.storage, &info.sender)?; + + let mut response = Response::new().add_attribute("action", "update_asset_param"); + + match update { + AssetParamsUpdate::AddOrUpdate { + denom, + params, + } => { + validate_native_denom(&denom)?; + params.validate()?; + + ASSET_PARAMS.save(deps.storage, &denom, ¶ms)?; + response = response + .add_attribute("action_type", "add_or_update") + .add_attribute("denom", denom); + } + AssetParamsUpdate::Remove { + denom, + } => { + ASSET_PARAMS.remove(deps.storage, &denom); + response = + response.add_attribute("action_type", "remove").add_attribute("denom", denom); + } + } + + Ok(response) +} + +// /// Emergency owner can only DISABLE BORROWING. +// fn update_asset_by_emergency_owner( +// deps: DepsMut, +// denom: &str, +// params: AssetParams, +// ) -> Result { +// if let Some(mut asset) = ASSET_PARAMS.may_load(deps.storage, denom)? { +// match params.red_bank_borrow_enabled { +// Some(borrow_enabled) if !borrow_enabled => { +// asset.red_bank_borrow_enabled = borrow_enabled; +// ASSET_PARAMS.save(deps.storage, denom, &asset)?; +// +// Ok(Response::new() +// .add_attribute("action", "emergency_update_asset") +// .add_attribute("denom", denom)) +// } +// _ => ContractError::Unauthorized {}.into(), +// } +// } else { +// ContractError::AssetNotInitialized {} +// } +// } + +pub fn update_vault_config( + deps: DepsMut, + info: MessageInfo, + update: VaultConfigUpdate, +) -> Result { + OWNER.assert_owner(deps.storage, &info.sender)?; + + let mut response = Response::new().add_attribute("action", "update_vault_config"); + + match update { + VaultConfigUpdate::AddOrUpdate { + addr, + config, + } => { + let checked = deps.api.addr_validate(&addr)?; + config.validate()?; + VAULT_CONFIGS.save(deps.storage, &checked, &config)?; + response = + response.add_attribute("action_type", "add_or_update").add_attribute("addr", addr); + } + VaultConfigUpdate::Remove { + addr, + } => { + let checked = deps.api.addr_validate(&addr)?; + VAULT_CONFIGS.remove(deps.storage, &checked); + response = response.add_attribute("action_type", "remove").add_attribute("addr", addr); + } + } + + Ok(response) +} + +pub fn validate_mcf(param_value: Decimal) -> Result<(), ValidationError> { + if !param_value.le(&Decimal::one()) { + Err(ValidationError::InvalidParam { + param_name: "max-close-factor".to_string(), + invalid_value: "max-close-factor".to_string(), + predicate: "<= 1".to_string(), + }) + } else { + Ok(()) + } +} + +/// liquidation_threshold should be greater than or equal to max_loan_to_value +pub fn assert_lqt_gte_max_ltv( + max_ltv: Decimal, + liq_threshold: Decimal, +) -> Result<(), ValidationError> { + if liq_threshold <= max_ltv { + return Err(ValidationError::InvalidParam { + param_name: "liquidation_threshold".to_string(), + invalid_value: liq_threshold.to_string(), + predicate: format!("> {} (max LTV)", max_ltv), + }); + } + Ok(()) +} diff --git a/contracts/asset-params/src/lib.rs b/contracts/params/src/lib.rs similarity index 100% rename from contracts/asset-params/src/lib.rs rename to contracts/params/src/lib.rs index 97b02b0ff..7e8f1f90c 100644 --- a/contracts/asset-params/src/lib.rs +++ b/contracts/params/src/lib.rs @@ -1,7 +1,7 @@ pub mod contract; +pub mod error; pub mod execute; pub mod msg; pub mod query; pub mod state; -pub mod error; pub mod types; diff --git a/contracts/params/src/msg.rs b/contracts/params/src/msg.rs new file mode 100644 index 000000000..d412fa069 --- /dev/null +++ b/contracts/params/src/msg.rs @@ -0,0 +1,55 @@ +use cosmwasm_schema::{cw_serde, QueryResponses}; +use cosmwasm_std::Decimal; +use mars_owner::OwnerUpdate; + +use crate::types::{AssetParams, AssetParamsUpdate, VaultConfig, VaultConfigUpdate}; + +#[cw_serde] +pub struct InstantiateMsg { + /// Contract's owner + pub owner: String, + /// The maximum percent a liquidator can decrease the debt amount of the liquidatee + pub max_close_factor: Decimal, +} + +#[cw_serde] +pub enum ExecuteMsg { + UpdateOwner(OwnerUpdate), + UpdateMaxCloseFactor(Decimal), + UpdateAssetParams(AssetParamsUpdate), + UpdateVaultConfig(VaultConfigUpdate), +} + +#[cw_serde] +#[derive(QueryResponses)] +pub enum QueryMsg { + #[returns(mars_owner::OwnerResponse)] + Owner {}, + + #[returns(AssetParams)] + AssetParams { + denom: String, + }, + + #[returns(Vec)] + AllAssetParams { + start_after: Option, + limit: Option, + }, + + #[returns(VaultConfig)] + VaultConfig { + /// Address of vault + address: String, + }, + + #[returns(Vec)] + AllVaultConfigs { + start_after: Option, + limit: Option, + }, + + // query all configs + #[returns(Decimal)] + MaxCloseFactor {}, +} diff --git a/contracts/params/src/query.rs b/contracts/params/src/query.rs new file mode 100644 index 000000000..db1bf639d --- /dev/null +++ b/contracts/params/src/query.rs @@ -0,0 +1,62 @@ +use cosmwasm_std::{Addr, Deps, Order, StdResult}; +use cw_paginate::DEFAULT_LIMIT; +use cw_storage_plus::Bound; + +use crate::{ + state::{ASSET_PARAMS, VAULT_CONFIGS}, + types::{AssetParamsResponse, VaultConfig, VaultConfigResponse}, +}; + +pub fn query_all_asset_params( + deps: Deps, + start_after: Option, + limit: Option, +) -> StdResult> { + let start = start_after.as_ref().map(|denom| Bound::exclusive(denom.as_str())); + let limit = limit.unwrap_or(DEFAULT_LIMIT) as usize; + ASSET_PARAMS + .range(deps.storage, start, None, Order::Ascending) + .take(limit) + .map(|res| { + let (denom, params) = res?; + Ok(AssetParamsResponse { + denom, + params, + }) + }) + .collect() +} + +pub fn query_vault_config(deps: Deps, unchecked: &str) -> StdResult { + let addr = deps.api.addr_validate(unchecked)?; + VAULT_CONFIGS.load(deps.storage, &addr) +} + +pub fn query_all_vault_configs( + deps: Deps, + start_after: Option, + limit: Option, +) -> StdResult> { + let vault_addr: Addr; + let start = match &start_after { + Some(unchecked) => { + vault_addr = deps.api.addr_validate(unchecked)?; + Some(Bound::exclusive(&vault_addr)) + } + None => None, + }; + + let limit = limit.unwrap_or(DEFAULT_LIMIT) as usize; + + VAULT_CONFIGS + .range(deps.storage, start, None, Order::Ascending) + .take(limit) + .map(|res| { + let (addr, config) = res?; + Ok(VaultConfigResponse { + addr, + config, + }) + }) + .collect() +} diff --git a/contracts/asset-params/src/state.rs b/contracts/params/src/state.rs similarity index 51% rename from contracts/asset-params/src/state.rs rename to contracts/params/src/state.rs index e85db459d..0a22180c3 100644 --- a/contracts/asset-params/src/state.rs +++ b/contracts/params/src/state.rs @@ -1,9 +1,10 @@ use cosmwasm_std::{Addr, Decimal}; use cw_storage_plus::{Item, Map}; use mars_owner::Owner; -use crate::types::{AssetParams, VaultConfigs}; + +use crate::types::{AssetParams, VaultConfig}; pub const OWNER: Owner = Owner::new("owner"); -pub const CLOSE_FACTOR: Item = Item::new("max_close_factor"); pub const ASSET_PARAMS: Map<&str, AssetParams> = Map::new("asset_params"); -pub const VAULT_CONFIGS: Map<&Addr, VaultConfigs> = Map::new("vault_configs"); +pub const VAULT_CONFIGS: Map<&Addr, VaultConfig> = Map::new("vault_configs"); +pub const MAX_CLOSE_FACTOR: Item = Item::new("max_close_factor"); diff --git a/contracts/params/src/types.rs b/contracts/params/src/types.rs new file mode 100644 index 000000000..1e2b29d0e --- /dev/null +++ b/contracts/params/src/types.rs @@ -0,0 +1,103 @@ +use cosmwasm_schema::cw_serde; +use cosmwasm_std::{Addr, Coin, Decimal, Uint128}; +use mars_red_bank_types::red_bank::InterestRateModel; +use mars_utils::{ + error::ValidationError, + helpers::{decimal_param_le_one, decimal_param_lt_one}, +}; + +use crate::execute::assert_lqt_gte_max_ltv; + +#[cw_serde] +pub struct RoverPermissions { + pub whitelisted: bool, +} + +#[cw_serde] +pub struct RedBankPermissions { + pub deposit_enabled: bool, + pub borrow_enabled: bool, +} + +#[cw_serde] +pub struct AssetPermissions { + pub rover: RoverPermissions, + pub red_bank: RedBankPermissions, +} + +#[cw_serde] +pub struct AssetParams { + pub permissions: AssetPermissions, + pub max_loan_to_value: Decimal, + pub liquidation_threshold: Decimal, + pub liquidation_bonus: Decimal, + pub red_bank_deposit_cap: Uint128, + pub interest_rate_model: InterestRateModel, + pub reserve_factor: Decimal, +} + +impl AssetParams { + pub fn validate(&self) -> Result<(), ValidationError> { + decimal_param_lt_one(self.reserve_factor, "reserve_factor")?; + decimal_param_le_one(self.max_loan_to_value, "max_loan_to_value")?; + decimal_param_le_one(self.liquidation_threshold, "liquidation_threshold")?; + decimal_param_le_one(self.liquidation_bonus, "liquidation_bonus")?; + + assert_lqt_gte_max_ltv(self.max_loan_to_value, self.liquidation_threshold)?; + + self.interest_rate_model.validate()?; + + Ok(()) + } +} + +#[cw_serde] +pub struct AssetParamsResponse { + pub denom: String, + pub params: AssetParams, +} + +#[cw_serde] +pub struct VaultConfigResponse { + pub addr: Addr, + pub config: VaultConfig, +} + +#[cw_serde] +pub struct VaultConfig { + pub deposit_cap: Coin, + pub max_loan_to_value: Decimal, + pub liquidation_threshold: Decimal, + pub whitelisted: bool, +} + +impl VaultConfig { + pub fn validate(&self) -> Result<(), ValidationError> { + decimal_param_le_one(self.max_loan_to_value, "max_loan_to_value")?; + decimal_param_le_one(self.liquidation_threshold, "liquidation_threshold")?; + assert_lqt_gte_max_ltv(self.max_loan_to_value, self.liquidation_threshold)?; + Ok(()) + } +} + +#[cw_serde] +pub enum AssetParamsUpdate { + AddOrUpdate { + denom: String, + params: AssetParams, + }, + Remove { + denom: String, + }, +} + +#[cw_serde] +pub enum VaultConfigUpdate { + AddOrUpdate { + addr: String, + config: VaultConfig, + }, + Remove { + addr: String, + }, +} diff --git a/contracts/params/tests/helpers/assertions.rs b/contracts/params/tests/helpers/assertions.rs new file mode 100644 index 000000000..857060fd9 --- /dev/null +++ b/contracts/params/tests/helpers/assertions.rs @@ -0,0 +1,25 @@ +use std::{collections::HashSet, hash::Hash}; + +use anyhow::Result as AnyResult; +use cw_multi_test::AppResponse; +use mars_params::error::ContractError; + +pub fn assert_err(res: AnyResult, err: ContractError) { + match res { + Ok(_) => panic!("Result was not an error"), + Err(generic_err) => { + let contract_err: ContractError = generic_err.downcast().unwrap(); + assert_eq!(contract_err, err); + } + } +} + +pub fn assert_contents_equal(vec_a: &[T], vec_b: &[T]) +where + T: Eq + Hash, +{ + let set_a: HashSet<_> = vec_a.iter().collect(); + let set_b: HashSet<_> = vec_b.iter().collect(); + + assert!(set_a == set_b) +} diff --git a/contracts/params/tests/helpers/contracts.rs b/contracts/params/tests/helpers/contracts.rs new file mode 100644 index 000000000..52c2cfef9 --- /dev/null +++ b/contracts/params/tests/helpers/contracts.rs @@ -0,0 +1,11 @@ +use cosmwasm_std::Empty; +use cw_multi_test::{Contract, ContractWrapper}; + +pub fn mock_params_contract() -> Box> { + let contract = ContractWrapper::new( + mars_params::contract::execute, + mars_params::contract::instantiate, + mars_params::contract::query, + ); + Box::new(contract) +} diff --git a/contracts/params/tests/helpers/generator.rs b/contracts/params/tests/helpers/generator.rs new file mode 100644 index 000000000..9f76fff37 --- /dev/null +++ b/contracts/params/tests/helpers/generator.rs @@ -0,0 +1,41 @@ +use std::str::FromStr; + +use cosmwasm_std::{coin, Decimal, Uint128}; +use mars_params::types::{ + AssetParams, AssetPermissions, RedBankPermissions, RoverPermissions, VaultConfig, +}; +use mars_red_bank_types::red_bank::InterestRateModel; + +pub fn default_asset_params() -> AssetParams { + AssetParams { + permissions: AssetPermissions { + rover: RoverPermissions { + whitelisted: false, + }, + red_bank: RedBankPermissions { + deposit_enabled: true, + borrow_enabled: false, + }, + }, + max_loan_to_value: Decimal::from_str("0.6").unwrap(), + liquidation_threshold: Decimal::from_str("0.7").unwrap(), + liquidation_bonus: Decimal::from_str("0.15").unwrap(), + red_bank_deposit_cap: Uint128::new(1_000_000_000), + interest_rate_model: InterestRateModel { + optimal_utilization_rate: Decimal::from_str("0.6").unwrap(), + base: Decimal::zero(), + slope_1: Decimal::from_str("0.15").unwrap(), + slope_2: Decimal::from_str("3").unwrap(), + }, + reserve_factor: Decimal::from_str("0.2").unwrap(), + } +} + +pub fn default_vault_config() -> VaultConfig { + VaultConfig { + deposit_cap: coin(100_000_000_000, "uusdc"), + max_loan_to_value: Decimal::from_str("0.47").unwrap(), + liquidation_threshold: Decimal::from_str("0.5").unwrap(), + whitelisted: true, + } +} diff --git a/contracts/params/tests/helpers/mock_env.rs b/contracts/params/tests/helpers/mock_env.rs new file mode 100644 index 000000000..31a466e68 --- /dev/null +++ b/contracts/params/tests/helpers/mock_env.rs @@ -0,0 +1,204 @@ +use std::{mem::take, str::FromStr}; + +use anyhow::Result as AnyResult; +use cosmwasm_std::{Addr, Decimal}; +use cw_multi_test::{App, AppResponse, BasicApp, Executor}; +use mars_owner::{OwnerResponse, OwnerUpdate}; +use mars_params::{ + msg::{ExecuteMsg, InstantiateMsg, QueryMsg}, + types::{ + AssetParams, AssetParamsResponse, AssetParamsUpdate, VaultConfig, VaultConfigResponse, + VaultConfigUpdate, + }, +}; + +use crate::helpers::mock_params_contract; + +pub struct MockEnv { + pub app: BasicApp, + pub params_contract: Addr, +} + +pub struct MockEnvBuilder { + pub app: BasicApp, + pub max_close_factor: Option, +} + +#[allow(clippy::new_ret_no_self)] +impl MockEnv { + pub fn new() -> MockEnvBuilder { + MockEnvBuilder { + app: App::default(), + max_close_factor: None, + } + } + + //-------------------------------------------------------------------------------------------------- + // Execute Msgs + //-------------------------------------------------------------------------------------------------- + + pub fn update_asset_params( + &mut self, + sender: &Addr, + update: AssetParamsUpdate, + ) -> AnyResult { + self.app.execute_contract( + sender.clone(), + self.params_contract.clone(), + &ExecuteMsg::UpdateAssetParams(update), + &[], + ) + } + + pub fn update_vault_config( + &mut self, + sender: &Addr, + update: VaultConfigUpdate, + ) -> AnyResult { + self.app.execute_contract( + sender.clone(), + self.params_contract.clone(), + &ExecuteMsg::UpdateVaultConfig(update), + &[], + ) + } + + pub fn update_owner(&mut self, sender: &Addr, update: OwnerUpdate) -> AnyResult { + self.app.execute_contract( + sender.clone(), + self.params_contract.clone(), + &ExecuteMsg::UpdateOwner(update), + &[], + ) + } + + pub fn update_max_close_factor( + &mut self, + sender: &Addr, + mcf: Decimal, + ) -> AnyResult { + self.app.execute_contract( + sender.clone(), + self.params_contract.clone(), + &ExecuteMsg::UpdateMaxCloseFactor(mcf), + &[], + ) + } + + //-------------------------------------------------------------------------------------------------- + // Queries + //-------------------------------------------------------------------------------------------------- + + pub fn query_owner(&self) -> Addr { + let res = self.query_ownership(); + Addr::unchecked(res.owner.unwrap()) + } + + pub fn query_ownership(&self) -> OwnerResponse { + self.app.wrap().query_wasm_smart(self.params_contract.clone(), &QueryMsg::Owner {}).unwrap() + } + + pub fn query_asset_params(&self, denom: &str) -> AssetParams { + self.app + .wrap() + .query_wasm_smart( + self.params_contract.clone(), + &QueryMsg::AssetParams { + denom: denom.to_string(), + }, + ) + .unwrap() + } + + pub fn query_all_asset_params( + &self, + start_after: Option, + limit: Option, + ) -> Vec { + self.app + .wrap() + .query_wasm_smart( + self.params_contract.clone(), + &QueryMsg::AllAssetParams { + start_after, + limit, + }, + ) + .unwrap() + } + + pub fn query_vault_config(&self, addr: &str) -> VaultConfig { + self.app + .wrap() + .query_wasm_smart( + self.params_contract.clone(), + &QueryMsg::VaultConfig { + address: addr.to_string(), + }, + ) + .unwrap() + } + + pub fn query_all_vault_configs( + &self, + start_after: Option, + limit: Option, + ) -> Vec { + self.app + .wrap() + .query_wasm_smart( + self.params_contract.clone(), + &QueryMsg::AllVaultConfigs { + start_after, + limit, + }, + ) + .unwrap() + } + + pub fn query_max_close_factor(&self) -> Decimal { + self.app + .wrap() + .query_wasm_smart(self.params_contract.clone(), &QueryMsg::MaxCloseFactor {}) + .unwrap() + } +} + +impl MockEnvBuilder { + pub fn build(&mut self) -> AnyResult { + let code_id = self.app.store_code(mock_params_contract()); + + let params_contract = self.app.instantiate_contract( + code_id, + Addr::unchecked("owner"), + &InstantiateMsg { + owner: "owner".to_string(), + max_close_factor: self.get_max_close_factor(), + }, + &[], + "mock-params-contract", + None, + )?; + + Ok(MockEnv { + app: take(&mut self.app), + params_contract, + }) + } + + //-------------------------------------------------------------------------------------------------- + // Get or defaults + //-------------------------------------------------------------------------------------------------- + + pub fn get_max_close_factor(&self) -> Decimal { + self.max_close_factor.unwrap_or(Decimal::from_str("0.5").unwrap()) + } + + //-------------------------------------------------------------------------------------------------- + // Setter functions + //-------------------------------------------------------------------------------------------------- + pub fn max_close_factor(&mut self, mcf: Decimal) -> &mut Self { + self.max_close_factor = Some(mcf); + self + } +} diff --git a/contracts/params/tests/helpers/mod.rs b/contracts/params/tests/helpers/mod.rs new file mode 100644 index 000000000..2c580c0be --- /dev/null +++ b/contracts/params/tests/helpers/mod.rs @@ -0,0 +1,6 @@ +pub use self::{assertions::*, contracts::*, generator::*, mock_env::*}; + +mod assertions; +mod contracts; +mod generator; +mod mock_env; diff --git a/contracts/params/tests/test_asset_validation.rs b/contracts/params/tests/test_asset_validation.rs new file mode 100644 index 000000000..06b10d683 --- /dev/null +++ b/contracts/params/tests/test_asset_validation.rs @@ -0,0 +1,168 @@ +use std::str::FromStr; + +use cosmwasm_std::Decimal; +use mars_params::{error::ContractError::Validation, types::AssetParamsUpdate}; +use mars_utils::error::ValidationError::{InvalidDenom, InvalidParam}; + +use crate::helpers::{assert_err, default_asset_params, MockEnv}; + +pub mod helpers; + +#[test] +fn denom_must_be_native() { + let mut mock = MockEnv::new().build().unwrap(); + let denom = "AA".to_string(); // Invalid native denom length + + let res = mock.update_asset_params( + &mock.query_owner(), + AssetParamsUpdate::AddOrUpdate { + denom, + params: default_asset_params(), + }, + ); + assert_err( + res, + Validation(InvalidDenom { + reason: "Invalid denom length".to_string(), + }), + ); +} + +#[test] +fn reserve_factor_less_than_one() { + let mut mock = MockEnv::new().build().unwrap(); + let mut params = default_asset_params(); + params.reserve_factor = Decimal::from_str("1.1235").unwrap(); + + let res = mock.update_asset_params( + &mock.query_owner(), + AssetParamsUpdate::AddOrUpdate { + denom: "denom_xyz".to_string(), + params, + }, + ); + assert_err( + res, + Validation(InvalidParam { + param_name: "reserve_factor".to_string(), + invalid_value: "1.1235".to_string(), + predicate: "< 1".to_string(), + }), + ); +} + +#[test] +fn max_ltv_less_than_or_equal_to_one() { + let mut mock = MockEnv::new().build().unwrap(); + let mut params = default_asset_params(); + params.max_loan_to_value = Decimal::from_str("1.1235").unwrap(); + + let res = mock.update_asset_params( + &mock.query_owner(), + AssetParamsUpdate::AddOrUpdate { + denom: "denom_xyz".to_string(), + params, + }, + ); + assert_err( + res, + Validation(InvalidParam { + param_name: "max_loan_to_value".to_string(), + invalid_value: "1.1235".to_string(), + predicate: "<= 1".to_string(), + }), + ); +} + +#[test] +fn liquidation_threshold_less_than_or_equal_to_one() { + let mut mock = MockEnv::new().build().unwrap(); + let mut params = default_asset_params(); + params.liquidation_threshold = Decimal::from_str("1.1235").unwrap(); + + let res = mock.update_asset_params( + &mock.query_owner(), + AssetParamsUpdate::AddOrUpdate { + denom: "denom_xyz".to_string(), + params, + }, + ); + assert_err( + res, + Validation(InvalidParam { + param_name: "liquidation_threshold".to_string(), + invalid_value: "1.1235".to_string(), + predicate: "<= 1".to_string(), + }), + ); +} + +#[test] +fn liquidation_bonus_less_than_or_equal_to_one() { + let mut mock = MockEnv::new().build().unwrap(); + let mut params = default_asset_params(); + params.liquidation_bonus = Decimal::from_str("1.1235").unwrap(); + + let res = mock.update_asset_params( + &mock.query_owner(), + AssetParamsUpdate::AddOrUpdate { + denom: "denom_xyz".to_string(), + params, + }, + ); + assert_err( + res, + Validation(InvalidParam { + param_name: "liquidation_bonus".to_string(), + invalid_value: "1.1235".to_string(), + predicate: "<= 1".to_string(), + }), + ); +} + +#[test] +fn liq_threshold_gte_max_ltv() { + let mut mock = MockEnv::new().build().unwrap(); + let mut params = default_asset_params(); + params.liquidation_threshold = Decimal::from_str("0.5").unwrap(); + params.max_loan_to_value = Decimal::from_str("0.6").unwrap(); + + let res = mock.update_asset_params( + &mock.query_owner(), + AssetParamsUpdate::AddOrUpdate { + denom: "denom_xyz".to_string(), + params, + }, + ); + assert_err( + res, + Validation(InvalidParam { + param_name: "liquidation_threshold".to_string(), + invalid_value: "0.5".to_string(), + predicate: "> 0.6 (max LTV)".to_string(), + }), + ); +} + +#[test] +fn interest_rate_model_validated() { + let mut mock = MockEnv::new().build().unwrap(); + let mut params = default_asset_params(); + params.interest_rate_model.optimal_utilization_rate = Decimal::from_str("1.5").unwrap(); + + let res = mock.update_asset_params( + &mock.query_owner(), + AssetParamsUpdate::AddOrUpdate { + denom: "denom_xyz".to_string(), + params, + }, + ); + assert_err( + res, + Validation(InvalidParam { + param_name: "optimal_utilization_rate".to_string(), + invalid_value: "1.5".to_string(), + predicate: "<= 1".to_string(), + }), + ); +} diff --git a/contracts/params/tests/test_close_factor.rs b/contracts/params/tests/test_close_factor.rs new file mode 100644 index 000000000..7b23d0bd6 --- /dev/null +++ b/contracts/params/tests/test_close_factor.rs @@ -0,0 +1,65 @@ +use std::str::FromStr; + +use cosmwasm_std::{Addr, Decimal}; +use mars_owner::{OwnerError, OwnerUpdate}; +use mars_params::error::ContractError::{Owner, Validation}; +use mars_utils::error::ValidationError::InvalidParam; + +use crate::helpers::{assert_err, MockEnv}; + +pub mod helpers; + +#[test] +fn mcf_set_on_init() { + let mock = MockEnv::new().build().unwrap(); + let mcf = mock.query_max_close_factor(); + assert_eq!(mcf, Decimal::from_str("0.5").unwrap()) +} + +#[test] +fn mcf_validated_on_init() { + let res = MockEnv::new().max_close_factor(Decimal::from_str("1.23").unwrap()).build(); + if res.is_ok() { + panic!("Should have thrown an instantiate error"); + } +} + +#[test] +fn only_owner_can_update_mcf() { + let mut mock = MockEnv::new().build().unwrap(); + let bad_guy = Addr::unchecked("doctor_otto_983"); + let res = mock.update_owner( + &bad_guy, + OwnerUpdate::ProposeNewOwner { + proposed: bad_guy.to_string(), + }, + ); + assert_err(res, Owner(OwnerError::NotOwner {})); +} + +#[test] +fn validated_updates() { + let mut mock = MockEnv::new().build().unwrap(); + let res = mock.update_max_close_factor(&mock.query_owner(), Decimal::from_str("1.9").unwrap()); + assert_err( + res, + Validation(InvalidParam { + param_name: "max-close-factor".to_string(), + invalid_value: "max-close-factor".to_string(), + predicate: "<= 1".to_string(), + }), + ); +} + +#[test] +fn update_mcf() { + let mut mock = MockEnv::new().build().unwrap(); + let new_max_close_factor = Decimal::from_str("0.9").unwrap(); + let current_mcf = mock.query_max_close_factor(); + assert_ne!(current_mcf, new_max_close_factor); + + mock.update_max_close_factor(&mock.query_owner(), Decimal::from_str("0.9").unwrap()).unwrap(); + + let current_mcf = mock.query_max_close_factor(); + assert_eq!(current_mcf, new_max_close_factor); +} diff --git a/contracts/params/tests/test_emergency_powers.rs b/contracts/params/tests/test_emergency_powers.rs new file mode 100644 index 000000000..8b1378917 --- /dev/null +++ b/contracts/params/tests/test_emergency_powers.rs @@ -0,0 +1 @@ + diff --git a/contracts/params/tests/test_owner.rs b/contracts/params/tests/test_owner.rs new file mode 100644 index 000000000..df525b854 --- /dev/null +++ b/contracts/params/tests/test_owner.rs @@ -0,0 +1,47 @@ +use cosmwasm_std::Addr; +use mars_owner::{OwnerError, OwnerUpdate}; +use mars_params::error::ContractError::Owner; + +use crate::helpers::{assert_err, MockEnv}; + +pub mod helpers; + +#[test] +fn owner_set_on_init() { + let mock = MockEnv::new().build().unwrap(); + let owner = mock.query_owner(); + assert_eq!("owner", &owner.to_string()) +} + +#[test] +fn only_owner_can_execute_updates() { + let mut mock = MockEnv::new().build().unwrap(); + let bad_guy = Addr::unchecked("doctor_otto_983"); + let res = mock.update_owner( + &bad_guy, + OwnerUpdate::ProposeNewOwner { + proposed: bad_guy.to_string(), + }, + ); + assert_err(res, Owner(OwnerError::NotOwner {})); +} + +#[test] +fn owner_can_execute_updates() { + let mut mock = MockEnv::new().build().unwrap(); + + let ownership = mock.query_ownership(); + assert_eq!(ownership.emergency_owner, None); + + let em_owner = "miles_morales".to_string(); + mock.update_owner( + &mock.query_owner(), + OwnerUpdate::SetEmergencyOwner { + emergency_owner: em_owner.clone(), + }, + ) + .unwrap(); + + let ownership = mock.query_ownership(); + assert_eq!(ownership.emergency_owner, Some(em_owner)); +} diff --git a/contracts/params/tests/test_update_asset_params.rs b/contracts/params/tests/test_update_asset_params.rs new file mode 100644 index 000000000..d129a32eb --- /dev/null +++ b/contracts/params/tests/test_update_asset_params.rs @@ -0,0 +1,311 @@ +use cosmwasm_std::Addr; +use mars_owner::OwnerError; +use mars_params::{error::ContractError::Owner, types::AssetParamsUpdate}; + +use crate::helpers::{assert_contents_equal, assert_err, default_asset_params, MockEnv}; + +pub mod helpers; + +#[test] +fn initial_state_of_params() { + let mock = MockEnv::new().build().unwrap(); + let params = mock.query_all_asset_params(None, None); + assert!(params.is_empty()); +} + +#[test] +fn only_owner_can_update_asset_params() { + let mut mock = MockEnv::new().build().unwrap(); + let bad_guy = Addr::unchecked("doctor_otto_983"); + let res = mock.update_asset_params( + &bad_guy, + AssetParamsUpdate::Remove { + denom: "xyz".to_string(), + }, + ); + assert_err(res, Owner(OwnerError::NotOwner {})); +} + +#[test] +fn initializing_asset_param() { + let mut mock = MockEnv::new().build().unwrap(); + let owner = mock.query_owner(); + let denom0 = "atom".to_string(); + let denom1 = "osmo".to_string(); + + let params = default_asset_params(); + + mock.update_asset_params( + &owner, + AssetParamsUpdate::AddOrUpdate { + denom: denom0.to_string(), + params: params.clone(), + }, + ) + .unwrap(); + + let all_asset_params = mock.query_all_asset_params(None, None); + assert_eq!(1, all_asset_params.len()); + let res = all_asset_params.first().unwrap(); + assert_eq!(&denom0, &res.denom); + + // Validate config set correctly + assert_eq!(params.permissions.rover.whitelisted, res.params.permissions.rover.whitelisted); + assert_eq!( + params.permissions.red_bank.deposit_enabled, + res.params.permissions.red_bank.deposit_enabled + ); + assert_eq!( + params.permissions.red_bank.borrow_enabled, + res.params.permissions.red_bank.borrow_enabled + ); + assert_eq!(params.max_loan_to_value, res.params.max_loan_to_value); + assert_eq!(params.liquidation_threshold, res.params.liquidation_threshold); + assert_eq!(params.liquidation_bonus, res.params.liquidation_bonus); + assert_eq!(params.red_bank_deposit_cap, res.params.red_bank_deposit_cap); + assert_eq!(params.interest_rate_model, res.params.interest_rate_model); + assert_eq!(params.reserve_factor, res.params.reserve_factor); + + mock.update_asset_params( + &owner, + AssetParamsUpdate::AddOrUpdate { + denom: denom1.to_string(), + params: default_asset_params(), + }, + ) + .unwrap(); + + let asset_params = mock.query_all_asset_params(None, None); + assert_eq!(2, asset_params.len()); + assert_eq!(&denom1, &asset_params.get(1).unwrap().denom); +} + +#[test] +fn add_same_denom_multiple_times() { + let mut mock = MockEnv::new().build().unwrap(); + let owner = mock.query_owner(); + let denom0 = "atom".to_string(); + + mock.update_asset_params( + &owner, + AssetParamsUpdate::AddOrUpdate { + denom: denom0.to_string(), + params: default_asset_params(), + }, + ) + .unwrap(); + mock.update_asset_params( + &owner, + AssetParamsUpdate::AddOrUpdate { + denom: denom0.to_string(), + params: default_asset_params(), + }, + ) + .unwrap(); + mock.update_asset_params( + &owner, + AssetParamsUpdate::AddOrUpdate { + denom: denom0.to_string(), + params: default_asset_params(), + }, + ) + .unwrap(); + mock.update_asset_params( + &owner, + AssetParamsUpdate::AddOrUpdate { + denom: denom0.to_string(), + params: default_asset_params(), + }, + ) + .unwrap(); + + let asset_params = mock.query_all_asset_params(None, None); + assert_eq!(1, asset_params.len()); + assert_eq!(denom0, asset_params.first().unwrap().denom); +} + +#[test] +fn update_existing_asset_params() { + let mut mock = MockEnv::new().build().unwrap(); + let owner = mock.query_owner(); + let denom0 = "atom".to_string(); + + let mut params = default_asset_params(); + + mock.update_asset_params( + &owner, + AssetParamsUpdate::AddOrUpdate { + denom: denom0.to_string(), + params: params.clone(), + }, + ) + .unwrap(); + + let asset_params = mock.query_asset_params(&denom0); + assert!(!asset_params.permissions.rover.whitelisted); + assert!(asset_params.permissions.red_bank.deposit_enabled); + + params.permissions.rover.whitelisted = true; + params.permissions.red_bank.deposit_enabled = false; + + mock.update_asset_params( + &owner, + AssetParamsUpdate::AddOrUpdate { + denom: denom0.to_string(), + params, + }, + ) + .unwrap(); + + let all_asset_params = mock.query_all_asset_params(None, None); + assert_eq!(1, all_asset_params.len()); + + let asset_params = mock.query_asset_params(&denom0); + assert!(asset_params.permissions.rover.whitelisted); + assert!(!asset_params.permissions.red_bank.deposit_enabled); +} + +#[test] +fn removing_from_asset_params() { + let mut mock = MockEnv::new().build().unwrap(); + let owner = mock.query_owner(); + let denom0 = "atom".to_string(); + let denom1 = "osmo".to_string(); + let denom2 = "juno".to_string(); + + mock.update_asset_params( + &owner, + AssetParamsUpdate::AddOrUpdate { + denom: denom0.to_string(), + params: default_asset_params(), + }, + ) + .unwrap(); + mock.update_asset_params( + &owner, + AssetParamsUpdate::AddOrUpdate { + denom: denom1.to_string(), + params: default_asset_params(), + }, + ) + .unwrap(); + mock.update_asset_params( + &owner, + AssetParamsUpdate::AddOrUpdate { + denom: denom2.to_string(), + params: default_asset_params(), + }, + ) + .unwrap(); + + let asset_params = mock.query_all_asset_params(None, None); + assert_eq!(3, asset_params.len()); + + mock.update_asset_params( + &owner, + AssetParamsUpdate::Remove { + denom: denom1, + }, + ) + .unwrap(); + let asset_params = mock.query_all_asset_params(None, None); + assert_eq!(2, asset_params.len()); + assert_eq!(&denom0, &asset_params.first().unwrap().denom); + assert_eq!(&denom2, &asset_params.get(1).unwrap().denom); + + mock.update_asset_params( + &owner, + AssetParamsUpdate::Remove { + denom: denom0, + }, + ) + .unwrap(); + mock.update_asset_params( + &owner, + AssetParamsUpdate::Remove { + denom: denom2, + }, + ) + .unwrap(); + let asset_params = mock.query_all_asset_params(None, None); + assert!(asset_params.is_empty()); +} + +#[test] +fn pagination_query() { + let mut mock = MockEnv::new().build().unwrap(); + let owner = mock.query_owner(); + let denom0 = "atom".to_string(); + let denom1 = "osmo".to_string(); + let denom2 = "juno".to_string(); + let denom3 = "mars".to_string(); + let denom4 = "ion".to_string(); + let denom5 = "usdc".to_string(); + + mock.update_asset_params( + &owner, + AssetParamsUpdate::AddOrUpdate { + denom: denom0.to_string(), + params: default_asset_params(), + }, + ) + .unwrap(); + mock.update_asset_params( + &owner, + AssetParamsUpdate::AddOrUpdate { + denom: denom1.to_string(), + params: default_asset_params(), + }, + ) + .unwrap(); + mock.update_asset_params( + &owner, + AssetParamsUpdate::AddOrUpdate { + denom: denom2.to_string(), + params: default_asset_params(), + }, + ) + .unwrap(); + mock.update_asset_params( + &owner, + AssetParamsUpdate::AddOrUpdate { + denom: denom3.to_string(), + params: default_asset_params(), + }, + ) + .unwrap(); + mock.update_asset_params( + &owner, + AssetParamsUpdate::AddOrUpdate { + denom: denom4.to_string(), + params: default_asset_params(), + }, + ) + .unwrap(); + mock.update_asset_params( + &owner, + AssetParamsUpdate::AddOrUpdate { + denom: denom5.to_string(), + params: default_asset_params(), + }, + ) + .unwrap(); + + let asset_params_a = mock.query_all_asset_params(None, Some(2)); + let asset_params_b = + mock.query_all_asset_params(asset_params_a.last().map(|r| r.denom.clone()), Some(2)); + let asset_params_c = + mock.query_all_asset_params(asset_params_b.last().map(|r| r.denom.clone()), None); + + let combined = asset_params_a + .iter() + .cloned() + .chain(asset_params_b.iter().cloned()) + .chain(asset_params_c.iter().cloned()) + .map(|r| r.denom) + .collect::>(); + + assert_eq!(6, combined.len()); + + assert_contents_equal(&[denom0, denom1, denom2, denom3, denom4, denom5], &combined) +} diff --git a/contracts/params/tests/test_vault_validation.rs b/contracts/params/tests/test_vault_validation.rs new file mode 100644 index 000000000..2cda0c779 --- /dev/null +++ b/contracts/params/tests/test_vault_validation.rs @@ -0,0 +1,99 @@ +use std::str::FromStr; + +use cosmwasm_std::{Decimal, StdError::GenericErr}; +use mars_params::{ + error::ContractError::{Std, Validation}, + types::VaultConfigUpdate, +}; +use mars_utils::error::ValidationError::InvalidParam; + +use crate::helpers::{assert_err, default_vault_config, MockEnv}; + +pub mod helpers; + +#[test] +fn vault_addr_must_be_valid() { + let mut mock = MockEnv::new().build().unwrap(); + + let res = mock.update_vault_config( + &mock.query_owner(), + VaultConfigUpdate::AddOrUpdate { + addr: "%".to_string(), + config: default_vault_config(), + }, + ); + assert_err( + res, + Std(GenericErr { msg: "Invalid input: human address too short for this mock implementation (must be >= 3).".to_string() }), + ); +} + +#[test] +fn vault_max_ltv_less_than_or_equal_to_one() { + let mut mock = MockEnv::new().build().unwrap(); + let mut config = default_vault_config(); + config.max_loan_to_value = Decimal::from_str("1.1235").unwrap(); + + let res = mock.update_vault_config( + &mock.query_owner(), + VaultConfigUpdate::AddOrUpdate { + addr: "vault_xyz".to_string(), + config, + }, + ); + assert_err( + res, + Validation(InvalidParam { + param_name: "max_loan_to_value".to_string(), + invalid_value: "1.1235".to_string(), + predicate: "<= 1".to_string(), + }), + ); +} + +#[test] +fn vault_liquidation_threshold_less_than_or_equal_to_one() { + let mut mock = MockEnv::new().build().unwrap(); + let mut config = default_vault_config(); + config.liquidation_threshold = Decimal::from_str("1.1235").unwrap(); + + let res = mock.update_vault_config( + &mock.query_owner(), + VaultConfigUpdate::AddOrUpdate { + addr: "vault_xyz".to_string(), + config, + }, + ); + assert_err( + res, + Validation(InvalidParam { + param_name: "liquidation_threshold".to_string(), + invalid_value: "1.1235".to_string(), + predicate: "<= 1".to_string(), + }), + ); +} + +#[test] +fn vault_liq_threshold_gte_max_ltv() { + let mut mock = MockEnv::new().build().unwrap(); + let mut config = default_vault_config(); + config.liquidation_threshold = Decimal::from_str("0.5").unwrap(); + config.max_loan_to_value = Decimal::from_str("0.6").unwrap(); + + let res = mock.update_vault_config( + &mock.query_owner(), + VaultConfigUpdate::AddOrUpdate { + addr: "vault_xyz".to_string(), + config, + }, + ); + assert_err( + res, + Validation(InvalidParam { + param_name: "liquidation_threshold".to_string(), + invalid_value: "0.5".to_string(), + predicate: "> 0.6 (max LTV)".to_string(), + }), + ); +} diff --git a/contracts/params/tests/test_vaults.rs b/contracts/params/tests/test_vaults.rs new file mode 100644 index 000000000..ba1fec053 --- /dev/null +++ b/contracts/params/tests/test_vaults.rs @@ -0,0 +1,304 @@ +use std::str::FromStr; + +use cosmwasm_std::{Addr, Decimal}; +use mars_owner::OwnerError; +use mars_params::{error::ContractError::Owner, types::VaultConfigUpdate}; + +use crate::helpers::{assert_contents_equal, assert_err, default_vault_config, MockEnv}; + +pub mod helpers; + +#[test] +fn initial_state_of_vault_configs() { + let mock = MockEnv::new().build().unwrap(); + let configs = mock.query_all_vault_configs(None, None); + assert!(configs.is_empty()); +} + +#[test] +fn only_owner_can_update_vault_configs() { + let mut mock = MockEnv::new().build().unwrap(); + let bad_guy = Addr::unchecked("doctor_otto_983"); + let res = mock.update_vault_config( + &bad_guy, + VaultConfigUpdate::Remove { + addr: "xyz".to_string(), + }, + ); + assert_err(res, Owner(OwnerError::NotOwner {})); +} + +#[test] +fn initializing_asset_param() { + let mut mock = MockEnv::new().build().unwrap(); + let owner = mock.query_owner(); + let vault0 = "vault_addr_0".to_string(); + let vault1 = "vault_addr_1".to_string(); + + let config = default_vault_config(); + + mock.update_vault_config( + &owner, + VaultConfigUpdate::AddOrUpdate { + addr: vault0.clone(), + config: config.clone(), + }, + ) + .unwrap(); + + let all_vault_configs = mock.query_all_vault_configs(None, None); + assert_eq!(1, all_vault_configs.len()); + let res = all_vault_configs.first().unwrap(); + assert_eq!(&vault0, &res.addr); + + // Validate config set correctly + assert_eq!(config.max_loan_to_value, res.config.max_loan_to_value); + assert_eq!(config.liquidation_threshold, res.config.liquidation_threshold); + assert_eq!(config.deposit_cap.denom, res.config.deposit_cap.denom); + assert_eq!(config.deposit_cap.amount, res.config.deposit_cap.amount); + assert_eq!(config.whitelisted, res.config.whitelisted); + + mock.update_vault_config( + &owner, + VaultConfigUpdate::AddOrUpdate { + addr: vault1.clone(), + config, + }, + ) + .unwrap(); + + let vault_configs = mock.query_all_vault_configs(None, None); + assert_eq!(2, vault_configs.len()); + assert_eq!(&vault1, &vault_configs.get(1).unwrap().addr); +} + +#[test] +fn add_same_vault_multiple_times() { + let mut mock = MockEnv::new().build().unwrap(); + let owner = mock.query_owner(); + let vault0 = "vault_addr_0".to_string(); + + mock.update_vault_config( + &owner, + VaultConfigUpdate::AddOrUpdate { + addr: vault0.to_string(), + config: default_vault_config(), + }, + ) + .unwrap(); + mock.update_vault_config( + &owner, + VaultConfigUpdate::AddOrUpdate { + addr: vault0.to_string(), + config: default_vault_config(), + }, + ) + .unwrap(); + mock.update_vault_config( + &owner, + VaultConfigUpdate::AddOrUpdate { + addr: vault0.to_string(), + config: default_vault_config(), + }, + ) + .unwrap(); + mock.update_vault_config( + &owner, + VaultConfigUpdate::AddOrUpdate { + addr: vault0.to_string(), + config: default_vault_config(), + }, + ) + .unwrap(); + + let vault_configs = mock.query_all_vault_configs(None, None); + assert_eq!(1, vault_configs.len()); + assert_eq!(vault0, vault_configs.first().unwrap().addr); +} + +#[test] +fn update_existing_vault_configs() { + let mut mock = MockEnv::new().build().unwrap(); + let owner = mock.query_owner(); + let vault0 = "vault_addr_0".to_string(); + + let mut config = default_vault_config(); + + mock.update_vault_config( + &owner, + VaultConfigUpdate::AddOrUpdate { + addr: vault0.to_string(), + config: config.clone(), + }, + ) + .unwrap(); + + let vault_config = mock.query_vault_config(&vault0); + assert!(vault_config.whitelisted); + assert_eq!(vault_config.max_loan_to_value, Decimal::from_str("0.47").unwrap()); + + let new_max_ltv = Decimal::from_str("0.39").unwrap(); + config.whitelisted = false; + config.max_loan_to_value = new_max_ltv; + + mock.update_vault_config( + &owner, + VaultConfigUpdate::AddOrUpdate { + addr: vault0.to_string(), + config, + }, + ) + .unwrap(); + + let all_vault_configs = mock.query_all_vault_configs(None, None); + assert_eq!(1, all_vault_configs.len()); + + let vault_config = mock.query_vault_config(&vault0); + assert!(!vault_config.whitelisted); + assert_eq!(vault_config.max_loan_to_value, new_max_ltv); +} + +#[test] +fn removing_from_vault_configs() { + let mut mock = MockEnv::new().build().unwrap(); + let owner = mock.query_owner(); + let vault0 = "vault_addr_0".to_string(); + let vault1 = "vault_addr_1".to_string(); + let vault2 = "vault_addr_2".to_string(); + + mock.update_vault_config( + &owner, + VaultConfigUpdate::AddOrUpdate { + addr: vault0.to_string(), + config: default_vault_config(), + }, + ) + .unwrap(); + mock.update_vault_config( + &owner, + VaultConfigUpdate::AddOrUpdate { + addr: vault1.to_string(), + config: default_vault_config(), + }, + ) + .unwrap(); + mock.update_vault_config( + &owner, + VaultConfigUpdate::AddOrUpdate { + addr: vault2.to_string(), + config: default_vault_config(), + }, + ) + .unwrap(); + + let vault_configs = mock.query_all_vault_configs(None, None); + assert_eq!(3, vault_configs.len()); + + mock.update_vault_config( + &owner, + VaultConfigUpdate::Remove { + addr: vault1, + }, + ) + .unwrap(); + let vault_configs = mock.query_all_vault_configs(None, None); + assert_eq!(2, vault_configs.len()); + assert_eq!(&vault0, &vault_configs.first().unwrap().addr); + assert_eq!(&vault2, &vault_configs.get(1).unwrap().addr); + + mock.update_vault_config( + &owner, + VaultConfigUpdate::Remove { + addr: vault0, + }, + ) + .unwrap(); + mock.update_vault_config( + &owner, + VaultConfigUpdate::Remove { + addr: vault2, + }, + ) + .unwrap(); + let vault_configs = mock.query_all_vault_configs(None, None); + assert!(vault_configs.is_empty()); +} + +#[test] +fn pagination_query() { + let mut mock = MockEnv::new().build().unwrap(); + let owner = mock.query_owner(); + let vault0 = "vault_addr_0".to_string(); + let vault1 = "vault_addr_1".to_string(); + let vault2 = "vault_addr_2".to_string(); + let vault3 = "vault_addr_3".to_string(); + let vault4 = "vault_addr_4".to_string(); + let vault5 = "vault_addr_5".to_string(); + + mock.update_vault_config( + &owner, + VaultConfigUpdate::AddOrUpdate { + addr: vault0.to_string(), + config: default_vault_config(), + }, + ) + .unwrap(); + mock.update_vault_config( + &owner, + VaultConfigUpdate::AddOrUpdate { + addr: vault1.to_string(), + config: default_vault_config(), + }, + ) + .unwrap(); + mock.update_vault_config( + &owner, + VaultConfigUpdate::AddOrUpdate { + addr: vault2.to_string(), + config: default_vault_config(), + }, + ) + .unwrap(); + mock.update_vault_config( + &owner, + VaultConfigUpdate::AddOrUpdate { + addr: vault3.to_string(), + config: default_vault_config(), + }, + ) + .unwrap(); + mock.update_vault_config( + &owner, + VaultConfigUpdate::AddOrUpdate { + addr: vault4.to_string(), + config: default_vault_config(), + }, + ) + .unwrap(); + mock.update_vault_config( + &owner, + VaultConfigUpdate::AddOrUpdate { + addr: vault5.to_string(), + config: default_vault_config(), + }, + ) + .unwrap(); + + let vault_configs_a = mock.query_all_vault_configs(None, Some(2)); + let vault_configs_b = + mock.query_all_vault_configs(vault_configs_a.last().map(|r| r.addr.to_string()), Some(2)); + let vault_configs_c = + mock.query_all_vault_configs(vault_configs_b.last().map(|r| r.addr.to_string()), None); + + let combined = vault_configs_a + .iter() + .cloned() + .chain(vault_configs_b.iter().cloned()) + .chain(vault_configs_c.iter().cloned()) + .map(|r| r.addr.to_string()) + .collect::>(); + + assert_eq!(6, combined.len()); + + assert_contents_equal(&[vault0, vault1, vault2, vault3, vault4, vault5], &combined) +} diff --git a/schema.Makefile.toml b/schema.Makefile.toml index 52a17327b..4577c5dfa 100644 --- a/schema.Makefile.toml +++ b/schema.Makefile.toml @@ -12,6 +12,7 @@ fn main() -> std::io::Result<()> { let contracts = vec![ "mars-swapper-osmosis", + "mars-params", ]; for contract in contracts { diff --git a/schemas/mars-params/mars-params.json b/schemas/mars-params/mars-params.json new file mode 100644 index 000000000..0e474c451 --- /dev/null +++ b/schemas/mars-params/mars-params.json @@ -0,0 +1,1020 @@ +{ + "contract_name": "mars-params", + "contract_version": "1.0.0", + "idl_version": "1.0.0", + "instantiate": { + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "InstantiateMsg", + "type": "object", + "required": [ + "max_close_factor", + "owner" + ], + "properties": { + "max_close_factor": { + "description": "The maximum percent a liquidator can decrease the debt amount of the liquidatee", + "allOf": [ + { + "$ref": "#/definitions/Decimal" + } + ] + }, + "owner": { + "description": "Contract's owner", + "type": "string" + } + }, + "additionalProperties": false, + "definitions": { + "Decimal": { + "description": "A fixed-point decimal value with 18 fractional digits, i.e. Decimal(1_000_000_000_000_000_000) == 1.0\n\nThe greatest possible value that can be represented is 340282366920938463463.374607431768211455 (which is (2^128 - 1) / 10^18)", + "type": "string" + } + } + }, + "execute": { + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "ExecuteMsg", + "oneOf": [ + { + "type": "object", + "required": [ + "update_owner" + ], + "properties": { + "update_owner": { + "$ref": "#/definitions/OwnerUpdate" + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "update_max_close_factor" + ], + "properties": { + "update_max_close_factor": { + "$ref": "#/definitions/Decimal" + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "update_asset_params" + ], + "properties": { + "update_asset_params": { + "$ref": "#/definitions/AssetParamsUpdate" + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "update_vault_config" + ], + "properties": { + "update_vault_config": { + "$ref": "#/definitions/VaultConfigUpdate" + } + }, + "additionalProperties": false + } + ], + "definitions": { + "AssetParams": { + "type": "object", + "required": [ + "interest_rate_model", + "liquidation_bonus", + "liquidation_threshold", + "max_loan_to_value", + "permissions", + "red_bank_deposit_cap", + "reserve_factor" + ], + "properties": { + "interest_rate_model": { + "$ref": "#/definitions/InterestRateModel" + }, + "liquidation_bonus": { + "$ref": "#/definitions/Decimal" + }, + "liquidation_threshold": { + "$ref": "#/definitions/Decimal" + }, + "max_loan_to_value": { + "$ref": "#/definitions/Decimal" + }, + "permissions": { + "$ref": "#/definitions/AssetPermissions" + }, + "red_bank_deposit_cap": { + "$ref": "#/definitions/Uint128" + }, + "reserve_factor": { + "$ref": "#/definitions/Decimal" + } + }, + "additionalProperties": false + }, + "AssetParamsUpdate": { + "oneOf": [ + { + "type": "object", + "required": [ + "add_or_update" + ], + "properties": { + "add_or_update": { + "type": "object", + "required": [ + "denom", + "params" + ], + "properties": { + "denom": { + "type": "string" + }, + "params": { + "$ref": "#/definitions/AssetParams" + } + }, + "additionalProperties": false + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "remove" + ], + "properties": { + "remove": { + "type": "object", + "required": [ + "denom" + ], + "properties": { + "denom": { + "type": "string" + } + }, + "additionalProperties": false + } + }, + "additionalProperties": false + } + ] + }, + "AssetPermissions": { + "type": "object", + "required": [ + "red_bank", + "rover" + ], + "properties": { + "red_bank": { + "$ref": "#/definitions/RedBankPermissions" + }, + "rover": { + "$ref": "#/definitions/RoverPermissions" + } + }, + "additionalProperties": false + }, + "Coin": { + "type": "object", + "required": [ + "amount", + "denom" + ], + "properties": { + "amount": { + "$ref": "#/definitions/Uint128" + }, + "denom": { + "type": "string" + } + } + }, + "Decimal": { + "description": "A fixed-point decimal value with 18 fractional digits, i.e. Decimal(1_000_000_000_000_000_000) == 1.0\n\nThe greatest possible value that can be represented is 340282366920938463463.374607431768211455 (which is (2^128 - 1) / 10^18)", + "type": "string" + }, + "InterestRateModel": { + "type": "object", + "required": [ + "base", + "optimal_utilization_rate", + "slope_1", + "slope_2" + ], + "properties": { + "base": { + "description": "Base rate", + "allOf": [ + { + "$ref": "#/definitions/Decimal" + } + ] + }, + "optimal_utilization_rate": { + "description": "Optimal utilization rate", + "allOf": [ + { + "$ref": "#/definitions/Decimal" + } + ] + }, + "slope_1": { + "description": "Slope parameter for interest rate model function when utilization_rate < optimal_utilization_rate", + "allOf": [ + { + "$ref": "#/definitions/Decimal" + } + ] + }, + "slope_2": { + "description": "Slope parameter for interest rate model function when utilization_rate >= optimal_utilization_rate", + "allOf": [ + { + "$ref": "#/definitions/Decimal" + } + ] + } + }, + "additionalProperties": false + }, + "OwnerUpdate": { + "oneOf": [ + { + "description": "Proposes a new owner to take role. Only current owner can execute.", + "type": "object", + "required": [ + "propose_new_owner" + ], + "properties": { + "propose_new_owner": { + "type": "object", + "required": [ + "proposed" + ], + "properties": { + "proposed": { + "type": "string" + } + }, + "additionalProperties": false + } + }, + "additionalProperties": false + }, + { + "description": "Clears the currently proposed owner. Only current owner can execute.", + "type": "string", + "enum": [ + "clear_proposed" + ] + }, + { + "description": "Promotes the proposed owner to be the current one. Only the proposed owner can execute.", + "type": "string", + "enum": [ + "accept_proposed" + ] + }, + { + "description": "Throws away the keys to the Owner role forever. Once done, no owner can ever be set later.", + "type": "string", + "enum": [ + "abolish_owner_role" + ] + }, + { + "description": "A separate entity managed by Owner that can be used for granting specific emergency powers.", + "type": "object", + "required": [ + "set_emergency_owner" + ], + "properties": { + "set_emergency_owner": { + "type": "object", + "required": [ + "emergency_owner" + ], + "properties": { + "emergency_owner": { + "type": "string" + } + }, + "additionalProperties": false + } + }, + "additionalProperties": false + }, + { + "description": "Remove the entity in the Emergency Owner role", + "type": "string", + "enum": [ + "clear_emergency_owner" + ] + } + ] + }, + "RedBankPermissions": { + "type": "object", + "required": [ + "borrow_enabled", + "deposit_enabled" + ], + "properties": { + "borrow_enabled": { + "type": "boolean" + }, + "deposit_enabled": { + "type": "boolean" + } + }, + "additionalProperties": false + }, + "RoverPermissions": { + "type": "object", + "required": [ + "whitelisted" + ], + "properties": { + "whitelisted": { + "type": "boolean" + } + }, + "additionalProperties": false + }, + "Uint128": { + "description": "A thin wrapper around u128 that is using strings for JSON encoding/decoding, such that the full u128 range can be used for clients that convert JSON numbers to floats, like JavaScript and jq.\n\n# Examples\n\nUse `from` to create instances of this and `u128` to get the value out:\n\n``` # use cosmwasm_std::Uint128; let a = Uint128::from(123u128); assert_eq!(a.u128(), 123);\n\nlet b = Uint128::from(42u64); assert_eq!(b.u128(), 42);\n\nlet c = Uint128::from(70u32); assert_eq!(c.u128(), 70); ```", + "type": "string" + }, + "VaultConfig": { + "type": "object", + "required": [ + "deposit_cap", + "liquidation_threshold", + "max_loan_to_value", + "whitelisted" + ], + "properties": { + "deposit_cap": { + "$ref": "#/definitions/Coin" + }, + "liquidation_threshold": { + "$ref": "#/definitions/Decimal" + }, + "max_loan_to_value": { + "$ref": "#/definitions/Decimal" + }, + "whitelisted": { + "type": "boolean" + } + }, + "additionalProperties": false + }, + "VaultConfigUpdate": { + "oneOf": [ + { + "type": "object", + "required": [ + "add_or_update" + ], + "properties": { + "add_or_update": { + "type": "object", + "required": [ + "addr", + "config" + ], + "properties": { + "addr": { + "type": "string" + }, + "config": { + "$ref": "#/definitions/VaultConfig" + } + }, + "additionalProperties": false + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "remove" + ], + "properties": { + "remove": { + "type": "object", + "required": [ + "addr" + ], + "properties": { + "addr": { + "type": "string" + } + }, + "additionalProperties": false + } + }, + "additionalProperties": false + } + ] + } + } + }, + "query": { + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "QueryMsg", + "oneOf": [ + { + "type": "object", + "required": [ + "owner" + ], + "properties": { + "owner": { + "type": "object", + "additionalProperties": false + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "asset_params" + ], + "properties": { + "asset_params": { + "type": "object", + "required": [ + "denom" + ], + "properties": { + "denom": { + "type": "string" + } + }, + "additionalProperties": false + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "all_asset_params" + ], + "properties": { + "all_asset_params": { + "type": "object", + "properties": { + "limit": { + "type": [ + "integer", + "null" + ], + "format": "uint32", + "minimum": 0.0 + }, + "start_after": { + "type": [ + "string", + "null" + ] + } + }, + "additionalProperties": false + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "vault_config" + ], + "properties": { + "vault_config": { + "type": "object", + "required": [ + "address" + ], + "properties": { + "address": { + "description": "Address of vault", + "type": "string" + } + }, + "additionalProperties": false + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "all_vault_configs" + ], + "properties": { + "all_vault_configs": { + "type": "object", + "properties": { + "limit": { + "type": [ + "integer", + "null" + ], + "format": "uint32", + "minimum": 0.0 + }, + "start_after": { + "type": [ + "string", + "null" + ] + } + }, + "additionalProperties": false + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "max_close_factor" + ], + "properties": { + "max_close_factor": { + "type": "object", + "additionalProperties": false + } + }, + "additionalProperties": false + } + ] + }, + "migrate": null, + "sudo": null, + "responses": { + "all_asset_params": { + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "Array_of_AssetParamsResponse", + "type": "array", + "items": { + "$ref": "#/definitions/AssetParamsResponse" + }, + "definitions": { + "AssetParams": { + "type": "object", + "required": [ + "interest_rate_model", + "liquidation_bonus", + "liquidation_threshold", + "max_loan_to_value", + "permissions", + "red_bank_deposit_cap", + "reserve_factor" + ], + "properties": { + "interest_rate_model": { + "$ref": "#/definitions/InterestRateModel" + }, + "liquidation_bonus": { + "$ref": "#/definitions/Decimal" + }, + "liquidation_threshold": { + "$ref": "#/definitions/Decimal" + }, + "max_loan_to_value": { + "$ref": "#/definitions/Decimal" + }, + "permissions": { + "$ref": "#/definitions/AssetPermissions" + }, + "red_bank_deposit_cap": { + "$ref": "#/definitions/Uint128" + }, + "reserve_factor": { + "$ref": "#/definitions/Decimal" + } + }, + "additionalProperties": false + }, + "AssetParamsResponse": { + "type": "object", + "required": [ + "denom", + "params" + ], + "properties": { + "denom": { + "type": "string" + }, + "params": { + "$ref": "#/definitions/AssetParams" + } + }, + "additionalProperties": false + }, + "AssetPermissions": { + "type": "object", + "required": [ + "red_bank", + "rover" + ], + "properties": { + "red_bank": { + "$ref": "#/definitions/RedBankPermissions" + }, + "rover": { + "$ref": "#/definitions/RoverPermissions" + } + }, + "additionalProperties": false + }, + "Decimal": { + "description": "A fixed-point decimal value with 18 fractional digits, i.e. Decimal(1_000_000_000_000_000_000) == 1.0\n\nThe greatest possible value that can be represented is 340282366920938463463.374607431768211455 (which is (2^128 - 1) / 10^18)", + "type": "string" + }, + "InterestRateModel": { + "type": "object", + "required": [ + "base", + "optimal_utilization_rate", + "slope_1", + "slope_2" + ], + "properties": { + "base": { + "description": "Base rate", + "allOf": [ + { + "$ref": "#/definitions/Decimal" + } + ] + }, + "optimal_utilization_rate": { + "description": "Optimal utilization rate", + "allOf": [ + { + "$ref": "#/definitions/Decimal" + } + ] + }, + "slope_1": { + "description": "Slope parameter for interest rate model function when utilization_rate < optimal_utilization_rate", + "allOf": [ + { + "$ref": "#/definitions/Decimal" + } + ] + }, + "slope_2": { + "description": "Slope parameter for interest rate model function when utilization_rate >= optimal_utilization_rate", + "allOf": [ + { + "$ref": "#/definitions/Decimal" + } + ] + } + }, + "additionalProperties": false + }, + "RedBankPermissions": { + "type": "object", + "required": [ + "borrow_enabled", + "deposit_enabled" + ], + "properties": { + "borrow_enabled": { + "type": "boolean" + }, + "deposit_enabled": { + "type": "boolean" + } + }, + "additionalProperties": false + }, + "RoverPermissions": { + "type": "object", + "required": [ + "whitelisted" + ], + "properties": { + "whitelisted": { + "type": "boolean" + } + }, + "additionalProperties": false + }, + "Uint128": { + "description": "A thin wrapper around u128 that is using strings for JSON encoding/decoding, such that the full u128 range can be used for clients that convert JSON numbers to floats, like JavaScript and jq.\n\n# Examples\n\nUse `from` to create instances of this and `u128` to get the value out:\n\n``` # use cosmwasm_std::Uint128; let a = Uint128::from(123u128); assert_eq!(a.u128(), 123);\n\nlet b = Uint128::from(42u64); assert_eq!(b.u128(), 42);\n\nlet c = Uint128::from(70u32); assert_eq!(c.u128(), 70); ```", + "type": "string" + } + } + }, + "all_vault_configs": { + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "Array_of_VaultConfig", + "type": "array", + "items": { + "$ref": "#/definitions/VaultConfig" + }, + "definitions": { + "Coin": { + "type": "object", + "required": [ + "amount", + "denom" + ], + "properties": { + "amount": { + "$ref": "#/definitions/Uint128" + }, + "denom": { + "type": "string" + } + } + }, + "Decimal": { + "description": "A fixed-point decimal value with 18 fractional digits, i.e. Decimal(1_000_000_000_000_000_000) == 1.0\n\nThe greatest possible value that can be represented is 340282366920938463463.374607431768211455 (which is (2^128 - 1) / 10^18)", + "type": "string" + }, + "Uint128": { + "description": "A thin wrapper around u128 that is using strings for JSON encoding/decoding, such that the full u128 range can be used for clients that convert JSON numbers to floats, like JavaScript and jq.\n\n# Examples\n\nUse `from` to create instances of this and `u128` to get the value out:\n\n``` # use cosmwasm_std::Uint128; let a = Uint128::from(123u128); assert_eq!(a.u128(), 123);\n\nlet b = Uint128::from(42u64); assert_eq!(b.u128(), 42);\n\nlet c = Uint128::from(70u32); assert_eq!(c.u128(), 70); ```", + "type": "string" + }, + "VaultConfig": { + "type": "object", + "required": [ + "deposit_cap", + "liquidation_threshold", + "max_loan_to_value", + "whitelisted" + ], + "properties": { + "deposit_cap": { + "$ref": "#/definitions/Coin" + }, + "liquidation_threshold": { + "$ref": "#/definitions/Decimal" + }, + "max_loan_to_value": { + "$ref": "#/definitions/Decimal" + }, + "whitelisted": { + "type": "boolean" + } + }, + "additionalProperties": false + } + } + }, + "asset_params": { + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "AssetParams", + "type": "object", + "required": [ + "interest_rate_model", + "liquidation_bonus", + "liquidation_threshold", + "max_loan_to_value", + "permissions", + "red_bank_deposit_cap", + "reserve_factor" + ], + "properties": { + "interest_rate_model": { + "$ref": "#/definitions/InterestRateModel" + }, + "liquidation_bonus": { + "$ref": "#/definitions/Decimal" + }, + "liquidation_threshold": { + "$ref": "#/definitions/Decimal" + }, + "max_loan_to_value": { + "$ref": "#/definitions/Decimal" + }, + "permissions": { + "$ref": "#/definitions/AssetPermissions" + }, + "red_bank_deposit_cap": { + "$ref": "#/definitions/Uint128" + }, + "reserve_factor": { + "$ref": "#/definitions/Decimal" + } + }, + "additionalProperties": false, + "definitions": { + "AssetPermissions": { + "type": "object", + "required": [ + "red_bank", + "rover" + ], + "properties": { + "red_bank": { + "$ref": "#/definitions/RedBankPermissions" + }, + "rover": { + "$ref": "#/definitions/RoverPermissions" + } + }, + "additionalProperties": false + }, + "Decimal": { + "description": "A fixed-point decimal value with 18 fractional digits, i.e. Decimal(1_000_000_000_000_000_000) == 1.0\n\nThe greatest possible value that can be represented is 340282366920938463463.374607431768211455 (which is (2^128 - 1) / 10^18)", + "type": "string" + }, + "InterestRateModel": { + "type": "object", + "required": [ + "base", + "optimal_utilization_rate", + "slope_1", + "slope_2" + ], + "properties": { + "base": { + "description": "Base rate", + "allOf": [ + { + "$ref": "#/definitions/Decimal" + } + ] + }, + "optimal_utilization_rate": { + "description": "Optimal utilization rate", + "allOf": [ + { + "$ref": "#/definitions/Decimal" + } + ] + }, + "slope_1": { + "description": "Slope parameter for interest rate model function when utilization_rate < optimal_utilization_rate", + "allOf": [ + { + "$ref": "#/definitions/Decimal" + } + ] + }, + "slope_2": { + "description": "Slope parameter for interest rate model function when utilization_rate >= optimal_utilization_rate", + "allOf": [ + { + "$ref": "#/definitions/Decimal" + } + ] + } + }, + "additionalProperties": false + }, + "RedBankPermissions": { + "type": "object", + "required": [ + "borrow_enabled", + "deposit_enabled" + ], + "properties": { + "borrow_enabled": { + "type": "boolean" + }, + "deposit_enabled": { + "type": "boolean" + } + }, + "additionalProperties": false + }, + "RoverPermissions": { + "type": "object", + "required": [ + "whitelisted" + ], + "properties": { + "whitelisted": { + "type": "boolean" + } + }, + "additionalProperties": false + }, + "Uint128": { + "description": "A thin wrapper around u128 that is using strings for JSON encoding/decoding, such that the full u128 range can be used for clients that convert JSON numbers to floats, like JavaScript and jq.\n\n# Examples\n\nUse `from` to create instances of this and `u128` to get the value out:\n\n``` # use cosmwasm_std::Uint128; let a = Uint128::from(123u128); assert_eq!(a.u128(), 123);\n\nlet b = Uint128::from(42u64); assert_eq!(b.u128(), 42);\n\nlet c = Uint128::from(70u32); assert_eq!(c.u128(), 70); ```", + "type": "string" + } + } + }, + "max_close_factor": { + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "Decimal", + "description": "A fixed-point decimal value with 18 fractional digits, i.e. Decimal(1_000_000_000_000_000_000) == 1.0\n\nThe greatest possible value that can be represented is 340282366920938463463.374607431768211455 (which is (2^128 - 1) / 10^18)", + "type": "string" + }, + "owner": { + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "OwnerResponse", + "description": "Returned from Owner.query()", + "type": "object", + "required": [ + "abolished", + "initialized" + ], + "properties": { + "abolished": { + "type": "boolean" + }, + "emergency_owner": { + "type": [ + "string", + "null" + ] + }, + "initialized": { + "type": "boolean" + }, + "owner": { + "type": [ + "string", + "null" + ] + }, + "proposed": { + "type": [ + "string", + "null" + ] + } + }, + "additionalProperties": false + }, + "vault_config": { + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "VaultConfig", + "type": "object", + "required": [ + "deposit_cap", + "liquidation_threshold", + "max_loan_to_value", + "whitelisted" + ], + "properties": { + "deposit_cap": { + "$ref": "#/definitions/Coin" + }, + "liquidation_threshold": { + "$ref": "#/definitions/Decimal" + }, + "max_loan_to_value": { + "$ref": "#/definitions/Decimal" + }, + "whitelisted": { + "type": "boolean" + } + }, + "additionalProperties": false, + "definitions": { + "Coin": { + "type": "object", + "required": [ + "amount", + "denom" + ], + "properties": { + "amount": { + "$ref": "#/definitions/Uint128" + }, + "denom": { + "type": "string" + } + } + }, + "Decimal": { + "description": "A fixed-point decimal value with 18 fractional digits, i.e. Decimal(1_000_000_000_000_000_000) == 1.0\n\nThe greatest possible value that can be represented is 340282366920938463463.374607431768211455 (which is (2^128 - 1) / 10^18)", + "type": "string" + }, + "Uint128": { + "description": "A thin wrapper around u128 that is using strings for JSON encoding/decoding, such that the full u128 range can be used for clients that convert JSON numbers to floats, like JavaScript and jq.\n\n# Examples\n\nUse `from` to create instances of this and `u128` to get the value out:\n\n``` # use cosmwasm_std::Uint128; let a = Uint128::from(123u128); assert_eq!(a.u128(), 123);\n\nlet b = Uint128::from(42u64); assert_eq!(b.u128(), 42);\n\nlet c = Uint128::from(70u32); assert_eq!(c.u128(), 70); ```", + "type": "string" + } + } + } + } +} diff --git a/schemas/mars-swapper-osmosis/mars-swapper-osmosis.json b/schemas/mars-swapper-osmosis/mars-swapper-osmosis.json index 88892296a..4eab808e1 100644 --- a/schemas/mars-swapper-osmosis/mars-swapper-osmosis.json +++ b/schemas/mars-swapper-osmosis/mars-swapper-osmosis.json @@ -199,6 +199,35 @@ "enum": [ "abolish_owner_role" ] + }, + { + "description": "A separate entity managed by Owner that can be used for granting specific emergency powers.", + "type": "object", + "required": [ + "set_emergency_owner" + ], + "properties": { + "set_emergency_owner": { + "type": "object", + "required": [ + "emergency_owner" + ], + "properties": { + "emergency_owner": { + "type": "string" + } + }, + "additionalProperties": false + } + }, + "additionalProperties": false + }, + { + "description": "Remove the entity in the Emergency Owner role", + "type": "string", + "enum": [ + "clear_emergency_owner" + ] } ] }, @@ -395,6 +424,12 @@ "abolished": { "type": "boolean" }, + "emergency_owner": { + "type": [ + "string", + "null" + ] + }, "initialized": { "type": "boolean" }, diff --git a/scripts/package.json b/scripts/package.json index c20fcf870..d42c92cf3 100644 --- a/scripts/package.json +++ b/scripts/package.json @@ -13,22 +13,22 @@ "format-check": "prettier --ignore-path .gitignore --check ." }, "dependencies": { - "@cosmjs/cosmwasm-stargate": "^0.29.5", - "@cosmjs/proto-signing": "^0.29.5", - "@cosmjs/stargate": "^0.29.5", - "@cosmwasm/ts-codegen": "^0.24.0", + "@cosmjs/cosmwasm-stargate": "^0.30.1", + "@cosmjs/proto-signing": "^0.30.1", + "@cosmjs/stargate": "^0.30.1", + "@cosmwasm/ts-codegen": "^0.25.2", "chalk": "4.1.2", - "cosmjs-types": "^0.6.1", + "cosmjs-types": "^0.7.2", "prepend-file": "^2.0.1" }, "devDependencies": { - "@types/node": "^18.11.18", - "@typescript-eslint/eslint-plugin": "^5.49.0", - "@typescript-eslint/parser": "^5.49.0", + "@types/node": "^18.15.11", + "@typescript-eslint/eslint-plugin": "^5.57.1", + "@typescript-eslint/parser": "^5.57.1", "cosmjs-types": "^0.6.1", - "eslint": "^8.32.0", - "eslint-config-prettier": "^8.6.0", - "prettier": "^2.8.3", - "typescript": "^4.9.4" + "eslint": "^8.37.0", + "eslint-config-prettier": "^8.8.0", + "prettier": "^2.8.7", + "typescript": "^5.0.3" } } diff --git a/scripts/tsconfig.json b/scripts/tsconfig.json index 7b3570c4a..be7ea699b 100644 --- a/scripts/tsconfig.json +++ b/scripts/tsconfig.json @@ -23,7 +23,6 @@ "noImplicitReturns": true, "noImplicitThis": true, "strictNullChecks": true, - "suppressImplicitAnyIndexErrors": true, "allowSyntheticDefaultImports": true, "skipLibCheck": true }, diff --git a/scripts/types/generated/mars-params/MarsParams.client.ts b/scripts/types/generated/mars-params/MarsParams.client.ts new file mode 100644 index 000000000..0f91297fa --- /dev/null +++ b/scripts/types/generated/mars-params/MarsParams.client.ts @@ -0,0 +1,224 @@ +// @ts-nocheck +/** + * This file was automatically generated by @cosmwasm/ts-codegen@0.25.2. + * DO NOT MODIFY IT BY HAND. Instead, modify the source JSONSchema file, + * and run the @cosmwasm/ts-codegen generate command to regenerate this file. + */ + +import { CosmWasmClient, SigningCosmWasmClient, ExecuteResult } from '@cosmjs/cosmwasm-stargate' +import { StdFee } from '@cosmjs/amino' +import { + Decimal, + InstantiateMsg, + ExecuteMsg, + OwnerUpdate, + AssetParamsUpdate, + Uint128, + VaultConfigUpdate, + AssetParams, + InterestRateModel, + AssetPermissions, + RedBankPermissions, + RoverPermissions, + VaultConfig, + Coin, + QueryMsg, + ArrayOfAssetParamsResponse, + AssetParamsResponse, + ArrayOfVaultConfig, + OwnerResponse, +} from './MarsParams.types' +export interface MarsParamsReadOnlyInterface { + contractAddress: string + owner: () => Promise + assetParams: ({ denom }: { denom: string }) => Promise + allAssetParams: ({ + limit, + startAfter, + }: { + limit?: number + startAfter?: string + }) => Promise + vaultConfig: ({ address }: { address: string }) => Promise + allVaultConfigs: ({ + limit, + startAfter, + }: { + limit?: number + startAfter?: string + }) => Promise + maxCloseFactor: () => Promise +} +export class MarsParamsQueryClient implements MarsParamsReadOnlyInterface { + client: CosmWasmClient + contractAddress: string + + constructor(client: CosmWasmClient, contractAddress: string) { + this.client = client + this.contractAddress = contractAddress + this.owner = this.owner.bind(this) + this.assetParams = this.assetParams.bind(this) + this.allAssetParams = this.allAssetParams.bind(this) + this.vaultConfig = this.vaultConfig.bind(this) + this.allVaultConfigs = this.allVaultConfigs.bind(this) + this.maxCloseFactor = this.maxCloseFactor.bind(this) + } + + owner = async (): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + owner: {}, + }) + } + assetParams = async ({ denom }: { denom: string }): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + asset_params: { + denom, + }, + }) + } + allAssetParams = async ({ + limit, + startAfter, + }: { + limit?: number + startAfter?: string + }): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + all_asset_params: { + limit, + start_after: startAfter, + }, + }) + } + vaultConfig = async ({ address }: { address: string }): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + vault_config: { + address, + }, + }) + } + allVaultConfigs = async ({ + limit, + startAfter, + }: { + limit?: number + startAfter?: string + }): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + all_vault_configs: { + limit, + start_after: startAfter, + }, + }) + } + maxCloseFactor = async (): Promise => { + return this.client.queryContractSmart(this.contractAddress, { + max_close_factor: {}, + }) + } +} +export interface MarsParamsInterface extends MarsParamsReadOnlyInterface { + contractAddress: string + sender: string + updateOwner: ( + fee?: number | StdFee | 'auto', + memo?: string, + funds?: Coin[], + ) => Promise + updateMaxCloseFactor: ( + fee?: number | StdFee | 'auto', + memo?: string, + funds?: Coin[], + ) => Promise + updateAssetParams: ( + fee?: number | StdFee | 'auto', + memo?: string, + funds?: Coin[], + ) => Promise + updateVaultConfig: ( + fee?: number | StdFee | 'auto', + memo?: string, + funds?: Coin[], + ) => Promise +} +export class MarsParamsClient extends MarsParamsQueryClient implements MarsParamsInterface { + client: SigningCosmWasmClient + sender: string + contractAddress: string + + constructor(client: SigningCosmWasmClient, sender: string, contractAddress: string) { + super(client, contractAddress) + this.client = client + this.sender = sender + this.contractAddress = contractAddress + this.updateOwner = this.updateOwner.bind(this) + this.updateMaxCloseFactor = this.updateMaxCloseFactor.bind(this) + this.updateAssetParams = this.updateAssetParams.bind(this) + this.updateVaultConfig = this.updateVaultConfig.bind(this) + } + + updateOwner = async ( + fee: number | StdFee | 'auto' = 'auto', + memo?: string, + funds?: Coin[], + ): Promise => { + return await this.client.execute( + this.sender, + this.contractAddress, + { + update_owner: {}, + }, + fee, + memo, + funds, + ) + } + updateMaxCloseFactor = async ( + fee: number | StdFee | 'auto' = 'auto', + memo?: string, + funds?: Coin[], + ): Promise => { + return await this.client.execute( + this.sender, + this.contractAddress, + { + update_max_close_factor: {}, + }, + fee, + memo, + funds, + ) + } + updateAssetParams = async ( + fee: number | StdFee | 'auto' = 'auto', + memo?: string, + funds?: Coin[], + ): Promise => { + return await this.client.execute( + this.sender, + this.contractAddress, + { + update_asset_params: {}, + }, + fee, + memo, + funds, + ) + } + updateVaultConfig = async ( + fee: number | StdFee | 'auto' = 'auto', + memo?: string, + funds?: Coin[], + ): Promise => { + return await this.client.execute( + this.sender, + this.contractAddress, + { + update_vault_config: {}, + }, + fee, + memo, + funds, + ) + } +} diff --git a/scripts/types/generated/mars-params/MarsParams.react-query.ts b/scripts/types/generated/mars-params/MarsParams.react-query.ts new file mode 100644 index 000000000..ebcec4d6c --- /dev/null +++ b/scripts/types/generated/mars-params/MarsParams.react-query.ts @@ -0,0 +1,262 @@ +// @ts-nocheck +/** + * This file was automatically generated by @cosmwasm/ts-codegen@0.25.2. + * DO NOT MODIFY IT BY HAND. Instead, modify the source JSONSchema file, + * and run the @cosmwasm/ts-codegen generate command to regenerate this file. + */ + +import { UseQueryOptions, useQuery, useMutation, UseMutationOptions } from '@tanstack/react-query' +import { ExecuteResult } from '@cosmjs/cosmwasm-stargate' +import { StdFee } from '@cosmjs/amino' +import { + Decimal, + InstantiateMsg, + ExecuteMsg, + OwnerUpdate, + AssetParamsUpdate, + Uint128, + VaultConfigUpdate, + AssetParams, + InterestRateModel, + AssetPermissions, + RedBankPermissions, + RoverPermissions, + VaultConfig, + Coin, + QueryMsg, + ArrayOfAssetParamsResponse, + AssetParamsResponse, + ArrayOfVaultConfig, + OwnerResponse, +} from './MarsParams.types' +import { MarsParamsQueryClient, MarsParamsClient } from './MarsParams.client' +export const marsParamsQueryKeys = { + contract: [ + { + contract: 'marsParams', + }, + ] as const, + address: (contractAddress: string | undefined) => + [{ ...marsParamsQueryKeys.contract[0], address: contractAddress }] as const, + owner: (contractAddress: string | undefined, args?: Record) => + [{ ...marsParamsQueryKeys.address(contractAddress)[0], method: 'owner', args }] as const, + assetParams: (contractAddress: string | undefined, args?: Record) => + [{ ...marsParamsQueryKeys.address(contractAddress)[0], method: 'asset_params', args }] as const, + allAssetParams: (contractAddress: string | undefined, args?: Record) => + [ + { ...marsParamsQueryKeys.address(contractAddress)[0], method: 'all_asset_params', args }, + ] as const, + vaultConfig: (contractAddress: string | undefined, args?: Record) => + [{ ...marsParamsQueryKeys.address(contractAddress)[0], method: 'vault_config', args }] as const, + allVaultConfigs: (contractAddress: string | undefined, args?: Record) => + [ + { ...marsParamsQueryKeys.address(contractAddress)[0], method: 'all_vault_configs', args }, + ] as const, + maxCloseFactor: (contractAddress: string | undefined, args?: Record) => + [ + { ...marsParamsQueryKeys.address(contractAddress)[0], method: 'max_close_factor', args }, + ] as const, +} +export interface MarsParamsReactQuery { + client: MarsParamsQueryClient | undefined + options?: Omit< + UseQueryOptions, + "'queryKey' | 'queryFn' | 'initialData'" + > & { + initialData?: undefined + } +} +export interface MarsParamsMaxCloseFactorQuery + extends MarsParamsReactQuery {} +export function useMarsParamsMaxCloseFactorQuery({ + client, + options, +}: MarsParamsMaxCloseFactorQuery) { + return useQuery( + marsParamsQueryKeys.maxCloseFactor(client?.contractAddress), + () => (client ? client.maxCloseFactor() : Promise.reject(new Error('Invalid client'))), + { ...options, enabled: !!client && (options?.enabled != undefined ? options.enabled : true) }, + ) +} +export interface MarsParamsAllVaultConfigsQuery + extends MarsParamsReactQuery { + args: { + limit?: number + startAfter?: string + } +} +export function useMarsParamsAllVaultConfigsQuery({ + client, + args, + options, +}: MarsParamsAllVaultConfigsQuery) { + return useQuery( + marsParamsQueryKeys.allVaultConfigs(client?.contractAddress, args), + () => + client + ? client.allVaultConfigs({ + limit: args.limit, + startAfter: args.startAfter, + }) + : Promise.reject(new Error('Invalid client')), + { ...options, enabled: !!client && (options?.enabled != undefined ? options.enabled : true) }, + ) +} +export interface MarsParamsVaultConfigQuery + extends MarsParamsReactQuery { + args: { + address: string + } +} +export function useMarsParamsVaultConfigQuery({ + client, + args, + options, +}: MarsParamsVaultConfigQuery) { + return useQuery( + marsParamsQueryKeys.vaultConfig(client?.contractAddress, args), + () => + client + ? client.vaultConfig({ + address: args.address, + }) + : Promise.reject(new Error('Invalid client')), + { ...options, enabled: !!client && (options?.enabled != undefined ? options.enabled : true) }, + ) +} +export interface MarsParamsAllAssetParamsQuery + extends MarsParamsReactQuery { + args: { + limit?: number + startAfter?: string + } +} +export function useMarsParamsAllAssetParamsQuery({ + client, + args, + options, +}: MarsParamsAllAssetParamsQuery) { + return useQuery( + marsParamsQueryKeys.allAssetParams(client?.contractAddress, args), + () => + client + ? client.allAssetParams({ + limit: args.limit, + startAfter: args.startAfter, + }) + : Promise.reject(new Error('Invalid client')), + { ...options, enabled: !!client && (options?.enabled != undefined ? options.enabled : true) }, + ) +} +export interface MarsParamsAssetParamsQuery + extends MarsParamsReactQuery { + args: { + denom: string + } +} +export function useMarsParamsAssetParamsQuery({ + client, + args, + options, +}: MarsParamsAssetParamsQuery) { + return useQuery( + marsParamsQueryKeys.assetParams(client?.contractAddress, args), + () => + client + ? client.assetParams({ + denom: args.denom, + }) + : Promise.reject(new Error('Invalid client')), + { ...options, enabled: !!client && (options?.enabled != undefined ? options.enabled : true) }, + ) +} +export interface MarsParamsOwnerQuery extends MarsParamsReactQuery {} +export function useMarsParamsOwnerQuery({ + client, + options, +}: MarsParamsOwnerQuery) { + return useQuery( + marsParamsQueryKeys.owner(client?.contractAddress), + () => (client ? client.owner() : Promise.reject(new Error('Invalid client'))), + { ...options, enabled: !!client && (options?.enabled != undefined ? options.enabled : true) }, + ) +} +export interface MarsParamsUpdateVaultConfigMutation { + client: MarsParamsClient + args?: { + fee?: number | StdFee | 'auto' + memo?: string + funds?: Coin[] + } +} +export function useMarsParamsUpdateVaultConfigMutation( + options?: Omit< + UseMutationOptions, + 'mutationFn' + >, +) { + return useMutation( + ({ client, msg, args: { fee, memo, funds } = {} }) => + client.updateVaultConfig(msg, fee, memo, funds), + options, + ) +} +export interface MarsParamsUpdateAssetParamsMutation { + client: MarsParamsClient + args?: { + fee?: number | StdFee | 'auto' + memo?: string + funds?: Coin[] + } +} +export function useMarsParamsUpdateAssetParamsMutation( + options?: Omit< + UseMutationOptions, + 'mutationFn' + >, +) { + return useMutation( + ({ client, msg, args: { fee, memo, funds } = {} }) => + client.updateAssetParams(msg, fee, memo, funds), + options, + ) +} +export interface MarsParamsUpdateMaxCloseFactorMutation { + client: MarsParamsClient + args?: { + fee?: number | StdFee | 'auto' + memo?: string + funds?: Coin[] + } +} +export function useMarsParamsUpdateMaxCloseFactorMutation( + options?: Omit< + UseMutationOptions, + 'mutationFn' + >, +) { + return useMutation( + ({ client, msg, args: { fee, memo, funds } = {} }) => + client.updateMaxCloseFactor(msg, fee, memo, funds), + options, + ) +} +export interface MarsParamsUpdateOwnerMutation { + client: MarsParamsClient + args?: { + fee?: number | StdFee | 'auto' + memo?: string + funds?: Coin[] + } +} +export function useMarsParamsUpdateOwnerMutation( + options?: Omit< + UseMutationOptions, + 'mutationFn' + >, +) { + return useMutation( + ({ client, msg, args: { fee, memo, funds } = {} }) => client.updateOwner(msg, fee, memo, funds), + options, + ) +} diff --git a/scripts/types/generated/mars-params/MarsParams.types.ts b/scripts/types/generated/mars-params/MarsParams.types.ts new file mode 100644 index 000000000..f8c154c63 --- /dev/null +++ b/scripts/types/generated/mars-params/MarsParams.types.ts @@ -0,0 +1,144 @@ +// @ts-nocheck +/** + * This file was automatically generated by @cosmwasm/ts-codegen@0.25.2. + * DO NOT MODIFY IT BY HAND. Instead, modify the source JSONSchema file, + * and run the @cosmwasm/ts-codegen generate command to regenerate this file. + */ + +export type Decimal = string +export interface InstantiateMsg { + max_close_factor: Decimal + owner: string +} +export type ExecuteMsg = + | { + update_owner: OwnerUpdate + } + | { + update_max_close_factor: Decimal + } + | { + update_asset_params: AssetParamsUpdate + } + | { + update_vault_config: VaultConfigUpdate + } +export type OwnerUpdate = + | { + propose_new_owner: { + proposed: string + } + } + | 'clear_proposed' + | 'accept_proposed' + | 'abolish_owner_role' + | { + set_emergency_owner: { + emergency_owner: string + } + } + | 'clear_emergency_owner' +export type AssetParamsUpdate = + | { + add_or_update: { + denom: string + params: AssetParams + } + } + | { + remove: { + denom: string + } + } +export type Uint128 = string +export type VaultConfigUpdate = + | { + add_or_update: { + addr: string + config: VaultConfig + } + } + | { + remove: { + addr: string + } + } +export interface AssetParams { + interest_rate_model: InterestRateModel + liquidation_bonus: Decimal + liquidation_threshold: Decimal + max_loan_to_value: Decimal + permissions: AssetPermissions + red_bank_deposit_cap: Uint128 + reserve_factor: Decimal +} +export interface InterestRateModel { + base: Decimal + optimal_utilization_rate: Decimal + slope_1: Decimal + slope_2: Decimal +} +export interface AssetPermissions { + red_bank: RedBankPermissions + rover: RoverPermissions +} +export interface RedBankPermissions { + borrow_enabled: boolean + deposit_enabled: boolean +} +export interface RoverPermissions { + whitelisted: boolean +} +export interface VaultConfig { + deposit_cap: Coin + liquidation_threshold: Decimal + max_loan_to_value: Decimal + whitelisted: boolean +} +export interface Coin { + amount: Uint128 + denom: string + [k: string]: unknown +} +export type QueryMsg = + | { + owner: {} + } + | { + asset_params: { + denom: string + } + } + | { + all_asset_params: { + limit?: number | null + start_after?: string | null + } + } + | { + vault_config: { + address: string + } + } + | { + all_vault_configs: { + limit?: number | null + start_after?: string | null + } + } + | { + max_close_factor: {} + } +export type ArrayOfAssetParamsResponse = AssetParamsResponse[] +export interface AssetParamsResponse { + denom: string + params: AssetParams +} +export type ArrayOfVaultConfig = VaultConfig[] +export interface OwnerResponse { + abolished: boolean + emergency_owner?: string | null + initialized: boolean + owner?: string | null + proposed?: string | null +} diff --git a/scripts/types/generated/mars-params/bundle.ts b/scripts/types/generated/mars-params/bundle.ts new file mode 100644 index 000000000..2fbbee643 --- /dev/null +++ b/scripts/types/generated/mars-params/bundle.ts @@ -0,0 +1,13 @@ +// @ts-nocheck +/** + * This file was automatically generated by @cosmwasm/ts-codegen@0.25.2. + * DO NOT MODIFY IT BY HAND. Instead, modify the source JSONSchema file, + * and run the @cosmwasm/ts-codegen generate command to regenerate this file. + */ + +import * as _0 from './MarsParams.types' +import * as _1 from './MarsParams.client' +import * as _2 from './MarsParams.react-query' +export namespace contracts { + export const MarsParams = { ..._0, ..._1, ..._2 } +} diff --git a/scripts/types/generated/mars-swapper-osmosis/MarsSwapperOsmosis.client.ts b/scripts/types/generated/mars-swapper-osmosis/MarsSwapperOsmosis.client.ts index df141b095..6cc765a75 100644 --- a/scripts/types/generated/mars-swapper-osmosis/MarsSwapperOsmosis.client.ts +++ b/scripts/types/generated/mars-swapper-osmosis/MarsSwapperOsmosis.client.ts @@ -1,6 +1,6 @@ // @ts-nocheck /** - * This file was automatically generated by @cosmwasm/ts-codegen@0.24.0. + * This file was automatically generated by @cosmwasm/ts-codegen@0.25.2. * DO NOT MODIFY IT BY HAND. Instead, modify the source JSONSchema file, * and run the @cosmwasm/ts-codegen generate command to regenerate this file. */ diff --git a/scripts/types/generated/mars-swapper-osmosis/MarsSwapperOsmosis.react-query.ts b/scripts/types/generated/mars-swapper-osmosis/MarsSwapperOsmosis.react-query.ts index 7ddaa0e81..51f078536 100644 --- a/scripts/types/generated/mars-swapper-osmosis/MarsSwapperOsmosis.react-query.ts +++ b/scripts/types/generated/mars-swapper-osmosis/MarsSwapperOsmosis.react-query.ts @@ -1,6 +1,6 @@ // @ts-nocheck /** - * This file was automatically generated by @cosmwasm/ts-codegen@0.24.0. + * This file was automatically generated by @cosmwasm/ts-codegen@0.25.2. * DO NOT MODIFY IT BY HAND. Instead, modify the source JSONSchema file, * and run the @cosmwasm/ts-codegen generate command to regenerate this file. */ diff --git a/scripts/types/generated/mars-swapper-osmosis/MarsSwapperOsmosis.types.ts b/scripts/types/generated/mars-swapper-osmosis/MarsSwapperOsmosis.types.ts index 95070c230..44811b368 100644 --- a/scripts/types/generated/mars-swapper-osmosis/MarsSwapperOsmosis.types.ts +++ b/scripts/types/generated/mars-swapper-osmosis/MarsSwapperOsmosis.types.ts @@ -1,6 +1,6 @@ // @ts-nocheck /** - * This file was automatically generated by @cosmwasm/ts-codegen@0.24.0. + * This file was automatically generated by @cosmwasm/ts-codegen@0.25.2. * DO NOT MODIFY IT BY HAND. Instead, modify the source JSONSchema file, * and run the @cosmwasm/ts-codegen generate command to regenerate this file. */ @@ -42,6 +42,12 @@ export type OwnerUpdate = | 'clear_proposed' | 'accept_proposed' | 'abolish_owner_role' + | { + set_emergency_owner: { + emergency_owner: string + } + } + | 'clear_emergency_owner' export type OsmosisRoute = SwapAmountInRoute[] export type Uint128 = string export type Decimal = string @@ -83,6 +89,7 @@ export interface EstimateExactInSwapResponse { } export interface OwnerResponse { abolished: boolean + emergency_owner?: string | null initialized: boolean owner?: string | null proposed?: string | null diff --git a/scripts/types/generated/mars-swapper-osmosis/bundle.ts b/scripts/types/generated/mars-swapper-osmosis/bundle.ts index 717bb2225..61b4c5a82 100644 --- a/scripts/types/generated/mars-swapper-osmosis/bundle.ts +++ b/scripts/types/generated/mars-swapper-osmosis/bundle.ts @@ -1,13 +1,13 @@ // @ts-nocheck /** - * This file was automatically generated by @cosmwasm/ts-codegen@0.24.0. + * This file was automatically generated by @cosmwasm/ts-codegen@0.25.2. * DO NOT MODIFY IT BY HAND. Instead, modify the source JSONSchema file, * and run the @cosmwasm/ts-codegen generate command to regenerate this file. */ -import * as _0 from './MarsSwapperOsmosis.types' -import * as _1 from './MarsSwapperOsmosis.client' -import * as _2 from './MarsSwapperOsmosis.react-query' +import * as _3 from './MarsSwapperOsmosis.types' +import * as _4 from './MarsSwapperOsmosis.client' +import * as _5 from './MarsSwapperOsmosis.react-query' export namespace contracts { - export const MarsSwapperOsmosis = { ..._0, ..._1, ..._2 } + export const MarsSwapperOsmosis = { ..._3, ..._4, ..._5 } } diff --git a/scripts/yarn.lock b/scripts/yarn.lock index 2deefce00..646748133 100644 --- a/scripts/yarn.lock +++ b/scripts/yarn.lock @@ -1035,143 +1035,143 @@ "@noble/hashes" "^1.0.0" protobufjs "^6.8.8" -"@cosmjs/amino@^0.29.5": - version "0.29.5" - resolved "https://registry.yarnpkg.com/@cosmjs/amino/-/amino-0.29.5.tgz#053b4739a90b15b9e2b781ccd484faf64bd49aec" - integrity sha512-Qo8jpC0BiziTSUqpkNatBcwtKNhCovUnFul9SlT/74JUCdLYaeG5hxr3q1cssQt++l4LvlcpF+OUXL48XjNjLw== - dependencies: - "@cosmjs/crypto" "^0.29.5" - "@cosmjs/encoding" "^0.29.5" - "@cosmjs/math" "^0.29.5" - "@cosmjs/utils" "^0.29.5" - -"@cosmjs/cosmwasm-stargate@^0.29.5": - version "0.29.5" - resolved "https://registry.yarnpkg.com/@cosmjs/cosmwasm-stargate/-/cosmwasm-stargate-0.29.5.tgz#3f257da682658833e0f4eb9e8ff758e4d927663a" - integrity sha512-TNdSvm2tEE3XMCuxHxquzls56t40hC8qnLeYJWHsY2ECZmRK3KrnpRReEr7N7bLtODToK7X/riYrV0JaYxjrYA== - dependencies: - "@cosmjs/amino" "^0.29.5" - "@cosmjs/crypto" "^0.29.5" - "@cosmjs/encoding" "^0.29.5" - "@cosmjs/math" "^0.29.5" - "@cosmjs/proto-signing" "^0.29.5" - "@cosmjs/stargate" "^0.29.5" - "@cosmjs/tendermint-rpc" "^0.29.5" - "@cosmjs/utils" "^0.29.5" - cosmjs-types "^0.5.2" +"@cosmjs/amino@^0.30.1": + version "0.30.1" + resolved "https://registry.yarnpkg.com/@cosmjs/amino/-/amino-0.30.1.tgz#7c18c14627361ba6c88e3495700ceea1f76baace" + integrity sha512-yNHnzmvAlkETDYIpeCTdVqgvrdt1qgkOXwuRVi8s27UKI5hfqyE9fJ/fuunXE6ZZPnKkjIecDznmuUOMrMvw4w== + dependencies: + "@cosmjs/crypto" "^0.30.1" + "@cosmjs/encoding" "^0.30.1" + "@cosmjs/math" "^0.30.1" + "@cosmjs/utils" "^0.30.1" + +"@cosmjs/cosmwasm-stargate@^0.30.1": + version "0.30.1" + resolved "https://registry.yarnpkg.com/@cosmjs/cosmwasm-stargate/-/cosmwasm-stargate-0.30.1.tgz#6f9ca310f75433a3e30d683bc6aa24eadb345d79" + integrity sha512-W/6SLUCJAJGBN+sJLXouLZikVgmqDd9LCdlMzQaxczcCHTWeJAmRvOiZGSZaSy3shw/JN1qc6g6PKpvTVgj10A== + dependencies: + "@cosmjs/amino" "^0.30.1" + "@cosmjs/crypto" "^0.30.1" + "@cosmjs/encoding" "^0.30.1" + "@cosmjs/math" "^0.30.1" + "@cosmjs/proto-signing" "^0.30.1" + "@cosmjs/stargate" "^0.30.1" + "@cosmjs/tendermint-rpc" "^0.30.1" + "@cosmjs/utils" "^0.30.1" + cosmjs-types "^0.7.1" long "^4.0.0" pako "^2.0.2" -"@cosmjs/crypto@^0.29.5": - version "0.29.5" - resolved "https://registry.yarnpkg.com/@cosmjs/crypto/-/crypto-0.29.5.tgz#ab99fc382b93d8a8db075780cf07487a0f9519fd" - integrity sha512-2bKkaLGictaNL0UipQCL6C1afaisv6k8Wr/GCLx9FqiyFkh9ZgRHDyetD64ZsjnWV/N/D44s/esI+k6oPREaiQ== +"@cosmjs/crypto@^0.30.1": + version "0.30.1" + resolved "https://registry.yarnpkg.com/@cosmjs/crypto/-/crypto-0.30.1.tgz#21e94d5ca8f8ded16eee1389d2639cb5c43c3eb5" + integrity sha512-rAljUlake3MSXs9xAm87mu34GfBLN0h/1uPPV6jEwClWjNkAMotzjC0ab9MARy5FFAvYHL3lWb57bhkbt2GtzQ== dependencies: - "@cosmjs/encoding" "^0.29.5" - "@cosmjs/math" "^0.29.5" - "@cosmjs/utils" "^0.29.5" + "@cosmjs/encoding" "^0.30.1" + "@cosmjs/math" "^0.30.1" + "@cosmjs/utils" "^0.30.1" "@noble/hashes" "^1" bn.js "^5.2.0" elliptic "^6.5.4" libsodium-wrappers "^0.7.6" -"@cosmjs/encoding@^0.29.5": - version "0.29.5" - resolved "https://registry.yarnpkg.com/@cosmjs/encoding/-/encoding-0.29.5.tgz#009a4b1c596cdfd326f30ccfa79f5e56daa264f2" - integrity sha512-G4rGl/Jg4dMCw5u6PEZHZcoHnUBlukZODHbm/wcL4Uu91fkn5jVo5cXXZcvs4VCkArVGrEj/52eUgTZCmOBGWQ== +"@cosmjs/encoding@^0.30.1": + version "0.30.1" + resolved "https://registry.yarnpkg.com/@cosmjs/encoding/-/encoding-0.30.1.tgz#b5c4e0ef7ceb1f2753688eb96400ed70f35c6058" + integrity sha512-rXmrTbgqwihORwJ3xYhIgQFfMSrwLu1s43RIK9I8EBudPx3KmnmyAKzMOVsRDo9edLFNuZ9GIvysUCwQfq3WlQ== dependencies: base64-js "^1.3.0" bech32 "^1.1.4" readonly-date "^1.0.0" -"@cosmjs/json-rpc@^0.29.5": - version "0.29.5" - resolved "https://registry.yarnpkg.com/@cosmjs/json-rpc/-/json-rpc-0.29.5.tgz#5e483a9bd98a6270f935adf0dfd8a1e7eb777fe4" - integrity sha512-C78+X06l+r9xwdM1yFWIpGl03LhB9NdM1xvZpQHwgCOl0Ir/WV8pw48y3Ez2awAoUBRfTeejPe4KvrE6NoIi/w== +"@cosmjs/json-rpc@^0.30.1": + version "0.30.1" + resolved "https://registry.yarnpkg.com/@cosmjs/json-rpc/-/json-rpc-0.30.1.tgz#16f21305fc167598c8a23a45549b85106b2372bc" + integrity sha512-pitfC/2YN9t+kXZCbNuyrZ6M8abnCC2n62m+JtU9vQUfaEtVsgy+1Fk4TRQ175+pIWSdBMFi2wT8FWVEE4RhxQ== dependencies: - "@cosmjs/stream" "^0.29.5" + "@cosmjs/stream" "^0.30.1" xstream "^11.14.0" -"@cosmjs/math@^0.29.5": - version "0.29.5" - resolved "https://registry.yarnpkg.com/@cosmjs/math/-/math-0.29.5.tgz#722c96e080d6c2b62215ce9f4c70da7625b241b6" - integrity sha512-2GjKcv+A9f86MAWYLUkjhw1/WpRl2R1BTb3m9qPG7lzMA7ioYff9jY5SPCfafKdxM4TIQGxXQlYGewQL16O68Q== +"@cosmjs/math@^0.30.1": + version "0.30.1" + resolved "https://registry.yarnpkg.com/@cosmjs/math/-/math-0.30.1.tgz#8b816ef4de5d3afa66cb9fdfb5df2357a7845b8a" + integrity sha512-yaoeI23pin9ZiPHIisa6qqLngfnBR/25tSaWpkTm8Cy10MX70UF5oN4+/t1heLaM6SSmRrhk3psRkV4+7mH51Q== dependencies: bn.js "^5.2.0" -"@cosmjs/proto-signing@^0.29.5": - version "0.29.5" - resolved "https://registry.yarnpkg.com/@cosmjs/proto-signing/-/proto-signing-0.29.5.tgz#af3b62a46c2c2f1d2327d678b13b7262db1fe87c" - integrity sha512-QRrS7CiKaoETdgIqvi/7JC2qCwCR7lnWaUsTzh/XfRy3McLkEd+cXbKAW3cygykv7IN0VAEIhZd2lyIfT8KwNA== - dependencies: - "@cosmjs/amino" "^0.29.5" - "@cosmjs/crypto" "^0.29.5" - "@cosmjs/encoding" "^0.29.5" - "@cosmjs/math" "^0.29.5" - "@cosmjs/utils" "^0.29.5" - cosmjs-types "^0.5.2" +"@cosmjs/proto-signing@^0.30.1": + version "0.30.1" + resolved "https://registry.yarnpkg.com/@cosmjs/proto-signing/-/proto-signing-0.30.1.tgz#f0dda372488df9cd2677150b89b3e9c72b3cb713" + integrity sha512-tXh8pPYXV4aiJVhTKHGyeZekjj+K9s2KKojMB93Gcob2DxUjfKapFYBMJSgfKPuWUPEmyr8Q9km2hplI38ILgQ== + dependencies: + "@cosmjs/amino" "^0.30.1" + "@cosmjs/crypto" "^0.30.1" + "@cosmjs/encoding" "^0.30.1" + "@cosmjs/math" "^0.30.1" + "@cosmjs/utils" "^0.30.1" + cosmjs-types "^0.7.1" long "^4.0.0" -"@cosmjs/socket@^0.29.5": - version "0.29.5" - resolved "https://registry.yarnpkg.com/@cosmjs/socket/-/socket-0.29.5.tgz#a48df6b4c45dc6a6ef8e47232725dd4aa556ac2d" - integrity sha512-5VYDupIWbIXq3ftPV1LkS5Ya/T7Ol/AzWVhNxZ79hPe/mBfv1bGau/LqIYOm2zxGlgm9hBHOTmWGqNYDwr9LNQ== +"@cosmjs/socket@^0.30.1": + version "0.30.1" + resolved "https://registry.yarnpkg.com/@cosmjs/socket/-/socket-0.30.1.tgz#00b22f4b5e2ab01f4d82ccdb7b2e59536bfe5ce0" + integrity sha512-r6MpDL+9N+qOS/D5VaxnPaMJ3flwQ36G+vPvYJsXArj93BjgyFB7BwWwXCQDzZ+23cfChPUfhbINOenr8N2Kow== dependencies: - "@cosmjs/stream" "^0.29.5" + "@cosmjs/stream" "^0.30.1" isomorphic-ws "^4.0.1" ws "^7" xstream "^11.14.0" -"@cosmjs/stargate@^0.29.5": - version "0.29.5" - resolved "https://registry.yarnpkg.com/@cosmjs/stargate/-/stargate-0.29.5.tgz#d597af1c85a3c2af7b5bdbec34d5d40692cc09e4" - integrity sha512-hjEv8UUlJruLrYGJcUZXM/CziaINOKwfVm2BoSdUnNTMxGvY/jC1ABHKeZUYt9oXHxEJ1n9+pDqzbKc8pT0nBw== +"@cosmjs/stargate@^0.30.1": + version "0.30.1" + resolved "https://registry.yarnpkg.com/@cosmjs/stargate/-/stargate-0.30.1.tgz#e1b22e1226cffc6e93914a410755f1f61057ba04" + integrity sha512-RdbYKZCGOH8gWebO7r6WvNnQMxHrNXInY/gPHPzMjbQF6UatA6fNM2G2tdgS5j5u7FTqlCI10stNXrknaNdzog== dependencies: "@confio/ics23" "^0.6.8" - "@cosmjs/amino" "^0.29.5" - "@cosmjs/encoding" "^0.29.5" - "@cosmjs/math" "^0.29.5" - "@cosmjs/proto-signing" "^0.29.5" - "@cosmjs/stream" "^0.29.5" - "@cosmjs/tendermint-rpc" "^0.29.5" - "@cosmjs/utils" "^0.29.5" - cosmjs-types "^0.5.2" + "@cosmjs/amino" "^0.30.1" + "@cosmjs/encoding" "^0.30.1" + "@cosmjs/math" "^0.30.1" + "@cosmjs/proto-signing" "^0.30.1" + "@cosmjs/stream" "^0.30.1" + "@cosmjs/tendermint-rpc" "^0.30.1" + "@cosmjs/utils" "^0.30.1" + cosmjs-types "^0.7.1" long "^4.0.0" protobufjs "~6.11.3" xstream "^11.14.0" -"@cosmjs/stream@^0.29.5": - version "0.29.5" - resolved "https://registry.yarnpkg.com/@cosmjs/stream/-/stream-0.29.5.tgz#350981cac496d04939b92ee793b9b19f44bc1d4e" - integrity sha512-TToTDWyH1p05GBtF0Y8jFw2C+4783ueDCmDyxOMM6EU82IqpmIbfwcdMOCAm0JhnyMh+ocdebbFvnX/sGKzRAA== +"@cosmjs/stream@^0.30.1": + version "0.30.1" + resolved "https://registry.yarnpkg.com/@cosmjs/stream/-/stream-0.30.1.tgz#ba038a2aaf41343696b1e6e759d8e03a9516ec1a" + integrity sha512-Fg0pWz1zXQdoxQZpdHRMGvUH5RqS6tPv+j9Eh7Q953UjMlrwZVo0YFLC8OTf/HKVf10E4i0u6aM8D69Q6cNkgQ== dependencies: xstream "^11.14.0" -"@cosmjs/tendermint-rpc@^0.29.5": - version "0.29.5" - resolved "https://registry.yarnpkg.com/@cosmjs/tendermint-rpc/-/tendermint-rpc-0.29.5.tgz#f205c10464212bdf843f91bb2e4a093b618cb5c2" - integrity sha512-ar80twieuAxsy0x2za/aO3kBr2DFPAXDmk2ikDbmkda+qqfXgl35l9CVAAjKRqd9d+cRvbQyb5M4wy6XQpEV6w== - dependencies: - "@cosmjs/crypto" "^0.29.5" - "@cosmjs/encoding" "^0.29.5" - "@cosmjs/json-rpc" "^0.29.5" - "@cosmjs/math" "^0.29.5" - "@cosmjs/socket" "^0.29.5" - "@cosmjs/stream" "^0.29.5" - "@cosmjs/utils" "^0.29.5" +"@cosmjs/tendermint-rpc@^0.30.1": + version "0.30.1" + resolved "https://registry.yarnpkg.com/@cosmjs/tendermint-rpc/-/tendermint-rpc-0.30.1.tgz#c16378892ba1ac63f72803fdf7567eab9d4f0aa0" + integrity sha512-Z3nCwhXSbPZJ++v85zHObeUggrEHVfm1u18ZRwXxFE9ZMl5mXTybnwYhczuYOl7KRskgwlB+rID0WYACxj4wdQ== + dependencies: + "@cosmjs/crypto" "^0.30.1" + "@cosmjs/encoding" "^0.30.1" + "@cosmjs/json-rpc" "^0.30.1" + "@cosmjs/math" "^0.30.1" + "@cosmjs/socket" "^0.30.1" + "@cosmjs/stream" "^0.30.1" + "@cosmjs/utils" "^0.30.1" axios "^0.21.2" readonly-date "^1.0.0" xstream "^11.14.0" -"@cosmjs/utils@^0.29.5": - version "0.29.5" - resolved "https://registry.yarnpkg.com/@cosmjs/utils/-/utils-0.29.5.tgz#3fed1b3528ae8c5f1eb5d29b68755bebfd3294ee" - integrity sha512-m7h+RXDUxOzEOGt4P+3OVPX7PuakZT3GBmaM/Y2u+abN3xZkziykD/NvedYFvvCCdQo714XcGl33bwifS9FZPQ== +"@cosmjs/utils@^0.30.1": + version "0.30.1" + resolved "https://registry.yarnpkg.com/@cosmjs/utils/-/utils-0.30.1.tgz#6d92582341be3c2ec8d82090253cfa4b7f959edb" + integrity sha512-KvvX58MGMWh7xA+N+deCfunkA/ZNDvFLw4YbOmX3f/XBIkqrVY7qlotfy2aNb1kgp6h4B6Yc8YawJPDTfvWX7g== -"@cosmwasm/ts-codegen@^0.24.0": - version "0.24.0" - resolved "https://registry.yarnpkg.com/@cosmwasm/ts-codegen/-/ts-codegen-0.24.0.tgz#61015220a9dccfd35dec46bcb67786441111f096" - integrity sha512-g5ufDroLzOzsMvnKyAz7i5M3Z3k8XYetRv9PnGW0Zbgj4sziw6jDimPJ3Ubnput+i380day7LnCwVT7zLIEzCQ== +"@cosmwasm/ts-codegen@^0.25.2": + version "0.25.2" + resolved "https://registry.yarnpkg.com/@cosmwasm/ts-codegen/-/ts-codegen-0.25.2.tgz#68bbddbafbbc4488446cf2c2986318e18ec65446" + integrity sha512-XCrEXOgFjJvkvSWg6fXh2Ika9unHCJWH2ffbeKeGnzr6x6UX1iCH+8KDcgqMPdvpIOCBaxy9keFoaAqVFue9Ag== dependencies: "@babel/core" "7.18.10" "@babel/generator" "7.18.12" @@ -1199,16 +1199,28 @@ parse-package-name "1.0.0" rimraf "3.0.2" shelljs "0.8.5" - wasm-ast-types "^0.17.0" + wasm-ast-types "^0.18.2" -"@eslint/eslintrc@^1.4.1": - version "1.4.1" - resolved "https://registry.yarnpkg.com/@eslint/eslintrc/-/eslintrc-1.4.1.tgz#af58772019a2d271b7e2d4c23ff4ddcba3ccfb3e" - integrity sha512-XXrH9Uarn0stsyldqDYq8r++mROmWRI1xKMXa640Bb//SY1+ECYX6VzT6Lcx5frD0V30XieqJ0oX9I2Xj5aoMA== +"@eslint-community/eslint-utils@^4.2.0": + version "4.4.0" + resolved "https://registry.yarnpkg.com/@eslint-community/eslint-utils/-/eslint-utils-4.4.0.tgz#a23514e8fb9af1269d5f7788aa556798d61c6b59" + integrity sha512-1/sA4dwrzBAyeUoQ6oxahHKmrZvsnLCg4RfxW3ZFGGmQkSNQPFNLV9CUEFQP1x9EYXHTo5p6xdhZM1Ne9p/AfA== + dependencies: + eslint-visitor-keys "^3.3.0" + +"@eslint-community/regexpp@^4.4.0": + version "4.5.0" + resolved "https://registry.yarnpkg.com/@eslint-community/regexpp/-/regexpp-4.5.0.tgz#f6f729b02feee2c749f57e334b7a1b5f40a81724" + integrity sha512-vITaYzIcNmjn5tF5uxcZ/ft7/RXGrMUIS9HalWckEOF6ESiwXKoMzAQf2UW0aVd6rnOeExTJVd5hmWXucBKGXQ== + +"@eslint/eslintrc@^2.0.2": + version "2.0.2" + resolved "https://registry.yarnpkg.com/@eslint/eslintrc/-/eslintrc-2.0.2.tgz#01575e38707add677cf73ca1589abba8da899a02" + integrity sha512-3W4f5tDUra+pA+FzgugqL2pRimUTDJWKr7BINqOpkZrC0uYI0NIc0/JFgBROCU07HR6GieA5m3/rsPIhDmCXTQ== dependencies: ajv "^6.12.4" debug "^4.3.2" - espree "^9.4.0" + espree "^9.5.1" globals "^13.19.0" ignore "^5.2.0" import-fresh "^3.2.1" @@ -1216,6 +1228,11 @@ minimatch "^3.1.2" strip-json-comments "^3.1.1" +"@eslint/js@8.37.0": + version "8.37.0" + resolved "https://registry.yarnpkg.com/@eslint/js/-/js-8.37.0.tgz#cf1b5fa24217fe007f6487a26d765274925efa7d" + integrity sha512-x5vzdtOOGgFVDCUs81QRB2+liax8rFg3+7hqM+QhBG0/G3F1ZsoYl97UrqgHgQ9KKT7G6c4V+aTUCgu/n22v1A== + "@humanwhocodes/config-array@^0.11.8": version "0.11.8" resolved "https://registry.yarnpkg.com/@humanwhocodes/config-array/-/config-array-0.11.8.tgz#03595ac2075a4dc0f191cc2131de14fbd7d410b9" @@ -1503,11 +1520,16 @@ resolved "https://registry.yarnpkg.com/@types/minimatch/-/minimatch-5.1.2.tgz#07508b45797cb81ec3f273011b054cd0755eddca" integrity sha512-K0VQKziLUWkVKiRVrx4a40iPaxTUefQmjtkQofBkYRcoaaL/8rhwDWww9qWbrgicNOgnpIsMxyNIUM4+n6dUIA== -"@types/node@*", "@types/node@>=13.7.0", "@types/node@^18.11.18": +"@types/node@*", "@types/node@>=13.7.0": version "18.11.18" resolved "https://registry.yarnpkg.com/@types/node/-/node-18.11.18.tgz#8dfb97f0da23c2293e554c5a50d61ef134d7697f" integrity sha512-DHQpWGjyQKSHj3ebjFI/wRKcqQcdR+MoFBygntYOZytCqNfkd2ZC4ARDJ2DQqhjH5p85Nnd3jhUJIXrszFX/JA== +"@types/node@^18.15.11": + version "18.15.11" + resolved "https://registry.yarnpkg.com/@types/node/-/node-18.15.11.tgz#b3b790f09cb1696cffcec605de025b088fa4225f" + integrity sha512-E5Kwq2n4SbMzQOn6wnmBjuK9ouqlURrcZDVfbo9ftDDTFt3nk7ZKK4GMOzoYgnpQJKcxwQw+lGaBvvlMo0qN/Q== + "@types/prettier@^2.6.1": version "2.7.2" resolved "https://registry.yarnpkg.com/@types/prettier/-/prettier-2.7.2.tgz#6c2324641cc4ba050a8c710b2b251b377581fbf0" @@ -1530,87 +1552,88 @@ dependencies: "@types/yargs-parser" "*" -"@typescript-eslint/eslint-plugin@^5.49.0": - version "5.49.0" - resolved "https://registry.yarnpkg.com/@typescript-eslint/eslint-plugin/-/eslint-plugin-5.49.0.tgz#d0b4556f0792194bf0c2fb297897efa321492389" - integrity sha512-IhxabIpcf++TBaBa1h7jtOWyon80SXPRLDq0dVz5SLFC/eW6tofkw/O7Ar3lkx5z5U6wzbKDrl2larprp5kk5Q== +"@typescript-eslint/eslint-plugin@^5.57.1": + version "5.57.1" + resolved "https://registry.yarnpkg.com/@typescript-eslint/eslint-plugin/-/eslint-plugin-5.57.1.tgz#d1ab162a3cd2671b8a1c9ddf6e2db73b14439735" + integrity sha512-1MeobQkQ9tztuleT3v72XmY0XuKXVXusAhryoLuU5YZ+mXoYKZP9SQ7Flulh1NX4DTjpGTc2b/eMu4u7M7dhnQ== dependencies: - "@typescript-eslint/scope-manager" "5.49.0" - "@typescript-eslint/type-utils" "5.49.0" - "@typescript-eslint/utils" "5.49.0" + "@eslint-community/regexpp" "^4.4.0" + "@typescript-eslint/scope-manager" "5.57.1" + "@typescript-eslint/type-utils" "5.57.1" + "@typescript-eslint/utils" "5.57.1" debug "^4.3.4" + grapheme-splitter "^1.0.4" ignore "^5.2.0" natural-compare-lite "^1.4.0" - regexpp "^3.2.0" semver "^7.3.7" tsutils "^3.21.0" -"@typescript-eslint/parser@^5.49.0": - version "5.49.0" - resolved "https://registry.yarnpkg.com/@typescript-eslint/parser/-/parser-5.49.0.tgz#d699734b2f20e16351e117417d34a2bc9d7c4b90" - integrity sha512-veDlZN9mUhGqU31Qiv2qEp+XrJj5fgZpJ8PW30sHU+j/8/e5ruAhLaVDAeznS7A7i4ucb/s8IozpDtt9NqCkZg== +"@typescript-eslint/parser@^5.57.1": + version "5.57.1" + resolved "https://registry.yarnpkg.com/@typescript-eslint/parser/-/parser-5.57.1.tgz#af911234bd4401d09668c5faf708a0570a17a748" + integrity sha512-hlA0BLeVSA/wBPKdPGxoVr9Pp6GutGoY380FEhbVi0Ph4WNe8kLvqIRx76RSQt1lynZKfrXKs0/XeEk4zZycuA== dependencies: - "@typescript-eslint/scope-manager" "5.49.0" - "@typescript-eslint/types" "5.49.0" - "@typescript-eslint/typescript-estree" "5.49.0" + "@typescript-eslint/scope-manager" "5.57.1" + "@typescript-eslint/types" "5.57.1" + "@typescript-eslint/typescript-estree" "5.57.1" debug "^4.3.4" -"@typescript-eslint/scope-manager@5.49.0": - version "5.49.0" - resolved "https://registry.yarnpkg.com/@typescript-eslint/scope-manager/-/scope-manager-5.49.0.tgz#81b5d899cdae446c26ddf18bd47a2f5484a8af3e" - integrity sha512-clpROBOiMIzpbWNxCe1xDK14uPZh35u4QaZO1GddilEzoCLAEz4szb51rBpdgurs5k2YzPtJeTEN3qVbG+LRUQ== +"@typescript-eslint/scope-manager@5.57.1": + version "5.57.1" + resolved "https://registry.yarnpkg.com/@typescript-eslint/scope-manager/-/scope-manager-5.57.1.tgz#5d28799c0fc8b501a29ba1749d827800ef22d710" + integrity sha512-N/RrBwEUKMIYxSKl0oDK5sFVHd6VI7p9K5MyUlVYAY6dyNb/wHUqndkTd3XhpGlXgnQsBkRZuu4f9kAHghvgPw== dependencies: - "@typescript-eslint/types" "5.49.0" - "@typescript-eslint/visitor-keys" "5.49.0" + "@typescript-eslint/types" "5.57.1" + "@typescript-eslint/visitor-keys" "5.57.1" -"@typescript-eslint/type-utils@5.49.0": - version "5.49.0" - resolved "https://registry.yarnpkg.com/@typescript-eslint/type-utils/-/type-utils-5.49.0.tgz#8d5dcc8d422881e2ccf4ebdc6b1d4cc61aa64125" - integrity sha512-eUgLTYq0tR0FGU5g1YHm4rt5H/+V2IPVkP0cBmbhRyEmyGe4XvJ2YJ6sYTmONfjmdMqyMLad7SB8GvblbeESZA== +"@typescript-eslint/type-utils@5.57.1": + version "5.57.1" + resolved "https://registry.yarnpkg.com/@typescript-eslint/type-utils/-/type-utils-5.57.1.tgz#235daba621d3f882b8488040597b33777c74bbe9" + integrity sha512-/RIPQyx60Pt6ga86hKXesXkJ2WOS4UemFrmmq/7eOyiYjYv/MUSHPlkhU6k9T9W1ytnTJueqASW+wOmW4KrViw== dependencies: - "@typescript-eslint/typescript-estree" "5.49.0" - "@typescript-eslint/utils" "5.49.0" + "@typescript-eslint/typescript-estree" "5.57.1" + "@typescript-eslint/utils" "5.57.1" debug "^4.3.4" tsutils "^3.21.0" -"@typescript-eslint/types@5.49.0": - version "5.49.0" - resolved "https://registry.yarnpkg.com/@typescript-eslint/types/-/types-5.49.0.tgz#ad66766cb36ca1c89fcb6ac8b87ec2e6dac435c3" - integrity sha512-7If46kusG+sSnEpu0yOz2xFv5nRz158nzEXnJFCGVEHWnuzolXKwrH5Bsf9zsNlOQkyZuk0BZKKoJQI+1JPBBg== +"@typescript-eslint/types@5.57.1": + version "5.57.1" + resolved "https://registry.yarnpkg.com/@typescript-eslint/types/-/types-5.57.1.tgz#d9989c7a9025897ea6f0550b7036027f69e8a603" + integrity sha512-bSs4LOgyV3bJ08F5RDqO2KXqg3WAdwHCu06zOqcQ6vqbTJizyBhuh1o1ImC69X4bV2g1OJxbH71PJqiO7Y1RuA== -"@typescript-eslint/typescript-estree@5.49.0": - version "5.49.0" - resolved "https://registry.yarnpkg.com/@typescript-eslint/typescript-estree/-/typescript-estree-5.49.0.tgz#ebd6294c0ea97891fce6af536048181e23d729c8" - integrity sha512-PBdx+V7deZT/3GjNYPVQv1Nc0U46dAHbIuOG8AZ3on3vuEKiPDwFE/lG1snN2eUB9IhF7EyF7K1hmTcLztNIsA== +"@typescript-eslint/typescript-estree@5.57.1": + version "5.57.1" + resolved "https://registry.yarnpkg.com/@typescript-eslint/typescript-estree/-/typescript-estree-5.57.1.tgz#10d9643e503afc1ca4f5553d9bbe672ea4050b71" + integrity sha512-A2MZqD8gNT0qHKbk2wRspg7cHbCDCk2tcqt6ScCFLr5Ru8cn+TCfM786DjPhqwseiS+PrYwcXht5ztpEQ6TFTw== dependencies: - "@typescript-eslint/types" "5.49.0" - "@typescript-eslint/visitor-keys" "5.49.0" + "@typescript-eslint/types" "5.57.1" + "@typescript-eslint/visitor-keys" "5.57.1" debug "^4.3.4" globby "^11.1.0" is-glob "^4.0.3" semver "^7.3.7" tsutils "^3.21.0" -"@typescript-eslint/utils@5.49.0": - version "5.49.0" - resolved "https://registry.yarnpkg.com/@typescript-eslint/utils/-/utils-5.49.0.tgz#1c07923bc55ff7834dfcde487fff8d8624a87b32" - integrity sha512-cPJue/4Si25FViIb74sHCLtM4nTSBXtLx1d3/QT6mirQ/c65bV8arBEebBJJizfq8W2YyMoPI/WWPFWitmNqnQ== +"@typescript-eslint/utils@5.57.1": + version "5.57.1" + resolved "https://registry.yarnpkg.com/@typescript-eslint/utils/-/utils-5.57.1.tgz#0f97b0bbd88c2d5e2036869f26466be5f4c69475" + integrity sha512-kN6vzzf9NkEtawECqze6v99LtmDiUJCVpvieTFA1uL7/jDghiJGubGZ5csicYHU1Xoqb3oH/R5cN5df6W41Nfg== dependencies: + "@eslint-community/eslint-utils" "^4.2.0" "@types/json-schema" "^7.0.9" "@types/semver" "^7.3.12" - "@typescript-eslint/scope-manager" "5.49.0" - "@typescript-eslint/types" "5.49.0" - "@typescript-eslint/typescript-estree" "5.49.0" + "@typescript-eslint/scope-manager" "5.57.1" + "@typescript-eslint/types" "5.57.1" + "@typescript-eslint/typescript-estree" "5.57.1" eslint-scope "^5.1.1" - eslint-utils "^3.0.0" semver "^7.3.7" -"@typescript-eslint/visitor-keys@5.49.0": - version "5.49.0" - resolved "https://registry.yarnpkg.com/@typescript-eslint/visitor-keys/-/visitor-keys-5.49.0.tgz#2561c4da3f235f5c852759bf6c5faec7524f90fe" - integrity sha512-v9jBMjpNWyn8B6k/Mjt6VbUS4J1GvUlR4x3Y+ibnP1z7y7V4n0WRz+50DY6+Myj0UaXVSuUlHohO+eZ8IJEnkg== +"@typescript-eslint/visitor-keys@5.57.1": + version "5.57.1" + resolved "https://registry.yarnpkg.com/@typescript-eslint/visitor-keys/-/visitor-keys-5.57.1.tgz#585e5fa42a9bbcd9065f334fd7c8a4ddfa7d905e" + integrity sha512-RjQrAniDU0CEk5r7iphkm731zKlFiUjvcBS2yHAg8WWqFMCaCrD0rKEVOMUyMMcbGPZ0bPp56srkGWrgfZqLRA== dependencies: - "@typescript-eslint/types" "5.49.0" + "@typescript-eslint/types" "5.57.1" eslint-visitor-keys "^3.3.0" acorn-jsx@^5.3.2: @@ -1967,18 +1990,10 @@ core-js-compat@^3.21.0, core-js-compat@^3.22.1: dependencies: browserslist "^4.21.4" -cosmjs-types@^0.5.2: - version "0.5.2" - resolved "https://registry.yarnpkg.com/cosmjs-types/-/cosmjs-types-0.5.2.tgz#2d42b354946f330dfb5c90a87fdc2a36f97b965d" - integrity sha512-zxCtIJj8v3Di7s39uN4LNcN3HIE1z0B9Z0SPE8ZNQR0oSzsuSe1ACgxoFkvhkS7WBasCAFcglS11G2hyfd5tPg== - dependencies: - long "^4.0.0" - protobufjs "~6.11.2" - -cosmjs-types@^0.6.1: - version "0.6.1" - resolved "https://registry.yarnpkg.com/cosmjs-types/-/cosmjs-types-0.6.1.tgz#4944e83d0fa87880243a11813bdff0e313d39a68" - integrity sha512-fRz6yzElHHBULDyLArF/G1UkkTWW4r3RondBUGnmSsZWYI5NpfDn32MVa5aRmpaaf4tJI2cbnXHs9fykwU7Ttg== +cosmjs-types@^0.7.1, cosmjs-types@^0.7.2: + version "0.7.2" + resolved "https://registry.yarnpkg.com/cosmjs-types/-/cosmjs-types-0.7.2.tgz#a757371abd340949c5bd5d49c6f8379ae1ffd7e2" + integrity sha512-vf2uLyktjr/XVAgEq0DjMxeAWh1yYREe7AMHDKd7EiHVqxBPCaBS+qEEQUkXbR9ndnckqr1sUG8BQhazh4X5lA== dependencies: long "^4.0.0" protobufjs "~6.11.2" @@ -2118,10 +2133,10 @@ escape-string-regexp@^4.0.0: resolved "https://registry.yarnpkg.com/escape-string-regexp/-/escape-string-regexp-4.0.0.tgz#14ba83a5d373e3d311e5afca29cf5bfad965bf34" integrity sha512-TtpcNJ3XAzx3Gq8sWRzJaVajRs0uVxA2YAkdb1jm2YkPz4G6egUFAyA3n5vtEIZefPk5Wa4UXbKuS5fKkJWdgA== -eslint-config-prettier@^8.6.0: - version "8.6.0" - resolved "https://registry.yarnpkg.com/eslint-config-prettier/-/eslint-config-prettier-8.6.0.tgz#dec1d29ab728f4fa63061774e1672ac4e363d207" - integrity sha512-bAF0eLpLVqP5oEVUFKpMA+NnRFICwn9X8B5jrR9FcqnYBuPbqWEjTEspPWMj5ye6czoSLDweCzSo3Ko7gGrZaA== +eslint-config-prettier@^8.8.0: + version "8.8.0" + resolved "https://registry.yarnpkg.com/eslint-config-prettier/-/eslint-config-prettier-8.8.0.tgz#bfda738d412adc917fd7b038857110efe98c9348" + integrity sha512-wLbQiFre3tdGgpDv67NQKnJuTlcUVYHas3k+DZCc2U2BadthoEY4B7hLPvAxaqdyOGCzuLfii2fqGph10va7oA== eslint-scope@^5.1.1: version "5.1.1" @@ -2139,29 +2154,25 @@ eslint-scope@^7.1.1: esrecurse "^4.3.0" estraverse "^5.2.0" -eslint-utils@^3.0.0: - version "3.0.0" - resolved "https://registry.yarnpkg.com/eslint-utils/-/eslint-utils-3.0.0.tgz#8aebaface7345bb33559db0a1f13a1d2d48c3672" - integrity sha512-uuQC43IGctw68pJA1RgbQS8/NP7rch6Cwd4j3ZBtgo4/8Flj4eGE7ZYSZRN3iq5pVUv6GPdW5Z1RFleo84uLDA== - dependencies: - eslint-visitor-keys "^2.0.0" - -eslint-visitor-keys@^2.0.0: - version "2.1.0" - resolved "https://registry.yarnpkg.com/eslint-visitor-keys/-/eslint-visitor-keys-2.1.0.tgz#f65328259305927392c938ed44eb0a5c9b2bd303" - integrity sha512-0rSmRBzXgDzIsD6mGdJgevzgezI534Cer5L/vyMX0kHzT/jiB43jRhd9YUlMGYLQy2zprNmoT8qasCGtY+QaKw== - eslint-visitor-keys@^3.3.0: version "3.3.0" resolved "https://registry.yarnpkg.com/eslint-visitor-keys/-/eslint-visitor-keys-3.3.0.tgz#f6480fa6b1f30efe2d1968aa8ac745b862469826" integrity sha512-mQ+suqKJVyeuwGYHAdjMFqjCyfl8+Ldnxuyp3ldiMBFKkvytrXUZWaiPCEav8qDHKty44bD+qV1IP4T+w+xXRA== -eslint@^8.32.0: - version "8.32.0" - resolved "https://registry.yarnpkg.com/eslint/-/eslint-8.32.0.tgz#d9690056bb6f1a302bd991e7090f5b68fbaea861" - integrity sha512-nETVXpnthqKPFyuY2FNjz/bEd6nbosRgKbkgS/y1C7LJop96gYHWpiguLecMHQ2XCPxn77DS0P+68WzG6vkZSQ== - dependencies: - "@eslint/eslintrc" "^1.4.1" +eslint-visitor-keys@^3.4.0: + version "3.4.0" + resolved "https://registry.yarnpkg.com/eslint-visitor-keys/-/eslint-visitor-keys-3.4.0.tgz#c7f0f956124ce677047ddbc192a68f999454dedc" + integrity sha512-HPpKPUBQcAsZOsHAFwTtIKcYlCje62XB7SEAcxjtmW6TD1WVpkS6i6/hOVtTZIl4zGj/mBqpFVGvaDneik+VoQ== + +eslint@^8.37.0: + version "8.37.0" + resolved "https://registry.yarnpkg.com/eslint/-/eslint-8.37.0.tgz#1f660ef2ce49a0bfdec0b0d698e0b8b627287412" + integrity sha512-NU3Ps9nI05GUoVMxcZx1J8CNR6xOvUT4jAUMH5+z8lpp3aEdPVCImKw6PWG4PY+Vfkpr+jvMpxs/qoE7wq0sPw== + dependencies: + "@eslint-community/eslint-utils" "^4.2.0" + "@eslint-community/regexpp" "^4.4.0" + "@eslint/eslintrc" "^2.0.2" + "@eslint/js" "8.37.0" "@humanwhocodes/config-array" "^0.11.8" "@humanwhocodes/module-importer" "^1.0.1" "@nodelib/fs.walk" "^1.2.8" @@ -2172,10 +2183,9 @@ eslint@^8.32.0: doctrine "^3.0.0" escape-string-regexp "^4.0.0" eslint-scope "^7.1.1" - eslint-utils "^3.0.0" - eslint-visitor-keys "^3.3.0" - espree "^9.4.0" - esquery "^1.4.0" + eslint-visitor-keys "^3.4.0" + espree "^9.5.1" + esquery "^1.4.2" esutils "^2.0.2" fast-deep-equal "^3.1.3" file-entry-cache "^6.0.1" @@ -2196,29 +2206,28 @@ eslint@^8.32.0: minimatch "^3.1.2" natural-compare "^1.4.0" optionator "^0.9.1" - regexpp "^3.2.0" strip-ansi "^6.0.1" strip-json-comments "^3.1.0" text-table "^0.2.0" -espree@^9.4.0: - version "9.4.1" - resolved "https://registry.yarnpkg.com/espree/-/espree-9.4.1.tgz#51d6092615567a2c2cff7833445e37c28c0065bd" - integrity sha512-XwctdmTO6SIvCzd9810yyNzIrOrqNYV9Koizx4C/mRhf9uq0o4yHoCEU/670pOxOL/MSraektvSAji79kX90Vg== +espree@^9.5.1: + version "9.5.1" + resolved "https://registry.yarnpkg.com/espree/-/espree-9.5.1.tgz#4f26a4d5f18905bf4f2e0bd99002aab807e96dd4" + integrity sha512-5yxtHSZXRSW5pvv3hAlXM5+/Oswi1AUFqBmbibKb5s6bp3rGIDkyXU6xCoyuuLhijr4SFwPrXRoZjz0AZDN9tg== dependencies: acorn "^8.8.0" acorn-jsx "^5.3.2" - eslint-visitor-keys "^3.3.0" + eslint-visitor-keys "^3.4.0" esprima@^4.0.0: version "4.0.1" resolved "https://registry.yarnpkg.com/esprima/-/esprima-4.0.1.tgz#13b04cdb3e6c5d19df91ab6987a8695619b0aa71" integrity sha512-eGuFFw7Upda+g4p+QHvnW0RyTX/SVeJBDM/gCtMARO0cLuT2HcEKnTPvhjV6aGeqrCB/sbNop0Kszm0jsaWU4A== -esquery@^1.4.0: - version "1.4.0" - resolved "https://registry.yarnpkg.com/esquery/-/esquery-1.4.0.tgz#2148ffc38b82e8c7057dfed48425b3e61f0f24a5" - integrity sha512-cCDispWt5vHHtwMY2YrAQ4ibFkAL8RbH5YGBnZBc90MolvvfkkQcJro/aZiAQUlQ3qgrYS6D6v8Gc5G5CQsc9w== +esquery@^1.4.2: + version "1.5.0" + resolved "https://registry.yarnpkg.com/esquery/-/esquery-1.5.0.tgz#6ce17738de8577694edd7361c57182ac8cb0db0b" + integrity sha512-YQLXUplAwJgCydQ78IMJywZCceoqk1oH01OERdSAJc/7U2AylwjhSCLDEtqwg811idIS/9fIU5GjG73IgjKMVg== dependencies: estraverse "^5.1.0" @@ -3190,11 +3199,16 @@ prepend-file@^2.0.1: dependencies: temp-write "^4.0.0" -prettier@^2.6.2, prettier@^2.8.3: +prettier@^2.6.2: version "2.8.3" resolved "https://registry.yarnpkg.com/prettier/-/prettier-2.8.3.tgz#ab697b1d3dd46fb4626fbe2f543afe0cc98d8632" integrity sha512-tJ/oJ4amDihPoufT5sM0Z1SKEuKay8LfVAMlbbhnnkvt6BUserZylqo2PN+p9KeljLr0OHa2rXHU1T8reeoTrw== +prettier@^2.8.7: + version "2.8.7" + resolved "https://registry.yarnpkg.com/prettier/-/prettier-2.8.7.tgz#bb79fc8729308549d28fe3a98fce73d2c0656450" + integrity sha512-yPngTo3aXUUmyuTjeTUT75txrf+aMh9FiD7q9ZE/i6r0bPb22g4FsE6Y338PQX1bmfy08i9QQCB7/rcUAVntfw== + protobufjs@^6.8.8, protobufjs@~6.11.2, protobufjs@~6.11.3: version "6.11.3" resolved "https://registry.yarnpkg.com/protobufjs/-/protobufjs-6.11.3.tgz#637a527205a35caa4f3e2a9a4a13ddffe0e7af74" @@ -3260,11 +3274,6 @@ regenerator-transform@^0.15.1: dependencies: "@babel/runtime" "^7.8.4" -regexpp@^3.2.0: - version "3.2.0" - resolved "https://registry.yarnpkg.com/regexpp/-/regexpp-3.2.0.tgz#0425a2768d8f23bad70ca4b90461fa2f1213e1b2" - integrity sha512-pq2bWo9mVD43nbts2wGv17XLiNLya+GklZ8kaDLV2Z08gDCsGpnKn9BFMepvWuHCbyVvY7J5o5+BVvoQbmlJLg== - regexpu-core@^5.2.1: version "5.2.2" resolved "https://registry.yarnpkg.com/regexpu-core/-/regexpu-core-5.2.2.tgz#3e4e5d12103b64748711c3aad69934d7718e75fc" @@ -3604,10 +3613,10 @@ type@^2.7.2: resolved "https://registry.yarnpkg.com/type/-/type-2.7.2.tgz#2376a15a3a28b1efa0f5350dcf72d24df6ef98d0" integrity sha512-dzlvlNlt6AXU7EBSfpAscydQ7gXB+pPGsPnfJnZpiNJBDj7IaJzQlBZYGdEi4R9HmPdBv2XmWJ6YUtoTa7lmCw== -typescript@^4.9.4: - version "4.9.4" - resolved "https://registry.yarnpkg.com/typescript/-/typescript-4.9.4.tgz#a2a3d2756c079abda241d75f149df9d561091e78" - integrity sha512-Uz+dTXYzxXXbsFpM86Wh3dKCxrQqUcVMxwU54orwlJjOpO3ao8L7j5lH+dWfTwgCwIuM9GQ2kvVotzYJMXTBZg== +typescript@^5.0.3: + version "5.0.3" + resolved "https://registry.yarnpkg.com/typescript/-/typescript-5.0.3.tgz#fe976f0c826a88d0a382007681cbb2da44afdedf" + integrity sha512-xv8mOEDnigb/tN9PSMTwSEqAnUvkoXMQlicOb0IUVDBSQCgBSaAAROUZYy2IcUy5qU6XajK5jjjO7TMWqBTKZA== unicode-canonical-property-names-ecmascript@^2.0.0: version "2.0.0" @@ -3666,10 +3675,10 @@ walker@^1.0.8: dependencies: makeerror "1.0.12" -wasm-ast-types@^0.17.0: - version "0.17.0" - resolved "https://registry.yarnpkg.com/wasm-ast-types/-/wasm-ast-types-0.17.0.tgz#417280a61d60ea9964667cf2edb8f5281dc295d7" - integrity sha512-WeriXPbG67iI51Mf/5qRR0xcpEaTO/Wyjpl+vsmjZ5K6q/0W6iO03zHsESNIH/hpc5FPTpb0Y0L9xAtnnNe9Ow== +wasm-ast-types@^0.18.2: + version "0.18.2" + resolved "https://registry.yarnpkg.com/wasm-ast-types/-/wasm-ast-types-0.18.2.tgz#2161f390e7a2e4ad45a46bfdeda6d2d56801ece5" + integrity sha512-SKsuc56aYcl2UQM1Zm8IJZ2efvNAYhu/pPgH2OJZvUahGDi8W+jqnrKx9hIJeKW2GQdhboIIPFKY7PihWzgzgQ== dependencies: "@babel/runtime" "^7.18.9" "@babel/types" "7.18.10" From ceaa04719a98750b896eb6035a73aa7295644867 Mon Sep 17 00:00:00 2001 From: Gabe Rodriguez Date: Tue, 4 Apr 2023 16:46:14 +0200 Subject: [PATCH 05/17] emergency powers tests --- Cargo.lock | 195 +----------------- Cargo.toml | 1 - contracts/params/Cargo.toml | 6 +- contracts/params/src/contract.rs | 16 ++ contracts/params/src/emergency_powers.rs | 82 ++++++++ contracts/params/src/execute.rs | 23 --- contracts/params/src/lib.rs | 1 + contracts/params/src/msg.rs | 6 +- contracts/params/src/query.rs | 3 +- contracts/params/src/types.rs | 18 ++ contracts/params/tests/helpers/mock_env.rs | 41 +++- .../params/tests/test_emergency_powers.rs | 159 ++++++++++++++ schemas/mars-params/mars-params.json | 96 +++++++++ .../mars-params/MarsParams.client.ts | 25 +++ .../mars-params/MarsParams.react-query.ts | 23 +++ .../generated/mars-params/MarsParams.types.ts | 23 +++ 16 files changed, 496 insertions(+), 222 deletions(-) create mode 100644 contracts/params/src/emergency_powers.rs diff --git a/Cargo.lock b/Cargo.lock index e143938e6..640900054 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -74,12 +74,6 @@ version = "1.6.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8c3c1a368f70d6cf7302d78f8f7093da241fb8e8807c05cc9e51a125895a6d5b" -[[package]] -name = "bech32" -version = "0.9.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d86b93f97252c47b41663388e6d155714a9d0c398b99f1005cbc5f978b29f445" - [[package]] name = "bindgen" version = "0.60.1" @@ -434,7 +428,7 @@ checksum = "c80e93d1deccb8588db03945016a292c3c631e6325d349ebb35d2db6f4f946f7" dependencies = [ "cosmwasm-schema", "cosmwasm-std", - "cw2 1.0.1 (registry+https://github.com/rust-lang/crates.io-index)", + "cw2", "schemars", "semver", "serde", @@ -454,19 +448,6 @@ dependencies = [ "serde", ] -[[package]] -name = "cw2" -version = "1.0.1" -source = "git+https://github.com/mars-protocol/cw-plus?rev=4014255#4014255fc2d79486e332e02d1ab1421db86f4f0b" -dependencies = [ - "cosmwasm-schema", - "cosmwasm-std", - "cw-storage-plus", - "schemars", - "serde", - "thiserror", -] - [[package]] name = "der" version = "0.6.1" @@ -876,77 +857,6 @@ dependencies = [ "cfg-if", ] -[[package]] -name = "mars-address-provider" -version = "1.0.1" -source = "git+https://github.com/mars-protocol/red-bank?rev=00301d60c38af09d8eb7980355009e2f00c6f41f#00301d60c38af09d8eb7980355009e2f00c6f41f" -dependencies = [ - "bech32", - "cosmwasm-std", - "cw-storage-plus", - "cw2 1.0.1 (git+https://github.com/mars-protocol/cw-plus?rev=4014255)", - "mars-owner", - "mars-red-bank-types 1.0.1", - "thiserror", -] - -[[package]] -name = "mars-health" -version = "1.0.1" -source = "git+https://github.com/mars-protocol/red-bank?rev=00301d60c38af09d8eb7980355009e2f00c6f41f#00301d60c38af09d8eb7980355009e2f00c6f41f" -dependencies = [ - "cosmwasm-std", - "mars-red-bank-types 1.0.1", - "thiserror", -] - -[[package]] -name = "mars-incentives" -version = "1.0.1" -source = "git+https://github.com/mars-protocol/red-bank?rev=00301d60c38af09d8eb7980355009e2f00c6f41f#00301d60c38af09d8eb7980355009e2f00c6f41f" -dependencies = [ - "cosmwasm-std", - "cw-storage-plus", - "cw2 1.0.1 (git+https://github.com/mars-protocol/cw-plus?rev=4014255)", - "mars-owner", - "mars-red-bank-types 1.0.1", - "mars-utils 1.0.1", - "thiserror", -] - -[[package]] -name = "mars-oracle-base" -version = "1.0.1" -source = "git+https://github.com/mars-protocol/red-bank?rev=00301d60c38af09d8eb7980355009e2f00c6f41f#00301d60c38af09d8eb7980355009e2f00c6f41f" -dependencies = [ - "cosmwasm-std", - "cw-storage-plus", - "cw2 1.0.1 (git+https://github.com/mars-protocol/cw-plus?rev=4014255)", - "mars-owner", - "mars-red-bank-types 1.0.1", - "mars-utils 1.0.1", - "schemars", - "serde", - "thiserror", -] - -[[package]] -name = "mars-oracle-osmosis" -version = "1.0.1" -source = "git+https://github.com/mars-protocol/red-bank?rev=00301d60c38af09d8eb7980355009e2f00c6f41f#00301d60c38af09d8eb7980355009e2f00c6f41f" -dependencies = [ - "cosmwasm-std", - "cw-storage-plus", - "cw2 1.0.1 (git+https://github.com/mars-protocol/cw-plus?rev=4014255)", - "mars-oracle-base", - "mars-osmosis", - "mars-red-bank-types 1.0.1", - "osmosis-std 0.14.0", - "schemars", - "serde", - "thiserror", -] - [[package]] name = "mars-osmosis" version = "1.0.1" @@ -978,34 +888,16 @@ dependencies = [ "cosmwasm-schema", "cosmwasm-std", "cw-multi-test", - "cw-paginate", "cw-storage-plus", - "cw2 1.0.1 (registry+https://github.com/rust-lang/crates.io-index)", + "cw2", "mars-owner", - "mars-red-bank-types 1.0.0", - "mars-testing", - "mars-utils 1.0.0", + "mars-red-bank-types", + "mars-utils", "schemars", "serde", "thiserror", ] -[[package]] -name = "mars-red-bank" -version = "1.0.1" -source = "git+https://github.com/mars-protocol/red-bank?rev=00301d60c38af09d8eb7980355009e2f00c6f41f#00301d60c38af09d8eb7980355009e2f00c6f41f" -dependencies = [ - "cosmwasm-std", - "cw-storage-plus", - "cw-utils", - "cw2 1.0.1 (git+https://github.com/mars-protocol/cw-plus?rev=4014255)", - "mars-health", - "mars-owner", - "mars-red-bank-types 1.0.1", - "mars-utils 1.0.1", - "thiserror", -] - [[package]] name = "mars-red-bank-types" version = "1.0.0" @@ -1015,51 +907,7 @@ dependencies = [ "cosmwasm-schema", "cosmwasm-std", "mars-owner", - "mars-utils 1.0.0", - "thiserror", -] - -[[package]] -name = "mars-red-bank-types" -version = "1.0.1" -source = "git+https://github.com/mars-protocol/red-bank?rev=00301d60c38af09d8eb7980355009e2f00c6f41f#00301d60c38af09d8eb7980355009e2f00c6f41f" -dependencies = [ - "cosmwasm-schema", - "cosmwasm-std", - "mars-owner", - "mars-utils 1.0.1", - "thiserror", -] - -[[package]] -name = "mars-rewards-collector-base" -version = "1.0.1" -source = "git+https://github.com/mars-protocol/red-bank?rev=00301d60c38af09d8eb7980355009e2f00c6f41f#00301d60c38af09d8eb7980355009e2f00c6f41f" -dependencies = [ - "cosmwasm-std", - "cw-storage-plus", - "mars-owner", - "mars-red-bank-types 1.0.1", - "mars-utils 1.0.1", - "schemars", - "serde", - "thiserror", -] - -[[package]] -name = "mars-rewards-collector-osmosis" -version = "1.0.1" -source = "git+https://github.com/mars-protocol/red-bank?rev=00301d60c38af09d8eb7980355009e2f00c6f41f#00301d60c38af09d8eb7980355009e2f00c6f41f" -dependencies = [ - "cosmwasm-std", - "cw-storage-plus", - "cw2 1.0.1 (git+https://github.com/mars-protocol/cw-plus?rev=4014255)", - "mars-osmosis", - "mars-red-bank-types 1.0.1", - "mars-rewards-collector-base", - "osmosis-std 0.14.0", - "schemars", - "serde", + "mars-utils", "thiserror", ] @@ -1112,7 +960,7 @@ dependencies = [ "cosmwasm-schema", "cosmwasm-std", "cw-storage-plus", - "cw2 1.0.1 (registry+https://github.com/rust-lang/crates.io-index)", + "cw2", "mars-osmosis", "mars-owner", "mars-swapper", @@ -1123,28 +971,6 @@ dependencies = [ "thiserror", ] -[[package]] -name = "mars-testing" -version = "1.0.1" -source = "git+https://github.com/mars-protocol/red-bank?rev=00301d60c38af09d8eb7980355009e2f00c6f41f#00301d60c38af09d8eb7980355009e2f00c6f41f" -dependencies = [ - "anyhow", - "cosmwasm-std", - "cw-multi-test", - "mars-address-provider", - "mars-incentives", - "mars-oracle-osmosis", - "mars-osmosis", - "mars-red-bank", - "mars-red-bank-types 1.0.1", - "mars-rewards-collector-osmosis", - "osmosis-std 0.14.0", - "prost 0.11.8", - "schemars", - "serde", - "thiserror", -] - [[package]] name = "mars-utils" version = "1.0.0" @@ -1155,15 +981,6 @@ dependencies = [ "thiserror", ] -[[package]] -name = "mars-utils" -version = "1.0.1" -source = "git+https://github.com/mars-protocol/red-bank?rev=00301d60c38af09d8eb7980355009e2f00c6f41f#00301d60c38af09d8eb7980355009e2f00c6f41f" -dependencies = [ - "cosmwasm-std", - "thiserror", -] - [[package]] name = "memchr" version = "2.5.0" diff --git a/Cargo.toml b/Cargo.toml index a65ee3c34..f92c84a3f 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -48,7 +48,6 @@ mars-red-bank-types = "1.0.0" mars-owner = { version = "1.0.0", features = ["emergency-owner"] } mars-swapper = { path = "packages/mars-swapper" } mars-utils = "1.0.0" -mars-testing = { git = "https://github.com/mars-protocol/red-bank", rev = "00301d60c38af09d8eb7980355009e2f00c6f41f" } # contracts mars-swapper-base = { version = "1.0.0", path = "contracts/swapper/base" } diff --git a/contracts/params/Cargo.toml b/contracts/params/Cargo.toml index c0d86b366..a34ffde72 100644 --- a/contracts/params/Cargo.toml +++ b/contracts/params/Cargo.toml @@ -22,7 +22,6 @@ library = [] cosmwasm-schema = { workspace = true } cosmwasm-std = { workspace = true } cw2 = { workspace = true } -cw-paginate = { workspace = true } cw-storage-plus = { workspace = true } mars-red-bank-types = { workspace = true } mars-owner = { workspace = true } @@ -30,8 +29,7 @@ mars-utils = { workspace = true } schemars = { workspace = true } serde = { workspace = true } thiserror = { workspace = true } -mars-testing = { workspace = true } [dev-dependencies] -anyhow = { workspace = true } -cw-multi-test = { workspace = true } \ No newline at end of file +anyhow = { workspace = true } +cw-multi-test = { workspace = true } diff --git a/contracts/params/src/contract.rs b/contracts/params/src/contract.rs index 9a1cb63da..c8403dd13 100644 --- a/contracts/params/src/contract.rs +++ b/contracts/params/src/contract.rs @@ -3,11 +3,13 @@ use cw2::set_contract_version; use mars_owner::OwnerInit::SetInitialOwner; use crate::{ + emergency_powers::{disable_borrowing, disallow_coin, set_zero_deposit_cap, set_zero_max_ltv}, error::ContractResult, execute::{update_asset_params, update_max_close_factor, update_vault_config, validate_mcf}, msg::{ExecuteMsg, InstantiateMsg, QueryMsg}, query::{query_all_asset_params, query_all_vault_configs, query_vault_config}, state::{ASSET_PARAMS, MAX_CLOSE_FACTOR, OWNER}, + types::{EmergencyUpdate, RedBankEmergencyUpdate, RoverEmergencyUpdate}, }; const CONTRACT_NAME: &str = env!("CARGO_PKG_NAME"); @@ -48,6 +50,20 @@ pub fn execute( ExecuteMsg::UpdateAssetParams(update) => update_asset_params(deps, info, update), ExecuteMsg::UpdateMaxCloseFactor(mcf) => update_max_close_factor(deps, info, mcf), ExecuteMsg::UpdateVaultConfig(update) => update_vault_config(deps, info, update), + ExecuteMsg::EmergencyUpdate(update) => match update { + EmergencyUpdate::RedBank(rb_u) => match rb_u { + RedBankEmergencyUpdate::DisableBorrowing(denom) => { + disable_borrowing(deps, info, &denom) + } + }, + EmergencyUpdate::Rover(rv_u) => match rv_u { + RoverEmergencyUpdate::DisallowCoin(denom) => disallow_coin(deps, info, &denom), + RoverEmergencyUpdate::SetZeroMaxLtvOnVault(v) => set_zero_max_ltv(deps, info, &v), + RoverEmergencyUpdate::SetZeroDepositCapOnVault(v) => { + set_zero_deposit_cap(deps, info, &v) + } + }, + }, } } diff --git a/contracts/params/src/emergency_powers.rs b/contracts/params/src/emergency_powers.rs new file mode 100644 index 000000000..76c4104ce --- /dev/null +++ b/contracts/params/src/emergency_powers.rs @@ -0,0 +1,82 @@ +use cosmwasm_std::{Decimal, DepsMut, MessageInfo, Response, Uint128}; + +use crate::{ + error::ContractError, + state::{ASSET_PARAMS, OWNER, VAULT_CONFIGS}, +}; + +pub fn disable_borrowing( + deps: DepsMut, + info: MessageInfo, + denom: &str, +) -> Result { + OWNER.assert_emergency_owner(deps.storage, &info.sender)?; + + let mut params = ASSET_PARAMS.load(deps.storage, denom)?; + params.permissions.red_bank.borrow_enabled = false; + ASSET_PARAMS.save(deps.storage, denom, ¶ms)?; + + let response = Response::new() + .add_attribute("action", "emergency_disable_borrowing") + .add_attribute("denom", denom.to_string()); + + Ok(response) +} + +pub fn disallow_coin( + deps: DepsMut, + info: MessageInfo, + denom: &str, +) -> Result { + OWNER.assert_emergency_owner(deps.storage, &info.sender)?; + + let mut params = ASSET_PARAMS.load(deps.storage, denom)?; + params.permissions.rover.whitelisted = false; + ASSET_PARAMS.save(deps.storage, denom, ¶ms)?; + + let response = Response::new() + .add_attribute("action", "emergency_disallow_coin") + .add_attribute("denom", denom.to_string()); + + Ok(response) +} + +pub fn set_zero_max_ltv( + deps: DepsMut, + info: MessageInfo, + vault: &str, +) -> Result { + OWNER.assert_emergency_owner(deps.storage, &info.sender)?; + + let vault_addr = deps.api.addr_validate(vault)?; + + let mut config = VAULT_CONFIGS.load(deps.storage, &vault_addr)?; + config.max_loan_to_value = Decimal::zero(); + VAULT_CONFIGS.save(deps.storage, &vault_addr, &config)?; + + let response = Response::new() + .add_attribute("action", "emergency_set_zero_max_ltv") + .add_attribute("vault", vault.to_string()); + + Ok(response) +} + +pub fn set_zero_deposit_cap( + deps: DepsMut, + info: MessageInfo, + vault: &str, +) -> Result { + OWNER.assert_emergency_owner(deps.storage, &info.sender)?; + + let vault_addr = deps.api.addr_validate(vault)?; + + let mut config = VAULT_CONFIGS.load(deps.storage, &vault_addr)?; + config.deposit_cap.amount = Uint128::zero(); + VAULT_CONFIGS.save(deps.storage, &vault_addr, &config)?; + + let response = Response::new() + .add_attribute("action", "emergency_set_zero_deposit_cap") + .add_attribute("vault", vault.to_string()); + + Ok(response) +} diff --git a/contracts/params/src/execute.rs b/contracts/params/src/execute.rs index 750e864d0..a7df479be 100644 --- a/contracts/params/src/execute.rs +++ b/contracts/params/src/execute.rs @@ -61,29 +61,6 @@ pub fn update_asset_params( Ok(response) } -// /// Emergency owner can only DISABLE BORROWING. -// fn update_asset_by_emergency_owner( -// deps: DepsMut, -// denom: &str, -// params: AssetParams, -// ) -> Result { -// if let Some(mut asset) = ASSET_PARAMS.may_load(deps.storage, denom)? { -// match params.red_bank_borrow_enabled { -// Some(borrow_enabled) if !borrow_enabled => { -// asset.red_bank_borrow_enabled = borrow_enabled; -// ASSET_PARAMS.save(deps.storage, denom, &asset)?; -// -// Ok(Response::new() -// .add_attribute("action", "emergency_update_asset") -// .add_attribute("denom", denom)) -// } -// _ => ContractError::Unauthorized {}.into(), -// } -// } else { -// ContractError::AssetNotInitialized {} -// } -// } - pub fn update_vault_config( deps: DepsMut, info: MessageInfo, diff --git a/contracts/params/src/lib.rs b/contracts/params/src/lib.rs index 7e8f1f90c..2f486c2cc 100644 --- a/contracts/params/src/lib.rs +++ b/contracts/params/src/lib.rs @@ -1,4 +1,5 @@ pub mod contract; +pub mod emergency_powers; pub mod error; pub mod execute; pub mod msg; diff --git a/contracts/params/src/msg.rs b/contracts/params/src/msg.rs index d412fa069..19c4b7e78 100644 --- a/contracts/params/src/msg.rs +++ b/contracts/params/src/msg.rs @@ -2,7 +2,9 @@ use cosmwasm_schema::{cw_serde, QueryResponses}; use cosmwasm_std::Decimal; use mars_owner::OwnerUpdate; -use crate::types::{AssetParams, AssetParamsUpdate, VaultConfig, VaultConfigUpdate}; +use crate::types::{ + AssetParams, AssetParamsUpdate, EmergencyUpdate, VaultConfig, VaultConfigUpdate, +}; #[cw_serde] pub struct InstantiateMsg { @@ -18,6 +20,7 @@ pub enum ExecuteMsg { UpdateMaxCloseFactor(Decimal), UpdateAssetParams(AssetParamsUpdate), UpdateVaultConfig(VaultConfigUpdate), + EmergencyUpdate(EmergencyUpdate), } #[cw_serde] @@ -49,7 +52,6 @@ pub enum QueryMsg { limit: Option, }, - // query all configs #[returns(Decimal)] MaxCloseFactor {}, } diff --git a/contracts/params/src/query.rs b/contracts/params/src/query.rs index db1bf639d..12ad21bbc 100644 --- a/contracts/params/src/query.rs +++ b/contracts/params/src/query.rs @@ -1,5 +1,4 @@ use cosmwasm_std::{Addr, Deps, Order, StdResult}; -use cw_paginate::DEFAULT_LIMIT; use cw_storage_plus::Bound; use crate::{ @@ -7,6 +6,8 @@ use crate::{ types::{AssetParamsResponse, VaultConfig, VaultConfigResponse}, }; +pub const DEFAULT_LIMIT: u32 = 10; + pub fn query_all_asset_params( deps: Deps, start_after: Option, diff --git a/contracts/params/src/types.rs b/contracts/params/src/types.rs index 1e2b29d0e..e76a0c85b 100644 --- a/contracts/params/src/types.rs +++ b/contracts/params/src/types.rs @@ -101,3 +101,21 @@ pub enum VaultConfigUpdate { addr: String, }, } + +#[cw_serde] +pub enum RoverEmergencyUpdate { + SetZeroMaxLtvOnVault(String), + SetZeroDepositCapOnVault(String), + DisallowCoin(String), +} + +#[cw_serde] +pub enum RedBankEmergencyUpdate { + DisableBorrowing(String), +} + +#[cw_serde] +pub enum EmergencyUpdate { + Rover(RoverEmergencyUpdate), + RedBank(RedBankEmergencyUpdate), +} diff --git a/contracts/params/tests/helpers/mock_env.rs b/contracts/params/tests/helpers/mock_env.rs index 31a466e68..7c0256e4b 100644 --- a/contracts/params/tests/helpers/mock_env.rs +++ b/contracts/params/tests/helpers/mock_env.rs @@ -7,8 +7,8 @@ use mars_owner::{OwnerResponse, OwnerUpdate}; use mars_params::{ msg::{ExecuteMsg, InstantiateMsg, QueryMsg}, types::{ - AssetParams, AssetParamsResponse, AssetParamsUpdate, VaultConfig, VaultConfigResponse, - VaultConfigUpdate, + AssetParams, AssetParamsResponse, AssetParamsUpdate, EmergencyUpdate, VaultConfig, + VaultConfigResponse, VaultConfigUpdate, }, }; @@ -22,6 +22,7 @@ pub struct MockEnv { pub struct MockEnvBuilder { pub app: BasicApp, pub max_close_factor: Option, + pub emergency_owner: Option, } #[allow(clippy::new_ret_no_self)] @@ -30,6 +31,7 @@ impl MockEnv { MockEnvBuilder { app: App::default(), max_close_factor: None, + emergency_owner: None, } } @@ -85,6 +87,19 @@ impl MockEnv { ) } + pub fn emergency_update( + &mut self, + sender: &Addr, + update: EmergencyUpdate, + ) -> AnyResult { + self.app.execute_contract( + sender.clone(), + self.params_contract.clone(), + &ExecuteMsg::EmergencyUpdate(update), + &[], + ) + } + //-------------------------------------------------------------------------------------------------- // Queries //-------------------------------------------------------------------------------------------------- @@ -180,12 +195,29 @@ impl MockEnvBuilder { None, )?; + if self.emergency_owner.is_some() { + self.set_emergency_owner(¶ms_contract, &self.emergency_owner.clone().unwrap()); + } + Ok(MockEnv { app: take(&mut self.app), params_contract, }) } + fn set_emergency_owner(&mut self, params_contract: &Addr, eo: &str) { + self.app + .execute_contract( + Addr::unchecked("owner"), + params_contract.clone(), + &ExecuteMsg::UpdateOwner(OwnerUpdate::SetEmergencyOwner { + emergency_owner: eo.to_string(), + }), + &[], + ) + .unwrap(); + } + //-------------------------------------------------------------------------------------------------- // Get or defaults //-------------------------------------------------------------------------------------------------- @@ -201,4 +233,9 @@ impl MockEnvBuilder { self.max_close_factor = Some(mcf); self } + + pub fn emergency_owner(&mut self, eo: &str) -> &mut Self { + self.emergency_owner = Some(eo.to_string()); + self + } } diff --git a/contracts/params/tests/test_emergency_powers.rs b/contracts/params/tests/test_emergency_powers.rs index 8b1378917..c932a531d 100644 --- a/contracts/params/tests/test_emergency_powers.rs +++ b/contracts/params/tests/test_emergency_powers.rs @@ -1 +1,160 @@ +use cosmwasm_std::Addr; +use mars_owner::OwnerError; +use mars_params::{ + error::ContractError::Owner, + types::{ + AssetParamsUpdate, EmergencyUpdate, RedBankEmergencyUpdate, RoverEmergencyUpdate, + VaultConfigUpdate, + }, +}; +use crate::helpers::{assert_err, default_asset_params, default_vault_config, MockEnv}; + +pub mod helpers; + +#[test] +fn only_owner_can_invoke_emergency_powers() { + let mut mock = MockEnv::new().build().unwrap(); + let bad_guy = Addr::unchecked("doctor_otto_983"); + let res = mock.emergency_update( + &bad_guy, + EmergencyUpdate::RedBank(RedBankEmergencyUpdate::DisableBorrowing("xyz".to_string())), + ); + assert_err(res, Owner(OwnerError::NotEmergencyOwner {})); + + let res = mock.emergency_update( + &bad_guy, + EmergencyUpdate::Rover(RoverEmergencyUpdate::DisallowCoin("xyz".to_string())), + ); + assert_err(res, Owner(OwnerError::NotEmergencyOwner {})); + + let res = mock.emergency_update( + &bad_guy, + EmergencyUpdate::Rover(RoverEmergencyUpdate::SetZeroDepositCapOnVault("xyz".to_string())), + ); + assert_err(res, Owner(OwnerError::NotEmergencyOwner {})); + + let res = mock.emergency_update( + &bad_guy, + EmergencyUpdate::Rover(RoverEmergencyUpdate::SetZeroMaxLtvOnVault("xyz".to_string())), + ); + assert_err(res, Owner(OwnerError::NotEmergencyOwner {})); +} + +#[test] +fn disabling_borrowing() { + let emergency_owner = Addr::unchecked("miles_morales"); + let mut mock = MockEnv::new().emergency_owner(emergency_owner.as_str()).build().unwrap(); + let denom = "atom".to_string(); + + let mut params = default_asset_params(); + params.permissions.red_bank.borrow_enabled = true; + + mock.update_asset_params( + &mock.query_owner(), + AssetParamsUpdate::AddOrUpdate { + denom: denom.clone(), + params, + }, + ) + .unwrap(); + + let params = mock.query_asset_params(&denom); + assert!(params.permissions.red_bank.borrow_enabled); + + mock.emergency_update( + &emergency_owner, + EmergencyUpdate::RedBank(RedBankEmergencyUpdate::DisableBorrowing(denom.clone())), + ) + .unwrap(); + + let params = mock.query_asset_params(&denom); + assert!(!params.permissions.red_bank.borrow_enabled); +} + +#[test] +fn disallow_coin() { + let emergency_owner = Addr::unchecked("miles_morales"); + let mut mock = MockEnv::new().emergency_owner(emergency_owner.as_str()).build().unwrap(); + let denom = "atom".to_string(); + + let mut params = default_asset_params(); + params.permissions.rover.whitelisted = true; + + mock.update_asset_params( + &mock.query_owner(), + AssetParamsUpdate::AddOrUpdate { + denom: denom.clone(), + params, + }, + ) + .unwrap(); + + let params = mock.query_asset_params(&denom); + assert!(params.permissions.rover.whitelisted); + + mock.emergency_update( + &emergency_owner, + EmergencyUpdate::Rover(RoverEmergencyUpdate::DisallowCoin(denom.clone())), + ) + .unwrap(); + + let params = mock.query_asset_params(&denom); + assert!(!params.permissions.rover.whitelisted); +} + +#[test] +fn set_zero_max_ltv() { + let emergency_owner = Addr::unchecked("miles_morales"); + let mut mock = MockEnv::new().emergency_owner(emergency_owner.as_str()).build().unwrap(); + let vault = "vault_addr_123".to_string(); + + mock.update_vault_config( + &mock.query_owner(), + VaultConfigUpdate::AddOrUpdate { + addr: vault.clone(), + config: default_vault_config(), + }, + ) + .unwrap(); + + let params = mock.query_vault_config(&vault); + assert!(!params.max_loan_to_value.is_zero()); + + mock.emergency_update( + &emergency_owner, + EmergencyUpdate::Rover(RoverEmergencyUpdate::SetZeroMaxLtvOnVault(vault.clone())), + ) + .unwrap(); + + let params = mock.query_vault_config(&vault); + assert!(params.max_loan_to_value.is_zero()); +} + +#[test] +fn set_zero_deposit_cap() { + let emergency_owner = Addr::unchecked("miles_morales"); + let mut mock = MockEnv::new().emergency_owner(emergency_owner.as_str()).build().unwrap(); + let vault = "vault_addr_123".to_string(); + + mock.update_vault_config( + &mock.query_owner(), + VaultConfigUpdate::AddOrUpdate { + addr: vault.clone(), + config: default_vault_config(), + }, + ) + .unwrap(); + + let params = mock.query_vault_config(&vault); + assert!(!params.deposit_cap.amount.is_zero()); + + mock.emergency_update( + &emergency_owner, + EmergencyUpdate::Rover(RoverEmergencyUpdate::SetZeroDepositCapOnVault(vault.clone())), + ) + .unwrap(); + + let params = mock.query_vault_config(&vault); + assert!(params.deposit_cap.amount.is_zero()); +} diff --git a/schemas/mars-params/mars-params.json b/schemas/mars-params/mars-params.json index 0e474c451..f02a5d2ab 100644 --- a/schemas/mars-params/mars-params.json +++ b/schemas/mars-params/mars-params.json @@ -83,6 +83,18 @@ } }, "additionalProperties": false + }, + { + "type": "object", + "required": [ + "emergency_update" + ], + "properties": { + "emergency_update": { + "$ref": "#/definitions/EmergencyUpdate" + } + }, + "additionalProperties": false } ], "definitions": { @@ -207,6 +219,34 @@ "description": "A fixed-point decimal value with 18 fractional digits, i.e. Decimal(1_000_000_000_000_000_000) == 1.0\n\nThe greatest possible value that can be represented is 340282366920938463463.374607431768211455 (which is (2^128 - 1) / 10^18)", "type": "string" }, + "EmergencyUpdate": { + "oneOf": [ + { + "type": "object", + "required": [ + "rover" + ], + "properties": { + "rover": { + "$ref": "#/definitions/RoverEmergencyUpdate" + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "red_bank" + ], + "properties": { + "red_bank": { + "$ref": "#/definitions/RedBankEmergencyUpdate" + } + }, + "additionalProperties": false + } + ] + }, "InterestRateModel": { "type": "object", "required": [ @@ -327,6 +367,22 @@ } ] }, + "RedBankEmergencyUpdate": { + "oneOf": [ + { + "type": "object", + "required": [ + "disable_borrowing" + ], + "properties": { + "disable_borrowing": { + "type": "string" + } + }, + "additionalProperties": false + } + ] + }, "RedBankPermissions": { "type": "object", "required": [ @@ -343,6 +399,46 @@ }, "additionalProperties": false }, + "RoverEmergencyUpdate": { + "oneOf": [ + { + "type": "object", + "required": [ + "set_zero_max_ltv_on_vault" + ], + "properties": { + "set_zero_max_ltv_on_vault": { + "type": "string" + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "set_zero_deposit_cap_on_vault" + ], + "properties": { + "set_zero_deposit_cap_on_vault": { + "type": "string" + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "disallow_coin" + ], + "properties": { + "disallow_coin": { + "type": "string" + } + }, + "additionalProperties": false + } + ] + }, "RoverPermissions": { "type": "object", "required": [ diff --git a/scripts/types/generated/mars-params/MarsParams.client.ts b/scripts/types/generated/mars-params/MarsParams.client.ts index 0f91297fa..4dc050b2b 100644 --- a/scripts/types/generated/mars-params/MarsParams.client.ts +++ b/scripts/types/generated/mars-params/MarsParams.client.ts @@ -15,6 +15,9 @@ import { AssetParamsUpdate, Uint128, VaultConfigUpdate, + EmergencyUpdate, + RoverEmergencyUpdate, + RedBankEmergencyUpdate, AssetParams, InterestRateModel, AssetPermissions, @@ -140,6 +143,11 @@ export interface MarsParamsInterface extends MarsParamsReadOnlyInterface { memo?: string, funds?: Coin[], ) => Promise + emergencyUpdate: ( + fee?: number | StdFee | 'auto', + memo?: string, + funds?: Coin[], + ) => Promise } export class MarsParamsClient extends MarsParamsQueryClient implements MarsParamsInterface { client: SigningCosmWasmClient @@ -155,6 +163,7 @@ export class MarsParamsClient extends MarsParamsQueryClient implements MarsParam this.updateMaxCloseFactor = this.updateMaxCloseFactor.bind(this) this.updateAssetParams = this.updateAssetParams.bind(this) this.updateVaultConfig = this.updateVaultConfig.bind(this) + this.emergencyUpdate = this.emergencyUpdate.bind(this) } updateOwner = async ( @@ -221,4 +230,20 @@ export class MarsParamsClient extends MarsParamsQueryClient implements MarsParam funds, ) } + emergencyUpdate = async ( + fee: number | StdFee | 'auto' = 'auto', + memo?: string, + funds?: Coin[], + ): Promise => { + return await this.client.execute( + this.sender, + this.contractAddress, + { + emergency_update: {}, + }, + fee, + memo, + funds, + ) + } } diff --git a/scripts/types/generated/mars-params/MarsParams.react-query.ts b/scripts/types/generated/mars-params/MarsParams.react-query.ts index ebcec4d6c..a56800393 100644 --- a/scripts/types/generated/mars-params/MarsParams.react-query.ts +++ b/scripts/types/generated/mars-params/MarsParams.react-query.ts @@ -16,6 +16,9 @@ import { AssetParamsUpdate, Uint128, VaultConfigUpdate, + EmergencyUpdate, + RoverEmergencyUpdate, + RedBankEmergencyUpdate, AssetParams, InterestRateModel, AssetPermissions, @@ -181,6 +184,26 @@ export function useMarsParamsOwnerQuery({ { ...options, enabled: !!client && (options?.enabled != undefined ? options.enabled : true) }, ) } +export interface MarsParamsEmergencyUpdateMutation { + client: MarsParamsClient + args?: { + fee?: number | StdFee | 'auto' + memo?: string + funds?: Coin[] + } +} +export function useMarsParamsEmergencyUpdateMutation( + options?: Omit< + UseMutationOptions, + 'mutationFn' + >, +) { + return useMutation( + ({ client, msg, args: { fee, memo, funds } = {} }) => + client.emergencyUpdate(msg, fee, memo, funds), + options, + ) +} export interface MarsParamsUpdateVaultConfigMutation { client: MarsParamsClient args?: { diff --git a/scripts/types/generated/mars-params/MarsParams.types.ts b/scripts/types/generated/mars-params/MarsParams.types.ts index f8c154c63..1586d56d7 100644 --- a/scripts/types/generated/mars-params/MarsParams.types.ts +++ b/scripts/types/generated/mars-params/MarsParams.types.ts @@ -23,6 +23,9 @@ export type ExecuteMsg = | { update_vault_config: VaultConfigUpdate } + | { + emergency_update: EmergencyUpdate + } export type OwnerUpdate = | { propose_new_owner: { @@ -63,6 +66,26 @@ export type VaultConfigUpdate = addr: string } } +export type EmergencyUpdate = + | { + rover: RoverEmergencyUpdate + } + | { + red_bank: RedBankEmergencyUpdate + } +export type RoverEmergencyUpdate = + | { + set_zero_max_ltv_on_vault: string + } + | { + set_zero_deposit_cap_on_vault: string + } + | { + disallow_coin: string + } +export type RedBankEmergencyUpdate = { + disable_borrowing: string +} export interface AssetParams { interest_rate_model: InterestRateModel liquidation_bonus: Decimal From e73c11633f2eeb85fb0a75738d9d657b8e64beb1 Mon Sep 17 00:00:00 2001 From: brimigs Date: Mon, 10 Apr 2023 08:39:31 -0400 Subject: [PATCH 06/17] remove 'remove asset param' functionality --- contracts/params/src/execute.rs | 7 ---- contracts/params/src/types.rs | 3 -- .../params/tests/test_update_asset_params.rs | 33 ++----------------- 3 files changed, 3 insertions(+), 40 deletions(-) diff --git a/contracts/params/src/execute.rs b/contracts/params/src/execute.rs index a7df479be..8fb0bf4e8 100644 --- a/contracts/params/src/execute.rs +++ b/contracts/params/src/execute.rs @@ -49,13 +49,6 @@ pub fn update_asset_params( .add_attribute("action_type", "add_or_update") .add_attribute("denom", denom); } - AssetParamsUpdate::Remove { - denom, - } => { - ASSET_PARAMS.remove(deps.storage, &denom); - response = - response.add_attribute("action_type", "remove").add_attribute("denom", denom); - } } Ok(response) diff --git a/contracts/params/src/types.rs b/contracts/params/src/types.rs index e76a0c85b..b00386ae1 100644 --- a/contracts/params/src/types.rs +++ b/contracts/params/src/types.rs @@ -86,9 +86,6 @@ pub enum AssetParamsUpdate { denom: String, params: AssetParams, }, - Remove { - denom: String, - }, } #[cw_serde] diff --git a/contracts/params/tests/test_update_asset_params.rs b/contracts/params/tests/test_update_asset_params.rs index d129a32eb..5b1ef69b6 100644 --- a/contracts/params/tests/test_update_asset_params.rs +++ b/contracts/params/tests/test_update_asset_params.rs @@ -16,11 +16,13 @@ fn initial_state_of_params() { #[test] fn only_owner_can_update_asset_params() { let mut mock = MockEnv::new().build().unwrap(); + let params = default_asset_params(); let bad_guy = Addr::unchecked("doctor_otto_983"); let res = mock.update_asset_params( &bad_guy, - AssetParamsUpdate::Remove { + AssetParamsUpdate::AddOrUpdate { denom: "xyz".to_string(), + params: params.clone(), }, ); assert_err(res, Owner(OwnerError::NotOwner {})); @@ -200,35 +202,6 @@ fn removing_from_asset_params() { let asset_params = mock.query_all_asset_params(None, None); assert_eq!(3, asset_params.len()); - - mock.update_asset_params( - &owner, - AssetParamsUpdate::Remove { - denom: denom1, - }, - ) - .unwrap(); - let asset_params = mock.query_all_asset_params(None, None); - assert_eq!(2, asset_params.len()); - assert_eq!(&denom0, &asset_params.first().unwrap().denom); - assert_eq!(&denom2, &asset_params.get(1).unwrap().denom); - - mock.update_asset_params( - &owner, - AssetParamsUpdate::Remove { - denom: denom0, - }, - ) - .unwrap(); - mock.update_asset_params( - &owner, - AssetParamsUpdate::Remove { - denom: denom2, - }, - ) - .unwrap(); - let asset_params = mock.query_all_asset_params(None, None); - assert!(asset_params.is_empty()); } #[test] From 24629dc4c3fb3c04a9ebce05c94a4c3009191792 Mon Sep 17 00:00:00 2001 From: brimigs Date: Tue, 11 Apr 2023 01:04:47 -0400 Subject: [PATCH 07/17] update schema --- .../params/tests/test_update_asset_params.rs | 3 +- schemas/mars-params/mars-params.json | 1116 ----------------- .../mars-swapper-osmosis.json | 514 -------- 3 files changed, 1 insertion(+), 1632 deletions(-) delete mode 100644 schemas/mars-params/mars-params.json delete mode 100644 schemas/mars-swapper-osmosis/mars-swapper-osmosis.json diff --git a/contracts/params/tests/test_update_asset_params.rs b/contracts/params/tests/test_update_asset_params.rs index 5b1ef69b6..821ef8eab 100644 --- a/contracts/params/tests/test_update_asset_params.rs +++ b/contracts/params/tests/test_update_asset_params.rs @@ -16,13 +16,12 @@ fn initial_state_of_params() { #[test] fn only_owner_can_update_asset_params() { let mut mock = MockEnv::new().build().unwrap(); - let params = default_asset_params(); let bad_guy = Addr::unchecked("doctor_otto_983"); let res = mock.update_asset_params( &bad_guy, AssetParamsUpdate::AddOrUpdate { denom: "xyz".to_string(), - params: params.clone(), + params: default_asset_params(), }, ); assert_err(res, Owner(OwnerError::NotOwner {})); diff --git a/schemas/mars-params/mars-params.json b/schemas/mars-params/mars-params.json deleted file mode 100644 index f02a5d2ab..000000000 --- a/schemas/mars-params/mars-params.json +++ /dev/null @@ -1,1116 +0,0 @@ -{ - "contract_name": "mars-params", - "contract_version": "1.0.0", - "idl_version": "1.0.0", - "instantiate": { - "$schema": "http://json-schema.org/draft-07/schema#", - "title": "InstantiateMsg", - "type": "object", - "required": [ - "max_close_factor", - "owner" - ], - "properties": { - "max_close_factor": { - "description": "The maximum percent a liquidator can decrease the debt amount of the liquidatee", - "allOf": [ - { - "$ref": "#/definitions/Decimal" - } - ] - }, - "owner": { - "description": "Contract's owner", - "type": "string" - } - }, - "additionalProperties": false, - "definitions": { - "Decimal": { - "description": "A fixed-point decimal value with 18 fractional digits, i.e. Decimal(1_000_000_000_000_000_000) == 1.0\n\nThe greatest possible value that can be represented is 340282366920938463463.374607431768211455 (which is (2^128 - 1) / 10^18)", - "type": "string" - } - } - }, - "execute": { - "$schema": "http://json-schema.org/draft-07/schema#", - "title": "ExecuteMsg", - "oneOf": [ - { - "type": "object", - "required": [ - "update_owner" - ], - "properties": { - "update_owner": { - "$ref": "#/definitions/OwnerUpdate" - } - }, - "additionalProperties": false - }, - { - "type": "object", - "required": [ - "update_max_close_factor" - ], - "properties": { - "update_max_close_factor": { - "$ref": "#/definitions/Decimal" - } - }, - "additionalProperties": false - }, - { - "type": "object", - "required": [ - "update_asset_params" - ], - "properties": { - "update_asset_params": { - "$ref": "#/definitions/AssetParamsUpdate" - } - }, - "additionalProperties": false - }, - { - "type": "object", - "required": [ - "update_vault_config" - ], - "properties": { - "update_vault_config": { - "$ref": "#/definitions/VaultConfigUpdate" - } - }, - "additionalProperties": false - }, - { - "type": "object", - "required": [ - "emergency_update" - ], - "properties": { - "emergency_update": { - "$ref": "#/definitions/EmergencyUpdate" - } - }, - "additionalProperties": false - } - ], - "definitions": { - "AssetParams": { - "type": "object", - "required": [ - "interest_rate_model", - "liquidation_bonus", - "liquidation_threshold", - "max_loan_to_value", - "permissions", - "red_bank_deposit_cap", - "reserve_factor" - ], - "properties": { - "interest_rate_model": { - "$ref": "#/definitions/InterestRateModel" - }, - "liquidation_bonus": { - "$ref": "#/definitions/Decimal" - }, - "liquidation_threshold": { - "$ref": "#/definitions/Decimal" - }, - "max_loan_to_value": { - "$ref": "#/definitions/Decimal" - }, - "permissions": { - "$ref": "#/definitions/AssetPermissions" - }, - "red_bank_deposit_cap": { - "$ref": "#/definitions/Uint128" - }, - "reserve_factor": { - "$ref": "#/definitions/Decimal" - } - }, - "additionalProperties": false - }, - "AssetParamsUpdate": { - "oneOf": [ - { - "type": "object", - "required": [ - "add_or_update" - ], - "properties": { - "add_or_update": { - "type": "object", - "required": [ - "denom", - "params" - ], - "properties": { - "denom": { - "type": "string" - }, - "params": { - "$ref": "#/definitions/AssetParams" - } - }, - "additionalProperties": false - } - }, - "additionalProperties": false - }, - { - "type": "object", - "required": [ - "remove" - ], - "properties": { - "remove": { - "type": "object", - "required": [ - "denom" - ], - "properties": { - "denom": { - "type": "string" - } - }, - "additionalProperties": false - } - }, - "additionalProperties": false - } - ] - }, - "AssetPermissions": { - "type": "object", - "required": [ - "red_bank", - "rover" - ], - "properties": { - "red_bank": { - "$ref": "#/definitions/RedBankPermissions" - }, - "rover": { - "$ref": "#/definitions/RoverPermissions" - } - }, - "additionalProperties": false - }, - "Coin": { - "type": "object", - "required": [ - "amount", - "denom" - ], - "properties": { - "amount": { - "$ref": "#/definitions/Uint128" - }, - "denom": { - "type": "string" - } - } - }, - "Decimal": { - "description": "A fixed-point decimal value with 18 fractional digits, i.e. Decimal(1_000_000_000_000_000_000) == 1.0\n\nThe greatest possible value that can be represented is 340282366920938463463.374607431768211455 (which is (2^128 - 1) / 10^18)", - "type": "string" - }, - "EmergencyUpdate": { - "oneOf": [ - { - "type": "object", - "required": [ - "rover" - ], - "properties": { - "rover": { - "$ref": "#/definitions/RoverEmergencyUpdate" - } - }, - "additionalProperties": false - }, - { - "type": "object", - "required": [ - "red_bank" - ], - "properties": { - "red_bank": { - "$ref": "#/definitions/RedBankEmergencyUpdate" - } - }, - "additionalProperties": false - } - ] - }, - "InterestRateModel": { - "type": "object", - "required": [ - "base", - "optimal_utilization_rate", - "slope_1", - "slope_2" - ], - "properties": { - "base": { - "description": "Base rate", - "allOf": [ - { - "$ref": "#/definitions/Decimal" - } - ] - }, - "optimal_utilization_rate": { - "description": "Optimal utilization rate", - "allOf": [ - { - "$ref": "#/definitions/Decimal" - } - ] - }, - "slope_1": { - "description": "Slope parameter for interest rate model function when utilization_rate < optimal_utilization_rate", - "allOf": [ - { - "$ref": "#/definitions/Decimal" - } - ] - }, - "slope_2": { - "description": "Slope parameter for interest rate model function when utilization_rate >= optimal_utilization_rate", - "allOf": [ - { - "$ref": "#/definitions/Decimal" - } - ] - } - }, - "additionalProperties": false - }, - "OwnerUpdate": { - "oneOf": [ - { - "description": "Proposes a new owner to take role. Only current owner can execute.", - "type": "object", - "required": [ - "propose_new_owner" - ], - "properties": { - "propose_new_owner": { - "type": "object", - "required": [ - "proposed" - ], - "properties": { - "proposed": { - "type": "string" - } - }, - "additionalProperties": false - } - }, - "additionalProperties": false - }, - { - "description": "Clears the currently proposed owner. Only current owner can execute.", - "type": "string", - "enum": [ - "clear_proposed" - ] - }, - { - "description": "Promotes the proposed owner to be the current one. Only the proposed owner can execute.", - "type": "string", - "enum": [ - "accept_proposed" - ] - }, - { - "description": "Throws away the keys to the Owner role forever. Once done, no owner can ever be set later.", - "type": "string", - "enum": [ - "abolish_owner_role" - ] - }, - { - "description": "A separate entity managed by Owner that can be used for granting specific emergency powers.", - "type": "object", - "required": [ - "set_emergency_owner" - ], - "properties": { - "set_emergency_owner": { - "type": "object", - "required": [ - "emergency_owner" - ], - "properties": { - "emergency_owner": { - "type": "string" - } - }, - "additionalProperties": false - } - }, - "additionalProperties": false - }, - { - "description": "Remove the entity in the Emergency Owner role", - "type": "string", - "enum": [ - "clear_emergency_owner" - ] - } - ] - }, - "RedBankEmergencyUpdate": { - "oneOf": [ - { - "type": "object", - "required": [ - "disable_borrowing" - ], - "properties": { - "disable_borrowing": { - "type": "string" - } - }, - "additionalProperties": false - } - ] - }, - "RedBankPermissions": { - "type": "object", - "required": [ - "borrow_enabled", - "deposit_enabled" - ], - "properties": { - "borrow_enabled": { - "type": "boolean" - }, - "deposit_enabled": { - "type": "boolean" - } - }, - "additionalProperties": false - }, - "RoverEmergencyUpdate": { - "oneOf": [ - { - "type": "object", - "required": [ - "set_zero_max_ltv_on_vault" - ], - "properties": { - "set_zero_max_ltv_on_vault": { - "type": "string" - } - }, - "additionalProperties": false - }, - { - "type": "object", - "required": [ - "set_zero_deposit_cap_on_vault" - ], - "properties": { - "set_zero_deposit_cap_on_vault": { - "type": "string" - } - }, - "additionalProperties": false - }, - { - "type": "object", - "required": [ - "disallow_coin" - ], - "properties": { - "disallow_coin": { - "type": "string" - } - }, - "additionalProperties": false - } - ] - }, - "RoverPermissions": { - "type": "object", - "required": [ - "whitelisted" - ], - "properties": { - "whitelisted": { - "type": "boolean" - } - }, - "additionalProperties": false - }, - "Uint128": { - "description": "A thin wrapper around u128 that is using strings for JSON encoding/decoding, such that the full u128 range can be used for clients that convert JSON numbers to floats, like JavaScript and jq.\n\n# Examples\n\nUse `from` to create instances of this and `u128` to get the value out:\n\n``` # use cosmwasm_std::Uint128; let a = Uint128::from(123u128); assert_eq!(a.u128(), 123);\n\nlet b = Uint128::from(42u64); assert_eq!(b.u128(), 42);\n\nlet c = Uint128::from(70u32); assert_eq!(c.u128(), 70); ```", - "type": "string" - }, - "VaultConfig": { - "type": "object", - "required": [ - "deposit_cap", - "liquidation_threshold", - "max_loan_to_value", - "whitelisted" - ], - "properties": { - "deposit_cap": { - "$ref": "#/definitions/Coin" - }, - "liquidation_threshold": { - "$ref": "#/definitions/Decimal" - }, - "max_loan_to_value": { - "$ref": "#/definitions/Decimal" - }, - "whitelisted": { - "type": "boolean" - } - }, - "additionalProperties": false - }, - "VaultConfigUpdate": { - "oneOf": [ - { - "type": "object", - "required": [ - "add_or_update" - ], - "properties": { - "add_or_update": { - "type": "object", - "required": [ - "addr", - "config" - ], - "properties": { - "addr": { - "type": "string" - }, - "config": { - "$ref": "#/definitions/VaultConfig" - } - }, - "additionalProperties": false - } - }, - "additionalProperties": false - }, - { - "type": "object", - "required": [ - "remove" - ], - "properties": { - "remove": { - "type": "object", - "required": [ - "addr" - ], - "properties": { - "addr": { - "type": "string" - } - }, - "additionalProperties": false - } - }, - "additionalProperties": false - } - ] - } - } - }, - "query": { - "$schema": "http://json-schema.org/draft-07/schema#", - "title": "QueryMsg", - "oneOf": [ - { - "type": "object", - "required": [ - "owner" - ], - "properties": { - "owner": { - "type": "object", - "additionalProperties": false - } - }, - "additionalProperties": false - }, - { - "type": "object", - "required": [ - "asset_params" - ], - "properties": { - "asset_params": { - "type": "object", - "required": [ - "denom" - ], - "properties": { - "denom": { - "type": "string" - } - }, - "additionalProperties": false - } - }, - "additionalProperties": false - }, - { - "type": "object", - "required": [ - "all_asset_params" - ], - "properties": { - "all_asset_params": { - "type": "object", - "properties": { - "limit": { - "type": [ - "integer", - "null" - ], - "format": "uint32", - "minimum": 0.0 - }, - "start_after": { - "type": [ - "string", - "null" - ] - } - }, - "additionalProperties": false - } - }, - "additionalProperties": false - }, - { - "type": "object", - "required": [ - "vault_config" - ], - "properties": { - "vault_config": { - "type": "object", - "required": [ - "address" - ], - "properties": { - "address": { - "description": "Address of vault", - "type": "string" - } - }, - "additionalProperties": false - } - }, - "additionalProperties": false - }, - { - "type": "object", - "required": [ - "all_vault_configs" - ], - "properties": { - "all_vault_configs": { - "type": "object", - "properties": { - "limit": { - "type": [ - "integer", - "null" - ], - "format": "uint32", - "minimum": 0.0 - }, - "start_after": { - "type": [ - "string", - "null" - ] - } - }, - "additionalProperties": false - } - }, - "additionalProperties": false - }, - { - "type": "object", - "required": [ - "max_close_factor" - ], - "properties": { - "max_close_factor": { - "type": "object", - "additionalProperties": false - } - }, - "additionalProperties": false - } - ] - }, - "migrate": null, - "sudo": null, - "responses": { - "all_asset_params": { - "$schema": "http://json-schema.org/draft-07/schema#", - "title": "Array_of_AssetParamsResponse", - "type": "array", - "items": { - "$ref": "#/definitions/AssetParamsResponse" - }, - "definitions": { - "AssetParams": { - "type": "object", - "required": [ - "interest_rate_model", - "liquidation_bonus", - "liquidation_threshold", - "max_loan_to_value", - "permissions", - "red_bank_deposit_cap", - "reserve_factor" - ], - "properties": { - "interest_rate_model": { - "$ref": "#/definitions/InterestRateModel" - }, - "liquidation_bonus": { - "$ref": "#/definitions/Decimal" - }, - "liquidation_threshold": { - "$ref": "#/definitions/Decimal" - }, - "max_loan_to_value": { - "$ref": "#/definitions/Decimal" - }, - "permissions": { - "$ref": "#/definitions/AssetPermissions" - }, - "red_bank_deposit_cap": { - "$ref": "#/definitions/Uint128" - }, - "reserve_factor": { - "$ref": "#/definitions/Decimal" - } - }, - "additionalProperties": false - }, - "AssetParamsResponse": { - "type": "object", - "required": [ - "denom", - "params" - ], - "properties": { - "denom": { - "type": "string" - }, - "params": { - "$ref": "#/definitions/AssetParams" - } - }, - "additionalProperties": false - }, - "AssetPermissions": { - "type": "object", - "required": [ - "red_bank", - "rover" - ], - "properties": { - "red_bank": { - "$ref": "#/definitions/RedBankPermissions" - }, - "rover": { - "$ref": "#/definitions/RoverPermissions" - } - }, - "additionalProperties": false - }, - "Decimal": { - "description": "A fixed-point decimal value with 18 fractional digits, i.e. Decimal(1_000_000_000_000_000_000) == 1.0\n\nThe greatest possible value that can be represented is 340282366920938463463.374607431768211455 (which is (2^128 - 1) / 10^18)", - "type": "string" - }, - "InterestRateModel": { - "type": "object", - "required": [ - "base", - "optimal_utilization_rate", - "slope_1", - "slope_2" - ], - "properties": { - "base": { - "description": "Base rate", - "allOf": [ - { - "$ref": "#/definitions/Decimal" - } - ] - }, - "optimal_utilization_rate": { - "description": "Optimal utilization rate", - "allOf": [ - { - "$ref": "#/definitions/Decimal" - } - ] - }, - "slope_1": { - "description": "Slope parameter for interest rate model function when utilization_rate < optimal_utilization_rate", - "allOf": [ - { - "$ref": "#/definitions/Decimal" - } - ] - }, - "slope_2": { - "description": "Slope parameter for interest rate model function when utilization_rate >= optimal_utilization_rate", - "allOf": [ - { - "$ref": "#/definitions/Decimal" - } - ] - } - }, - "additionalProperties": false - }, - "RedBankPermissions": { - "type": "object", - "required": [ - "borrow_enabled", - "deposit_enabled" - ], - "properties": { - "borrow_enabled": { - "type": "boolean" - }, - "deposit_enabled": { - "type": "boolean" - } - }, - "additionalProperties": false - }, - "RoverPermissions": { - "type": "object", - "required": [ - "whitelisted" - ], - "properties": { - "whitelisted": { - "type": "boolean" - } - }, - "additionalProperties": false - }, - "Uint128": { - "description": "A thin wrapper around u128 that is using strings for JSON encoding/decoding, such that the full u128 range can be used for clients that convert JSON numbers to floats, like JavaScript and jq.\n\n# Examples\n\nUse `from` to create instances of this and `u128` to get the value out:\n\n``` # use cosmwasm_std::Uint128; let a = Uint128::from(123u128); assert_eq!(a.u128(), 123);\n\nlet b = Uint128::from(42u64); assert_eq!(b.u128(), 42);\n\nlet c = Uint128::from(70u32); assert_eq!(c.u128(), 70); ```", - "type": "string" - } - } - }, - "all_vault_configs": { - "$schema": "http://json-schema.org/draft-07/schema#", - "title": "Array_of_VaultConfig", - "type": "array", - "items": { - "$ref": "#/definitions/VaultConfig" - }, - "definitions": { - "Coin": { - "type": "object", - "required": [ - "amount", - "denom" - ], - "properties": { - "amount": { - "$ref": "#/definitions/Uint128" - }, - "denom": { - "type": "string" - } - } - }, - "Decimal": { - "description": "A fixed-point decimal value with 18 fractional digits, i.e. Decimal(1_000_000_000_000_000_000) == 1.0\n\nThe greatest possible value that can be represented is 340282366920938463463.374607431768211455 (which is (2^128 - 1) / 10^18)", - "type": "string" - }, - "Uint128": { - "description": "A thin wrapper around u128 that is using strings for JSON encoding/decoding, such that the full u128 range can be used for clients that convert JSON numbers to floats, like JavaScript and jq.\n\n# Examples\n\nUse `from` to create instances of this and `u128` to get the value out:\n\n``` # use cosmwasm_std::Uint128; let a = Uint128::from(123u128); assert_eq!(a.u128(), 123);\n\nlet b = Uint128::from(42u64); assert_eq!(b.u128(), 42);\n\nlet c = Uint128::from(70u32); assert_eq!(c.u128(), 70); ```", - "type": "string" - }, - "VaultConfig": { - "type": "object", - "required": [ - "deposit_cap", - "liquidation_threshold", - "max_loan_to_value", - "whitelisted" - ], - "properties": { - "deposit_cap": { - "$ref": "#/definitions/Coin" - }, - "liquidation_threshold": { - "$ref": "#/definitions/Decimal" - }, - "max_loan_to_value": { - "$ref": "#/definitions/Decimal" - }, - "whitelisted": { - "type": "boolean" - } - }, - "additionalProperties": false - } - } - }, - "asset_params": { - "$schema": "http://json-schema.org/draft-07/schema#", - "title": "AssetParams", - "type": "object", - "required": [ - "interest_rate_model", - "liquidation_bonus", - "liquidation_threshold", - "max_loan_to_value", - "permissions", - "red_bank_deposit_cap", - "reserve_factor" - ], - "properties": { - "interest_rate_model": { - "$ref": "#/definitions/InterestRateModel" - }, - "liquidation_bonus": { - "$ref": "#/definitions/Decimal" - }, - "liquidation_threshold": { - "$ref": "#/definitions/Decimal" - }, - "max_loan_to_value": { - "$ref": "#/definitions/Decimal" - }, - "permissions": { - "$ref": "#/definitions/AssetPermissions" - }, - "red_bank_deposit_cap": { - "$ref": "#/definitions/Uint128" - }, - "reserve_factor": { - "$ref": "#/definitions/Decimal" - } - }, - "additionalProperties": false, - "definitions": { - "AssetPermissions": { - "type": "object", - "required": [ - "red_bank", - "rover" - ], - "properties": { - "red_bank": { - "$ref": "#/definitions/RedBankPermissions" - }, - "rover": { - "$ref": "#/definitions/RoverPermissions" - } - }, - "additionalProperties": false - }, - "Decimal": { - "description": "A fixed-point decimal value with 18 fractional digits, i.e. Decimal(1_000_000_000_000_000_000) == 1.0\n\nThe greatest possible value that can be represented is 340282366920938463463.374607431768211455 (which is (2^128 - 1) / 10^18)", - "type": "string" - }, - "InterestRateModel": { - "type": "object", - "required": [ - "base", - "optimal_utilization_rate", - "slope_1", - "slope_2" - ], - "properties": { - "base": { - "description": "Base rate", - "allOf": [ - { - "$ref": "#/definitions/Decimal" - } - ] - }, - "optimal_utilization_rate": { - "description": "Optimal utilization rate", - "allOf": [ - { - "$ref": "#/definitions/Decimal" - } - ] - }, - "slope_1": { - "description": "Slope parameter for interest rate model function when utilization_rate < optimal_utilization_rate", - "allOf": [ - { - "$ref": "#/definitions/Decimal" - } - ] - }, - "slope_2": { - "description": "Slope parameter for interest rate model function when utilization_rate >= optimal_utilization_rate", - "allOf": [ - { - "$ref": "#/definitions/Decimal" - } - ] - } - }, - "additionalProperties": false - }, - "RedBankPermissions": { - "type": "object", - "required": [ - "borrow_enabled", - "deposit_enabled" - ], - "properties": { - "borrow_enabled": { - "type": "boolean" - }, - "deposit_enabled": { - "type": "boolean" - } - }, - "additionalProperties": false - }, - "RoverPermissions": { - "type": "object", - "required": [ - "whitelisted" - ], - "properties": { - "whitelisted": { - "type": "boolean" - } - }, - "additionalProperties": false - }, - "Uint128": { - "description": "A thin wrapper around u128 that is using strings for JSON encoding/decoding, such that the full u128 range can be used for clients that convert JSON numbers to floats, like JavaScript and jq.\n\n# Examples\n\nUse `from` to create instances of this and `u128` to get the value out:\n\n``` # use cosmwasm_std::Uint128; let a = Uint128::from(123u128); assert_eq!(a.u128(), 123);\n\nlet b = Uint128::from(42u64); assert_eq!(b.u128(), 42);\n\nlet c = Uint128::from(70u32); assert_eq!(c.u128(), 70); ```", - "type": "string" - } - } - }, - "max_close_factor": { - "$schema": "http://json-schema.org/draft-07/schema#", - "title": "Decimal", - "description": "A fixed-point decimal value with 18 fractional digits, i.e. Decimal(1_000_000_000_000_000_000) == 1.0\n\nThe greatest possible value that can be represented is 340282366920938463463.374607431768211455 (which is (2^128 - 1) / 10^18)", - "type": "string" - }, - "owner": { - "$schema": "http://json-schema.org/draft-07/schema#", - "title": "OwnerResponse", - "description": "Returned from Owner.query()", - "type": "object", - "required": [ - "abolished", - "initialized" - ], - "properties": { - "abolished": { - "type": "boolean" - }, - "emergency_owner": { - "type": [ - "string", - "null" - ] - }, - "initialized": { - "type": "boolean" - }, - "owner": { - "type": [ - "string", - "null" - ] - }, - "proposed": { - "type": [ - "string", - "null" - ] - } - }, - "additionalProperties": false - }, - "vault_config": { - "$schema": "http://json-schema.org/draft-07/schema#", - "title": "VaultConfig", - "type": "object", - "required": [ - "deposit_cap", - "liquidation_threshold", - "max_loan_to_value", - "whitelisted" - ], - "properties": { - "deposit_cap": { - "$ref": "#/definitions/Coin" - }, - "liquidation_threshold": { - "$ref": "#/definitions/Decimal" - }, - "max_loan_to_value": { - "$ref": "#/definitions/Decimal" - }, - "whitelisted": { - "type": "boolean" - } - }, - "additionalProperties": false, - "definitions": { - "Coin": { - "type": "object", - "required": [ - "amount", - "denom" - ], - "properties": { - "amount": { - "$ref": "#/definitions/Uint128" - }, - "denom": { - "type": "string" - } - } - }, - "Decimal": { - "description": "A fixed-point decimal value with 18 fractional digits, i.e. Decimal(1_000_000_000_000_000_000) == 1.0\n\nThe greatest possible value that can be represented is 340282366920938463463.374607431768211455 (which is (2^128 - 1) / 10^18)", - "type": "string" - }, - "Uint128": { - "description": "A thin wrapper around u128 that is using strings for JSON encoding/decoding, such that the full u128 range can be used for clients that convert JSON numbers to floats, like JavaScript and jq.\n\n# Examples\n\nUse `from` to create instances of this and `u128` to get the value out:\n\n``` # use cosmwasm_std::Uint128; let a = Uint128::from(123u128); assert_eq!(a.u128(), 123);\n\nlet b = Uint128::from(42u64); assert_eq!(b.u128(), 42);\n\nlet c = Uint128::from(70u32); assert_eq!(c.u128(), 70); ```", - "type": "string" - } - } - } - } -} diff --git a/schemas/mars-swapper-osmosis/mars-swapper-osmosis.json b/schemas/mars-swapper-osmosis/mars-swapper-osmosis.json deleted file mode 100644 index 4eab808e1..000000000 --- a/schemas/mars-swapper-osmosis/mars-swapper-osmosis.json +++ /dev/null @@ -1,514 +0,0 @@ -{ - "contract_name": "mars-swapper-osmosis", - "contract_version": "1.0.0", - "idl_version": "1.0.0", - "instantiate": { - "$schema": "http://json-schema.org/draft-07/schema#", - "title": "InstantiateMsg", - "type": "object", - "required": [ - "owner" - ], - "properties": { - "owner": { - "description": "The contract's owner, who can update config", - "type": "string" - } - }, - "additionalProperties": false - }, - "execute": { - "$schema": "http://json-schema.org/draft-07/schema#", - "title": "ExecuteMsg", - "oneOf": [ - { - "description": "Manges owner role state", - "type": "object", - "required": [ - "update_owner" - ], - "properties": { - "update_owner": { - "$ref": "#/definitions/OwnerUpdate" - } - }, - "additionalProperties": false - }, - { - "description": "Configure the route for swapping an asset\n\nThis is chain-specific, and can include parameters such as slippage tolerance and the routes for multi-step swaps", - "type": "object", - "required": [ - "set_route" - ], - "properties": { - "set_route": { - "type": "object", - "required": [ - "denom_in", - "denom_out", - "route" - ], - "properties": { - "denom_in": { - "type": "string" - }, - "denom_out": { - "type": "string" - }, - "route": { - "$ref": "#/definitions/OsmosisRoute" - } - }, - "additionalProperties": false - } - }, - "additionalProperties": false - }, - { - "description": "Perform a swapper with an exact-in amount. Requires slippage allowance %.", - "type": "object", - "required": [ - "swap_exact_in" - ], - "properties": { - "swap_exact_in": { - "type": "object", - "required": [ - "coin_in", - "denom_out", - "slippage" - ], - "properties": { - "coin_in": { - "$ref": "#/definitions/Coin" - }, - "denom_out": { - "type": "string" - }, - "slippage": { - "$ref": "#/definitions/Decimal" - } - }, - "additionalProperties": false - } - }, - "additionalProperties": false - }, - { - "description": "Send swapper results back to swapper. Also refunds extra if sent more than needed. Internal use only.", - "type": "object", - "required": [ - "transfer_result" - ], - "properties": { - "transfer_result": { - "type": "object", - "required": [ - "denom_in", - "denom_out", - "recipient" - ], - "properties": { - "denom_in": { - "type": "string" - }, - "denom_out": { - "type": "string" - }, - "recipient": { - "$ref": "#/definitions/Addr" - } - }, - "additionalProperties": false - } - }, - "additionalProperties": false - } - ], - "definitions": { - "Addr": { - "description": "A human readable address.\n\nIn Cosmos, this is typically bech32 encoded. But for multi-chain smart contracts no assumptions should be made other than being UTF-8 encoded and of reasonable length.\n\nThis type represents a validated address. It can be created in the following ways 1. Use `Addr::unchecked(input)` 2. Use `let checked: Addr = deps.api.addr_validate(input)?` 3. Use `let checked: Addr = deps.api.addr_humanize(canonical_addr)?` 4. Deserialize from JSON. This must only be done from JSON that was validated before such as a contract's state. `Addr` must not be used in messages sent by the user because this would result in unvalidated instances.\n\nThis type is immutable. If you really need to mutate it (Really? Are you sure?), create a mutable copy using `let mut mutable = Addr::to_string()` and operate on that `String` instance.", - "type": "string" - }, - "Coin": { - "type": "object", - "required": [ - "amount", - "denom" - ], - "properties": { - "amount": { - "$ref": "#/definitions/Uint128" - }, - "denom": { - "type": "string" - } - } - }, - "Decimal": { - "description": "A fixed-point decimal value with 18 fractional digits, i.e. Decimal(1_000_000_000_000_000_000) == 1.0\n\nThe greatest possible value that can be represented is 340282366920938463463.374607431768211455 (which is (2^128 - 1) / 10^18)", - "type": "string" - }, - "OsmosisRoute": { - "type": "array", - "items": { - "$ref": "#/definitions/SwapAmountInRoute" - } - }, - "OwnerUpdate": { - "oneOf": [ - { - "description": "Proposes a new owner to take role. Only current owner can execute.", - "type": "object", - "required": [ - "propose_new_owner" - ], - "properties": { - "propose_new_owner": { - "type": "object", - "required": [ - "proposed" - ], - "properties": { - "proposed": { - "type": "string" - } - }, - "additionalProperties": false - } - }, - "additionalProperties": false - }, - { - "description": "Clears the currently proposed owner. Only current owner can execute.", - "type": "string", - "enum": [ - "clear_proposed" - ] - }, - { - "description": "Promotes the proposed owner to be the current one. Only the proposed owner can execute.", - "type": "string", - "enum": [ - "accept_proposed" - ] - }, - { - "description": "Throws away the keys to the Owner role forever. Once done, no owner can ever be set later.", - "type": "string", - "enum": [ - "abolish_owner_role" - ] - }, - { - "description": "A separate entity managed by Owner that can be used for granting specific emergency powers.", - "type": "object", - "required": [ - "set_emergency_owner" - ], - "properties": { - "set_emergency_owner": { - "type": "object", - "required": [ - "emergency_owner" - ], - "properties": { - "emergency_owner": { - "type": "string" - } - }, - "additionalProperties": false - } - }, - "additionalProperties": false - }, - { - "description": "Remove the entity in the Emergency Owner role", - "type": "string", - "enum": [ - "clear_emergency_owner" - ] - } - ] - }, - "SwapAmountInRoute": { - "description": "===================== MsgSwapExactAmountIn", - "type": "object", - "required": [ - "pool_id", - "token_out_denom" - ], - "properties": { - "pool_id": { - "type": "integer", - "format": "uint64", - "minimum": 0.0 - }, - "token_out_denom": { - "type": "string" - } - } - }, - "Uint128": { - "description": "A thin wrapper around u128 that is using strings for JSON encoding/decoding, such that the full u128 range can be used for clients that convert JSON numbers to floats, like JavaScript and jq.\n\n# Examples\n\nUse `from` to create instances of this and `u128` to get the value out:\n\n``` # use cosmwasm_std::Uint128; let a = Uint128::from(123u128); assert_eq!(a.u128(), 123);\n\nlet b = Uint128::from(42u64); assert_eq!(b.u128(), 42);\n\nlet c = Uint128::from(70u32); assert_eq!(c.u128(), 70); ```", - "type": "string" - } - } - }, - "query": { - "$schema": "http://json-schema.org/draft-07/schema#", - "title": "QueryMsg", - "oneOf": [ - { - "description": "Query contract owner config", - "type": "object", - "required": [ - "owner" - ], - "properties": { - "owner": { - "type": "object", - "additionalProperties": false - } - }, - "additionalProperties": false - }, - { - "description": "Get route for swapping an input denom into an output denom", - "type": "object", - "required": [ - "route" - ], - "properties": { - "route": { - "type": "object", - "required": [ - "denom_in", - "denom_out" - ], - "properties": { - "denom_in": { - "type": "string" - }, - "denom_out": { - "type": "string" - } - }, - "additionalProperties": false - } - }, - "additionalProperties": false - }, - { - "description": "Enumerate all swapper routes", - "type": "object", - "required": [ - "routes" - ], - "properties": { - "routes": { - "type": "object", - "properties": { - "limit": { - "type": [ - "integer", - "null" - ], - "format": "uint32", - "minimum": 0.0 - }, - "start_after": { - "type": [ - "array", - "null" - ], - "items": [ - { - "type": "string" - }, - { - "type": "string" - } - ], - "maxItems": 2, - "minItems": 2 - } - }, - "additionalProperties": false - } - }, - "additionalProperties": false - }, - { - "description": "Return current spot price swapping In for Out Warning: Do not use this as an oracle price feed. Use Mars-Oracle for pricing.", - "type": "object", - "required": [ - "estimate_exact_in_swap" - ], - "properties": { - "estimate_exact_in_swap": { - "type": "object", - "required": [ - "coin_in", - "denom_out" - ], - "properties": { - "coin_in": { - "$ref": "#/definitions/Coin" - }, - "denom_out": { - "type": "string" - } - }, - "additionalProperties": false - } - }, - "additionalProperties": false - } - ], - "definitions": { - "Coin": { - "type": "object", - "required": [ - "amount", - "denom" - ], - "properties": { - "amount": { - "$ref": "#/definitions/Uint128" - }, - "denom": { - "type": "string" - } - } - }, - "Uint128": { - "description": "A thin wrapper around u128 that is using strings for JSON encoding/decoding, such that the full u128 range can be used for clients that convert JSON numbers to floats, like JavaScript and jq.\n\n# Examples\n\nUse `from` to create instances of this and `u128` to get the value out:\n\n``` # use cosmwasm_std::Uint128; let a = Uint128::from(123u128); assert_eq!(a.u128(), 123);\n\nlet b = Uint128::from(42u64); assert_eq!(b.u128(), 42);\n\nlet c = Uint128::from(70u32); assert_eq!(c.u128(), 70); ```", - "type": "string" - } - } - }, - "migrate": null, - "sudo": null, - "responses": { - "estimate_exact_in_swap": { - "$schema": "http://json-schema.org/draft-07/schema#", - "title": "EstimateExactInSwapResponse", - "type": "object", - "required": [ - "amount" - ], - "properties": { - "amount": { - "$ref": "#/definitions/Uint128" - } - }, - "additionalProperties": false, - "definitions": { - "Uint128": { - "description": "A thin wrapper around u128 that is using strings for JSON encoding/decoding, such that the full u128 range can be used for clients that convert JSON numbers to floats, like JavaScript and jq.\n\n# Examples\n\nUse `from` to create instances of this and `u128` to get the value out:\n\n``` # use cosmwasm_std::Uint128; let a = Uint128::from(123u128); assert_eq!(a.u128(), 123);\n\nlet b = Uint128::from(42u64); assert_eq!(b.u128(), 42);\n\nlet c = Uint128::from(70u32); assert_eq!(c.u128(), 70); ```", - "type": "string" - } - } - }, - "owner": { - "$schema": "http://json-schema.org/draft-07/schema#", - "title": "OwnerResponse", - "description": "Returned from Owner.query()", - "type": "object", - "required": [ - "abolished", - "initialized" - ], - "properties": { - "abolished": { - "type": "boolean" - }, - "emergency_owner": { - "type": [ - "string", - "null" - ] - }, - "initialized": { - "type": "boolean" - }, - "owner": { - "type": [ - "string", - "null" - ] - }, - "proposed": { - "type": [ - "string", - "null" - ] - } - }, - "additionalProperties": false - }, - "route": { - "$schema": "http://json-schema.org/draft-07/schema#", - "title": "RouteResponse_for_Empty", - "type": "object", - "required": [ - "denom_in", - "denom_out", - "route" - ], - "properties": { - "denom_in": { - "type": "string" - }, - "denom_out": { - "type": "string" - }, - "route": { - "$ref": "#/definitions/Empty" - } - }, - "additionalProperties": false, - "definitions": { - "Empty": { - "description": "An empty struct that serves as a placeholder in different places, such as contracts that don't set a custom message.\n\nIt is designed to be expressable in correct JSON and JSON Schema but contains no meaningful data. Previously we used enums without cases, but those cannot represented as valid JSON Schema (https://github.com/CosmWasm/cosmwasm/issues/451)", - "type": "object" - } - } - }, - "routes": { - "$schema": "http://json-schema.org/draft-07/schema#", - "title": "Array_of_RouteResponse_for_Empty", - "type": "array", - "items": { - "$ref": "#/definitions/RouteResponse_for_Empty" - }, - "definitions": { - "Empty": { - "description": "An empty struct that serves as a placeholder in different places, such as contracts that don't set a custom message.\n\nIt is designed to be expressable in correct JSON and JSON Schema but contains no meaningful data. Previously we used enums without cases, but those cannot represented as valid JSON Schema (https://github.com/CosmWasm/cosmwasm/issues/451)", - "type": "object" - }, - "RouteResponse_for_Empty": { - "type": "object", - "required": [ - "denom_in", - "denom_out", - "route" - ], - "properties": { - "denom_in": { - "type": "string" - }, - "denom_out": { - "type": "string" - }, - "route": { - "$ref": "#/definitions/Empty" - } - }, - "additionalProperties": false - } - } - } - } -} From e4b6393b06606f953520bcf2fd9f40240c6fb192 Mon Sep 17 00:00:00 2001 From: brimigs Date: Tue, 11 Apr 2023 21:48:16 -0400 Subject: [PATCH 08/17] updates --- contracts/params/src/contract.rs | 4 +- contracts/params/src/execute.rs | 4 +- contracts/params/src/types.rs | 6 +- contracts/params/tests/helpers/generator.rs | 6 +- schemas/mars-params/mars-params.json | 1095 +++++++++++++++++ .../mars-swapper-osmosis.json | 514 ++++++++ .../mars-params/MarsParams.client.ts | 2 +- .../mars-params/MarsParams.react-query.ts | 2 +- .../generated/mars-params/MarsParams.types.ts | 24 +- 9 files changed, 1630 insertions(+), 27 deletions(-) create mode 100644 schemas/mars-params/mars-params.json create mode 100644 schemas/mars-swapper-osmosis/mars-swapper-osmosis.json diff --git a/contracts/params/src/contract.rs b/contracts/params/src/contract.rs index c8403dd13..694df7bb6 100644 --- a/contracts/params/src/contract.rs +++ b/contracts/params/src/contract.rs @@ -5,7 +5,7 @@ use mars_owner::OwnerInit::SetInitialOwner; use crate::{ emergency_powers::{disable_borrowing, disallow_coin, set_zero_deposit_cap, set_zero_max_ltv}, error::ContractResult, - execute::{update_asset_params, update_max_close_factor, update_vault_config, validate_mcf}, + execute::{update_asset_params, update_max_close_factor, update_vault_config, assert_mcf}, msg::{ExecuteMsg, InstantiateMsg, QueryMsg}, query::{query_all_asset_params, query_all_vault_configs, query_vault_config}, state::{ASSET_PARAMS, MAX_CLOSE_FACTOR, OWNER}, @@ -32,7 +32,7 @@ pub fn instantiate( }, )?; - validate_mcf(msg.max_close_factor)?; + assert_mcf(msg.max_close_factor)?; MAX_CLOSE_FACTOR.save(deps.storage, &msg.max_close_factor)?; Ok(Response::default()) diff --git a/contracts/params/src/execute.rs b/contracts/params/src/execute.rs index 8fb0bf4e8..5fa4dbc82 100644 --- a/contracts/params/src/execute.rs +++ b/contracts/params/src/execute.rs @@ -17,7 +17,7 @@ pub fn update_max_close_factor( ) -> Result { OWNER.assert_owner(deps.storage, &info.sender)?; - validate_mcf(max_close_factor)?; + assert_mcf(max_close_factor)?; MAX_CLOSE_FACTOR.save(deps.storage, &max_close_factor)?; let response = Response::new() @@ -86,7 +86,7 @@ pub fn update_vault_config( Ok(response) } -pub fn validate_mcf(param_value: Decimal) -> Result<(), ValidationError> { +pub fn assert_mcf(param_value: Decimal) -> Result<(), ValidationError> { if !param_value.le(&Decimal::one()) { Err(ValidationError::InvalidParam { param_name: "max-close-factor".to_string(), diff --git a/contracts/params/src/types.rs b/contracts/params/src/types.rs index b00386ae1..683ea7dda 100644 --- a/contracts/params/src/types.rs +++ b/contracts/params/src/types.rs @@ -14,15 +14,16 @@ pub struct RoverPermissions { } #[cw_serde] -pub struct RedBankPermissions { +pub struct RedBankSettings { pub deposit_enabled: bool, pub borrow_enabled: bool, + pub deposit_cap: Uint128, } #[cw_serde] pub struct AssetPermissions { pub rover: RoverPermissions, - pub red_bank: RedBankPermissions, + pub red_bank: RedBankSettings, } #[cw_serde] @@ -31,7 +32,6 @@ pub struct AssetParams { pub max_loan_to_value: Decimal, pub liquidation_threshold: Decimal, pub liquidation_bonus: Decimal, - pub red_bank_deposit_cap: Uint128, pub interest_rate_model: InterestRateModel, pub reserve_factor: Decimal, } diff --git a/contracts/params/tests/helpers/generator.rs b/contracts/params/tests/helpers/generator.rs index 9f76fff37..59b0c0228 100644 --- a/contracts/params/tests/helpers/generator.rs +++ b/contracts/params/tests/helpers/generator.rs @@ -2,7 +2,7 @@ use std::str::FromStr; use cosmwasm_std::{coin, Decimal, Uint128}; use mars_params::types::{ - AssetParams, AssetPermissions, RedBankPermissions, RoverPermissions, VaultConfig, + AssetParams, AssetPermissions, RedBankSettings, RoverPermissions, VaultConfig, }; use mars_red_bank_types::red_bank::InterestRateModel; @@ -12,15 +12,15 @@ pub fn default_asset_params() -> AssetParams { rover: RoverPermissions { whitelisted: false, }, - red_bank: RedBankPermissions { + red_bank: RedBankSettings { deposit_enabled: true, borrow_enabled: false, + deposit_cap: Uint128::new(1_000_000_000), }, }, max_loan_to_value: Decimal::from_str("0.6").unwrap(), liquidation_threshold: Decimal::from_str("0.7").unwrap(), liquidation_bonus: Decimal::from_str("0.15").unwrap(), - red_bank_deposit_cap: Uint128::new(1_000_000_000), interest_rate_model: InterestRateModel { optimal_utilization_rate: Decimal::from_str("0.6").unwrap(), base: Decimal::zero(), diff --git a/schemas/mars-params/mars-params.json b/schemas/mars-params/mars-params.json new file mode 100644 index 000000000..caea24d9a --- /dev/null +++ b/schemas/mars-params/mars-params.json @@ -0,0 +1,1095 @@ +{ + "contract_name": "mars-params", + "contract_version": "1.0.0", + "idl_version": "1.0.0", + "instantiate": { + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "InstantiateMsg", + "type": "object", + "required": [ + "max_close_factor", + "owner" + ], + "properties": { + "max_close_factor": { + "description": "The maximum percent a liquidator can decrease the debt amount of the liquidatee", + "allOf": [ + { + "$ref": "#/definitions/Decimal" + } + ] + }, + "owner": { + "description": "Contract's owner", + "type": "string" + } + }, + "additionalProperties": false, + "definitions": { + "Decimal": { + "description": "A fixed-point decimal value with 18 fractional digits, i.e. Decimal(1_000_000_000_000_000_000) == 1.0\n\nThe greatest possible value that can be represented is 340282366920938463463.374607431768211455 (which is (2^128 - 1) / 10^18)", + "type": "string" + } + } + }, + "execute": { + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "ExecuteMsg", + "oneOf": [ + { + "type": "object", + "required": [ + "update_owner" + ], + "properties": { + "update_owner": { + "$ref": "#/definitions/OwnerUpdate" + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "update_max_close_factor" + ], + "properties": { + "update_max_close_factor": { + "$ref": "#/definitions/Decimal" + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "update_asset_params" + ], + "properties": { + "update_asset_params": { + "$ref": "#/definitions/AssetParamsUpdate" + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "update_vault_config" + ], + "properties": { + "update_vault_config": { + "$ref": "#/definitions/VaultConfigUpdate" + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "emergency_update" + ], + "properties": { + "emergency_update": { + "$ref": "#/definitions/EmergencyUpdate" + } + }, + "additionalProperties": false + } + ], + "definitions": { + "AssetParams": { + "type": "object", + "required": [ + "interest_rate_model", + "liquidation_bonus", + "liquidation_threshold", + "max_loan_to_value", + "permissions", + "reserve_factor" + ], + "properties": { + "interest_rate_model": { + "$ref": "#/definitions/InterestRateModel" + }, + "liquidation_bonus": { + "$ref": "#/definitions/Decimal" + }, + "liquidation_threshold": { + "$ref": "#/definitions/Decimal" + }, + "max_loan_to_value": { + "$ref": "#/definitions/Decimal" + }, + "permissions": { + "$ref": "#/definitions/AssetPermissions" + }, + "reserve_factor": { + "$ref": "#/definitions/Decimal" + } + }, + "additionalProperties": false + }, + "AssetParamsUpdate": { + "oneOf": [ + { + "type": "object", + "required": [ + "add_or_update" + ], + "properties": { + "add_or_update": { + "type": "object", + "required": [ + "denom", + "params" + ], + "properties": { + "denom": { + "type": "string" + }, + "params": { + "$ref": "#/definitions/AssetParams" + } + }, + "additionalProperties": false + } + }, + "additionalProperties": false + } + ] + }, + "AssetPermissions": { + "type": "object", + "required": [ + "red_bank", + "rover" + ], + "properties": { + "red_bank": { + "$ref": "#/definitions/RedBankSettings" + }, + "rover": { + "$ref": "#/definitions/RoverPermissions" + } + }, + "additionalProperties": false + }, + "Coin": { + "type": "object", + "required": [ + "amount", + "denom" + ], + "properties": { + "amount": { + "$ref": "#/definitions/Uint128" + }, + "denom": { + "type": "string" + } + } + }, + "Decimal": { + "description": "A fixed-point decimal value with 18 fractional digits, i.e. Decimal(1_000_000_000_000_000_000) == 1.0\n\nThe greatest possible value that can be represented is 340282366920938463463.374607431768211455 (which is (2^128 - 1) / 10^18)", + "type": "string" + }, + "EmergencyUpdate": { + "oneOf": [ + { + "type": "object", + "required": [ + "rover" + ], + "properties": { + "rover": { + "$ref": "#/definitions/RoverEmergencyUpdate" + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "red_bank" + ], + "properties": { + "red_bank": { + "$ref": "#/definitions/RedBankEmergencyUpdate" + } + }, + "additionalProperties": false + } + ] + }, + "InterestRateModel": { + "type": "object", + "required": [ + "base", + "optimal_utilization_rate", + "slope_1", + "slope_2" + ], + "properties": { + "base": { + "description": "Base rate", + "allOf": [ + { + "$ref": "#/definitions/Decimal" + } + ] + }, + "optimal_utilization_rate": { + "description": "Optimal utilization rate", + "allOf": [ + { + "$ref": "#/definitions/Decimal" + } + ] + }, + "slope_1": { + "description": "Slope parameter for interest rate model function when utilization_rate < optimal_utilization_rate", + "allOf": [ + { + "$ref": "#/definitions/Decimal" + } + ] + }, + "slope_2": { + "description": "Slope parameter for interest rate model function when utilization_rate >= optimal_utilization_rate", + "allOf": [ + { + "$ref": "#/definitions/Decimal" + } + ] + } + }, + "additionalProperties": false + }, + "OwnerUpdate": { + "oneOf": [ + { + "description": "Proposes a new owner to take role. Only current owner can execute.", + "type": "object", + "required": [ + "propose_new_owner" + ], + "properties": { + "propose_new_owner": { + "type": "object", + "required": [ + "proposed" + ], + "properties": { + "proposed": { + "type": "string" + } + }, + "additionalProperties": false + } + }, + "additionalProperties": false + }, + { + "description": "Clears the currently proposed owner. Only current owner can execute.", + "type": "string", + "enum": [ + "clear_proposed" + ] + }, + { + "description": "Promotes the proposed owner to be the current one. Only the proposed owner can execute.", + "type": "string", + "enum": [ + "accept_proposed" + ] + }, + { + "description": "Throws away the keys to the Owner role forever. Once done, no owner can ever be set later.", + "type": "string", + "enum": [ + "abolish_owner_role" + ] + }, + { + "description": "A separate entity managed by Owner that can be used for granting specific emergency powers.", + "type": "object", + "required": [ + "set_emergency_owner" + ], + "properties": { + "set_emergency_owner": { + "type": "object", + "required": [ + "emergency_owner" + ], + "properties": { + "emergency_owner": { + "type": "string" + } + }, + "additionalProperties": false + } + }, + "additionalProperties": false + }, + { + "description": "Remove the entity in the Emergency Owner role", + "type": "string", + "enum": [ + "clear_emergency_owner" + ] + } + ] + }, + "RedBankEmergencyUpdate": { + "oneOf": [ + { + "type": "object", + "required": [ + "disable_borrowing" + ], + "properties": { + "disable_borrowing": { + "type": "string" + } + }, + "additionalProperties": false + } + ] + }, + "RedBankSettings": { + "type": "object", + "required": [ + "borrow_enabled", + "deposit_cap", + "deposit_enabled" + ], + "properties": { + "borrow_enabled": { + "type": "boolean" + }, + "deposit_cap": { + "$ref": "#/definitions/Uint128" + }, + "deposit_enabled": { + "type": "boolean" + } + }, + "additionalProperties": false + }, + "RoverEmergencyUpdate": { + "oneOf": [ + { + "type": "object", + "required": [ + "set_zero_max_ltv_on_vault" + ], + "properties": { + "set_zero_max_ltv_on_vault": { + "type": "string" + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "set_zero_deposit_cap_on_vault" + ], + "properties": { + "set_zero_deposit_cap_on_vault": { + "type": "string" + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "disallow_coin" + ], + "properties": { + "disallow_coin": { + "type": "string" + } + }, + "additionalProperties": false + } + ] + }, + "RoverPermissions": { + "type": "object", + "required": [ + "whitelisted" + ], + "properties": { + "whitelisted": { + "type": "boolean" + } + }, + "additionalProperties": false + }, + "Uint128": { + "description": "A thin wrapper around u128 that is using strings for JSON encoding/decoding, such that the full u128 range can be used for clients that convert JSON numbers to floats, like JavaScript and jq.\n\n# Examples\n\nUse `from` to create instances of this and `u128` to get the value out:\n\n``` # use cosmwasm_std::Uint128; let a = Uint128::from(123u128); assert_eq!(a.u128(), 123);\n\nlet b = Uint128::from(42u64); assert_eq!(b.u128(), 42);\n\nlet c = Uint128::from(70u32); assert_eq!(c.u128(), 70); ```", + "type": "string" + }, + "VaultConfig": { + "type": "object", + "required": [ + "deposit_cap", + "liquidation_threshold", + "max_loan_to_value", + "whitelisted" + ], + "properties": { + "deposit_cap": { + "$ref": "#/definitions/Coin" + }, + "liquidation_threshold": { + "$ref": "#/definitions/Decimal" + }, + "max_loan_to_value": { + "$ref": "#/definitions/Decimal" + }, + "whitelisted": { + "type": "boolean" + } + }, + "additionalProperties": false + }, + "VaultConfigUpdate": { + "oneOf": [ + { + "type": "object", + "required": [ + "add_or_update" + ], + "properties": { + "add_or_update": { + "type": "object", + "required": [ + "addr", + "config" + ], + "properties": { + "addr": { + "type": "string" + }, + "config": { + "$ref": "#/definitions/VaultConfig" + } + }, + "additionalProperties": false + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "remove" + ], + "properties": { + "remove": { + "type": "object", + "required": [ + "addr" + ], + "properties": { + "addr": { + "type": "string" + } + }, + "additionalProperties": false + } + }, + "additionalProperties": false + } + ] + } + } + }, + "query": { + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "QueryMsg", + "oneOf": [ + { + "type": "object", + "required": [ + "owner" + ], + "properties": { + "owner": { + "type": "object", + "additionalProperties": false + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "asset_params" + ], + "properties": { + "asset_params": { + "type": "object", + "required": [ + "denom" + ], + "properties": { + "denom": { + "type": "string" + } + }, + "additionalProperties": false + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "all_asset_params" + ], + "properties": { + "all_asset_params": { + "type": "object", + "properties": { + "limit": { + "type": [ + "integer", + "null" + ], + "format": "uint32", + "minimum": 0.0 + }, + "start_after": { + "type": [ + "string", + "null" + ] + } + }, + "additionalProperties": false + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "vault_config" + ], + "properties": { + "vault_config": { + "type": "object", + "required": [ + "address" + ], + "properties": { + "address": { + "description": "Address of vault", + "type": "string" + } + }, + "additionalProperties": false + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "all_vault_configs" + ], + "properties": { + "all_vault_configs": { + "type": "object", + "properties": { + "limit": { + "type": [ + "integer", + "null" + ], + "format": "uint32", + "minimum": 0.0 + }, + "start_after": { + "type": [ + "string", + "null" + ] + } + }, + "additionalProperties": false + } + }, + "additionalProperties": false + }, + { + "type": "object", + "required": [ + "max_close_factor" + ], + "properties": { + "max_close_factor": { + "type": "object", + "additionalProperties": false + } + }, + "additionalProperties": false + } + ] + }, + "migrate": null, + "sudo": null, + "responses": { + "all_asset_params": { + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "Array_of_AssetParamsResponse", + "type": "array", + "items": { + "$ref": "#/definitions/AssetParamsResponse" + }, + "definitions": { + "AssetParams": { + "type": "object", + "required": [ + "interest_rate_model", + "liquidation_bonus", + "liquidation_threshold", + "max_loan_to_value", + "permissions", + "reserve_factor" + ], + "properties": { + "interest_rate_model": { + "$ref": "#/definitions/InterestRateModel" + }, + "liquidation_bonus": { + "$ref": "#/definitions/Decimal" + }, + "liquidation_threshold": { + "$ref": "#/definitions/Decimal" + }, + "max_loan_to_value": { + "$ref": "#/definitions/Decimal" + }, + "permissions": { + "$ref": "#/definitions/AssetPermissions" + }, + "reserve_factor": { + "$ref": "#/definitions/Decimal" + } + }, + "additionalProperties": false + }, + "AssetParamsResponse": { + "type": "object", + "required": [ + "denom", + "params" + ], + "properties": { + "denom": { + "type": "string" + }, + "params": { + "$ref": "#/definitions/AssetParams" + } + }, + "additionalProperties": false + }, + "AssetPermissions": { + "type": "object", + "required": [ + "red_bank", + "rover" + ], + "properties": { + "red_bank": { + "$ref": "#/definitions/RedBankSettings" + }, + "rover": { + "$ref": "#/definitions/RoverPermissions" + } + }, + "additionalProperties": false + }, + "Decimal": { + "description": "A fixed-point decimal value with 18 fractional digits, i.e. Decimal(1_000_000_000_000_000_000) == 1.0\n\nThe greatest possible value that can be represented is 340282366920938463463.374607431768211455 (which is (2^128 - 1) / 10^18)", + "type": "string" + }, + "InterestRateModel": { + "type": "object", + "required": [ + "base", + "optimal_utilization_rate", + "slope_1", + "slope_2" + ], + "properties": { + "base": { + "description": "Base rate", + "allOf": [ + { + "$ref": "#/definitions/Decimal" + } + ] + }, + "optimal_utilization_rate": { + "description": "Optimal utilization rate", + "allOf": [ + { + "$ref": "#/definitions/Decimal" + } + ] + }, + "slope_1": { + "description": "Slope parameter for interest rate model function when utilization_rate < optimal_utilization_rate", + "allOf": [ + { + "$ref": "#/definitions/Decimal" + } + ] + }, + "slope_2": { + "description": "Slope parameter for interest rate model function when utilization_rate >= optimal_utilization_rate", + "allOf": [ + { + "$ref": "#/definitions/Decimal" + } + ] + } + }, + "additionalProperties": false + }, + "RedBankSettings": { + "type": "object", + "required": [ + "borrow_enabled", + "deposit_cap", + "deposit_enabled" + ], + "properties": { + "borrow_enabled": { + "type": "boolean" + }, + "deposit_cap": { + "$ref": "#/definitions/Uint128" + }, + "deposit_enabled": { + "type": "boolean" + } + }, + "additionalProperties": false + }, + "RoverPermissions": { + "type": "object", + "required": [ + "whitelisted" + ], + "properties": { + "whitelisted": { + "type": "boolean" + } + }, + "additionalProperties": false + }, + "Uint128": { + "description": "A thin wrapper around u128 that is using strings for JSON encoding/decoding, such that the full u128 range can be used for clients that convert JSON numbers to floats, like JavaScript and jq.\n\n# Examples\n\nUse `from` to create instances of this and `u128` to get the value out:\n\n``` # use cosmwasm_std::Uint128; let a = Uint128::from(123u128); assert_eq!(a.u128(), 123);\n\nlet b = Uint128::from(42u64); assert_eq!(b.u128(), 42);\n\nlet c = Uint128::from(70u32); assert_eq!(c.u128(), 70); ```", + "type": "string" + } + } + }, + "all_vault_configs": { + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "Array_of_VaultConfig", + "type": "array", + "items": { + "$ref": "#/definitions/VaultConfig" + }, + "definitions": { + "Coin": { + "type": "object", + "required": [ + "amount", + "denom" + ], + "properties": { + "amount": { + "$ref": "#/definitions/Uint128" + }, + "denom": { + "type": "string" + } + } + }, + "Decimal": { + "description": "A fixed-point decimal value with 18 fractional digits, i.e. Decimal(1_000_000_000_000_000_000) == 1.0\n\nThe greatest possible value that can be represented is 340282366920938463463.374607431768211455 (which is (2^128 - 1) / 10^18)", + "type": "string" + }, + "Uint128": { + "description": "A thin wrapper around u128 that is using strings for JSON encoding/decoding, such that the full u128 range can be used for clients that convert JSON numbers to floats, like JavaScript and jq.\n\n# Examples\n\nUse `from` to create instances of this and `u128` to get the value out:\n\n``` # use cosmwasm_std::Uint128; let a = Uint128::from(123u128); assert_eq!(a.u128(), 123);\n\nlet b = Uint128::from(42u64); assert_eq!(b.u128(), 42);\n\nlet c = Uint128::from(70u32); assert_eq!(c.u128(), 70); ```", + "type": "string" + }, + "VaultConfig": { + "type": "object", + "required": [ + "deposit_cap", + "liquidation_threshold", + "max_loan_to_value", + "whitelisted" + ], + "properties": { + "deposit_cap": { + "$ref": "#/definitions/Coin" + }, + "liquidation_threshold": { + "$ref": "#/definitions/Decimal" + }, + "max_loan_to_value": { + "$ref": "#/definitions/Decimal" + }, + "whitelisted": { + "type": "boolean" + } + }, + "additionalProperties": false + } + } + }, + "asset_params": { + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "AssetParams", + "type": "object", + "required": [ + "interest_rate_model", + "liquidation_bonus", + "liquidation_threshold", + "max_loan_to_value", + "permissions", + "reserve_factor" + ], + "properties": { + "interest_rate_model": { + "$ref": "#/definitions/InterestRateModel" + }, + "liquidation_bonus": { + "$ref": "#/definitions/Decimal" + }, + "liquidation_threshold": { + "$ref": "#/definitions/Decimal" + }, + "max_loan_to_value": { + "$ref": "#/definitions/Decimal" + }, + "permissions": { + "$ref": "#/definitions/AssetPermissions" + }, + "reserve_factor": { + "$ref": "#/definitions/Decimal" + } + }, + "additionalProperties": false, + "definitions": { + "AssetPermissions": { + "type": "object", + "required": [ + "red_bank", + "rover" + ], + "properties": { + "red_bank": { + "$ref": "#/definitions/RedBankSettings" + }, + "rover": { + "$ref": "#/definitions/RoverPermissions" + } + }, + "additionalProperties": false + }, + "Decimal": { + "description": "A fixed-point decimal value with 18 fractional digits, i.e. Decimal(1_000_000_000_000_000_000) == 1.0\n\nThe greatest possible value that can be represented is 340282366920938463463.374607431768211455 (which is (2^128 - 1) / 10^18)", + "type": "string" + }, + "InterestRateModel": { + "type": "object", + "required": [ + "base", + "optimal_utilization_rate", + "slope_1", + "slope_2" + ], + "properties": { + "base": { + "description": "Base rate", + "allOf": [ + { + "$ref": "#/definitions/Decimal" + } + ] + }, + "optimal_utilization_rate": { + "description": "Optimal utilization rate", + "allOf": [ + { + "$ref": "#/definitions/Decimal" + } + ] + }, + "slope_1": { + "description": "Slope parameter for interest rate model function when utilization_rate < optimal_utilization_rate", + "allOf": [ + { + "$ref": "#/definitions/Decimal" + } + ] + }, + "slope_2": { + "description": "Slope parameter for interest rate model function when utilization_rate >= optimal_utilization_rate", + "allOf": [ + { + "$ref": "#/definitions/Decimal" + } + ] + } + }, + "additionalProperties": false + }, + "RedBankSettings": { + "type": "object", + "required": [ + "borrow_enabled", + "deposit_cap", + "deposit_enabled" + ], + "properties": { + "borrow_enabled": { + "type": "boolean" + }, + "deposit_cap": { + "$ref": "#/definitions/Uint128" + }, + "deposit_enabled": { + "type": "boolean" + } + }, + "additionalProperties": false + }, + "RoverPermissions": { + "type": "object", + "required": [ + "whitelisted" + ], + "properties": { + "whitelisted": { + "type": "boolean" + } + }, + "additionalProperties": false + }, + "Uint128": { + "description": "A thin wrapper around u128 that is using strings for JSON encoding/decoding, such that the full u128 range can be used for clients that convert JSON numbers to floats, like JavaScript and jq.\n\n# Examples\n\nUse `from` to create instances of this and `u128` to get the value out:\n\n``` # use cosmwasm_std::Uint128; let a = Uint128::from(123u128); assert_eq!(a.u128(), 123);\n\nlet b = Uint128::from(42u64); assert_eq!(b.u128(), 42);\n\nlet c = Uint128::from(70u32); assert_eq!(c.u128(), 70); ```", + "type": "string" + } + } + }, + "max_close_factor": { + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "Decimal", + "description": "A fixed-point decimal value with 18 fractional digits, i.e. Decimal(1_000_000_000_000_000_000) == 1.0\n\nThe greatest possible value that can be represented is 340282366920938463463.374607431768211455 (which is (2^128 - 1) / 10^18)", + "type": "string" + }, + "owner": { + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "OwnerResponse", + "description": "Returned from Owner.query()", + "type": "object", + "required": [ + "abolished", + "initialized" + ], + "properties": { + "abolished": { + "type": "boolean" + }, + "emergency_owner": { + "type": [ + "string", + "null" + ] + }, + "initialized": { + "type": "boolean" + }, + "owner": { + "type": [ + "string", + "null" + ] + }, + "proposed": { + "type": [ + "string", + "null" + ] + } + }, + "additionalProperties": false + }, + "vault_config": { + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "VaultConfig", + "type": "object", + "required": [ + "deposit_cap", + "liquidation_threshold", + "max_loan_to_value", + "whitelisted" + ], + "properties": { + "deposit_cap": { + "$ref": "#/definitions/Coin" + }, + "liquidation_threshold": { + "$ref": "#/definitions/Decimal" + }, + "max_loan_to_value": { + "$ref": "#/definitions/Decimal" + }, + "whitelisted": { + "type": "boolean" + } + }, + "additionalProperties": false, + "definitions": { + "Coin": { + "type": "object", + "required": [ + "amount", + "denom" + ], + "properties": { + "amount": { + "$ref": "#/definitions/Uint128" + }, + "denom": { + "type": "string" + } + } + }, + "Decimal": { + "description": "A fixed-point decimal value with 18 fractional digits, i.e. Decimal(1_000_000_000_000_000_000) == 1.0\n\nThe greatest possible value that can be represented is 340282366920938463463.374607431768211455 (which is (2^128 - 1) / 10^18)", + "type": "string" + }, + "Uint128": { + "description": "A thin wrapper around u128 that is using strings for JSON encoding/decoding, such that the full u128 range can be used for clients that convert JSON numbers to floats, like JavaScript and jq.\n\n# Examples\n\nUse `from` to create instances of this and `u128` to get the value out:\n\n``` # use cosmwasm_std::Uint128; let a = Uint128::from(123u128); assert_eq!(a.u128(), 123);\n\nlet b = Uint128::from(42u64); assert_eq!(b.u128(), 42);\n\nlet c = Uint128::from(70u32); assert_eq!(c.u128(), 70); ```", + "type": "string" + } + } + } + } +} diff --git a/schemas/mars-swapper-osmosis/mars-swapper-osmosis.json b/schemas/mars-swapper-osmosis/mars-swapper-osmosis.json new file mode 100644 index 000000000..4eab808e1 --- /dev/null +++ b/schemas/mars-swapper-osmosis/mars-swapper-osmosis.json @@ -0,0 +1,514 @@ +{ + "contract_name": "mars-swapper-osmosis", + "contract_version": "1.0.0", + "idl_version": "1.0.0", + "instantiate": { + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "InstantiateMsg", + "type": "object", + "required": [ + "owner" + ], + "properties": { + "owner": { + "description": "The contract's owner, who can update config", + "type": "string" + } + }, + "additionalProperties": false + }, + "execute": { + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "ExecuteMsg", + "oneOf": [ + { + "description": "Manges owner role state", + "type": "object", + "required": [ + "update_owner" + ], + "properties": { + "update_owner": { + "$ref": "#/definitions/OwnerUpdate" + } + }, + "additionalProperties": false + }, + { + "description": "Configure the route for swapping an asset\n\nThis is chain-specific, and can include parameters such as slippage tolerance and the routes for multi-step swaps", + "type": "object", + "required": [ + "set_route" + ], + "properties": { + "set_route": { + "type": "object", + "required": [ + "denom_in", + "denom_out", + "route" + ], + "properties": { + "denom_in": { + "type": "string" + }, + "denom_out": { + "type": "string" + }, + "route": { + "$ref": "#/definitions/OsmosisRoute" + } + }, + "additionalProperties": false + } + }, + "additionalProperties": false + }, + { + "description": "Perform a swapper with an exact-in amount. Requires slippage allowance %.", + "type": "object", + "required": [ + "swap_exact_in" + ], + "properties": { + "swap_exact_in": { + "type": "object", + "required": [ + "coin_in", + "denom_out", + "slippage" + ], + "properties": { + "coin_in": { + "$ref": "#/definitions/Coin" + }, + "denom_out": { + "type": "string" + }, + "slippage": { + "$ref": "#/definitions/Decimal" + } + }, + "additionalProperties": false + } + }, + "additionalProperties": false + }, + { + "description": "Send swapper results back to swapper. Also refunds extra if sent more than needed. Internal use only.", + "type": "object", + "required": [ + "transfer_result" + ], + "properties": { + "transfer_result": { + "type": "object", + "required": [ + "denom_in", + "denom_out", + "recipient" + ], + "properties": { + "denom_in": { + "type": "string" + }, + "denom_out": { + "type": "string" + }, + "recipient": { + "$ref": "#/definitions/Addr" + } + }, + "additionalProperties": false + } + }, + "additionalProperties": false + } + ], + "definitions": { + "Addr": { + "description": "A human readable address.\n\nIn Cosmos, this is typically bech32 encoded. But for multi-chain smart contracts no assumptions should be made other than being UTF-8 encoded and of reasonable length.\n\nThis type represents a validated address. It can be created in the following ways 1. Use `Addr::unchecked(input)` 2. Use `let checked: Addr = deps.api.addr_validate(input)?` 3. Use `let checked: Addr = deps.api.addr_humanize(canonical_addr)?` 4. Deserialize from JSON. This must only be done from JSON that was validated before such as a contract's state. `Addr` must not be used in messages sent by the user because this would result in unvalidated instances.\n\nThis type is immutable. If you really need to mutate it (Really? Are you sure?), create a mutable copy using `let mut mutable = Addr::to_string()` and operate on that `String` instance.", + "type": "string" + }, + "Coin": { + "type": "object", + "required": [ + "amount", + "denom" + ], + "properties": { + "amount": { + "$ref": "#/definitions/Uint128" + }, + "denom": { + "type": "string" + } + } + }, + "Decimal": { + "description": "A fixed-point decimal value with 18 fractional digits, i.e. Decimal(1_000_000_000_000_000_000) == 1.0\n\nThe greatest possible value that can be represented is 340282366920938463463.374607431768211455 (which is (2^128 - 1) / 10^18)", + "type": "string" + }, + "OsmosisRoute": { + "type": "array", + "items": { + "$ref": "#/definitions/SwapAmountInRoute" + } + }, + "OwnerUpdate": { + "oneOf": [ + { + "description": "Proposes a new owner to take role. Only current owner can execute.", + "type": "object", + "required": [ + "propose_new_owner" + ], + "properties": { + "propose_new_owner": { + "type": "object", + "required": [ + "proposed" + ], + "properties": { + "proposed": { + "type": "string" + } + }, + "additionalProperties": false + } + }, + "additionalProperties": false + }, + { + "description": "Clears the currently proposed owner. Only current owner can execute.", + "type": "string", + "enum": [ + "clear_proposed" + ] + }, + { + "description": "Promotes the proposed owner to be the current one. Only the proposed owner can execute.", + "type": "string", + "enum": [ + "accept_proposed" + ] + }, + { + "description": "Throws away the keys to the Owner role forever. Once done, no owner can ever be set later.", + "type": "string", + "enum": [ + "abolish_owner_role" + ] + }, + { + "description": "A separate entity managed by Owner that can be used for granting specific emergency powers.", + "type": "object", + "required": [ + "set_emergency_owner" + ], + "properties": { + "set_emergency_owner": { + "type": "object", + "required": [ + "emergency_owner" + ], + "properties": { + "emergency_owner": { + "type": "string" + } + }, + "additionalProperties": false + } + }, + "additionalProperties": false + }, + { + "description": "Remove the entity in the Emergency Owner role", + "type": "string", + "enum": [ + "clear_emergency_owner" + ] + } + ] + }, + "SwapAmountInRoute": { + "description": "===================== MsgSwapExactAmountIn", + "type": "object", + "required": [ + "pool_id", + "token_out_denom" + ], + "properties": { + "pool_id": { + "type": "integer", + "format": "uint64", + "minimum": 0.0 + }, + "token_out_denom": { + "type": "string" + } + } + }, + "Uint128": { + "description": "A thin wrapper around u128 that is using strings for JSON encoding/decoding, such that the full u128 range can be used for clients that convert JSON numbers to floats, like JavaScript and jq.\n\n# Examples\n\nUse `from` to create instances of this and `u128` to get the value out:\n\n``` # use cosmwasm_std::Uint128; let a = Uint128::from(123u128); assert_eq!(a.u128(), 123);\n\nlet b = Uint128::from(42u64); assert_eq!(b.u128(), 42);\n\nlet c = Uint128::from(70u32); assert_eq!(c.u128(), 70); ```", + "type": "string" + } + } + }, + "query": { + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "QueryMsg", + "oneOf": [ + { + "description": "Query contract owner config", + "type": "object", + "required": [ + "owner" + ], + "properties": { + "owner": { + "type": "object", + "additionalProperties": false + } + }, + "additionalProperties": false + }, + { + "description": "Get route for swapping an input denom into an output denom", + "type": "object", + "required": [ + "route" + ], + "properties": { + "route": { + "type": "object", + "required": [ + "denom_in", + "denom_out" + ], + "properties": { + "denom_in": { + "type": "string" + }, + "denom_out": { + "type": "string" + } + }, + "additionalProperties": false + } + }, + "additionalProperties": false + }, + { + "description": "Enumerate all swapper routes", + "type": "object", + "required": [ + "routes" + ], + "properties": { + "routes": { + "type": "object", + "properties": { + "limit": { + "type": [ + "integer", + "null" + ], + "format": "uint32", + "minimum": 0.0 + }, + "start_after": { + "type": [ + "array", + "null" + ], + "items": [ + { + "type": "string" + }, + { + "type": "string" + } + ], + "maxItems": 2, + "minItems": 2 + } + }, + "additionalProperties": false + } + }, + "additionalProperties": false + }, + { + "description": "Return current spot price swapping In for Out Warning: Do not use this as an oracle price feed. Use Mars-Oracle for pricing.", + "type": "object", + "required": [ + "estimate_exact_in_swap" + ], + "properties": { + "estimate_exact_in_swap": { + "type": "object", + "required": [ + "coin_in", + "denom_out" + ], + "properties": { + "coin_in": { + "$ref": "#/definitions/Coin" + }, + "denom_out": { + "type": "string" + } + }, + "additionalProperties": false + } + }, + "additionalProperties": false + } + ], + "definitions": { + "Coin": { + "type": "object", + "required": [ + "amount", + "denom" + ], + "properties": { + "amount": { + "$ref": "#/definitions/Uint128" + }, + "denom": { + "type": "string" + } + } + }, + "Uint128": { + "description": "A thin wrapper around u128 that is using strings for JSON encoding/decoding, such that the full u128 range can be used for clients that convert JSON numbers to floats, like JavaScript and jq.\n\n# Examples\n\nUse `from` to create instances of this and `u128` to get the value out:\n\n``` # use cosmwasm_std::Uint128; let a = Uint128::from(123u128); assert_eq!(a.u128(), 123);\n\nlet b = Uint128::from(42u64); assert_eq!(b.u128(), 42);\n\nlet c = Uint128::from(70u32); assert_eq!(c.u128(), 70); ```", + "type": "string" + } + } + }, + "migrate": null, + "sudo": null, + "responses": { + "estimate_exact_in_swap": { + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "EstimateExactInSwapResponse", + "type": "object", + "required": [ + "amount" + ], + "properties": { + "amount": { + "$ref": "#/definitions/Uint128" + } + }, + "additionalProperties": false, + "definitions": { + "Uint128": { + "description": "A thin wrapper around u128 that is using strings for JSON encoding/decoding, such that the full u128 range can be used for clients that convert JSON numbers to floats, like JavaScript and jq.\n\n# Examples\n\nUse `from` to create instances of this and `u128` to get the value out:\n\n``` # use cosmwasm_std::Uint128; let a = Uint128::from(123u128); assert_eq!(a.u128(), 123);\n\nlet b = Uint128::from(42u64); assert_eq!(b.u128(), 42);\n\nlet c = Uint128::from(70u32); assert_eq!(c.u128(), 70); ```", + "type": "string" + } + } + }, + "owner": { + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "OwnerResponse", + "description": "Returned from Owner.query()", + "type": "object", + "required": [ + "abolished", + "initialized" + ], + "properties": { + "abolished": { + "type": "boolean" + }, + "emergency_owner": { + "type": [ + "string", + "null" + ] + }, + "initialized": { + "type": "boolean" + }, + "owner": { + "type": [ + "string", + "null" + ] + }, + "proposed": { + "type": [ + "string", + "null" + ] + } + }, + "additionalProperties": false + }, + "route": { + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "RouteResponse_for_Empty", + "type": "object", + "required": [ + "denom_in", + "denom_out", + "route" + ], + "properties": { + "denom_in": { + "type": "string" + }, + "denom_out": { + "type": "string" + }, + "route": { + "$ref": "#/definitions/Empty" + } + }, + "additionalProperties": false, + "definitions": { + "Empty": { + "description": "An empty struct that serves as a placeholder in different places, such as contracts that don't set a custom message.\n\nIt is designed to be expressable in correct JSON and JSON Schema but contains no meaningful data. Previously we used enums without cases, but those cannot represented as valid JSON Schema (https://github.com/CosmWasm/cosmwasm/issues/451)", + "type": "object" + } + } + }, + "routes": { + "$schema": "http://json-schema.org/draft-07/schema#", + "title": "Array_of_RouteResponse_for_Empty", + "type": "array", + "items": { + "$ref": "#/definitions/RouteResponse_for_Empty" + }, + "definitions": { + "Empty": { + "description": "An empty struct that serves as a placeholder in different places, such as contracts that don't set a custom message.\n\nIt is designed to be expressable in correct JSON and JSON Schema but contains no meaningful data. Previously we used enums without cases, but those cannot represented as valid JSON Schema (https://github.com/CosmWasm/cosmwasm/issues/451)", + "type": "object" + }, + "RouteResponse_for_Empty": { + "type": "object", + "required": [ + "denom_in", + "denom_out", + "route" + ], + "properties": { + "denom_in": { + "type": "string" + }, + "denom_out": { + "type": "string" + }, + "route": { + "$ref": "#/definitions/Empty" + } + }, + "additionalProperties": false + } + } + } + } +} diff --git a/scripts/types/generated/mars-params/MarsParams.client.ts b/scripts/types/generated/mars-params/MarsParams.client.ts index 4dc050b2b..7bd3a6ac1 100644 --- a/scripts/types/generated/mars-params/MarsParams.client.ts +++ b/scripts/types/generated/mars-params/MarsParams.client.ts @@ -21,7 +21,7 @@ import { AssetParams, InterestRateModel, AssetPermissions, - RedBankPermissions, + RedBankSettings, RoverPermissions, VaultConfig, Coin, diff --git a/scripts/types/generated/mars-params/MarsParams.react-query.ts b/scripts/types/generated/mars-params/MarsParams.react-query.ts index a56800393..f01e225c1 100644 --- a/scripts/types/generated/mars-params/MarsParams.react-query.ts +++ b/scripts/types/generated/mars-params/MarsParams.react-query.ts @@ -22,7 +22,7 @@ import { AssetParams, InterestRateModel, AssetPermissions, - RedBankPermissions, + RedBankSettings, RoverPermissions, VaultConfig, Coin, diff --git a/scripts/types/generated/mars-params/MarsParams.types.ts b/scripts/types/generated/mars-params/MarsParams.types.ts index 1586d56d7..c2e6c4585 100644 --- a/scripts/types/generated/mars-params/MarsParams.types.ts +++ b/scripts/types/generated/mars-params/MarsParams.types.ts @@ -41,18 +41,12 @@ export type OwnerUpdate = } } | 'clear_emergency_owner' -export type AssetParamsUpdate = - | { - add_or_update: { - denom: string - params: AssetParams - } - } - | { - remove: { - denom: string - } - } +export type AssetParamsUpdate = { + add_or_update: { + denom: string + params: AssetParams + } +} export type Uint128 = string export type VaultConfigUpdate = | { @@ -92,7 +86,6 @@ export interface AssetParams { liquidation_threshold: Decimal max_loan_to_value: Decimal permissions: AssetPermissions - red_bank_deposit_cap: Uint128 reserve_factor: Decimal } export interface InterestRateModel { @@ -102,11 +95,12 @@ export interface InterestRateModel { slope_2: Decimal } export interface AssetPermissions { - red_bank: RedBankPermissions + red_bank: RedBankSettings rover: RoverPermissions } -export interface RedBankPermissions { +export interface RedBankSettings { borrow_enabled: boolean + deposit_cap: Uint128 deposit_enabled: boolean } export interface RoverPermissions { From 2c1e57f83e48ac868781b029e37012d286c8dc6e Mon Sep 17 00:00:00 2001 From: brimigs Date: Tue, 11 Apr 2023 22:14:27 -0400 Subject: [PATCH 09/17] update tests --- contracts/params/src/contract.rs | 2 +- contracts/params/tests/test_update_asset_params.rs | 5 ++++- 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/contracts/params/src/contract.rs b/contracts/params/src/contract.rs index 694df7bb6..8e7ea0c89 100644 --- a/contracts/params/src/contract.rs +++ b/contracts/params/src/contract.rs @@ -5,7 +5,7 @@ use mars_owner::OwnerInit::SetInitialOwner; use crate::{ emergency_powers::{disable_borrowing, disallow_coin, set_zero_deposit_cap, set_zero_max_ltv}, error::ContractResult, - execute::{update_asset_params, update_max_close_factor, update_vault_config, assert_mcf}, + execute::{assert_mcf, update_asset_params, update_max_close_factor, update_vault_config}, msg::{ExecuteMsg, InstantiateMsg, QueryMsg}, query::{query_all_asset_params, query_all_vault_configs, query_vault_config}, state::{ASSET_PARAMS, MAX_CLOSE_FACTOR, OWNER}, diff --git a/contracts/params/tests/test_update_asset_params.rs b/contracts/params/tests/test_update_asset_params.rs index 821ef8eab..b19b9737d 100644 --- a/contracts/params/tests/test_update_asset_params.rs +++ b/contracts/params/tests/test_update_asset_params.rs @@ -63,7 +63,10 @@ fn initializing_asset_param() { assert_eq!(params.max_loan_to_value, res.params.max_loan_to_value); assert_eq!(params.liquidation_threshold, res.params.liquidation_threshold); assert_eq!(params.liquidation_bonus, res.params.liquidation_bonus); - assert_eq!(params.red_bank_deposit_cap, res.params.red_bank_deposit_cap); + assert_eq!( + params.permissions.red_bank.deposit_cap, + res.params.permissions.red_bank.deposit_cap + ); assert_eq!(params.interest_rate_model, res.params.interest_rate_model); assert_eq!(params.reserve_factor, res.params.reserve_factor); From 7f4c3f98cbee8259bc2b26b2723917af21c6c8a2 Mon Sep 17 00:00:00 2001 From: Piotr Babel Date: Wed, 12 Apr 2023 12:29:37 +0200 Subject: [PATCH 10/17] Add stable / nightly toolchains. --- .github/workflows/main.yml | 13 +++++++++++-- Makefile.toml | 6 ++++++ 2 files changed, 17 insertions(+), 2 deletions(-) diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml index 7def88a60..f308ce6ba 100644 --- a/.github/workflows/main.yml +++ b/.github/workflows/main.yml @@ -18,12 +18,21 @@ jobs: - name: Checkout sources uses: actions/checkout@v3 - - name: Install Rust + - name: Install stable Rust + uses: actions-rs/toolchain@v1 + with: + toolchain: stable + target: wasm32-unknown-unknown + components: clippy + profile: minimal + override: true + + - name: Install nightly Rust uses: actions-rs/toolchain@v1 with: toolchain: nightly target: wasm32-unknown-unknown - components: rustfmt, clippy + components: rustfmt profile: minimal override: true diff --git a/Makefile.toml b/Makefile.toml index 303a15b2d..0f036e8d7 100644 --- a/Makefile.toml +++ b/Makefile.toml @@ -11,6 +11,7 @@ default_to_workspace = false ARTIFACTS_DIR_PATH = "target/wasm32-unknown-unknown/release" [tasks.build] +toolchain = "stable" command = "cargo" args = ["build", "--release", "--target", "wasm32-unknown-unknown", "--locked"] @@ -28,14 +29,17 @@ docker run --rm -v "$(pwd)":/code \ """ [tasks.test] +toolchain = "stable" command = "cargo" args = ["test", "--locked"] [tasks.unit-test] +toolchain = "stable" command = "cargo" args = ["test", "--locked", "--workspace", "--exclude", "mars-integration-tests"] [tasks.integration-test] +toolchain = "stable" command = "cargo" args = ["test", "--locked", "--package", "mars-integration-tests"] @@ -45,10 +49,12 @@ command = "cargo" args = ["fmt", "--all", "--check"] [tasks.clippy] +toolchain = "stable" command = "cargo" args = ["clippy", "--tests", "--", "-D", "warnings"] [tasks.audit] +toolchain = "stable" command = "cargo" args = ["audit"] From ed14ff687d1b7604ecdee4853927c2292d9a7106 Mon Sep 17 00:00:00 2001 From: Piotr Babel Date: Wed, 12 Apr 2023 13:33:21 +0200 Subject: [PATCH 11/17] Fix clippy. --- contracts/params/tests/test_update_asset_params.rs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/contracts/params/tests/test_update_asset_params.rs b/contracts/params/tests/test_update_asset_params.rs index b19b9737d..9e4494047 100644 --- a/contracts/params/tests/test_update_asset_params.rs +++ b/contracts/params/tests/test_update_asset_params.rs @@ -180,7 +180,7 @@ fn removing_from_asset_params() { mock.update_asset_params( &owner, AssetParamsUpdate::AddOrUpdate { - denom: denom0.to_string(), + denom: denom0, params: default_asset_params(), }, ) @@ -188,7 +188,7 @@ fn removing_from_asset_params() { mock.update_asset_params( &owner, AssetParamsUpdate::AddOrUpdate { - denom: denom1.to_string(), + denom: denom1, params: default_asset_params(), }, ) @@ -196,7 +196,7 @@ fn removing_from_asset_params() { mock.update_asset_params( &owner, AssetParamsUpdate::AddOrUpdate { - denom: denom2.to_string(), + denom: denom2, params: default_asset_params(), }, ) From 39e40c0f2275f5ee4a1b258af2fc8fad791d312e Mon Sep 17 00:00:00 2001 From: brimigs Date: Thu, 13 Apr 2023 07:55:15 -0400 Subject: [PATCH 12/17] update contract name --- contracts/params/src/execute.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/contracts/params/src/execute.rs b/contracts/params/src/execute.rs index 5fa4dbc82..83fcfb10d 100644 --- a/contracts/params/src/execute.rs +++ b/contracts/params/src/execute.rs @@ -7,7 +7,7 @@ use crate::{ types::{AssetParamsUpdate, VaultConfigUpdate}, }; -pub const CONTRACT_NAME: &str = "crates.io:mars-params"; +pub const CONTRACT_NAME: &str = env!("CARGO_PKG_NAME"); pub const CONTRACT_VERSION: &str = env!("CARGO_PKG_VERSION"); pub fn update_max_close_factor( From 16828050d7ac1d8e778510d91898b22243be7930 Mon Sep 17 00:00:00 2001 From: brimigs Date: Tue, 18 Apr 2023 06:19:34 -0400 Subject: [PATCH 13/17] publishing mars-params to crates.io --- contracts/params/Cargo.toml | 1 + contracts/params/README.md | 16 ++++++++++++++++ 2 files changed, 17 insertions(+) create mode 100644 contracts/params/README.md diff --git a/contracts/params/Cargo.toml b/contracts/params/Cargo.toml index a34ffde72..08ad2108c 100644 --- a/contracts/params/Cargo.toml +++ b/contracts/params/Cargo.toml @@ -1,5 +1,6 @@ [package] name = "mars-params" +description = "Contract storing the asset params for Rover and Red Bank." version = { workspace = true } authors = { workspace = true } license = { workspace = true } diff --git a/contracts/params/README.md b/contracts/params/README.md new file mode 100644 index 000000000..71737bcc1 --- /dev/null +++ b/contracts/params/README.md @@ -0,0 +1,16 @@ +# Mars Params Contract + +The Mars Params Contract is published to [Crates.io](https://crates.io/crates/mars-params) + +This contract holds the following values for all the assets in Mars Protocol: + +- **Max Loan To Value:** Max percentage of collateral that can be borrowed +- **Liquidation Threshold:** LTV at which the loan is defined as under collateralized and can be liquidated +- **Liquidation Bonus:** Percentage of extra collateral the liquidator gets as a bonus +- **Deposit Enabled:** Is the asset able to be deposited into the Red Bank +- **Borrow Enabled:** Is the asset able to be borrowed from the Red Bank +- **Deposit Cap:** Max amount that can be deposited into the Red Bank +- **Asset Permissions** Rover and Red Bank Permission Settings + +Note: Rover Vaults only utilize max loan to value, liquidation threshold, and deposit cap parameters, while Red Bank Markets utilize all of the above parameters. + From f54c3382c85474d4503ed7bd4e13bd7693da66b0 Mon Sep 17 00:00:00 2001 From: piobab Date: Fri, 28 Apr 2023 17:26:35 +0200 Subject: [PATCH 14/17] Remove reserve factor and interest rate model. (#8) * Remove reserve factor and interest rate model. * Update schema. * Update version. * Update schema. --- Cargo.lock | 10 +- Cargo.toml | 2 +- contracts/params/src/types.rs | 11 +- contracts/params/tests/helpers/generator.rs | 8 - .../params/tests/test_asset_validation.rs | 46 ----- .../params/tests/test_update_asset_params.rs | 2 - schemas/mars-params/mars-params.json | 164 +----------------- .../mars-swapper-osmosis.json | 2 +- .../mars-params/MarsParams.client.ts | 1 - .../mars-params/MarsParams.react-query.ts | 1 - .../generated/mars-params/MarsParams.types.ts | 8 - 11 files changed, 12 insertions(+), 243 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 640900054..10af6d4df 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -882,7 +882,7 @@ dependencies = [ [[package]] name = "mars-params" -version = "1.0.0" +version = "1.0.1" dependencies = [ "anyhow", "cosmwasm-schema", @@ -913,7 +913,7 @@ dependencies = [ [[package]] name = "mars-swapper" -version = "1.0.0" +version = "1.0.1" dependencies = [ "cosmwasm-schema", "cosmwasm-std", @@ -927,7 +927,7 @@ dependencies = [ [[package]] name = "mars-swapper-base" -version = "1.0.0" +version = "1.0.1" dependencies = [ "cosmwasm-schema", "cosmwasm-std", @@ -942,7 +942,7 @@ dependencies = [ [[package]] name = "mars-swapper-mock" -version = "1.0.0" +version = "1.0.1" dependencies = [ "anyhow", "cosmwasm-std", @@ -954,7 +954,7 @@ dependencies = [ [[package]] name = "mars-swapper-osmosis" -version = "1.0.0" +version = "1.0.1" dependencies = [ "anyhow", "cosmwasm-schema", diff --git a/Cargo.toml b/Cargo.toml index f92c84a3f..22c40a695 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -6,7 +6,7 @@ members = [ ] [workspace.package] -version = "1.0.0" +version = "1.0.1" authors = [ "Gabe R. ", "Larry Engineer ", diff --git a/contracts/params/src/types.rs b/contracts/params/src/types.rs index 683ea7dda..c6ed4a0f6 100644 --- a/contracts/params/src/types.rs +++ b/contracts/params/src/types.rs @@ -1,10 +1,6 @@ use cosmwasm_schema::cw_serde; use cosmwasm_std::{Addr, Coin, Decimal, Uint128}; -use mars_red_bank_types::red_bank::InterestRateModel; -use mars_utils::{ - error::ValidationError, - helpers::{decimal_param_le_one, decimal_param_lt_one}, -}; +use mars_utils::{error::ValidationError, helpers::decimal_param_le_one}; use crate::execute::assert_lqt_gte_max_ltv; @@ -32,21 +28,16 @@ pub struct AssetParams { pub max_loan_to_value: Decimal, pub liquidation_threshold: Decimal, pub liquidation_bonus: Decimal, - pub interest_rate_model: InterestRateModel, - pub reserve_factor: Decimal, } impl AssetParams { pub fn validate(&self) -> Result<(), ValidationError> { - decimal_param_lt_one(self.reserve_factor, "reserve_factor")?; decimal_param_le_one(self.max_loan_to_value, "max_loan_to_value")?; decimal_param_le_one(self.liquidation_threshold, "liquidation_threshold")?; decimal_param_le_one(self.liquidation_bonus, "liquidation_bonus")?; assert_lqt_gte_max_ltv(self.max_loan_to_value, self.liquidation_threshold)?; - self.interest_rate_model.validate()?; - Ok(()) } } diff --git a/contracts/params/tests/helpers/generator.rs b/contracts/params/tests/helpers/generator.rs index 59b0c0228..f5b449610 100644 --- a/contracts/params/tests/helpers/generator.rs +++ b/contracts/params/tests/helpers/generator.rs @@ -4,7 +4,6 @@ use cosmwasm_std::{coin, Decimal, Uint128}; use mars_params::types::{ AssetParams, AssetPermissions, RedBankSettings, RoverPermissions, VaultConfig, }; -use mars_red_bank_types::red_bank::InterestRateModel; pub fn default_asset_params() -> AssetParams { AssetParams { @@ -21,13 +20,6 @@ pub fn default_asset_params() -> AssetParams { max_loan_to_value: Decimal::from_str("0.6").unwrap(), liquidation_threshold: Decimal::from_str("0.7").unwrap(), liquidation_bonus: Decimal::from_str("0.15").unwrap(), - interest_rate_model: InterestRateModel { - optimal_utilization_rate: Decimal::from_str("0.6").unwrap(), - base: Decimal::zero(), - slope_1: Decimal::from_str("0.15").unwrap(), - slope_2: Decimal::from_str("3").unwrap(), - }, - reserve_factor: Decimal::from_str("0.2").unwrap(), } } diff --git a/contracts/params/tests/test_asset_validation.rs b/contracts/params/tests/test_asset_validation.rs index 06b10d683..4650e0de5 100644 --- a/contracts/params/tests/test_asset_validation.rs +++ b/contracts/params/tests/test_asset_validation.rs @@ -28,29 +28,6 @@ fn denom_must_be_native() { ); } -#[test] -fn reserve_factor_less_than_one() { - let mut mock = MockEnv::new().build().unwrap(); - let mut params = default_asset_params(); - params.reserve_factor = Decimal::from_str("1.1235").unwrap(); - - let res = mock.update_asset_params( - &mock.query_owner(), - AssetParamsUpdate::AddOrUpdate { - denom: "denom_xyz".to_string(), - params, - }, - ); - assert_err( - res, - Validation(InvalidParam { - param_name: "reserve_factor".to_string(), - invalid_value: "1.1235".to_string(), - predicate: "< 1".to_string(), - }), - ); -} - #[test] fn max_ltv_less_than_or_equal_to_one() { let mut mock = MockEnv::new().build().unwrap(); @@ -143,26 +120,3 @@ fn liq_threshold_gte_max_ltv() { }), ); } - -#[test] -fn interest_rate_model_validated() { - let mut mock = MockEnv::new().build().unwrap(); - let mut params = default_asset_params(); - params.interest_rate_model.optimal_utilization_rate = Decimal::from_str("1.5").unwrap(); - - let res = mock.update_asset_params( - &mock.query_owner(), - AssetParamsUpdate::AddOrUpdate { - denom: "denom_xyz".to_string(), - params, - }, - ); - assert_err( - res, - Validation(InvalidParam { - param_name: "optimal_utilization_rate".to_string(), - invalid_value: "1.5".to_string(), - predicate: "<= 1".to_string(), - }), - ); -} diff --git a/contracts/params/tests/test_update_asset_params.rs b/contracts/params/tests/test_update_asset_params.rs index 9e4494047..5ddd14542 100644 --- a/contracts/params/tests/test_update_asset_params.rs +++ b/contracts/params/tests/test_update_asset_params.rs @@ -67,8 +67,6 @@ fn initializing_asset_param() { params.permissions.red_bank.deposit_cap, res.params.permissions.red_bank.deposit_cap ); - assert_eq!(params.interest_rate_model, res.params.interest_rate_model); - assert_eq!(params.reserve_factor, res.params.reserve_factor); mock.update_asset_params( &owner, diff --git a/schemas/mars-params/mars-params.json b/schemas/mars-params/mars-params.json index caea24d9a..deba6c252 100644 --- a/schemas/mars-params/mars-params.json +++ b/schemas/mars-params/mars-params.json @@ -1,6 +1,6 @@ { "contract_name": "mars-params", - "contract_version": "1.0.0", + "contract_version": "1.0.1", "idl_version": "1.0.0", "instantiate": { "$schema": "http://json-schema.org/draft-07/schema#", @@ -101,17 +101,12 @@ "AssetParams": { "type": "object", "required": [ - "interest_rate_model", "liquidation_bonus", "liquidation_threshold", "max_loan_to_value", - "permissions", - "reserve_factor" + "permissions" ], "properties": { - "interest_rate_model": { - "$ref": "#/definitions/InterestRateModel" - }, "liquidation_bonus": { "$ref": "#/definitions/Decimal" }, @@ -123,9 +118,6 @@ }, "permissions": { "$ref": "#/definitions/AssetPermissions" - }, - "reserve_factor": { - "$ref": "#/definitions/Decimal" } }, "additionalProperties": false @@ -222,50 +214,6 @@ } ] }, - "InterestRateModel": { - "type": "object", - "required": [ - "base", - "optimal_utilization_rate", - "slope_1", - "slope_2" - ], - "properties": { - "base": { - "description": "Base rate", - "allOf": [ - { - "$ref": "#/definitions/Decimal" - } - ] - }, - "optimal_utilization_rate": { - "description": "Optimal utilization rate", - "allOf": [ - { - "$ref": "#/definitions/Decimal" - } - ] - }, - "slope_1": { - "description": "Slope parameter for interest rate model function when utilization_rate < optimal_utilization_rate", - "allOf": [ - { - "$ref": "#/definitions/Decimal" - } - ] - }, - "slope_2": { - "description": "Slope parameter for interest rate model function when utilization_rate >= optimal_utilization_rate", - "allOf": [ - { - "$ref": "#/definitions/Decimal" - } - ] - } - }, - "additionalProperties": false - }, "OwnerUpdate": { "oneOf": [ { @@ -657,17 +605,12 @@ "AssetParams": { "type": "object", "required": [ - "interest_rate_model", "liquidation_bonus", "liquidation_threshold", "max_loan_to_value", - "permissions", - "reserve_factor" + "permissions" ], "properties": { - "interest_rate_model": { - "$ref": "#/definitions/InterestRateModel" - }, "liquidation_bonus": { "$ref": "#/definitions/Decimal" }, @@ -679,9 +622,6 @@ }, "permissions": { "$ref": "#/definitions/AssetPermissions" - }, - "reserve_factor": { - "$ref": "#/definitions/Decimal" } }, "additionalProperties": false @@ -722,50 +662,6 @@ "description": "A fixed-point decimal value with 18 fractional digits, i.e. Decimal(1_000_000_000_000_000_000) == 1.0\n\nThe greatest possible value that can be represented is 340282366920938463463.374607431768211455 (which is (2^128 - 1) / 10^18)", "type": "string" }, - "InterestRateModel": { - "type": "object", - "required": [ - "base", - "optimal_utilization_rate", - "slope_1", - "slope_2" - ], - "properties": { - "base": { - "description": "Base rate", - "allOf": [ - { - "$ref": "#/definitions/Decimal" - } - ] - }, - "optimal_utilization_rate": { - "description": "Optimal utilization rate", - "allOf": [ - { - "$ref": "#/definitions/Decimal" - } - ] - }, - "slope_1": { - "description": "Slope parameter for interest rate model function when utilization_rate < optimal_utilization_rate", - "allOf": [ - { - "$ref": "#/definitions/Decimal" - } - ] - }, - "slope_2": { - "description": "Slope parameter for interest rate model function when utilization_rate >= optimal_utilization_rate", - "allOf": [ - { - "$ref": "#/definitions/Decimal" - } - ] - } - }, - "additionalProperties": false - }, "RedBankSettings": { "type": "object", "required": [ @@ -866,17 +762,12 @@ "title": "AssetParams", "type": "object", "required": [ - "interest_rate_model", "liquidation_bonus", "liquidation_threshold", "max_loan_to_value", - "permissions", - "reserve_factor" + "permissions" ], "properties": { - "interest_rate_model": { - "$ref": "#/definitions/InterestRateModel" - }, "liquidation_bonus": { "$ref": "#/definitions/Decimal" }, @@ -888,9 +779,6 @@ }, "permissions": { "$ref": "#/definitions/AssetPermissions" - }, - "reserve_factor": { - "$ref": "#/definitions/Decimal" } }, "additionalProperties": false, @@ -915,50 +803,6 @@ "description": "A fixed-point decimal value with 18 fractional digits, i.e. Decimal(1_000_000_000_000_000_000) == 1.0\n\nThe greatest possible value that can be represented is 340282366920938463463.374607431768211455 (which is (2^128 - 1) / 10^18)", "type": "string" }, - "InterestRateModel": { - "type": "object", - "required": [ - "base", - "optimal_utilization_rate", - "slope_1", - "slope_2" - ], - "properties": { - "base": { - "description": "Base rate", - "allOf": [ - { - "$ref": "#/definitions/Decimal" - } - ] - }, - "optimal_utilization_rate": { - "description": "Optimal utilization rate", - "allOf": [ - { - "$ref": "#/definitions/Decimal" - } - ] - }, - "slope_1": { - "description": "Slope parameter for interest rate model function when utilization_rate < optimal_utilization_rate", - "allOf": [ - { - "$ref": "#/definitions/Decimal" - } - ] - }, - "slope_2": { - "description": "Slope parameter for interest rate model function when utilization_rate >= optimal_utilization_rate", - "allOf": [ - { - "$ref": "#/definitions/Decimal" - } - ] - } - }, - "additionalProperties": false - }, "RedBankSettings": { "type": "object", "required": [ diff --git a/schemas/mars-swapper-osmosis/mars-swapper-osmosis.json b/schemas/mars-swapper-osmosis/mars-swapper-osmosis.json index 4eab808e1..1b71b9c5c 100644 --- a/schemas/mars-swapper-osmosis/mars-swapper-osmosis.json +++ b/schemas/mars-swapper-osmosis/mars-swapper-osmosis.json @@ -1,6 +1,6 @@ { "contract_name": "mars-swapper-osmosis", - "contract_version": "1.0.0", + "contract_version": "1.0.1", "idl_version": "1.0.0", "instantiate": { "$schema": "http://json-schema.org/draft-07/schema#", diff --git a/scripts/types/generated/mars-params/MarsParams.client.ts b/scripts/types/generated/mars-params/MarsParams.client.ts index 7bd3a6ac1..723d5180b 100644 --- a/scripts/types/generated/mars-params/MarsParams.client.ts +++ b/scripts/types/generated/mars-params/MarsParams.client.ts @@ -19,7 +19,6 @@ import { RoverEmergencyUpdate, RedBankEmergencyUpdate, AssetParams, - InterestRateModel, AssetPermissions, RedBankSettings, RoverPermissions, diff --git a/scripts/types/generated/mars-params/MarsParams.react-query.ts b/scripts/types/generated/mars-params/MarsParams.react-query.ts index f01e225c1..5b0e81b9f 100644 --- a/scripts/types/generated/mars-params/MarsParams.react-query.ts +++ b/scripts/types/generated/mars-params/MarsParams.react-query.ts @@ -20,7 +20,6 @@ import { RoverEmergencyUpdate, RedBankEmergencyUpdate, AssetParams, - InterestRateModel, AssetPermissions, RedBankSettings, RoverPermissions, diff --git a/scripts/types/generated/mars-params/MarsParams.types.ts b/scripts/types/generated/mars-params/MarsParams.types.ts index c2e6c4585..3cc0b70e3 100644 --- a/scripts/types/generated/mars-params/MarsParams.types.ts +++ b/scripts/types/generated/mars-params/MarsParams.types.ts @@ -81,18 +81,10 @@ export type RedBankEmergencyUpdate = { disable_borrowing: string } export interface AssetParams { - interest_rate_model: InterestRateModel liquidation_bonus: Decimal liquidation_threshold: Decimal max_loan_to_value: Decimal permissions: AssetPermissions - reserve_factor: Decimal -} -export interface InterestRateModel { - base: Decimal - optimal_utilization_rate: Decimal - slope_1: Decimal - slope_2: Decimal } export interface AssetPermissions { red_bank: RedBankSettings From 5ee79e62a7e580e6975164770ae3cb229bba2a3b Mon Sep 17 00:00:00 2001 From: Gabe Rodriguez Date: Tue, 9 May 2023 12:38:02 +0200 Subject: [PATCH 15/17] Add HLS to asset params --- contracts/params/src/execute.rs | 14 + contracts/params/src/types.rs | 19 +- contracts/params/tests/helpers/generator.rs | 9 +- .../params/tests/test_asset_validation.rs | 70 ++ schemas/mars-params/mars-params.json | 72 +- scripts/package.json | 14 +- .../mars-params/MarsParams.client.ts | 21 +- .../mars-params/MarsParams.react-query.ts | 9 +- .../generated/mars-params/MarsParams.types.ts | 11 +- scripts/types/generated/mars-params/bundle.ts | 2 +- .../MarsSwapperOsmosis.client.ts | 6 +- .../MarsSwapperOsmosis.react-query.ts | 3 +- .../MarsSwapperOsmosis.types.ts | 2 +- .../generated/mars-swapper-osmosis/bundle.ts | 2 +- scripts/yarn.lock | 857 +++++++++--------- 15 files changed, 640 insertions(+), 471 deletions(-) diff --git a/contracts/params/src/execute.rs b/contracts/params/src/execute.rs index 83fcfb10d..f8d8baf00 100644 --- a/contracts/params/src/execute.rs +++ b/contracts/params/src/execute.rs @@ -112,3 +112,17 @@ pub fn assert_lqt_gte_max_ltv( } Ok(()) } + +pub fn assert_hls_lqt_gte_max_ltv( + max_ltv: Decimal, + liq_threshold: Decimal, +) -> Result<(), ValidationError> { + if liq_threshold <= max_ltv { + return Err(ValidationError::InvalidParam { + param_name: "hls_liquidation_threshold".to_string(), + invalid_value: liq_threshold.to_string(), + predicate: format!("> {} (hls max LTV)", max_ltv), + }); + } + Ok(()) +} diff --git a/contracts/params/src/types.rs b/contracts/params/src/types.rs index c6ed4a0f6..4223bffa8 100644 --- a/contracts/params/src/types.rs +++ b/contracts/params/src/types.rs @@ -2,7 +2,7 @@ use cosmwasm_schema::cw_serde; use cosmwasm_std::{Addr, Coin, Decimal, Uint128}; use mars_utils::{error::ValidationError, helpers::decimal_param_le_one}; -use crate::execute::assert_lqt_gte_max_ltv; +use crate::execute::{assert_hls_lqt_gte_max_ltv, assert_lqt_gte_max_ltv}; #[cw_serde] pub struct RoverPermissions { @@ -10,7 +10,7 @@ pub struct RoverPermissions { } #[cw_serde] -pub struct RedBankSettings { +pub struct RedBankPermissions { pub deposit_enabled: bool, pub borrow_enabled: bool, pub deposit_cap: Uint128, @@ -19,12 +19,19 @@ pub struct RedBankSettings { #[cw_serde] pub struct AssetPermissions { pub rover: RoverPermissions, - pub red_bank: RedBankSettings, + pub red_bank: RedBankPermissions, +} + +#[cw_serde] +pub struct HighLeverageStrategyParams { + pub max_loan_to_value: Decimal, + pub liquidation_threshold: Decimal, } #[cw_serde] pub struct AssetParams { pub permissions: AssetPermissions, + pub hls: HighLeverageStrategyParams, pub max_loan_to_value: Decimal, pub liquidation_threshold: Decimal, pub liquidation_bonus: Decimal, @@ -34,9 +41,13 @@ impl AssetParams { pub fn validate(&self) -> Result<(), ValidationError> { decimal_param_le_one(self.max_loan_to_value, "max_loan_to_value")?; decimal_param_le_one(self.liquidation_threshold, "liquidation_threshold")?; + assert_lqt_gte_max_ltv(self.max_loan_to_value, self.liquidation_threshold)?; + decimal_param_le_one(self.liquidation_bonus, "liquidation_bonus")?; - assert_lqt_gte_max_ltv(self.max_loan_to_value, self.liquidation_threshold)?; + decimal_param_le_one(self.hls.max_loan_to_value, "hls_max_loan_to_value")?; + decimal_param_le_one(self.hls.liquidation_threshold, "hls_liquidation_threshold")?; + assert_hls_lqt_gte_max_ltv(self.hls.max_loan_to_value, self.hls.liquidation_threshold)?; Ok(()) } diff --git a/contracts/params/tests/helpers/generator.rs b/contracts/params/tests/helpers/generator.rs index f5b449610..86f29555f 100644 --- a/contracts/params/tests/helpers/generator.rs +++ b/contracts/params/tests/helpers/generator.rs @@ -2,7 +2,8 @@ use std::str::FromStr; use cosmwasm_std::{coin, Decimal, Uint128}; use mars_params::types::{ - AssetParams, AssetPermissions, RedBankSettings, RoverPermissions, VaultConfig, + AssetParams, AssetPermissions, HighLeverageStrategyParams, RedBankPermissions, + RoverPermissions, VaultConfig, }; pub fn default_asset_params() -> AssetParams { @@ -11,7 +12,7 @@ pub fn default_asset_params() -> AssetParams { rover: RoverPermissions { whitelisted: false, }, - red_bank: RedBankSettings { + red_bank: RedBankPermissions { deposit_enabled: true, borrow_enabled: false, deposit_cap: Uint128::new(1_000_000_000), @@ -20,6 +21,10 @@ pub fn default_asset_params() -> AssetParams { max_loan_to_value: Decimal::from_str("0.6").unwrap(), liquidation_threshold: Decimal::from_str("0.7").unwrap(), liquidation_bonus: Decimal::from_str("0.15").unwrap(), + hls: HighLeverageStrategyParams { + max_loan_to_value: Decimal::from_str("0.85").unwrap(), + liquidation_threshold: Decimal::from_str("0.9").unwrap(), + }, } } diff --git a/contracts/params/tests/test_asset_validation.rs b/contracts/params/tests/test_asset_validation.rs index 4650e0de5..73a357beb 100644 --- a/contracts/params/tests/test_asset_validation.rs +++ b/contracts/params/tests/test_asset_validation.rs @@ -120,3 +120,73 @@ fn liq_threshold_gte_max_ltv() { }), ); } + +#[test] +fn hls_max_ltv_less_than_or_equal_to_one() { + let mut mock = MockEnv::new().build().unwrap(); + let mut params = default_asset_params(); + params.hls.max_loan_to_value = Decimal::from_str("1.1235").unwrap(); + + let res = mock.update_asset_params( + &mock.query_owner(), + AssetParamsUpdate::AddOrUpdate { + denom: "denom_xyz".to_string(), + params, + }, + ); + assert_err( + res, + Validation(InvalidParam { + param_name: "hls_max_loan_to_value".to_string(), + invalid_value: "1.1235".to_string(), + predicate: "<= 1".to_string(), + }), + ); +} + +#[test] +fn hls_liquidation_threshold_less_than_or_equal_to_one() { + let mut mock = MockEnv::new().build().unwrap(); + let mut params = default_asset_params(); + params.hls.liquidation_threshold = Decimal::from_str("1.1235").unwrap(); + + let res = mock.update_asset_params( + &mock.query_owner(), + AssetParamsUpdate::AddOrUpdate { + denom: "denom_xyz".to_string(), + params, + }, + ); + assert_err( + res, + Validation(InvalidParam { + param_name: "hls_liquidation_threshold".to_string(), + invalid_value: "1.1235".to_string(), + predicate: "<= 1".to_string(), + }), + ); +} + +#[test] +fn hls_liq_threshold_gte_hls_max_ltv() { + let mut mock = MockEnv::new().build().unwrap(); + let mut params = default_asset_params(); + params.hls.liquidation_threshold = Decimal::from_str("0.5").unwrap(); + params.hls.max_loan_to_value = Decimal::from_str("0.6").unwrap(); + + let res = mock.update_asset_params( + &mock.query_owner(), + AssetParamsUpdate::AddOrUpdate { + denom: "denom_xyz".to_string(), + params, + }, + ); + assert_err( + res, + Validation(InvalidParam { + param_name: "hls_liquidation_threshold".to_string(), + invalid_value: "0.5".to_string(), + predicate: "> 0.6 (hls max LTV)".to_string(), + }), + ); +} diff --git a/schemas/mars-params/mars-params.json b/schemas/mars-params/mars-params.json index deba6c252..62b88d96d 100644 --- a/schemas/mars-params/mars-params.json +++ b/schemas/mars-params/mars-params.json @@ -101,12 +101,16 @@ "AssetParams": { "type": "object", "required": [ + "hls", "liquidation_bonus", "liquidation_threshold", "max_loan_to_value", "permissions" ], "properties": { + "hls": { + "$ref": "#/definitions/HighLeverageStrategyParams" + }, "liquidation_bonus": { "$ref": "#/definitions/Decimal" }, @@ -159,7 +163,7 @@ ], "properties": { "red_bank": { - "$ref": "#/definitions/RedBankSettings" + "$ref": "#/definitions/RedBankPermissions" }, "rover": { "$ref": "#/definitions/RoverPermissions" @@ -214,6 +218,22 @@ } ] }, + "HighLeverageStrategyParams": { + "type": "object", + "required": [ + "liquidation_threshold", + "max_loan_to_value" + ], + "properties": { + "liquidation_threshold": { + "$ref": "#/definitions/Decimal" + }, + "max_loan_to_value": { + "$ref": "#/definitions/Decimal" + } + }, + "additionalProperties": false + }, "OwnerUpdate": { "oneOf": [ { @@ -306,7 +326,7 @@ } ] }, - "RedBankSettings": { + "RedBankPermissions": { "type": "object", "required": [ "borrow_enabled", @@ -605,12 +625,16 @@ "AssetParams": { "type": "object", "required": [ + "hls", "liquidation_bonus", "liquidation_threshold", "max_loan_to_value", "permissions" ], "properties": { + "hls": { + "$ref": "#/definitions/HighLeverageStrategyParams" + }, "liquidation_bonus": { "$ref": "#/definitions/Decimal" }, @@ -650,7 +674,7 @@ ], "properties": { "red_bank": { - "$ref": "#/definitions/RedBankSettings" + "$ref": "#/definitions/RedBankPermissions" }, "rover": { "$ref": "#/definitions/RoverPermissions" @@ -662,7 +686,23 @@ "description": "A fixed-point decimal value with 18 fractional digits, i.e. Decimal(1_000_000_000_000_000_000) == 1.0\n\nThe greatest possible value that can be represented is 340282366920938463463.374607431768211455 (which is (2^128 - 1) / 10^18)", "type": "string" }, - "RedBankSettings": { + "HighLeverageStrategyParams": { + "type": "object", + "required": [ + "liquidation_threshold", + "max_loan_to_value" + ], + "properties": { + "liquidation_threshold": { + "$ref": "#/definitions/Decimal" + }, + "max_loan_to_value": { + "$ref": "#/definitions/Decimal" + } + }, + "additionalProperties": false + }, + "RedBankPermissions": { "type": "object", "required": [ "borrow_enabled", @@ -762,12 +802,16 @@ "title": "AssetParams", "type": "object", "required": [ + "hls", "liquidation_bonus", "liquidation_threshold", "max_loan_to_value", "permissions" ], "properties": { + "hls": { + "$ref": "#/definitions/HighLeverageStrategyParams" + }, "liquidation_bonus": { "$ref": "#/definitions/Decimal" }, @@ -791,7 +835,7 @@ ], "properties": { "red_bank": { - "$ref": "#/definitions/RedBankSettings" + "$ref": "#/definitions/RedBankPermissions" }, "rover": { "$ref": "#/definitions/RoverPermissions" @@ -803,7 +847,23 @@ "description": "A fixed-point decimal value with 18 fractional digits, i.e. Decimal(1_000_000_000_000_000_000) == 1.0\n\nThe greatest possible value that can be represented is 340282366920938463463.374607431768211455 (which is (2^128 - 1) / 10^18)", "type": "string" }, - "RedBankSettings": { + "HighLeverageStrategyParams": { + "type": "object", + "required": [ + "liquidation_threshold", + "max_loan_to_value" + ], + "properties": { + "liquidation_threshold": { + "$ref": "#/definitions/Decimal" + }, + "max_loan_to_value": { + "$ref": "#/definitions/Decimal" + } + }, + "additionalProperties": false + }, + "RedBankPermissions": { "type": "object", "required": [ "borrow_enabled", diff --git a/scripts/package.json b/scripts/package.json index d42c92cf3..303cfd959 100644 --- a/scripts/package.json +++ b/scripts/package.json @@ -16,19 +16,19 @@ "@cosmjs/cosmwasm-stargate": "^0.30.1", "@cosmjs/proto-signing": "^0.30.1", "@cosmjs/stargate": "^0.30.1", - "@cosmwasm/ts-codegen": "^0.25.2", + "@cosmwasm/ts-codegen": "^0.27.0", "chalk": "4.1.2", "cosmjs-types": "^0.7.2", "prepend-file": "^2.0.1" }, "devDependencies": { - "@types/node": "^18.15.11", - "@typescript-eslint/eslint-plugin": "^5.57.1", - "@typescript-eslint/parser": "^5.57.1", + "@types/node": "^20.1.1", + "@typescript-eslint/eslint-plugin": "^5.59.5", + "@typescript-eslint/parser": "^5.59.5", "cosmjs-types": "^0.6.1", - "eslint": "^8.37.0", + "eslint": "^8.40.0", "eslint-config-prettier": "^8.8.0", - "prettier": "^2.8.7", - "typescript": "^5.0.3" + "prettier": "^2.8.8", + "typescript": "^5.0.4" } } diff --git a/scripts/types/generated/mars-params/MarsParams.client.ts b/scripts/types/generated/mars-params/MarsParams.client.ts index 723d5180b..53d33ae72 100644 --- a/scripts/types/generated/mars-params/MarsParams.client.ts +++ b/scripts/types/generated/mars-params/MarsParams.client.ts @@ -1,6 +1,6 @@ // @ts-nocheck /** - * This file was automatically generated by @cosmwasm/ts-codegen@0.25.2. + * This file was automatically generated by @cosmwasm/ts-codegen@0.27.0. * DO NOT MODIFY IT BY HAND. Instead, modify the source JSONSchema file, * and run the @cosmwasm/ts-codegen generate command to regenerate this file. */ @@ -19,8 +19,9 @@ import { RoverEmergencyUpdate, RedBankEmergencyUpdate, AssetParams, + HighLeverageStrategyParams, AssetPermissions, - RedBankSettings, + RedBankPermissions, RoverPermissions, VaultConfig, Coin, @@ -123,6 +124,7 @@ export interface MarsParamsInterface extends MarsParamsReadOnlyInterface { contractAddress: string sender: string updateOwner: ( + ownerUpdate: OwnerUpdate, fee?: number | StdFee | 'auto', memo?: string, funds?: Coin[], @@ -133,16 +135,19 @@ export interface MarsParamsInterface extends MarsParamsReadOnlyInterface { funds?: Coin[], ) => Promise updateAssetParams: ( + assetParamsUpdate: AssetParamsUpdate, fee?: number | StdFee | 'auto', memo?: string, funds?: Coin[], ) => Promise updateVaultConfig: ( + vaultConfigUpdate: VaultConfigUpdate, fee?: number | StdFee | 'auto', memo?: string, funds?: Coin[], ) => Promise emergencyUpdate: ( + emergencyUpdate: EmergencyUpdate, fee?: number | StdFee | 'auto', memo?: string, funds?: Coin[], @@ -166,6 +171,7 @@ export class MarsParamsClient extends MarsParamsQueryClient implements MarsParam } updateOwner = async ( + ownerUpdate: OwnerUpdate, fee: number | StdFee | 'auto' = 'auto', memo?: string, funds?: Coin[], @@ -174,7 +180,7 @@ export class MarsParamsClient extends MarsParamsQueryClient implements MarsParam this.sender, this.contractAddress, { - update_owner: {}, + update_owner: ownerUpdate, }, fee, memo, @@ -198,6 +204,7 @@ export class MarsParamsClient extends MarsParamsQueryClient implements MarsParam ) } updateAssetParams = async ( + assetParamsUpdate: AssetParamsUpdate, fee: number | StdFee | 'auto' = 'auto', memo?: string, funds?: Coin[], @@ -206,7 +213,7 @@ export class MarsParamsClient extends MarsParamsQueryClient implements MarsParam this.sender, this.contractAddress, { - update_asset_params: {}, + update_asset_params: assetParamsUpdate, }, fee, memo, @@ -214,6 +221,7 @@ export class MarsParamsClient extends MarsParamsQueryClient implements MarsParam ) } updateVaultConfig = async ( + vaultConfigUpdate: VaultConfigUpdate, fee: number | StdFee | 'auto' = 'auto', memo?: string, funds?: Coin[], @@ -222,7 +230,7 @@ export class MarsParamsClient extends MarsParamsQueryClient implements MarsParam this.sender, this.contractAddress, { - update_vault_config: {}, + update_vault_config: vaultConfigUpdate, }, fee, memo, @@ -230,6 +238,7 @@ export class MarsParamsClient extends MarsParamsQueryClient implements MarsParam ) } emergencyUpdate = async ( + emergencyUpdate: EmergencyUpdate, fee: number | StdFee | 'auto' = 'auto', memo?: string, funds?: Coin[], @@ -238,7 +247,7 @@ export class MarsParamsClient extends MarsParamsQueryClient implements MarsParam this.sender, this.contractAddress, { - emergency_update: {}, + emergency_update: emergencyUpdate, }, fee, memo, diff --git a/scripts/types/generated/mars-params/MarsParams.react-query.ts b/scripts/types/generated/mars-params/MarsParams.react-query.ts index 5b0e81b9f..d49873504 100644 --- a/scripts/types/generated/mars-params/MarsParams.react-query.ts +++ b/scripts/types/generated/mars-params/MarsParams.react-query.ts @@ -1,6 +1,6 @@ // @ts-nocheck /** - * This file was automatically generated by @cosmwasm/ts-codegen@0.25.2. + * This file was automatically generated by @cosmwasm/ts-codegen@0.27.0. * DO NOT MODIFY IT BY HAND. Instead, modify the source JSONSchema file, * and run the @cosmwasm/ts-codegen generate command to regenerate this file. */ @@ -20,8 +20,9 @@ import { RoverEmergencyUpdate, RedBankEmergencyUpdate, AssetParams, + HighLeverageStrategyParams, AssetPermissions, - RedBankSettings, + RedBankPermissions, RoverPermissions, VaultConfig, Coin, @@ -185,6 +186,7 @@ export function useMarsParamsOwnerQuery({ } export interface MarsParamsEmergencyUpdateMutation { client: MarsParamsClient + msg: EmergencyUpdate args?: { fee?: number | StdFee | 'auto' memo?: string @@ -205,6 +207,7 @@ export function useMarsParamsEmergencyUpdateMutation( } export interface MarsParamsUpdateVaultConfigMutation { client: MarsParamsClient + msg: VaultConfigUpdate args?: { fee?: number | StdFee | 'auto' memo?: string @@ -225,6 +228,7 @@ export function useMarsParamsUpdateVaultConfigMutation( } export interface MarsParamsUpdateAssetParamsMutation { client: MarsParamsClient + msg: AssetParamsUpdate args?: { fee?: number | StdFee | 'auto' memo?: string @@ -265,6 +269,7 @@ export function useMarsParamsUpdateMaxCloseFactorMutation( } export interface MarsParamsUpdateOwnerMutation { client: MarsParamsClient + msg: OwnerUpdate args?: { fee?: number | StdFee | 'auto' memo?: string diff --git a/scripts/types/generated/mars-params/MarsParams.types.ts b/scripts/types/generated/mars-params/MarsParams.types.ts index 3cc0b70e3..4b34f7596 100644 --- a/scripts/types/generated/mars-params/MarsParams.types.ts +++ b/scripts/types/generated/mars-params/MarsParams.types.ts @@ -1,6 +1,6 @@ // @ts-nocheck /** - * This file was automatically generated by @cosmwasm/ts-codegen@0.25.2. + * This file was automatically generated by @cosmwasm/ts-codegen@0.27.0. * DO NOT MODIFY IT BY HAND. Instead, modify the source JSONSchema file, * and run the @cosmwasm/ts-codegen generate command to regenerate this file. */ @@ -81,16 +81,21 @@ export type RedBankEmergencyUpdate = { disable_borrowing: string } export interface AssetParams { + hls: HighLeverageStrategyParams liquidation_bonus: Decimal liquidation_threshold: Decimal max_loan_to_value: Decimal permissions: AssetPermissions } +export interface HighLeverageStrategyParams { + liquidation_threshold: Decimal + max_loan_to_value: Decimal +} export interface AssetPermissions { - red_bank: RedBankSettings + red_bank: RedBankPermissions rover: RoverPermissions } -export interface RedBankSettings { +export interface RedBankPermissions { borrow_enabled: boolean deposit_cap: Uint128 deposit_enabled: boolean diff --git a/scripts/types/generated/mars-params/bundle.ts b/scripts/types/generated/mars-params/bundle.ts index 2fbbee643..b2e209d21 100644 --- a/scripts/types/generated/mars-params/bundle.ts +++ b/scripts/types/generated/mars-params/bundle.ts @@ -1,6 +1,6 @@ // @ts-nocheck /** - * This file was automatically generated by @cosmwasm/ts-codegen@0.25.2. + * This file was automatically generated by @cosmwasm/ts-codegen@0.27.0. * DO NOT MODIFY IT BY HAND. Instead, modify the source JSONSchema file, * and run the @cosmwasm/ts-codegen generate command to regenerate this file. */ diff --git a/scripts/types/generated/mars-swapper-osmosis/MarsSwapperOsmosis.client.ts b/scripts/types/generated/mars-swapper-osmosis/MarsSwapperOsmosis.client.ts index 6cc765a75..66333f46e 100644 --- a/scripts/types/generated/mars-swapper-osmosis/MarsSwapperOsmosis.client.ts +++ b/scripts/types/generated/mars-swapper-osmosis/MarsSwapperOsmosis.client.ts @@ -1,6 +1,6 @@ // @ts-nocheck /** - * This file was automatically generated by @cosmwasm/ts-codegen@0.25.2. + * This file was automatically generated by @cosmwasm/ts-codegen@0.27.0. * DO NOT MODIFY IT BY HAND. Instead, modify the source JSONSchema file, * and run the @cosmwasm/ts-codegen generate command to regenerate this file. */ @@ -114,6 +114,7 @@ export interface MarsSwapperOsmosisInterface extends MarsSwapperOsmosisReadOnlyI contractAddress: string sender: string updateOwner: ( + ownerUpdate: OwnerUpdate, fee?: number | StdFee | 'auto', memo?: string, funds?: Coin[], @@ -181,6 +182,7 @@ export class MarsSwapperOsmosisClient } updateOwner = async ( + ownerUpdate: OwnerUpdate, fee: number | StdFee | 'auto' = 'auto', memo?: string, funds?: Coin[], @@ -189,7 +191,7 @@ export class MarsSwapperOsmosisClient this.sender, this.contractAddress, { - update_owner: {}, + update_owner: ownerUpdate, }, fee, memo, diff --git a/scripts/types/generated/mars-swapper-osmosis/MarsSwapperOsmosis.react-query.ts b/scripts/types/generated/mars-swapper-osmosis/MarsSwapperOsmosis.react-query.ts index 51f078536..c51ffbda5 100644 --- a/scripts/types/generated/mars-swapper-osmosis/MarsSwapperOsmosis.react-query.ts +++ b/scripts/types/generated/mars-swapper-osmosis/MarsSwapperOsmosis.react-query.ts @@ -1,6 +1,6 @@ // @ts-nocheck /** - * This file was automatically generated by @cosmwasm/ts-codegen@0.25.2. + * This file was automatically generated by @cosmwasm/ts-codegen@0.27.0. * DO NOT MODIFY IT BY HAND. Instead, modify the source JSONSchema file, * and run the @cosmwasm/ts-codegen generate command to regenerate this file. */ @@ -226,6 +226,7 @@ export function useMarsSwapperOsmosisSetRouteMutation( } export interface MarsSwapperOsmosisUpdateOwnerMutation { client: MarsSwapperOsmosisClient + msg: OwnerUpdate args?: { fee?: number | StdFee | 'auto' memo?: string diff --git a/scripts/types/generated/mars-swapper-osmosis/MarsSwapperOsmosis.types.ts b/scripts/types/generated/mars-swapper-osmosis/MarsSwapperOsmosis.types.ts index 44811b368..5c78cf963 100644 --- a/scripts/types/generated/mars-swapper-osmosis/MarsSwapperOsmosis.types.ts +++ b/scripts/types/generated/mars-swapper-osmosis/MarsSwapperOsmosis.types.ts @@ -1,6 +1,6 @@ // @ts-nocheck /** - * This file was automatically generated by @cosmwasm/ts-codegen@0.25.2. + * This file was automatically generated by @cosmwasm/ts-codegen@0.27.0. * DO NOT MODIFY IT BY HAND. Instead, modify the source JSONSchema file, * and run the @cosmwasm/ts-codegen generate command to regenerate this file. */ diff --git a/scripts/types/generated/mars-swapper-osmosis/bundle.ts b/scripts/types/generated/mars-swapper-osmosis/bundle.ts index 61b4c5a82..09a96fcdf 100644 --- a/scripts/types/generated/mars-swapper-osmosis/bundle.ts +++ b/scripts/types/generated/mars-swapper-osmosis/bundle.ts @@ -1,6 +1,6 @@ // @ts-nocheck /** - * This file was automatically generated by @cosmwasm/ts-codegen@0.25.2. + * This file was automatically generated by @cosmwasm/ts-codegen@0.27.0. * DO NOT MODIFY IT BY HAND. Instead, modify the source JSONSchema file, * and run the @cosmwasm/ts-codegen generate command to regenerate this file. */ diff --git a/scripts/yarn.lock b/scripts/yarn.lock index 646748133..63edc9f3b 100644 --- a/scripts/yarn.lock +++ b/scripts/yarn.lock @@ -2,25 +2,25 @@ # yarn lockfile v1 -"@ampproject/remapping@^2.1.0": - version "2.2.0" - resolved "https://registry.yarnpkg.com/@ampproject/remapping/-/remapping-2.2.0.tgz#56c133824780de3174aed5ab6834f3026790154d" - integrity sha512-qRmjj8nj9qmLTQXXmaR1cck3UXSRMPrbsLJAasZpF+t3riI71BXed5ebIOYwQntykeZuhjsdweEc9BxH5Jc26w== +"@ampproject/remapping@^2.1.0", "@ampproject/remapping@^2.2.0": + version "2.2.1" + resolved "https://registry.yarnpkg.com/@ampproject/remapping/-/remapping-2.2.1.tgz#99e8e11851128b8702cd57c33684f1d0f260b630" + integrity sha512-lFMjJTrFL3j7L9yBxwYfCq2k6qqwHyzuUl/XBnif78PWTJYyL/dfowQHWE3sp6U6ZzqWiiIZnpTMO96zhkjwtg== dependencies: - "@jridgewell/gen-mapping" "^0.1.0" + "@jridgewell/gen-mapping" "^0.3.0" "@jridgewell/trace-mapping" "^0.3.9" -"@babel/code-frame@^7.18.6": - version "7.18.6" - resolved "https://registry.yarnpkg.com/@babel/code-frame/-/code-frame-7.18.6.tgz#3b25d38c89600baa2dcc219edfa88a74eb2c427a" - integrity sha512-TDCmlK5eOvH+eH7cdAFlNXeVJqWIQ7gW9tY1GJIpUtFb6CmjVyq2VM3u71bOyR8CRihcCgMUYoDNyLXao3+70Q== +"@babel/code-frame@^7.18.6", "@babel/code-frame@^7.21.4": + version "7.21.4" + resolved "https://registry.yarnpkg.com/@babel/code-frame/-/code-frame-7.21.4.tgz#d0fa9e4413aca81f2b23b9442797bda1826edb39" + integrity sha512-LYvhNKfwWSPpocw8GI7gpK2nq3HSDuEPC/uSYaALSJu9xjsalaaYFOq0Pwt5KmVqwEbZlDu81aLXwBOmD/Fv9g== dependencies: "@babel/highlight" "^7.18.6" -"@babel/compat-data@^7.17.7", "@babel/compat-data@^7.18.8", "@babel/compat-data@^7.20.5": - version "7.20.10" - resolved "https://registry.yarnpkg.com/@babel/compat-data/-/compat-data-7.20.10.tgz#9d92fa81b87542fff50e848ed585b4212c1d34ec" - integrity sha512-sEnuDPpOJR/fcafHMjpcpGN5M2jbUGUHwmuWKM/YdPzeEDJg8bgmbcWQFUfE32MQjti1koACvoPVsDe8Uq+idg== +"@babel/compat-data@^7.17.7", "@babel/compat-data@^7.18.8", "@babel/compat-data@^7.20.5", "@babel/compat-data@^7.21.5": + version "7.21.7" + resolved "https://registry.yarnpkg.com/@babel/compat-data/-/compat-data-7.21.7.tgz#61caffb60776e49a57ba61a88f02bedd8714f6bc" + integrity sha512-KYMqFYTaenzMK4yUtf4EW9wc4N9ef80FsbMtkwool5zpwl4YrT1SdWYSTRcT94KO4hannogdS+LxY7L+arP3gA== "@babel/core@7.18.10": version "7.18.10" @@ -44,20 +44,20 @@ semver "^6.3.0" "@babel/core@^7.11.6", "@babel/core@^7.12.3": - version "7.20.12" - resolved "https://registry.yarnpkg.com/@babel/core/-/core-7.20.12.tgz#7930db57443c6714ad216953d1356dac0eb8496d" - integrity sha512-XsMfHovsUYHFMdrIHkZphTN/2Hzzi78R08NuHfDBehym2VsPDL6Zn/JAD/JQdnRvbSsbQc4mVaU1m6JgtTEElg== - dependencies: - "@ampproject/remapping" "^2.1.0" - "@babel/code-frame" "^7.18.6" - "@babel/generator" "^7.20.7" - "@babel/helper-compilation-targets" "^7.20.7" - "@babel/helper-module-transforms" "^7.20.11" - "@babel/helpers" "^7.20.7" - "@babel/parser" "^7.20.7" + version "7.21.8" + resolved "https://registry.yarnpkg.com/@babel/core/-/core-7.21.8.tgz#2a8c7f0f53d60100ba4c32470ba0281c92aa9aa4" + integrity sha512-YeM22Sondbo523Sz0+CirSPnbj9bG3P0CdHcBZdqUuaeOaYEFbOLoGU7lebvGP6P5J/WE9wOn7u7C4J9HvS1xQ== + dependencies: + "@ampproject/remapping" "^2.2.0" + "@babel/code-frame" "^7.21.4" + "@babel/generator" "^7.21.5" + "@babel/helper-compilation-targets" "^7.21.5" + "@babel/helper-module-transforms" "^7.21.5" + "@babel/helpers" "^7.21.5" + "@babel/parser" "^7.21.8" "@babel/template" "^7.20.7" - "@babel/traverse" "^7.20.12" - "@babel/types" "^7.20.7" + "@babel/traverse" "^7.21.5" + "@babel/types" "^7.21.5" convert-source-map "^1.7.0" debug "^4.1.0" gensync "^1.0.0-beta.2" @@ -73,13 +73,14 @@ "@jridgewell/gen-mapping" "^0.3.2" jsesc "^2.5.1" -"@babel/generator@^7.18.10", "@babel/generator@^7.20.7": - version "7.20.7" - resolved "https://registry.yarnpkg.com/@babel/generator/-/generator-7.20.7.tgz#f8ef57c8242665c5929fe2e8d82ba75460187b4a" - integrity sha512-7wqMOJq8doJMZmP4ApXTzLxSr7+oO2jroJURrVEp6XShrQUObV8Tq/D0NCcoYg2uHqUrjzO0zwBjoYzelxK+sw== +"@babel/generator@^7.18.10", "@babel/generator@^7.21.5": + version "7.21.5" + resolved "https://registry.yarnpkg.com/@babel/generator/-/generator-7.21.5.tgz#c0c0e5449504c7b7de8236d99338c3e2a340745f" + integrity sha512-SrKK/sRv8GesIW1bDagf9cCG38IOMYZusoe1dfg0D8aiUe3Amvoj1QtjTPAWcfrZFvIwlleLb0gxzQidL9w14w== dependencies: - "@babel/types" "^7.20.7" + "@babel/types" "^7.21.5" "@jridgewell/gen-mapping" "^0.3.2" + "@jridgewell/trace-mapping" "^0.3.17" jsesc "^2.5.1" "@babel/helper-annotate-as-pure@^7.18.6": @@ -90,45 +91,46 @@ "@babel/types" "^7.18.6" "@babel/helper-builder-binary-assignment-operator-visitor@^7.18.6": - version "7.18.9" - resolved "https://registry.yarnpkg.com/@babel/helper-builder-binary-assignment-operator-visitor/-/helper-builder-binary-assignment-operator-visitor-7.18.9.tgz#acd4edfd7a566d1d51ea975dff38fd52906981bb" - integrity sha512-yFQ0YCHoIqarl8BCRwBL8ulYUaZpz3bNsA7oFepAzee+8/+ImtADXNOmO5vJvsPff3qi+hvpkY/NYBTrBQgdNw== + version "7.21.5" + resolved "https://registry.yarnpkg.com/@babel/helper-builder-binary-assignment-operator-visitor/-/helper-builder-binary-assignment-operator-visitor-7.21.5.tgz#817f73b6c59726ab39f6ba18c234268a519e5abb" + integrity sha512-uNrjKztPLkUk7bpCNC0jEKDJzzkvel/W+HguzbN8krA+LPfC1CEobJEvAvGka2A/M+ViOqXdcRL0GqPUJSjx9g== dependencies: - "@babel/helper-explode-assignable-expression" "^7.18.6" - "@babel/types" "^7.18.9" + "@babel/types" "^7.21.5" -"@babel/helper-compilation-targets@^7.17.7", "@babel/helper-compilation-targets@^7.18.9", "@babel/helper-compilation-targets@^7.20.7": - version "7.20.7" - resolved "https://registry.yarnpkg.com/@babel/helper-compilation-targets/-/helper-compilation-targets-7.20.7.tgz#a6cd33e93629f5eb473b021aac05df62c4cd09bb" - integrity sha512-4tGORmfQcrc+bvrjb5y3dG9Mx1IOZjsHqQVUz7XCNHO+iTmqxWnVg3KRygjGmpRLJGdQSKuvFinbIb0CnZwHAQ== +"@babel/helper-compilation-targets@^7.17.7", "@babel/helper-compilation-targets@^7.18.9", "@babel/helper-compilation-targets@^7.20.7", "@babel/helper-compilation-targets@^7.21.5": + version "7.21.5" + resolved "https://registry.yarnpkg.com/@babel/helper-compilation-targets/-/helper-compilation-targets-7.21.5.tgz#631e6cc784c7b660417421349aac304c94115366" + integrity sha512-1RkbFGUKex4lvsB9yhIfWltJM5cZKUftB2eNajaDv3dCMEp49iBG0K14uH8NnX9IPux2+mK7JGEOB0jn48/J6w== dependencies: - "@babel/compat-data" "^7.20.5" - "@babel/helper-validator-option" "^7.18.6" + "@babel/compat-data" "^7.21.5" + "@babel/helper-validator-option" "^7.21.0" browserslist "^4.21.3" lru-cache "^5.1.1" semver "^6.3.0" -"@babel/helper-create-class-features-plugin@^7.18.6", "@babel/helper-create-class-features-plugin@^7.20.12", "@babel/helper-create-class-features-plugin@^7.20.5", "@babel/helper-create-class-features-plugin@^7.20.7": - version "7.20.12" - resolved "https://registry.yarnpkg.com/@babel/helper-create-class-features-plugin/-/helper-create-class-features-plugin-7.20.12.tgz#4349b928e79be05ed2d1643b20b99bb87c503819" - integrity sha512-9OunRkbT0JQcednL0UFvbfXpAsUXiGjUk0a7sN8fUXX7Mue79cUSMjHGDRRi/Vz9vYlpIhLV5fMD5dKoMhhsNQ== +"@babel/helper-create-class-features-plugin@^7.18.6", "@babel/helper-create-class-features-plugin@^7.21.0": + version "7.21.8" + resolved "https://registry.yarnpkg.com/@babel/helper-create-class-features-plugin/-/helper-create-class-features-plugin-7.21.8.tgz#205b26330258625ef8869672ebca1e0dee5a0f02" + integrity sha512-+THiN8MqiH2AczyuZrnrKL6cAxFRRQDKW9h1YkBvbgKmAm6mwiacig1qT73DHIWMGo40GRnsEfN3LA+E6NtmSw== dependencies: "@babel/helper-annotate-as-pure" "^7.18.6" - "@babel/helper-environment-visitor" "^7.18.9" - "@babel/helper-function-name" "^7.19.0" - "@babel/helper-member-expression-to-functions" "^7.20.7" + "@babel/helper-environment-visitor" "^7.21.5" + "@babel/helper-function-name" "^7.21.0" + "@babel/helper-member-expression-to-functions" "^7.21.5" "@babel/helper-optimise-call-expression" "^7.18.6" - "@babel/helper-replace-supers" "^7.20.7" + "@babel/helper-replace-supers" "^7.21.5" "@babel/helper-skip-transparent-expression-wrappers" "^7.20.0" "@babel/helper-split-export-declaration" "^7.18.6" + semver "^6.3.0" "@babel/helper-create-regexp-features-plugin@^7.18.6", "@babel/helper-create-regexp-features-plugin@^7.20.5": - version "7.20.5" - resolved "https://registry.yarnpkg.com/@babel/helper-create-regexp-features-plugin/-/helper-create-regexp-features-plugin-7.20.5.tgz#5ea79b59962a09ec2acf20a963a01ab4d076ccca" - integrity sha512-m68B1lkg3XDGX5yCvGO0kPx3v9WIYLnzjKfPcQiwntEQa5ZeRkPmo2X/ISJc8qxWGfwUr+kvZAeEzAwLec2r2w== + version "7.21.8" + resolved "https://registry.yarnpkg.com/@babel/helper-create-regexp-features-plugin/-/helper-create-regexp-features-plugin-7.21.8.tgz#a7886f61c2e29e21fd4aaeaf1e473deba6b571dc" + integrity sha512-zGuSdedkFtsFHGbexAvNuipg1hbtitDLo2XE8/uf6Y9sOQV1xsYX/2pNbtedp/X0eU1pIt+kGvaqHCowkRbS5g== dependencies: "@babel/helper-annotate-as-pure" "^7.18.6" - regexpu-core "^5.2.1" + regexpu-core "^5.3.1" + semver "^6.3.0" "@babel/helper-define-polyfill-provider@^0.3.2", "@babel/helper-define-polyfill-provider@^0.3.3": version "0.3.3" @@ -142,25 +144,18 @@ resolve "^1.14.2" semver "^6.1.2" -"@babel/helper-environment-visitor@^7.18.9": - version "7.18.9" - resolved "https://registry.yarnpkg.com/@babel/helper-environment-visitor/-/helper-environment-visitor-7.18.9.tgz#0c0cee9b35d2ca190478756865bb3528422f51be" - integrity sha512-3r/aACDJ3fhQ/EVgFy0hpj8oHyHpQc+LPtJoY9SzTThAsStm4Ptegq92vqKoE3vD706ZVFWITnMnxucw+S9Ipg== +"@babel/helper-environment-visitor@^7.18.9", "@babel/helper-environment-visitor@^7.21.5": + version "7.21.5" + resolved "https://registry.yarnpkg.com/@babel/helper-environment-visitor/-/helper-environment-visitor-7.21.5.tgz#c769afefd41d171836f7cb63e295bedf689d48ba" + integrity sha512-IYl4gZ3ETsWocUWgsFZLM5i1BYx9SoemminVEXadgLBa9TdeorzgLKm8wWLA6J1N/kT3Kch8XIk1laNzYoHKvQ== -"@babel/helper-explode-assignable-expression@^7.18.6": - version "7.18.6" - resolved "https://registry.yarnpkg.com/@babel/helper-explode-assignable-expression/-/helper-explode-assignable-expression-7.18.6.tgz#41f8228ef0a6f1a036b8dfdfec7ce94f9a6bc096" - integrity sha512-eyAYAsQmB80jNfg4baAtLeWAQHfHFiR483rzFK+BhETlGZaQC9bsfrugfXDCbRHLQbIA7U5NxhhOxN7p/dWIcg== +"@babel/helper-function-name@^7.18.9", "@babel/helper-function-name@^7.19.0", "@babel/helper-function-name@^7.21.0": + version "7.21.0" + resolved "https://registry.yarnpkg.com/@babel/helper-function-name/-/helper-function-name-7.21.0.tgz#d552829b10ea9f120969304023cd0645fa00b1b4" + integrity sha512-HfK1aMRanKHpxemaY2gqBmL04iAPOPRj7DxtNbiDOrJK+gdwkiNRVpCpUJYbUT+aZyemKN8brqTOxzCaG6ExRg== dependencies: - "@babel/types" "^7.18.6" - -"@babel/helper-function-name@^7.18.9", "@babel/helper-function-name@^7.19.0": - version "7.19.0" - resolved "https://registry.yarnpkg.com/@babel/helper-function-name/-/helper-function-name-7.19.0.tgz#941574ed5390682e872e52d3f38ce9d1bef4648c" - integrity sha512-WAwHBINyrpqywkUH0nTnNgI5ina5TFn85HKS0pbPDfxFfhyR/aNQEn4hGi1P1JyT//I0t4OgXUlofzWILRvS5w== - dependencies: - "@babel/template" "^7.18.10" - "@babel/types" "^7.19.0" + "@babel/template" "^7.20.7" + "@babel/types" "^7.21.0" "@babel/helper-hoist-variables@^7.18.6": version "7.18.6" @@ -169,33 +164,33 @@ dependencies: "@babel/types" "^7.18.6" -"@babel/helper-member-expression-to-functions@^7.20.7": - version "7.20.7" - resolved "https://registry.yarnpkg.com/@babel/helper-member-expression-to-functions/-/helper-member-expression-to-functions-7.20.7.tgz#a6f26e919582275a93c3aa6594756d71b0bb7f05" - integrity sha512-9J0CxJLq315fEdi4s7xK5TQaNYjZw+nDVpVqr1axNGKzdrdwYBD5b4uKv3n75aABG0rCCTK8Im8Ww7eYfMrZgw== +"@babel/helper-member-expression-to-functions@^7.21.5": + version "7.21.5" + resolved "https://registry.yarnpkg.com/@babel/helper-member-expression-to-functions/-/helper-member-expression-to-functions-7.21.5.tgz#3b1a009af932e586af77c1030fba9ee0bde396c0" + integrity sha512-nIcGfgwpH2u4n9GG1HpStW5Ogx7x7ekiFHbjjFRKXbn5zUvqO9ZgotCO4x1aNbKn/x/xOUaXEhyNHCwtFCpxWg== dependencies: - "@babel/types" "^7.20.7" + "@babel/types" "^7.21.5" -"@babel/helper-module-imports@^7.18.6": - version "7.18.6" - resolved "https://registry.yarnpkg.com/@babel/helper-module-imports/-/helper-module-imports-7.18.6.tgz#1e3ebdbbd08aad1437b428c50204db13c5a3ca6e" - integrity sha512-0NFvs3VkuSYbFi1x2Vd6tKrywq+z/cLeYC/RJNFrIX/30Bf5aiGYbtvGXolEktzJH8o5E5KJ3tT+nkxuuZFVlA== +"@babel/helper-module-imports@^7.18.6", "@babel/helper-module-imports@^7.21.4": + version "7.21.4" + resolved "https://registry.yarnpkg.com/@babel/helper-module-imports/-/helper-module-imports-7.21.4.tgz#ac88b2f76093637489e718a90cec6cf8a9b029af" + integrity sha512-orajc5T2PsRYUN3ZryCEFeMDYwyw09c/pZeaQEZPH0MpKzSvn3e0uXsDBu3k03VI+9DBiRo+l22BfKTpKwa/Wg== dependencies: - "@babel/types" "^7.18.6" + "@babel/types" "^7.21.4" -"@babel/helper-module-transforms@^7.18.6", "@babel/helper-module-transforms@^7.18.9", "@babel/helper-module-transforms@^7.20.11": - version "7.20.11" - resolved "https://registry.yarnpkg.com/@babel/helper-module-transforms/-/helper-module-transforms-7.20.11.tgz#df4c7af713c557938c50ea3ad0117a7944b2f1b0" - integrity sha512-uRy78kN4psmji1s2QtbtcCSaj/LILFDp0f/ymhpQH5QY3nljUZCaNWz9X1dEj/8MBdBEFECs7yRhKn8i7NjZgg== +"@babel/helper-module-transforms@^7.18.6", "@babel/helper-module-transforms@^7.18.9", "@babel/helper-module-transforms@^7.20.11", "@babel/helper-module-transforms@^7.21.5": + version "7.21.5" + resolved "https://registry.yarnpkg.com/@babel/helper-module-transforms/-/helper-module-transforms-7.21.5.tgz#d937c82e9af68d31ab49039136a222b17ac0b420" + integrity sha512-bI2Z9zBGY2q5yMHoBvJ2a9iX3ZOAzJPm7Q8Yz6YeoUjU/Cvhmi2G4QyTNyPBqqXSgTjUxRg3L0xV45HvkNWWBw== dependencies: - "@babel/helper-environment-visitor" "^7.18.9" - "@babel/helper-module-imports" "^7.18.6" - "@babel/helper-simple-access" "^7.20.2" + "@babel/helper-environment-visitor" "^7.21.5" + "@babel/helper-module-imports" "^7.21.4" + "@babel/helper-simple-access" "^7.21.5" "@babel/helper-split-export-declaration" "^7.18.6" "@babel/helper-validator-identifier" "^7.19.1" "@babel/template" "^7.20.7" - "@babel/traverse" "^7.20.10" - "@babel/types" "^7.20.7" + "@babel/traverse" "^7.21.5" + "@babel/types" "^7.21.5" "@babel/helper-optimise-call-expression@^7.18.6": version "7.18.6" @@ -204,10 +199,10 @@ dependencies: "@babel/types" "^7.18.6" -"@babel/helper-plugin-utils@^7.0.0", "@babel/helper-plugin-utils@^7.10.4", "@babel/helper-plugin-utils@^7.12.13", "@babel/helper-plugin-utils@^7.14.5", "@babel/helper-plugin-utils@^7.16.7", "@babel/helper-plugin-utils@^7.18.6", "@babel/helper-plugin-utils@^7.18.9", "@babel/helper-plugin-utils@^7.19.0", "@babel/helper-plugin-utils@^7.20.2", "@babel/helper-plugin-utils@^7.8.0", "@babel/helper-plugin-utils@^7.8.3": - version "7.20.2" - resolved "https://registry.yarnpkg.com/@babel/helper-plugin-utils/-/helper-plugin-utils-7.20.2.tgz#d1b9000752b18d0877cff85a5c376ce5c3121629" - integrity sha512-8RvlJG2mj4huQ4pZ+rU9lqKi9ZKiRmuvGuM2HlWmkmgOhbs6zEAw6IEiJ5cQqGbDzGZOhwuOQNtZMi/ENLjZoQ== +"@babel/helper-plugin-utils@^7.0.0", "@babel/helper-plugin-utils@^7.10.4", "@babel/helper-plugin-utils@^7.12.13", "@babel/helper-plugin-utils@^7.14.5", "@babel/helper-plugin-utils@^7.16.7", "@babel/helper-plugin-utils@^7.18.6", "@babel/helper-plugin-utils@^7.18.9", "@babel/helper-plugin-utils@^7.19.0", "@babel/helper-plugin-utils@^7.20.2", "@babel/helper-plugin-utils@^7.21.5", "@babel/helper-plugin-utils@^7.8.0", "@babel/helper-plugin-utils@^7.8.3": + version "7.21.5" + resolved "https://registry.yarnpkg.com/@babel/helper-plugin-utils/-/helper-plugin-utils-7.21.5.tgz#345f2377d05a720a4e5ecfa39cbf4474a4daed56" + integrity sha512-0WDaIlXKOX/3KfBK/dwP1oQGiPh6rjMkT7HIRv7i5RR2VUMwrx5ZL0dwBkKx7+SW1zwNdgjHd34IMk5ZjTeHVg== "@babel/helper-remap-async-to-generator@^7.18.9": version "7.18.9" @@ -219,24 +214,24 @@ "@babel/helper-wrap-function" "^7.18.9" "@babel/types" "^7.18.9" -"@babel/helper-replace-supers@^7.18.6", "@babel/helper-replace-supers@^7.20.7": - version "7.20.7" - resolved "https://registry.yarnpkg.com/@babel/helper-replace-supers/-/helper-replace-supers-7.20.7.tgz#243ecd2724d2071532b2c8ad2f0f9f083bcae331" - integrity sha512-vujDMtB6LVfNW13jhlCrp48QNslK6JXi7lQG736HVbHz/mbf4Dc7tIRh1Xf5C0rF7BP8iiSxGMCmY6Ci1ven3A== +"@babel/helper-replace-supers@^7.18.6", "@babel/helper-replace-supers@^7.20.7", "@babel/helper-replace-supers@^7.21.5": + version "7.21.5" + resolved "https://registry.yarnpkg.com/@babel/helper-replace-supers/-/helper-replace-supers-7.21.5.tgz#a6ad005ba1c7d9bc2973dfde05a1bba7065dde3c" + integrity sha512-/y7vBgsr9Idu4M6MprbOVUfH3vs7tsIfnVWv/Ml2xgwvyH6LTngdfbf5AdsKwkJy4zgy1X/kuNrEKvhhK28Yrg== dependencies: - "@babel/helper-environment-visitor" "^7.18.9" - "@babel/helper-member-expression-to-functions" "^7.20.7" + "@babel/helper-environment-visitor" "^7.21.5" + "@babel/helper-member-expression-to-functions" "^7.21.5" "@babel/helper-optimise-call-expression" "^7.18.6" "@babel/template" "^7.20.7" - "@babel/traverse" "^7.20.7" - "@babel/types" "^7.20.7" + "@babel/traverse" "^7.21.5" + "@babel/types" "^7.21.5" -"@babel/helper-simple-access@^7.20.2": - version "7.20.2" - resolved "https://registry.yarnpkg.com/@babel/helper-simple-access/-/helper-simple-access-7.20.2.tgz#0ab452687fe0c2cfb1e2b9e0015de07fc2d62dd9" - integrity sha512-+0woI/WPq59IrqDYbVGfshjT5Dmk/nnbdpcF8SnMhhXObpTq2KNBdLFRFrkVdbDOyUmHBCxzm5FHV1rACIkIbA== +"@babel/helper-simple-access@^7.21.5": + version "7.21.5" + resolved "https://registry.yarnpkg.com/@babel/helper-simple-access/-/helper-simple-access-7.21.5.tgz#d697a7971a5c39eac32c7e63c0921c06c8a249ee" + integrity sha512-ENPDAMC1wAjR0uaCUwliBdiSl1KBJAVnMTzXqi64c2MG8MPR6ii4qf7bSXDqSFbr4W6W028/rf5ivoHop5/mkg== dependencies: - "@babel/types" "^7.20.2" + "@babel/types" "^7.21.5" "@babel/helper-skip-transparent-expression-wrappers@^7.20.0": version "7.20.0" @@ -252,20 +247,20 @@ dependencies: "@babel/types" "^7.18.6" -"@babel/helper-string-parser@^7.18.10", "@babel/helper-string-parser@^7.19.4": - version "7.19.4" - resolved "https://registry.yarnpkg.com/@babel/helper-string-parser/-/helper-string-parser-7.19.4.tgz#38d3acb654b4701a9b77fb0615a96f775c3a9e63" - integrity sha512-nHtDoQcuqFmwYNYPz3Rah5ph2p8PFeFCsZk9A/48dPc/rGocJ5J3hAAZ7pb76VWX3fZKu+uEr/FhH5jLx7umrw== +"@babel/helper-string-parser@^7.18.10", "@babel/helper-string-parser@^7.21.5": + version "7.21.5" + resolved "https://registry.yarnpkg.com/@babel/helper-string-parser/-/helper-string-parser-7.21.5.tgz#2b3eea65443c6bdc31c22d037c65f6d323b6b2bd" + integrity sha512-5pTUx3hAJaZIdW99sJ6ZUUgWq/Y+Hja7TowEnLNMm1VivRgZQL3vpBY3qUACVsvw+yQU6+YgfBVmcbLaZtrA1w== "@babel/helper-validator-identifier@^7.18.6", "@babel/helper-validator-identifier@^7.19.1": version "7.19.1" resolved "https://registry.yarnpkg.com/@babel/helper-validator-identifier/-/helper-validator-identifier-7.19.1.tgz#7eea834cf32901ffdc1a7ee555e2f9c27e249ca2" integrity sha512-awrNfaMtnHUr653GgGEs++LlAvW6w+DcPrOliSMXWCKo597CwL5Acf/wWdNkf/tfEQE3mjkeD1YOVZOUV/od1w== -"@babel/helper-validator-option@^7.18.6": - version "7.18.6" - resolved "https://registry.yarnpkg.com/@babel/helper-validator-option/-/helper-validator-option-7.18.6.tgz#bf0d2b5a509b1f336099e4ff36e1a63aa5db4db8" - integrity sha512-XO7gESt5ouv/LRJdrVjkShckw6STTaB7l9BrpBaAHDeF5YZT+01PCwmR0SJHnkW6i8OwW/EVWRShfi4j2x+KQw== +"@babel/helper-validator-option@^7.18.6", "@babel/helper-validator-option@^7.21.0": + version "7.21.0" + resolved "https://registry.yarnpkg.com/@babel/helper-validator-option/-/helper-validator-option-7.21.0.tgz#8224c7e13ace4bafdc4004da2cf064ef42673180" + integrity sha512-rmL/B8/f0mKS2baE9ZpyTcTavvEuWhTTW8amjzXNvYG4AwBsqTLikfXsEofsJEfKHf+HQVQbFOHy6o+4cnC/fQ== "@babel/helper-wrap-function@^7.18.9": version "7.20.5" @@ -277,14 +272,14 @@ "@babel/traverse" "^7.20.5" "@babel/types" "^7.20.5" -"@babel/helpers@^7.18.9", "@babel/helpers@^7.20.7": - version "7.20.13" - resolved "https://registry.yarnpkg.com/@babel/helpers/-/helpers-7.20.13.tgz#e3cb731fb70dc5337134cadc24cbbad31cc87ad2" - integrity sha512-nzJ0DWCL3gB5RCXbUO3KIMMsBY2Eqbx8mBpKGE/02PgyRQFcPQLbkQ1vyy596mZLaP+dAfD+R4ckASzNVmW3jg== +"@babel/helpers@^7.18.9", "@babel/helpers@^7.21.5": + version "7.21.5" + resolved "https://registry.yarnpkg.com/@babel/helpers/-/helpers-7.21.5.tgz#5bac66e084d7a4d2d9696bdf0175a93f7fb63c08" + integrity sha512-BSY+JSlHxOmGsPTydUkPf1MdMQ3M81x5xGCOVgWM3G8XH77sJ292Y2oqcp0CbbgxhqBuI46iUz1tT7hqP7EfgA== dependencies: "@babel/template" "^7.20.7" - "@babel/traverse" "^7.20.13" - "@babel/types" "^7.20.7" + "@babel/traverse" "^7.21.5" + "@babel/types" "^7.21.5" "@babel/highlight@^7.18.6": version "7.18.6" @@ -300,10 +295,10 @@ resolved "https://registry.yarnpkg.com/@babel/parser/-/parser-7.18.11.tgz#68bb07ab3d380affa9a3f96728df07969645d2d9" integrity sha512-9JKn5vN+hDt0Hdqn1PiJ2guflwP+B6Ga8qbDuoF0PzzVhrzsKIJo8yGqVk6CmMHiMei9w1C1Bp9IMJSIK+HPIQ== -"@babel/parser@^7.14.7", "@babel/parser@^7.18.10", "@babel/parser@^7.18.11", "@babel/parser@^7.20.13", "@babel/parser@^7.20.7": - version "7.20.13" - resolved "https://registry.yarnpkg.com/@babel/parser/-/parser-7.20.13.tgz#ddf1eb5a813588d2fb1692b70c6fce75b945c088" - integrity sha512-gFDLKMfpiXCsjt4za2JA9oTMn70CeseCehb11kRZgvd7+F67Hih3OHOK24cRrWECJ/ljfPGac6ygXAs/C8kIvw== +"@babel/parser@^7.14.7", "@babel/parser@^7.18.10", "@babel/parser@^7.18.11", "@babel/parser@^7.20.7", "@babel/parser@^7.21.5", "@babel/parser@^7.21.8": + version "7.21.8" + resolved "https://registry.yarnpkg.com/@babel/parser/-/parser-7.21.8.tgz#642af7d0333eab9c0ad70b14ac5e76dbde7bfdf8" + integrity sha512-6zavDGdzG3gUqAdWvlLFfk+36RilI+Pwyuuh7HItyeScCWP3k6i8vKclAQ0bM/0y/Kz/xiwvxhMv9MgTJP5gmA== "@babel/plugin-bugfix-safari-id-destructuring-collision-in-function-expression@^7.18.6": version "7.18.6" @@ -340,11 +335,11 @@ "@babel/helper-plugin-utils" "^7.18.6" "@babel/plugin-proposal-class-static-block@^7.18.6": - version "7.20.7" - resolved "https://registry.yarnpkg.com/@babel/plugin-proposal-class-static-block/-/plugin-proposal-class-static-block-7.20.7.tgz#92592e9029b13b15be0f7ce6a7aedc2879ca45a7" - integrity sha512-AveGOoi9DAjUYYuUAG//Ig69GlazLnoyzMw68VCDux+c1tsnnH/OkYcpz/5xzMkEFC6UxjR5Gw1c+iY2wOGVeQ== + version "7.21.0" + resolved "https://registry.yarnpkg.com/@babel/plugin-proposal-class-static-block/-/plugin-proposal-class-static-block-7.21.0.tgz#77bdd66fb7b605f3a61302d224bdfacf5547977d" + integrity sha512-XP5G9MWNUskFuP30IfFSEFB0Z6HzLIUcjYM4bYOPHXl7eiJ9HFv8tWj6TXTN5QODiEhDZAeI4hLok2iHFFV4hw== dependencies: - "@babel/helper-create-class-features-plugin" "^7.20.7" + "@babel/helper-create-class-features-plugin" "^7.21.0" "@babel/helper-plugin-utils" "^7.20.2" "@babel/plugin-syntax-class-static-block" "^7.14.5" @@ -435,9 +430,9 @@ "@babel/plugin-syntax-optional-catch-binding" "^7.8.3" "@babel/plugin-proposal-optional-chaining@^7.18.9", "@babel/plugin-proposal-optional-chaining@^7.20.7": - version "7.20.7" - resolved "https://registry.yarnpkg.com/@babel/plugin-proposal-optional-chaining/-/plugin-proposal-optional-chaining-7.20.7.tgz#49f2b372519ab31728cc14115bb0998b15bfda55" - integrity sha512-T+A7b1kfjtRM51ssoOfS1+wbyCVqorfyZhT99TvxxLMirPShD8CzKMRepMlCBGM5RpHMbn8s+5MMHnPstJH6mQ== + version "7.21.0" + resolved "https://registry.yarnpkg.com/@babel/plugin-proposal-optional-chaining/-/plugin-proposal-optional-chaining-7.21.0.tgz#886f5c8978deb7d30f678b2e24346b287234d3ea" + integrity sha512-p4zeefM72gpmEe2fkUr/OnOXpWEf8nAgk7ZYVqqfFiyIG7oFfVZcCrU64hWn5xp4tQ9LkV4bTIa5rD0KANpKNA== dependencies: "@babel/helper-plugin-utils" "^7.20.2" "@babel/helper-skip-transparent-expression-wrappers" "^7.20.0" @@ -452,12 +447,12 @@ "@babel/helper-plugin-utils" "^7.18.6" "@babel/plugin-proposal-private-property-in-object@^7.18.6": - version "7.20.5" - resolved "https://registry.yarnpkg.com/@babel/plugin-proposal-private-property-in-object/-/plugin-proposal-private-property-in-object-7.20.5.tgz#309c7668f2263f1c711aa399b5a9a6291eef6135" - integrity sha512-Vq7b9dUA12ByzB4EjQTPo25sFhY+08pQDBSZRtUAkj7lb7jahaHR5igera16QZ+3my1nYR4dKsNdYj5IjPHilQ== + version "7.21.0" + resolved "https://registry.yarnpkg.com/@babel/plugin-proposal-private-property-in-object/-/plugin-proposal-private-property-in-object-7.21.0.tgz#19496bd9883dd83c23c7d7fc45dcd9ad02dfa1dc" + integrity sha512-ha4zfehbJjc5MmXBlHec1igel5TJXXLDDRbuJ4+XT2TJcyD9/V1919BA8gMvsdHcNMBy4WBUBiRb3nw/EQUtBw== dependencies: "@babel/helper-annotate-as-pure" "^7.18.6" - "@babel/helper-create-class-features-plugin" "^7.20.5" + "@babel/helper-create-class-features-plugin" "^7.21.0" "@babel/helper-plugin-utils" "^7.20.2" "@babel/plugin-syntax-private-property-in-object" "^7.14.5" @@ -525,6 +520,13 @@ dependencies: "@babel/helper-plugin-utils" "^7.8.0" +"@babel/plugin-syntax-jsx@^7.21.4": + version "7.21.4" + resolved "https://registry.yarnpkg.com/@babel/plugin-syntax-jsx/-/plugin-syntax-jsx-7.21.4.tgz#f264ed7bf40ffc9ec239edabc17a50c4f5b6fea2" + integrity sha512-5hewiLct5OKyh6PLKEYaFclcqtIgCb6bmELouxjF6up5q3Sov7rOayW4RwhbaBL0dit8rA80GNfY+UuDp2mBbQ== + dependencies: + "@babel/helper-plugin-utils" "^7.20.2" + "@babel/plugin-syntax-logical-assignment-operators@^7.10.4": version "7.10.4" resolved "https://registry.yarnpkg.com/@babel/plugin-syntax-logical-assignment-operators/-/plugin-syntax-logical-assignment-operators-7.10.4.tgz#ca91ef46303530448b906652bac2e9fe9941f699" @@ -582,18 +584,18 @@ "@babel/helper-plugin-utils" "^7.14.5" "@babel/plugin-syntax-typescript@^7.20.0": - version "7.20.0" - resolved "https://registry.yarnpkg.com/@babel/plugin-syntax-typescript/-/plugin-syntax-typescript-7.20.0.tgz#4e9a0cfc769c85689b77a2e642d24e9f697fc8c7" - integrity sha512-rd9TkG+u1CExzS4SM1BlMEhMXwFLKVjOAFFCDx9PbX5ycJWDoWMcwdJH9RhkPu1dOgn5TrxLot/Gx6lWFuAUNQ== + version "7.21.4" + resolved "https://registry.yarnpkg.com/@babel/plugin-syntax-typescript/-/plugin-syntax-typescript-7.21.4.tgz#2751948e9b7c6d771a8efa59340c15d4a2891ff8" + integrity sha512-xz0D39NvhQn4t4RNsHmDnnsaQizIlUkdtYvLs8La1BlfjQ6JEwxkJGeqJMW2tAXx+q6H+WFuUTXNdYVpEya0YA== dependencies: - "@babel/helper-plugin-utils" "^7.19.0" + "@babel/helper-plugin-utils" "^7.20.2" "@babel/plugin-transform-arrow-functions@^7.18.6": - version "7.20.7" - resolved "https://registry.yarnpkg.com/@babel/plugin-transform-arrow-functions/-/plugin-transform-arrow-functions-7.20.7.tgz#bea332b0e8b2dab3dafe55a163d8227531ab0551" - integrity sha512-3poA5E7dzDomxj9WXWwuD6A5F3kc7VXwIJO+E+J8qtDtS+pXPAhrgEyh+9GBwBgPq1Z+bB+/JD60lp5jsN7JPQ== + version "7.21.5" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-arrow-functions/-/plugin-transform-arrow-functions-7.21.5.tgz#9bb42a53de447936a57ba256fbf537fc312b6929" + integrity sha512-wb1mhwGOCaXHDTcsRYMKF9e5bbMgqwxtqa2Y1ifH96dXJPwbuLX9qHy3clhrxVqgMz7nyNXs8VkxdH8UBcjKqA== dependencies: - "@babel/helper-plugin-utils" "^7.20.2" + "@babel/helper-plugin-utils" "^7.21.5" "@babel/plugin-transform-async-to-generator@^7.18.6": version "7.20.7" @@ -612,21 +614,21 @@ "@babel/helper-plugin-utils" "^7.18.6" "@babel/plugin-transform-block-scoping@^7.18.9": - version "7.20.11" - resolved "https://registry.yarnpkg.com/@babel/plugin-transform-block-scoping/-/plugin-transform-block-scoping-7.20.11.tgz#9f5a3424bd112a3f32fe0cf9364fbb155cff262a" - integrity sha512-tA4N427a7fjf1P0/2I4ScsHGc5jcHPbb30xMbaTke2gxDuWpUfXDuX1FEymJwKk4tuGUvGcejAR6HdZVqmmPyw== + version "7.21.0" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-block-scoping/-/plugin-transform-block-scoping-7.21.0.tgz#e737b91037e5186ee16b76e7ae093358a5634f02" + integrity sha512-Mdrbunoh9SxwFZapeHVrwFmri16+oYotcZysSzhNIVDwIAb1UV+kvnxULSYq9J3/q5MDG+4X6w8QVgD1zhBXNQ== dependencies: "@babel/helper-plugin-utils" "^7.20.2" "@babel/plugin-transform-classes@^7.18.9": - version "7.20.7" - resolved "https://registry.yarnpkg.com/@babel/plugin-transform-classes/-/plugin-transform-classes-7.20.7.tgz#f438216f094f6bb31dc266ebfab8ff05aecad073" - integrity sha512-LWYbsiXTPKl+oBlXUGlwNlJZetXD5Am+CyBdqhPsDVjM9Jc8jwBJFrKhHf900Kfk2eZG1y9MAG3UNajol7A4VQ== + version "7.21.0" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-classes/-/plugin-transform-classes-7.21.0.tgz#f469d0b07a4c5a7dbb21afad9e27e57b47031665" + integrity sha512-RZhbYTCEUAe6ntPehC4hlslPWosNHDox+vAs4On/mCLRLfoDVHf6hVEd7kuxr1RnHwJmxFfUM3cZiZRmPxJPXQ== dependencies: "@babel/helper-annotate-as-pure" "^7.18.6" "@babel/helper-compilation-targets" "^7.20.7" "@babel/helper-environment-visitor" "^7.18.9" - "@babel/helper-function-name" "^7.19.0" + "@babel/helper-function-name" "^7.21.0" "@babel/helper-optimise-call-expression" "^7.18.6" "@babel/helper-plugin-utils" "^7.20.2" "@babel/helper-replace-supers" "^7.20.7" @@ -634,17 +636,17 @@ globals "^11.1.0" "@babel/plugin-transform-computed-properties@^7.18.9": - version "7.20.7" - resolved "https://registry.yarnpkg.com/@babel/plugin-transform-computed-properties/-/plugin-transform-computed-properties-7.20.7.tgz#704cc2fd155d1c996551db8276d55b9d46e4d0aa" - integrity sha512-Lz7MvBK6DTjElHAmfu6bfANzKcxpyNPeYBGEafyA6E5HtRpjpZwU+u7Qrgz/2OR0z+5TvKYbPdphfSaAcZBrYQ== + version "7.21.5" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-computed-properties/-/plugin-transform-computed-properties-7.21.5.tgz#3a2d8bb771cd2ef1cd736435f6552fe502e11b44" + integrity sha512-TR653Ki3pAwxBxUe8srfF3e4Pe3FTA46uaNHYyQwIoM4oWKSoOZiDNyHJ0oIoDIUPSRQbQG7jzgVBX3FPVne1Q== dependencies: - "@babel/helper-plugin-utils" "^7.20.2" + "@babel/helper-plugin-utils" "^7.21.5" "@babel/template" "^7.20.7" "@babel/plugin-transform-destructuring@^7.18.9": - version "7.20.7" - resolved "https://registry.yarnpkg.com/@babel/plugin-transform-destructuring/-/plugin-transform-destructuring-7.20.7.tgz#8bda578f71620c7de7c93af590154ba331415454" - integrity sha512-Xwg403sRrZb81IVB79ZPqNQME23yhugYVqgTxAhT99h485F4f+GMELFhhOsscDUB7HCswepKeCKLn/GZvUKoBA== + version "7.21.3" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-destructuring/-/plugin-transform-destructuring-7.21.3.tgz#73b46d0fd11cd6ef57dea8a381b1215f4959d401" + integrity sha512-bp6hwMFzuiE4HqYEyoGJ/V2LeIWn+hLVKc4pnj++E5XQptwhtcGmSayM029d/j2X1bPKGTlsyPwAubuU22KhMA== dependencies: "@babel/helper-plugin-utils" "^7.20.2" @@ -672,11 +674,11 @@ "@babel/helper-plugin-utils" "^7.18.6" "@babel/plugin-transform-for-of@^7.18.8": - version "7.18.8" - resolved "https://registry.yarnpkg.com/@babel/plugin-transform-for-of/-/plugin-transform-for-of-7.18.8.tgz#6ef8a50b244eb6a0bdbad0c7c61877e4e30097c1" - integrity sha512-yEfTRnjuskWYo0k1mHUqrVWaZwrdq8AYbfrpqULOJOaucGSp4mNMVps+YtA8byoevxS/urwU75vyhQIxcCgiBQ== + version "7.21.5" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-for-of/-/plugin-transform-for-of-7.21.5.tgz#e890032b535f5a2e237a18535f56a9fdaa7b83fc" + integrity sha512-nYWpjKW/7j/I/mZkGVgHJXh4bA1sfdFnJoOXwJuj4m3Q2EraO/8ZyrkCau9P5tbHQk01RMSt6KYLCsW7730SXQ== dependencies: - "@babel/helper-plugin-utils" "^7.18.6" + "@babel/helper-plugin-utils" "^7.21.5" "@babel/plugin-transform-function-name@^7.18.9": version "7.18.9" @@ -709,14 +711,14 @@ "@babel/helper-module-transforms" "^7.20.11" "@babel/helper-plugin-utils" "^7.20.2" -"@babel/plugin-transform-modules-commonjs@^7.18.6": - version "7.20.11" - resolved "https://registry.yarnpkg.com/@babel/plugin-transform-modules-commonjs/-/plugin-transform-modules-commonjs-7.20.11.tgz#8cb23010869bf7669fd4b3098598b6b2be6dc607" - integrity sha512-S8e1f7WQ7cimJQ51JkAaDrEtohVEitXjgCGAS2N8S31Y42E+kWwfSz83LYz57QdBm7q9diARVqanIaH2oVgQnw== +"@babel/plugin-transform-modules-commonjs@^7.18.6", "@babel/plugin-transform-modules-commonjs@^7.21.5": + version "7.21.5" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-modules-commonjs/-/plugin-transform-modules-commonjs-7.21.5.tgz#d69fb947eed51af91de82e4708f676864e5e47bc" + integrity sha512-OVryBEgKUbtqMoB7eG2rs6UFexJi6Zj6FDXx+esBLPTCxCNxAY9o+8Di7IsUGJ+AVhp5ncK0fxWUBd0/1gPhrQ== dependencies: - "@babel/helper-module-transforms" "^7.20.11" - "@babel/helper-plugin-utils" "^7.20.2" - "@babel/helper-simple-access" "^7.20.2" + "@babel/helper-module-transforms" "^7.21.5" + "@babel/helper-plugin-utils" "^7.21.5" + "@babel/helper-simple-access" "^7.21.5" "@babel/plugin-transform-modules-systemjs@^7.18.9": version "7.20.11" @@ -760,9 +762,9 @@ "@babel/helper-replace-supers" "^7.18.6" "@babel/plugin-transform-parameters@^7.18.8", "@babel/plugin-transform-parameters@^7.20.7": - version "7.20.7" - resolved "https://registry.yarnpkg.com/@babel/plugin-transform-parameters/-/plugin-transform-parameters-7.20.7.tgz#0ee349e9d1bc96e78e3b37a7af423a4078a7083f" - integrity sha512-WiWBIkeHKVOSYPO0pWkxGPfKeWrCJyD3NJ53+Lrp/QMSZbsVPovrVl2aWZ19D/LTVnaDv5Ap7GJ/B2CTOZdrfA== + version "7.21.3" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-parameters/-/plugin-transform-parameters-7.21.3.tgz#18fc4e797cf6d6d972cb8c411dbe8a809fa157db" + integrity sha512-Wxc+TvppQG9xWFYatvCGPvZ6+SIUxQ2ZdiBP+PHYMIjnPXD+uThCshaz4NZOnODAtBjjcVQQ/3OKs9LW28purQ== dependencies: "@babel/helper-plugin-utils" "^7.20.2" @@ -774,11 +776,11 @@ "@babel/helper-plugin-utils" "^7.18.6" "@babel/plugin-transform-regenerator@^7.18.6": - version "7.20.5" - resolved "https://registry.yarnpkg.com/@babel/plugin-transform-regenerator/-/plugin-transform-regenerator-7.20.5.tgz#57cda588c7ffb7f4f8483cc83bdcea02a907f04d" - integrity sha512-kW/oO7HPBtntbsahzQ0qSE3tFvkFwnbozz3NWFhLGqH75vLEg+sCGngLlhVkePlCs3Jv0dBBHDzCHxNiFAQKCQ== + version "7.21.5" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-regenerator/-/plugin-transform-regenerator-7.21.5.tgz#576c62f9923f94bcb1c855adc53561fd7913724e" + integrity sha512-ZoYBKDb6LyMi5yCsByQ5jmXsHAQDDYeexT1Szvlmui+lADvfSecr5Dxd/PkrTC3pAD182Fcju1VQkB4oCp9M+w== dependencies: - "@babel/helper-plugin-utils" "^7.20.2" + "@babel/helper-plugin-utils" "^7.21.5" regenerator-transform "^0.15.1" "@babel/plugin-transform-reserved-words@^7.18.6": @@ -836,21 +838,22 @@ dependencies: "@babel/helper-plugin-utils" "^7.18.9" -"@babel/plugin-transform-typescript@^7.18.6": - version "7.20.13" - resolved "https://registry.yarnpkg.com/@babel/plugin-transform-typescript/-/plugin-transform-typescript-7.20.13.tgz#e3581b356b8694f6ff450211fe6774eaff8d25ab" - integrity sha512-O7I/THxarGcDZxkgWKMUrk7NK1/WbHAg3Xx86gqS6x9MTrNL6AwIluuZ96ms4xeDe6AVx6rjHbWHP7x26EPQBA== +"@babel/plugin-transform-typescript@^7.21.3": + version "7.21.3" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-typescript/-/plugin-transform-typescript-7.21.3.tgz#316c5be579856ea890a57ebc5116c5d064658f2b" + integrity sha512-RQxPz6Iqt8T0uw/WsJNReuBpWpBqs/n7mNo18sKLoTbMp+UrEekhH+pKSVC7gWz+DNjo9gryfV8YzCiT45RgMw== dependencies: - "@babel/helper-create-class-features-plugin" "^7.20.12" + "@babel/helper-annotate-as-pure" "^7.18.6" + "@babel/helper-create-class-features-plugin" "^7.21.0" "@babel/helper-plugin-utils" "^7.20.2" "@babel/plugin-syntax-typescript" "^7.20.0" "@babel/plugin-transform-unicode-escapes@^7.18.10": - version "7.18.10" - resolved "https://registry.yarnpkg.com/@babel/plugin-transform-unicode-escapes/-/plugin-transform-unicode-escapes-7.18.10.tgz#1ecfb0eda83d09bbcb77c09970c2dd55832aa246" - integrity sha512-kKAdAI+YzPgGY/ftStBFXTI1LZFju38rYThnfMykS+IXy8BVx+res7s2fxf1l8I35DV2T97ezo6+SGrXz6B3iQ== + version "7.21.5" + resolved "https://registry.yarnpkg.com/@babel/plugin-transform-unicode-escapes/-/plugin-transform-unicode-escapes-7.21.5.tgz#1e55ed6195259b0e9061d81f5ef45a9b009fb7f2" + integrity sha512-LYm/gTOwZqsYohlvFUe/8Tujz75LqqVC2w+2qPHLR+WyWHGCZPN1KBpJCJn+4Bk4gOkQy/IXKIge6az5MqwlOg== dependencies: - "@babel/helper-plugin-utils" "^7.18.9" + "@babel/helper-plugin-utils" "^7.21.5" "@babel/plugin-transform-unicode-regex@^7.18.6": version "7.18.6" @@ -953,18 +956,25 @@ esutils "^2.0.2" "@babel/preset-typescript@^7.18.6": - version "7.18.6" - resolved "https://registry.yarnpkg.com/@babel/preset-typescript/-/preset-typescript-7.18.6.tgz#ce64be3e63eddc44240c6358daefac17b3186399" - integrity sha512-s9ik86kXBAnD760aybBucdpnLsAt0jK1xqJn2juOn9lkOvSHV60os5hxoVJsPzMQxvnUJFAlkont2DvvaYEBtQ== + version "7.21.5" + resolved "https://registry.yarnpkg.com/@babel/preset-typescript/-/preset-typescript-7.21.5.tgz#68292c884b0e26070b4d66b202072d391358395f" + integrity sha512-iqe3sETat5EOrORXiQ6rWfoOg2y68Cs75B9wNxdPW4kixJxh7aXQE1KPdWLDniC24T/6dSnguF33W9j/ZZQcmA== dependencies: - "@babel/helper-plugin-utils" "^7.18.6" - "@babel/helper-validator-option" "^7.18.6" - "@babel/plugin-transform-typescript" "^7.18.6" + "@babel/helper-plugin-utils" "^7.21.5" + "@babel/helper-validator-option" "^7.21.0" + "@babel/plugin-syntax-jsx" "^7.21.4" + "@babel/plugin-transform-modules-commonjs" "^7.21.5" + "@babel/plugin-transform-typescript" "^7.21.3" + +"@babel/regjsgen@^0.8.0": + version "0.8.0" + resolved "https://registry.yarnpkg.com/@babel/regjsgen/-/regjsgen-0.8.0.tgz#f0ba69b075e1f05fb2825b7fad991e7adbb18310" + integrity sha512-x/rqGMdzj+fWZvCOYForTghzbtqPDZ5gPwaoNGHdgDfF2QA/XZbCBp4Moo5scrkAMPhB7z26XM/AaHuIJdgauA== "@babel/runtime@^7.11.2", "@babel/runtime@^7.18.9", "@babel/runtime@^7.8.4": - version "7.20.13" - resolved "https://registry.yarnpkg.com/@babel/runtime/-/runtime-7.20.13.tgz#7055ab8a7cff2b8f6058bf6ae45ff84ad2aded4b" - integrity sha512-gt3PKXs0DBoL9xCvOIIZ2NEqAGZqHjAnmVbfQtB620V0uReIQutpel14KcneZuer7UioY8ALKZ7iocavvzTNFA== + version "7.21.5" + resolved "https://registry.yarnpkg.com/@babel/runtime/-/runtime-7.21.5.tgz#8492dddda9644ae3bda3b45eabe87382caee7200" + integrity sha512-8jI69toZqqcsnqGGqwGS4Qb1VwLOEp4hz+CXPywcvjs60u3B4Pom/U/7rm4W8tMOYEB+E9wgD0mW1l3r8qlI9Q== dependencies: regenerator-runtime "^0.13.11" @@ -993,19 +1003,19 @@ debug "^4.1.0" globals "^11.1.0" -"@babel/traverse@^7.18.10", "@babel/traverse@^7.20.10", "@babel/traverse@^7.20.12", "@babel/traverse@^7.20.13", "@babel/traverse@^7.20.5", "@babel/traverse@^7.20.7": - version "7.20.13" - resolved "https://registry.yarnpkg.com/@babel/traverse/-/traverse-7.20.13.tgz#817c1ba13d11accca89478bd5481b2d168d07473" - integrity sha512-kMJXfF0T6DIS9E8cgdLCSAL+cuCK+YEZHWiLK0SXpTo8YRj5lpJu3CDNKiIBCne4m9hhTIqUg6SYTAI39tAiVQ== +"@babel/traverse@^7.18.10", "@babel/traverse@^7.20.5", "@babel/traverse@^7.21.5": + version "7.21.5" + resolved "https://registry.yarnpkg.com/@babel/traverse/-/traverse-7.21.5.tgz#ad22361d352a5154b498299d523cf72998a4b133" + integrity sha512-AhQoI3YjWi6u/y/ntv7k48mcrCXmus0t79J9qPNlk/lAsFlCiJ047RmbfMOawySTHtywXhbXgpx/8nXMYd+oFw== dependencies: - "@babel/code-frame" "^7.18.6" - "@babel/generator" "^7.20.7" - "@babel/helper-environment-visitor" "^7.18.9" - "@babel/helper-function-name" "^7.19.0" + "@babel/code-frame" "^7.21.4" + "@babel/generator" "^7.21.5" + "@babel/helper-environment-visitor" "^7.21.5" + "@babel/helper-function-name" "^7.21.0" "@babel/helper-hoist-variables" "^7.18.6" "@babel/helper-split-export-declaration" "^7.18.6" - "@babel/parser" "^7.20.13" - "@babel/types" "^7.20.7" + "@babel/parser" "^7.21.5" + "@babel/types" "^7.21.5" debug "^4.1.0" globals "^11.1.0" @@ -1018,12 +1028,12 @@ "@babel/helper-validator-identifier" "^7.18.6" to-fast-properties "^2.0.0" -"@babel/types@^7.18.10", "@babel/types@^7.18.6", "@babel/types@^7.18.9", "@babel/types@^7.19.0", "@babel/types@^7.20.0", "@babel/types@^7.20.2", "@babel/types@^7.20.5", "@babel/types@^7.20.7", "@babel/types@^7.4.4": - version "7.20.7" - resolved "https://registry.yarnpkg.com/@babel/types/-/types-7.20.7.tgz#54ec75e252318423fc07fb644dc6a58a64c09b7f" - integrity sha512-69OnhBxSSgK0OzTJai4kyPDiKTIe3j+ctaHdIGVbRahTLAT7L3R9oeXHC2aVSuGYt3cVnoAMDmOCgJ2yaiLMvg== +"@babel/types@^7.18.10", "@babel/types@^7.18.6", "@babel/types@^7.18.9", "@babel/types@^7.20.0", "@babel/types@^7.20.5", "@babel/types@^7.20.7", "@babel/types@^7.21.0", "@babel/types@^7.21.4", "@babel/types@^7.21.5", "@babel/types@^7.4.4": + version "7.21.5" + resolved "https://registry.yarnpkg.com/@babel/types/-/types-7.21.5.tgz#18dfbd47c39d3904d5db3d3dc2cc80bedb60e5b6" + integrity sha512-m4AfNvVF2mVC/F7fDEdH2El3HzUg9It/XsCxZiOTTA3m3qYfcSVSbTfM6Q9xG+hYDniZssYhlXKKUMD5m8tF4Q== dependencies: - "@babel/helper-string-parser" "^7.19.4" + "@babel/helper-string-parser" "^7.21.5" "@babel/helper-validator-identifier" "^7.19.1" to-fast-properties "^2.0.0" @@ -1168,10 +1178,10 @@ resolved "https://registry.yarnpkg.com/@cosmjs/utils/-/utils-0.30.1.tgz#6d92582341be3c2ec8d82090253cfa4b7f959edb" integrity sha512-KvvX58MGMWh7xA+N+deCfunkA/ZNDvFLw4YbOmX3f/XBIkqrVY7qlotfy2aNb1kgp6h4B6Yc8YawJPDTfvWX7g== -"@cosmwasm/ts-codegen@^0.25.2": - version "0.25.2" - resolved "https://registry.yarnpkg.com/@cosmwasm/ts-codegen/-/ts-codegen-0.25.2.tgz#68bbddbafbbc4488446cf2c2986318e18ec65446" - integrity sha512-XCrEXOgFjJvkvSWg6fXh2Ika9unHCJWH2ffbeKeGnzr6x6UX1iCH+8KDcgqMPdvpIOCBaxy9keFoaAqVFue9Ag== +"@cosmwasm/ts-codegen@^0.27.0": + version "0.27.0" + resolved "https://registry.yarnpkg.com/@cosmwasm/ts-codegen/-/ts-codegen-0.27.0.tgz#dcc74eec41aa599a7a5e2a18a4f97b74c008c92f" + integrity sha512-aNZFf7MjVv0D/LX4xpPgv1nao3+G1Mq19rjnEVgRhUKoTILl8RFoyK8dCo2LOIlSg3trdl2nlk6luYpI4AHPZw== dependencies: "@babel/core" "7.18.10" "@babel/generator" "7.18.12" @@ -1199,7 +1209,7 @@ parse-package-name "1.0.0" rimraf "3.0.2" shelljs "0.8.5" - wasm-ast-types "^0.18.2" + wasm-ast-types "^0.20.0" "@eslint-community/eslint-utils@^4.2.0": version "4.4.0" @@ -1209,18 +1219,18 @@ eslint-visitor-keys "^3.3.0" "@eslint-community/regexpp@^4.4.0": - version "4.5.0" - resolved "https://registry.yarnpkg.com/@eslint-community/regexpp/-/regexpp-4.5.0.tgz#f6f729b02feee2c749f57e334b7a1b5f40a81724" - integrity sha512-vITaYzIcNmjn5tF5uxcZ/ft7/RXGrMUIS9HalWckEOF6ESiwXKoMzAQf2UW0aVd6rnOeExTJVd5hmWXucBKGXQ== + version "4.5.1" + resolved "https://registry.yarnpkg.com/@eslint-community/regexpp/-/regexpp-4.5.1.tgz#cdd35dce4fa1a89a4fd42b1599eb35b3af408884" + integrity sha512-Z5ba73P98O1KUYCCJTUeVpja9RcGoMdncZ6T49FCUl2lN38JtCJ+3WgIDBv0AuY4WChU5PmtJmOCTlN6FZTFKQ== -"@eslint/eslintrc@^2.0.2": - version "2.0.2" - resolved "https://registry.yarnpkg.com/@eslint/eslintrc/-/eslintrc-2.0.2.tgz#01575e38707add677cf73ca1589abba8da899a02" - integrity sha512-3W4f5tDUra+pA+FzgugqL2pRimUTDJWKr7BINqOpkZrC0uYI0NIc0/JFgBROCU07HR6GieA5m3/rsPIhDmCXTQ== +"@eslint/eslintrc@^2.0.3": + version "2.0.3" + resolved "https://registry.yarnpkg.com/@eslint/eslintrc/-/eslintrc-2.0.3.tgz#4910db5505f4d503f27774bf356e3704818a0331" + integrity sha512-+5gy6OQfk+xx3q0d6jGZZC3f3KzAkXc/IanVxd1is/VIIziRqqt3ongQz0FiTUXqTk0c7aDB3OaFuKnuSoJicQ== dependencies: ajv "^6.12.4" debug "^4.3.2" - espree "^9.5.1" + espree "^9.5.2" globals "^13.19.0" ignore "^5.2.0" import-fresh "^3.2.1" @@ -1228,10 +1238,10 @@ minimatch "^3.1.2" strip-json-comments "^3.1.1" -"@eslint/js@8.37.0": - version "8.37.0" - resolved "https://registry.yarnpkg.com/@eslint/js/-/js-8.37.0.tgz#cf1b5fa24217fe007f6487a26d765274925efa7d" - integrity sha512-x5vzdtOOGgFVDCUs81QRB2+liax8rFg3+7hqM+QhBG0/G3F1ZsoYl97UrqgHgQ9KKT7G6c4V+aTUCgu/n22v1A== +"@eslint/js@8.40.0": + version "8.40.0" + resolved "https://registry.yarnpkg.com/@eslint/js/-/js-8.40.0.tgz#3ba73359e11f5a7bd3e407f70b3528abfae69cec" + integrity sha512-ElyB54bJIhXQYVKjDSvCkPO1iU1tSAeVQJbllWJq1XQSmmA4dgFk8CbiBGpiOPxleE48vDogxCtmMYku4HSVLA== "@humanwhocodes/config-array@^0.11.8": version "0.11.8" @@ -1308,18 +1318,10 @@ "@types/yargs" "^17.0.8" chalk "^4.0.0" -"@jridgewell/gen-mapping@^0.1.0": - version "0.1.1" - resolved "https://registry.yarnpkg.com/@jridgewell/gen-mapping/-/gen-mapping-0.1.1.tgz#e5d2e450306a9491e3bd77e323e38d7aff315996" - integrity sha512-sQXCasFk+U8lWYEe66WxRDOE9PjVz4vSM51fTu3Hw+ClTpUSQb718772vH3pyS5pShp6lvQM7SxgIDXXXmOX7w== - dependencies: - "@jridgewell/set-array" "^1.0.0" - "@jridgewell/sourcemap-codec" "^1.4.10" - -"@jridgewell/gen-mapping@^0.3.2": - version "0.3.2" - resolved "https://registry.yarnpkg.com/@jridgewell/gen-mapping/-/gen-mapping-0.3.2.tgz#c1aedc61e853f2bb9f5dfe6d4442d3b565b253b9" - integrity sha512-mh65xKQAzI6iBcFzwv28KVWSmCkdRBWoOh+bYQGW3+6OZvbbN3TqMGo5hqYxQniRcH9F2VZIoJCm4pa3BPDK/A== +"@jridgewell/gen-mapping@^0.3.0", "@jridgewell/gen-mapping@^0.3.2": + version "0.3.3" + resolved "https://registry.yarnpkg.com/@jridgewell/gen-mapping/-/gen-mapping-0.3.3.tgz#7e02e6eb5df901aaedb08514203b096614024098" + integrity sha512-HLhSWOLRi875zjjMG/r+Nv0oCW8umGb0BgEhyX3dDX3egwZtB8PqLnjz3yedt8R5StBrzcg4aBpnh8UA9D1BoQ== dependencies: "@jridgewell/set-array" "^1.0.1" "@jridgewell/sourcemap-codec" "^1.4.10" @@ -1330,20 +1332,25 @@ resolved "https://registry.yarnpkg.com/@jridgewell/resolve-uri/-/resolve-uri-3.1.0.tgz#2203b118c157721addfe69d47b70465463066d78" integrity sha512-F2msla3tad+Mfht5cJq7LSXcdudKTWCVYUgw6pLFOOHSTtZlj6SWNYAp+AhuqLmWdBO2X5hPrLcu8cVP8fy28w== -"@jridgewell/set-array@^1.0.0", "@jridgewell/set-array@^1.0.1": +"@jridgewell/set-array@^1.0.1": version "1.1.2" resolved "https://registry.yarnpkg.com/@jridgewell/set-array/-/set-array-1.1.2.tgz#7c6cf998d6d20b914c0a55a91ae928ff25965e72" integrity sha512-xnkseuNADM0gt2bs+BvhO0p78Mk762YnZdsuzFV018NoG1Sj1SCQvpSqa7XUaTam5vAGasABV9qXASMKnFMwMw== -"@jridgewell/sourcemap-codec@1.4.14", "@jridgewell/sourcemap-codec@^1.4.10": +"@jridgewell/sourcemap-codec@1.4.14": version "1.4.14" resolved "https://registry.yarnpkg.com/@jridgewell/sourcemap-codec/-/sourcemap-codec-1.4.14.tgz#add4c98d341472a289190b424efbdb096991bb24" integrity sha512-XPSJHWmi394fuUuzDnGz1wiKqWfo1yXecHQMRf2l6hztTO+nPru658AyDngaBe7isIxEkRsPR3FZh+s7iVa4Uw== -"@jridgewell/trace-mapping@^0.3.13", "@jridgewell/trace-mapping@^0.3.9": - version "0.3.17" - resolved "https://registry.yarnpkg.com/@jridgewell/trace-mapping/-/trace-mapping-0.3.17.tgz#793041277af9073b0951a7fe0f0d8c4c98c36985" - integrity sha512-MCNzAp77qzKca9+W/+I0+sEpaUnZoeasnghNeVc41VZCEKaCH73Vq3BZZ/SzWIgrqE4H4ceI+p+b6C0mHf9T4g== +"@jridgewell/sourcemap-codec@^1.4.10": + version "1.4.15" + resolved "https://registry.yarnpkg.com/@jridgewell/sourcemap-codec/-/sourcemap-codec-1.4.15.tgz#d7c6e6755c78567a951e04ab52ef0fd26de59f32" + integrity sha512-eF2rxCRulEKXHTRiDrDy6erMYWqNw4LPdQ8UQA4huuxaQsVeRPFl2oM8oDGxMFhJUWZf9McpLtJasDDZb/Bpeg== + +"@jridgewell/trace-mapping@^0.3.13", "@jridgewell/trace-mapping@^0.3.17", "@jridgewell/trace-mapping@^0.3.9": + version "0.3.18" + resolved "https://registry.yarnpkg.com/@jridgewell/trace-mapping/-/trace-mapping-0.3.18.tgz#25783b2086daf6ff1dcb53c9249ae480e4dd4cd6" + integrity sha512-w+niJYzMHdd7USdiH2U6869nqhD2nbfZXND5Yp93qIbEmnDNk7PD48o+YchRVpzMU7M6jVCbenTR7PA1FLQ9pA== dependencies: "@jridgewell/resolve-uri" "3.1.0" "@jridgewell/sourcemap-codec" "1.4.14" @@ -1354,9 +1361,9 @@ integrity sha512-4JQNk+3mVzK3xh2rqd6RB4J46qUR19azEHBneZyTZM+c456qOrbbM/5xcR8huNCCcbVt7+UmizG6GuUvPvKUYg== "@noble/hashes@^1", "@noble/hashes@^1.0.0": - version "1.1.5" - resolved "https://registry.yarnpkg.com/@noble/hashes/-/hashes-1.1.5.tgz#1a0377f3b9020efe2fae03290bd2a12140c95c11" - integrity sha512-LTMZiiLc+V4v1Yi16TD6aX2gmtKszNye0pQgbaLqkvhIqP7nVsSaJsWloGQjJfJ8offaoP5GtX3yY5swbcJxxQ== + version "1.3.0" + resolved "https://registry.yarnpkg.com/@noble/hashes/-/hashes-1.3.0.tgz#085fd70f6d7d9d109671090ccae1d3bec62554a1" + integrity sha512-ilHEACi9DwqJB0pw7kv+Apvh50jiiSyR/cQ3y4W7lOR5mhvn/50FLUfsnfJz0BDZtl/RR16kXvptiv6q1msYZg== "@nodelib/fs.scandir@2.1.5": version "2.1.5" @@ -1506,9 +1513,9 @@ integrity sha512-wOuvG1SN4Us4rez+tylwwwCV1psiNVOkJeM3AUWUNWg/jDQY2+HE/444y5gc+jBmRqASOm2Oeh5c1axHobwRKQ== "@types/lodash@^4.14.182": - version "4.14.191" - resolved "https://registry.yarnpkg.com/@types/lodash/-/lodash-4.14.191.tgz#09511e7f7cba275acd8b419ddac8da9a6a79e2fa" - integrity sha512-BdZ5BCCvho3EIXw6wUCXHe7rS53AIDPLE+JzwgT+OsJk53oBfbSmZZ7CX4VaRoN78N+TJpFi9QPlfIVNmJYWxQ== + version "4.14.194" + resolved "https://registry.yarnpkg.com/@types/lodash/-/lodash-4.14.194.tgz#b71eb6f7a0ff11bff59fc987134a093029258a76" + integrity sha512-r22s9tAS7imvBt2lyHC9B8AGwWnXaYb1tY09oyLkXDs4vArpYJzw09nj8MLx5VfciBPGIb+ZwG0ssYnEPJxn/g== "@types/long@^4.0.1": version "4.0.2" @@ -1520,15 +1527,10 @@ resolved "https://registry.yarnpkg.com/@types/minimatch/-/minimatch-5.1.2.tgz#07508b45797cb81ec3f273011b054cd0755eddca" integrity sha512-K0VQKziLUWkVKiRVrx4a40iPaxTUefQmjtkQofBkYRcoaaL/8rhwDWww9qWbrgicNOgnpIsMxyNIUM4+n6dUIA== -"@types/node@*", "@types/node@>=13.7.0": - version "18.11.18" - resolved "https://registry.yarnpkg.com/@types/node/-/node-18.11.18.tgz#8dfb97f0da23c2293e554c5a50d61ef134d7697f" - integrity sha512-DHQpWGjyQKSHj3ebjFI/wRKcqQcdR+MoFBygntYOZytCqNfkd2ZC4ARDJ2DQqhjH5p85Nnd3jhUJIXrszFX/JA== - -"@types/node@^18.15.11": - version "18.15.11" - resolved "https://registry.yarnpkg.com/@types/node/-/node-18.15.11.tgz#b3b790f09cb1696cffcec605de025b088fa4225f" - integrity sha512-E5Kwq2n4SbMzQOn6wnmBjuK9ouqlURrcZDVfbo9ftDDTFt3nk7ZKK4GMOzoYgnpQJKcxwQw+lGaBvvlMo0qN/Q== +"@types/node@*", "@types/node@>=13.7.0", "@types/node@^20.1.1": + version "20.1.1" + resolved "https://registry.yarnpkg.com/@types/node/-/node-20.1.1.tgz#afc492e8dbe7f672dd3a13674823522b467a45ad" + integrity sha512-uKBEevTNb+l6/aCQaKVnUModfEMjAl98lw2Si9P5y4hLu9tm6AlX2ZIoXZX6Wh9lJueYPrGPKk5WMCNHg/u6/A== "@types/prettier@^2.6.1": version "2.7.2" @@ -1536,9 +1538,9 @@ integrity sha512-KufADq8uQqo1pYKVIYzfKbJfBAc0sOeXqGbFaSpv8MRmC/zXgowNZmFcbngndGk922QDmOASEXUZCaY48gs4cg== "@types/semver@^7.3.12": - version "7.3.13" - resolved "https://registry.yarnpkg.com/@types/semver/-/semver-7.3.13.tgz#da4bfd73f49bd541d28920ab0e2bf0ee80f71c91" - integrity sha512-21cFJr9z3g5dW8B0CVI9g2O9beqaThGQ6ZFBqHfwhzLDKUxaqTIy3vnfah/UPkfOiF2pLq+tGz+W8RyCskuslw== + version "7.5.0" + resolved "https://registry.yarnpkg.com/@types/semver/-/semver-7.5.0.tgz#591c1ce3a702c45ee15f47a42ade72c2fd78978a" + integrity sha512-G8hZ6XJiHnuhQKR7ZmysCeJWE08o8T0AXtk5darsCaTVsYZhhgUrq53jizaR2FvsoeCwJhlmwTjkXBY5Pn/ZHw== "@types/yargs-parser@*": version "21.0.0" @@ -1546,21 +1548,21 @@ integrity sha512-iO9ZQHkZxHn4mSakYV0vFHAVDyEOIJQrV2uZ06HxEPcx+mt8swXoZHIbaaJ2crJYFfErySgktuTZ3BeLz+XmFA== "@types/yargs@^17.0.8": - version "17.0.20" - resolved "https://registry.yarnpkg.com/@types/yargs/-/yargs-17.0.20.tgz#107f0fcc13bd4a524e352b41c49fe88aab5c54d5" - integrity sha512-eknWrTHofQuPk2iuqDm1waA7V6xPlbgBoaaXEgYkClhLOnB0TtbW+srJaOToAgawPxPlHQzwypFA2bhZaUGP5A== + version "17.0.24" + resolved "https://registry.yarnpkg.com/@types/yargs/-/yargs-17.0.24.tgz#b3ef8d50ad4aa6aecf6ddc97c580a00f5aa11902" + integrity sha512-6i0aC7jV6QzQB8ne1joVZ0eSFIstHsCrobmOtghM11yGlH0j43FKL2UhWdELkyps0zuf7qVTUVCCR+tgSlyLLw== dependencies: "@types/yargs-parser" "*" -"@typescript-eslint/eslint-plugin@^5.57.1": - version "5.57.1" - resolved "https://registry.yarnpkg.com/@typescript-eslint/eslint-plugin/-/eslint-plugin-5.57.1.tgz#d1ab162a3cd2671b8a1c9ddf6e2db73b14439735" - integrity sha512-1MeobQkQ9tztuleT3v72XmY0XuKXVXusAhryoLuU5YZ+mXoYKZP9SQ7Flulh1NX4DTjpGTc2b/eMu4u7M7dhnQ== +"@typescript-eslint/eslint-plugin@^5.59.5": + version "5.59.5" + resolved "https://registry.yarnpkg.com/@typescript-eslint/eslint-plugin/-/eslint-plugin-5.59.5.tgz#f156827610a3f8cefc56baeaa93cd4a5f32966b4" + integrity sha512-feA9xbVRWJZor+AnLNAr7A8JRWeZqHUf4T9tlP+TN04b05pFVhO5eN7/O93Y/1OUlLMHKbnJisgDURs/qvtqdg== dependencies: "@eslint-community/regexpp" "^4.4.0" - "@typescript-eslint/scope-manager" "5.57.1" - "@typescript-eslint/type-utils" "5.57.1" - "@typescript-eslint/utils" "5.57.1" + "@typescript-eslint/scope-manager" "5.59.5" + "@typescript-eslint/type-utils" "5.59.5" + "@typescript-eslint/utils" "5.59.5" debug "^4.3.4" grapheme-splitter "^1.0.4" ignore "^5.2.0" @@ -1568,72 +1570,72 @@ semver "^7.3.7" tsutils "^3.21.0" -"@typescript-eslint/parser@^5.57.1": - version "5.57.1" - resolved "https://registry.yarnpkg.com/@typescript-eslint/parser/-/parser-5.57.1.tgz#af911234bd4401d09668c5faf708a0570a17a748" - integrity sha512-hlA0BLeVSA/wBPKdPGxoVr9Pp6GutGoY380FEhbVi0Ph4WNe8kLvqIRx76RSQt1lynZKfrXKs0/XeEk4zZycuA== +"@typescript-eslint/parser@^5.59.5": + version "5.59.5" + resolved "https://registry.yarnpkg.com/@typescript-eslint/parser/-/parser-5.59.5.tgz#63064f5eafbdbfb5f9dfbf5c4503cdf949852981" + integrity sha512-NJXQC4MRnF9N9yWqQE2/KLRSOLvrrlZb48NGVfBa+RuPMN6B7ZcK5jZOvhuygv4D64fRKnZI4L4p8+M+rfeQuw== dependencies: - "@typescript-eslint/scope-manager" "5.57.1" - "@typescript-eslint/types" "5.57.1" - "@typescript-eslint/typescript-estree" "5.57.1" + "@typescript-eslint/scope-manager" "5.59.5" + "@typescript-eslint/types" "5.59.5" + "@typescript-eslint/typescript-estree" "5.59.5" debug "^4.3.4" -"@typescript-eslint/scope-manager@5.57.1": - version "5.57.1" - resolved "https://registry.yarnpkg.com/@typescript-eslint/scope-manager/-/scope-manager-5.57.1.tgz#5d28799c0fc8b501a29ba1749d827800ef22d710" - integrity sha512-N/RrBwEUKMIYxSKl0oDK5sFVHd6VI7p9K5MyUlVYAY6dyNb/wHUqndkTd3XhpGlXgnQsBkRZuu4f9kAHghvgPw== +"@typescript-eslint/scope-manager@5.59.5": + version "5.59.5" + resolved "https://registry.yarnpkg.com/@typescript-eslint/scope-manager/-/scope-manager-5.59.5.tgz#33ffc7e8663f42cfaac873de65ebf65d2bce674d" + integrity sha512-jVecWwnkX6ZgutF+DovbBJirZcAxgxC0EOHYt/niMROf8p4PwxxG32Qdhj/iIQQIuOflLjNkxoXyArkcIP7C3A== dependencies: - "@typescript-eslint/types" "5.57.1" - "@typescript-eslint/visitor-keys" "5.57.1" + "@typescript-eslint/types" "5.59.5" + "@typescript-eslint/visitor-keys" "5.59.5" -"@typescript-eslint/type-utils@5.57.1": - version "5.57.1" - resolved "https://registry.yarnpkg.com/@typescript-eslint/type-utils/-/type-utils-5.57.1.tgz#235daba621d3f882b8488040597b33777c74bbe9" - integrity sha512-/RIPQyx60Pt6ga86hKXesXkJ2WOS4UemFrmmq/7eOyiYjYv/MUSHPlkhU6k9T9W1ytnTJueqASW+wOmW4KrViw== +"@typescript-eslint/type-utils@5.59.5": + version "5.59.5" + resolved "https://registry.yarnpkg.com/@typescript-eslint/type-utils/-/type-utils-5.59.5.tgz#485b0e2c5b923460bc2ea6b338c595343f06fc9b" + integrity sha512-4eyhS7oGym67/pSxA2mmNq7X164oqDYNnZCUayBwJZIRVvKpBCMBzFnFxjeoDeShjtO6RQBHBuwybuX3POnDqg== dependencies: - "@typescript-eslint/typescript-estree" "5.57.1" - "@typescript-eslint/utils" "5.57.1" + "@typescript-eslint/typescript-estree" "5.59.5" + "@typescript-eslint/utils" "5.59.5" debug "^4.3.4" tsutils "^3.21.0" -"@typescript-eslint/types@5.57.1": - version "5.57.1" - resolved "https://registry.yarnpkg.com/@typescript-eslint/types/-/types-5.57.1.tgz#d9989c7a9025897ea6f0550b7036027f69e8a603" - integrity sha512-bSs4LOgyV3bJ08F5RDqO2KXqg3WAdwHCu06zOqcQ6vqbTJizyBhuh1o1ImC69X4bV2g1OJxbH71PJqiO7Y1RuA== +"@typescript-eslint/types@5.59.5": + version "5.59.5" + resolved "https://registry.yarnpkg.com/@typescript-eslint/types/-/types-5.59.5.tgz#e63c5952532306d97c6ea432cee0981f6d2258c7" + integrity sha512-xkfRPHbqSH4Ggx4eHRIO/eGL8XL4Ysb4woL8c87YuAo8Md7AUjyWKa9YMwTL519SyDPrfEgKdewjkxNCVeJW7w== -"@typescript-eslint/typescript-estree@5.57.1": - version "5.57.1" - resolved "https://registry.yarnpkg.com/@typescript-eslint/typescript-estree/-/typescript-estree-5.57.1.tgz#10d9643e503afc1ca4f5553d9bbe672ea4050b71" - integrity sha512-A2MZqD8gNT0qHKbk2wRspg7cHbCDCk2tcqt6ScCFLr5Ru8cn+TCfM786DjPhqwseiS+PrYwcXht5ztpEQ6TFTw== +"@typescript-eslint/typescript-estree@5.59.5": + version "5.59.5" + resolved "https://registry.yarnpkg.com/@typescript-eslint/typescript-estree/-/typescript-estree-5.59.5.tgz#9b252ce55dd765e972a7a2f99233c439c5101e42" + integrity sha512-+XXdLN2CZLZcD/mO7mQtJMvCkzRfmODbeSKuMY/yXbGkzvA9rJyDY5qDYNoiz2kP/dmyAxXquL2BvLQLJFPQIg== dependencies: - "@typescript-eslint/types" "5.57.1" - "@typescript-eslint/visitor-keys" "5.57.1" + "@typescript-eslint/types" "5.59.5" + "@typescript-eslint/visitor-keys" "5.59.5" debug "^4.3.4" globby "^11.1.0" is-glob "^4.0.3" semver "^7.3.7" tsutils "^3.21.0" -"@typescript-eslint/utils@5.57.1": - version "5.57.1" - resolved "https://registry.yarnpkg.com/@typescript-eslint/utils/-/utils-5.57.1.tgz#0f97b0bbd88c2d5e2036869f26466be5f4c69475" - integrity sha512-kN6vzzf9NkEtawECqze6v99LtmDiUJCVpvieTFA1uL7/jDghiJGubGZ5csicYHU1Xoqb3oH/R5cN5df6W41Nfg== +"@typescript-eslint/utils@5.59.5": + version "5.59.5" + resolved "https://registry.yarnpkg.com/@typescript-eslint/utils/-/utils-5.59.5.tgz#15b3eb619bb223302e60413adb0accd29c32bcae" + integrity sha512-sCEHOiw+RbyTii9c3/qN74hYDPNORb8yWCoPLmB7BIflhplJ65u2PBpdRla12e3SSTJ2erRkPjz7ngLHhUegxA== dependencies: "@eslint-community/eslint-utils" "^4.2.0" "@types/json-schema" "^7.0.9" "@types/semver" "^7.3.12" - "@typescript-eslint/scope-manager" "5.57.1" - "@typescript-eslint/types" "5.57.1" - "@typescript-eslint/typescript-estree" "5.57.1" + "@typescript-eslint/scope-manager" "5.59.5" + "@typescript-eslint/types" "5.59.5" + "@typescript-eslint/typescript-estree" "5.59.5" eslint-scope "^5.1.1" semver "^7.3.7" -"@typescript-eslint/visitor-keys@5.57.1": - version "5.57.1" - resolved "https://registry.yarnpkg.com/@typescript-eslint/visitor-keys/-/visitor-keys-5.57.1.tgz#585e5fa42a9bbcd9065f334fd7c8a4ddfa7d905e" - integrity sha512-RjQrAniDU0CEk5r7iphkm731zKlFiUjvcBS2yHAg8WWqFMCaCrD0rKEVOMUyMMcbGPZ0bPp56srkGWrgfZqLRA== +"@typescript-eslint/visitor-keys@5.59.5": + version "5.59.5" + resolved "https://registry.yarnpkg.com/@typescript-eslint/visitor-keys/-/visitor-keys-5.59.5.tgz#ba5b8d6791a13cf9fea6716af1e7626434b29b9b" + integrity sha512-qL+Oz+dbeBRTeyJTIy0eniD3uvqU7x+y1QceBismZ41hd4aBSRh8UAw4pZP0+XzLuPZmx4raNMq/I+59W2lXKA== dependencies: - "@typescript-eslint/types" "5.57.1" + "@typescript-eslint/types" "5.59.5" eslint-visitor-keys "^3.3.0" acorn-jsx@^5.3.2: @@ -1836,15 +1838,15 @@ brorand@^1.1.0: resolved "https://registry.yarnpkg.com/brorand/-/brorand-1.1.0.tgz#12c25efe40a45e3c323eb8675a0a0ce57b22371f" integrity sha512-cKV8tMCEpQs4hK/ik71d6LrPOnpkpGBR0wzxqr68g2m/LB2GxVYQroAjMJZRVM1Y4BCjCKc3vAamxSzOY2RP+w== -browserslist@^4.21.3, browserslist@^4.21.4: - version "4.21.4" - resolved "https://registry.yarnpkg.com/browserslist/-/browserslist-4.21.4.tgz#e7496bbc67b9e39dd0f98565feccdcb0d4ff6987" - integrity sha512-CBHJJdDmgjl3daYjN5Cp5kbTf1mUhZoS+beLklHIvkOWscs83YAhLlF3Wsh/lciQYAcbBJgTOD44VtG31ZM4Hw== +browserslist@^4.21.3, browserslist@^4.21.5: + version "4.21.5" + resolved "https://registry.yarnpkg.com/browserslist/-/browserslist-4.21.5.tgz#75c5dae60063ee641f977e00edd3cfb2fb7af6a7" + integrity sha512-tUkiguQGW7S3IhB7N+c2MV/HZPSCPAAiYBZXLsBhFB/PCy6ZKKsZrmBayHV9fdGV/ARIfJ14NkxKzRDjvp7L6w== dependencies: - caniuse-lite "^1.0.30001400" - electron-to-chromium "^1.4.251" - node-releases "^2.0.6" - update-browserslist-db "^1.0.9" + caniuse-lite "^1.0.30001449" + electron-to-chromium "^1.4.284" + node-releases "^2.0.8" + update-browserslist-db "^1.0.10" bser@2.1.1: version "2.1.1" @@ -1868,10 +1870,10 @@ camelcase@^5.3.1: resolved "https://registry.yarnpkg.com/camelcase/-/camelcase-5.3.1.tgz#e3c9b31569e106811df242f715725a1f4c494320" integrity sha512-L28STB170nwWS63UjtlEOE3dldQApaJXZkOI1uMFfzf3rRuPegHaHesyee+YxQ+W6SvRDQV6UrdOdRiR153wJg== -caniuse-lite@^1.0.30001400: - version "1.0.30001447" - resolved "https://registry.yarnpkg.com/caniuse-lite/-/caniuse-lite-1.0.30001447.tgz#ef1f39ae38d839d7176713735a8e467a0a2523bd" - integrity sha512-bdKU1BQDPeEXe9A39xJnGtY0uRq/z5osrnXUw0TcK+EYno45Y+U7QU9HhHEyzvMDffpYadFXi3idnSNkcwLkTw== +caniuse-lite@^1.0.30001449: + version "1.0.30001486" + resolved "https://registry.yarnpkg.com/caniuse-lite/-/caniuse-lite-1.0.30001486.tgz#56a08885228edf62cbe1ac8980f2b5dae159997e" + integrity sha512-uv7/gXuHi10Whlj0pp5q/tsK/32J2QSqVRKQhs2j8VsDCjgyruAh/eEXHF822VqO9yT6iZKw3nRwZRSPBE9OQg== case@1.6.3: version "1.6.3" @@ -1917,9 +1919,9 @@ chardet@^0.7.0: integrity sha512-mT8iDcrh03qDGRRmoA2hmBJnxpllMR+0/0qlzjqZES6NdiWDcZkCNAk4rPFZ9Q85r27unkiNNg8ZOiwZXBHwcA== ci-info@^3.2.0: - version "3.7.1" - resolved "https://registry.yarnpkg.com/ci-info/-/ci-info-3.7.1.tgz#708a6cdae38915d597afdf3b145f2f8e1ff55f3f" - integrity sha512-4jYS4MOAaCIStSRwiuxc4B8MYhIe676yO1sYGzARnjXkWpmzZMMYxY6zu8WYWDhSuth5zhrQ1rhNSibyyvv4/w== + version "3.8.0" + resolved "https://registry.yarnpkg.com/ci-info/-/ci-info-3.8.0.tgz#81408265a5380c929f0bc665d62256628ce9ef91" + integrity sha512-eXTggHWSooYhq49F2opQhuHWgzucfF2YgODK4e1566GQs5BIfP30B0oenwBJHfWxAs2fyPB1s7Mg949zLf61Yw== cli-color@^2.0.2: version "2.0.3" @@ -1984,11 +1986,11 @@ convert-source-map@^1.4.0, convert-source-map@^1.7.0: integrity sha512-ASFBup0Mz1uyiIjANan1jzLQami9z1PoYSZCiiYW2FczPbenXc45FZdBZLzOT+r6+iciuEModtmCti+hjaAk0A== core-js-compat@^3.21.0, core-js-compat@^3.22.1: - version "3.27.2" - resolved "https://registry.yarnpkg.com/core-js-compat/-/core-js-compat-3.27.2.tgz#607c50ad6db8fd8326af0b2883ebb987be3786da" - integrity sha512-welaYuF7ZtbYKGrIy7y3eb40d37rG1FvzEOfe7hSLd2iD6duMDqUhRfSvCGyC46HhR6Y8JXXdZ2lnRUMkPBpvg== + version "3.30.2" + resolved "https://registry.yarnpkg.com/core-js-compat/-/core-js-compat-3.30.2.tgz#83f136e375babdb8c80ad3c22d67c69098c1dd8b" + integrity sha512-nriW1nuJjUgvkEjIot1Spwakz52V9YkYHZAQG6A1eCgC8AA1p0zngrQEP9R0+V6hji5XilWKG1Bd0YRppmGimA== dependencies: - browserslist "^4.21.4" + browserslist "^4.21.5" cosmjs-types@^0.7.1, cosmjs-types@^0.7.2: version "0.7.2" @@ -2038,9 +2040,9 @@ deepmerge@4.2.2: integrity sha512-FJ3UgI4gIl+PHZm53knsuSFpE+nESMr7M4v9QcgB7S63Kj/6WqMiFQJpBBYz1Pt+66bZpP3Q7Lye0Oo9MPKEdg== define-properties@^1.1.3: - version "1.1.4" - resolved "https://registry.yarnpkg.com/define-properties/-/define-properties-1.1.4.tgz#0b14d7bd7fbeb2f3572c3a7eda80ea5d57fb05b1" - integrity sha512-uckOqKcfaVvtBdsVkdPv3XjveQJsNQqmhXgRi8uhvWWuPYZCNlzT8qAyblUgNoXdHdjMTzAqeGjAoli8f+bzPA== + version "1.2.0" + resolved "https://registry.yarnpkg.com/define-properties/-/define-properties-1.2.0.tgz#52988570670c9eacedd8064f4a990f2405849bd5" + integrity sha512-xvqAVKGfT1+UAvPwKTVw/njhdQ8ZhXK4lI0bCIuCMrp2up9nPnaDftrLtmpTazqd1o+UY4zgzU+avtMbDP+ldA== dependencies: has-property-descriptors "^1.0.0" object-keys "^1.1.1" @@ -2064,10 +2066,10 @@ dotty@0.1.2: resolved "https://registry.yarnpkg.com/dotty/-/dotty-0.1.2.tgz#512d44cc4111a724931226259297f235e8484f6f" integrity sha512-V0EWmKeH3DEhMwAZ+8ZB2Ao4OK6p++Z0hsDtZq3N0+0ZMVqkzrcEGROvOnZpLnvBg5PTNG23JEDLAm64gPaotQ== -electron-to-chromium@^1.4.251: - version "1.4.284" - resolved "https://registry.yarnpkg.com/electron-to-chromium/-/electron-to-chromium-1.4.284.tgz#61046d1e4cab3a25238f6bf7413795270f125592" - integrity sha512-M8WEXFuKXMYMVr45fo8mq0wUrrJHheiKZf6BArTKk9ZBYCKJEOU5H8cdWgDT+qCVZf7Na4lVUaZsA+h6uA9+PA== +electron-to-chromium@^1.4.284: + version "1.4.387" + resolved "https://registry.yarnpkg.com/electron-to-chromium/-/electron-to-chromium-1.4.387.tgz#9a93ef1bd01b5898436026401ea3cabb1dd17d7a" + integrity sha512-tutLf+alr1/0YqJwKPdstVvDLmxmLb5xNyDLNS0RZmenHcEYk9qKfpKDCVZEKJ00JVbnayJm1MZAbYhYDFpcOw== elliptic@^6.5.4: version "6.5.4" @@ -2146,33 +2148,28 @@ eslint-scope@^5.1.1: esrecurse "^4.3.0" estraverse "^4.1.1" -eslint-scope@^7.1.1: - version "7.1.1" - resolved "https://registry.yarnpkg.com/eslint-scope/-/eslint-scope-7.1.1.tgz#fff34894c2f65e5226d3041ac480b4513a163642" - integrity sha512-QKQM/UXpIiHcLqJ5AOyIW7XZmzjkzQXYE54n1++wb0u9V/abW3l9uQnxX8Z5Xd18xyKIMTUAyQ0k1e8pz6LUrw== +eslint-scope@^7.2.0: + version "7.2.0" + resolved "https://registry.yarnpkg.com/eslint-scope/-/eslint-scope-7.2.0.tgz#f21ebdafda02352f103634b96dd47d9f81ca117b" + integrity sha512-DYj5deGlHBfMt15J7rdtyKNq/Nqlv5KfU4iodrQ019XESsRnwXH9KAE0y3cwtUHDo2ob7CypAnCqefh6vioWRw== dependencies: esrecurse "^4.3.0" estraverse "^5.2.0" -eslint-visitor-keys@^3.3.0: - version "3.3.0" - resolved "https://registry.yarnpkg.com/eslint-visitor-keys/-/eslint-visitor-keys-3.3.0.tgz#f6480fa6b1f30efe2d1968aa8ac745b862469826" - integrity sha512-mQ+suqKJVyeuwGYHAdjMFqjCyfl8+Ldnxuyp3ldiMBFKkvytrXUZWaiPCEav8qDHKty44bD+qV1IP4T+w+xXRA== - -eslint-visitor-keys@^3.4.0: - version "3.4.0" - resolved "https://registry.yarnpkg.com/eslint-visitor-keys/-/eslint-visitor-keys-3.4.0.tgz#c7f0f956124ce677047ddbc192a68f999454dedc" - integrity sha512-HPpKPUBQcAsZOsHAFwTtIKcYlCje62XB7SEAcxjtmW6TD1WVpkS6i6/hOVtTZIl4zGj/mBqpFVGvaDneik+VoQ== +eslint-visitor-keys@^3.3.0, eslint-visitor-keys@^3.4.1: + version "3.4.1" + resolved "https://registry.yarnpkg.com/eslint-visitor-keys/-/eslint-visitor-keys-3.4.1.tgz#c22c48f48942d08ca824cc526211ae400478a994" + integrity sha512-pZnmmLwYzf+kWaM/Qgrvpen51upAktaaiI01nsJD/Yr3lMOdNtq0cxkrrg16w64VtisN6okbs7Q8AfGqj4c9fA== -eslint@^8.37.0: - version "8.37.0" - resolved "https://registry.yarnpkg.com/eslint/-/eslint-8.37.0.tgz#1f660ef2ce49a0bfdec0b0d698e0b8b627287412" - integrity sha512-NU3Ps9nI05GUoVMxcZx1J8CNR6xOvUT4jAUMH5+z8lpp3aEdPVCImKw6PWG4PY+Vfkpr+jvMpxs/qoE7wq0sPw== +eslint@^8.40.0: + version "8.40.0" + resolved "https://registry.yarnpkg.com/eslint/-/eslint-8.40.0.tgz#a564cd0099f38542c4e9a2f630fa45bf33bc42a4" + integrity sha512-bvR+TsP9EHL3TqNtj9sCNJVAFK3fBN8Q7g5waghxyRsPLIMwL73XSKnZFK0hk/O2ANC+iAoq6PWMQ+IfBAJIiQ== dependencies: "@eslint-community/eslint-utils" "^4.2.0" "@eslint-community/regexpp" "^4.4.0" - "@eslint/eslintrc" "^2.0.2" - "@eslint/js" "8.37.0" + "@eslint/eslintrc" "^2.0.3" + "@eslint/js" "8.40.0" "@humanwhocodes/config-array" "^0.11.8" "@humanwhocodes/module-importer" "^1.0.1" "@nodelib/fs.walk" "^1.2.8" @@ -2182,9 +2179,9 @@ eslint@^8.37.0: debug "^4.3.2" doctrine "^3.0.0" escape-string-regexp "^4.0.0" - eslint-scope "^7.1.1" - eslint-visitor-keys "^3.4.0" - espree "^9.5.1" + eslint-scope "^7.2.0" + eslint-visitor-keys "^3.4.1" + espree "^9.5.2" esquery "^1.4.2" esutils "^2.0.2" fast-deep-equal "^3.1.3" @@ -2210,14 +2207,14 @@ eslint@^8.37.0: strip-json-comments "^3.1.0" text-table "^0.2.0" -espree@^9.5.1: - version "9.5.1" - resolved "https://registry.yarnpkg.com/espree/-/espree-9.5.1.tgz#4f26a4d5f18905bf4f2e0bd99002aab807e96dd4" - integrity sha512-5yxtHSZXRSW5pvv3hAlXM5+/Oswi1AUFqBmbibKb5s6bp3rGIDkyXU6xCoyuuLhijr4SFwPrXRoZjz0AZDN9tg== +espree@^9.5.2: + version "9.5.2" + resolved "https://registry.yarnpkg.com/espree/-/espree-9.5.2.tgz#e994e7dc33a082a7a82dceaf12883a829353215b" + integrity sha512-7OASN1Wma5fum5SrNhFMAMJxOUAbhyfQ8dQ//PJaJbNw0URTPWqIghHWt1MmAANKhHZIYOHruW4Kw4ruUWOdGw== dependencies: acorn "^8.8.0" acorn-jsx "^5.3.2" - eslint-visitor-keys "^3.4.0" + eslint-visitor-keys "^3.4.1" esprima@^4.0.0: version "4.0.1" @@ -2475,9 +2472,9 @@ globals@^11.1.0: integrity sha512-WOBp/EEGUiIsJSp7wcv/y6MO+lV9UoncWqxuFfm8eBwzWNgyfBd6Gz+IeKQ9jCmyhoH99g15M3T+QaVHFjizVA== globals@^13.19.0: - version "13.19.0" - resolved "https://registry.yarnpkg.com/globals/-/globals-13.19.0.tgz#7a42de8e6ad4f7242fbcca27ea5b23aca367b5c8" - integrity sha512-dkQ957uSRWHw7CFXLUtUHQI3g3aWApYhfNR2O6jn/907riyTYKVBmxYVROkBcY614FSSeSJh7Xm7SrUWCxvJMQ== + version "13.20.0" + resolved "https://registry.yarnpkg.com/globals/-/globals-13.20.0.tgz#ea276a1e508ffd4f1612888f9d1bad1e2717bf82" + integrity sha512-Qg5QtVkCy/kv3FUSlu4ukeZDVf9ee0iXLAUYX13gbR17bnejFTzr4iS9bY7kwCf1NztRNm1t91fjOiyx4CSwPQ== dependencies: type-fest "^0.20.2" @@ -2501,9 +2498,9 @@ globby@^11.1.0: slash "^3.0.0" graceful-fs@^4.1.15, graceful-fs@^4.2.9: - version "4.2.10" - resolved "https://registry.yarnpkg.com/graceful-fs/-/graceful-fs-4.2.10.tgz#147d3a006da4ca3ce14728c7aefc287c367d7a6c" - integrity sha512-9ByhssR2fPVsNZj478qUUbKfmL0+t5BDVyjShtyZZLiK7ZDAArFFfopyOTj0M05wE2tJPisA4iTnnXl2YoPvOA== + version "4.2.11" + resolved "https://registry.yarnpkg.com/graceful-fs/-/graceful-fs-4.2.11.tgz#4183e4e8bf08bb6e05bbb2f7d2e0c8f712ca40e3" + integrity sha512-RbJ5/jmFcNNCcDV5o9eTnBLJ/HszWV0P73bc+Ff4nS/rJj+YaS6IGyiOL0VoBYX+l1Wrl3k63h/KrH+nhJ0XvQ== grapheme-splitter@^1.0.4: version "1.0.4" @@ -2672,10 +2669,10 @@ interpret@^1.0.0: resolved "https://registry.yarnpkg.com/interpret/-/interpret-1.4.0.tgz#665ab8bc4da27a774a40584e812e3e0fa45b1a1e" integrity sha512-agE4QfB2Lkp9uICn7BAqoscw4SZP9kTE2hxiFI3jBPmXJfdqiahTbUuKGsMoN2GtqL9AxhYioAcVvgsb1HvRbA== -is-core-module@^2.9.0: - version "2.11.0" - resolved "https://registry.yarnpkg.com/is-core-module/-/is-core-module-2.11.0.tgz#ad4cb3e3863e814523c96f3f58d26cc570ff0144" - integrity sha512-RRjxlvLDkD1YJwDbroBHMb+cukurkDWNyHx7D3oNB5x9rb5ogcksMC5wHCadcXoo67gVr/+3GFySh3134zi6rw== +is-core-module@^2.11.0: + version "2.12.0" + resolved "https://registry.yarnpkg.com/is-core-module/-/is-core-module-2.12.0.tgz#36ad62f6f73c8253fd6472517a12483cf03e7ec4" + integrity sha512-RECHCBCd/viahWmwj6enj19sKbHfJrddi/6cBDsNTKbNq0f7VeaUkBo60BqzvPqo/W54ChS62Z5qyun7cfOMqQ== dependencies: has "^1.0.3" @@ -2788,9 +2785,9 @@ jest-worker@^28.1.3: supports-color "^8.0.0" js-sdsl@^4.1.4: - version "4.3.0" - resolved "https://registry.yarnpkg.com/js-sdsl/-/js-sdsl-4.3.0.tgz#aeefe32a451f7af88425b11fdb5f58c90ae1d711" - integrity sha512-mifzlm2+5nZ+lEcLJMoBK0/IH/bDg8XnJfd/Wq6IP+xoCjLZsTOnV2QpxlVbX9bMnkl5PdEjNtBJ9Cj1NjifhQ== + version "4.4.0" + resolved "https://registry.yarnpkg.com/js-sdsl/-/js-sdsl-4.4.0.tgz#8b437dbe642daa95760400b602378ed8ffea8430" + integrity sha512-FfVSdx6pJ41Oa+CF7RDaFmTnCaFhua+SNYQX74riGOpl96x+2jQCqEfQ2bnXu/5DPCqlRuiqyvTJM0Qjz26IVg== js-tokens@^4.0.0: version "4.0.0" @@ -2846,16 +2843,16 @@ levn@^0.4.1: type-check "~0.4.0" libsodium-wrappers@^0.7.6: - version "0.7.10" - resolved "https://registry.yarnpkg.com/libsodium-wrappers/-/libsodium-wrappers-0.7.10.tgz#13ced44cacb0fc44d6ac9ce67d725956089ce733" - integrity sha512-pO3F1Q9NPLB/MWIhehim42b/Fwb30JNScCNh8TcQ/kIc+qGLQch8ag8wb0keK3EP5kbGakk1H8Wwo7v+36rNQg== + version "0.7.11" + resolved "https://registry.yarnpkg.com/libsodium-wrappers/-/libsodium-wrappers-0.7.11.tgz#53bd20606dffcc54ea2122133c7da38218f575f7" + integrity sha512-SrcLtXj7BM19vUKtQuyQKiQCRJPgbpauzl3s0rSwD+60wtHqSUuqcoawlMDheCJga85nKOQwxNYQxf/CKAvs6Q== dependencies: - libsodium "^0.7.0" + libsodium "^0.7.11" -libsodium@^0.7.0: - version "0.7.10" - resolved "https://registry.yarnpkg.com/libsodium/-/libsodium-0.7.10.tgz#c2429a7e4c0836f879d701fec2c8a208af024159" - integrity sha512-eY+z7hDrDKxkAK+QKZVNv92A5KYkxfvIshtBJkmg5TSiCnYqZP3i9OO9whE79Pwgm4jGaoHgkM4ao/b9Cyu4zQ== +libsodium@^0.7.11: + version "0.7.11" + resolved "https://registry.yarnpkg.com/libsodium/-/libsodium-0.7.11.tgz#cd10aae7bcc34a300cc6ad0ac88fcca674cfbc2e" + integrity sha512-WPfJ7sS53I2s4iM58QxY3Inb83/6mjlYgcmZs7DJsvDlnmVUwNinBCi5vBT43P6bHRy01O4zsMU2CoVR6xJ40A== locate-path@^5.0.0: version "5.0.0" @@ -2892,9 +2889,9 @@ long@^4.0.0: integrity sha512-XsP+KhQif4bjX1kbuSiySJFNAehNxgLb6hPRGJ9QsUr8ajHkuXGdrHmFUTUUXhDwVX2R5bY4JNZEwbUiMhV+MA== long@^5.2.0: - version "5.2.1" - resolved "https://registry.yarnpkg.com/long/-/long-5.2.1.tgz#e27595d0083d103d2fa2c20c7699f8e0c92b897f" - integrity sha512-GKSNGeNAtw8IryjjkhZxuKB3JzlcLTwjtiQCHKvqQet81I93kXslhDQruGI/QsddO83mcDToBVy7GqGS/zYf/A== + version "5.2.3" + resolved "https://registry.yarnpkg.com/long/-/long-5.2.3.tgz#a3ba97f3877cf1d778eccbcb048525ebb77499e1" + integrity sha512-lcHwpNoggQTObv5apGNCTdJrO69eHOZMi4BNC+rTLER8iHAqGrUVeLh/irVIM7zTw2bOXA8T6uNPeujwOLg/2Q== lru-cache@^5.1.1: version "5.1.1" @@ -2998,9 +2995,9 @@ minimist@1.2.6: integrity sha512-Jsjnk4bw3YJqYzbdyBiNsPWHPfO++UGG749Cxs6peCu5Xg4nrena6OVxOYxrQTqww0Jmwt+Ref8rggumkTLz9Q== minimist@^1.2.6: - version "1.2.7" - resolved "https://registry.yarnpkg.com/minimist/-/minimist-1.2.7.tgz#daa1c4d91f507390437c6a8bc01078e7000c4d18" - integrity sha512-bzfL1YUZsP41gmu/qjrEk0Q6i2ix/cVeAhbCbqH9u3zYutS1cLg00qhrD0M2MVdCcx4Sc0UpP2eBWo9rotpq6g== + version "1.2.8" + resolved "https://registry.yarnpkg.com/minimist/-/minimist-1.2.8.tgz#c1a464e7693302e082a075cee0c057741ac4772c" + integrity sha512-2yyAR8qBkN3YuheJanUpWC5U3bb5osDywNB8RzDVlDwDHbocAJveqqj1u8+SVD7jkWT4yvsHCpWqqWqAxb0zCA== mkdirp@1.0.4, mkdirp@^1.0.4: version "1.0.4" @@ -3046,10 +3043,10 @@ node-int64@^0.4.0: resolved "https://registry.yarnpkg.com/node-int64/-/node-int64-0.4.0.tgz#87a9065cdb355d3182d8f94ce11188b825c68a3b" integrity sha512-O5lz91xSOeoXP6DulyHfllpq+Eg00MWitZIbtPfoSEvqIHdl5gfcY6hYzDWnj0qD5tz52PI08u9qUvSVeUBeHw== -node-releases@^2.0.6: - version "2.0.8" - resolved "https://registry.yarnpkg.com/node-releases/-/node-releases-2.0.8.tgz#0f349cdc8fcfa39a92ac0be9bc48b7706292b9ae" - integrity sha512-dFSmB8fFHEH/s81Xi+Y/15DQY6VHW81nXRj86EMSL3lmuTmK1e+aT4wrFCkTbm+gSwkw4KpX+rT/pMM2c1mF+A== +node-releases@^2.0.8: + version "2.0.10" + resolved "https://registry.yarnpkg.com/node-releases/-/node-releases-2.0.10.tgz#c311ebae3b6a148c89b1813fd7c4d3c024ef537f" + integrity sha512-5GFldHPXVG/YZmFzJvKK2zDSzPKhEp0+ZR5SVaoSag9fsL5YgHbUHDfnG5494ISANDcK4KwPXAx2xqVEydmd7w== normalize-path@^3.0.0: version "3.0.0" @@ -3199,15 +3196,10 @@ prepend-file@^2.0.1: dependencies: temp-write "^4.0.0" -prettier@^2.6.2: - version "2.8.3" - resolved "https://registry.yarnpkg.com/prettier/-/prettier-2.8.3.tgz#ab697b1d3dd46fb4626fbe2f543afe0cc98d8632" - integrity sha512-tJ/oJ4amDihPoufT5sM0Z1SKEuKay8LfVAMlbbhnnkvt6BUserZylqo2PN+p9KeljLr0OHa2rXHU1T8reeoTrw== - -prettier@^2.8.7: - version "2.8.7" - resolved "https://registry.yarnpkg.com/prettier/-/prettier-2.8.7.tgz#bb79fc8729308549d28fe3a98fce73d2c0656450" - integrity sha512-yPngTo3aXUUmyuTjeTUT75txrf+aMh9FiD7q9ZE/i6r0bPb22g4FsE6Y338PQX1bmfy08i9QQCB7/rcUAVntfw== +prettier@^2.6.2, prettier@^2.8.8: + version "2.8.8" + resolved "https://registry.yarnpkg.com/prettier/-/prettier-2.8.8.tgz#e8c5d7e98a4305ffe3de2e1fc4aca1a71c28b1da" + integrity sha512-tdN8qQGvNjw4CHbY+XXk0JgCXn9QiF21a55rBe5LJAU+kDyC4WQn4+awm2Xfk2lQMk5fKup9XgzTZtGkjBdP9Q== protobufjs@^6.8.8, protobufjs@~6.11.2, protobufjs@~6.11.3: version "6.11.3" @@ -3274,23 +3266,18 @@ regenerator-transform@^0.15.1: dependencies: "@babel/runtime" "^7.8.4" -regexpu-core@^5.2.1: - version "5.2.2" - resolved "https://registry.yarnpkg.com/regexpu-core/-/regexpu-core-5.2.2.tgz#3e4e5d12103b64748711c3aad69934d7718e75fc" - integrity sha512-T0+1Zp2wjF/juXMrMxHxidqGYn8U4R+zleSJhX9tQ1PUsS8a9UtYfbsF9LdiVgNX3kiX8RNaKM42nfSgvFJjmw== +regexpu-core@^5.3.1: + version "5.3.2" + resolved "https://registry.yarnpkg.com/regexpu-core/-/regexpu-core-5.3.2.tgz#11a2b06884f3527aec3e93dbbf4a3b958a95546b" + integrity sha512-RAM5FlZz+Lhmo7db9L298p2vHP5ZywrVXmVXpmAD9GuL5MPH6t9ROw1iA/wfHkQ76Qe7AaPF0nGuim96/IrQMQ== dependencies: + "@babel/regjsgen" "^0.8.0" regenerate "^1.4.2" regenerate-unicode-properties "^10.1.0" - regjsgen "^0.7.1" regjsparser "^0.9.1" unicode-match-property-ecmascript "^2.0.0" unicode-match-property-value-ecmascript "^2.1.0" -regjsgen@^0.7.1: - version "0.7.1" - resolved "https://registry.yarnpkg.com/regjsgen/-/regjsgen-0.7.1.tgz#ee5ef30e18d3f09b7c369b76e7c2373ed25546f6" - integrity sha512-RAt+8H2ZEzHeYWxZ3H2z6tF18zyyOnlcdaafLrm21Bguj7uZy6ULibiAFdXEtKQY4Sy7wDTwDiOazasMLc4KPA== - regjsparser@^0.9.1: version "0.9.1" resolved "https://registry.yarnpkg.com/regjsparser/-/regjsparser-0.9.1.tgz#272d05aa10c7c1f67095b1ff0addae8442fc5709" @@ -3309,11 +3296,11 @@ resolve-from@^5.0.0: integrity sha512-qYg9KP24dD5qka9J47d0aVky0N+b4fTU89LN9iDnjB5waksiC49rvMB0PrUJQGoTmH50XPiqOvAjDfaijGxYZw== resolve@^1.1.6, resolve@^1.14.2: - version "1.22.1" - resolved "https://registry.yarnpkg.com/resolve/-/resolve-1.22.1.tgz#27cb2ebb53f91abb49470a928bba7558066ac177" - integrity sha512-nBpuuYuY5jFsli/JIs1oldw6fOQCBioohqWZg/2hiaOybXOft4lonv85uDOKXdf8rhyK159cxU5cDcK/NKk8zw== + version "1.22.2" + resolved "https://registry.yarnpkg.com/resolve/-/resolve-1.22.2.tgz#0ed0943d4e301867955766c9f3e1ae6d01c6845f" + integrity sha512-Sb+mjNHOULsBv818T40qSPeRiuWLyaGMa5ewydRLFimneixmVy2zdivRl+AF6jaYPC8ERxGDmFSiqui6SfPd+g== dependencies: - is-core-module "^2.9.0" + is-core-module "^2.11.0" path-parse "^1.0.7" supports-preserve-symlinks-flag "^1.0.0" @@ -3379,9 +3366,9 @@ semver@^6.0.0, semver@^6.1.1, semver@^6.1.2, semver@^6.3.0: integrity sha512-b39TBaTSfV6yBrapU89p5fKekE2m/NwnDocOVruQFS1/veMgdzuPcnOM34M6CwxW8jH/lxEa5rBoDeUwu5HHTw== semver@^7.3.7: - version "7.3.8" - resolved "https://registry.yarnpkg.com/semver/-/semver-7.3.8.tgz#07a78feafb3f7b32347d725e33de7e2a2df67798" - integrity sha512-NB1ctGL5rlHrPJtFDVIVzTyQylMLu9N9VICA6HSFJo8MCGVTMW6gfpicwKmmK/dAjTOrqu5l63JJOpDSrAis3A== + version "7.5.0" + resolved "https://registry.yarnpkg.com/semver/-/semver-7.5.0.tgz#ed8c5dc8efb6c629c88b23d41dc9bf40c1d96cd0" + integrity sha512-+XC0AD/R7Q2mPSRuy2Id0+CGTZ98+8f+KvwirxOKIEyid+XSx6HbC63p+O4IndTHuX5Z+JxQ0TghCkO5Cg/2HA== dependencies: lru-cache "^6.0.0" @@ -3613,10 +3600,10 @@ type@^2.7.2: resolved "https://registry.yarnpkg.com/type/-/type-2.7.2.tgz#2376a15a3a28b1efa0f5350dcf72d24df6ef98d0" integrity sha512-dzlvlNlt6AXU7EBSfpAscydQ7gXB+pPGsPnfJnZpiNJBDj7IaJzQlBZYGdEi4R9HmPdBv2XmWJ6YUtoTa7lmCw== -typescript@^5.0.3: - version "5.0.3" - resolved "https://registry.yarnpkg.com/typescript/-/typescript-5.0.3.tgz#fe976f0c826a88d0a382007681cbb2da44afdedf" - integrity sha512-xv8mOEDnigb/tN9PSMTwSEqAnUvkoXMQlicOb0IUVDBSQCgBSaAAROUZYy2IcUy5qU6XajK5jjjO7TMWqBTKZA== +typescript@^5.0.4: + version "5.0.4" + resolved "https://registry.yarnpkg.com/typescript/-/typescript-5.0.4.tgz#b217fd20119bd61a94d4011274e0ab369058da3b" + integrity sha512-cW9T5W9xY37cc+jfEnaUvX91foxtHkza3Nw3wkoF4sSlKn0MONdkdEndig/qPBWXNkmplh3NzayQzCiHM4/hqw== unicode-canonical-property-names-ecmascript@^2.0.0: version "2.0.0" @@ -3641,10 +3628,10 @@ unicode-property-aliases-ecmascript@^2.0.0: resolved "https://registry.yarnpkg.com/unicode-property-aliases-ecmascript/-/unicode-property-aliases-ecmascript-2.1.0.tgz#43d41e3be698bd493ef911077c9b131f827e8ccd" integrity sha512-6t3foTQI9qne+OZoVQB/8x8rk2k1eVy1gRXhV3oFQ5T6R1dqQ1xtin3XqSlx3+ATBkliTaR/hHyJBm+LVPNM8w== -update-browserslist-db@^1.0.9: - version "1.0.10" - resolved "https://registry.yarnpkg.com/update-browserslist-db/-/update-browserslist-db-1.0.10.tgz#0f54b876545726f17d00cd9a2561e6dade943ff3" - integrity sha512-OztqDenkfFkbSG+tRxBeAnCVPckDBcvibKd35yDONx6OU8N7sqgwc7rCbkJ/WcYtVRZ4ba68d6byhC21GFh7sQ== +update-browserslist-db@^1.0.10: + version "1.0.11" + resolved "https://registry.yarnpkg.com/update-browserslist-db/-/update-browserslist-db-1.0.11.tgz#9a2a641ad2907ae7b3616506f4b977851db5b940" + integrity sha512-dCwEFf0/oT85M1fHBg4F0jtLwJrutGoHSQXCh7u4o2t1drG+c0a9Flnqww6XUKSfQMPpJBRjU8d4RXB09qtvaA== dependencies: escalade "^3.1.1" picocolors "^1.0.0" @@ -3675,10 +3662,10 @@ walker@^1.0.8: dependencies: makeerror "1.0.12" -wasm-ast-types@^0.18.2: - version "0.18.2" - resolved "https://registry.yarnpkg.com/wasm-ast-types/-/wasm-ast-types-0.18.2.tgz#2161f390e7a2e4ad45a46bfdeda6d2d56801ece5" - integrity sha512-SKsuc56aYcl2UQM1Zm8IJZ2efvNAYhu/pPgH2OJZvUahGDi8W+jqnrKx9hIJeKW2GQdhboIIPFKY7PihWzgzgQ== +wasm-ast-types@^0.20.0: + version "0.20.0" + resolved "https://registry.yarnpkg.com/wasm-ast-types/-/wasm-ast-types-0.20.0.tgz#93782528318620072ce9650f0e16861c8c620c08" + integrity sha512-EBEf0PaBGwK8eAKjG5SPDY6Dj1AEG4x07paGaJ+hAhltAsF2PgfBikR3i1UIdFjj8BFb2nGwlRTfWPH1ll9Dyg== dependencies: "@babel/runtime" "^7.18.9" "@babel/types" "7.18.10" From 9f2b953d40b8ea97e253b919cffebbcbb7720296 Mon Sep 17 00:00:00 2001 From: Gabe Rodriguez Date: Wed, 10 May 2023 09:30:40 +0200 Subject: [PATCH 16/17] Review updates --- contracts/params/src/emergency_powers.rs | 4 +- contracts/params/src/execute.rs | 4 +- contracts/params/src/types.rs | 42 +++---- contracts/params/tests/helpers/generator.rs | 25 ++-- .../params/tests/test_asset_validation.rs | 12 +- .../params/tests/test_emergency_powers.rs | 12 +- .../params/tests/test_update_asset_params.rs | 29 ++--- .../params/tests/test_vault_validation.rs | 2 +- schemas/mars-params/mars-params.json | 114 ++++++------------ .../mars-params/MarsParams.client.ts | 5 +- .../mars-params/MarsParams.react-query.ts | 5 +- .../generated/mars-params/MarsParams.types.ts | 21 ++-- 12 files changed, 110 insertions(+), 165 deletions(-) diff --git a/contracts/params/src/emergency_powers.rs b/contracts/params/src/emergency_powers.rs index 76c4104ce..2fe95c910 100644 --- a/contracts/params/src/emergency_powers.rs +++ b/contracts/params/src/emergency_powers.rs @@ -13,7 +13,7 @@ pub fn disable_borrowing( OWNER.assert_emergency_owner(deps.storage, &info.sender)?; let mut params = ASSET_PARAMS.load(deps.storage, denom)?; - params.permissions.red_bank.borrow_enabled = false; + params.red_bank.borrow_enabled = false; ASSET_PARAMS.save(deps.storage, denom, ¶ms)?; let response = Response::new() @@ -31,7 +31,7 @@ pub fn disallow_coin( OWNER.assert_emergency_owner(deps.storage, &info.sender)?; let mut params = ASSET_PARAMS.load(deps.storage, denom)?; - params.permissions.rover.whitelisted = false; + params.rover.whitelisted = false; ASSET_PARAMS.save(deps.storage, denom, ¶ms)?; let response = Response::new() diff --git a/contracts/params/src/execute.rs b/contracts/params/src/execute.rs index f8d8baf00..9e5aebd14 100644 --- a/contracts/params/src/execute.rs +++ b/contracts/params/src/execute.rs @@ -99,7 +99,7 @@ pub fn assert_mcf(param_value: Decimal) -> Result<(), ValidationError> { } /// liquidation_threshold should be greater than or equal to max_loan_to_value -pub fn assert_lqt_gte_max_ltv( +pub fn assert_lqt_gt_max_ltv( max_ltv: Decimal, liq_threshold: Decimal, ) -> Result<(), ValidationError> { @@ -113,7 +113,7 @@ pub fn assert_lqt_gte_max_ltv( Ok(()) } -pub fn assert_hls_lqt_gte_max_ltv( +pub fn assert_hls_lqt_gt_max_ltv( max_ltv: Decimal, liq_threshold: Decimal, ) -> Result<(), ValidationError> { diff --git a/contracts/params/src/types.rs b/contracts/params/src/types.rs index 4223bffa8..1a3325159 100644 --- a/contracts/params/src/types.rs +++ b/contracts/params/src/types.rs @@ -2,36 +2,31 @@ use cosmwasm_schema::cw_serde; use cosmwasm_std::{Addr, Coin, Decimal, Uint128}; use mars_utils::{error::ValidationError, helpers::decimal_param_le_one}; -use crate::execute::{assert_hls_lqt_gte_max_ltv, assert_lqt_gte_max_ltv}; +use crate::execute::{assert_hls_lqt_gt_max_ltv, assert_lqt_gt_max_ltv}; #[cw_serde] -pub struct RoverPermissions { +pub struct HighLeverageStrategyParams { + pub max_loan_to_value: Decimal, + pub liquidation_threshold: Decimal, +} + +#[cw_serde] +pub struct RoverSettings { pub whitelisted: bool, + pub hls: HighLeverageStrategyParams, } #[cw_serde] -pub struct RedBankPermissions { +pub struct RedBankSettings { pub deposit_enabled: bool, pub borrow_enabled: bool, pub deposit_cap: Uint128, } -#[cw_serde] -pub struct AssetPermissions { - pub rover: RoverPermissions, - pub red_bank: RedBankPermissions, -} - -#[cw_serde] -pub struct HighLeverageStrategyParams { - pub max_loan_to_value: Decimal, - pub liquidation_threshold: Decimal, -} - #[cw_serde] pub struct AssetParams { - pub permissions: AssetPermissions, - pub hls: HighLeverageStrategyParams, + pub rover: RoverSettings, + pub red_bank: RedBankSettings, pub max_loan_to_value: Decimal, pub liquidation_threshold: Decimal, pub liquidation_bonus: Decimal, @@ -41,13 +36,16 @@ impl AssetParams { pub fn validate(&self) -> Result<(), ValidationError> { decimal_param_le_one(self.max_loan_to_value, "max_loan_to_value")?; decimal_param_le_one(self.liquidation_threshold, "liquidation_threshold")?; - assert_lqt_gte_max_ltv(self.max_loan_to_value, self.liquidation_threshold)?; + assert_lqt_gt_max_ltv(self.max_loan_to_value, self.liquidation_threshold)?; decimal_param_le_one(self.liquidation_bonus, "liquidation_bonus")?; - decimal_param_le_one(self.hls.max_loan_to_value, "hls_max_loan_to_value")?; - decimal_param_le_one(self.hls.liquidation_threshold, "hls_liquidation_threshold")?; - assert_hls_lqt_gte_max_ltv(self.hls.max_loan_to_value, self.hls.liquidation_threshold)?; + decimal_param_le_one(self.rover.hls.max_loan_to_value, "hls_max_loan_to_value")?; + decimal_param_le_one(self.rover.hls.liquidation_threshold, "hls_liquidation_threshold")?; + assert_hls_lqt_gt_max_ltv( + self.rover.hls.max_loan_to_value, + self.rover.hls.liquidation_threshold, + )?; Ok(()) } @@ -77,7 +75,7 @@ impl VaultConfig { pub fn validate(&self) -> Result<(), ValidationError> { decimal_param_le_one(self.max_loan_to_value, "max_loan_to_value")?; decimal_param_le_one(self.liquidation_threshold, "liquidation_threshold")?; - assert_lqt_gte_max_ltv(self.max_loan_to_value, self.liquidation_threshold)?; + assert_lqt_gt_max_ltv(self.max_loan_to_value, self.liquidation_threshold)?; Ok(()) } } diff --git a/contracts/params/tests/helpers/generator.rs b/contracts/params/tests/helpers/generator.rs index 86f29555f..6d963ebaa 100644 --- a/contracts/params/tests/helpers/generator.rs +++ b/contracts/params/tests/helpers/generator.rs @@ -2,29 +2,26 @@ use std::str::FromStr; use cosmwasm_std::{coin, Decimal, Uint128}; use mars_params::types::{ - AssetParams, AssetPermissions, HighLeverageStrategyParams, RedBankPermissions, - RoverPermissions, VaultConfig, + AssetParams, HighLeverageStrategyParams, RedBankSettings, RoverSettings, VaultConfig, }; pub fn default_asset_params() -> AssetParams { AssetParams { - permissions: AssetPermissions { - rover: RoverPermissions { - whitelisted: false, - }, - red_bank: RedBankPermissions { - deposit_enabled: true, - borrow_enabled: false, - deposit_cap: Uint128::new(1_000_000_000), + rover: RoverSettings { + whitelisted: false, + hls: HighLeverageStrategyParams { + max_loan_to_value: Decimal::from_str("0.85").unwrap(), + liquidation_threshold: Decimal::from_str("0.9").unwrap(), }, }, + red_bank: RedBankSettings { + deposit_enabled: true, + borrow_enabled: false, + deposit_cap: Uint128::new(1_000_000_000), + }, max_loan_to_value: Decimal::from_str("0.6").unwrap(), liquidation_threshold: Decimal::from_str("0.7").unwrap(), liquidation_bonus: Decimal::from_str("0.15").unwrap(), - hls: HighLeverageStrategyParams { - max_loan_to_value: Decimal::from_str("0.85").unwrap(), - liquidation_threshold: Decimal::from_str("0.9").unwrap(), - }, } } diff --git a/contracts/params/tests/test_asset_validation.rs b/contracts/params/tests/test_asset_validation.rs index 73a357beb..42df89bc8 100644 --- a/contracts/params/tests/test_asset_validation.rs +++ b/contracts/params/tests/test_asset_validation.rs @@ -98,7 +98,7 @@ fn liquidation_bonus_less_than_or_equal_to_one() { } #[test] -fn liq_threshold_gte_max_ltv() { +fn liq_threshold_gt_max_ltv() { let mut mock = MockEnv::new().build().unwrap(); let mut params = default_asset_params(); params.liquidation_threshold = Decimal::from_str("0.5").unwrap(); @@ -125,7 +125,7 @@ fn liq_threshold_gte_max_ltv() { fn hls_max_ltv_less_than_or_equal_to_one() { let mut mock = MockEnv::new().build().unwrap(); let mut params = default_asset_params(); - params.hls.max_loan_to_value = Decimal::from_str("1.1235").unwrap(); + params.rover.hls.max_loan_to_value = Decimal::from_str("1.1235").unwrap(); let res = mock.update_asset_params( &mock.query_owner(), @@ -148,7 +148,7 @@ fn hls_max_ltv_less_than_or_equal_to_one() { fn hls_liquidation_threshold_less_than_or_equal_to_one() { let mut mock = MockEnv::new().build().unwrap(); let mut params = default_asset_params(); - params.hls.liquidation_threshold = Decimal::from_str("1.1235").unwrap(); + params.rover.hls.liquidation_threshold = Decimal::from_str("1.1235").unwrap(); let res = mock.update_asset_params( &mock.query_owner(), @@ -168,11 +168,11 @@ fn hls_liquidation_threshold_less_than_or_equal_to_one() { } #[test] -fn hls_liq_threshold_gte_hls_max_ltv() { +fn hls_liq_threshold_gt_hls_max_ltv() { let mut mock = MockEnv::new().build().unwrap(); let mut params = default_asset_params(); - params.hls.liquidation_threshold = Decimal::from_str("0.5").unwrap(); - params.hls.max_loan_to_value = Decimal::from_str("0.6").unwrap(); + params.rover.hls.liquidation_threshold = Decimal::from_str("0.5").unwrap(); + params.rover.hls.max_loan_to_value = Decimal::from_str("0.6").unwrap(); let res = mock.update_asset_params( &mock.query_owner(), diff --git a/contracts/params/tests/test_emergency_powers.rs b/contracts/params/tests/test_emergency_powers.rs index c932a531d..cd736b5aa 100644 --- a/contracts/params/tests/test_emergency_powers.rs +++ b/contracts/params/tests/test_emergency_powers.rs @@ -48,7 +48,7 @@ fn disabling_borrowing() { let denom = "atom".to_string(); let mut params = default_asset_params(); - params.permissions.red_bank.borrow_enabled = true; + params.red_bank.borrow_enabled = true; mock.update_asset_params( &mock.query_owner(), @@ -60,7 +60,7 @@ fn disabling_borrowing() { .unwrap(); let params = mock.query_asset_params(&denom); - assert!(params.permissions.red_bank.borrow_enabled); + assert!(params.red_bank.borrow_enabled); mock.emergency_update( &emergency_owner, @@ -69,7 +69,7 @@ fn disabling_borrowing() { .unwrap(); let params = mock.query_asset_params(&denom); - assert!(!params.permissions.red_bank.borrow_enabled); + assert!(!params.red_bank.borrow_enabled); } #[test] @@ -79,7 +79,7 @@ fn disallow_coin() { let denom = "atom".to_string(); let mut params = default_asset_params(); - params.permissions.rover.whitelisted = true; + params.rover.whitelisted = true; mock.update_asset_params( &mock.query_owner(), @@ -91,7 +91,7 @@ fn disallow_coin() { .unwrap(); let params = mock.query_asset_params(&denom); - assert!(params.permissions.rover.whitelisted); + assert!(params.rover.whitelisted); mock.emergency_update( &emergency_owner, @@ -100,7 +100,7 @@ fn disallow_coin() { .unwrap(); let params = mock.query_asset_params(&denom); - assert!(!params.permissions.rover.whitelisted); + assert!(!params.rover.whitelisted); } #[test] diff --git a/contracts/params/tests/test_update_asset_params.rs b/contracts/params/tests/test_update_asset_params.rs index 5ddd14542..d5cb781d3 100644 --- a/contracts/params/tests/test_update_asset_params.rs +++ b/contracts/params/tests/test_update_asset_params.rs @@ -51,22 +51,13 @@ fn initializing_asset_param() { assert_eq!(&denom0, &res.denom); // Validate config set correctly - assert_eq!(params.permissions.rover.whitelisted, res.params.permissions.rover.whitelisted); - assert_eq!( - params.permissions.red_bank.deposit_enabled, - res.params.permissions.red_bank.deposit_enabled - ); - assert_eq!( - params.permissions.red_bank.borrow_enabled, - res.params.permissions.red_bank.borrow_enabled - ); + assert_eq!(params.rover.whitelisted, res.params.rover.whitelisted); + assert_eq!(params.red_bank.deposit_enabled, res.params.red_bank.deposit_enabled); + assert_eq!(params.red_bank.borrow_enabled, res.params.red_bank.borrow_enabled); assert_eq!(params.max_loan_to_value, res.params.max_loan_to_value); assert_eq!(params.liquidation_threshold, res.params.liquidation_threshold); assert_eq!(params.liquidation_bonus, res.params.liquidation_bonus); - assert_eq!( - params.permissions.red_bank.deposit_cap, - res.params.permissions.red_bank.deposit_cap - ); + assert_eq!(params.red_bank.deposit_cap, res.params.red_bank.deposit_cap); mock.update_asset_params( &owner, @@ -144,11 +135,11 @@ fn update_existing_asset_params() { .unwrap(); let asset_params = mock.query_asset_params(&denom0); - assert!(!asset_params.permissions.rover.whitelisted); - assert!(asset_params.permissions.red_bank.deposit_enabled); + assert!(!asset_params.rover.whitelisted); + assert!(asset_params.red_bank.deposit_enabled); - params.permissions.rover.whitelisted = true; - params.permissions.red_bank.deposit_enabled = false; + params.rover.whitelisted = true; + params.red_bank.deposit_enabled = false; mock.update_asset_params( &owner, @@ -163,8 +154,8 @@ fn update_existing_asset_params() { assert_eq!(1, all_asset_params.len()); let asset_params = mock.query_asset_params(&denom0); - assert!(asset_params.permissions.rover.whitelisted); - assert!(!asset_params.permissions.red_bank.deposit_enabled); + assert!(asset_params.rover.whitelisted); + assert!(!asset_params.red_bank.deposit_enabled); } #[test] diff --git a/contracts/params/tests/test_vault_validation.rs b/contracts/params/tests/test_vault_validation.rs index 2cda0c779..ea1261896 100644 --- a/contracts/params/tests/test_vault_validation.rs +++ b/contracts/params/tests/test_vault_validation.rs @@ -75,7 +75,7 @@ fn vault_liquidation_threshold_less_than_or_equal_to_one() { } #[test] -fn vault_liq_threshold_gte_max_ltv() { +fn vault_liq_threshold_gt_max_ltv() { let mut mock = MockEnv::new().build().unwrap(); let mut config = default_vault_config(); config.liquidation_threshold = Decimal::from_str("0.5").unwrap(); diff --git a/schemas/mars-params/mars-params.json b/schemas/mars-params/mars-params.json index 62b88d96d..a28d417f3 100644 --- a/schemas/mars-params/mars-params.json +++ b/schemas/mars-params/mars-params.json @@ -101,16 +101,13 @@ "AssetParams": { "type": "object", "required": [ - "hls", "liquidation_bonus", "liquidation_threshold", "max_loan_to_value", - "permissions" + "red_bank", + "rover" ], "properties": { - "hls": { - "$ref": "#/definitions/HighLeverageStrategyParams" - }, "liquidation_bonus": { "$ref": "#/definitions/Decimal" }, @@ -120,8 +117,11 @@ "max_loan_to_value": { "$ref": "#/definitions/Decimal" }, - "permissions": { - "$ref": "#/definitions/AssetPermissions" + "red_bank": { + "$ref": "#/definitions/RedBankSettings" + }, + "rover": { + "$ref": "#/definitions/RoverSettings" } }, "additionalProperties": false @@ -155,22 +155,6 @@ } ] }, - "AssetPermissions": { - "type": "object", - "required": [ - "red_bank", - "rover" - ], - "properties": { - "red_bank": { - "$ref": "#/definitions/RedBankPermissions" - }, - "rover": { - "$ref": "#/definitions/RoverPermissions" - } - }, - "additionalProperties": false - }, "Coin": { "type": "object", "required": [ @@ -326,7 +310,7 @@ } ] }, - "RedBankPermissions": { + "RedBankSettings": { "type": "object", "required": [ "borrow_enabled", @@ -386,12 +370,16 @@ } ] }, - "RoverPermissions": { + "RoverSettings": { "type": "object", "required": [ + "hls", "whitelisted" ], "properties": { + "hls": { + "$ref": "#/definitions/HighLeverageStrategyParams" + }, "whitelisted": { "type": "boolean" } @@ -625,16 +613,13 @@ "AssetParams": { "type": "object", "required": [ - "hls", "liquidation_bonus", "liquidation_threshold", "max_loan_to_value", - "permissions" + "red_bank", + "rover" ], "properties": { - "hls": { - "$ref": "#/definitions/HighLeverageStrategyParams" - }, "liquidation_bonus": { "$ref": "#/definitions/Decimal" }, @@ -644,8 +629,11 @@ "max_loan_to_value": { "$ref": "#/definitions/Decimal" }, - "permissions": { - "$ref": "#/definitions/AssetPermissions" + "red_bank": { + "$ref": "#/definitions/RedBankSettings" + }, + "rover": { + "$ref": "#/definitions/RoverSettings" } }, "additionalProperties": false @@ -666,22 +654,6 @@ }, "additionalProperties": false }, - "AssetPermissions": { - "type": "object", - "required": [ - "red_bank", - "rover" - ], - "properties": { - "red_bank": { - "$ref": "#/definitions/RedBankPermissions" - }, - "rover": { - "$ref": "#/definitions/RoverPermissions" - } - }, - "additionalProperties": false - }, "Decimal": { "description": "A fixed-point decimal value with 18 fractional digits, i.e. Decimal(1_000_000_000_000_000_000) == 1.0\n\nThe greatest possible value that can be represented is 340282366920938463463.374607431768211455 (which is (2^128 - 1) / 10^18)", "type": "string" @@ -702,7 +674,7 @@ }, "additionalProperties": false }, - "RedBankPermissions": { + "RedBankSettings": { "type": "object", "required": [ "borrow_enabled", @@ -722,12 +694,16 @@ }, "additionalProperties": false }, - "RoverPermissions": { + "RoverSettings": { "type": "object", "required": [ + "hls", "whitelisted" ], "properties": { + "hls": { + "$ref": "#/definitions/HighLeverageStrategyParams" + }, "whitelisted": { "type": "boolean" } @@ -802,16 +778,13 @@ "title": "AssetParams", "type": "object", "required": [ - "hls", "liquidation_bonus", "liquidation_threshold", "max_loan_to_value", - "permissions" + "red_bank", + "rover" ], "properties": { - "hls": { - "$ref": "#/definitions/HighLeverageStrategyParams" - }, "liquidation_bonus": { "$ref": "#/definitions/Decimal" }, @@ -821,28 +794,15 @@ "max_loan_to_value": { "$ref": "#/definitions/Decimal" }, - "permissions": { - "$ref": "#/definitions/AssetPermissions" + "red_bank": { + "$ref": "#/definitions/RedBankSettings" + }, + "rover": { + "$ref": "#/definitions/RoverSettings" } }, "additionalProperties": false, "definitions": { - "AssetPermissions": { - "type": "object", - "required": [ - "red_bank", - "rover" - ], - "properties": { - "red_bank": { - "$ref": "#/definitions/RedBankPermissions" - }, - "rover": { - "$ref": "#/definitions/RoverPermissions" - } - }, - "additionalProperties": false - }, "Decimal": { "description": "A fixed-point decimal value with 18 fractional digits, i.e. Decimal(1_000_000_000_000_000_000) == 1.0\n\nThe greatest possible value that can be represented is 340282366920938463463.374607431768211455 (which is (2^128 - 1) / 10^18)", "type": "string" @@ -863,7 +823,7 @@ }, "additionalProperties": false }, - "RedBankPermissions": { + "RedBankSettings": { "type": "object", "required": [ "borrow_enabled", @@ -883,12 +843,16 @@ }, "additionalProperties": false }, - "RoverPermissions": { + "RoverSettings": { "type": "object", "required": [ + "hls", "whitelisted" ], "properties": { + "hls": { + "$ref": "#/definitions/HighLeverageStrategyParams" + }, "whitelisted": { "type": "boolean" } diff --git a/scripts/types/generated/mars-params/MarsParams.client.ts b/scripts/types/generated/mars-params/MarsParams.client.ts index 53d33ae72..744cd3a51 100644 --- a/scripts/types/generated/mars-params/MarsParams.client.ts +++ b/scripts/types/generated/mars-params/MarsParams.client.ts @@ -19,10 +19,9 @@ import { RoverEmergencyUpdate, RedBankEmergencyUpdate, AssetParams, + RedBankSettings, + RoverSettings, HighLeverageStrategyParams, - AssetPermissions, - RedBankPermissions, - RoverPermissions, VaultConfig, Coin, QueryMsg, diff --git a/scripts/types/generated/mars-params/MarsParams.react-query.ts b/scripts/types/generated/mars-params/MarsParams.react-query.ts index d49873504..da3150446 100644 --- a/scripts/types/generated/mars-params/MarsParams.react-query.ts +++ b/scripts/types/generated/mars-params/MarsParams.react-query.ts @@ -20,10 +20,9 @@ import { RoverEmergencyUpdate, RedBankEmergencyUpdate, AssetParams, + RedBankSettings, + RoverSettings, HighLeverageStrategyParams, - AssetPermissions, - RedBankPermissions, - RoverPermissions, VaultConfig, Coin, QueryMsg, diff --git a/scripts/types/generated/mars-params/MarsParams.types.ts b/scripts/types/generated/mars-params/MarsParams.types.ts index 4b34f7596..67cef0548 100644 --- a/scripts/types/generated/mars-params/MarsParams.types.ts +++ b/scripts/types/generated/mars-params/MarsParams.types.ts @@ -81,28 +81,25 @@ export type RedBankEmergencyUpdate = { disable_borrowing: string } export interface AssetParams { - hls: HighLeverageStrategyParams liquidation_bonus: Decimal liquidation_threshold: Decimal max_loan_to_value: Decimal - permissions: AssetPermissions -} -export interface HighLeverageStrategyParams { - liquidation_threshold: Decimal - max_loan_to_value: Decimal -} -export interface AssetPermissions { - red_bank: RedBankPermissions - rover: RoverPermissions + red_bank: RedBankSettings + rover: RoverSettings } -export interface RedBankPermissions { +export interface RedBankSettings { borrow_enabled: boolean deposit_cap: Uint128 deposit_enabled: boolean } -export interface RoverPermissions { +export interface RoverSettings { + hls: HighLeverageStrategyParams whitelisted: boolean } +export interface HighLeverageStrategyParams { + liquidation_threshold: Decimal + max_loan_to_value: Decimal +} export interface VaultConfig { deposit_cap: Coin liquidation_threshold: Decimal From e3c4c6ff94da93c9fe2cadb8895ccebdd7732dde Mon Sep 17 00:00:00 2001 From: Pacman Date: Fri, 2 Jun 2023 17:44:46 +0200 Subject: [PATCH 17/17] chore: bump osmosis-test-tube version --- Cargo.lock | 30 +++++++++++++++++++++--------- Cargo.toml | 2 +- 2 files changed, 22 insertions(+), 10 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 37edb8253..2aa6a3437 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1486,13 +1486,13 @@ checksum = "ceedf44fb00f2d1984b0bc98102627ce622e083e49a5bacdb3e514fa4238e267" [[package]] name = "osmosis-std" -version = "0.13.2" +version = "0.14.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "10d6fe6ac7fcba45ed61d738091d33c838c4cabbcf4892dc7aa56d19d39cc976" +checksum = "2fc0a9075efd64ed5a8be3bf134cbf1080570d68384f2ad58ffaac6c00d063fd" dependencies = [ "chrono", "cosmwasm-std", - "osmosis-std-derive", + "osmosis-std-derive 0.13.2", "prost 0.11.9", "prost-types", "schemars", @@ -1502,13 +1502,13 @@ dependencies = [ [[package]] name = "osmosis-std" -version = "0.14.0" +version = "0.15.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2fc0a9075efd64ed5a8be3bf134cbf1080570d68384f2ad58ffaac6c00d063fd" +checksum = "87725a7480b98887167edf878daa52201a13322ad88e34355a7f2ddc663e047e" dependencies = [ "chrono", "cosmwasm-std", - "osmosis-std-derive", + "osmosis-std-derive 0.15.3", "prost 0.11.9", "prost-types", "schemars", @@ -1528,17 +1528,29 @@ dependencies = [ "syn 1.0.109", ] +[[package]] +name = "osmosis-std-derive" +version = "0.15.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f4d482a16be198ee04e0f94e10dd9b8d02332dcf33bc5ea4b255e7e25eedc5df" +dependencies = [ + "itertools", + "proc-macro2", + "quote", + "syn 1.0.109", +] + [[package]] name = "osmosis-test-tube" -version = "14.1.1" +version = "15.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "37e7d470a607f4016906fee20ff51275b399ffad9903240dc462c0f5226650c7" +checksum = "b6aba931600343de65be9cbf9ed5a98a611bbf1fc9c45994eb980cc5afb18404" dependencies = [ "base64", "bindgen", "cosmrs", "cosmwasm-std", - "osmosis-std 0.13.2", + "osmosis-std 0.15.3", "prost 0.11.9", "serde", "serde_json", diff --git a/Cargo.toml b/Cargo.toml index 04d11d411..be5d5d674 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -42,7 +42,7 @@ cw-storage-plus = "1.0.1" cw-utils = "1.0.1" mars-owner = { version = "1.0.0", features = ["emergency-owner"] } osmosis-std = "0.14.0" -osmosis-test-tube = "14.1.1" +osmosis-test-tube = "15.1.0" prost = { version = "0.11.5", default-features = false, features = ["prost-derive"] } schemars = "0.8.11" serde = { version = "1.0.152", default-features = false, features = ["derive"] }