Skip to content

Commit f66b80f

Browse files
authored
Arlai/inflow skip adapter (#361)
* Adding Inflow Mars Adapter + ability for Inflow to work with adapters for immediate deposit+withdraw * make clippy 0.1.91 happy for gatekeeper * Fix Mars message types and events * Make Adapter interface more generic, no mention of Inflow anymore * Deposit and Withdraw now check depositor is enabled + Added AllPositions query implementation * Adding permissioned "Deposit to Adapter" feature * Adding extensibility of adapters from interface + IBC adapter * Use Custom/Standard and Action/Query for proper TS types * Update the message structure for adapters in vault contract * Automate deployment of vault and Mars adapter * Rename interfaces to inflow_vault and inflow_adapter * Prepare for new types of adapters (outside / within deployed amount calculation) * Adding DeploymentTracking enum to adapters in Vault * Adding IBC Adapter instantiation and initial configuration * Adding Skip swap adapter (no review yet) * Implementing DeploymentDirection and DepositFromDeployment as per Copilot suggestion * Clean up * Add MoveAdapterFunds message * Clean some old schema up * Implementing AvailableForDeposit/Withdraw queries + TimeToWithdraw * Improved the instantiate message for Mars & IBC adapters * Add changelog entry * Add max_slippage feature using Slinky oracle * Osmosis capabilities on skip adapter, using ibc adapter * Allow IBC memo capability + simplify Skip swap adapter * fix error: wasm32 compiler didn't recognize Binary was used * Ability to set memo is an Executor capability, not Depositor * Backport ibc-adapter changes from skip adapter branch (set memo capability) * Added forward path for Osmosis swaps * More generic - local vs cross chain swaps * Fixed the PFM forward memo + Made Skip adapter more generic for cross chain * Fixed timeout as integer and not stirng * Funds should always start from the Skip swap adapter * Fixing clippy warning in 0.1.92 * Addressing Philip's comments * Add changelog + small comment fix * Address Dusan's comments
1 parent d70a9c9 commit f66b80f

28 files changed

Lines changed: 5734 additions & 2 deletions
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
- Add the skip swap adapter that can be triggered to request token swaps on local or remote chains via IBC + PFM + Hooks, using Skip swap contracts. ([\#361](https://github.com/informalsystems/hydro/pull/361))

.gitignore

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,8 @@ tools/build/*
2929
# log files from deployments
3030
*_res.json
3131
*_tx.json
32-
scripts/deploy-config.json
32+
scripts/*.json
33+
scripts/skip-adapter/*.json
3334

3435
.seed
3536

@@ -38,4 +39,3 @@ node_modules/
3839

3940
contracts/liquid-collateral/package.json
4041
contracts/liquid-collateral/package-lock.json
41-

Cargo.lock

Lines changed: 21 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ members = [
1313
"contracts/inflow/control-center",
1414
"contracts/inflow/mars-adapter",
1515
"contracts/inflow/ibc-adapter",
16+
"contracts/inflow/skip-adapter",
1617
"contracts/inflow/proxy",
1718
"contracts/inflow/user-registry",
1819
"packages/cw-orch-interface",

Makefile

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,7 @@ schema:
5050
cd contracts/inflow/user-registry && cargo run --bin inflow_user_registry_schema
5151
cd contracts/inflow/mars-adapter && cargo run --bin inflow_mars_adapter_schema
5252
cd contracts/inflow/ibc-adapter && cargo run --bin inflow_ibc_adapter_schema
53+
cd contracts/inflow/skip-adapter && cargo run --bin inflow_skip_adapter_schema
5354

5455
$(MAKE) ts-codegen-inner SCHEMA_LOCATION=./contracts/hydro/schema NAME=HydroBase
5556
$(MAKE) ts-codegen-inner SCHEMA_LOCATION=./contracts/tribute/schema NAME=TributeBase
@@ -65,6 +66,7 @@ schema:
6566
$(MAKE) ts-codegen-inner SCHEMA_LOCATION=./contracts/inflow/user-registry/schema NAME=InflowUserRegistryBase
6667
$(MAKE) ts-codegen-inner SCHEMA_LOCATION=./contracts/inflow/mars-adapter/schema NAME=InflowMarsAdapterBase
6768
$(MAKE) ts-codegen-inner SCHEMA_LOCATION=./contracts/inflow/ibc-adapter/schema NAME=InflowIBCAdapterBase
69+
$(MAKE) ts-codegen-inner SCHEMA_LOCATION=./contracts/inflow/skip-adapter/schema NAME=InflowSkipAdapterBase
6870

6971
ts-codegen-inner:
7072
npx @cosmwasm/ts-codegen@1.7.2 generate \

artifacts/checksums.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ db981dc9ecb9b4c1a3b0ab3b2cd5fb1bb4b8af8ea65d1aabd410cadaf0dc023d ibc_adapter.wa
99
c95cda39a291a37c5ec67d049cfddba71b90916ccb9d7dec8023e804aaa90ca5 marketplace.wasm
1010
0c2156713a9e401404b780cb4a52d19c4e1b8ea290b9cdb01652131e5bade172 mars_adapter.wasm
1111
988b36afbbddd63f8b919e3b17c1405decacdc91240f522886a6df17e03908fc proxy.wasm
12+
6ebd88c770766dc8dd09ca1baa64c0e3735df6ed6ea5dbd3a43f6d8ead50d03a skip_adapter.wasm
1213
8535ea89d552ea8bae7c005bb375e9cf0114eccafa20d819935d08402e5661a2 st_token_info_provider.wasm
1314
08550312a580125cfd91934ffb287d9d7e5f3db278ea4107602380872c3405a0 tribute.wasm
1415
a107833648b55ffdc7302e2a70d21a8ecfeee71e354168b3ebaf71f9a1d9101f user_registry.wasm

artifacts/skip_adapter.wasm

484 KB
Binary file not shown.
Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
[package]
2+
name = "skip-adapter"
3+
version = { workspace = true }
4+
edition = { workspace = true }
5+
authors = ["arlai-mk"]
6+
7+
[lib]
8+
crate-type = ["cdylib", "rlib"]
9+
10+
[features]
11+
library = []
12+
13+
[dependencies]
14+
cosmwasm-std = { workspace = true }
15+
cosmwasm-schema = { workspace = true }
16+
cw-storage-plus = { workspace = true }
17+
cw2 = { workspace = true }
18+
thiserror = { workspace = true }
19+
serde = { workspace = true }
20+
serde_json = { workspace = true }
21+
schemars = { workspace = true }
22+
neutron-sdk = { workspace = true }
23+
neutron-std = { workspace = true }
24+
interface = { path = "../../../packages/interface" }
25+
ibc-adapter = { path = "../ibc-adapter" }
26+
sha2 = { workspace = true }
27+
hex = { workspace = true }
28+
29+
[dev-dependencies]
30+
cw-multi-test = "2.0"

0 commit comments

Comments
 (0)