Skip to content

Commit e54de6f

Browse files
authored
Implement IBC Callbacks Adapter (#160)
* create a skip2 package which is skip types and methods for cosmwasm 2 * add skip2 to workspace cargo.toml * update makefile to use 15.1 optimizer required to compile cosmwasm 2 deps * add ibc-callbacks scaffolding - a copy of ibc hooks adapter * update skip and skip2 packages with eureka fee - also removes unused code in skip2 pkg * update makefile with latest cw optimizer * update cargo toml and cargo lock * add ibc callbacks adapter * update entrypoint contract with eureka fee logic * update other ibc adapters for updated type * Update Cargo.lock * run make schema * allow large enum variant * fix mantra clippy * allow deprecated fields / variants in ibc callbacks adapter * fix typo commited * hex encode upper on the ibc denom * check success on dest callback * run make fmt * add error * refund only the coin that was ibc transferred on err and timeout * clarify comment * run make fmt * add eureka fee tests for entrypoint * add execute ibc transfer tests * handle both nanos and seconds timeout timestamps * handle returning multi-hop-denoms * make swap venues optional, add mantra pool manager * add ledger testnet contracts * Add cosmoshub testnet contracts * deploy cosmoshub mainnet contracts * update lombard testnet deployed contracts * deploy ledger mainnet contracts * proper ledger deployment with swap contract * deploy babylon mainnet contracts * add evm addr check if solidity encoding is provided * update cosmos hub deployed contracts * update ledger deployed contracts
1 parent a8fa95a commit e54de6f

36 files changed

+4647
-292
lines changed

Cargo.lock

Lines changed: 2270 additions & 240 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
@@ -52,6 +52,7 @@ serde = { version = "1.0.194", default-features = false, features
5252
serde-cw-value = "0.7.0"
5353
serde-json-wasm = "1.0.1"
5454
skip = { version = "0.3.0", path = "./packages/skip" }
55+
skip2 = { version = "0.3.0", path = "./packages/skip2" }
5556
test-case = "3.3.1"
5657
thiserror = "1"
5758
white-whale-std = "1.1.1"

Makefile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,9 +31,9 @@ optimize:
3131
--mount type=volume,source="$(notdir $(CURDIR))_cache",target=/target \
3232
--mount type=volume,source=registry_cache,target=/usr/local/cargo/registry \
3333
--platform linux/arm64 \
34-
cosmwasm/workspace-optimizer-arm64:0.14.0; else \
34+
cosmwasm/workspace-optimizer-arm64:0.16.1; else \
3535
docker run --rm -v "$(CURDIR)":/code \
3636
--mount type=volume,source="$(notdir $(CURDIR))_cache",target=/target \
3737
--mount type=volume,source=registry_cache,target=/usr/local/cargo/registry \
3838
--platform linux/amd64 \
39-
cosmwasm/workspace-optimizer:0.14.0; fi
39+
cosmwasm/workspace-optimizer:0.16.1; fi
Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
[package]
2+
name = "skip-go-ibc-adapter-ibc-callbacks"
3+
version = { workspace = true }
4+
rust-version = { workspace = true }
5+
authors = { workspace = true }
6+
edition = { workspace = true }
7+
license = { workspace = true }
8+
homepage = { workspace = true }
9+
repository = { workspace = true }
10+
documentation = { workspace = true }
11+
keywords = { workspace = true }
12+
13+
[lib]
14+
crate-type = ["cdylib", "rlib"]
15+
16+
[features]
17+
# use library feature to disable all instantiate/execute/query exports
18+
library = []
19+
20+
[dependencies]
21+
cosmwasm-schema = { version = "2.0.0" }
22+
cosmwasm-std = { version = "2.0.0", features = ["stargate"] }
23+
cw2 = { version = "2.0.0" }
24+
cw-storage-plus = { version = "2.0.0" }
25+
ibc-proto = { git = "https://github.com/NotJeremyLiu/ibc-proto-rs", branch = "jl/ftp-v1", default-features = false, features = ["std", "serde"]}
26+
prost = { version = "0.13.5" }
27+
ibc-eureka-solidity-types = {git = "https://github.com/cosmos/solidity-ibc-eureka", branch="serdar/309-callbacks-pkg"}
28+
serde-json-wasm = { workspace = true }
29+
serde-cw-value = { workspace = true }
30+
skip2 = { workspace = true }
31+
thiserror = { workspace = true }
32+
alloy-sol-types = { version = "0.8", default-features = false, features=["json"]}
33+
alloy-primitives = { version = "1.0.0" }
34+
hex = { version = "0.4", default-features = false }
35+
sha2 = { version = "0.10", default-features = false }
36+
37+
[dev-dependencies]
38+
test-case = { workspace = true }
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
# IBC Callbacks Transfer Adapter Contract
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
use cosmwasm_schema::write_api;
2+
use skip2::ibc::{ExecuteMsg, InstantiateMsg, QueryMsg};
3+
4+
fn main() {
5+
write_api! {
6+
instantiate: InstantiateMsg,
7+
execute: ExecuteMsg,
8+
query: QueryMsg
9+
}
10+
}

0 commit comments

Comments
 (0)