Skip to content

Commit 50e06a0

Browse files
feat(zkgm): cosmwasm: handle cross-chain staking
1 parent ac75d48 commit 50e06a0

File tree

8 files changed

+440
-12
lines changed

8 files changed

+440
-12
lines changed

Cargo.lock

Lines changed: 16 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: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -215,6 +215,7 @@ members = [
215215
"lib/linea-types",
216216
"cosmwasm/osmosis-tokenfactory-token-minter",
217217
"cosmwasm/cw20-token-minter",
218+
"cosmwasm/cw-account",
218219
"cosmwasm/ucs03-zkgm-token-minter-api",
219220
"cosmwasm/osmosis-tokenfactory-token-owner",
220221
"cosmwasm/cw20-base",
@@ -322,6 +323,7 @@ ibc-union-msg = { path = "cosmwasm/ibc-union/core/msg", default-feature
322323

323324
frissitheto = { path = "lib/frissitheto", default-features = false }
324325

326+
cw-account = { path = "cosmwasm/cw-account", default-features = false }
325327
cw20-base = { path = "cosmwasm/cw20-base", default-features = false }
326328
cw20-token-minter = { path = "cosmwasm/cw20-token-minter", default-features = false }
327329
osmosis-tokenfactory-token-minter = { path = "cosmwasm/osmosis-tokenfactory-token-minter", default-features = false }

cosmwasm/ibc-union/app/ucs03-zkgm/Cargo.toml

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,8 @@ library = []
2020
[dependencies]
2121
alloy = { workspace = true, features = ["sol-types"] }
2222
cosmwasm-schema = { workspace = true }
23-
cosmwasm-std = { workspace = true, features = ["cosmwasm_1_2"] }
23+
cosmwasm-std = { workspace = true, features = ["cosmwasm_1_2", "staking"] }
24+
cw-account = { workspace = true }
2425
cw-storage-plus = { workspace = true }
2526
embed-commit = { workspace = true }
2627
ethabi = { workspace = true }

cosmwasm/ibc-union/app/ucs03-zkgm/src/com.rs

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,11 @@ pub const OP_MULTIPLEX: u8 = 0x01;
88
pub const OP_BATCH: u8 = 0x02;
99
pub const OP_FUNGIBLE_ASSET_ORDER: u8 = 0x03;
1010

11+
// Privileged instructions
12+
pub const OP_STAKE: u8 = 0xC1;
13+
pub const OP_UNSTAKE: u8 = 0xC2;
14+
pub const OP_WITHDRAW_STAKE: u8 = 0xC3;
15+
1116
pub const ACK_ERR_ONLY_MAKER: &[u8] = &[0xDE, 0xAD, 0xC0, 0xDE];
1217

1318
pub const TAG_ACK_FAILURE: U256 = U256::ZERO;
@@ -68,6 +73,31 @@ alloy::sol! {
6873
uint256 quote_amount;
6974
}
7075

76+
#[derive(Debug, PartialEq)]
77+
struct Stake {
78+
uint256 token_id;
79+
bytes governance_token;
80+
bytes sender;
81+
bytes beneficiary;
82+
bytes validator;
83+
uint256 amount;
84+
}
85+
86+
struct Unstake {
87+
uint256 token_id;
88+
bytes governance_token;
89+
bytes sender;
90+
bytes validator;
91+
uint256 amount;
92+
}
93+
94+
struct WithdrawStake {
95+
uint256 token_id;
96+
bytes governance_token;
97+
bytes sender;
98+
bytes beneficiary;
99+
}
100+
71101
#[derive(Debug)]
72102
struct Ack {
73103
uint256 tag;
@@ -83,4 +113,12 @@ alloy::sol! {
83113
uint256 fill_type;
84114
bytes market_maker;
85115
}
116+
117+
struct UnstakeAck {
118+
uint256 completion_time;
119+
}
120+
121+
struct WithdrawStakeAck {
122+
uint256 amount;
123+
}
86124
}

0 commit comments

Comments
 (0)