-
Notifications
You must be signed in to change notification settings - Fork 42
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(zkgm): cosmwasm scaffold (#3479)
- Loading branch information
Showing
15 changed files
with
1,082 additions
and
175 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
[package] | ||
authors = ["Union.fi Labs"] | ||
edition = { workspace = true } | ||
license-file = { workspace = true } | ||
name = "ibc-union-ucs03-zkgm" | ||
repository = "https://github.com/unionlabs/union" | ||
version = "1.0.0" | ||
|
||
[lints] | ||
workspace = true | ||
|
||
[lib] | ||
crate-type = ["cdylib", "rlib"] | ||
|
||
[features] | ||
library = [] | ||
|
||
[dependencies] | ||
alloy = { workspace = true, features = ["sol-types"] } | ||
base58 = { version = "0.2" } | ||
cosmwasm-schema = { version = "1.5" } | ||
cosmwasm-std = { version = "1.5" } | ||
cw-storage-plus = { version = "1.2" } | ||
ethabi = { workspace = true } | ||
ibc-solidity = { workspace = true, features = ["serde"] } | ||
ibc-union-msg = { workspace = true } | ||
serde = { workspace = true, features = ["derive"] } | ||
thiserror = { workspace = true } | ||
token-factory-api = { workspace = true } | ||
unionlabs = { workspace = true, features = ["ethabi"] } | ||
|
||
[dev-dependencies] | ||
hex = { workspace = true } | ||
serde_json = { workspace = true } |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,71 @@ | ||
use alloy::primitives::U256; | ||
|
||
pub const ZKGM_VERSION_0: u8 = 0x00; | ||
|
||
pub const OP_FUNGIBLE_ASSET_ORDER: u8 = 0x03; | ||
|
||
pub const ACK_ERR_ONLY_MAKER: &[u8] = &[0xDE, 0xAD, 0xC0, 0xDE]; | ||
|
||
pub const TAG_ACK_FAILURE: U256 = U256::ZERO; | ||
pub const TAG_ACK_SUCCESS: U256 = U256::from_be_slice(&[1]); | ||
|
||
pub const FILL_TYPE_PROTOCOL: U256 = U256::from_be_slice(&[0xB0, 0xCA, 0xD0]); | ||
pub const FILL_TYPE_MARKETMAKER: U256 = U256::from_be_slice(&[0xD1, 0xCE, 0xC4, 0x5E]); | ||
|
||
alloy::sol! { | ||
struct ZkgmPacket { | ||
bytes32 salt; | ||
uint256 path; | ||
Instruction instruction; | ||
} | ||
|
||
struct Instruction { | ||
uint8 version; | ||
uint8 opcode; | ||
bytes operand; | ||
} | ||
|
||
struct Forward { | ||
uint32 channel_id; | ||
uint64 timeout_height; | ||
uint64 timeout_timestamp; | ||
Instruction instruction; | ||
} | ||
|
||
struct Multiplex { | ||
bytes sender; | ||
bool eureka; | ||
bytes contract_address; | ||
bytes contract_calldata; | ||
} | ||
|
||
struct Batch { | ||
Instruction[] instructions; | ||
} | ||
|
||
struct FungibleAssetOrder { | ||
bytes sender; | ||
bytes receiver; | ||
bytes base_token; | ||
uint256 base_amount; | ||
string base_token_symbol; | ||
string base_token_name; | ||
uint256 base_token_path; | ||
bytes quote_token; | ||
uint256 quote_amount; | ||
} | ||
|
||
struct Ack { | ||
uint256 tag; | ||
bytes inner_ack; | ||
} | ||
|
||
struct BatchAck { | ||
bytes[] acknowledgements; | ||
} | ||
|
||
struct FungibleAssetOrderAck { | ||
uint256 fill_type; | ||
bytes market_maker; | ||
} | ||
} |
Oops, something went wrong.