From 43576f2e6cb3585fba9a67329dfe0524b46a8edb Mon Sep 17 00:00:00 2001 From: ByeongSu Hong Date: Wed, 14 Feb 2024 15:19:11 +0900 Subject: [PATCH] feat: testnet deployment (#94) * upload codes * disable migration * fix script & deploy * bump deps * rc8 * release * readme * fix workflow * env * final --- .github/workflows/release.yaml | 53 +++ Cargo.toml | 2 +- scripts/README.md | 85 ++++ scripts/action/deploy.ts | 202 ++------- scripts/action/fetch.ts | 4 + scripts/context/osmo-test-5.json | 109 +++++ scripts/package.json | 21 +- scripts/pnpm-lock.yaml | 465 +++++++-------------- scripts/src/config.ts | 72 +++- scripts/src/contracts/hpl_hook_fee.ts | 7 + scripts/src/contracts/hpl_test_mock_ism.ts | 7 + scripts/src/contracts/index.ts | 2 + scripts/src/deploy.ts | 269 +++++++++--- scripts/src/index.ts | 2 +- 14 files changed, 734 insertions(+), 566 deletions(-) create mode 100644 .github/workflows/release.yaml create mode 100644 scripts/README.md create mode 100644 scripts/context/osmo-test-5.json create mode 100644 scripts/src/contracts/hpl_hook_fee.ts create mode 100644 scripts/src/contracts/hpl_test_mock_ism.ts diff --git a/.github/workflows/release.yaml b/.github/workflows/release.yaml new file mode 100644 index 00000000..c755ce2e --- /dev/null +++ b/.github/workflows/release.yaml @@ -0,0 +1,53 @@ +name: release + +on: + push: + tags: + - "v*.*.*" + +jobs: + artifact: + permissions: + contents: write + pull-requests: write + + name: artifact + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + + - name: Install Rust + run: | + rustup toolchain install 1.72 \ + --profile minimal \ + --target wasm32-unknown-unknown \ + --no-self-update + + - name: Cache dependencies + uses: Swatinem/rust-cache@v2 + + - name: Install Deps + run: make install-prod + + - name: Setup Docker Buildx + uses: docker/setup-buildx-action@v2 + + - name: Build wasm + run: | + cargo generate-lockfile + make ci-build + mv wasm_codes.zip ${{ env.ARTIFACT_NAME }} + sha256sum ${{ env.ARTIFACT_NAME }} > ${{ env.ARTIFACT_NAME }}.CHECKSUM + md5sum ${{ env.ARTIFACT_NAME }} > ${{ env.ARTIFACT_NAME }}.CHECKSUM.MD5 + env: + ARTIFACT_NAME: ${{ github.event.repository.name }}-${{ github.ref_name }}.zip + + - name: Release + uses: softprops/action-gh-release@v1 + with: + files: | + ${{ env.ARTIFACT_NAME }} + ${{ env.ARTIFACT_NAME }}.CHECKSUM + ${{ env.ARTIFACT_NAME }}.CHECKSUM.MD5 + env: + ARTIFACT_NAME: ${{ github.event.repository.name }}-${{ github.ref_name }}.zip diff --git a/Cargo.toml b/Cargo.toml index 7fa7f06c..3a274b9e 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -27,7 +27,7 @@ panic = "abort" rpath = false [workspace.package] -version = "0.0.6-rc6" +version = "0.0.6-rc8" authors = [ "byeongsu-hong ", "Eric ", diff --git a/scripts/README.md b/scripts/README.md new file mode 100644 index 00000000..03f75d1f --- /dev/null +++ b/scripts/README.md @@ -0,0 +1,85 @@ +# Deploy Scripts + +## Prerequisites + +- [pnpm](https://pnpm.io/) + +## Configuration + +Create a `config.yaml` file in the root directory of the project. Default option for Osmosis testnet is following. + +Also, you can check the full list of options in the [config.ts](./src/config.ts) file. + +```yaml +network: + id: "osmo-test-5" + hrp: "osmo" + url: "https://rpc.osmotest5.osmosis.zone/" + gas: + price: "0.025" + denom: "uosmo" + domain: 1037 # osmo-test-5 -> ascii / decimal -> sum + +signer: { PRIVATE_KEY } + +deploy: + ism: + type: multisig + owner: { SIGNER_ADDRESS } + validators: + 5: + addrs: + - { SIGNER_ETH_ADDRESS } + threshold: 1 + 420: + addrs: + - { SIGNER_ETH_ADDRESS } + threshold: 1 + 421613: + addrs: + - { SIGNER_ETH_ADDRESS } + threshold: 1 + + hooks: + default: + type: mock + + required: + type: aggregate + owner: { SIGNER_ADDRESS } + hooks: + - type: merkle + + - type: pausable + owner: { SIGNER_ADDRESS } + paused: false + - type: fee + owner: { SIGNER_ADDRESS } + fee: + denom: uosmo + amount: 1 +``` + +## Usage + +### Uploading Contract Codes + +```bash +pnpm upload +``` + +### Deploying Contracts + +```bash +pnpm deploy +``` + +## Maintaining + +### Adding a new contract + +1. Add a new module with actual contract output name in the [contracts](./src/contracts/) directory. +2. Class name should be upper camel case conversion of the contract name. +3. Import new module [contracts/index.ts](./src/index.ts) file. +4. If a new contract is ISM or Hook, add a new option to config type. +5. Add a new field to the Contracts class in the [deploy.ts](./src/deploy.ts) file. diff --git a/scripts/action/deploy.ts b/scripts/action/deploy.ts index 3df56508..11af4a8f 100644 --- a/scripts/action/deploy.ts +++ b/scripts/action/deploy.ts @@ -1,11 +1,20 @@ +import "reflect-metadata"; + import { writeFileSync } from "fs"; import { loadContext } from "../src/load_context"; -import { Client, HookType, config, getSigningClient } from "../src/config"; +import { + Client, + DEFAULT_HOOK, + DEFAULT_ISM, + HookType, + config, + getSigningClient, +} from "../src/config"; import { ContractFetcher } from "./fetch"; import { Context } from "../src/types"; -import { Contracts, deploy_ism } from "../src/deploy"; +import { Contracts, deploy_ism, deploy_hook } from "../src/deploy"; const name = (c: any) => c.contractName; const addr = (ctx: Context, c: any) => ctx.contracts[name(c)].address!; @@ -22,8 +31,7 @@ async function main() { } = contracts; ctx = await deploy_core(ctx, client, contracts); - ctx = await deploy_igp(ctx, client, contracts); - ctx = await deploy_ism_hook(ctx, client, contracts); + ctx = await deploy_ism_and_hook(ctx, client, contracts); // init test mock msg receiver ctx.contracts[name(mocks.receiver)] = await mocks.receiver.instantiate({ @@ -86,84 +94,26 @@ const deploy_core = async ( return ctx; }; -const deploy_igp = async ( - ctx: Context, - client: Client, - { igp }: Contracts -): Promise => { - // init igp - ctx.contracts[name(igp.core)] = await igp.core.instantiate({ - hrp: config.network.hrp, - owner: client.signer, - gas_token: config.deploy.igp.token || config.network.gas.denom, - beneficiary: client.signer, - }); - - // init igp oracle - ctx.contracts[name(igp.oracle)] = await igp.oracle.instantiate({ - owner: client.signer, - }); - - await client.wasm.execute( - client.signer, - addr(ctx, igp.oracle), - { - set_remote_gas_data_configs: { - configs: Object.entries(config.deploy.igp.configs).map( - ([domain, v]) => ({ - remote_domain: Number(domain), - token_exchange_rate: v.exchange_rate.toString(), - gas_price: v.gas_price.toString(), - }) - ), - }, - }, - "auto" - ); - - await client.wasm.execute( - client.signer, - addr(ctx, igp.core), - { - router: { - set_routes: { - set: Object.keys(config.deploy.igp.configs).map((domain) => ({ - domain: Number(domain), - route: addr(ctx, igp.oracle), - })), - }, - }, - }, - "auto" - ); - - return ctx; -}; - -const deploy_ism_hook = async ( +const deploy_ism_and_hook = async ( ctx: Context, client: Client, contracts: Contracts ) => { + // deploy default ism + ctx.contracts["hpl_default_ism"] = { ...ctx.contracts[`hpl_ism_${config.deploy.ism?.type || "multisig"}`], - - address: await deploy_ism( - client, - config.deploy.ism || { - type: "multisig", - owner: "", - validators: { - 5: { - addrs: [client.signer_addr], - threshold: 1, - }, - }, - }, - contracts - ), }; + [ctx, ctx.contracts["hpl_default_ism"].address] = await deploy_ism( + ctx, + client, + config.deploy.ism || DEFAULT_ISM(client.signer_addr), + contracts + ); + + // deploy default hook + ctx.contracts["hpl_default_hook"] = { ...ctx.contracts[ config.deploy.hooks?.default?.type && @@ -171,15 +121,17 @@ const deploy_ism_hook = async ( ? `hpl_hook_${config.deploy.hooks.default.type}` : "hpl_test_mock_hook" ], - - address: await deploy_hook( - ctx, - client, - config.deploy.hooks?.default || { type: "mock" }, - contracts - ), }; + [ctx, ctx.contracts["hpl_default_hook"].address] = await deploy_hook( + ctx, + client, + config.deploy.hooks?.default || DEFAULT_HOOK, + contracts + ); + + // deploy required hook + ctx.contracts["hpl_required_hook"] = { ...ctx.contracts[ config.deploy.hooks?.required?.type && @@ -187,90 +139,16 @@ const deploy_ism_hook = async ( ? `hpl_hook_${config.deploy.hooks.required.type}` : "hpl_test_mock_hook" ], - - address: await deploy_hook( - ctx, - client, - config.deploy.hooks?.required || { type: "mock" }, - contracts - ), }; - return ctx; -}; - -const deploy_hook = async ( - ctx: Context, - client: Client, - hook: HookType, - contracts: Contracts -): Promise => { - const { - core: { mailbox }, - hooks, - igp, - mocks, - } = contracts; - - switch (hook.type) { - case "aggregate": - const aggregate_hook_res = await hooks.aggregate.instantiate({ - owner: hook.owner === "" ? client.signer : hook.owner, - hooks: await Promise.all( - hook.hooks.map((v) => deploy_hook(ctx, client, v, contracts)) - ), - }); - - return aggregate_hook_res.address!; - - case "merkle": - const merkle_hook_res = await hooks.merkle.instantiate({ - owner: hook.owner === "" ? client.signer : hook.owner, - mailbox: addr(ctx, mailbox), - }); - - return merkle_hook_res.address!; - - case "mock": - const mock_hook_res = await mocks.hook.instantiate({}); - - return mock_hook_res.address!; - - case "pausable": - const pausable_hook_res = await hooks.pausable.instantiate({ - owner: hook.owner === "" ? client.signer : hook.owner, - }); - - return pausable_hook_res.address!; - - case "igp": - return ctx.contracts[name(igp.core)].address!; - - case "routing": - const routing_hook_res = await hooks.routing.instantiate({ - owner: hook.owner === "" ? client.signer : hook.owner, - }); + [ctx, ctx.contracts["hpl_required_hook"].address] = await deploy_hook( + ctx, + client, + config.deploy.hooks?.required || DEFAULT_HOOK, + contracts + ); - await client.wasm.execute( - client.signer, - routing_hook_res.address!, - { - router: { - set_routes: { - set: await Promise.all( - Object.entries(hook.hooks).map(async ([domain, v]) => { - const route = await deploy_hook(ctx, client, v, contracts); - return { domain, route }; - }) - ), - }, - }, - }, - "auto" - ); - default: - throw new Error("invalid hook type"); - } + return ctx; }; main().catch(console.error); diff --git a/scripts/action/fetch.ts b/scripts/action/fetch.ts index 270968d4..8cbc23ea 100644 --- a/scripts/action/fetch.ts +++ b/scripts/action/fetch.ts @@ -19,6 +19,8 @@ import { HplTestMockMsgReceiver, HplWarpCw20, HplWarpNative, + HplHookFee, + HplTestMockIsm, } from "../src/contracts"; type Const = new ( @@ -50,6 +52,7 @@ export class ContractFetcher { }, hooks: { aggregate: this.get(HplHookAggregate, "hpl_hook_aggregate"), + fee: this.get(HplHookFee, "hpl_hook_fee"), merkle: this.get(HplHookMerkle, "hpl_hook_merkle"), pausable: this.get(HplHookPausable, "hpl_hook_pausable"), routing: this.get(HplHookRouting, "hpl_hook_routing"), @@ -73,6 +76,7 @@ export class ContractFetcher { }, mocks: { hook: this.get(HplTestMockHook, "hpl_test_mock_hook"), + ism: this.get(HplTestMockIsm, "hpl_test_mock_ism"), receiver: this.get( HplTestMockMsgReceiver, "hpl_test_mock_msg_receiver" diff --git a/scripts/context/osmo-test-5.json b/scripts/context/osmo-test-5.json new file mode 100644 index 00000000..70834476 --- /dev/null +++ b/scripts/context/osmo-test-5.json @@ -0,0 +1,109 @@ +{ + "contracts": { + "hpl_hook_aggregate": { + "address": "osmo10sr7uqmdxf70eym34g3agpqcg3dlhalj2qhskg40224advh5a74qc5htag", + "codeId": 6715, + "digest": "2ae680bad348a4cf289b1cc951bbaf0c68a9c31693b7deb2e0985cd65b5268be" + }, + "hpl_hook_fee": { + "address": "osmo143008a6pn465z8u5pxmjy8dypkhwhkxchua99wq9ukj94k7mvs5syfdpnx", + "codeId": 6716, + "digest": "a7d2db4c76cd6e34978ee19ce25268b705e16db0f0e4fb815f343b289e892777" + }, + "hpl_hook_merkle": { + "address": "osmo164y69rngl4n3uny0mejfpve9pe2j75lwcn4why5c9a4lwtethyksm75wu0", + "codeId": 6717, + "digest": "35da6025ef81ace5ad9b36edf0997828b65b434d87cecdd171a05b50679d263e" + }, + "hpl_hook_pausable": { + "address": "osmo19d0cj9wys0556stak9wvrhg7yr4u3xp77wwy6egmvse4rrfv8e2qhcqjpv", + "codeId": 6718, + "digest": "493a4a637a9a9d73e926a42797524cec6799e895973b6a41e4a9cb7082c138f6" + }, + "hpl_hook_routing": { + "codeId": 6719, + "digest": "6a75d6d571c39c8c0b50850d2faad81ed71141206fd749aff232e4fc59114c35" + }, + "hpl_hook_routing_custom": { + "codeId": 6720, + "digest": "e708e9813a92ff1763fd274541a5dd601ee71a235e7ce501e2385c80792bbf31" + }, + "hpl_hook_routing_fallback": { + "codeId": 6721, + "digest": "4674b05d75b1596f4c6e9e314d56d69cdf8316e580460c8f03b63531721668aa" + }, + "hpl_igp": { + "codeId": 6722, + "digest": "6b7a6853ed70716f27825c14fb01a9dc4564abefe273b1a30886da69aa3f1c48" + }, + "hpl_igp_oracle": { + "codeId": 6723, + "digest": "8f4af18a3e13c8299f8570a1edfcf4633afb9178c9266074819dd797b1a07f45" + }, + "hpl_ism_aggregate": { + "codeId": 6724, + "digest": "fa9ae6d1a129f88e56a35bc836f39427c2a589db6795d97b1c19c18c7eb8b823" + }, + "hpl_ism_multisig": { + "address": "osmo1kcgs2qw2lgsqlg0ah4t9e5d5trz7pha56pzjae4yjnjnpuey2qwqape0mx", + "codeId": 6725, + "digest": "17ffef91b62b5fdb715e598f555901f55df277d94e3a157c63b5d73f883bb80a" + }, + "hpl_ism_pausable": { + "codeId": 6726, + "digest": "2a47af4ae7d55492a743c4dd2a0b644af84e2991eadc6f620b593dfb720540bc" + }, + "hpl_ism_routing": { + "codeId": 6727, + "digest": "641c803101059ab7bc40ebf5f9730e463733b7d0486364367e979873004afe2a" + }, + "hpl_mailbox": { + "address": "osmo17w8776pqahas8el82xcq6lp6ylcreqv9jl3wq32x5l9hm4jds7yqaunlyt", + "codeId": 6728, + "digest": "5e3b0f950b4bcf5e67b12e9cdab953e37c22ee9190f82de5ce2e5e92fa33820b" + }, + "hpl_test_mock_hook": { + "address": "osmo18ssgfr36mnqzmjt6r86jxxunte92zhrhwx6x8ckvmlrysy6cqpks94efx6", + "codeId": 6729, + "digest": "ca19b41ad96e6105d0a63d0984c52b50c3849dd15bf4a4e2c083c9628e19167b" + }, + "hpl_test_mock_ism": { + "codeId": 6730, + "digest": "c4cd903cdaf43c73932c3bdd3c9717d0cb9c4647541e9ec5ab4c16e86b9b70ec" + }, + "hpl_test_mock_msg_receiver": { + "address": "osmo18ughnf23dqd5tdwmh3fnm4amapdn27shgjmr9akraujx9t80uuxqw8l679", + "codeId": 6731, + "digest": "ba40b0ed08399fd7a00d7453f74f4994c1dc1cba365e7149f63ceb9e9e29b34a" + }, + "hpl_validator_announce": { + "address": "osmo1y25235tnv7y8levemflae8wllq32jfrr8rerseyt9mm2t2pa6pgsqksg20", + "codeId": 6732, + "digest": "716f8b3124e53f5d3534106ae40640dee11e7df2003106f0f2476d1ff3c12e57" + }, + "hpl_warp_cw20": { + "codeId": 6733, + "digest": "8ebc84704e5c9e48562a8a48f7df8b7021e946b8e1aba4f0d53964460dcaffcf" + }, + "hpl_warp_native": { + "codeId": 6734, + "digest": "581c35d20a031d11debbf452ac1b18dfe18a16da2d43b31767c963dfc7e90fd6" + }, + "hpl_default_ism": { + "codeId": 6725, + "digest": "17ffef91b62b5fdb715e598f555901f55df277d94e3a157c63b5d73f883bb80a", + "address": "osmo1kcgs2qw2lgsqlg0ah4t9e5d5trz7pha56pzjae4yjnjnpuey2qwqape0mx" + }, + "hpl_default_hook": { + "codeId": 6729, + "digest": "ca19b41ad96e6105d0a63d0984c52b50c3849dd15bf4a4e2c083c9628e19167b", + "address": "osmo18ssgfr36mnqzmjt6r86jxxunte92zhrhwx6x8ckvmlrysy6cqpks94efx6" + }, + "hpl_required_hook": { + "codeId": 6715, + "digest": "2ae680bad348a4cf289b1cc951bbaf0c68a9c31693b7deb2e0985cd65b5268be", + "address": "osmo10sr7uqmdxf70eym34g3agpqcg3dlhalj2qhskg40224advh5a74qc5htag" + } + }, + "address": "osmo1g3q542hpttdrj9aaczsq0tkl0uyfk7nkydklz6" +} diff --git a/scripts/package.json b/scripts/package.json index d7699162..c0b33123 100644 --- a/scripts/package.json +++ b/scripts/package.json @@ -4,22 +4,21 @@ "description": "", "main": "index.js", "scripts": { - "test": "echo \"Error: no test specified\" && exit 1", + "upload": "ts-node src/index.ts", + "deploy": "ts-node action/deploy.ts", "build": "npx tsc" }, "keywords": [], "author": "", "license": "ISC", "dependencies": { - "@cosmjs/cosmwasm": "^0.25.6", - "@cosmjs/cosmwasm-launchpad": "^0.25.6", - "@cosmjs/cosmwasm-stargate": "^0.31.0", - "@cosmjs/crypto": "^0.31.0", - "@cosmjs/encoding": "^0.31.0", - "@cosmjs/proto-signing": "^0.31.0", - "@cosmjs/stargate": "^0.31.0", - "@cosmjs/tendermint-rpc": "0.31.0", - "axios": "^1.6.2", + "@cosmjs/cosmwasm-stargate": "^0.32.2", + "@cosmjs/crypto": "^0.32.2", + "@cosmjs/encoding": "^0.32.2", + "@cosmjs/proto-signing": "^0.32.2", + "@cosmjs/stargate": "^0.32.2", + "@cosmjs/tendermint-rpc": "^0.32.2", + "axios": "^1.6.7", "colors": "^1.4.0", "commander": "^11.1.0", "inversify": "^6.0.1", @@ -34,4 +33,4 @@ "tsx": "^3.13.0", "typescript": "^5.1.6" } -} \ No newline at end of file +} diff --git a/scripts/pnpm-lock.yaml b/scripts/pnpm-lock.yaml index 66ec77a8..be43b28a 100644 --- a/scripts/pnpm-lock.yaml +++ b/scripts/pnpm-lock.yaml @@ -5,33 +5,27 @@ settings: excludeLinksFromLockfile: false dependencies: - '@cosmjs/cosmwasm': - specifier: ^0.25.6 - version: 0.25.6 - '@cosmjs/cosmwasm-launchpad': - specifier: ^0.25.6 - version: 0.25.6 '@cosmjs/cosmwasm-stargate': - specifier: ^0.31.0 - version: 0.31.0 + specifier: ^0.32.2 + version: 0.32.2 '@cosmjs/crypto': - specifier: ^0.31.0 - version: 0.31.0 + specifier: ^0.32.2 + version: 0.32.2 '@cosmjs/encoding': - specifier: ^0.31.0 - version: 0.31.0 + specifier: ^0.32.2 + version: 0.32.2 '@cosmjs/proto-signing': - specifier: ^0.31.0 - version: 0.31.0 + specifier: ^0.32.2 + version: 0.32.2 '@cosmjs/stargate': - specifier: ^0.31.0 - version: 0.31.0 + specifier: ^0.32.2 + version: 0.32.2 '@cosmjs/tendermint-rpc': - specifier: 0.31.0 - version: 0.31.0 + specifier: ^0.32.2 + version: 0.32.2 axios: - specifier: ^1.6.2 - version: 1.6.2 + specifier: ^1.6.7 + version: 1.6.7 colors: specifier: ^1.4.0 version: 1.4.0 @@ -73,54 +67,31 @@ packages: /@confio/ics23@0.6.8: resolution: {integrity: sha512-wB6uo+3A50m0sW/EWcU64xpV/8wShZ6bMTa7pF8eYsTrSkQA7oLUIJcs/wb8g4y2Oyq701BaGiO6n/ak5WXO1w==} dependencies: - '@noble/hashes': 1.3.1 + '@noble/hashes': 1.3.3 protobufjs: 6.11.4 dev: false - /@cosmjs/amino@0.25.6: - resolution: {integrity: sha512-9dXN2W7LHjDtJUGNsQ9ok0DfxeN3ca/TXnxCR3Ikh/5YqBqxI8Gel1J9PQO9L6EheYyh045Wff4bsMaLjyEeqQ==} + /@cosmjs/amino@0.32.2: + resolution: {integrity: sha512-lcK5RCVm4OfdAooxKcF2+NwaDVVpghOq6o/A40c2mHXDUzUoRZ33VAHjVJ9Me6vOFxshrw/XEFn1f4KObntjYA==} dependencies: - '@cosmjs/crypto': 0.25.6 - '@cosmjs/encoding': 0.25.6 - '@cosmjs/math': 0.25.6 - '@cosmjs/utils': 0.25.6 + '@cosmjs/crypto': 0.32.2 + '@cosmjs/encoding': 0.32.2 + '@cosmjs/math': 0.32.2 + '@cosmjs/utils': 0.32.2 dev: false - /@cosmjs/amino@0.31.0: - resolution: {integrity: sha512-xJ5CCEK7H79FTpOuEmlpSzVI+ZeYESTVvO3wHDgbnceIyAne3C68SvyaKqLUR4uJB0Z4q4+DZHbqW6itUiv4lA==} + /@cosmjs/cosmwasm-stargate@0.32.2: + resolution: {integrity: sha512-OwJHzIx2CoJS6AULxOpNR6m+CI0GXxy8z9svHA1ZawzNM3ZGlL0GvHdhmF0WkpX4E7UdrYlJSLpKcgg5Fo6i7Q==} dependencies: - '@cosmjs/crypto': 0.31.1 - '@cosmjs/encoding': 0.31.1 - '@cosmjs/math': 0.31.1 - '@cosmjs/utils': 0.31.1 - dev: false - - /@cosmjs/cosmwasm-launchpad@0.25.6: - resolution: {integrity: sha512-rzpYg/A8tvXbY6p89LabPB1mqCtTUv+33nN+s+VWMH0oOl0LSIgLE0yIT61kwTaf2dWQvRVeFaiRLFC72/w/zw==} - dependencies: - '@cosmjs/crypto': 0.25.6 - '@cosmjs/encoding': 0.25.6 - '@cosmjs/launchpad': 0.25.6 - '@cosmjs/math': 0.25.6 - '@cosmjs/utils': 0.25.6 - pako: 2.1.0 - transitivePeerDependencies: - - debug - dev: false - - /@cosmjs/cosmwasm-stargate@0.31.0: - resolution: {integrity: sha512-l6aX++3LhaAGZO46qIgrrNF40lYhOrdPfl35Z32ks6Wf3mwgbQEZwaxnoGzwUePY7/yaIiEFJ1JO6MlVPZVuag==} - dependencies: - '@cosmjs/amino': 0.31.0 - '@cosmjs/crypto': 0.31.0 - '@cosmjs/encoding': 0.31.0 - '@cosmjs/math': 0.31.0 - '@cosmjs/proto-signing': 0.31.0 - '@cosmjs/stargate': 0.31.0 - '@cosmjs/tendermint-rpc': 0.31.0 - '@cosmjs/utils': 0.31.0 - cosmjs-types: 0.8.0 - long: 4.0.0 + '@cosmjs/amino': 0.32.2 + '@cosmjs/crypto': 0.32.2 + '@cosmjs/encoding': 0.32.2 + '@cosmjs/math': 0.32.2 + '@cosmjs/proto-signing': 0.32.2 + '@cosmjs/stargate': 0.32.2 + '@cosmjs/tendermint-rpc': 0.32.2 + '@cosmjs/utils': 0.32.2 + cosmjs-types: 0.9.0 pako: 2.1.0 transitivePeerDependencies: - bufferutil @@ -128,132 +99,54 @@ packages: - utf-8-validate dev: false - /@cosmjs/cosmwasm@0.25.6: - resolution: {integrity: sha512-o+YM2NvL3/2O5lnG/vHk9QE+DvDH6FNYfvzO/evit17sAr/m5G2E8fuROlU+Z9Ml6Nj0QXgqhsR81WCGcup1Sw==} - dependencies: - '@cosmjs/cosmwasm-launchpad': 0.25.6 - transitivePeerDependencies: - - debug - dev: false - - /@cosmjs/crypto@0.25.6: - resolution: {integrity: sha512-ec+YcQLrg2ibcxtNrh4FqQnG9kG9IE/Aik2NH6+OXQdFU/qFuBTxSFcKDgzzBOChwlkXwydllM9Jjbp+dgIzRw==} + /@cosmjs/crypto@0.32.2: + resolution: {integrity: sha512-RuxrYKzhrPF9g6NmU7VEq++Hn1vZJjqqJpZ9Tmw9lOYOV8BUsv+j/0BE86kmWi7xVJ7EwxiuxYsKuM8IR18CIA==} dependencies: - '@cosmjs/encoding': 0.25.6 - '@cosmjs/math': 0.25.6 - '@cosmjs/utils': 0.25.6 - bip39: 3.1.0 - bn.js: 4.12.0 - elliptic: 6.5.4 - js-sha3: 0.8.0 - libsodium-wrappers: 0.7.11 - ripemd160: 2.0.2 - sha.js: 2.4.11 - dev: false - - /@cosmjs/crypto@0.31.0: - resolution: {integrity: sha512-UaqCe6Tgh0pe1QlZ66E13t6FlIF86QrnBXXq+EN7Xe1Rouza3fJ1ojGlPleJZkBoq3tAyYVIOOqdZIxtVj/sIQ==} - dependencies: - '@cosmjs/encoding': 0.31.0 - '@cosmjs/math': 0.31.0 - '@cosmjs/utils': 0.31.0 - '@noble/hashes': 1.3.1 - bn.js: 5.2.1 - elliptic: 6.5.4 - libsodium-wrappers-sumo: 0.7.11 - dev: false - - /@cosmjs/crypto@0.31.1: - resolution: {integrity: sha512-4R/SqdzdVzd4E5dpyEh1IKm5GbTqwDogutyIyyb1bcOXiX/x3CrvPI9Tb4WSIMDLvlb5TVzu2YnUV51Q1+6mMA==} - dependencies: - '@cosmjs/encoding': 0.31.1 - '@cosmjs/math': 0.31.1 - '@cosmjs/utils': 0.31.1 - '@noble/hashes': 1.3.1 + '@cosmjs/encoding': 0.32.2 + '@cosmjs/math': 0.32.2 + '@cosmjs/utils': 0.32.2 + '@noble/hashes': 1.3.3 bn.js: 5.2.1 elliptic: 6.5.4 - libsodium-wrappers-sumo: 0.7.11 + libsodium-wrappers-sumo: 0.7.13 dev: false - /@cosmjs/encoding@0.25.6: - resolution: {integrity: sha512-0imUOB8XkUstI216uznPaX1hqgvLQ2Xso3zJj5IV5oJuNlsfDj9nt/iQxXWbJuettc6gvrFfpf+Vw2vBZSZ75g==} + /@cosmjs/encoding@0.32.2: + resolution: {integrity: sha512-WX7m1wLpA9V/zH0zRcz4EmgZdAv1F44g4dbXOgNj1eXZw1PIGR12p58OEkLN51Ha3S4DKRtCv5CkhK1KHEvQtg==} dependencies: base64-js: 1.5.1 bech32: 1.1.4 readonly-date: 1.0.0 dev: false - /@cosmjs/encoding@0.31.0: - resolution: {integrity: sha512-NYGQDRxT7MIRSlcbAezwxK0FqnaSPKCH7O32cmfpHNWorFxhy9lwmBoCvoe59Kd0HmArI4h+NGzLEfX3OLnA4Q==} + /@cosmjs/json-rpc@0.32.2: + resolution: {integrity: sha512-lan2lOgmz4yVE/HR8eCOSiII/1OudIulk8836koyIDCsPEpt6eKBuctnAD168vABGArKccLAo7Mr2gy9nrKrOQ==} dependencies: - base64-js: 1.5.1 - bech32: 1.1.4 - readonly-date: 1.0.0 - dev: false - - /@cosmjs/encoding@0.31.1: - resolution: {integrity: sha512-IuxP6ewwX6vg9sUJ8ocJD92pkerI4lyG8J5ynAM3NaX3q+n+uMoPRSQXNeL9bnlrv01FF1kIm8if/f5F7ZPtkA==} - dependencies: - base64-js: 1.5.1 - bech32: 1.1.4 - readonly-date: 1.0.0 - dev: false - - /@cosmjs/json-rpc@0.31.1: - resolution: {integrity: sha512-gIkCj2mUDHAxvmJnHtybXtMLZDeXrkDZlujjzhvJlWsIuj1kpZbKtYqh+eNlfwhMkMMAlQa/y4422jDmizW+ng==} - dependencies: - '@cosmjs/stream': 0.31.1 + '@cosmjs/stream': 0.32.2 xstream: 11.14.0 dev: false - /@cosmjs/launchpad@0.25.6: - resolution: {integrity: sha512-4Yhn4cX50UE6jZz/hWqKeeCmvrlrz0BBwOdYX/29k25FqP+oLAow1xKm6UxgYuuAq8Pg/bUvswxSqwegZJTb6g==} - dependencies: - '@cosmjs/amino': 0.25.6 - '@cosmjs/crypto': 0.25.6 - '@cosmjs/encoding': 0.25.6 - '@cosmjs/math': 0.25.6 - '@cosmjs/utils': 0.25.6 - axios: 0.21.4 - fast-deep-equal: 3.1.3 - transitivePeerDependencies: - - debug - dev: false - - /@cosmjs/math@0.25.6: - resolution: {integrity: sha512-Fmyc9FJ8KMU34n7rdapMJrT/8rx5WhMw2F7WLBu7AVLcBh0yWsXIcMSJCoPHTOnMIiABjXsnrrwEaLrOOBfu6A==} - dependencies: - bn.js: 4.12.0 - dev: false - - /@cosmjs/math@0.31.0: - resolution: {integrity: sha512-Sb/8Ry/+gKJaYiV6X8q45kxXC9FoV98XCY1WXtu0JQwOi61VCG2VXsURQnVvZ/EhR/CuT/swOlNKrqEs3da0fw==} - dependencies: - bn.js: 5.2.1 - dev: false - - /@cosmjs/math@0.31.1: - resolution: {integrity: sha512-kiuHV6m6DSB8/4UV1qpFhlc4ul8SgLXTGRlYkYiIIP4l0YNeJ+OpPYaOlEgx4Unk2mW3/O2FWYj7Jc93+BWXng==} + /@cosmjs/math@0.32.2: + resolution: {integrity: sha512-b8+ruAAY8aKtVKWSft2IvtCVCUH1LigIlf9ALIiY8n9jtM4kMASiaRbQ/27etnSAInV88IaezKK9rQZrtxTjcw==} dependencies: bn.js: 5.2.1 dev: false - /@cosmjs/proto-signing@0.31.0: - resolution: {integrity: sha512-JNlyOJRkn8EKB9mCthkjr6lVX6eyVQ09PFdmB4/DR874E62dFTvQ+YvyKMAgN7K7Dcjj26dVlAD3f6Xs7YOGDg==} + /@cosmjs/proto-signing@0.32.2: + resolution: {integrity: sha512-UV4WwkE3W3G3s7wwU9rizNcUEz2g0W8jQZS5J6/3fiN0mRPwtPKQ6EinPN9ASqcAJ7/VQH4/9EPOw7d6XQGnqw==} dependencies: - '@cosmjs/amino': 0.31.0 - '@cosmjs/crypto': 0.31.0 - '@cosmjs/encoding': 0.31.0 - '@cosmjs/math': 0.31.0 - '@cosmjs/utils': 0.31.0 - cosmjs-types: 0.8.0 - long: 4.0.0 + '@cosmjs/amino': 0.32.2 + '@cosmjs/crypto': 0.32.2 + '@cosmjs/encoding': 0.32.2 + '@cosmjs/math': 0.32.2 + '@cosmjs/utils': 0.32.2 + cosmjs-types: 0.9.0 dev: false - /@cosmjs/socket@0.31.1: - resolution: {integrity: sha512-XTtEr+x3WGbqkzoGX0sCkwVqf5n+bBqDwqNgb+DWaBABQxHVRuuainrTVp0Yc91D3Iy2twLQzeBA9OrRxDSerw==} + /@cosmjs/socket@0.32.2: + resolution: {integrity: sha512-Qc8jaw4uSBJm09UwPgkqe3g9TBFx4ZR9HkXpwT6Z9I+6kbLerXPR0Gy3NSJFSUgxIfTpO8O1yqoWAyf0Ay17Mw==} dependencies: - '@cosmjs/stream': 0.31.1 + '@cosmjs/stream': 0.32.2 isomorphic-ws: 4.0.1(ws@7.5.9) ws: 7.5.9 xstream: 11.14.0 @@ -262,20 +155,18 @@ packages: - utf-8-validate dev: false - /@cosmjs/stargate@0.31.0: - resolution: {integrity: sha512-GYhk9lzZPj/QmYHC0VV/4AMoRzVcOP+EnB1YZCoWlBdLuVmpBYKRagJqWIrIwdk1E0gF2ZoESd2TYfdh1fqIpg==} + /@cosmjs/stargate@0.32.2: + resolution: {integrity: sha512-AsJa29fT7Jd4xt9Ai+HMqhyj7UQu7fyYKdXj/8+/9PD74xe6lZSYhQPcitUmMLJ1ckKPgXSk5Dd2LbsQT0IhZg==} dependencies: '@confio/ics23': 0.6.8 - '@cosmjs/amino': 0.31.0 - '@cosmjs/encoding': 0.31.0 - '@cosmjs/math': 0.31.0 - '@cosmjs/proto-signing': 0.31.0 - '@cosmjs/stream': 0.31.0 - '@cosmjs/tendermint-rpc': 0.31.0 - '@cosmjs/utils': 0.31.0 - cosmjs-types: 0.8.0 - long: 4.0.0 - protobufjs: 6.11.4 + '@cosmjs/amino': 0.32.2 + '@cosmjs/encoding': 0.32.2 + '@cosmjs/math': 0.32.2 + '@cosmjs/proto-signing': 0.32.2 + '@cosmjs/stream': 0.32.2 + '@cosmjs/tendermint-rpc': 0.32.2 + '@cosmjs/utils': 0.32.2 + cosmjs-types: 0.9.0 xstream: 11.14.0 transitivePeerDependencies: - bufferutil @@ -283,29 +174,23 @@ packages: - utf-8-validate dev: false - /@cosmjs/stream@0.31.0: - resolution: {integrity: sha512-Y+aSHwhHkLGIaQOdqRob+yga2zr9ifl9gZDKD+B7+R5pdWN5f2TTDhYWxA6YZcZ6xRmfr7u8a7tDh7iYLC/zKA==} - dependencies: - xstream: 11.14.0 - dev: false - - /@cosmjs/stream@0.31.1: - resolution: {integrity: sha512-xsIGD9bpBvYYZASajCyOevh1H5pDdbOWmvb4UwGZ78doGVz3IC3Kb9BZKJHIX2fjq9CMdGVJHmlM+Zp5aM8yZA==} + /@cosmjs/stream@0.32.2: + resolution: {integrity: sha512-gpCufLfHAD8Zp1ZKge7AHbDf4RA0TZp66wZY6JaQR5bSiEF2Drjtp4mwXZPGejtaUMnaAgff3LrUzPJfKYdQwg==} dependencies: xstream: 11.14.0 dev: false - /@cosmjs/tendermint-rpc@0.31.0: - resolution: {integrity: sha512-yo9xbeuI6UoEKIhFZ9g0dvUKLqnBzwdpEc/uldQygQc51j38gQVwFko+6sjmhieJqRYYvrYumcbJMiV6GFM9aA==} + /@cosmjs/tendermint-rpc@0.32.2: + resolution: {integrity: sha512-DXyJHDmcAfCix4H/7/dKR0UMdshP01KxJOXHdHxBCbLIpck94BsWD3B2ZTXwfA6sv98so9wOzhp7qGQa5malxg==} dependencies: - '@cosmjs/crypto': 0.31.1 - '@cosmjs/encoding': 0.31.1 - '@cosmjs/json-rpc': 0.31.1 - '@cosmjs/math': 0.31.1 - '@cosmjs/socket': 0.31.1 - '@cosmjs/stream': 0.31.1 - '@cosmjs/utils': 0.31.1 - axios: 0.21.4 + '@cosmjs/crypto': 0.32.2 + '@cosmjs/encoding': 0.32.2 + '@cosmjs/json-rpc': 0.32.2 + '@cosmjs/math': 0.32.2 + '@cosmjs/socket': 0.32.2 + '@cosmjs/stream': 0.32.2 + '@cosmjs/utils': 0.32.2 + axios: 1.6.7 readonly-date: 1.0.0 xstream: 11.14.0 transitivePeerDependencies: @@ -314,16 +199,8 @@ packages: - utf-8-validate dev: false - /@cosmjs/utils@0.25.6: - resolution: {integrity: sha512-ofOYiuxVKNo238vCPPlaDzqPXy2AQ/5/nashBo5rvPZJkxt9LciGfUEQWPCOb1BIJDNx2Dzu0z4XCf/dwzl0Dg==} - dev: false - - /@cosmjs/utils@0.31.0: - resolution: {integrity: sha512-nNcycZWUYLNJlrIXgpcgVRqdl6BXjF4YlXdxobQWpW9Tikk61bEGeAFhDYtC0PwHlokCNw0KxWiHGJL4nL7Q5A==} - dev: false - - /@cosmjs/utils@0.31.1: - resolution: {integrity: sha512-n4Se1wu4GnKwztQHNFfJvUeWcpvx3o8cWhSbNs9JQShEuB3nv3R5lqFBtDCgHZF/emFQAP+ZjF8bTfCs9UBGhA==} + /@cosmjs/utils@0.32.2: + resolution: {integrity: sha512-Gg5t+eR7vPJMAmhkFt6CZrzPd0EKpAslWwk5rFVYZpJsM8JG5KT9XQ99hgNM3Ov6ScNoIWbXkpX27F6A9cXR4Q==} dev: false /@cspotcode/source-map-support@0.8.1: @@ -547,8 +424,8 @@ packages: '@jridgewell/sourcemap-codec': 1.4.15 dev: true - /@noble/hashes@1.3.1: - resolution: {integrity: sha512-EbqwksQwz9xDRGfDST86whPBgM65E0OH/pCgqW0GBVzO22bNE+NuIbeTb714+IfSjU3aRk47EUvXIb5bTsenKA==} + /@noble/hashes@1.3.3: + resolution: {integrity: sha512-V7/fPHgl+jsVPXqqeOzT8egNj2iBIVt+ECeMMG8TdcnTikP3oaBtUVqpT/gYCR68aEBJSF+XbYUxStjbFMqIIA==} engines: {node: '>= 16'} dev: false @@ -652,18 +529,10 @@ packages: resolution: {integrity: sha512-Oei9OH4tRh0YqU3GxhX79dM/mwVgvbZJaSNaRk+bshkj0S5cfHcgYakreBjrHwatXKbz+IoIdYLxrKim2MjW0Q==} dev: false - /axios@0.21.4: - resolution: {integrity: sha512-ut5vewkiu8jjGBdqpM44XxjuCjq9LAKeHVmoVfHVzy8eHgxxq8SbAVQNovDA8mVi05kP0Ea/n/UzcSHcTJQfNg==} + /axios@1.6.7: + resolution: {integrity: sha512-/hDJGff6/c7u0hDkvkGxR/oy6CbCs8ziCsC7SqmhjfozqiJGc8Z11wrv9z9lYfY4K8l+H9TpjcMDX0xOZmx+RA==} dependencies: - follow-redirects: 1.15.2 - transitivePeerDependencies: - - debug - dev: false - - /axios@1.6.2: - resolution: {integrity: sha512-7i24Ri4pmDRfJTR7LDBhsOTtcm+9kjX5WiY1X3wIisx6G9So3pfMkEiU7emUBe46oceVImccTEM3k6C5dbVW8A==} - dependencies: - follow-redirects: 1.15.2 + follow-redirects: 1.15.5 form-data: 4.0.0 proxy-from-env: 1.1.0 transitivePeerDependencies: @@ -678,12 +547,6 @@ packages: resolution: {integrity: sha512-s0IrSOzLlbvX7yp4WBfPITzpAU8sqQcpsmwXDiKwrG4r491vwCO/XpejasRNl0piBMe/DvP4Tz0mIS/X1DPJBQ==} dev: false - /bip39@3.1.0: - resolution: {integrity: sha512-c9kiwdk45Do5GL0vJMe7tS95VjCii65mYAH7DfWl3uW8AVzXKQVUm64i3hzVybBDMp9r7j9iNxR85+ul8MdN/A==} - dependencies: - '@noble/hashes': 1.3.1 - dev: false - /bn.js@4.12.0: resolution: {integrity: sha512-c98Bf3tPniI+scsdk237ku1Dc3ujXQTSgyiPUDEOe7tRkhrqridvh8klBv0HCEso1OLOYcHuCv/cS6DNxKH+ZA==} dev: false @@ -717,22 +580,29 @@ packages: engines: {node: '>=16'} dev: false - /cosmjs-types@0.8.0: - resolution: {integrity: sha512-Q2Mj95Fl0PYMWEhA2LuGEIhipF7mQwd9gTQ85DdP9jjjopeoGaDxvmPa5nakNzsq7FnO1DMTatXTAx6bxMH7Lg==} - dependencies: - long: 4.0.0 - protobufjs: 6.11.4 + /cosmjs-types@0.9.0: + resolution: {integrity: sha512-MN/yUe6mkJwHnCFfsNPeCfXVhyxHYW6c/xDUzrSbBycYzw++XvWDMJArXp2pLdgD6FQ8DW79vkPjeNKVrXaHeQ==} dev: false /create-require@1.1.1: resolution: {integrity: sha512-dcKFX3jn0MpIaXjisoRvexIJVEKzaq7z2rZKxf+MSr9TkdmHmsU4m2lcLojrj/FHl8mk5VxMmYA+ftRkP/3oKQ==} dev: true - /define-properties@1.2.0: - resolution: {integrity: sha512-xvqAVKGfT1+UAvPwKTVw/njhdQ8ZhXK4lI0bCIuCMrp2up9nPnaDftrLtmpTazqd1o+UY4zgzU+avtMbDP+ldA==} + /define-data-property@1.1.4: + resolution: {integrity: sha512-rBMvIzlpA8v6E+SJZoo++HAYqsLrkg7MSfIinMPFhmkorw7X+dOXVJQs+QT69zGkzMyfDnIMN2Wid1+NbL3T+A==} + engines: {node: '>= 0.4'} + dependencies: + es-define-property: 1.0.0 + es-errors: 1.3.0 + gopd: 1.0.1 + dev: false + + /define-properties@1.2.1: + resolution: {integrity: sha512-8QmQKqEASLd5nx0U1B1okLElbUuuttJ/AnYmRXbbbGDWh6uS208EjD4Xqq/I9wK7u0v6O08XhTWnt5XtEbR6Dg==} engines: {node: '>= 0.4'} dependencies: - has-property-descriptors: 1.0.0 + define-data-property: 1.1.4 + has-property-descriptors: 1.0.2 object-keys: 1.1.1 dev: false @@ -763,6 +633,18 @@ packages: minimalistic-crypto-utils: 1.0.1 dev: false + /es-define-property@1.0.0: + resolution: {integrity: sha512-jxayLKShrEqqzJ0eumQbVhTYQM27CfT1T35+gCgDFoL82JLsXqTJ76zv6A0YLOgEnLUMvLzsDsGIrl8NFpT2gQ==} + engines: {node: '>= 0.4'} + dependencies: + get-intrinsic: 1.2.4 + dev: false + + /es-errors@1.3.0: + resolution: {integrity: sha512-Zf5H2Kxt2xjTvbJvP2ZWLEICxA6j+hAmMzIlypy4xcBg1vKVnx89Wy0GbS+kf5cwCVFFzdCFh2XSCFNULS6csw==} + engines: {node: '>= 0.4'} + dev: false + /esbuild@0.18.20: resolution: {integrity: sha512-ceqxoedUrcayh7Y7ZX6NdbbDzGROiyVBgC4PriJThBKSVPWnnFHZAkfI1lJT8QFkOwH4qOS2SJkS4wvpGl8BpA==} engines: {node: '>=12'} @@ -799,12 +681,8 @@ packages: hasBin: true dev: true - /fast-deep-equal@3.1.3: - resolution: {integrity: sha512-f3qQ9oQy9j2AhBe/H9VC91wLmKBCCU/gDOnKNAYG5hswO7BLKj09Hc5HYNz9cGI++xlpDCIgDaitVs03ATR84Q==} - dev: false - - /follow-redirects@1.15.2: - resolution: {integrity: sha512-VQLG33o04KaQ8uYi2tVNbdrWp1QWxNNea+nmIB4EVM28v0hmP17z7aG1+wAkNzVq4KeXTq3221ye5qTJP91JwA==} + /follow-redirects@1.15.5: + resolution: {integrity: sha512-vSFWUON1B+yAw1VN4xMfxgn5fTUiaOzAJCKBwIIgT/+7CuGy9+r+5gITvP62j3RmaD5Ph65UaERdOSRGUzZtgw==} engines: {node: '>=4.0'} peerDependencies: debug: '*' @@ -830,17 +708,19 @@ packages: dev: true optional: true - /function-bind@1.1.1: - resolution: {integrity: sha512-yIovAzMX49sF8Yl58fSCWJ5svSLuaibPxXQJFLmBObTuCr0Mf1KiPopGM9NiFjiYBCbfaa2Fh6breQ6ANVTI0A==} + /function-bind@1.1.2: + resolution: {integrity: sha512-7XHNxH7qX9xG5mIwxkhumTox/MIRNcOgDrxWsMt2pAr23WHp6MrRlN7FBSFpCpr+oVO0F744iUgR82nJMfG2SA==} dev: false - /get-intrinsic@1.2.1: - resolution: {integrity: sha512-2DcsyfABl+gVHEfCOaTrWgyt+tb6MSEGmKq+kI5HwLbIYgjgmMcV8KQ41uaKz1xxUcn9tJtgFbQUEVcEbd0FYw==} + /get-intrinsic@1.2.4: + resolution: {integrity: sha512-5uYhsJH8VJBTv7oslg4BznJYhDoRI6waYCxMmCdnTrcCrHA/fCFKoTFz2JKKE0HdDFUF7/oQuhzumXJK7paBRQ==} + engines: {node: '>= 0.4'} dependencies: - function-bind: 1.1.1 - has: 1.0.3 + es-errors: 1.3.0 + function-bind: 1.1.2 has-proto: 1.0.1 has-symbols: 1.0.3 + hasown: 2.0.1 dev: false /get-tsconfig@4.7.2: @@ -853,13 +733,19 @@ packages: resolution: {integrity: sha512-sFdI5LyBiNTHjRd7cGPWapiHWMOXKyuBNX/cWJ3NfzrZQVa8GI/8cofCl74AOVqq9W5kNmguTIzJ/1s2gyI9wA==} engines: {node: '>= 0.4'} dependencies: - define-properties: 1.2.0 + define-properties: 1.2.1 + dev: false + + /gopd@1.0.1: + resolution: {integrity: sha512-d65bNlIadxvpb/A2abVdlqKqV563juRnZ1Wtk6s1sIR8uNsXR70xqIzVqxVf1eTqDunwT2MkczEeaezCKTZhwA==} + dependencies: + get-intrinsic: 1.2.4 dev: false - /has-property-descriptors@1.0.0: - resolution: {integrity: sha512-62DVLZGoiEBDHQyqG4w9xCuZ7eJEwNmJRWw2VY84Oedb7WFcA27fiEVe8oUQx9hAUJ4ekurquucTGwsyO1XGdQ==} + /has-property-descriptors@1.0.2: + resolution: {integrity: sha512-55JNKuIW+vq4Ke1BjOTjM2YctQIvCT7GFzHwmfZPGo5wnrgkid0YQtnAleFSqumZm4az3n2BS+erby5ipJdgrg==} dependencies: - get-intrinsic: 1.2.1 + es-define-property: 1.0.0 dev: false /has-proto@1.0.1: @@ -872,22 +758,6 @@ packages: engines: {node: '>= 0.4'} dev: false - /has@1.0.3: - resolution: {integrity: sha512-f2dvO0VU6Oej7RkWJGrehjbzMAjFp5/VKPp5tTpWIV4JHHZK1/BxbFRtf/siA2SWTe09caDmVtYYzWEIbBS4zw==} - engines: {node: '>= 0.4.0'} - dependencies: - function-bind: 1.1.1 - dev: false - - /hash-base@3.1.0: - resolution: {integrity: sha512-1nmYp/rhMDiE7AYkDw+lLwlAzz0AntGIe51F3RfFfEqyQ3feY2eI/NcwC6umIQVOASPMsWJLJScWKSSvzL9IVA==} - engines: {node: '>=4'} - dependencies: - inherits: 2.0.4 - readable-stream: 3.6.2 - safe-buffer: 5.2.1 - dev: false - /hash.js@1.1.7: resolution: {integrity: sha512-taOaskGt4z4SOANNseOviYDvjEJinIkRgmp7LbKP2YTTmVxWBl87s/uzK9r+44BclBSp2X7K1hqeNfz9JbBeXA==} dependencies: @@ -895,6 +765,13 @@ packages: minimalistic-assert: 1.0.1 dev: false + /hasown@2.0.1: + resolution: {integrity: sha512-1/th4MHjnwncwXsIW6QMzlvYL9kG5e/CpVvLRZe4XPa8TOUNbCELqmvhDmnkNsAjwaG4+I8gJJL0JBvTTLO9qA==} + engines: {node: '>= 0.4'} + dependencies: + function-bind: 1.1.2 + dev: false + /hmac-drbg@1.0.1: resolution: {integrity: sha512-Tti3gMqLdZfhOQY1Mzf/AanLiqh1WTiJgEj26ZuYQ9fbkLomzGchCws4FyrSd4VkpBfiNhaE1On+lOz894jvXg==} dependencies: @@ -919,10 +796,6 @@ packages: ws: 7.5.9 dev: false - /js-sha3@0.8.0: - resolution: {integrity: sha512-gF1cRrHhIzNfToc802P800N8PpXS+evLLXfsVpowqmAFR9uwbi89WvXg2QspOmXL8QL86J4T1EpFu+yUkwJY3Q==} - dev: false - /js-yaml@3.14.1: resolution: {integrity: sha512-okMH7OXXJ7YrN9Ok3/SXrnu4iX9yOk+25nqX4imS2npuvTYDmo/QEZoqwZkYaIDk3jVvBOTOIEgEhaLOynBS9g==} hasBin: true @@ -931,24 +804,14 @@ packages: esprima: 4.0.1 dev: true - /libsodium-sumo@0.7.11: - resolution: {integrity: sha512-bY+7ph7xpk51Ez2GbE10lXAQ5sJma6NghcIDaSPbM/G9elfrjLa0COHl/7P6Wb/JizQzl5UQontOOP1z0VwbLA==} - dev: false - - /libsodium-wrappers-sumo@0.7.11: - resolution: {integrity: sha512-DGypHOmJbB1nZn89KIfGOAkDgfv5N6SBGC3Qvmy/On0P0WD1JQvNRS/e3UL3aFF+xC0m+MYz5M+MnRnK2HMrKQ==} - dependencies: - libsodium-sumo: 0.7.11 + /libsodium-sumo@0.7.13: + resolution: {integrity: sha512-zTGdLu4b9zSNLfovImpBCbdAA4xkpkZbMnSQjP8HShyOutnGjRHmSOKlsylh1okao6QhLiz7nG98EGn+04cZjQ==} dev: false - /libsodium-wrappers@0.7.11: - resolution: {integrity: sha512-SrcLtXj7BM19vUKtQuyQKiQCRJPgbpauzl3s0rSwD+60wtHqSUuqcoawlMDheCJga85nKOQwxNYQxf/CKAvs6Q==} + /libsodium-wrappers-sumo@0.7.13: + resolution: {integrity: sha512-lz4YdplzDRh6AhnLGF2Dj2IUj94xRN6Bh8T0HLNwzYGwPehQJX6c7iYVrFUPZ3QqxE0bqC+K0IIqqZJYWumwSQ==} dependencies: - libsodium: 0.7.11 - dev: false - - /libsodium@0.7.11: - resolution: {integrity: sha512-WPfJ7sS53I2s4iM58QxY3Inb83/6mjlYgcmZs7DJsvDlnmVUwNinBCi5vBT43P6bHRy01O4zsMU2CoVR6xJ40A==} + libsodium-sumo: 0.7.13 dev: false /long@4.0.0: @@ -1023,15 +886,6 @@ packages: resolution: {integrity: sha512-D+zkORCbA9f1tdWRK0RaCR3GPv50cMxcrz4X8k5LTSUD1Dkw47mKJEZQNunItRTkWwgtaUSo1RVFRIG9ZXiFYg==} dev: false - /readable-stream@3.6.2: - resolution: {integrity: sha512-9u/sniCrY3D5WdsERHzHE4G2YCXqoG5FTHUiCC4SIbr6XcLZBY05ya9EKjYek9O5xOAwjGq+1JdGBAS7Q9ScoA==} - engines: {node: '>= 6'} - dependencies: - inherits: 2.0.4 - string_decoder: 1.3.0 - util-deprecate: 1.0.2 - dev: false - /readline@1.3.0: resolution: {integrity: sha512-k2d6ACCkiNYz222Fs/iNze30rRJ1iIicW7JuX/7/cozvih6YCkFZH+J6mAFDVgv0dRBaAyr4jDqC95R2y4IADg==} dev: false @@ -1048,25 +902,6 @@ packages: resolution: {integrity: sha512-seS2Tj26TBVOC2NIc2rOe2y2ZO7efxITtLZcGSOnHHNOQ7CkiUBfw0Iw2ck6xkIhPwLhKNLS8BO+hEpngQlqzw==} dev: true - /ripemd160@2.0.2: - resolution: {integrity: sha512-ii4iagi25WusVoiC4B4lq7pbXfAp3D9v5CwfkY33vffw2+pkDjY1D8GaN7spsxvCSx8dkPqOZCEZyfxcmJG2IA==} - dependencies: - hash-base: 3.1.0 - inherits: 2.0.4 - dev: false - - /safe-buffer@5.2.1: - resolution: {integrity: sha512-rp3So07KcdmmKbGvgaNxQSJr7bGVSVk5S9Eq1F+ppbRo70+YeaDxkw5Dd8NPN+GD6bjnYm2VuPuCXmpuYvmCXQ==} - dev: false - - /sha.js@2.4.11: - resolution: {integrity: sha512-QMEp5B7cftE7APOjk5Y6xgrbWu+WkLVQwk8JNjZ8nKRciZaByEW6MubieAiToS7+dwvrjGhH8jRXz3MVd0AYqQ==} - hasBin: true - dependencies: - inherits: 2.0.4 - safe-buffer: 5.2.1 - dev: false - /source-map-support@0.5.21: resolution: {integrity: sha512-uBHU3L3czsIyYXKX88fdrGovxdSCoTGDRZ6SYXtSRxLZUzHg5P/66Ht6uoUlHu9EZod+inXhKo3qQgwXUT/y1w==} dependencies: @@ -1083,12 +918,6 @@ packages: resolution: {integrity: sha512-D9cPgkvLlV3t3IzL0D0YLvGA9Ahk4PcvVwUbN0dSGr1aP0Nrt4AEnTUbuGvquEC0mA64Gqt1fzirlRs5ibXx8g==} dev: true - /string_decoder@1.3.0: - resolution: {integrity: sha512-hkRX8U1WjJFd8LsDJ2yQ/wWWxaopEsABU1XfkM8A+j0+85JAGppt16cr1Whg6KIbb4okU6Mql6BOj+uup/wKeA==} - dependencies: - safe-buffer: 5.2.1 - dev: false - /symbol-observable@2.0.3: resolution: {integrity: sha512-sQV7phh2WCYAn81oAkakC5qjq2Ml0g8ozqz03wOGnx9dDlG1de6yrF+0RAzSJD8fPUow3PTSMf2SAbOGxb93BA==} engines: {node: '>=0.10'} @@ -1164,10 +993,6 @@ packages: hasBin: true dev: true - /util-deprecate@1.0.2: - resolution: {integrity: sha512-EPD5q1uXyFxJpCrLnCc1nHnq3gOa6DZBocAIiI2TaSCA7VCJ1UJDMagCzIkXNsUYfD1daK//LTEQ8xiIbrHtcw==} - dev: false - /v8-compile-cache-lib@3.0.1: resolution: {integrity: sha512-wa7YjyUGfNZngI/vtK0UHAN+lgDCxBPCylVXGp0zu59Fz5aiGtNXaq3DhIov063MorB+VfufLh3JlF2KdTK3xg==} dev: true diff --git a/scripts/src/config.ts b/scripts/src/config.ts index 86f7337c..778226ce 100644 --- a/scripts/src/config.ts +++ b/scripts/src/config.ts @@ -10,6 +10,19 @@ import { DirectSecp256k1Wallet } from "@cosmjs/proto-signing"; import { GasPrice, SigningStargateClient } from "@cosmjs/stargate"; import { Secp256k1, keccak256 } from "@cosmjs/crypto"; +export const DEFAULT_ISM = (signer: string): IsmType => ({ + type: "multisig", + owner: "", + validators: { + 5: { + addrs: [signer], + threshold: 1, + }, + }, +}); + +export const DEFAULT_HOOK = { type: "mock" } as HookType; + export type IsmType = | { type: "multisig"; @@ -18,6 +31,9 @@ export type IsmType = [domain: number]: { addrs: string[]; threshold: number }; }; } + | { + type: "mock"; + } | { type: "aggregate"; owner: string; @@ -29,10 +45,40 @@ export type IsmType = isms: { [domain: number]: IsmType }; }; +export type FeeHookType = { + type: "fee"; + owner: string; + fee: { + denom: string; + amount: bigint; + }; +}; + +export type IgpHookType = { + type: "igp"; + token?: string; + configs: { + [domain: number]: { + exchange_rate: number; + gas_price: number; + }; + }; +}; + +export type RoutingHookType = { + type: "routing"; + owner: string; + hooks: { [domain: number]: HookType }; + custom_hooks?: { + [domain: number]: { recipient: string; hook: string }; + }; + fallback_hook?: string; +}; + export type HookType = + | FeeHookType | { type: "merkle"; - owner: string; } | { type: "mock"; @@ -40,20 +86,11 @@ export type HookType = | { type: "pausable"; owner: string; + paused: boolean; } - | { - type: "igp"; - } + | IgpHookType | { type: "aggregate"; owner: string; hooks: HookType[] } - | { - type: "routing"; - owner: string; - hooks: { [domain: number]: HookType }; - custom_hooks?: { - [domain: number]: { recipient: string; hook: string }; - }; - fallback_hook?: string; - }; + | RoutingHookType; export type Config = { network: { @@ -71,15 +108,6 @@ export type Config = { signer: string; deploy: { - igp: { - token?: string; - configs: { - [domain: number]: { - exchange_rate: number; - gas_price: number; - }; - }; - }; ism?: IsmType; hooks?: { default?: HookType; diff --git a/scripts/src/contracts/hpl_hook_fee.ts b/scripts/src/contracts/hpl_hook_fee.ts new file mode 100644 index 00000000..2062bd4b --- /dev/null +++ b/scripts/src/contracts/hpl_hook_fee.ts @@ -0,0 +1,7 @@ +import { injectable } from "inversify"; +import { BaseContract } from "../types"; + +@injectable() +export class HplHookFee extends BaseContract { + contractName: string = "hpl_hook_fee"; +} diff --git a/scripts/src/contracts/hpl_test_mock_ism.ts b/scripts/src/contracts/hpl_test_mock_ism.ts new file mode 100644 index 00000000..8a288ca2 --- /dev/null +++ b/scripts/src/contracts/hpl_test_mock_ism.ts @@ -0,0 +1,7 @@ +import { injectable } from "inversify"; +import { BaseContract } from "../types"; + +@injectable() +export class HplTestMockIsm extends BaseContract { + contractName: string = "hpl_test_mock_ism"; +} diff --git a/scripts/src/contracts/index.ts b/scripts/src/contracts/index.ts index 417f7be2..611555a8 100644 --- a/scripts/src/contracts/index.ts +++ b/scripts/src/contracts/index.ts @@ -1,4 +1,5 @@ export * from "./hpl_hook_aggregate"; +export * from "./hpl_hook_fee"; export * from "./hpl_hook_merkle"; export * from "./hpl_hook_pausable"; export * from "./hpl_hook_routing"; @@ -12,6 +13,7 @@ export * from "./hpl_ism_pausable"; export * from "./hpl_ism_routing"; export * from "./hpl_mailbox"; export * from "./hpl_test_mock_hook"; +export * from "./hpl_test_mock_ism"; export * from "./hpl_test_mock_msg_receiver"; export * from "./hpl_validator_announce"; export * from "./hpl_warp_cw20"; diff --git a/scripts/src/deploy.ts b/scripts/src/deploy.ts index 8f176c41..048e2aaa 100644 --- a/scripts/src/deploy.ts +++ b/scripts/src/deploy.ts @@ -1,4 +1,4 @@ -import { Client, IsmType } from "../src/config"; +import { Client, HookType, IgpHookType, IsmType, config } from "../src/config"; import { HplMailbox, HplValidatorAnnounce, @@ -16,7 +16,10 @@ import { HplWarpCw20, HplWarpNative, HplIgpOracle, + HplHookFee, + HplTestMockIsm, } from "./contracts"; +import { Context } from "./types"; export type Contracts = { core: { @@ -25,6 +28,7 @@ export type Contracts = { }; hooks: { aggregate: HplHookAggregate; + fee: HplHookFee; merkle: HplHookMerkle; pausable: HplHookPausable; routing: HplHookRouting; @@ -42,6 +46,7 @@ export type Contracts = { }; mocks: { hook: HplTestMockHook; + ism: HplTestMockIsm; receiver: HplTestMockMsgReceiver; }; warp: { @@ -51,79 +56,67 @@ export type Contracts = { }; const name = (c: any) => c.contractName; +const addr = (ctx: Context, c: any) => ctx.contracts[name(c)].address!; export const deploy_ism = async ( + ctx: Context, client: Client, ism: IsmType, contracts: Contracts -): Promise => { +): Promise<[Context, string]> => { const { isms } = contracts; switch (ism.type) { + // deploy multisig ism case "multisig": - console.log("Instantiate Multisig ISM contract"); const multisig_ism_res = await isms.multisig.instantiate({ owner: ism.owner === "" ? client.signer : ism.owner, }); + ctx.contracts[name(isms.multisig)] = multisig_ism_res; - console.log("Enroll validators"); - console.log(ism); - console.log( - Object.entries(ism.validators).flatMap(([domain, validator]) => - validator.addrs.map((v) => ({ - domain: Number(domain), - validator: v, - })) - ) - ); - await client.wasm.execute( - client.signer, - multisig_ism_res.address!, - { - enroll_validators: { - set: Object.entries(ism.validators).flatMap(([domain, validator]) => - validator.addrs.map((v) => ({ - domain: Number(domain), - validator: v, - })) - ), - }, - }, - "auto" - ); - - console.log("Set thresholds"); - await client.wasm.execute( - client.signer, - multisig_ism_res.address!, - { - set_thresholds: { - set: Object.entries(ism.validators).map( - ([domain, { threshold }]) => ({ - domain: Number(domain), - threshold, - }) - ), + for (const [domain, { addrs, threshold }] of Object.entries( + ism.validators + )) { + await client.wasm.execute( + client.signer, + multisig_ism_res.address!, + { + set_validators: { + domain: Number(domain), + threshold, + validators: addrs, + }, }, - }, - "auto" - ); + "auto" + ); + } - return multisig_ism_res.address!; + return [ctx, multisig_ism_res.address!]; + // deploy aggregate ism case "aggregate": const aggregate_ism_res = await isms.aggregate.instantiate({ owner: ism.owner === "" ? client.signer : ism.owner, isms: await Promise.all( - ism.isms.map((v) => deploy_ism(client, v, contracts)) + ism.isms.map(async (v) => { + const [newCtx, aggr] = await deploy_ism(ctx, client, v, contracts); + + ctx = newCtx; + + return aggr; + }) ), }); + ctx.contracts[name(isms.aggregate)] = aggregate_ism_res; - return aggregate_ism_res.address!; + return [ctx, aggregate_ism_res.address!]; + + // deploy routing ism case "routing": const routing_ism_res = await isms.routing.instantiate({ owner: ism.owner === "" ? client.signer : ism.owner, }); + ctx.contracts[name(isms.routing)] = routing_ism_res; await client.wasm.execute( client.signer, @@ -133,7 +126,15 @@ export const deploy_ism = async ( set_routes: { set: await Promise.all( Object.entries(ism.isms).map(async ([domain, v]) => { - const route = await deploy_ism(client, v, contracts); + const [newCtx, route] = await deploy_ism( + ctx, + client, + v, + contracts + ); + + ctx = newCtx; + return { domain, route }; }) ), @@ -143,9 +144,179 @@ export const deploy_ism = async ( "auto" ); - return routing_ism_res.address!; + return [ctx, routing_ism_res.address!]; default: throw new Error("invalid ism type"); } }; + +export const deploy_hook = async ( + ctx: Context, + client: Client, + hook: HookType, + contracts: Contracts +): Promise<[Context, string]> => { + const { + core: { mailbox }, + hooks, + mocks, + } = contracts; + + switch (hook.type) { + // deploy fee hook + case "fee": + const fee_hook_res = await hooks.fee.instantiate({ + owner: hook.owner === "" ? client.signer : hook.owner, + fee: { ...hook.fee, amount: hook.fee.amount.toString() }, + }); + + ctx.contracts[name(hooks.fee)] = fee_hook_res; + + return [ctx, fee_hook_res.address!]; + + // deploy merkle hook + case "merkle": + const merkle_hook_res = await hooks.merkle.instantiate({ + mailbox: addr(ctx, mailbox), + }); + + ctx.contracts[name(hooks.merkle)] = merkle_hook_res; + + return [ctx, merkle_hook_res.address!]; + + // deploy mock hook + case "mock": + const mock_hook_res = await mocks.hook.instantiate({}); + + ctx.contracts[name(mocks.hook)] = mock_hook_res; + + return [ctx, mock_hook_res.address!]; + + // deploy pausable hook + case "pausable": + const pausable_hook_res = await hooks.pausable.instantiate({ + owner: hook.owner === "" ? client.signer : hook.owner, + paused: hook.paused || false, + }); + + ctx.contracts[name(hooks.pausable)] = pausable_hook_res; + + return [ctx, pausable_hook_res.address!]; + + // deploy igp hook + case "igp": + ctx = await deploy_igp(ctx, client, hook, contracts); + + return [ctx, addr(ctx, contracts.igp.core)]; + + // deploy aggregate hook + case "aggregate": + const aggregate_set = []; + + for (const v of hook.hooks) { + const [newCtx, aggr] = await deploy_hook(ctx, client, v, contracts); + + ctx = newCtx; + + aggregate_set.push(aggr); + } + + const aggregate_hook_res = await hooks.aggregate.instantiate({ + owner: hook.owner === "" ? client.signer : hook.owner, + hooks: aggregate_set, + }); + + ctx.contracts[name(hooks.aggregate)] = aggregate_hook_res; + + return [ctx, aggregate_hook_res.address!]; + + // deploy routing hook + case "routing": + const routing_hook_res = await hooks.routing.instantiate({ + owner: hook.owner === "" ? client.signer : hook.owner, + }); + + ctx.contracts[name(hooks.routing)] = routing_hook_res; + + const routing_set = []; + + for (const [domain, v] of Object.entries(hook.hooks)) { + const [newCtx, route] = await deploy_hook(ctx, client, v, contracts); + + ctx = newCtx; + + routing_set.push({ domain: Number(domain), route }); + } + + await client.wasm.execute( + client.signer, + routing_hook_res.address!, + { + router: { + set_routes: { + set: routing_set, + }, + }, + }, + "auto" + ); + + return [ctx, routing_hook_res.address!]; + default: + throw new Error("invalid hook type"); + } +}; + +export const deploy_igp = async ( + ctx: Context, + client: Client, + settings: IgpHookType, + { igp }: Contracts +): Promise => { + // init igp + ctx.contracts[name(igp.core)] = await igp.core.instantiate({ + hrp: config.network.hrp, + owner: client.signer, + gas_token: settings.token || config.network.gas.denom, + beneficiary: client.signer, + }); + + // init igp oracle + ctx.contracts[name(igp.oracle)] = await igp.oracle.instantiate({ + owner: client.signer, + }); + + await client.wasm.execute( + client.signer, + addr(ctx, igp.oracle), + { + set_remote_gas_data_configs: { + configs: Object.entries(settings.configs).map(([domain, v]) => ({ + remote_domain: Number(domain), + token_exchange_rate: v.exchange_rate.toString(), + gas_price: v.gas_price.toString(), + })), + }, + }, + "auto" + ); + + await client.wasm.execute( + client.signer, + addr(ctx, igp.core), + { + router: { + set_routes: { + set: Object.keys(settings.configs).map((domain) => ({ + domain: Number(domain), + route: addr(ctx, igp.oracle), + })), + }, + }, + }, + "auto" + ); + + return ctx; +}; diff --git a/scripts/src/index.ts b/scripts/src/index.ts index b3e9b860..c0637b0d 100644 --- a/scripts/src/index.ts +++ b/scripts/src/index.ts @@ -122,7 +122,7 @@ async function main() { console.log("No contracts to upload."); } - runMigrations(config.network.id, false); + // runMigrations(config.network.id, false); } main();