From c4d41ff70f4e62ac0137b6fd143ff6ed31105ca5 Mon Sep 17 00:00:00 2001 From: Connor Barr Date: Sat, 21 Dec 2024 10:34:35 +0000 Subject: [PATCH 01/21] feat: alterations to kernel for IBC (#726) Co-authored-by: Joe Monem --- CHANGELOG.md | 6 +- Cargo.lock | 2 +- .../andromeda-set-amount-splitter/src/mock.rs | 1 + .../src/testing/mock_querier.rs | 1 - .../math/andromeda-matrix/src/contract.rs | 1 - contracts/os/andromeda-kernel/Cargo.toml | 2 +- contracts/os/andromeda-kernel/src/contract.rs | 8 +- contracts/os/andromeda-kernel/src/execute.rs | 25 ++- contracts/os/andromeda-kernel/src/ibc.rs | 28 +++- contracts/os/andromeda-kernel/src/query.rs | 9 +- contracts/os/andromeda-kernel/src/reply.rs | 38 ++++- contracts/os/andromeda-kernel/src/state.rs | 4 +- .../src/set_amount_splitter.rs | 1 - packages/andromeda-testing-e2e/Cargo.toml | 2 +- packages/andromeda-testing/Cargo.toml | 2 +- packages/deploy/Cargo.toml | 2 +- packages/std/src/ado_contract/execute.rs | 1 - packages/std/src/ado_contract/rates.rs | 1 - packages/std/src/amp/messages.rs | 2 - packages/std/src/common/rates.rs | 1 + packages/std/src/os/ibc_registry.rs | 4 +- packages/std/src/os/kernel.rs | 37 +---- packages/std/src/os/tests/ibc_registry.rs | 2 +- tests-integration/tests/ibc_registry.rs | 2 +- tests-integration/tests/kernel_orch.rs | 152 +++--------------- tests-integration/tests/splitter.rs | 35 +--- 26 files changed, 129 insertions(+), 240 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 5f07553e0..27cec609d 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -8,6 +8,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ## Unreleased ### Added + - Crowdfund, added additional state [(#715)](https://github.com/andromedaprotocol/andromeda-core/pull/715) - Added optional config for Send in Splitter contracts [(#686)](https://github.com/andromedaprotocol/andromeda-core/pull/686) - Added CW20 suppport in Splitter contracts [(#703)](https://github.com/andromedaprotocol/andromeda-core/pull/703) @@ -18,11 +19,14 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 - Added Schema and Form ADOs [(#591)](https://github.com/andromedaprotocol/andromeda-core/pull/591) ### Changed + - Rates: Limit rates recipient to only one address [(#669)](https://github.com/andromedaprotocol/andromeda-core/pull/669) - Address Validation: Cross-chain recipients don't need to be registered in VFS [(#725)](https://github.com/andromedaprotocol/andromeda-core/pull/725) ### Fixed +- feat: alterations to kernel for IBC [(#726)](https://github.com/andromedaprotocol/andromeda-core/pull/726) + ## Release 3 ### Added @@ -75,7 +79,6 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 - Include ADOBase Version in Schema [(#574)](https://github.com/andromedaprotocol/andromeda-core/pull/574) - Added multi-hop support for IBC [(#604)](https://github.com/andromedaprotocol/andromeda-core/pull/604) - ### Changed - Merkle Root: stage expiration now uses `Milliseconds`[(#417)](https://github.com/andromedaprotocol/andromeda-core/pull/417) @@ -96,7 +99,6 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 - Validator Staking: Updated according to audit [(#565)](https://github.com/andromedaprotocol/andromeda-core/pull/565) - Conditional Splitter: Change lock_time's type from MillisecondsDuration to Expiry [(#567)](https://github.com/andromedaprotocol/andromeda-core/pull/567) - ### Fixed - Splitter: avoid zero send messages, owner updates lock any time [(#457)](https://github.com/andromedaprotocol/andromeda-core/pull/457) diff --git a/Cargo.lock b/Cargo.lock index c83b520b2..09176e8c1 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -629,7 +629,7 @@ dependencies = [ [[package]] name = "andromeda-kernel" -version = "1.1.1" +version = "1.2.0-b.1" dependencies = [ "andromeda-std", "cosmwasm-schema 1.5.8", diff --git a/contracts/finance/andromeda-set-amount-splitter/src/mock.rs b/contracts/finance/andromeda-set-amount-splitter/src/mock.rs index 1d3c3276d..0114e8f29 100644 --- a/contracts/finance/andromeda-set-amount-splitter/src/mock.rs +++ b/contracts/finance/andromeda-set-amount-splitter/src/mock.rs @@ -13,6 +13,7 @@ pub struct MockSetAmountSplitter(Addr); mock_ado!(MockSetAmountSplitter, ExecuteMsg, QueryMsg); impl MockSetAmountSplitter { + #[allow(clippy::too_many_arguments)] pub fn instantiate( app: &mut MockApp, code_id: u64, diff --git a/contracts/finance/andromeda-weighted-distribution-splitter/src/testing/mock_querier.rs b/contracts/finance/andromeda-weighted-distribution-splitter/src/testing/mock_querier.rs index 6965c7a47..0c9c49d01 100644 --- a/contracts/finance/andromeda-weighted-distribution-splitter/src/testing/mock_querier.rs +++ b/contracts/finance/andromeda-weighted-distribution-splitter/src/testing/mock_querier.rs @@ -7,7 +7,6 @@ use cosmwasm_std::{ /// Alternative to `cosmwasm_std::testing::mock_dependencies` that allows us to respond to custom queries. /// /// Automatically assigns a kernel address as MOCK_KERNEL_CONTRACT. - #[allow(dead_code)] pub struct WasmMockQuerier { pub base: MockQuerier, diff --git a/contracts/math/andromeda-matrix/src/contract.rs b/contracts/math/andromeda-matrix/src/contract.rs index 1cc1beb86..730031820 100644 --- a/contracts/math/andromeda-matrix/src/contract.rs +++ b/contracts/math/andromeda-matrix/src/contract.rs @@ -126,7 +126,6 @@ pub fn handle_execute(mut ctx: ExecuteContext, msg: ExecuteMsg) -> Result, diff --git a/contracts/os/andromeda-kernel/Cargo.toml b/contracts/os/andromeda-kernel/Cargo.toml index 838c35239..59ef3cd84 100644 --- a/contracts/os/andromeda-kernel/Cargo.toml +++ b/contracts/os/andromeda-kernel/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "andromeda-kernel" -version = "1.1.1" +version = "1.2.0-b.1" authors = ["Connor Barr "] edition = "2021" rust-version = "1.65.0" diff --git a/contracts/os/andromeda-kernel/src/contract.rs b/contracts/os/andromeda-kernel/src/contract.rs index 873a470a0..7846a8034 100644 --- a/contracts/os/andromeda-kernel/src/contract.rs +++ b/contracts/os/andromeda-kernel/src/contract.rs @@ -99,8 +99,9 @@ pub fn execute( ExecuteMsg::Send { message } => execute::send(execute_env, message), ExecuteMsg::TriggerRelay { packet_sequence, - packet_ack_msg, - } => execute::trigger_relay(execute_env, packet_sequence, packet_ack_msg), + channel_id, + packet_ack, + } => execute::trigger_relay(execute_env, packet_sequence, channel_id, packet_ack), ExecuteMsg::UpsertKeyAddress { key, value } => { execute::upsert_key_address(execute_env, key, value) } @@ -171,5 +172,8 @@ pub fn query(deps: Deps, _env: Env, msg: QueryMsg) -> Result encode_binary(&ADOContract::default().query_version(deps)?), QueryMsg::AdoType {} => encode_binary(&ADOContract::default().query_type(deps)?), QueryMsg::Owner {} => encode_binary(&ADOContract::default().query_contract_owner(deps)?), + QueryMsg::ChainNameByChannel { channel } => { + encode_binary(&query::chain_name_by_channel(deps, channel)?) + } } } diff --git a/contracts/os/andromeda-kernel/src/execute.rs b/contracts/os/andromeda-kernel/src/execute.rs index 25b329572..489940166 100644 --- a/contracts/os/andromeda-kernel/src/execute.rs +++ b/contracts/os/andromeda-kernel/src/execute.rs @@ -10,15 +10,11 @@ use andromeda_std::error::ContractError; use andromeda_std::os::aos_querier::AOSQuerier; #[cfg(not(target_arch = "wasm32"))] use andromeda_std::os::ibc_registry::path_to_hops; -use andromeda_std::os::kernel::{ - AcknowledgementMsg, ChannelInfo, IbcExecuteMsg, Ics20PacketInfo, InternalMsg, - SendMessageWithFundsResponse, -}; +use andromeda_std::os::kernel::{ChannelInfo, IbcExecuteMsg, Ics20PacketInfo, InternalMsg}; use andromeda_std::os::vfs::vfs_resolve_symlink; use cosmwasm_std::{ attr, ensure, from_json, to_json_binary, BankMsg, Binary, Coin, ContractInfoResponse, - CosmosMsg, DepsMut, Env, IbcMsg, IbcPacketAckMsg, MessageInfo, Response, StdError, SubMsg, - WasmMsg, + CosmosMsg, DepsMut, Env, IbcMsg, MessageInfo, Response, StdAck, StdError, SubMsg, WasmMsg, }; use crate::query; @@ -38,16 +34,18 @@ pub fn send(ctx: ExecuteContext, message: AMPMsg) -> Result Result { //TODO Only the authorized address to handle replies can call this function ensure!( ctx.info.sender == KERNEL_ADDRESSES.load(ctx.deps.storage, TRIGGER_KEY)?, ContractError::Unauthorized {} ); - let ics20_packet_info = - CHANNEL_TO_EXECUTE_MSG.load(ctx.deps.storage, packet_sequence.clone())?; + let ics20_packet_info = CHANNEL_TO_EXECUTE_MSG + .load(ctx.deps.storage, (channel_id, packet_sequence)) + .expect("No packet found for channel_id and sequence"); let chain = ics20_packet_info @@ -62,11 +60,10 @@ pub fn trigger_relay( .ok_or_else(|| ContractError::InvalidPacket { error: Some(format!("Channel not found for chain {}", chain)), })?; - let ack: AcknowledgementMsg = - from_json(packet_ack_msg.acknowledgement.data)?; + let ack: StdAck = from_json(packet_ack_msg)?; match ack { - AcknowledgementMsg::Ok(_) => handle_ibc_transfer_funds_reply( + StdAck::Success(_) => handle_ibc_transfer_funds_reply( ctx.deps, ctx.info, ctx.env, @@ -76,7 +73,7 @@ pub fn trigger_relay( ics20_packet_info, ), // This means that the funds have been returned to the contract, time to return the funds to the original sender - AcknowledgementMsg::Error(_) => { + StdAck::Error(_) => { let refund_msg = CosmosMsg::Bank(BankMsg::Send { to_address: ics20_packet_info.sender.clone(), amount: vec![ics20_packet_info.funds.clone()], diff --git a/contracts/os/andromeda-kernel/src/ibc.rs b/contracts/os/andromeda-kernel/src/ibc.rs index edef93a0e..b133eb8f7 100644 --- a/contracts/os/andromeda-kernel/src/ibc.rs +++ b/contracts/os/andromeda-kernel/src/ibc.rs @@ -1,7 +1,7 @@ use crate::ack::{make_ack_fail, make_ack_success}; use crate::execute; use crate::proto::MsgTransfer; -use crate::state::{CHANNEL_TO_CHAIN, KERNEL_ADDRESSES, REFUND_DATA}; +use crate::state::{CHAIN_TO_CHANNEL, CHANNEL_TO_CHAIN, KERNEL_ADDRESSES, REFUND_DATA}; use andromeda_std::amp::{IBC_REGISTRY_KEY, VFS_KEY}; use andromeda_std::common::context::ExecuteContext; use andromeda_std::common::reply::ReplyId; @@ -127,10 +127,13 @@ pub fn do_ibc_packet_receive( msg: IbcPacketReceiveMsg, ) -> Result { let channel = msg.clone().packet.dest.channel_id; - ensure!( - CHANNEL_TO_CHAIN.has(deps.storage, channel.as_str()), - ContractError::Unauthorized {} - ); + let chain = CHANNEL_TO_CHAIN + .may_load(deps.storage, channel.as_str())? + .ok_or(ContractError::Unauthorized {})?; + let channel_info = CHAIN_TO_CHANNEL + .may_load(deps.storage, chain.as_str())? + .ok_or(ContractError::Unauthorized {})?; + let packet_msg: IbcExecuteMsg = from_json(&msg.packet.data)?; let mut execute_env = ExecuteContext { env: env.clone(), @@ -159,25 +162,34 @@ pub fn do_ibc_packet_receive( funds, original_sender, } => { - let amp_msg = AMPMsg::new(recipient, message.clone(), Some(vec![funds.clone()])); + let amp_msg = AMPMsg::new( + recipient.clone(), + message.clone(), + Some(vec![funds.clone()]), + ); execute_env.info = MessageInfo { funds: vec![funds.clone()], - sender: Addr::unchecked("foreign_kernel"), + sender: env.contract.address, }; let res = execute::send(execute_env, amp_msg)?; + // Refunds must be done via the ICS20 channel + let ics20_channel_id = channel_info + .ics20_channel_id + .expect("Cannot refund, ICS20 Channel ID not set"); // Save refund info REFUND_DATA.save( deps.storage, &RefundData { original_sender, funds, - channel, + channel: ics20_channel_id, }, )?; Ok(IbcReceiveResponse::new() .set_ack(make_ack_success()) + .add_attribute("recipient", recipient.as_str()) .add_attributes(res.attributes) .add_submessage(SubMsg::reply_always( res.messages.first().unwrap().msg.clone(), diff --git a/contracts/os/andromeda-kernel/src/query.rs b/contracts/os/andromeda-kernel/src/query.rs index ebfc0faa2..18cab3472 100644 --- a/contracts/os/andromeda-kernel/src/query.rs +++ b/contracts/os/andromeda-kernel/src/query.rs @@ -8,7 +8,9 @@ use andromeda_std::{ }; use cosmwasm_std::{Addr, Coin, Deps}; -use crate::state::{CHAIN_TO_CHANNEL, CURR_CHAIN, IBC_FUND_RECOVERY, KERNEL_ADDRESSES}; +use crate::state::{ + CHAIN_TO_CHANNEL, CHANNEL_TO_CHAIN, CURR_CHAIN, IBC_FUND_RECOVERY, KERNEL_ADDRESSES, +}; pub fn key_address(deps: Deps, key: String) -> Result { Ok(KERNEL_ADDRESSES.load(deps.storage, &key)?) @@ -50,6 +52,11 @@ pub fn channel_info( Ok(resp) } +pub fn chain_name_by_channel(deps: Deps, channel: String) -> Result, ContractError> { + let info = CHANNEL_TO_CHAIN.may_load(deps.storage, &channel)?; + Ok(info) +} + pub fn recoveries(deps: Deps, addr: Addr) -> Result, ContractError> { Ok(IBC_FUND_RECOVERY .may_load(deps.storage, &addr)? diff --git a/contracts/os/andromeda-kernel/src/reply.rs b/contracts/os/andromeda-kernel/src/reply.rs index cb300e4eb..5d13e10ef 100644 --- a/contracts/os/andromeda-kernel/src/reply.rs +++ b/contracts/os/andromeda-kernel/src/reply.rs @@ -14,8 +14,8 @@ use andromeda_std::{ os::aos_querier::AOSQuerier, }; use cosmwasm_std::{ - ensure, wasm_execute, Addr, CosmosMsg, DepsMut, Empty, Env, IbcMsg, Reply, Response, SubMsg, - SubMsgResponse, SubMsgResult, + ensure, to_json_string, wasm_execute, Addr, CosmosMsg, DepsMut, Empty, Env, IbcMsg, Reply, + Response, SubMsg, SubMsgResponse, SubMsgResult, }; /// Handles the reply from an ADO creation @@ -100,10 +100,30 @@ pub fn on_reply_ibc_transfer( _env: Env, msg: Reply, ) -> Result { + if let SubMsgResult::Ok(SubMsgResponse { data: Some(b), .. }) = msg.result { + let MsgTransferResponse { sequence } = + MsgTransferResponse::decode(&b[..]).map_err(|_e| ContractError::InvalidPacket { + error: Some(format!("could not decode response: {b}")), + })?; + + let pending_execute_msg = PENDING_MSG_AND_FUNDS.load(deps.storage)?; + CHANNEL_TO_EXECUTE_MSG.save( + deps.storage, + (pending_execute_msg.channel.clone(), sequence), + &pending_execute_msg, + )?; + PENDING_MSG_AND_FUNDS.remove(deps.storage); + return Ok(Response::new() + .add_attribute("action", "transfer_funds_reply") + .add_attribute("sequence", sequence.to_string())); + } + + #[cfg(not(target_arch = "wasm32"))] + // When the reply is from a non-wasm32 target, the reply data is pulled from the events if let Reply { id: 106, result: SubMsgResult::Ok(SubMsgResponse { events, .. }), - } = msg + } = msg.clone() { if let Some(send_packet_event) = events.iter().find(|e| e.ty == "send_packet") { let packet_data = send_packet_event @@ -133,7 +153,10 @@ pub fn on_reply_ibc_transfer( let pending_execute_msg = PENDING_MSG_AND_FUNDS.load(deps.storage)?; CHANNEL_TO_EXECUTE_MSG.save( deps.storage, - packet_sequence.clone(), + ( + pending_execute_msg.channel.clone(), + packet_sequence.parse().unwrap(), + ), &pending_execute_msg, )?; PENDING_MSG_AND_FUNDS.remove(deps.storage); @@ -163,15 +186,17 @@ pub fn on_reply_ibc_transfer( .add_message(refund_msg) .add_attribute("action", "refund") .add_attribute("recipient", refund_recipient) - .add_attribute("amount_refunded", refund_coin.to_string())) + .add_attribute("amount_refunded", refund_coin.to_string()) + .add_attribute("reply", to_json_string(&msg)?)) } // Handles the reply from an Execute Msg that was preceded by an ICS20 transfer pub fn on_reply_refund_ibc_transfer_with_msg( deps: DepsMut, env: Env, - _msg: Reply, + msg: Reply, ) -> Result { + let err = msg.result.unwrap_err(); let refund_data = REFUND_DATA.load(deps.storage)?; // Construct the refund message let refund_msg = IbcMsg::Transfer { @@ -187,5 +212,6 @@ pub fn on_reply_refund_ibc_transfer_with_msg( ("action", "refund_ibc_transfer_with_msg"), ("recipient", refund_data.original_sender.as_str()), ("amount", refund_data.funds.to_string().as_str()), + ("error", err.to_string().as_str()), ])) } diff --git a/contracts/os/andromeda-kernel/src/state.rs b/contracts/os/andromeda-kernel/src/state.rs index 1b32715d8..80cb58164 100644 --- a/contracts/os/andromeda-kernel/src/state.rs +++ b/contracts/os/andromeda-kernel/src/state.rs @@ -43,7 +43,9 @@ pub const IBC_FUND_RECOVERY: Map<&Addr, Vec> = Map::new("ibc_fund_recovery pub const PENDING_MSG_AND_FUNDS: Item = Item::new("pending_execute_msg"); /// Used to store sequence/channel against an ExecuteMsg, to be sent after an ack of ICS20 -pub const CHANNEL_TO_EXECUTE_MSG: Map = Map::new("channel_to_execute_msg"); +/// Key is (channel_id, sequence) +pub const CHANNEL_TO_EXECUTE_MSG: Map<(String, u64), Ics20PacketInfo> = + Map::new("channel_to_execute_msg"); /// Used to temporarily store the most recent ExecuteMsg with the corresponding Coin to be sent in a reply for ICS20 transfer pub const REFUND_DATA: Item = Item::new("refund_data"); diff --git a/packages/andromeda-finance/src/set_amount_splitter.rs b/packages/andromeda-finance/src/set_amount_splitter.rs index 2e7ac8b08..915561e05 100644 --- a/packages/andromeda-finance/src/set_amount_splitter.rs +++ b/packages/andromeda-finance/src/set_amount_splitter.rs @@ -100,7 +100,6 @@ pub struct GetSplitterConfigResponse { /// * The recipient amount must be above zero /// * Each recipient can't have more than two coins assigned. /// * No duplicate coins - pub fn validate_recipient_list( deps: Deps, recipients: Vec, diff --git a/packages/andromeda-testing-e2e/Cargo.toml b/packages/andromeda-testing-e2e/Cargo.toml index f8a38f73b..0ccab7592 100644 --- a/packages/andromeda-testing-e2e/Cargo.toml +++ b/packages/andromeda-testing-e2e/Cargo.toml @@ -26,7 +26,7 @@ andromeda-modules = { version = "2.0.0", path = "../andromeda-modules" } andromeda-adodb = { version = "1.0.0", path = "../../contracts/os/andromeda-adodb", features = [ "testing", ] } -andromeda-kernel = { version = "1.0.0", path = "../../contracts/os/andromeda-kernel", features = [ +andromeda-kernel = { version = "1.2.0-b.1", path = "../../contracts/os/andromeda-kernel", features = [ "testing", ] } andromeda-vfs = { version = "1.0.0", path = "../../contracts/os/andromeda-vfs", features = [ diff --git a/packages/andromeda-testing/Cargo.toml b/packages/andromeda-testing/Cargo.toml index da9e5f15a..8960144c6 100644 --- a/packages/andromeda-testing/Cargo.toml +++ b/packages/andromeda-testing/Cargo.toml @@ -26,7 +26,7 @@ andromeda-modules = { version = "2.0.0", path = "../andromeda-modules" } andromeda-adodb = { version = "1.0.0", path = "../../contracts/os/andromeda-adodb", features = [ "testing", ] } -andromeda-kernel = { version = "1.0.0", path = "../../contracts/os/andromeda-kernel", features = [ +andromeda-kernel = { version = "1.2.0-b.1", path = "../../contracts/os/andromeda-kernel", features = [ "testing", ] } andromeda-vfs = { version = "1.0.0", path = "../../contracts/os/andromeda-vfs", features = [ diff --git a/packages/deploy/Cargo.toml b/packages/deploy/Cargo.toml index 16666f6f1..b956e8aa9 100644 --- a/packages/deploy/Cargo.toml +++ b/packages/deploy/Cargo.toml @@ -36,7 +36,7 @@ cw-orch = { workspace = true } cw-orch-daemon = "0.24.2" # OS Contracts -andromeda-kernel = { version = "1.1.1", path = "../../contracts/os/andromeda-kernel" } +andromeda-kernel = { version = "1.2.0-b.1", path = "../../contracts/os/andromeda-kernel" } andromeda-adodb = { version = "1.1.1", path = "../../contracts/os/andromeda-adodb" } andromeda-vfs = { version = "1.1.1", path = "../../contracts/os/andromeda-vfs" } andromeda-economics = { version = "1.1.1", path = "../../contracts/os/andromeda-economics" } diff --git a/packages/std/src/ado_contract/execute.rs b/packages/std/src/ado_contract/execute.rs index c13be8776..d9b9bd0cb 100644 --- a/packages/std/src/ado_contract/execute.rs +++ b/packages/std/src/ado_contract/execute.rs @@ -348,7 +348,6 @@ impl ADOContract<'_> { } #[cfg(test)] - mod tests { use super::*; use crate::testing::mock_querier::MOCK_KERNEL_CONTRACT; diff --git a/packages/std/src/ado_contract/rates.rs b/packages/std/src/ado_contract/rates.rs index bfd08b081..ddc54bab6 100644 --- a/packages/std/src/ado_contract/rates.rs +++ b/packages/std/src/ado_contract/rates.rs @@ -168,7 +168,6 @@ impl ADOContract<'_> { } #[cfg(test)] #[cfg(feature = "rates")] - mod tests { use cosmwasm_std::{ diff --git a/packages/std/src/amp/messages.rs b/packages/std/src/amp/messages.rs index 628cde484..16f54dcf8 100644 --- a/packages/std/src/amp/messages.rs +++ b/packages/std/src/amp/messages.rs @@ -245,7 +245,6 @@ impl AMPCtx { /// It contains an original sender, if used for authorisation the sender must be authorised /// The previous sender is the one who sent the message /// A packet may contain several messages which allows for message batching - pub struct AMPPkt { /// Any messages associated with the packet pub messages: Vec, @@ -340,7 +339,6 @@ impl AMPPkt { } /// Generates a SubMsg to send the AMPPkt to the kernel - pub fn to_sub_msg( &self, address: impl Into, diff --git a/packages/std/src/common/rates.rs b/packages/std/src/common/rates.rs index 5108fa627..246fa391c 100644 --- a/packages/std/src/common/rates.rs +++ b/packages/std/src/common/rates.rs @@ -13,6 +13,7 @@ use cw20::Cw20ExecuteMsg; /// * `base_amount` - The amount paid before tax. /// * `remaining_amount_after_royalties` - The amount remaining of the base_amount after royalties /// are applied +/// /// Returns the amount of tax necessary to be paid on top of the `base_amount`. pub fn get_tax_amount( msgs: &[SubMsg], diff --git a/packages/std/src/os/ibc_registry.rs b/packages/std/src/os/ibc_registry.rs index 9c41732fb..f32354bf7 100644 --- a/packages/std/src/os/ibc_registry.rs +++ b/packages/std/src/os/ibc_registry.rs @@ -29,8 +29,10 @@ impl DenomInfo { // Hash the concatenated string using SHA-256 let hash = Sha256::digest(input.as_bytes()); + let hash_str = format!("{:X}", hash); // Return the result in the format "ibc/" - format!("ibc/{:X}", hash).to_lowercase() + // Denom hash must be uppercase + format!("ibc/{:}", hash_str.to_uppercase()) } } #[cw_serde] diff --git a/packages/std/src/os/kernel.rs b/packages/std/src/os/kernel.rs index 706e5eaeb..2ee342136 100644 --- a/packages/std/src/os/kernel.rs +++ b/packages/std/src/os/kernel.rs @@ -4,10 +4,9 @@ use crate::{ messages::{AMPMsg, AMPPkt}, AndrAddr, }, - error::ContractError, }; use cosmwasm_schema::{cw_serde, QueryResponses}; -use cosmwasm_std::{Addr, Binary, Coin, IbcPacketAckMsg}; +use cosmwasm_std::{Addr, Binary, Coin}; #[cw_serde] pub struct ChannelInfo { @@ -45,8 +44,9 @@ pub enum ExecuteMsg { message: AMPMsg, }, TriggerRelay { - packet_sequence: String, - packet_ack_msg: IbcPacketAckMsg, + packet_sequence: u64, + channel_id: String, + packet_ack: Binary, }, /// Upserts a key address to the kernel, restricted to the owner of the kernel UpsertKeyAddress { @@ -112,6 +112,8 @@ pub enum QueryMsg { VerifyAddress { address: String }, #[returns(Option)] ChannelInfo { chain: String }, + #[returns(Option)] + ChainNameByChannel { channel: String }, #[returns(Vec<::cosmwasm_std::Coin>)] Recoveries { addr: Addr }, #[returns(ChainNameResponse)] @@ -170,30 +172,3 @@ pub struct RefundData { pub funds: Coin, pub channel: String, } - -#[cw_serde] -pub struct SendMessageWithFundsResponse {} - -#[cw_serde] -pub enum AcknowledgementMsg { - Ok(S), - Error(String), -} - -impl AcknowledgementMsg { - pub fn unwrap(self) -> Result { - match self { - AcknowledgementMsg::Ok(data) => Ok(data), - AcknowledgementMsg::Error(err) => Err(ContractError::CustomError { msg: err }), - } - } - - pub fn unwrap_err(self) -> Result { - match self { - AcknowledgementMsg::Ok(_) => Err(ContractError::CustomError { - msg: "Not an error".to_string(), - }), - AcknowledgementMsg::Error(err) => Ok(err), - } - } -} diff --git a/packages/std/src/os/tests/ibc_registry.rs b/packages/std/src/os/tests/ibc_registry.rs index f8de4d9bc..5b678caf6 100644 --- a/packages/std/src/os/tests/ibc_registry.rs +++ b/packages/std/src/os/tests/ibc_registry.rs @@ -45,7 +45,7 @@ mod tests { denom: "ibc/1234567890123456789012345678901234567890123456789012345678901234" .to_string(), expected_res: Err(ContractError::InvalidDenom { - msg: Some("Denom hash does not match. Expected: ibc/eab02686416e4b155cfee9c247171e1c4196b218c6a254f765b0958b3af59d09, Actual: ibc/1234567890123456789012345678901234567890123456789012345678901234".to_string()), + msg: Some("Denom hash does not match. Expected: ibc/EAB02686416E4B155CFEE9C247171E1C4196B218C6A254F765B0958B3AF59D09, Actual: ibc/1234567890123456789012345678901234567890123456789012345678901234".to_string()), }), }, ValidateDenomTestCase { diff --git a/tests-integration/tests/ibc_registry.rs b/tests-integration/tests/ibc_registry.rs index 0348e69ba..8710f2ce2 100644 --- a/tests-integration/tests/ibc_registry.rs +++ b/tests-integration/tests/ibc_registry.rs @@ -102,7 +102,7 @@ fn test_ibc_registry() { let denom_info = DenomInfo { path, base_denom }; assert_eq!( denom_info.get_ibc_denom(), - "ibc/eab02686416e4b155cfee9c247171e1c4196b218c6a254f765b0958b3af59d09".to_string() + "ibc/EAB02686416E4B155CFEE9C247171E1C4196B218C6A254F765B0958B3AF59D09".to_string() ); // Test authorization diff --git a/tests-integration/tests/kernel_orch.rs b/tests-integration/tests/kernel_orch.rs index 58993d78b..d658d604e 100644 --- a/tests-integration/tests/kernel_orch.rs +++ b/tests-integration/tests/kernel_orch.rs @@ -23,14 +23,11 @@ use andromeda_std::{ common::{denom::Asset, expiration::Expiry, Milliseconds}, os::{ self, - kernel::{AcknowledgementMsg, ExecuteMsg, InstantiateMsg, SendMessageWithFundsResponse}, + kernel::{ExecuteMsg, InstantiateMsg}, }, }; use andromeda_vfs::VFSContract; -use cosmwasm_std::{ - coin, to_json_binary, Addr, Binary, Decimal, IbcAcknowledgement, IbcEndpoint, IbcPacket, - IbcPacketAckMsg, IbcTimeout, Timestamp, Uint128, -}; +use cosmwasm_std::{coin, to_json_binary, Addr, Binary, Decimal, StdAck, Uint128}; use cw_orch::prelude::*; use cw_orch_interchain::{prelude::*, types::IbcPacketOutcome, InterchainEnv}; use ibc_relayer_types::core::ics24_host::identifier::PortId; @@ -816,7 +813,7 @@ fn test_kernel_ibc_funds_only() { kernel_osmosis .execute( &ExecuteMsg::AssignChannels { - ics20_channel_id: Some(channel.0.channel.unwrap().to_string()), + ics20_channel_id: Some(channel.0.channel.clone().unwrap().to_string()), direct_channel_id: Some(juno_channel.to_string()), chain: "juno".to_string(), kernel_address: kernel_juno.address().unwrap().into_string(), @@ -894,29 +891,9 @@ fn test_kernel_ibc_funds_only() { let kernel_juno_trigger_request = kernel_juno .execute( &ExecuteMsg::TriggerRelay { - packet_sequence: "1".to_string(), - packet_ack_msg: IbcPacketAckMsg::new( - IbcAcknowledgement::new( - to_json_binary(&AcknowledgementMsg::::Ok( - SendMessageWithFundsResponse {}, - )) - .unwrap(), - ), - IbcPacket::new( - Binary::default(), - IbcEndpoint { - port_id: "port_id".to_string(), - channel_id: "channel_id".to_string(), - }, - IbcEndpoint { - port_id: "port_id".to_string(), - channel_id: "channel_id".to_string(), - }, - 1, - IbcTimeout::with_timestamp(Timestamp::from_seconds(1)), - ), - Addr::unchecked("relayer"), - ), + packet_sequence: 1, + channel_id: channel.0.channel.clone().unwrap().to_string(), + packet_ack: to_json_binary(&StdAck::Success(Binary::default())).unwrap(), }, None, ) @@ -1070,29 +1047,9 @@ fn test_kernel_ibc_funds_only() { let kernel_juno_trigger_request = kernel_juno .execute( &ExecuteMsg::TriggerRelay { - packet_sequence: "2".to_string(), - packet_ack_msg: IbcPacketAckMsg::new( - IbcAcknowledgement::new( - to_json_binary(&AcknowledgementMsg::::Ok( - SendMessageWithFundsResponse {}, - )) - .unwrap(), - ), - IbcPacket::new( - Binary::default(), - IbcEndpoint { - port_id: "port_id".to_string(), - channel_id: "channel_id".to_string(), - }, - IbcEndpoint { - port_id: "port_id".to_string(), - channel_id: "channel_id".to_string(), - }, - 1, - IbcTimeout::with_timestamp(Timestamp::from_seconds(1)), - ), - Addr::unchecked("relayer"), - ), + packet_sequence: 2, + channel_id: channel.0.channel.clone().unwrap().to_string(), + packet_ack: to_json_binary(&StdAck::Success(Binary::default())).unwrap(), }, None, ) @@ -1671,7 +1628,7 @@ fn test_kernel_ibc_funds_and_execute_msg() { kernel_osmosis .execute( &ExecuteMsg::AssignChannels { - ics20_channel_id: Some(channel.0.channel.unwrap().to_string()), + ics20_channel_id: Some(channel.0.channel.clone().unwrap().to_string()), direct_channel_id: Some(juno_channel.to_string()), chain: "juno".to_string(), kernel_address: kernel_juno.address().unwrap().into_string(), @@ -1763,31 +1720,9 @@ fn test_kernel_ibc_funds_and_execute_msg() { let kernel_juno_splitter_request = kernel_juno .execute( &ExecuteMsg::TriggerRelay { - packet_sequence: "1".to_string(), - packet_ack_msg: IbcPacketAckMsg::new( - IbcAcknowledgement::new( - to_json_binary( - &AcknowledgementMsg::::Ok( - SendMessageWithFundsResponse {}, - ), - ) - .unwrap(), - ), - IbcPacket::new( - Binary::default(), - IbcEndpoint { - port_id: "port_id".to_string(), - channel_id: "channel_id".to_string(), - }, - IbcEndpoint { - port_id: "port_id".to_string(), - channel_id: "channel_id".to_string(), - }, - 1, - IbcTimeout::with_timestamp(Timestamp::from_seconds(1)), - ), - Addr::unchecked("relayer"), - ), + packet_sequence: 1, + channel_id: channel.0.channel.clone().unwrap().to_string(), + packet_ack: to_json_binary(&StdAck::Success(Binary::default())).unwrap(), }, None, ) @@ -1993,7 +1928,7 @@ fn test_kernel_ibc_funds_only_unhappy() { kernel_osmosis .execute( &ExecuteMsg::AssignChannels { - ics20_channel_id: Some(channel.0.channel.unwrap().to_string()), + ics20_channel_id: Some(channel.0.channel.clone().unwrap().to_string()), direct_channel_id: Some(juno_channel.to_string()), chain: "juno".to_string(), kernel_address: kernel_juno.address().unwrap().into_string(), @@ -2058,31 +1993,9 @@ fn test_kernel_ibc_funds_only_unhappy() { let kernel_juno_splitter_request = kernel_juno .execute( &ExecuteMsg::TriggerRelay { - packet_sequence: "1".to_string(), - packet_ack_msg: IbcPacketAckMsg::new( - IbcAcknowledgement::new( - to_json_binary( - &AcknowledgementMsg::::Error( - "error".to_string(), - ), - ) - .unwrap(), - ), - IbcPacket::new( - Binary::default(), - IbcEndpoint { - port_id: "port_id".to_string(), - channel_id: "channel_id".to_string(), - }, - IbcEndpoint { - port_id: "port_id".to_string(), - channel_id: "channel_id".to_string(), - }, - 1, - IbcTimeout::with_timestamp(Timestamp::from_seconds(1)), - ), - Addr::unchecked("relayer"), - ), + packet_sequence: 1, + channel_id: channel.0.channel.clone().unwrap().to_string(), + packet_ack: to_json_binary(&StdAck::Error("error".to_string())).unwrap(), }, None, ) @@ -2315,7 +2228,7 @@ fn test_kernel_ibc_funds_and_execute_msg_unhappy() { kernel_osmosis .execute( &ExecuteMsg::AssignChannels { - ics20_channel_id: Some(channel.0.channel.unwrap().to_string()), + ics20_channel_id: Some(channel.0.channel.clone().unwrap().to_string()), direct_channel_id: Some(juno_channel.to_string()), chain: "juno".to_string(), kernel_address: kernel_juno.address().unwrap().into_string(), @@ -2411,32 +2324,9 @@ fn test_kernel_ibc_funds_and_execute_msg_unhappy() { let kernel_juno_splitter_request = kernel_juno .execute( &ExecuteMsg::TriggerRelay { - packet_sequence: "1".to_string(), - packet_ack_msg: IbcPacketAckMsg::new( - IbcAcknowledgement::new( - to_json_binary( - // It's Ok because the ics20 transfer is supposed to go through. We want the ExecuteMsg to fail - &AcknowledgementMsg::::Ok( - SendMessageWithFundsResponse {}, - ), - ) - .unwrap(), - ), - IbcPacket::new( - Binary::default(), - IbcEndpoint { - port_id: "port_id".to_string(), - channel_id: "channel_id".to_string(), - }, - IbcEndpoint { - port_id: "port_id".to_string(), - channel_id: "channel_id".to_string(), - }, - 1, - IbcTimeout::with_timestamp(Timestamp::from_seconds(1)), - ), - Addr::unchecked("relayer"), - ), + packet_sequence: 1, + channel_id: channel.0.channel.clone().unwrap().to_string(), + packet_ack: to_json_binary(&StdAck::Success(Binary::default())).unwrap(), }, None, ) diff --git a/tests-integration/tests/splitter.rs b/tests-integration/tests/splitter.rs index 4632a4808..9badd969e 100644 --- a/tests-integration/tests/splitter.rs +++ b/tests-integration/tests/splitter.rs @@ -13,13 +13,10 @@ use andromeda_std::{ amp::{AndrAddr, Recipient}, os::{ self, - kernel::{AcknowledgementMsg, ExecuteMsg, InstantiateMsg, SendMessageWithFundsResponse}, + kernel::{ExecuteMsg, InstantiateMsg}, }, }; -use cosmwasm_std::{ - coin, to_json_binary, Binary, Coin, Decimal, Empty, IbcAcknowledgement, IbcEndpoint, IbcPacket, - IbcPacketAckMsg, IbcTimeout, Timestamp, Uint128, -}; +use cosmwasm_std::{coin, to_json_binary, Binary, Coin, Decimal, Empty, StdAck, Uint128}; use andromeda_finance::splitter::{ AddressPercent, Cw20HookMsg, ExecuteMsg as SplitterExecuteMsg, @@ -599,7 +596,7 @@ fn test_splitter_cross_chain_recipient() { kernel_osmosis .execute( &ExecuteMsg::AssignChannels { - ics20_channel_id: Some(channel.0.channel.unwrap().to_string()), + ics20_channel_id: Some(channel.0.channel.clone().unwrap().to_string()), direct_channel_id: Some(juno_channel.to_string()), chain: "juno".to_string(), kernel_address: kernel_juno.address().unwrap().into_string(), @@ -683,29 +680,9 @@ fn test_splitter_cross_chain_recipient() { let kernel_juno_trigger_request = kernel_juno .execute( &ExecuteMsg::TriggerRelay { - packet_sequence: "1".to_string(), - packet_ack_msg: IbcPacketAckMsg::new( - IbcAcknowledgement::new( - to_json_binary(&AcknowledgementMsg::::Ok( - SendMessageWithFundsResponse {}, - )) - .unwrap(), - ), - IbcPacket::new( - Binary::default(), - IbcEndpoint { - port_id: "port_id".to_string(), - channel_id: "channel_id".to_string(), - }, - IbcEndpoint { - port_id: "port_id".to_string(), - channel_id: "channel_id".to_string(), - }, - 1, - IbcTimeout::with_timestamp(Timestamp::from_seconds(1)), - ), - Addr::unchecked("relayer"), - ), + packet_sequence: 1, + channel_id: channel.0.channel.clone().unwrap().to_string(), + packet_ack: to_json_binary(&StdAck::Success(Binary::default())).unwrap(), }, None, ) From ed47543b489ad18a15528d5ba6bbee8f1c5a8fe6 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 23 Dec 2024 10:45:38 +0200 Subject: [PATCH 02/21] build(deps): bump anyhow from 1.0.94 to 1.0.95 (#731) Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- Cargo.lock | 4 ++-- packages/andromeda-testing-e2e/Cargo.toml | 4 ++-- packages/andromeda-testing/Cargo.toml | 4 ++-- 3 files changed, 6 insertions(+), 6 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 09176e8c1..e15645e83 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1147,9 +1147,9 @@ dependencies = [ [[package]] name = "anyhow" -version = "1.0.94" +version = "1.0.95" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c1fd03a028ef38ba2276dce7e33fcd6369c158a1bca17946c4b1b701891c1ff7" +checksum = "34ac096ce696dc2fcabef30516bb13c0a68a11d30131d3df6f04711467681b04" [[package]] name = "ark-bls12-381" diff --git a/packages/andromeda-testing-e2e/Cargo.toml b/packages/andromeda-testing-e2e/Cargo.toml index 0ccab7592..be33b072a 100644 --- a/packages/andromeda-testing-e2e/Cargo.toml +++ b/packages/andromeda-testing-e2e/Cargo.toml @@ -18,7 +18,7 @@ cosmwasm-std = { workspace = true } cosmwasm-schema = { workspace = true } cw721 = { workspace = true } cw20 = { workspace = true } -anyhow = "1.0.94" +anyhow = "1.0.95" andromeda-non-fungible-tokens = { workspace = true } andromeda-app = { version = "1.0.0", path = "../andromeda-app" } @@ -43,7 +43,7 @@ cosmrs = "0.21.0" [target.'cfg(not(target_arch = "wasm32"))'.dependencies] cw-multi-test = { workspace = true } -anyhow = "1.0.94" +anyhow = "1.0.95" reqwest = { version = "0.12.9", features = ["json"] } tokio = "1.42.0" cw-orch-daemon = "0.24.3" diff --git a/packages/andromeda-testing/Cargo.toml b/packages/andromeda-testing/Cargo.toml index 8960144c6..2620dba23 100644 --- a/packages/andromeda-testing/Cargo.toml +++ b/packages/andromeda-testing/Cargo.toml @@ -18,7 +18,7 @@ cosmwasm-std = { workspace = true } cosmwasm-schema = { workspace = true } cw721 = { workspace = true } cw20 = { workspace = true } -anyhow = "1.0.94" +anyhow = "1.0.95" andromeda-non-fungible-tokens = { workspace = true } andromeda-app = { version = "1.0.0", path = "../andromeda-app" } @@ -45,4 +45,4 @@ serde = { workspace = true } [target.'cfg(not(target_arch = "wasm32"))'.dependencies] cw-multi-test = { workspace = true } -anyhow = "1.0.94" +anyhow = "1.0.95" From e83b8ca7669f89011ce285777b0d2ee96f5f68d4 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 23 Dec 2024 10:46:00 +0200 Subject: [PATCH 03/21] build(deps): bump env_logger from 0.11.5 to 0.11.6 (#732) Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- Cargo.lock | 4 ++-- packages/deploy/Cargo.toml | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index e15645e83..9b70ce826 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -2895,9 +2895,9 @@ dependencies = [ [[package]] name = "env_logger" -version = "0.11.5" +version = "0.11.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e13fa619b91fb2381732789fc5de83b45675e882f66623b7d8cb4f643017018d" +checksum = "dcaee3d8e3cfc3fd92428d477bc97fc29ec8716d180c0d74c643bb26166660e0" dependencies = [ "anstream", "anstyle", diff --git a/packages/deploy/Cargo.toml b/packages/deploy/Cargo.toml index b956e8aa9..b4893e5a0 100644 --- a/packages/deploy/Cargo.toml +++ b/packages/deploy/Cargo.toml @@ -85,7 +85,7 @@ andromeda-date-time = { path = "../../contracts/math/andromeda-date-time" } andromeda-shunting = { path = "../../contracts/math/andromeda-shunting" } andromeda-std = { workspace = true } -env_logger = "0.11.5" +env_logger = "0.11.6" log = "0.4" dotenv = "0.15.0" reqwest = { version = "0.12", features = ["json", "blocking"] } From 1247a88be09a52b76b2ba435377d70a08c95f92e Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 23 Dec 2024 10:46:20 +0200 Subject: [PATCH 04/21] build(deps): bump serde_json from 1.0.133 to 1.0.134 (#734) Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- Cargo.lock | 4 ++-- Cargo.toml | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 9b70ce826..b1f6c73c8 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -5122,9 +5122,9 @@ dependencies = [ [[package]] name = "serde_json" -version = "1.0.133" +version = "1.0.134" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c7fceb2473b9166b2294ef05efcb65a3db80803f0b03ef86a5fc88a2b85ee377" +checksum = "d00f4175c42ee48b15416f6193a959ba3a0d67fc699a0db9ad12df9f83991c7d" dependencies = [ "itoa", "memchr", diff --git a/Cargo.toml b/Cargo.toml index c56971e1d..7a88dc9bc 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -68,4 +68,4 @@ serde = { version = "1.0.216" } test-case = { version = "3.3.1" } cw-orch = "=0.24.1" jsonschema-valid = { version = "0.5.2"} -serde_json = { version = "1.0.128" } +serde_json = { version = "1.0.134" } From 6254d80c900c301757b232a0e3331f6dc968e78d Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Mon, 23 Dec 2024 10:46:36 +0200 Subject: [PATCH 05/21] build(deps): bump thiserror from 2.0.7 to 2.0.9 (#735) Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- Cargo.lock | 16 ++++++++-------- .../fungible-tokens/andromeda-ics20/Cargo.toml | 2 +- packages/deploy/Cargo.toml | 2 +- packages/std/Cargo.toml | 2 +- 4 files changed, 11 insertions(+), 11 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index b1f6c73c8..f836c12ef 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -450,7 +450,7 @@ dependencies = [ "serde_json", "sha2 0.10.8", "strum_macros", - "thiserror 2.0.7", + "thiserror 2.0.9", ] [[package]] @@ -624,7 +624,7 @@ dependencies = [ "schemars", "semver", "serde", - "thiserror 2.0.7", + "thiserror 2.0.9", ] [[package]] @@ -935,7 +935,7 @@ dependencies = [ "serde-json-wasm 1.0.1", "sha2 0.10.8", "strum_macros", - "thiserror 2.0.7", + "thiserror 2.0.9", ] [[package]] @@ -5747,11 +5747,11 @@ dependencies = [ [[package]] name = "thiserror" -version = "2.0.7" +version = "2.0.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "93605438cbd668185516ab499d589afb7ee1859ea3d5fc8f6b0755e1c7443767" +checksum = "f072643fd0190df67a8bab670c20ef5d8737177d6ac6b2e9a236cb096206b2cc" dependencies = [ - "thiserror-impl 2.0.7", + "thiserror-impl 2.0.9", ] [[package]] @@ -5767,9 +5767,9 @@ dependencies = [ [[package]] name = "thiserror-impl" -version = "2.0.7" +version = "2.0.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e1d8749b4531af2117677a5fcd12b1348a3fe2b81e36e61ffeac5c4aa3273e36" +checksum = "7b50fa271071aae2e6ee85f842e2e28ba8cd2c5fb67f11fcb1fd70b276f9e7d4" dependencies = [ "proc-macro2", "quote", diff --git a/contracts/fungible-tokens/andromeda-ics20/Cargo.toml b/contracts/fungible-tokens/andromeda-ics20/Cargo.toml index 510555561..52c419950 100644 --- a/contracts/fungible-tokens/andromeda-ics20/Cargo.toml +++ b/contracts/fungible-tokens/andromeda-ics20/Cargo.toml @@ -27,7 +27,7 @@ cw20-base = { workspace = true } cw-controllers = "=1.1.2" schemars = "0.8.21" serde = "1.0.216" -thiserror = "2.0.7" +thiserror = "2.0.9" andromeda-std = { workspace = true } andromeda-fungible-tokens = { workspace = true } diff --git a/packages/deploy/Cargo.toml b/packages/deploy/Cargo.toml index b4893e5a0..ad33e5471 100644 --- a/packages/deploy/Cargo.toml +++ b/packages/deploy/Cargo.toml @@ -22,7 +22,7 @@ cw721-base = { workspace = true } cw-utils = { workspace = true } cw2 = { workspace = true } cw-asset = { version = "3.0.0" } -thiserror = { version = "2.0.7" } +thiserror = { version = "2.0.9" } lazy_static = "1" hex = "0.4" regex = { version = "1.9.1", default-features = false } diff --git a/packages/std/Cargo.toml b/packages/std/Cargo.toml index 9a267f7b6..c35fbebdc 100644 --- a/packages/std/Cargo.toml +++ b/packages/std/Cargo.toml @@ -30,7 +30,7 @@ cw-utils = { workspace = true } cw2 = { workspace = true } cw3 = { workspace = true } cw-asset = { version = "3.0.0" } -thiserror = { version = "2.0.7" } +thiserror = { version = "2.0.9" } lazy_static = "1" hex = "0.4" regex = { version = "1.9.1", default-features = false } From 0370ed838f8828c94ce2b900cf96463fbccf7c95 Mon Sep 17 00:00:00 2001 From: Dimitrije Dragasevic Date: Mon, 23 Dec 2024 09:57:05 +0100 Subject: [PATCH 06/21] Fixed handle_local amp message when a amp message is passed with custom config (#729) Co-authored-by: Connor Barr --- CHANGELOG.md | 1 + contracts/os/andromeda-kernel/src/execute.rs | 23 ++++++----- .../src/testing/test_handler.rs | 38 ++++++++++++++++--- 3 files changed, 48 insertions(+), 14 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 27cec609d..68d058cef 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -26,6 +26,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 ### Fixed - feat: alterations to kernel for IBC [(#726)](https://github.com/andromedaprotocol/andromeda-core/pull/726) +- Fixed handle_local amp message when a amp message is passed with custom config [(#729)](https://github.com/andromedaprotocol/andromeda-core/pull/729) ## Release 3 diff --git a/contracts/os/andromeda-kernel/src/execute.rs b/contracts/os/andromeda-kernel/src/execute.rs index 489940166..586ce4f8e 100644 --- a/contracts/os/andromeda-kernel/src/execute.rs +++ b/contracts/os/andromeda-kernel/src/execute.rs @@ -170,7 +170,7 @@ pub fn amp_receive( ) -> Result { // Only verified ADOs can access this function ensure!( - query::verify_address(deps.as_ref(), info.sender.to_string(),)?.verify_address, + query::verify_address(deps.as_ref(), info.sender.to_string())?.verify_address, ContractError::Unauthorized {} ); ensure!( @@ -536,16 +536,20 @@ impl MsgHandler { sequence: u64, ) -> Result { let mut res = Response::default(); + + let original_msg = self.message(); let AMPMsg { message, recipient, funds, config, .. - } = self.message(); + } = original_msg; + let recipient_addr = recipient.get_raw_address(&deps.as_ref())?; + let adodb_addr = KERNEL_ADDRESSES.load(deps.storage, ADO_DB_KEY)?; - // A default message is a bank message + if Binary::default() == message.clone() { ensure!( !funds.is_empty(), @@ -553,17 +557,18 @@ impl MsgHandler { error: Some("No message or funds supplied".to_string()) } ); - + let sub_msg = BankMsg::Send { to_address: recipient_addr.to_string(), amount: funds.clone(), }; - + let mut attrs = vec![]; for (idx, fund) in funds.iter().enumerate() { attrs.push(attr(format!("funds:{sequence}:{idx}"), fund.to_string())); } attrs.push(attr(format!("recipient:{sequence}"), recipient_addr)); + res = res .add_submessage(SubMsg::reply_on_error( CosmosMsg::Bank(sub_msg), @@ -577,7 +582,7 @@ impl MsgHandler { info.sender.to_string() }; let previous_sender = info.sender.to_string(); - // Ensure recipient is a smart contract + let ContractInfoResponse { code_id: recipient_code_id, .. @@ -593,12 +598,12 @@ impl MsgHandler { || AOSQuerier::ado_type_getter(&deps.querier, &adodb_addr, recipient_code_id)? .is_none() { - // Message is direct (no AMP Ctx) self.message() .generate_sub_msg_direct(recipient_addr.clone(), ReplyId::AMPMsg.repr()) } else { let amp_msg = - AMPMsg::new(recipient_addr.clone(), message.clone(), Some(funds.clone())); + AMPMsg::new(recipient_addr.clone(), message.clone(), Some(funds.clone())) + .with_config(config.clone()); let new_packet = AMPPkt::new(origin, previous_sender, vec![amp_msg]); @@ -608,7 +613,7 @@ impl MsgHandler { ReplyId::AMPMsg.repr(), )? }; - + res = res .add_submessage(sub_msg) .add_attributes(vec![attr(format!("recipient:{sequence}"), recipient_addr)]); diff --git a/contracts/os/andromeda-kernel/src/testing/test_handler.rs b/contracts/os/andromeda-kernel/src/testing/test_handler.rs index 3b1f421d3..4283c8c28 100644 --- a/contracts/os/andromeda-kernel/src/testing/test_handler.rs +++ b/contracts/os/andromeda-kernel/src/testing/test_handler.rs @@ -1,7 +1,7 @@ use crate::{execute::MsgHandler, state::KERNEL_ADDRESSES}; use andromeda_std::{ amp::{ - messages::{AMPCtx, AMPMsg, AMPPkt}, + messages::{AMPCtx, AMPMsg, AMPMsgConfig, AMPPkt}, ADO_DB_KEY, }, common::reply::ReplyId, @@ -12,9 +12,7 @@ use andromeda_std::{ }, }; use cosmwasm_std::{ - coin, - testing::{mock_env, mock_info}, - to_json_binary, Addr, BankMsg, Binary, SubMsg, + coin, testing::{mock_env, mock_info}, to_json_binary, Addr, BankMsg, Binary, ReplyOn, SubMsg }; struct TestHandleLocalCase { @@ -28,6 +26,22 @@ struct TestHandleLocalCase { #[test] fn test_handle_local() { + + fn create_test_msg_with_config(config: AMPMsgConfig) -> AMPMsg { + let base_msg = AMPMsg::new(MOCK_APP_CONTRACT, to_json_binary(&true).unwrap(), None); + base_msg.with_config(config) + } + + // Then in tests: + let config = AMPMsgConfig { + reply_on: ReplyOn::Error, + exit_at_error: false, + gas_limit: Some(1000000), + direct: false, + ibc_config: None, + }; + + let test_cases = vec![ TestHandleLocalCase { name: "Valid message to ADO (no funds/context)", @@ -196,6 +210,20 @@ fn test_handle_local() { error: Some("No message or funds supplied".to_string()), }), }, + TestHandleLocalCase { + name: "Message with custom reply configuration", + sender: "sender", + msg: create_test_msg_with_config(config.clone()), + ctx: None, + expected_submessage: AMPPkt::new( + "sender", + "sender", + vec![create_test_msg_with_config(config)], + ) + .to_sub_msg(MOCK_APP_CONTRACT, None, ReplyId::AMPMsg.repr()) + .unwrap(), + expected_error: None, + } ]; for test in test_cases { @@ -210,7 +238,7 @@ fn test_handle_local() { ) .unwrap(); - let res = + let res: Result = MsgHandler::new(test.msg).handle_local(deps.as_mut(), info, mock_env(), test.ctx, 0); if let Some(err) = test.expected_error { From 5a250de7ef6aa48cb158d148e3142ba92f40e77b Mon Sep 17 00:00:00 2001 From: Joe Monem <66594578+joemonem@users.noreply.github.com> Date: Mon, 23 Dec 2024 14:37:23 +0200 Subject: [PATCH 07/21] chore: remove unused deps using cargo-udeps (#737) --- Cargo.lock | 1058 ++++------------- .../andromeda-fixed-multisig/Cargo.toml | 2 - .../data-storage/andromeda-form/Cargo.toml | 1 - .../os/andromeda-ibc-registry/Cargo.toml | 1 - contracts/os/andromeda-kernel/Cargo.toml | 1 - ibc-tests/Cargo.toml | 2 - packages/andromeda-finance/Cargo.toml | 3 - packages/andromeda-fungible-tokens/Cargo.toml | 1 - packages/andromeda-testing-e2e/Cargo.toml | 3 - packages/std/Cargo.toml | 1 - 10 files changed, 217 insertions(+), 856 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index f836c12ef..1df7231f3 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -10,8 +10,8 @@ checksum = "0c77f8d4bac08f74fbc4fce8943cb2d35e742682b6cae8cb65555d6cd3830feb" dependencies = [ "anyhow", "bech32 0.11.0", - "cosmwasm-schema 1.5.8", - "cosmwasm-std 1.5.8", + "cosmwasm-schema", + "cosmwasm-std", "cw-storage-plus 1.2.0", "cw-utils 1.0.3", "cw20-ics20", @@ -53,18 +53,6 @@ dependencies = [ "version_check", ] -[[package]] -name = "ahash" -version = "0.8.11" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e89da841a80418a9b391ebaea17f5c112ffaaa96f621d2c285b5174da76b9011" -dependencies = [ - "cfg-if", - "once_cell", - "version_check", - "zerocopy", -] - [[package]] name = "aho-corasick" version = "1.1.3" @@ -74,12 +62,6 @@ dependencies = [ "memchr", ] -[[package]] -name = "allocator-api2" -version = "0.2.21" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "683d7910e743518b0e34f1186f92494becacb047c7b6bf616c96772180fef923" - [[package]] name = "android-tzdata" version = "0.1.1" @@ -100,10 +82,10 @@ name = "andromeda-accounts" version = "1.0.0" dependencies = [ "andromeda-std", - "cosmwasm-schema 1.5.8", - "cosmwasm-std 1.5.8", + "cosmwasm-schema", + "cosmwasm-std", "cw-utils 1.0.3", - "cw3 1.1.2", + "cw3", ] [[package]] @@ -114,8 +96,8 @@ dependencies = [ "andromeda-modules", "andromeda-std", "andromeda-testing", - "cosmwasm-schema 1.5.8", - "cosmwasm-std 1.5.8", + "cosmwasm-schema", + "cosmwasm-std", "cw-multi-test", "cw-orch", "cw-storage-plus 1.2.0", @@ -127,8 +109,8 @@ name = "andromeda-adodb" version = "1.1.2" dependencies = [ "andromeda-std", - "cosmwasm-schema 1.5.8", - "cosmwasm-std 1.5.8", + "cosmwasm-schema", + "cosmwasm-std", "cw-asset", "cw-multi-test", "cw-orch", @@ -141,8 +123,8 @@ name = "andromeda-app" version = "1.0.0" dependencies = [ "andromeda-std", - "cosmwasm-schema 1.5.8", - "cosmwasm-std 1.5.8", + "cosmwasm-schema", + "cosmwasm-std", "cw-multi-test", "cw-orch", "serde", @@ -155,8 +137,8 @@ dependencies = [ "andromeda-app", "andromeda-std", "andromeda-testing", - "cosmwasm-schema 1.5.8", - "cosmwasm-std 1.5.8", + "cosmwasm-schema", + "cosmwasm-std", "cw-multi-test", "cw-orch", "cw-orch-daemon", @@ -172,13 +154,13 @@ dependencies = [ "andromeda-non-fungible-tokens", "andromeda-std", "andromeda-testing", - "cosmwasm-schema 1.5.8", - "cosmwasm-std 1.5.8", + "cosmwasm-schema", + "cosmwasm-std", "cw-multi-test", "cw-orch", "cw-storage-plus 1.2.0", "cw-utils 1.0.3", - "cw20 1.1.2", + "cw20", "cw721 0.18.0", ] @@ -189,13 +171,13 @@ dependencies = [ "andromeda-data-storage", "andromeda-std", "andromeda-testing", - "cosmwasm-schema 1.5.8", - "cosmwasm-std 1.5.8", + "cosmwasm-schema", + "cosmwasm-std", "cw-multi-test", "cw-orch", "cw-storage-plus 1.2.0", "cw-utils 1.0.3", - "cw20 1.1.2", + "cw20", ] [[package]] @@ -206,8 +188,8 @@ dependencies = [ "andromeda-finance", "andromeda-std", "andromeda-testing", - "cosmwasm-schema 1.5.8", - "cosmwasm-std 1.5.8", + "cosmwasm-schema", + "cosmwasm-std", "cw-multi-test", "cw-orch", "cw-storage-plus 1.2.0", @@ -221,8 +203,8 @@ dependencies = [ "andromeda-math", "andromeda-std", "andromeda-testing", - "cosmwasm-schema 1.5.8", - "cosmwasm-std 1.5.8", + "cosmwasm-schema", + "cosmwasm-std", "cw-multi-test", "cw-orch", "cw-storage-plus 1.2.0", @@ -236,8 +218,8 @@ dependencies = [ "andromeda-app", "andromeda-finance", "andromeda-std", - "cosmwasm-schema 1.5.8", - "cosmwasm-std 1.5.8", + "cosmwasm-schema", + "cosmwasm-std", "cw-multi-test", "cw-storage-plus 1.2.0", "cw-utils 1.0.3", @@ -254,14 +236,14 @@ dependencies = [ "andromeda-non-fungible-tokens", "andromeda-std", "andromeda-testing", - "cosmwasm-schema 1.5.8", - "cosmwasm-std 1.5.8", + "cosmwasm-schema", + "cosmwasm-std", "cw-multi-test", "cw-orch", "cw-orch-daemon", "cw-storage-plus 1.2.0", "cw-utils 1.0.3", - "cw20 1.1.2", + "cw20", "cw721 0.18.0", ] @@ -273,8 +255,8 @@ dependencies = [ "andromeda-math", "andromeda-std", "andromeda-testing", - "cosmwasm-schema 1.5.8", - "cosmwasm-std 1.5.8", + "cosmwasm-schema", + "cosmwasm-std", "cw-multi-test", "cw-orch", "cw-storage-plus 1.2.0", @@ -290,14 +272,14 @@ dependencies = [ "andromeda-fungible-tokens", "andromeda-std", "andromeda-testing", - "cosmwasm-schema 1.5.8", - "cosmwasm-std 1.5.8", + "cosmwasm-schema", + "cosmwasm-std", "cw-multi-test", "cw-orch", "cw-orch-daemon", "cw-storage-plus 1.2.0", "cw-utils 1.0.3", - "cw20 1.1.2", + "cw20", "cw20-base", ] @@ -308,14 +290,14 @@ dependencies = [ "andromeda-app", "andromeda-fungible-tokens", "andromeda-std", - "cosmwasm-schema 1.5.8", - "cosmwasm-std 1.5.8", + "cosmwasm-schema", + "cosmwasm-std", "cw-asset", "cw-multi-test", "cw-orch", "cw-storage-plus 1.2.0", "cw-utils 1.0.3", - "cw20 1.1.2", + "cw20", ] [[package]] @@ -326,14 +308,14 @@ dependencies = [ "andromeda-fungible-tokens", "andromeda-std", "andromeda-testing", - "cosmwasm-schema 1.5.8", - "cosmwasm-std 1.5.8", + "cosmwasm-schema", + "cosmwasm-std", "cw-asset", "cw-multi-test", "cw-orch", "cw-storage-plus 1.2.0", "cw-utils 1.0.3", - "cw20 1.1.2", + "cw20", "cw20-base", ] @@ -344,8 +326,8 @@ dependencies = [ "andromeda-non-fungible-tokens", "andromeda-std", "andromeda-testing", - "cosmwasm-schema 1.5.8", - "cosmwasm-std 1.5.8", + "cosmwasm-schema", + "cosmwasm-std", "cw-multi-test", "cw-orch", "cw-orch-daemon", @@ -359,8 +341,8 @@ name = "andromeda-data-storage" version = "1.0.0" dependencies = [ "andromeda-std", - "cosmwasm-schema 1.5.8", - "cosmwasm-std 1.5.8", + "cosmwasm-schema", + "cosmwasm-std", "cw-utils 1.0.3", "serde", ] @@ -374,8 +356,8 @@ dependencies = [ "andromeda-std", "andromeda-testing", "chrono 0.4.39", - "cosmwasm-schema 1.5.8", - "cosmwasm-std 1.5.8", + "cosmwasm-schema", + "cosmwasm-std", "cw-multi-test", "cw-orch", "cw-storage-plus 1.2.0", @@ -422,8 +404,8 @@ dependencies = [ "andromeda-vfs", "andromeda-weighted-distribution-splitter", "chrono 0.4.39", - "cosmwasm-schema 1.5.8", - "cosmwasm-std 1.5.8", + "cosmwasm-schema", + "cosmwasm-std", "cw-asset", "cw-multi-test", "cw-orch", @@ -431,7 +413,7 @@ dependencies = [ "cw-storage-plus 1.2.0", "cw-utils 1.0.3", "cw2 1.1.2", - "cw20 1.1.2", + "cw20", "cw20-base", "cw721 0.18.0", "cw721-base 0.18.0", @@ -461,8 +443,8 @@ dependencies = [ "andromeda-math", "andromeda-std", "andromeda-testing", - "cosmwasm-schema 1.5.8", - "cosmwasm-std 1.5.8", + "cosmwasm-schema", + "cosmwasm-std", "cw-multi-test", "cw-orch", "cw-storage-plus 1.2.0", @@ -474,12 +456,12 @@ name = "andromeda-economics" version = "1.1.1" dependencies = [ "andromeda-std", - "cosmwasm-schema 1.5.8", - "cosmwasm-std 1.5.8", + "cosmwasm-schema", + "cosmwasm-std", "cw-multi-test", "cw-orch", "cw-storage-plus 1.2.0", - "cw20 1.1.2", + "cw20", ] [[package]] @@ -487,11 +469,11 @@ name = "andromeda-ecosystem" version = "1.0.0" dependencies = [ "andromeda-std", - "cosmwasm-schema 1.5.8", - "cosmwasm-std 1.5.8", + "cosmwasm-schema", + "cosmwasm-std", "cw-asset", "cw-storage-plus 1.2.0", - "cw20 1.1.2", + "cw20", "schemars", "serde", ] @@ -501,14 +483,12 @@ name = "andromeda-finance" version = "1.0.0" dependencies = [ "andromeda-std", - "cosmwasm-schema 1.5.8", - "cosmwasm-std 1.5.8", + "cosmwasm-schema", + "cosmwasm-std", "cw-multi-test", "cw-orch", "cw-utils 1.0.3", - "cw20 1.1.2", - "cw3 1.1.2", - "cw4", + "cw20", "cw721 0.18.0", "cw721-base 0.18.0", "schemars", @@ -523,16 +503,14 @@ dependencies = [ "andromeda-app", "andromeda-std", "andromeda-testing", - "cosmwasm-schema 1.5.8", - "cosmwasm-std 1.5.8", + "cosmwasm-schema", + "cosmwasm-std", "cw-multi-test", "cw-orch", "cw-storage-plus 1.2.0", "cw-utils 1.0.3", "cw2 1.1.2", - "cw3 1.1.2", - "cw3-fixed-multisig", - "cw4", + "cw3", ] [[package]] @@ -543,14 +521,13 @@ dependencies = [ "andromeda-modules", "andromeda-std", "andromeda-testing", - "cosmwasm-schema 1.5.8", - "cosmwasm-std 1.5.8", - "cw-json", + "cosmwasm-schema", + "cosmwasm-std", "cw-multi-test", "cw-orch", "cw-storage-plus 1.2.0", "cw-utils 1.0.3", - "cw20 1.1.2", + "cw20", "serde", "serde_json", "test-case", @@ -561,14 +538,14 @@ name = "andromeda-fungible-tokens" version = "1.0.0" dependencies = [ "andromeda-std", - "cosmwasm-schema 1.5.8", - "cosmwasm-std 1.5.8", + "cosmwasm-schema", + "cosmwasm-std", "cw-asset", "cw-controllers", "cw-multi-test", "cw-orch", "cw-utils 1.0.3", - "cw20 1.1.2", + "cw20", "cw20-base", "serde", ] @@ -580,27 +557,26 @@ dependencies = [ "andromeda-math", "andromeda-std", "andromeda-testing", - "cosmwasm-schema 1.5.8", - "cosmwasm-std 1.5.8", + "cosmwasm-schema", + "cosmwasm-std", "cw-multi-test", "cw-storage-plus 1.2.0", "cw-utils 1.0.3", - "cw20 1.1.2", + "cw20", ] [[package]] name = "andromeda-ibc-registry" version = "1.0.1" dependencies = [ - "andromeda-data-storage", "andromeda-std", - "cosmwasm-schema 1.5.8", - "cosmwasm-std 1.5.8", + "cosmwasm-schema", + "cosmwasm-std", "cw-multi-test", "cw-orch", "cw-storage-plus 1.2.0", "cw-utils 1.0.3", - "cw20 1.1.2", + "cw20", ] [[package]] @@ -611,15 +587,15 @@ dependencies = [ "andromeda-fungible-tokens", "andromeda-std", "andromeda-testing", - "cosmwasm-schema 1.5.8", - "cosmwasm-std 1.5.8", + "cosmwasm-schema", + "cosmwasm-std", "cw-controllers", "cw-multi-test", "cw-orch", "cw-storage-plus 1.2.0", "cw-utils 1.0.3", "cw2 1.1.2", - "cw20 1.1.2", + "cw20", "cw20-base", "schemars", "semver", @@ -632,8 +608,8 @@ name = "andromeda-kernel" version = "1.2.0-b.1" dependencies = [ "andromeda-std", - "cosmwasm-schema 1.5.8", - "cosmwasm-std 1.5.8", + "cosmwasm-schema", + "cosmwasm-std", "cw-multi-test", "cw-orch", "cw-storage-plus 1.2.0", @@ -644,7 +620,6 @@ dependencies = [ "prost 0.11.9", "schemars", "serde", - "serde-cw-value", "serde-json-wasm 1.0.1", ] @@ -656,14 +631,14 @@ dependencies = [ "andromeda-fungible-tokens", "andromeda-std", "andromeda-testing", - "cosmwasm-schema 1.5.8", - "cosmwasm-std 1.5.8", + "cosmwasm-schema", + "cosmwasm-std", "cw-asset", "cw-multi-test", "cw-orch", "cw-storage-plus 1.2.0", "cw-utils 1.0.3", - "cw20 1.1.2", + "cw20", ] [[package]] @@ -683,13 +658,13 @@ dependencies = [ "andromeda-non-fungible-tokens", "andromeda-std", "andromeda-testing", - "cosmwasm-schema 1.5.8", - "cosmwasm-std 1.5.8", + "cosmwasm-schema", + "cosmwasm-std", "cw-multi-test", "cw-orch", "cw-storage-plus 1.2.0", "cw-utils 1.0.3", - "cw20 1.1.2", + "cw20", "cw721 0.18.0", ] @@ -698,8 +673,8 @@ name = "andromeda-math" version = "1.0.0" dependencies = [ "andromeda-std", - "cosmwasm-schema 1.5.8", - "cosmwasm-std 1.5.8", + "cosmwasm-schema", + "cosmwasm-std", "cw-utils 1.0.3", ] @@ -710,13 +685,13 @@ dependencies = [ "andromeda-math", "andromeda-std", "andromeda-testing", - "cosmwasm-schema 1.5.8", - "cosmwasm-std 1.5.8", + "cosmwasm-schema", + "cosmwasm-std", "cw-multi-test", "cw-orch", "cw-storage-plus 1.2.0", "cw-utils 1.0.3", - "cw20 1.1.2", + "cw20", ] [[package]] @@ -727,14 +702,14 @@ dependencies = [ "andromeda-fungible-tokens", "andromeda-std", "andromeda-testing", - "cosmwasm-schema 1.5.8", - "cosmwasm-std 1.5.8", + "cosmwasm-schema", + "cosmwasm-std", "cw-asset", "cw-multi-test", "cw-orch", "cw-storage-plus 1.2.0", "cw-utils 1.0.3", - "cw20 1.1.2", + "cw20", "hex", "serde", "sha2 0.10.8", @@ -745,8 +720,8 @@ name = "andromeda-modules" version = "2.0.0" dependencies = [ "andromeda-std", - "cosmwasm-schema 1.5.8", - "cosmwasm-std 1.5.8", + "cosmwasm-schema", + "cosmwasm-std", "cw-utils 1.0.3", "cw721 0.18.0", "cw721-base 0.18.0", @@ -758,12 +733,12 @@ name = "andromeda-non-fungible-tokens" version = "1.0.0" dependencies = [ "andromeda-std", - "cosmwasm-schema 1.5.8", - "cosmwasm-std 1.5.8", + "cosmwasm-schema", + "cosmwasm-std", "cw-multi-test", "cw-orch", "cw-utils 1.0.3", - "cw20 1.1.2", + "cw20", "cw721 0.18.0", "cw721-base 0.18.0", "serde", @@ -776,8 +751,8 @@ dependencies = [ "andromeda-math", "andromeda-std", "andromeda-testing", - "cosmwasm-schema 1.5.8", - "cosmwasm-std 1.5.8", + "cosmwasm-schema", + "cosmwasm-std", "cw-multi-test", "cw-storage-plus 1.2.0", "cw-utils 1.0.3", @@ -790,13 +765,13 @@ dependencies = [ "andromeda-data-storage", "andromeda-std", "andromeda-testing", - "cosmwasm-schema 1.5.8", - "cosmwasm-std 1.5.8", + "cosmwasm-schema", + "cosmwasm-std", "cw-multi-test", "cw-orch", "cw-storage-plus 1.2.0", "cw-utils 1.0.3", - "cw20 1.1.2", + "cw20", ] [[package]] @@ -807,13 +782,13 @@ dependencies = [ "andromeda-finance", "andromeda-std", "andromeda-testing", - "cosmwasm-schema 1.5.8", - "cosmwasm-std 1.5.8", + "cosmwasm-schema", + "cosmwasm-std", "cw-multi-test", "cw-orch", "cw-storage-plus 1.2.0", "cw-utils 1.0.3", - "cw20 1.1.2", + "cw20", ] [[package]] @@ -824,13 +799,13 @@ dependencies = [ "andromeda-modules", "andromeda-std", "andromeda-testing", - "cosmwasm-schema 1.5.8", - "cosmwasm-std 1.5.8", + "cosmwasm-schema", + "cosmwasm-std", "cw-multi-test", "cw-orch", "cw-storage-plus 1.2.0", "cw-utils 1.0.3", - "cw20 1.1.2", + "cw20", ] [[package]] @@ -841,8 +816,8 @@ dependencies = [ "andromeda-modules", "andromeda-std", "andromeda-testing", - "cosmwasm-schema 1.5.8", - "cosmwasm-std 1.5.8", + "cosmwasm-schema", + "cosmwasm-std", "cw-json", "cw-multi-test", "cw-orch", @@ -859,13 +834,13 @@ dependencies = [ "andromeda-finance", "andromeda-std", "andromeda-testing", - "cosmwasm-schema 1.5.8", - "cosmwasm-std 1.5.8", + "cosmwasm-schema", + "cosmwasm-std", "cw-multi-test", "cw-orch", "cw-storage-plus 1.2.0", "cw-utils 1.0.3", - "cw20 1.1.2", + "cw20", ] [[package]] @@ -876,8 +851,8 @@ dependencies = [ "andromeda-math", "andromeda-std", "andromeda-testing", - "cosmwasm-schema 1.5.8", - "cosmwasm-std 1.5.8", + "cosmwasm-schema", + "cosmwasm-std", "cw-json", "cw-multi-test", "cw-orch", @@ -896,13 +871,13 @@ dependencies = [ "andromeda-finance", "andromeda-std", "andromeda-testing", - "cosmwasm-schema 1.5.8", - "cosmwasm-std 1.5.8", + "cosmwasm-schema", + "cosmwasm-std", "cw-multi-test", "cw-orch", "cw-storage-plus 1.2.0", "cw-utils 1.0.3", - "cw20 1.1.2", + "cw20", ] [[package]] @@ -910,17 +885,16 @@ name = "andromeda-std" version = "1.5.0-b.2" dependencies = [ "andromeda-macros", - "cosmwasm-schema 1.5.8", - "cosmwasm-std 1.5.8", + "cosmwasm-schema", + "cosmwasm-std", "cw-asset", "cw-multi-test", "cw-orch", "cw-storage-plus 1.2.0", "cw-utils 1.0.3", "cw2 1.1.2", - "cw20 1.1.2", + "cw20", "cw20-base", - "cw3 1.1.2", "cw721 0.18.0", "cw721-base 0.18.0", "enum-repr", @@ -945,13 +919,13 @@ dependencies = [ "andromeda-data-storage", "andromeda-std", "andromeda-testing", - "cosmwasm-schema 1.5.8", - "cosmwasm-std 1.5.8", + "cosmwasm-schema", + "cosmwasm-std", "cw-multi-test", "cw-orch", "cw-storage-plus 1.2.0", "cw-utils 1.0.3", - "cw20 1.1.2", + "cw20", ] [[package]] @@ -968,10 +942,10 @@ dependencies = [ "andromeda-std", "andromeda-vfs", "anyhow", - "cosmwasm-schema 1.5.8", - "cosmwasm-std 1.5.8", + "cosmwasm-schema", + "cosmwasm-std", "cw-multi-test", - "cw20 1.1.2", + "cw20", "cw721 0.18.0", "serde", ] @@ -989,16 +963,13 @@ dependencies = [ "andromeda-std", "andromeda-vfs", "anyhow", - "cosmrs 0.21.0", - "cosmwasm-schema 1.5.8", - "cosmwasm-std 1.5.8", + "cosmwasm-schema", + "cosmwasm-std", "cw-multi-test", "cw-orch", "cw-orch-daemon", - "cw20 1.1.2", + "cw20", "cw721 0.18.0", - "reqwest 0.12.9", - "secp256k1 0.30.0", "serde", "tokio", ] @@ -1011,8 +982,8 @@ dependencies = [ "andromeda-finance", "andromeda-std", "andromeda-testing", - "cosmwasm-schema 1.5.8", - "cosmwasm-std 1.5.8", + "cosmwasm-schema", + "cosmwasm-std", "cw-multi-test", "cw-orch", "cw-storage-plus 1.2.0", @@ -1027,8 +998,8 @@ dependencies = [ "andromeda-std", "andromeda-testing", "chrono 0.3.0", - "cosmwasm-schema 1.5.8", - "cosmwasm-std 1.5.8", + "cosmwasm-schema", + "cosmwasm-std", "cw-multi-test", "cw-orch", "cw-orch-daemon", @@ -1044,8 +1015,8 @@ version = "1.1.0" dependencies = [ "andromeda-ecosystem", "andromeda-std", - "cosmwasm-schema 1.5.8", - "cosmwasm-std 1.5.8", + "cosmwasm-schema", + "cosmwasm-std", "cw-multi-test", "cw-storage-plus 1.2.0", "cw-utils 1.0.3", @@ -1059,8 +1030,8 @@ dependencies = [ "andromeda-finance", "andromeda-std", "andromeda-testing", - "cosmwasm-schema 1.5.8", - "cosmwasm-std 1.5.8", + "cosmwasm-schema", + "cosmwasm-std", "cw-asset", "cw-multi-test", "cw-orch", @@ -1073,8 +1044,8 @@ name = "andromeda-vfs" version = "1.1.2" dependencies = [ "andromeda-std", - "cosmwasm-schema 1.5.8", - "cosmwasm-std 1.5.8", + "cosmwasm-schema", + "cosmwasm-std", "cw-multi-test", "cw-orch", "cw-storage-plus 1.2.0", @@ -1088,8 +1059,8 @@ dependencies = [ "andromeda-app", "andromeda-finance", "andromeda-std", - "cosmwasm-schema 1.5.8", - "cosmwasm-std 1.5.8", + "cosmwasm-schema", + "cosmwasm-std", "cw-multi-test", "cw-orch", "cw-storage-plus 1.2.0", @@ -1151,133 +1122,6 @@ version = "1.0.95" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "34ac096ce696dc2fcabef30516bb13c0a68a11d30131d3df6f04711467681b04" -[[package]] -name = "ark-bls12-381" -version = "0.4.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c775f0d12169cba7aae4caeb547bb6a50781c7449a8aa53793827c9ec4abf488" -dependencies = [ - "ark-ec", - "ark-ff", - "ark-serialize", - "ark-std", -] - -[[package]] -name = "ark-ec" -version = "0.4.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "defd9a439d56ac24968cca0571f598a61bc8c55f71d50a89cda591cb750670ba" -dependencies = [ - "ark-ff", - "ark-poly", - "ark-serialize", - "ark-std", - "derivative", - "hashbrown 0.13.2", - "itertools 0.10.5", - "num-traits", - "rayon", - "zeroize", -] - -[[package]] -name = "ark-ff" -version = "0.4.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ec847af850f44ad29048935519032c33da8aa03340876d351dfab5660d2966ba" -dependencies = [ - "ark-ff-asm", - "ark-ff-macros", - "ark-serialize", - "ark-std", - "derivative", - "digest 0.10.7", - "itertools 0.10.5", - "num-bigint", - "num-traits", - "paste", - "rayon", - "rustc_version", - "zeroize", -] - -[[package]] -name = "ark-ff-asm" -version = "0.4.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3ed4aa4fe255d0bc6d79373f7e31d2ea147bcf486cba1be5ba7ea85abdb92348" -dependencies = [ - "quote", - "syn 1.0.109", -] - -[[package]] -name = "ark-ff-macros" -version = "0.4.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7abe79b0e4288889c4574159ab790824d0033b9fdcb2a112a3182fac2e514565" -dependencies = [ - "num-bigint", - "num-traits", - "proc-macro2", - "quote", - "syn 1.0.109", -] - -[[package]] -name = "ark-poly" -version = "0.4.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d320bfc44ee185d899ccbadfa8bc31aab923ce1558716e1997a1e74057fe86bf" -dependencies = [ - "ark-ff", - "ark-serialize", - "ark-std", - "derivative", - "hashbrown 0.13.2", -] - -[[package]] -name = "ark-serialize" -version = "0.4.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "adb7b85a02b83d2f22f89bd5cac66c9c89474240cb6207cb1efc16d098e822a5" -dependencies = [ - "ark-serialize-derive", - "ark-std", - "digest 0.10.7", - "num-bigint", -] - -[[package]] -name = "ark-serialize-derive" -version = "0.4.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ae3281bc6d0fd7e549af32b52511e1302185bd688fd3359fa36423346ff682ea" -dependencies = [ - "proc-macro2", - "quote", - "syn 1.0.109", -] - -[[package]] -name = "ark-std" -version = "0.4.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "94893f1e0c6eeab764ade8dc4c0db24caf4fe7cbbaafc0eba0a9030f447b5185" -dependencies = [ - "num-traits", - "rand", - "rayon", -] - -[[package]] -name = "arrayvec" -version = "0.7.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7c02d123df017efcdfbd739ef81735b36c5ba83ec3c59c80a9d7ecc718f92e50" - [[package]] name = "async-recursion" version = "1.1.1" @@ -1466,17 +1310,11 @@ checksum = "1945a5048598e4189e239d3f809b19bdad4845c4b2ba400d304d2dcf26d2c462" dependencies = [ "bech32 0.9.1", "bitcoin-private", - "bitcoin_hashes 0.12.0", + "bitcoin_hashes", "hex_lit", - "secp256k1 0.27.0", + "secp256k1", ] -[[package]] -name = "bitcoin-io" -version = "0.1.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0b47c4ab7a93edb0c7198c5535ed9b52b63095f4e9b45279c6736cec4b856baf" - [[package]] name = "bitcoin-private" version = "0.1.0" @@ -1492,16 +1330,6 @@ dependencies = [ "bitcoin-private", ] -[[package]] -name = "bitcoin_hashes" -version = "0.14.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bb18c03d0db0247e147a21a6faafd5a7eb851c743db062de72018b6b7e8e4d16" -dependencies = [ - "bitcoin-io", - "hex-conservative", -] - [[package]] name = "bitflags" version = "1.3.2" @@ -1538,12 +1366,6 @@ version = "0.10.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "56953345e39537a3e18bdaeba4cb0c58a78c1f61f361dc0fa7c5c7340ae87c5f" -[[package]] -name = "bnum" -version = "0.11.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3e31ea183f6ee62ac8b8a8cf7feddd766317adfb13ff469de57ce033efd6a790" - [[package]] name = "bs58" version = "0.5.1" @@ -1673,16 +1495,6 @@ dependencies = [ "tendermint-proto 0.35.0", ] -[[package]] -name = "cosmos-sdk-proto" -version = "0.26.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "462e1f6a8e005acc8835d32d60cbd7973ed65ea2a8d8473830e675f050956427" -dependencies = [ - "prost 0.13.4", - "tendermint-proto 0.40.0", -] - [[package]] name = "cosmrs" version = "0.15.0" @@ -1705,32 +1517,6 @@ dependencies = [ "tokio", ] -[[package]] -name = "cosmrs" -version = "0.21.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "210fbe6f98594963b46cc980f126a9ede5db9a3848ca65b71303bebdb01afcd9" -dependencies = [ - "bip32", - "cosmos-sdk-proto 0.26.1", - "ecdsa", - "eyre", - "k256", - "rand_core 0.6.4", - "serde", - "serde_json", - "signature", - "subtle-encoding", - "tendermint 0.40.0", - "thiserror 1.0.69", -] - -[[package]] -name = "cosmwasm-core" -version = "2.1.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5f6ceb8624260d0d3a67c4e1a1d43fc7e9406720afbcb124521501dd138f90aa" - [[package]] name = "cosmwasm-crypto" version = "1.5.8" @@ -1738,35 +1524,12 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "58535cbcd599b3c193e3967c8292fe1dbbb5de7c2a2d87380661091dd4744044" dependencies = [ "digest 0.10.7", - "ed25519-zebra 3.1.0", + "ed25519-zebra", "k256", "rand_core 0.6.4", "thiserror 1.0.69", ] -[[package]] -name = "cosmwasm-crypto" -version = "2.1.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4125381e5fd7fefe9f614640049648088015eca2b60d861465329a5d87dfa538" -dependencies = [ - "ark-bls12-381", - "ark-ec", - "ark-ff", - "ark-serialize", - "cosmwasm-core", - "digest 0.10.7", - "ecdsa", - "ed25519-zebra 4.0.3", - "k256", - "num-traits", - "p256", - "rand_core 0.6.4", - "rayon", - "sha2 0.10.8", - "thiserror 1.0.69", -] - [[package]] name = "cosmwasm-derive" version = "1.5.8" @@ -1776,37 +1539,13 @@ dependencies = [ "syn 1.0.109", ] -[[package]] -name = "cosmwasm-derive" -version = "2.1.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1b5658b1dc64e10b56ae7a449f678f96932a96f6cfad1769d608d1d1d656480a" -dependencies = [ - "proc-macro2", - "quote", - "syn 2.0.90", -] - [[package]] name = "cosmwasm-schema" version = "1.5.8" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "93d388adfa9cb449557a92e9318121ac1a481fc4f599213b03a5b62699b403b4" dependencies = [ - "cosmwasm-schema-derive 1.5.8", - "schemars", - "serde", - "serde_json", - "thiserror 1.0.69", -] - -[[package]] -name = "cosmwasm-schema" -version = "2.1.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f86b4d949b6041519c58993a73f4bbfba8083ba14f7001eae704865a09065845" -dependencies = [ - "cosmwasm-schema-derive 2.1.4", + "cosmwasm-schema-derive", "schemars", "serde", "serde_json", @@ -1824,17 +1563,6 @@ dependencies = [ "syn 1.0.109", ] -[[package]] -name = "cosmwasm-schema-derive" -version = "2.1.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c8ef1b5835a65fcca3ab8b9a02b4f4dacc78e233a5c2f20b270efb9db0666d12" -dependencies = [ - "proc-macro2", - "quote", - "syn 2.0.90", -] - [[package]] name = "cosmwasm-std" version = "1.5.8" @@ -1843,9 +1571,9 @@ checksum = "c21fde95ccd20044a23c0ac6fd8c941f3e8c158169dc94b5aa6491a2d9551a8d" dependencies = [ "base64 0.21.7", "bech32 0.9.1", - "bnum 0.10.0", - "cosmwasm-crypto 1.5.8", - "cosmwasm-derive 1.5.8", + "bnum", + "cosmwasm-crypto", + "cosmwasm-derive", "derivative", "forward_ref", "hex", @@ -1857,29 +1585,6 @@ dependencies = [ "thiserror 1.0.69", ] -[[package]] -name = "cosmwasm-std" -version = "2.1.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "70eb7ab0c1e99dd6207496963ba2a457c4128ac9ad9c72a83f8d9808542b849b" -dependencies = [ - "base64 0.22.1", - "bech32 0.11.0", - "bnum 0.11.0", - "cosmwasm-core", - "cosmwasm-crypto 2.1.4", - "cosmwasm-derive 2.1.4", - "derive_more 1.0.0", - "hex", - "rand_core 0.6.4", - "schemars", - "serde", - "serde-json-wasm 1.0.1", - "sha2 0.10.8", - "static_assertions", - "thiserror 1.0.69", -] - [[package]] name = "cpufeatures" version = "0.2.16" @@ -1898,31 +1603,6 @@ dependencies = [ "cfg-if", ] -[[package]] -name = "crossbeam-deque" -version = "0.8.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "613f8cc01fe9cf1a3eb3d7f488fd2fa8388403e97039e2f73692932e291a770d" -dependencies = [ - "crossbeam-epoch", - "crossbeam-utils", -] - -[[package]] -name = "crossbeam-epoch" -version = "0.9.18" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5b82ac4a3c2ca9c3460964f020e1402edd5753411d7737aa39c3714ad1b5420e" -dependencies = [ - "crossbeam-utils", -] - -[[package]] -name = "crossbeam-utils" -version = "0.8.20" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "22ec99545bb0ed0ea7bb9b8e1e9122ea386ff8a48c0922e43f36d45ab09e0e80" - [[package]] name = "crunchy" version = "0.2.2" @@ -2010,7 +1690,7 @@ version = "1.0.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "451a4691083a88a3c0630a8a88799e9d4cd6679b7ce8ff22b8da2873ff31d380" dependencies = [ - "cosmwasm-std 1.5.8", + "cosmwasm-std", ] [[package]] @@ -2019,11 +1699,11 @@ version = "3.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "64e2cf17accdcafe71859a683b6ed3f18311634a769550aacf4829b50151b221" dependencies = [ - "cosmwasm-schema 1.5.8", - "cosmwasm-std 1.5.8", + "cosmwasm-schema", + "cosmwasm-std", "cw-address-like", "cw-storage-plus 1.2.0", - "cw20 1.1.2", + "cw20", "thiserror 1.0.69", ] @@ -2033,8 +1713,8 @@ version = "1.1.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "57de8d3761e46be863e3ac1eba8c8a976362a48c6abf240df1e26c3e421ee9e8" dependencies = [ - "cosmwasm-schema 1.5.8", - "cosmwasm-std 1.5.8", + "cosmwasm-schema", + "cosmwasm-std", "cw-storage-plus 1.2.0", "cw-utils 1.0.3", "schemars", @@ -2047,8 +1727,8 @@ name = "cw-json" version = "0.1.1" source = "git+https://github.com/SlayerAnsh/cw-json.git#1a3ef8005bafdd30571dc4546ca52400e45fda8a" dependencies = [ - "cosmwasm-schema 1.5.8", - "cosmwasm-std 1.5.8", + "cosmwasm-schema", + "cosmwasm-std", "serde", "serde-cw-value", "thiserror 1.0.69", @@ -2062,7 +1742,7 @@ checksum = "91fc33b1d65c102d72f46548c64dca423c337e528d6747d0c595316aa65f887b" dependencies = [ "anyhow", "bech32 0.11.0", - "cosmwasm-std 1.5.8", + "cosmwasm-std", "cw-storage-plus 1.2.0", "cw-utils 1.0.3", "derivative", @@ -2081,7 +1761,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0c81cb500eb2f9be31a0f90c7ce66572ee4a790ffbae1c6b42ff2e3f9faf3479" dependencies = [ "anyhow", - "cosmwasm-std 1.5.8", + "cosmwasm-std", "cw-orch-contract-derive", "cw-orch-core", "cw-orch-fns-derive", @@ -2115,7 +1795,7 @@ dependencies = [ "abstract-cw-multi-test", "anyhow", "cosmos-sdk-proto 0.21.1", - "cosmwasm-std 1.5.8", + "cosmwasm-std", "cw-storage-plus 1.2.0", "cw-utils 1.0.3", "dirs", @@ -2138,8 +1818,8 @@ dependencies = [ "base64 0.22.1", "bitcoin", "chrono 0.4.39", - "cosmrs 0.15.0", - "cosmwasm-std 1.5.8", + "cosmrs", + "cosmwasm-std", "cw-orch-core", "cw-orch-networks", "cw-orch-traits", @@ -2187,7 +1867,7 @@ version = "0.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ba25ad0bf28edb98a8eb00a4bb1a922f5e9555b52512c4017cae36a676d671ed" dependencies = [ - "cosmwasm-std 1.5.8", + "cosmwasm-std", "cw-orch-interchain-core", "cw-orch-interchain-mock", "cw1", @@ -2203,8 +1883,8 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "cbe966c1c30f655f704ab201b15219e4e5c01592465bbda8b39fb015e79873b2" dependencies = [ "base64 0.21.7", - "cosmwasm-schema 1.5.8", - "cosmwasm-std 1.5.8", + "cosmwasm-schema", + "cosmwasm-std", "cw-orch-core", "cw-orch-mock", "futures", @@ -2225,8 +1905,8 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "94e03b82fb8ae2dd93f04fce878edeb688ba9ceaa7efc27d35f4213a8eadecfa" dependencies = [ "anyhow", - "cosmrs 0.15.0", - "cosmwasm-std 1.5.8", + "cosmrs", + "cosmwasm-std", "cw-orch-core", "cw-orch-interchain-core", "cw-orch-mock", @@ -2245,7 +1925,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "57beb30d841bde79df51c9402741ef926ca8ef7ecd3570aa180074f767ac04d3" dependencies = [ "abstract-cw-multi-test", - "cosmwasm-std 1.5.8", + "cosmwasm-std", "cw-orch-core", "cw-utils 1.0.3", "log", @@ -2280,8 +1960,8 @@ version = "0.5.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "093dfb4520c48b5848274dd88ea99e280a04bc08729603341c7fb0d758c74321" dependencies = [ - "cosmwasm-schema 1.5.8", - "cosmwasm-std 1.5.8", + "cosmwasm-schema", + "cosmwasm-std", "cw-address-like", "cw-ownable-derive", "cw-storage-plus 1.2.0", @@ -2306,7 +1986,7 @@ version = "0.16.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d9b6f91c0b94481a3e9ef1ceb183c37d00764f8751e39b45fc09f4d9b970d469" dependencies = [ - "cosmwasm-std 1.5.8", + "cosmwasm-std", "schemars", "serde", ] @@ -2317,18 +1997,7 @@ version = "1.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d5ff29294ee99373e2cd5fd21786a3c0ced99a52fec2ca347d565489c61b723c" dependencies = [ - "cosmwasm-std 1.5.8", - "schemars", - "serde", -] - -[[package]] -name = "cw-storage-plus" -version = "2.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f13360e9007f51998d42b1bc6b7fa0141f74feae61ed5fd1e5b0a89eec7b5de1" -dependencies = [ - "cosmwasm-std 2.1.4", + "cosmwasm-std", "schemars", "serde", ] @@ -2339,8 +2008,8 @@ version = "0.16.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d6a84c6c1c0acc3616398eba50783934bd6c964bad6974241eaee3460c8f5b26" dependencies = [ - "cosmwasm-schema 1.5.8", - "cosmwasm-std 1.5.8", + "cosmwasm-schema", + "cosmwasm-std", "cw2 0.16.0", "schemars", "semver", @@ -2354,8 +2023,8 @@ version = "1.0.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1c4a657e5caacc3a0d00ee96ca8618745d050b8f757c709babafb81208d4239c" dependencies = [ - "cosmwasm-schema 1.5.8", - "cosmwasm-std 1.5.8", + "cosmwasm-schema", + "cosmwasm-std", "cw2 1.1.2", "schemars", "semver", @@ -2363,27 +2032,14 @@ dependencies = [ "thiserror 1.0.69", ] -[[package]] -name = "cw-utils" -version = "2.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "07dfee7f12f802431a856984a32bce1cb7da1e6c006b5409e3981035ce562dec" -dependencies = [ - "cosmwasm-schema 2.1.4", - "cosmwasm-std 2.1.4", - "schemars", - "serde", - "thiserror 1.0.69", -] - [[package]] name = "cw1" version = "1.1.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f1605722190afd93bfea6384b88224d1cfe50ebf70d2e10641535da79fa70e83" dependencies = [ - "cosmwasm-schema 1.5.8", - "cosmwasm-std 1.5.8", + "cosmwasm-schema", + "cosmwasm-std", "schemars", "serde", ] @@ -2394,8 +2050,8 @@ version = "1.1.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "81bb3e9dc87f4ff26547f4e27e0ba3c82034372f21b2f55527fb52b542637d8d" dependencies = [ - "cosmwasm-schema 1.5.8", - "cosmwasm-std 1.5.8", + "cosmwasm-schema", + "cosmwasm-std", "cw-storage-plus 1.2.0", "cw-utils 1.0.3", "cw1", @@ -2411,8 +2067,8 @@ version = "0.16.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "91398113b806f4d2a8d5f8d05684704a20ffd5968bf87e3473e1973710b884ad" dependencies = [ - "cosmwasm-schema 1.5.8", - "cosmwasm-std 1.5.8", + "cosmwasm-schema", + "cosmwasm-std", "cw-storage-plus 0.16.0", "schemars", "serde", @@ -2424,8 +2080,8 @@ version = "1.1.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c6c120b24fbbf5c3bedebb97f2cc85fbfa1c3287e09223428e7e597b5293c1fa" dependencies = [ - "cosmwasm-schema 1.5.8", - "cosmwasm-std 1.5.8", + "cosmwasm-schema", + "cosmwasm-std", "cw-storage-plus 1.2.0", "schemars", "semver", @@ -2433,57 +2089,30 @@ dependencies = [ "thiserror 1.0.69", ] -[[package]] -name = "cw2" -version = "2.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b04852cd38f044c0751259d5f78255d07590d136b8a86d4e09efdd7666bd6d27" -dependencies = [ - "cosmwasm-schema 2.1.4", - "cosmwasm-std 2.1.4", - "cw-storage-plus 2.0.0", - "schemars", - "semver", - "serde", - "thiserror 1.0.69", -] - [[package]] name = "cw20" version = "1.1.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "526e39bb20534e25a1cd0386727f0038f4da294e5e535729ba3ef54055246abd" dependencies = [ - "cosmwasm-schema 1.5.8", - "cosmwasm-std 1.5.8", + "cosmwasm-schema", + "cosmwasm-std", "cw-utils 1.0.3", "schemars", "serde", ] -[[package]] -name = "cw20" -version = "2.0.0" -source = "git+https://github.com/CosmWasm/cw-plus#17b1ac4d518ee9b546b82706a70b77cfff1b0ee3" -dependencies = [ - "cosmwasm-schema 2.1.4", - "cosmwasm-std 2.1.4", - "cw-utils 2.0.0", - "schemars", - "serde", -] - [[package]] name = "cw20-base" version = "1.1.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "17ad79e86ea3707229bf78df94e08732e8f713207b4a77b2699755596725e7d9" dependencies = [ - "cosmwasm-schema 1.5.8", - "cosmwasm-std 1.5.8", + "cosmwasm-schema", + "cosmwasm-std", "cw-storage-plus 1.2.0", "cw2 1.1.2", - "cw20 1.1.2", + "cw20", "schemars", "semver", "serde", @@ -2496,13 +2125,13 @@ version = "1.1.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "76221201da08fed611c857ea3aa21c031a4a7dc771a8b1750559ca987335dc02" dependencies = [ - "cosmwasm-schema 1.5.8", - "cosmwasm-std 1.5.8", + "cosmwasm-schema", + "cosmwasm-std", "cw-controllers", "cw-storage-plus 1.2.0", "cw-utils 1.0.3", "cw2 1.1.2", - "cw20 1.1.2", + "cw20", "schemars", "semver", "serde", @@ -2515,66 +2144,23 @@ version = "1.1.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "2967fbd073d4b626dd9e7148e05a84a3bebd9794e71342e12351110ffbb12395" dependencies = [ - "cosmwasm-schema 1.5.8", - "cosmwasm-std 1.5.8", + "cosmwasm-schema", + "cosmwasm-std", "cw-utils 1.0.3", - "cw20 1.1.2", + "cw20", "schemars", "serde", "thiserror 1.0.69", ] -[[package]] -name = "cw3" -version = "2.0.0" -source = "git+https://github.com/CosmWasm/cw-plus#17b1ac4d518ee9b546b82706a70b77cfff1b0ee3" -dependencies = [ - "cosmwasm-schema 2.1.4", - "cosmwasm-std 2.1.4", - "cw-utils 2.0.0", - "cw20 2.0.0", - "schemars", - "serde", - "thiserror 1.0.69", -] - -[[package]] -name = "cw3-fixed-multisig" -version = "2.0.0" -source = "git+https://github.com/CosmWasm/cw-plus#17b1ac4d518ee9b546b82706a70b77cfff1b0ee3" -dependencies = [ - "cosmwasm-schema 2.1.4", - "cosmwasm-std 2.1.4", - "cw-storage-plus 2.0.0", - "cw-utils 2.0.0", - "cw2 2.0.0", - "cw3 2.0.0", - "schemars", - "serde", - "thiserror 1.0.69", -] - -[[package]] -name = "cw4" -version = "1.1.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "24754ff6e45f2a1c60adc409d9b2eb87666012c44021329141ffaab3388fccd2" -dependencies = [ - "cosmwasm-schema 1.5.8", - "cosmwasm-std 1.5.8", - "cw-storage-plus 1.2.0", - "schemars", - "serde", -] - [[package]] name = "cw721" version = "0.16.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "94a1ea6e6277bdd6dfc043a9b1380697fe29d6e24b072597439523658d21d791" dependencies = [ - "cosmwasm-schema 1.5.8", - "cosmwasm-std 1.5.8", + "cosmwasm-schema", + "cosmwasm-std", "cw-utils 0.16.0", "schemars", "serde", @@ -2586,8 +2172,8 @@ version = "0.18.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e3c4d286625ccadc957fe480dd3bdc54ada19e0e6b5b9325379db3130569e914" dependencies = [ - "cosmwasm-schema 1.5.8", - "cosmwasm-std 1.5.8", + "cosmwasm-schema", + "cosmwasm-std", "cw-utils 1.0.3", "schemars", "serde", @@ -2599,8 +2185,8 @@ version = "0.16.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "77518e27431d43214cff4cdfbd788a7508f68d9b1f32389e6fce513e7eaccbef" dependencies = [ - "cosmwasm-schema 1.5.8", - "cosmwasm-std 1.5.8", + "cosmwasm-schema", + "cosmwasm-std", "cw-storage-plus 0.16.0", "cw-utils 0.16.0", "cw2 0.16.0", @@ -2616,8 +2202,8 @@ version = "0.18.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "da518d9f68bfda7d972cbaca2e8fcf04651d0edc3de72b04ae2bcd9289c81614" dependencies = [ - "cosmwasm-schema 1.5.8", - "cosmwasm-std 1.5.8", + "cosmwasm-schema", + "cosmwasm-std", "cw-ownable", "cw-storage-plus 1.2.0", "cw-utils 1.0.3", @@ -2670,27 +2256,6 @@ dependencies = [ "syn 2.0.90", ] -[[package]] -name = "derive_more" -version = "1.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4a9b99b9cbbe49445b21764dc0625032a89b145a2642e67603e1c936f5458d05" -dependencies = [ - "derive_more-impl", -] - -[[package]] -name = "derive_more-impl" -version = "1.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cb7330aeadfbe296029522e6c40f315320aba36fc43a5b3632f3795348f3bd22" -dependencies = [ - "proc-macro2", - "quote", - "syn 2.0.90", - "unicode-xid", -] - [[package]] name = "digest" version = "0.9.0" @@ -2823,21 +2388,6 @@ dependencies = [ "zeroize", ] -[[package]] -name = "ed25519-zebra" -version = "4.0.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7d9ce6874da5d4415896cd45ffbc4d1cfc0c4f9c079427bd870742c30f2f65a9" -dependencies = [ - "curve25519-dalek 4.1.3", - "ed25519", - "hashbrown 0.14.5", - "hex", - "rand_core 0.6.4", - "sha2 0.10.8", - "zeroize", -] - [[package]] name = "either" version = "1.13.0" @@ -3225,26 +2775,7 @@ version = "0.12.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8a9ee70c43aaf417c914396645a0fa852624801b24ebb7ae78fe8272889ac888" dependencies = [ - "ahash 0.7.8", -] - -[[package]] -name = "hashbrown" -version = "0.13.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "43a3c133739dddd0d2990f9a4bdf8eb4b21ef50e4851ca85ab661199821d510e" -dependencies = [ - "ahash 0.8.11", -] - -[[package]] -name = "hashbrown" -version = "0.14.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e5274423e17b7c9fc20b6e7e208532f9b19825d82dfd615708b70edd83df41f1" -dependencies = [ - "ahash 0.8.11", - "allocator-api2", + "ahash", ] [[package]] @@ -3265,15 +2796,6 @@ version = "0.4.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "7f24254aa9a54b5c858eaee2f5bccdb46aaf0e486a595ed5fd8f86ba55232a70" -[[package]] -name = "hex-conservative" -version = "0.2.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5313b072ce3c597065a808dbf612c4c8e8590bdbf8b579508bf7a762c5eae6cd" -dependencies = [ - "arrayvec", -] - [[package]] name = "hex_lit" version = "0.1.1" @@ -3560,7 +3082,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "2fa9269c050d20b36a9e61955a5526345df1508f396f7f3a9acb4c03cdb572f3" dependencies = [ "bytes", - "derive_more 0.99.18", + "derive_more", "dyn-clone", "erased-serde", "flex-error", @@ -3598,13 +3120,11 @@ dependencies = [ "andromeda-std", "andromeda-testing-e2e", "andromeda-validator-staking", - "cosmrs 0.21.0", - "cosmwasm-std 1.5.8", + "cosmwasm-std", "cw-orch", "cw-orch-daemon", - "cw20 1.1.2", + "cw20", "cw721 0.18.0", - "prost-types 0.13.4", "rstest", "serde", "tokio", @@ -4195,7 +3715,7 @@ version = "0.1.7" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "50fb348fd7aefc37038ba8125e18b360af5bd44c6e007d2b10346777995857e3" dependencies = [ - "cosmwasm-std 1.5.8", + "cosmwasm-std", "osmosis-std-derive 0.1.7", "prost 0.11.9", "prost-types 0.11.9", @@ -4227,18 +3747,6 @@ dependencies = [ "syn 1.0.109", ] -[[package]] -name = "p256" -version = "0.13.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c9863ad85fa8f4460f9c48cb909d38a0d689dba1f6f6988a5e3e0d31071bcd4b" -dependencies = [ - "ecdsa", - "elliptic-curve", - "primeorder", - "sha2 0.10.8", -] - [[package]] name = "parking_lot" version = "0.12.3" @@ -4364,8 +3872,8 @@ version = "1.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "fc2f16d20da9144fdf0658e785fc9108b86cecee517335ff531745029dd56088" dependencies = [ - "cosmwasm-schema 1.5.8", - "cosmwasm-std 1.5.8", + "cosmwasm-schema", + "cosmwasm-std", "cw-storage-plus 1.2.0", "thiserror 1.0.69", ] @@ -4385,15 +3893,6 @@ dependencies = [ "zerocopy", ] -[[package]] -name = "primeorder" -version = "0.13.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "353e1ca18966c16d9deb1c69278edbc5f194139612772bd9537af60ac231e1e6" -dependencies = [ - "elliptic-curve", -] - [[package]] name = "primitive-types" version = "0.12.2" @@ -4443,16 +3942,6 @@ dependencies = [ "prost-derive 0.12.6", ] -[[package]] -name = "prost" -version = "0.13.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2c0fef6c4230e4ccf618a35c59d7ede15dea37de8427500f50aff708806e42ec" -dependencies = [ - "bytes", - "prost-derive 0.13.4", -] - [[package]] name = "prost-derive" version = "0.11.9" @@ -4479,19 +3968,6 @@ dependencies = [ "syn 2.0.90", ] -[[package]] -name = "prost-derive" -version = "0.13.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "157c5a9d7ea5c2ed2d9fb8f495b64759f7816c7eaea54ba3978f0d63000162e3" -dependencies = [ - "anyhow", - "itertools 0.13.0", - "proc-macro2", - "quote", - "syn 2.0.90", -] - [[package]] name = "prost-types" version = "0.11.9" @@ -4510,15 +3986,6 @@ dependencies = [ "prost 0.12.6", ] -[[package]] -name = "prost-types" -version = "0.13.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cc2f1e56baa61e93533aebc21af4d2134b70f66275e0fcdf3cbe43d77ff7e8fc" -dependencies = [ - "prost 0.13.4", -] - [[package]] name = "quote" version = "1.0.37" @@ -4564,26 +4031,6 @@ dependencies = [ "getrandom", ] -[[package]] -name = "rayon" -version = "1.10.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b418a60154510ca1a002a752ca9714984e21e4241e804d32555251faf8b78ffa" -dependencies = [ - "either", - "rayon-core", -] - -[[package]] -name = "rayon-core" -version = "1.12.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1465873a3dfdaa8ae7cb14b4383657caab0b3e8a0aa9ae8e04b044854c8dfce2" -dependencies = [ - "crossbeam-deque", - "crossbeam-utils", -] - [[package]] name = "redox_syscall" version = "0.5.7" @@ -4991,19 +4438,8 @@ version = "0.27.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "25996b82292a7a57ed3508f052cfff8640d38d32018784acd714758b43da9c8f" dependencies = [ - "bitcoin_hashes 0.12.0", - "secp256k1-sys 0.8.1", -] - -[[package]] -name = "secp256k1" -version = "0.30.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b50c5943d326858130af85e049f2661ba3c78b26589b8ab98e65e80ae44a1252" -dependencies = [ - "bitcoin_hashes 0.14.0", - "rand", - "secp256k1-sys 0.10.1", + "bitcoin_hashes", + "secp256k1-sys", ] [[package]] @@ -5015,15 +4451,6 @@ dependencies = [ "cc", ] -[[package]] -name = "secp256k1-sys" -version = "0.10.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d4387882333d3aa8cb20530a17c69a3752e97837832f34f6dccc760e715001d9" -dependencies = [ - "cc", -] - [[package]] name = "security-framework" version = "2.11.1" @@ -5492,36 +4919,6 @@ dependencies = [ "zeroize", ] -[[package]] -name = "tendermint" -version = "0.40.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "37d513ce7f9e41c67ab2dd3d554ef65f36fbcc61745af1e1f93eafdeefa1ce37" -dependencies = [ - "bytes", - "digest 0.10.7", - "ed25519", - "ed25519-consensus", - "flex-error", - "futures", - "k256", - "num-traits", - "once_cell", - "prost 0.13.4", - "ripemd", - "serde", - "serde_bytes", - "serde_json", - "serde_repr", - "sha2 0.10.8", - "signature", - "subtle", - "subtle-encoding", - "tendermint-proto 0.40.0", - "time 0.3.37", - "zeroize", -] - [[package]] name = "tendermint-config" version = "0.34.1" @@ -5542,7 +4939,7 @@ version = "0.32.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "9875dce5c1b08201152eb0860f8fb1dce96c53e37532c310ffc4956d20f90def" dependencies = [ - "derive_more 0.99.18", + "derive_more", "flex-error", "serde", "tendermint 0.32.2", @@ -5603,21 +5000,6 @@ dependencies = [ "time 0.3.37", ] -[[package]] -name = "tendermint-proto" -version = "0.40.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c81ba1b023ec00763c3bc4f4376c67c0047f185cccf95c416c7a2f16272c4cbb" -dependencies = [ - "bytes", - "flex-error", - "prost 0.13.4", - "serde", - "serde_bytes", - "subtle-encoding", - "time 0.3.37", -] - [[package]] name = "tendermint-rpc" version = "0.34.1" @@ -5722,13 +5104,13 @@ dependencies = [ "andromeda-vault", "andromeda-vesting", "andromeda-vfs", - "cosmwasm-schema 1.5.8", - "cosmwasm-std 1.5.8", + "cosmwasm-schema", + "cosmwasm-std", "cw-asset", "cw-multi-test", "cw-orch", "cw-orch-interchain", - "cw20 1.1.2", + "cw20", "cw721 0.18.0", "cw721-base 0.18.0", "ibc-relayer-types", @@ -6127,12 +5509,6 @@ version = "1.12.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f6ccf251212114b54433ec949fd6a7841275f9ada20dddd2f29e9ceea4501493" -[[package]] -name = "unicode-xid" -version = "0.2.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ebc1c04c71510c7f702b52b7c350734c9ff1295c464a03335b00bb84fc54f853" - [[package]] name = "untrusted" version = "0.9.0" diff --git a/contracts/accounts/andromeda-fixed-multisig/Cargo.toml b/contracts/accounts/andromeda-fixed-multisig/Cargo.toml index aeb6da7d8..0e7eaa090 100644 --- a/contracts/accounts/andromeda-fixed-multisig/Cargo.toml +++ b/contracts/accounts/andromeda-fixed-multisig/Cargo.toml @@ -22,8 +22,6 @@ cw-storage-plus = { workspace = true } cw-utils = { workspace = true } cw2 = { workspace = true } cw3 = { workspace = true } -cw4 = { workspace = true } -cw3-fixed-multisig = { git = "https://github.com/CosmWasm/cw-plus" } andromeda-std = { workspace = true } andromeda-accounts = { workspace = true } diff --git a/contracts/data-storage/andromeda-form/Cargo.toml b/contracts/data-storage/andromeda-form/Cargo.toml index 08890859f..4dc5d3727 100644 --- a/contracts/data-storage/andromeda-form/Cargo.toml +++ b/contracts/data-storage/andromeda-form/Cargo.toml @@ -29,7 +29,6 @@ cosmwasm-schema = { workspace = true } cw-storage-plus = { workspace = true } cw-utils = { workspace = true } cw20 = { workspace = true } -cw-json = { git = "https://github.com/SlayerAnsh/cw-json.git" } serde_json = { workspace = true } serde = { workspace = true } test-case = { workspace = true } diff --git a/contracts/os/andromeda-ibc-registry/Cargo.toml b/contracts/os/andromeda-ibc-registry/Cargo.toml index af272ec95..086d6d093 100644 --- a/contracts/os/andromeda-ibc-registry/Cargo.toml +++ b/contracts/os/andromeda-ibc-registry/Cargo.toml @@ -30,7 +30,6 @@ cw-utils = { workspace = true } cw20 = { workspace = true } andromeda-std = { workspace = true } -andromeda-data-storage = { workspace = true } [target.'cfg(not(target_arch = "wasm32"))'.dependencies] cw-orch = { workspace = true } diff --git a/contracts/os/andromeda-kernel/Cargo.toml b/contracts/os/andromeda-kernel/Cargo.toml index 59ef3cd84..651933c6d 100644 --- a/contracts/os/andromeda-kernel/Cargo.toml +++ b/contracts/os/andromeda-kernel/Cargo.toml @@ -27,7 +27,6 @@ cosmwasm-schema = { workspace = true } cw-storage-plus = { workspace = true } serde-json-wasm = "1.0.1" -serde-cw-value = "0.7.0" osmosis-std-derive = "0.15.3" osmosis-std = "0.1.4" prost = { version = "0.11.2", default-features = false, features = [ diff --git a/ibc-tests/Cargo.toml b/ibc-tests/Cargo.toml index 7f71a896a..536df46eb 100644 --- a/ibc-tests/Cargo.toml +++ b/ibc-tests/Cargo.toml @@ -50,8 +50,6 @@ andromeda-app = { workspace = true } andromeda-fungible-tokens = { workspace = true } andromeda-non-fungible-tokens = { workspace = true } cosmwasm-std = { workspace = true, features = ["staking"] } -cosmrs = "0.21.0" -prost-types = "0.13.4" cw20.workspace = true cw721.workspace = true diff --git a/packages/andromeda-finance/Cargo.toml b/packages/andromeda-finance/Cargo.toml index 14386e0d5..896ed5d82 100644 --- a/packages/andromeda-finance/Cargo.toml +++ b/packages/andromeda-finance/Cargo.toml @@ -12,15 +12,12 @@ backtraces = ["cosmwasm-std/backtraces"] # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html [lib] crate-type = ["cdylib", "rlib"] -testing = ["cw-multi-test"] [dependencies] cosmwasm-std = { workspace = true, features = ["staking"] } cosmwasm-schema = { workspace = true } serde = { version = "1.0.216", default-features = false, features = ["derive"] } cw-utils = { workspace = true } -cw3 = { workspace = true } -cw4 = { workspace = true } cw721 = { workspace = true } cw721-base = { workspace = true } cw20 = { workspace = true } diff --git a/packages/andromeda-fungible-tokens/Cargo.toml b/packages/andromeda-fungible-tokens/Cargo.toml index f203a6eba..c627b0ad4 100644 --- a/packages/andromeda-fungible-tokens/Cargo.toml +++ b/packages/andromeda-fungible-tokens/Cargo.toml @@ -12,7 +12,6 @@ backtraces = ["cosmwasm-std/backtraces"] # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html [lib] crate-type = ["cdylib", "rlib"] -testing = ["cw-multi-test"] [dependencies] cosmwasm-std = { workspace = true } diff --git a/packages/andromeda-testing-e2e/Cargo.toml b/packages/andromeda-testing-e2e/Cargo.toml index be33b072a..33178c2f4 100644 --- a/packages/andromeda-testing-e2e/Cargo.toml +++ b/packages/andromeda-testing-e2e/Cargo.toml @@ -38,13 +38,10 @@ andromeda-economics = { version = "1.0.0", path = "../../contracts/os/andromeda- ] } andromeda-std = { workspace = true } serde = { workspace = true } -secp256k1 = "0.30.0" -cosmrs = "0.21.0" [target.'cfg(not(target_arch = "wasm32"))'.dependencies] cw-multi-test = { workspace = true } anyhow = "1.0.95" -reqwest = { version = "0.12.9", features = ["json"] } tokio = "1.42.0" cw-orch-daemon = "0.24.3" cw-orch = { workspace = true } diff --git a/packages/std/Cargo.toml b/packages/std/Cargo.toml index c35fbebdc..1f834820c 100644 --- a/packages/std/Cargo.toml +++ b/packages/std/Cargo.toml @@ -28,7 +28,6 @@ cw20-base = { workspace = true, features = ["library"] } cw721-base = { workspace = true } cw-utils = { workspace = true } cw2 = { workspace = true } -cw3 = { workspace = true } cw-asset = { version = "3.0.0" } thiserror = { version = "2.0.9" } lazy_static = "1" From 545cbbbc361a9c21319ca06c9b7fe90d03ae560d Mon Sep 17 00:00:00 2001 From: Joe Monem <66594578+joemonem@users.noreply.github.com> Date: Tue, 24 Dec 2024 10:25:32 +0200 Subject: [PATCH 08/21] ref: remove recipient now uses AndrAddr instead Recipient (#739) --- CHANGELOG.md | 1 + Cargo.lock | 2 +- .../Cargo.toml | 2 +- .../src/contract.rs | 103 +++++++----------- .../src/testing/tests.rs | 7 +- .../src/weighted_splitter.rs | 6 +- 6 files changed, 47 insertions(+), 74 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 68d058cef..251ad195d 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -22,6 +22,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 - Rates: Limit rates recipient to only one address [(#669)](https://github.com/andromedaprotocol/andromeda-core/pull/669) - Address Validation: Cross-chain recipients don't need to be registered in VFS [(#725)](https://github.com/andromedaprotocol/andromeda-core/pull/725) +- Weighted Splitter: Replace Recipient with AndrAddr in RemoveRecipient and GetUserWeight [(#739)](https://github.com/andromedaprotocol/andromeda-core/pull/739) ### Fixed diff --git a/Cargo.lock b/Cargo.lock index 1df7231f3..ee4d8079c 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1054,7 +1054,7 @@ dependencies = [ [[package]] name = "andromeda-weighted-distribution-splitter" -version = "2.1.0-beta" +version = "2.1.0-b.2" dependencies = [ "andromeda-app", "andromeda-finance", diff --git a/contracts/finance/andromeda-weighted-distribution-splitter/Cargo.toml b/contracts/finance/andromeda-weighted-distribution-splitter/Cargo.toml index 8f6967a6e..f7ef07252 100644 --- a/contracts/finance/andromeda-weighted-distribution-splitter/Cargo.toml +++ b/contracts/finance/andromeda-weighted-distribution-splitter/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "andromeda-weighted-distribution-splitter" -version = "2.1.0-beta" +version = "2.1.0-b.2" edition = "2021" rust-version = "1.75.0" diff --git a/contracts/finance/andromeda-weighted-distribution-splitter/src/contract.rs b/contracts/finance/andromeda-weighted-distribution-splitter/src/contract.rs index 7f16851ef..df02566f1 100644 --- a/contracts/finance/andromeda-weighted-distribution-splitter/src/contract.rs +++ b/contracts/finance/andromeda-weighted-distribution-splitter/src/contract.rs @@ -9,11 +9,8 @@ use andromeda_finance::{ use andromeda_std::{ ado_base::{InstantiateMsg as BaseInstantiateMsg, MigrateMsg}, ado_contract::ADOContract, - amp::Recipient, - common::{ - actions::call_action, context::ExecuteContext, encode_binary, expiration::Expiry, - Milliseconds, - }, + amp::{AndrAddr, Recipient}, + common::{actions::call_action, context::ExecuteContext, encode_binary, expiration::Expiry}, error::ContractError, }; use cosmwasm_std::{ @@ -33,30 +30,22 @@ pub fn instantiate( info: MessageInfo, msg: InstantiateMsg, ) -> Result { - let _app_contract = ADOContract::default().get_app_contract(deps.storage)?; // Max 100 recipients ensure!( msg.recipients.len() <= 100, ContractError::ReachedRecipientLimit {} ); - let splitter = match msg.lock_time { - Some(ref lock_time) => { - let time = validate_expiry_duration(lock_time, &env.block)?; - - Splitter { - recipients: msg.recipients, - lock: time, - default_recipient: msg.default_recipient, - } - } - None => { - Splitter { - recipients: msg.recipients, - // If locking isn't desired upon instantiation, it's automatically set to 0 - lock: Milliseconds::default(), - default_recipient: msg.default_recipient, - } - } + + let lock = msg + .lock_time + .map(|lock_time| validate_expiry_duration(&lock_time, &env.block)) + .transpose()? + .unwrap_or_default(); + + let splitter = Splitter { + recipients: msg.recipients, + lock, + default_recipient: msg.default_recipient, }; SPLITTER.save(deps.storage, &splitter)?; @@ -243,11 +232,10 @@ pub fn execute_add_recipient( ); // Check for duplicate recipients - - let user_exists = splitter - .recipients - .iter() - .any(|x| x.recipient == recipient.recipient); + let user_exists = splitter.recipients.iter().any(|x| { + x.recipient.address.get_raw_address(&deps.as_ref()) + == recipient.recipient.address.get_raw_address(&deps.as_ref()) + }); ensure!(!user_exists, ContractError::DuplicateRecipient {}); @@ -414,7 +402,7 @@ fn execute_update_recipients( fn execute_remove_recipient( ctx: ExecuteContext, - recipient: Recipient, + recipient: AndrAddr, ) -> Result { let ExecuteContext { deps, info, env, .. @@ -428,34 +416,23 @@ fn execute_remove_recipient( let mut splitter = SPLITTER.load(deps.storage)?; - // Can't remove recipients while lock isn't expired - ensure!( splitter.lock.is_expired(&env.block), ContractError::ContractLocked {} ); - // Recipients are stored in a vector, we search for the desired recipient's index in the vector - - let user_index = splitter + // Find and remove recipient in one pass + let recipient_idx = splitter .recipients - .clone() - .into_iter() - .position(|x| x.recipient == recipient); - - // If the index exists, remove the element found in the index - // If the index doesn't exist, return an error - ensure!(user_index.is_some(), ContractError::UserNotFound {}); + .iter() + .position(|x| { + x.recipient.address.get_raw_address(&deps.as_ref()) + == recipient.get_raw_address(&deps.as_ref()) + }) + .ok_or(ContractError::UserNotFound {})?; - if let Some(i) = user_index { - splitter.recipients.swap_remove(i); - let new_splitter = Splitter { - recipients: splitter.recipients, - lock: splitter.lock, - default_recipient: splitter.default_recipient, - }; - SPLITTER.save(deps.storage, &new_splitter)?; - }; + splitter.recipients.swap_remove(recipient_idx); + SPLITTER.save(deps.storage, &splitter)?; Ok(Response::default().add_attributes(vec![attr("action", "removed_recipient")])) } @@ -507,11 +484,14 @@ pub fn query(deps: Deps, env: Env, msg: QueryMsg) -> Result Result { +fn query_user_weight(deps: Deps, user: AndrAddr) -> Result { let splitter = SPLITTER.load(deps.storage)?; let recipients = splitter.recipients; - let addrs = recipients.iter().find(|&x| x.recipient == user); + let addrs = recipients + .iter() + .find(|&x| x.recipient.address.get_raw_address(&deps) == user.get_raw_address(&deps)) + .ok_or(ContractError::AccountNotFound {})?; // Calculate the total weight let mut total_weight = Uint128::zero(); @@ -519,19 +499,10 @@ fn query_user_weight(deps: Deps, user: Recipient) -> Result Result { diff --git a/contracts/finance/andromeda-weighted-distribution-splitter/src/testing/tests.rs b/contracts/finance/andromeda-weighted-distribution-splitter/src/testing/tests.rs index 99f7cb150..c0eb5cd4d 100644 --- a/contracts/finance/andromeda-weighted-distribution-splitter/src/testing/tests.rs +++ b/contracts/finance/andromeda-weighted-distribution-splitter/src/testing/tests.rs @@ -1,3 +1,4 @@ +use andromeda_std::amp::AndrAddr; use andromeda_std::common::expiration::Expiry; use andromeda_std::common::Milliseconds; use andromeda_std::testing::mock_querier::{mock_dependencies_custom, MOCK_KERNEL_CONTRACT}; @@ -430,7 +431,7 @@ fn test_execute_remove_recipient() { let _res = execute(deps.as_mut(), env.clone(), info.clone(), msg).unwrap(); let msg = ExecuteMsg::RemoveRecipient { - recipient: Recipient::from_string(String::from("addr1")), + recipient: AndrAddr::from_string("addr1"), }; // Try removing a user that isn't in the list let res = execute(deps.as_mut(), env, info, msg).unwrap(); @@ -525,7 +526,7 @@ fn test_execute_remove_recipient_not_on_list() { // Try removing a user that isn't in the list let msg = ExecuteMsg::RemoveRecipient { - recipient: Recipient::from_string(String::from("addr10")), + recipient: AndrAddr::from_string("addr10"), }; let err = execute(deps.as_mut(), env, info, msg).unwrap_err(); @@ -596,7 +597,7 @@ fn test_execute_remove_recipient_contract_locked() { SPLITTER.save(deps.as_mut().storage, &splitter).unwrap(); let msg = ExecuteMsg::RemoveRecipient { - recipient: Recipient::from_string(String::from("addr1")), + recipient: AndrAddr::from_string("addr1"), }; let err = execute(deps.as_mut(), env, info, msg).unwrap_err(); diff --git a/packages/andromeda-finance/src/weighted_splitter.rs b/packages/andromeda-finance/src/weighted_splitter.rs index 56a78f72f..7dbba120c 100644 --- a/packages/andromeda-finance/src/weighted_splitter.rs +++ b/packages/andromeda-finance/src/weighted_splitter.rs @@ -1,5 +1,5 @@ use andromeda_std::{ - amp::recipient::Recipient, + amp::{recipient::Recipient, AndrAddr}, andr_exec, andr_instantiate, andr_query, common::{expiration::Expiry, MillisecondsExpiration}, }; @@ -45,7 +45,7 @@ pub enum ExecuteMsg { /// Add a single recipient to the recipient list. Only executable by the contract owner when the contract is not locked. AddRecipient { recipient: AddressWeight }, /// Remove a single recipient from the recipient list. Only executable by the contract owner when the contract is not locked. - RemoveRecipient { recipient: Recipient }, + RemoveRecipient { recipient: AndrAddr }, /// Used to lock/unlock the contract allowing the config to be updated. UpdateLock { lock_time: Expiry }, /// Divides any attached funds to the message amongst the recipients list. @@ -61,7 +61,7 @@ pub enum QueryMsg { GetSplitterConfig {}, /// Gets user's allocated weight #[returns(GetUserWeightResponse)] - GetUserWeight { user: Recipient }, + GetUserWeight { user: AndrAddr }, } #[cw_serde] From 9331f978c53aa35a7ad034381d8297609b7952e8 Mon Sep 17 00:00:00 2001 From: Joe Monem <66594578+joemonem@users.noreply.github.com> Date: Tue, 24 Dec 2024 10:26:17 +0200 Subject: [PATCH 09/21] feat: include buy_now_price in UpdateAuction (#730) --- CHANGELOG.md | 1 + Cargo.lock | 2 +- .../andromeda-auction/Cargo.toml | 2 +- .../andromeda-auction/src/contract.rs | 13 +++++++++++++ .../andromeda-auction/src/mock.rs | 2 ++ .../andromeda-auction/src/testing/tests.rs | 7 ++++++- .../andromeda-non-fungible-tokens/src/auction.rs | 1 + tests-integration/tests/auction_app.rs | 1 + 8 files changed, 26 insertions(+), 3 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 251ad195d..f2ea6232e 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -17,6 +17,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 - Rates: Handle cross-chain recipients [(#671)](https://github.com/andromedaprotocol/andromeda-core/pull/671) - Permissions: Permissioned Actors in AndromedaQuery [(#717)](https://github.com/andromedaprotocol/andromeda-core/pull/717) - Added Schema and Form ADOs [(#591)](https://github.com/andromedaprotocol/andromeda-core/pull/591) +- Auction ADO: Added buy_now_price option in Update Auction [(#730)](https://github.com/andromedaprotocol/andromeda-core/pull/730) ### Changed diff --git a/Cargo.lock b/Cargo.lock index ee4d8079c..dbc69f60f 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -148,7 +148,7 @@ dependencies = [ [[package]] name = "andromeda-auction" -version = "2.2.4" +version = "2.2.5-b.1" dependencies = [ "andromeda-app", "andromeda-non-fungible-tokens", diff --git a/contracts/non-fungible-tokens/andromeda-auction/Cargo.toml b/contracts/non-fungible-tokens/andromeda-auction/Cargo.toml index 001aa5c5b..56ec0b0d6 100644 --- a/contracts/non-fungible-tokens/andromeda-auction/Cargo.toml +++ b/contracts/non-fungible-tokens/andromeda-auction/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "andromeda-auction" -version = "2.2.4" +version = "2.2.5-b.1" edition = "2021" rust-version = "1.75.0" diff --git a/contracts/non-fungible-tokens/andromeda-auction/src/contract.rs b/contracts/non-fungible-tokens/andromeda-auction/src/contract.rs index a963f6a69..84148b335 100644 --- a/contracts/non-fungible-tokens/andromeda-auction/src/contract.rs +++ b/contracts/non-fungible-tokens/andromeda-auction/src/contract.rs @@ -115,6 +115,7 @@ pub fn handle_execute(mut ctx: ExecuteContext, msg: ExecuteMsg) -> Result execute_update_auction( ctx, @@ -126,6 +127,7 @@ pub fn handle_execute(mut ctx: ExecuteContext, msg: ExecuteMsg) -> Result>, min_bid: Option, min_raise: Option, + buy_now_price: Option, recipient: Option, ) -> Result { let ExecuteContext { @@ -418,6 +421,14 @@ fn execute_update_auction( ContractError::StartTimeAfterEndTime {} ); + if let (Some(buy_now), Some(min)) = (buy_now_price, min_bid) { + if min >= buy_now { + return Err(ContractError::InvalidMinBid { + msg: Some("buy_now_price must be greater than the min_bid".to_string()), + }); + } + } + if let Some(ref whitelist) = whitelist { ADOContract::default() .permission_action(token_auction_state.auction_id.to_string(), deps.storage)?; @@ -440,6 +451,7 @@ fn execute_update_auction( token_auction_state.uses_cw20 = uses_cw20; token_auction_state.min_bid = min_bid; token_auction_state.min_raise = min_raise; + token_auction_state.buy_now_price = buy_now_price; token_auction_state.whitelist = whitelist; token_auction_state.recipient = recipient; TOKEN_AUCTION_STATE.save( @@ -457,6 +469,7 @@ fn execute_update_auction( attr("whitelist", format!("{:?}", whitelist_str)), attr("min_bid", format!("{:?}", &min_bid)), attr("min_raise", format!("{:?}", &min_raise)), + attr("buy_now_price", format!("{:?}", &buy_now_price)), ])) } diff --git a/contracts/non-fungible-tokens/andromeda-auction/src/mock.rs b/contracts/non-fungible-tokens/andromeda-auction/src/mock.rs index 7918807ec..cb2368190 100644 --- a/contracts/non-fungible-tokens/andromeda-auction/src/mock.rs +++ b/contracts/non-fungible-tokens/andromeda-auction/src/mock.rs @@ -225,6 +225,7 @@ pub fn mock_update_auction( coin_denom: Asset, min_bid: Option, min_raise: Option, + buy_now_price: Option, whitelist: Option>, recipient: Option, ) -> ExecuteMsg { @@ -237,6 +238,7 @@ pub fn mock_update_auction( whitelist, min_bid, min_raise, + buy_now_price, recipient, } } diff --git a/contracts/non-fungible-tokens/andromeda-auction/src/testing/tests.rs b/contracts/non-fungible-tokens/andromeda-auction/src/testing/tests.rs index c09994ff6..ec4f11d21 100644 --- a/contracts/non-fungible-tokens/andromeda-auction/src/testing/tests.rs +++ b/contracts/non-fungible-tokens/andromeda-auction/src/testing/tests.rs @@ -977,6 +977,7 @@ fn execute_update_auction_zero_start() { whitelist: None, min_bid: None, min_raise: None, + buy_now_price: None, recipient: None, }; let mut env = mock_env(); @@ -1010,6 +1011,7 @@ fn execute_update_auction_zero_duration() { whitelist: None, min_bid: None, min_raise: None, + buy_now_price: None, recipient: None, }; let mut env = mock_env(); @@ -1037,6 +1039,7 @@ fn execute_update_auction_unauthorized() { whitelist: Some(vec![Addr::unchecked("user")]), min_bid: None, min_raise: None, + buy_now_price: None, recipient: None, }; let env = mock_env(); @@ -1062,6 +1065,7 @@ fn execute_update_auction_auction_started() { whitelist: Some(vec![Addr::unchecked("user")]), min_bid: None, min_raise: None, + buy_now_price: None, recipient: None, }; let mut env = mock_env(); @@ -1089,6 +1093,7 @@ fn execute_update_auction() { whitelist: Some(vec![Addr::unchecked("user")]), min_bid: None, min_raise: None, + buy_now_price: Some(Uint128::from(100u128)), recipient: None, }; let mut env = mock_env(); @@ -1104,7 +1109,7 @@ fn execute_update_auction() { high_bidder_addr: Addr::unchecked(""), high_bidder_amount: Uint128::zero(), coin_denom: "uusd".to_string(), - buy_now_price: None, + buy_now_price: Some(Uint128::from(100u128)), uses_cw20: false, auction_id: 1u128.into(), owner: MOCK_TOKEN_OWNER.to_string(), diff --git a/packages/andromeda-non-fungible-tokens/src/auction.rs b/packages/andromeda-non-fungible-tokens/src/auction.rs index 5e8b800c5..40dcad458 100644 --- a/packages/andromeda-non-fungible-tokens/src/auction.rs +++ b/packages/andromeda-non-fungible-tokens/src/auction.rs @@ -47,6 +47,7 @@ pub enum ExecuteMsg { whitelist: Option>, min_bid: Option, min_raise: Option, + buy_now_price: Option, recipient: Option, }, CancelAuction { diff --git a/tests-integration/tests/auction_app.rs b/tests-integration/tests/auction_app.rs index 1e5d47345..75dc38318 100644 --- a/tests-integration/tests/auction_app.rs +++ b/tests-integration/tests/auction_app.rs @@ -815,6 +815,7 @@ fn test_auction_app_cw20_restricted() { Asset::Cw20Token(AndrAddr::from_string(second_cw20.addr().to_string())), None, None, + None, Some(vec![buyer_one.clone(), buyer_two.clone()]), Some(Recipient::from_string(buyer_one)), ); From 3e5fefa40bf4b235bbb31f4a3098a34c66f2faa0 Mon Sep 17 00:00:00 2001 From: Joe Monem <66594578+joemonem@users.noreply.github.com> Date: Tue, 24 Dec 2024 10:54:05 +0200 Subject: [PATCH 10/21] feat: Allow Flat Rate to be a VFS Path (#727) --- CHANGELOG.md | 1 + Cargo.lock | 4 +- contracts/modules/andromeda-rates/Cargo.toml | 2 +- .../modules/andromeda-rates/src/contract.rs | 5 ++- .../andromeda-rates/src/testing/tests.rs | 2 +- packages/std/Cargo.toml | 2 +- packages/std/src/ado_base/rates.rs | 40 +++++++++++++------ packages/std/src/ado_contract/rates.rs | 3 +- tests-integration/tests/marketplace_app.rs | 4 +- 9 files changed, 39 insertions(+), 24 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index f2ea6232e..913cb15c8 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -17,6 +17,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 - Rates: Handle cross-chain recipients [(#671)](https://github.com/andromedaprotocol/andromeda-core/pull/671) - Permissions: Permissioned Actors in AndromedaQuery [(#717)](https://github.com/andromedaprotocol/andromeda-core/pull/717) - Added Schema and Form ADOs [(#591)](https://github.com/andromedaprotocol/andromeda-core/pull/591) +- Flat Rate denom can be a VFS path [(#727)](https://github.com/andromedaprotocol/andromeda-core/pull/727) - Auction ADO: Added buy_now_price option in Update Auction [(#730)](https://github.com/andromedaprotocol/andromeda-core/pull/730) ### Changed diff --git a/Cargo.lock b/Cargo.lock index dbc69f60f..f1046f129 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -793,7 +793,7 @@ dependencies = [ [[package]] name = "andromeda-rates" -version = "2.0.3" +version = "2.0.4-b.1" dependencies = [ "andromeda-app", "andromeda-modules", @@ -882,7 +882,7 @@ dependencies = [ [[package]] name = "andromeda-std" -version = "1.5.0-b.2" +version = "1.5.0-b.3" dependencies = [ "andromeda-macros", "cosmwasm-schema", diff --git a/contracts/modules/andromeda-rates/Cargo.toml b/contracts/modules/andromeda-rates/Cargo.toml index 0a2fa3e93..b302bda11 100644 --- a/contracts/modules/andromeda-rates/Cargo.toml +++ b/contracts/modules/andromeda-rates/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "andromeda-rates" -version = "2.0.3" +version = "2.0.4-b.1" edition = "2021" rust-version = "1.75.0" diff --git a/contracts/modules/andromeda-rates/src/contract.rs b/contracts/modules/andromeda-rates/src/contract.rs index c59b4aaac..758712745 100644 --- a/contracts/modules/andromeda-rates/src/contract.rs +++ b/contracts/modules/andromeda-rates/src/contract.rs @@ -32,8 +32,6 @@ pub fn instantiate( let action = msg.action; let rate = msg.rate; - RATES.save(deps.storage, &action, &rate)?; - let inst_resp = ADOContract::default().instantiate( deps.storage, env, @@ -48,6 +46,9 @@ pub fn instantiate( }, )?; + let local_rate = rate.validate(deps.as_ref())?; + RATES.save(deps.storage, &action, &local_rate)?; + Ok(inst_resp) } diff --git a/contracts/modules/andromeda-rates/src/testing/tests.rs b/contracts/modules/andromeda-rates/src/testing/tests.rs index 4e7928573..cb3b6b4a0 100644 --- a/contracts/modules/andromeda-rates/src/testing/tests.rs +++ b/contracts/modules/andromeda-rates/src/testing/tests.rs @@ -32,7 +32,7 @@ fn test_instantiate_query() { msg: None, ibc_recovery_address: None, }, - value: LocalRateValue::Flat(coin(100_u128, "uandr")), + value: LocalRateValue::Flat(coin(100_u128, MOCK_UANDR)), description: None, }; let msg = InstantiateMsg { diff --git a/packages/std/Cargo.toml b/packages/std/Cargo.toml index 1f834820c..4a59029f8 100644 --- a/packages/std/Cargo.toml +++ b/packages/std/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "andromeda-std" -version = "1.5.0-b.2" +version = "1.5.0-b.3" edition = "2021" rust-version = "1.75.0" description = "The standard library for creating an Andromeda Digital Object" diff --git a/packages/std/src/ado_base/rates.rs b/packages/std/src/ado_base/rates.rs index fb820fdaf..fdee28618 100644 --- a/packages/std/src/ado_base/rates.rs +++ b/packages/std/src/ado_base/rates.rs @@ -97,15 +97,15 @@ impl LocalRateValue { LocalRateValue::Percent(_) => Ok(false), } } - pub fn validate(&self, deps: Deps) -> Result<(), ContractError> { + pub fn validate(&self, deps: Deps) -> Result { match self { // If it's a coin, make sure it's non-zero LocalRateValue::Flat(coin) => { ensure!(!coin.amount.is_zero(), ContractError::InvalidRate {}); // Extract denom - let denom = coin.denom.clone(); - // Check if it's a valid address - let is_valid_address = deps.api.addr_validate(denom.as_str()); + let denom_andr_addr = AndrAddr::from_string(&coin.denom); + + let is_valid_address = denom_andr_addr.get_raw_address(&deps); match is_valid_address { // Verify as CW20 Ok(cw20_address) => { @@ -118,9 +118,18 @@ impl LocalRateValue { !token_info_query.total_supply.is_zero(), ContractError::InvalidZeroAmount {} ); + // Return the resolved address since it could've originally been an AndrAddr + Ok(LocalRateValue::Flat(Coin { + denom: cw20_address.into_string(), + amount: coin.amount, + })) } + // Verify as Native Asset - Err(_) => validate_native_denom(deps, denom)?, + Err(_) => { + validate_native_denom(deps, coin.denom.clone())?; + Ok(self.clone()) + } } } // If it's a percentage, make sure it's greater than zero and less than or equal to 1 of type decimal (which represents 100%) @@ -129,9 +138,9 @@ impl LocalRateValue { !percent_rate.percent.is_zero() && percent_rate.percent <= Decimal::one(), ContractError::InvalidRate {} ); + Ok(self.clone()) } } - Ok(()) } pub fn is_flat(&self) -> bool { match self { @@ -149,15 +158,20 @@ pub struct LocalRate { pub description: Option, } impl LocalRate { - pub fn validate(&self, deps: Deps) -> Result<(), ContractError> { + pub fn validate(&self, deps: Deps) -> Result { if self.recipient.is_cross_chain() { ensure!( !self.value.is_valid_address(deps)?, ContractError::InvalidCw20CrossChainRate {} ); } - self.value.validate(deps)?; - Ok(()) + let local_rate_value = self.value.validate(deps)?; + Ok(LocalRate { + rate_type: self.rate_type.clone(), + recipient: self.recipient.clone(), + value: local_rate_value, + description: self.description.clone(), + }) } } // Created this because of the very complex return value warning. @@ -250,7 +264,7 @@ pub enum Rate { impl Rate { // Makes sure that the contract address is that of a Rates contract verified by the ADODB and validates the local rate value - pub fn validate_rate(&self, deps: Deps) -> Result<(), ContractError> { + pub fn validate_rate(&self, deps: Deps) -> Result { match self { Rate::Contract(address) => { let raw_address = address.get_raw_address(&deps)?; @@ -266,14 +280,14 @@ impl Rate { Some(ado_type) => { let ado_type = ADOVersion::from_string(ado_type).get_type(); ensure!(ado_type == "rates", ContractError::InvalidAddress {}); - Ok(()) + Ok(self.clone()) } None => Err(ContractError::InvalidAddress {}), } } Rate::Local(local_rate) => { - local_rate.validate(deps)?; - Ok(()) + let new_local_rate = local_rate.validate(deps)?; + Ok(Rate::Local(new_local_rate)) } } } diff --git a/packages/std/src/ado_contract/rates.rs b/packages/std/src/ado_contract/rates.rs index ddc54bab6..6d4b36f8b 100644 --- a/packages/std/src/ado_contract/rates.rs +++ b/packages/std/src/ado_contract/rates.rs @@ -46,8 +46,7 @@ impl ADOContract<'_> { ); let action: String = action.into(); // Validate rates - rate.validate_rate(ctx.deps.as_ref())?; - + let rate = rate.validate_rate(ctx.deps.as_ref())?; self.set_rates(ctx.deps.storage, action, rate)?; Ok(Response::default().add_attributes(vec![("action", "set_rates")])) diff --git a/tests-integration/tests/marketplace_app.rs b/tests-integration/tests/marketplace_app.rs index da35fb728..90aad5cf5 100644 --- a/tests-integration/tests/marketplace_app.rs +++ b/tests-integration/tests/marketplace_app.rs @@ -564,13 +564,13 @@ fn test_marketplace_app_cw20_restricted() { app.query_ado_by_component_name(&router, marketplace_component.name); let address_list: MockAddressList = app.query_ado_by_component_name(&router, address_list_component.name); - let cw20: MockCW20 = app.query_ado_by_component_name(&router, cw20_component.name); + let cw20: MockCW20 = app.query_ado_by_component_name(&router, cw20_component.name.clone()); let local_rate = LocalRate { rate_type: LocalRateType::Additive, recipient: Recipient::from_string(rates_receiver.to_string()), // This is the cw20's address - value: LocalRateValue::Flat(coin(100, cw20.addr().to_string())), + value: LocalRateValue::Flat(coin(100, format!("./{}", cw20_component.name))), description: None, }; From b4998a72ac56a110f860afb6cf480084e1fcfa90 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Thu, 2 Jan 2025 15:42:16 +0200 Subject: [PATCH 11/21] build(deps): bump serde from 1.0.216 to 1.0.217 (#743) Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> Co-authored-by: Joe Monem --- Cargo.lock | 8 ++++---- Cargo.toml | 2 +- contracts/finance/andromeda-cross-chain-swap/Cargo.toml | 2 +- contracts/fungible-tokens/andromeda-ics20/Cargo.toml | 2 +- .../fungible-tokens/andromeda-merkle-airdrop/Cargo.toml | 2 +- contracts/os/andromeda-vfs/Cargo.toml | 2 +- packages/andromeda-data-storage/Cargo.toml | 2 +- packages/andromeda-finance/Cargo.toml | 2 +- packages/andromeda-fungible-tokens/Cargo.toml | 2 +- packages/andromeda-modules/Cargo.toml | 2 +- packages/andromeda-non-fungible-tokens/Cargo.toml | 2 +- packages/deploy/Cargo.toml | 2 +- packages/std/Cargo.toml | 2 +- 13 files changed, 16 insertions(+), 16 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index f1046f129..da438d09f 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -4482,9 +4482,9 @@ checksum = "3cb6eb87a131f756572d7fb904f6e7b68633f09cca868c5df1c4b8d1a694bbba" [[package]] name = "serde" -version = "1.0.216" +version = "1.0.217" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0b9781016e935a97e8beecf0c933758c97a5520d32930e460142b4cd80c6338e" +checksum = "02fc4265df13d6fa1d00ecff087228cc0a2b5f3c0e87e258d8b94a156e984c70" dependencies = [ "serde_derive", ] @@ -4527,9 +4527,9 @@ dependencies = [ [[package]] name = "serde_derive" -version = "1.0.216" +version = "1.0.217" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "46f859dbbf73865c6627ed570e78961cd3ac92407a2d117204c49232485da55e" +checksum = "5a9bf7cf98d04a2b28aead066b7496853d4779c9cc183c440dbac457641e19a0" dependencies = [ "proc-macro2", "quote", diff --git a/Cargo.toml b/Cargo.toml index 7a88dc9bc..c3cf8c1fd 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -64,7 +64,7 @@ cosmwasm-schema = "1.5.8" semver = "1.0.24" enum-repr = "0.2.6" cw-multi-test = { version = "1.0.0", features = ["cosmwasm_1_2"] } -serde = { version = "1.0.216" } +serde = { version = "1.0.217" } test-case = { version = "3.3.1" } cw-orch = "=0.24.1" jsonschema-valid = { version = "0.5.2"} diff --git a/contracts/finance/andromeda-cross-chain-swap/Cargo.toml b/contracts/finance/andromeda-cross-chain-swap/Cargo.toml index 98cf2416c..abba9522a 100644 --- a/contracts/finance/andromeda-cross-chain-swap/Cargo.toml +++ b/contracts/finance/andromeda-cross-chain-swap/Cargo.toml @@ -21,7 +21,7 @@ cosmwasm-schema = { workspace = true } cw-storage-plus = { workspace = true } cw-utils = { workspace = true } schemars = { version = "0.8.10" } -serde = { version = "1.0.216", default-features = false, features = ["derive"] } +serde = { workspace = true } semver = { workspace = true } andromeda-std = { workspace = true } diff --git a/contracts/fungible-tokens/andromeda-ics20/Cargo.toml b/contracts/fungible-tokens/andromeda-ics20/Cargo.toml index 52c419950..b6c73cc8a 100644 --- a/contracts/fungible-tokens/andromeda-ics20/Cargo.toml +++ b/contracts/fungible-tokens/andromeda-ics20/Cargo.toml @@ -26,7 +26,7 @@ semver = { workspace = true } cw20-base = { workspace = true } cw-controllers = "=1.1.2" schemars = "0.8.21" -serde = "1.0.216" +serde = { workspace = true } thiserror = "2.0.9" andromeda-std = { workspace = true } diff --git a/contracts/fungible-tokens/andromeda-merkle-airdrop/Cargo.toml b/contracts/fungible-tokens/andromeda-merkle-airdrop/Cargo.toml index fdb84bf29..dd14474bc 100644 --- a/contracts/fungible-tokens/andromeda-merkle-airdrop/Cargo.toml +++ b/contracts/fungible-tokens/andromeda-merkle-airdrop/Cargo.toml @@ -24,7 +24,7 @@ cw20 = { workspace = true } cw-asset = { workspace = true } sha2 = "0.10.6" hex = "0.4.3" -serde = "1.0.216" +serde = { workspace = true } andromeda-std = { workspace = true } andromeda-fungible-tokens = { workspace = true } diff --git a/contracts/os/andromeda-vfs/Cargo.toml b/contracts/os/andromeda-vfs/Cargo.toml index 27437eb5c..164c89d60 100644 --- a/contracts/os/andromeda-vfs/Cargo.toml +++ b/contracts/os/andromeda-vfs/Cargo.toml @@ -25,7 +25,7 @@ testing = ["cw-multi-test"] cosmwasm-std = { workspace = true } cosmwasm-schema = { workspace = true } cw-storage-plus = { workspace = true } -serde = { version = "1.0.216", default-features = false, features = ["derive"] } +serde = { workspace = true } andromeda-std = { workspace = true } diff --git a/packages/andromeda-data-storage/Cargo.toml b/packages/andromeda-data-storage/Cargo.toml index 71f3e033c..ebdcfca3b 100644 --- a/packages/andromeda-data-storage/Cargo.toml +++ b/packages/andromeda-data-storage/Cargo.toml @@ -16,7 +16,7 @@ crate-type = ["cdylib", "rlib"] [dependencies] cosmwasm-std = { workspace = true } cosmwasm-schema = { workspace = true } -serde = { version = "1.0.216", default-features = false, features = ["derive"] } +serde = { workspace = true } cw-utils = { workspace = true } andromeda-std = { workspace = true, features = [] } diff --git a/packages/andromeda-finance/Cargo.toml b/packages/andromeda-finance/Cargo.toml index 896ed5d82..0d42e5936 100644 --- a/packages/andromeda-finance/Cargo.toml +++ b/packages/andromeda-finance/Cargo.toml @@ -16,7 +16,7 @@ crate-type = ["cdylib", "rlib"] [dependencies] cosmwasm-std = { workspace = true, features = ["staking"] } cosmwasm-schema = { workspace = true } -serde = { version = "1.0.216", default-features = false, features = ["derive"] } +serde = { workspace = true } cw-utils = { workspace = true } cw721 = { workspace = true } cw721-base = { workspace = true } diff --git a/packages/andromeda-fungible-tokens/Cargo.toml b/packages/andromeda-fungible-tokens/Cargo.toml index c627b0ad4..e55199254 100644 --- a/packages/andromeda-fungible-tokens/Cargo.toml +++ b/packages/andromeda-fungible-tokens/Cargo.toml @@ -16,7 +16,7 @@ crate-type = ["cdylib", "rlib"] [dependencies] cosmwasm-std = { workspace = true } cosmwasm-schema = { workspace = true } -serde = { version = "1.0.216", default-features = false, features = ["derive"] } +serde = { workspace = true } cw-utils = { workspace = true } cw20 = { workspace = true } cw20-base = { workspace = true } diff --git a/packages/andromeda-modules/Cargo.toml b/packages/andromeda-modules/Cargo.toml index ff44ed0cf..9848169a2 100644 --- a/packages/andromeda-modules/Cargo.toml +++ b/packages/andromeda-modules/Cargo.toml @@ -16,7 +16,7 @@ crate-type = ["cdylib", "rlib"] [dependencies] cosmwasm-std = { workspace = true } cosmwasm-schema = { workspace = true } -serde = { version = "1.0.216", default-features = false, features = ["derive"] } +serde = { workspace = true } cw-utils = { workspace = true } cw721 = { workspace = true } cw721-base = { workspace = true } diff --git a/packages/andromeda-non-fungible-tokens/Cargo.toml b/packages/andromeda-non-fungible-tokens/Cargo.toml index 6166a0975..a69705dd6 100644 --- a/packages/andromeda-non-fungible-tokens/Cargo.toml +++ b/packages/andromeda-non-fungible-tokens/Cargo.toml @@ -17,7 +17,7 @@ crate-type = ["cdylib", "rlib"] [dependencies] cosmwasm-std = { workspace = true } cosmwasm-schema = { workspace = true } -serde = { version = "1.0.216", default-features = false, features = ["derive"] } +serde = { workspace = true } cw-utils = { workspace = true } cw721 = { workspace = true } cw721-base = { workspace = true } diff --git a/packages/deploy/Cargo.toml b/packages/deploy/Cargo.toml index ad33e5471..27704dac7 100644 --- a/packages/deploy/Cargo.toml +++ b/packages/deploy/Cargo.toml @@ -14,7 +14,7 @@ cosmwasm-std = { workspace = true, features = ["ibc3", "cosmwasm_1_2"] } cosmwasm-schema = { workspace = true } cw-storage-plus = { workspace = true } schemars = "0.8.10" -serde = { version = "1.0.216", default-features = false, features = ["derive"] } +serde = { workspace = true } semver = { workspace = true } cw20 = { version = "1.0.1" } cw20-base = { workspace = true, features = ["library"] } diff --git a/packages/std/Cargo.toml b/packages/std/Cargo.toml index 4a59029f8..b95565abb 100644 --- a/packages/std/Cargo.toml +++ b/packages/std/Cargo.toml @@ -21,7 +21,7 @@ cosmwasm-std = { workspace = true, features = ["ibc3", "cosmwasm_1_2"] } cosmwasm-schema = { workspace = true } cw-storage-plus = { workspace = true } schemars = "0.8.10" -serde = { version = "1.0.216", default-features = false, features = ["derive"] } +serde = { workspace = true } semver = { workspace = true } cw20 = { version = "1.0.1" } cw20-base = { workspace = true, features = ["library"] } From afccffc622effccb014ee870fc402aabb904d294 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Thu, 2 Jan 2025 15:42:40 +0200 Subject: [PATCH 12/21] build(deps): bump reqwest from 0.12.9 to 0.12.11 (#744) Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- Cargo.lock | 28 ++++++++++++++++++++++------ 1 file changed, 22 insertions(+), 6 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index da438d09f..faa66e102 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -424,7 +424,7 @@ dependencies = [ "lazy_static", "log", "regex", - "reqwest 0.12.9", + "reqwest 0.12.11", "schemars", "semver", "serde", @@ -1201,7 +1201,7 @@ dependencies = [ "rustversion", "serde", "sync_wrapper 0.1.2", - "tower", + "tower 0.4.13", "tower-layer", "tower-service", ] @@ -4132,9 +4132,9 @@ dependencies = [ [[package]] name = "reqwest" -version = "0.12.9" +version = "0.12.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a77c62af46e79de0a562e1a9849205ffcb7fc1238876e9bd743357570e04046f" +checksum = "7fe060fe50f524be480214aba758c71f99f90ee8c83c5a36b5e9e1d568eb4eb3" dependencies = [ "base64 0.22.1", "bytes", @@ -4166,6 +4166,7 @@ dependencies = [ "system-configuration 0.6.1", "tokio", "tokio-native-tls", + "tower 0.5.2", "tower-service", "url", "wasm-bindgen", @@ -5367,7 +5368,7 @@ dependencies = [ "prost 0.11.9", "tokio", "tokio-stream", - "tower", + "tower 0.4.13", "tower-layer", "tower-service", "tracing", @@ -5398,7 +5399,7 @@ dependencies = [ "tokio", "tokio-rustls 0.24.1", "tokio-stream", - "tower", + "tower 0.4.13", "tower-layer", "tower-service", "tracing", @@ -5424,6 +5425,21 @@ dependencies = [ "tracing", ] +[[package]] +name = "tower" +version = "0.5.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d039ad9159c98b70ecfd540b2573b97f7f52c3e8d9f8ad57a24b916a536975f9" +dependencies = [ + "futures-core", + "futures-util", + "pin-project-lite", + "sync_wrapper 1.0.2", + "tokio", + "tower-layer", + "tower-service", +] + [[package]] name = "tower-layer" version = "0.3.3" From f3ec59d51d816ef575ec99d6df7c9f1aaed22552 Mon Sep 17 00:00:00 2001 From: Connor Barr Date: Thu, 2 Jan 2025 13:55:17 +0000 Subject: [PATCH 13/21] feat: kernel environment variables (#738) Co-authored-by: coderabbitai[bot] <136622811+coderabbitai[bot]@users.noreply.github.com> --- CHANGELOG.md | 1 + Cargo.lock | 3 +- Cargo.toml | 3 +- .../src/contract.rs | 10 +- contracts/os/andromeda-kernel/Cargo.toml | 3 +- contracts/os/andromeda-kernel/src/contract.rs | 4 +- contracts/os/andromeda-kernel/src/execute.rs | 173 +++++++++++++----- contracts/os/andromeda-kernel/src/query.rs | 11 +- contracts/os/andromeda-kernel/src/state.rs | 2 +- .../os/andromeda-kernel/src/testing/tests.rs | 122 +++++++++++- contracts/os/andromeda-vfs/src/execute.rs | 6 +- ibc-tests/Cargo.toml | 3 +- packages/std/src/error.rs | 6 + packages/std/src/os/aos_querier.rs | 10 + packages/std/src/os/kernel.rs | 19 ++ packages/std/src/testing/mock_querier.rs | 16 ++ tests-integration/Cargo.toml | 2 +- 17 files changed, 336 insertions(+), 58 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 913cb15c8..5a2ecc540 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -17,6 +17,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 - Rates: Handle cross-chain recipients [(#671)](https://github.com/andromedaprotocol/andromeda-core/pull/671) - Permissions: Permissioned Actors in AndromedaQuery [(#717)](https://github.com/andromedaprotocol/andromeda-core/pull/717) - Added Schema and Form ADOs [(#591)](https://github.com/andromedaprotocol/andromeda-core/pull/591) +- feat: kernel environment variables [#738](https://github.com/andromedaprotocol/andromeda-core/pull/738) - Flat Rate denom can be a VFS path [(#727)](https://github.com/andromedaprotocol/andromeda-core/pull/727) - Auction ADO: Added buy_now_price option in Update Auction [(#730)](https://github.com/andromedaprotocol/andromeda-core/pull/730) diff --git a/Cargo.lock b/Cargo.lock index faa66e102..ba65e03c4 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -605,7 +605,7 @@ dependencies = [ [[package]] name = "andromeda-kernel" -version = "1.2.0-b.1" +version = "1.2.0-b.2" dependencies = [ "andromeda-std", "cosmwasm-schema", @@ -618,6 +618,7 @@ dependencies = [ "osmosis-std", "osmosis-std-derive 0.15.3", "prost 0.11.9", + "rstest", "schemars", "serde", "serde-json-wasm 1.0.1", diff --git a/Cargo.toml b/Cargo.toml index c3cf8c1fd..bfd9175a9 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -67,5 +67,6 @@ cw-multi-test = { version = "1.0.0", features = ["cosmwasm_1_2"] } serde = { version = "1.0.217" } test-case = { version = "3.3.1" } cw-orch = "=0.24.1" -jsonschema-valid = { version = "0.5.2"} +jsonschema-valid = { version = "0.5.2" } serde_json = { version = "1.0.134" } +rstest = "0.23.0" diff --git a/contracts/finance/andromeda-validator-staking/src/contract.rs b/contracts/finance/andromeda-validator-staking/src/contract.rs index 02fc878db..572bde9e0 100644 --- a/contracts/finance/andromeda-validator-staking/src/contract.rs +++ b/contracts/finance/andromeda-validator-staking/src/contract.rs @@ -325,9 +325,15 @@ fn execute_claim( ); let kernel_addr = ADOContract::default().get_kernel_address(deps.storage)?; - let curr_chain = AOSQuerier::get_current_chain(&deps.querier, &kernel_addr)?; - let withdraw_msg: CosmosMsg = if curr_chain == "andromeda" { + let is_andromeda_distribution = AOSQuerier::get_env_variable::( + &deps.querier, + &kernel_addr, + "andromeda_distribution", + )? + .unwrap_or(false); + + let withdraw_msg: CosmosMsg = if is_andromeda_distribution { MsgWithdrawDelegatorReward { delegator_address: delegator.to_string(), validator_address: validator.to_string(), diff --git a/contracts/os/andromeda-kernel/Cargo.toml b/contracts/os/andromeda-kernel/Cargo.toml index 651933c6d..5d0662234 100644 --- a/contracts/os/andromeda-kernel/Cargo.toml +++ b/contracts/os/andromeda-kernel/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "andromeda-kernel" -version = "1.2.0-b.1" +version = "1.2.0-b.2" authors = ["Connor Barr "] edition = "2021" rust-version = "1.65.0" @@ -47,3 +47,4 @@ cw-orch = { workspace = true } [dev-dependencies] # andromeda-testing = { workspace = true, optional = true } +rstest = { workspace = true } diff --git a/contracts/os/andromeda-kernel/src/contract.rs b/contracts/os/andromeda-kernel/src/contract.rs index 7846a8034..a8db17cbb 100644 --- a/contracts/os/andromeda-kernel/src/contract.rs +++ b/contracts/os/andromeda-kernel/src/contract.rs @@ -127,8 +127,9 @@ pub fn execute( ExecuteMsg::UpdateChainName { chain_name } => { execute::update_chain_name(execute_env, chain_name) } + ExecuteMsg::SetEnv { variable, value } => execute::set_env(execute_env, variable, value), + ExecuteMsg::UnsetEnv { variable } => execute::unset_env(execute_env, variable), ExecuteMsg::Internal(msg) => execute::internal(execute_env, msg), - // Base message ExecuteMsg::Ownership(ownership_message) => ADOContract::default().execute_ownership( execute_env.deps, execute_env.env, @@ -175,5 +176,6 @@ pub fn query(deps: Deps, _env: Env, msg: QueryMsg) -> Result { encode_binary(&query::chain_name_by_channel(deps, channel)?) } + QueryMsg::GetEnv { variable } => encode_binary(&query::get_env(deps, variable)?), } } diff --git a/contracts/os/andromeda-kernel/src/execute.rs b/contracts/os/andromeda-kernel/src/execute.rs index 586ce4f8e..892c8ca8d 100644 --- a/contracts/os/andromeda-kernel/src/execute.rs +++ b/contracts/os/andromeda-kernel/src/execute.rs @@ -20,7 +20,7 @@ use cosmwasm_std::{ use crate::query; use crate::state::{ ADO_OWNER, CHAIN_TO_CHANNEL, CHANNEL_TO_CHAIN, CHANNEL_TO_EXECUTE_MSG, CURR_CHAIN, - IBC_FUND_RECOVERY, KERNEL_ADDRESSES, PENDING_MSG_AND_FUNDS, TRIGGER_KEY, + ENV_VARIABLES, IBC_FUND_RECOVERY, KERNEL_ADDRESSES, PENDING_MSG_AND_FUNDS, TRIGGER_KEY, }; pub fn send(ctx: ExecuteContext, message: AMPMsg) -> Result { @@ -256,42 +256,49 @@ pub fn create( chain.is_none() || owner.is_some(), ContractError::Unauthorized {} ); - if let Some(_chain) = chain { - Err(ContractError::CrossChainComponentsCurrentlyDisabled {}) - // let channel_info = if let Some(channel_info) = - // CHAIN_TO_CHANNEL.may_load(execute_ctx.deps.storage, &chain)? - // { - // Ok::(channel_info) - // } else { - // return Err(ContractError::InvalidPacket { - // error: Some(format!("Channel not found for chain {chain}")), - // }); - // }?; - // let kernel_msg = IbcExecuteMsg::CreateADO { - // instantiation_msg: msg.clone(), - // owner: owner.clone().unwrap(), - // ado_type: ado_type.clone(), - // }; - // let ibc_msg = IbcMsg::SendPacket { - // channel_id: channel_info.direct_channel_id.clone().unwrap(), - // data: to_json_binary(&kernel_msg)?, - // timeout: execute_ctx - // .env - // .block - // .time - // .plus_seconds(PACKET_LIFETIME) - // .into(), - // }; - // Ok(Response::default() - // .add_message(ibc_msg) - // .add_attributes(vec![ - // attr("action", "execute_create"), - // attr("ado_type", ado_type), - // attr("owner", owner.unwrap().to_string()), - // attr("chain", chain), - // attr("receiving_kernel_address", channel_info.kernel_address), - // attr("msg", msg.to_string()), - // ])) + if let Some(chain) = chain { + let cross_chain_components_enabled = ENV_VARIABLES + .may_load(execute_ctx.deps.storage, "cross_chain_components_enabled")? + .unwrap_or("false".to_string()); + ensure!( + cross_chain_components_enabled == "true", + ContractError::CrossChainComponentsCurrentlyDisabled {} + ); + + let channel_info = if let Some(channel_info) = + CHAIN_TO_CHANNEL.may_load(execute_ctx.deps.storage, &chain)? + { + Ok::(channel_info) + } else { + return Err(ContractError::InvalidPacket { + error: Some(format!("Channel not found for chain {chain}")), + }); + }?; + let kernel_msg = IbcExecuteMsg::CreateADO { + instantiation_msg: msg.clone(), + owner: owner.clone().unwrap(), + ado_type: ado_type.clone(), + }; + let ibc_msg = IbcMsg::SendPacket { + channel_id: channel_info.direct_channel_id.clone().unwrap(), + data: to_json_binary(&kernel_msg)?, + timeout: execute_ctx + .env + .block + .time + .plus_seconds(PACKET_LIFETIME) + .into(), + }; + Ok(Response::default() + .add_message(ibc_msg) + .add_attributes(vec![ + attr("action", "execute_create"), + attr("ado_type", ado_type), + attr("owner", owner.unwrap().to_string()), + attr("chain", chain), + attr("receiving_kernel_address", channel_info.kernel_address), + attr("msg", msg.to_string()), + ])) } else { let vfs_addr = KERNEL_ADDRESSES.load(execute_ctx.deps.storage, VFS_KEY)?; let adodb_addr = KERNEL_ADDRESSES.load(execute_ctx.deps.storage, ADO_DB_KEY)?; @@ -473,6 +480,86 @@ pub fn update_chain_name( .add_attribute("chain_name", chain_name)) } +pub fn set_env( + execute_ctx: ExecuteContext, + variable: String, + value: String, +) -> Result { + let contract = ADOContract::default(); + ensure!( + contract.is_contract_owner(execute_ctx.deps.storage, execute_ctx.info.sender.as_str())?, + ContractError::Unauthorized {} + ); + + ensure!( + !variable.is_empty(), + ContractError::InvalidEnvironmentVariable { + msg: "Environment variable name cannot be empty".to_string() + } + ); + + ensure!( + variable + .chars() + .all(|c| c.is_ascii_alphanumeric() || c == '_'), + ContractError::InvalidEnvironmentVariable { + msg: + "Environment variable name can only contain alphanumeric characters and underscores" + .to_string() + } + ); + + ensure!( + variable.len() <= 100, + ContractError::InvalidEnvironmentVariable { + msg: "Environment variable name length exceeds the maximum allowed length of 100 characters".to_string() + } + ); + + ensure!( + !value.is_empty(), + ContractError::InvalidEnvironmentVariable { + msg: "Environment variable value cannot be empty".to_string() + } + ); + + ensure!( + value.len() <= 100, + ContractError::InvalidEnvironmentVariable { + msg: "Environment variable value length exceeds the maximum allowed length of 100 characters".to_string() + } + ); + + ENV_VARIABLES.save( + execute_ctx.deps.storage, + &variable.to_ascii_uppercase(), + &value, + )?; + Ok(Response::default() + .add_attribute("action", "set_env") + .add_attribute("variable", variable) + .add_attribute("value", value)) +} + +pub fn unset_env(execute_ctx: ExecuteContext, variable: String) -> Result { + let contract = ADOContract::default(); + ensure!( + contract.is_contract_owner(execute_ctx.deps.storage, execute_ctx.info.sender.as_str())?, + ContractError::Unauthorized {} + ); + + ensure!( + ENV_VARIABLES + .may_load(execute_ctx.deps.storage, &variable.to_ascii_uppercase())? + .is_some(), + ContractError::EnvironmentVariableNotFound { variable } + ); + ENV_VARIABLES.remove(execute_ctx.deps.storage, &variable.to_ascii_uppercase()); + Ok(Response::default() + .add_attribute("action", "unset_env") + .add_attribute("variable", variable)) +} + /// Handles a given AMP message and returns a response /// /// Separated due to common functionality across multiple messages @@ -547,9 +634,9 @@ impl MsgHandler { } = original_msg; let recipient_addr = recipient.get_raw_address(&deps.as_ref())?; - + let adodb_addr = KERNEL_ADDRESSES.load(deps.storage, ADO_DB_KEY)?; - + if Binary::default() == message.clone() { ensure!( !funds.is_empty(), @@ -557,18 +644,18 @@ impl MsgHandler { error: Some("No message or funds supplied".to_string()) } ); - + let sub_msg = BankMsg::Send { to_address: recipient_addr.to_string(), amount: funds.clone(), }; - + let mut attrs = vec![]; for (idx, fund) in funds.iter().enumerate() { attrs.push(attr(format!("funds:{sequence}:{idx}"), fund.to_string())); } attrs.push(attr(format!("recipient:{sequence}"), recipient_addr)); - + res = res .add_submessage(SubMsg::reply_on_error( CosmosMsg::Bank(sub_msg), @@ -613,7 +700,7 @@ impl MsgHandler { ReplyId::AMPMsg.repr(), )? }; - + res = res .add_submessage(sub_msg) .add_attributes(vec![attr(format!("recipient:{sequence}"), recipient_addr)]); diff --git a/contracts/os/andromeda-kernel/src/query.rs b/contracts/os/andromeda-kernel/src/query.rs index 18cab3472..683a4e2aa 100644 --- a/contracts/os/andromeda-kernel/src/query.rs +++ b/contracts/os/andromeda-kernel/src/query.rs @@ -3,13 +3,14 @@ use andromeda_std::{ error::ContractError, os::{ aos_querier::AOSQuerier, - kernel::{ChainNameResponse, ChannelInfoResponse, VerifyAddressResponse}, + kernel::{ChainNameResponse, ChannelInfoResponse, EnvResponse, VerifyAddressResponse}, }, }; use cosmwasm_std::{Addr, Coin, Deps}; use crate::state::{ - CHAIN_TO_CHANNEL, CHANNEL_TO_CHAIN, CURR_CHAIN, IBC_FUND_RECOVERY, KERNEL_ADDRESSES, + CHAIN_TO_CHANNEL, CHANNEL_TO_CHAIN, CURR_CHAIN, ENV_VARIABLES, IBC_FUND_RECOVERY, + KERNEL_ADDRESSES, }; pub fn key_address(deps: Deps, key: String) -> Result { @@ -68,3 +69,9 @@ pub fn chain_name(deps: Deps) -> Result { chain_name: CURR_CHAIN.may_load(deps.storage)?.unwrap_or_default(), }) } + +pub fn get_env(deps: Deps, variable: String) -> Result { + Ok(EnvResponse { + value: ENV_VARIABLES.may_load(deps.storage, &variable.to_ascii_uppercase())?, + }) +} diff --git a/contracts/os/andromeda-kernel/src/state.rs b/contracts/os/andromeda-kernel/src/state.rs index 80cb58164..e3f4c80b8 100644 --- a/contracts/os/andromeda-kernel/src/state.rs +++ b/contracts/os/andromeda-kernel/src/state.rs @@ -19,7 +19,7 @@ pub struct OutgoingPacket { } pub const KERNEL_ADDRESSES: Map<&str, Addr> = Map::new("kernel_addresses"); -pub const _ENV_VARIABLES: Map<&str, String> = Map::new("kernel_env_variables"); +pub const ENV_VARIABLES: Map<&str, String> = Map::new("kernel_env_variables"); pub const CURR_CHAIN: Item = Item::new("kernel_curr_chain"); //Temporary storage for creating a new ADO to assign a new owner diff --git a/contracts/os/andromeda-kernel/src/testing/tests.rs b/contracts/os/andromeda-kernel/src/testing/tests.rs index fdeda9a6e..af356b016 100644 --- a/contracts/os/andromeda-kernel/src/testing/tests.rs +++ b/contracts/os/andromeda-kernel/src/testing/tests.rs @@ -1,7 +1,9 @@ use crate::{ contract::{execute, instantiate}, ibc::PACKET_LIFETIME, - state::{ADO_OWNER, CHAIN_TO_CHANNEL, CHANNEL_TO_CHAIN, CURR_CHAIN, KERNEL_ADDRESSES}, + state::{ + ADO_OWNER, CHAIN_TO_CHANNEL, CHANNEL_TO_CHAIN, CURR_CHAIN, ENV_VARIABLES, KERNEL_ADDRESSES, + }, }; use andromeda_std::{ amp::{ @@ -19,6 +21,7 @@ use cosmwasm_std::{ testing::{mock_dependencies, mock_env, mock_info}, to_json_binary, Addr, Binary, CosmosMsg, IbcMsg, }; +use rstest::rstest; #[test] fn proper_initialization() { @@ -390,3 +393,120 @@ fn test_handle_ibc_direct() { // * message fails even though it is a non-default binary message assert!(res.is_ok()); } + +const CREATOR: &str = "creator"; +const REALLY_LONG_VALUE: &str = "reallyreallyreallyreallyreallyreallyreallyreallyreallyreallyreallyreallyreallyreallyreallyreallyreallyreallyreallyreallyreallyreallyreallyreallyreallyreallyreallyreallyreallyreallyreallylongvalue"; + +fn invalid_env_variable(msg: &str) -> ContractError { + ContractError::InvalidEnvironmentVariable { + msg: msg.to_string(), + } +} + +#[rstest] +#[case::valid("test_var", Some("test_value"), CREATOR, None, None)] +#[case::not_found("test_var", None, CREATOR, None, Some(ContractError::EnvironmentVariableNotFound { variable: "test_var".to_string() }))] +#[case::unauthorized("test_var", Some("test_value"), "attacker", Some(ContractError::Unauthorized {}), None)] +#[case::long_value( + "test_var", + Some(REALLY_LONG_VALUE), + CREATOR, + Some(invalid_env_variable( + "Environment variable value length exceeds the maximum allowed length of 100 characters" + )), + None +)] +#[case::long_name( + REALLY_LONG_VALUE, + Some("test_val"), + CREATOR, + Some(invalid_env_variable( + "Environment variable name length exceeds the maximum allowed length of 100 characters" + )), + None +)] +#[case::empty_name( + "", + Some("test_value"), + CREATOR, + Some(invalid_env_variable("Environment variable name cannot be empty")), + None +)] +#[case::empty_value( + "test_var", + Some(""), + CREATOR, + Some(invalid_env_variable("Environment variable value cannot be empty")), + None +)] +#[case::nonalphanumeric( + "test-var", + Some("test_value"), + CREATOR, + Some(invalid_env_variable( + "Environment variable name can only contain alphanumeric characters and underscores" + )), + None +)] +fn test_set_unset_env( + #[case] variable: &str, + #[case] value: Option<&str>, + #[case] sender: &str, + #[case] expected_set_error: Option, + #[case] expected_unset_error: Option, +) { + let mut deps = mock_dependencies_custom(&[]); + let info = mock_info(CREATOR, &[]); + let env = mock_env(); + instantiate( + deps.as_mut(), + env.clone(), + info.clone(), + InstantiateMsg { + owner: None, + chain_name: "test".to_string(), + }, + ) + .unwrap(); + + let send_info = mock_info(sender, &[]); + + if let Some(value) = value { + // Set environment variable + let set_env_msg = ExecuteMsg::SetEnv { + variable: variable.to_string(), + value: value.to_string(), + }; + let res = execute(deps.as_mut(), env.clone(), send_info.clone(), set_env_msg); + if let Some(expected_error) = expected_set_error { + assert_eq!(res.unwrap_err(), expected_error); + return; + } else { + assert_eq!(res.unwrap().attributes[0].value, "set_env"); + } + + // Check if the variable is set + let stored_value = ENV_VARIABLES + .load(&deps.storage, &variable.to_ascii_uppercase()) + .unwrap(); + assert_eq!(stored_value, value); + } + + // Unset environment variable + let unset_env_msg = ExecuteMsg::UnsetEnv { + variable: variable.to_string(), + }; + let res = execute(deps.as_mut(), env, send_info, unset_env_msg); + if let Some(expected_error) = expected_unset_error { + assert_eq!(res.unwrap_err(), expected_error); + return; + } else { + assert_eq!(res.unwrap().attributes[0].value, "unset_env"); + } + + // Check if the variable is unset + let stored_value = ENV_VARIABLES + .may_load(&deps.storage, &variable.to_ascii_uppercase()) + .unwrap(); + assert!(stored_value.is_none()); +} diff --git a/contracts/os/andromeda-vfs/src/execute.rs b/contracts/os/andromeda-vfs/src/execute.rs index 508a4d1fe..93feb9c30 100644 --- a/contracts/os/andromeda-vfs/src/execute.rs +++ b/contracts/os/andromeda-vfs/src/execute.rs @@ -167,10 +167,12 @@ pub fn register_user( ); let username = username.to_lowercase(); let kernel = &ADOContract::default().get_kernel_address(env.deps.storage)?; - let curr_chain = AOSQuerier::get_current_chain(&env.deps.querier, kernel)?; + let is_registration_enabled = + AOSQuerier::get_env_variable::(&env.deps.querier, kernel, "username_registration")? + .unwrap_or(false); // Can only register username directly on Andromeda chain ensure!( - curr_chain == "andromeda" || env.info.sender == kernel, + is_registration_enabled || env.info.sender == kernel, ContractError::Unauthorized {} ); // If address is provided sender must be Kernel diff --git a/ibc-tests/Cargo.toml b/ibc-tests/Cargo.toml index 536df46eb..e8f5336f6 100644 --- a/ibc-tests/Cargo.toml +++ b/ibc-tests/Cargo.toml @@ -16,7 +16,7 @@ serde.workspace = true tokio = "1.42.0" cw-orch = { workspace = true } cw-orch-daemon = "0.24.2" -rstest = "0.23.0" +rstest = { workspace = true } andromeda-testing-e2e = { workspace = true } @@ -52,4 +52,3 @@ andromeda-non-fungible-tokens = { workspace = true } cosmwasm-std = { workspace = true, features = ["staking"] } cw20.workspace = true cw721.workspace = true - diff --git a/packages/std/src/error.rs b/packages/std/src/error.rs index c76346399..4982c4d63 100644 --- a/packages/std/src/error.rs +++ b/packages/std/src/error.rs @@ -752,6 +752,12 @@ pub enum ContractError { #[error("Invalid tier for {operation} operation: {msg} ")] InvalidTier { operation: String, msg: String }, + + #[error("Environment variable not found: {variable}")] + EnvironmentVariableNotFound { variable: String }, + + #[error("Invalid environment variable length: {msg}")] + InvalidEnvironmentVariable { msg: String }, } impl ContractError { diff --git a/packages/std/src/os/aos_querier.rs b/packages/std/src/os/aos_querier.rs index f4fbd8a77..0ab695402 100644 --- a/packages/std/src/os/aos_querier.rs +++ b/packages/std/src/os/aos_querier.rs @@ -322,4 +322,14 @@ impl AOSQuerier { }; Ok((new_denom_trace.get_ibc_denom(), new_denom_trace)) } + + pub fn get_env_variable( + querier: &QuerierWrapper, + kernel_addr: &Addr, + variable: &str, + ) -> Result, ContractError> { + let key = AOSQuerier::get_map_storage_key("kernel_env_variables", &[variable.as_bytes()])?; + let verify: Option = AOSQuerier::query_storage(querier, kernel_addr, &key)?; + Ok(verify) + } } diff --git a/packages/std/src/os/kernel.rs b/packages/std/src/os/kernel.rs index 2ee342136..f8756f8c1 100644 --- a/packages/std/src/os/kernel.rs +++ b/packages/std/src/os/kernel.rs @@ -73,6 +73,18 @@ pub enum ExecuteMsg { UpdateChainName { chain_name: String, }, + /// Sets an environment variable with the given name and value. + /// The variable name must be uppercase and can only contain letters, numbers, and underscores. + /// The value must be a valid UTF-8 string. + SetEnv { + variable: String, + value: String, + }, + /// Removes an environment variable with the given name. + /// Returns success even if the variable doesn't exist. + UnsetEnv { + variable: String, + }, // Only accessible to key contracts Internal(InternalMsg), // Base message @@ -102,6 +114,11 @@ pub struct ChainNameResponse { pub chain_name: String, } +#[cw_serde] +pub struct EnvResponse { + pub value: Option, +} + #[cw_serde] #[cfg_attr(not(target_arch = "wasm32"), derive(cw_orch::QueryFns))] #[derive(QueryResponses)] @@ -126,6 +143,8 @@ pub enum QueryMsg { AdoType {}, #[returns(crate::ado_base::ownership::ContractOwnerResponse)] Owner {}, + #[returns(EnvResponse)] + GetEnv { variable: String }, } #[cw_serde] diff --git a/packages/std/src/testing/mock_querier.rs b/packages/std/src/testing/mock_querier.rs index b1684489c..0aff538ee 100644 --- a/packages/std/src/testing/mock_querier.rs +++ b/packages/std/src/testing/mock_querier.rs @@ -504,6 +504,22 @@ impl MockAndromedaQuerier { "andromeda".to_string() }; SystemResult::Ok(ContractResult::Ok(to_json_binary(&res).unwrap())) + } else if key_str.contains("kernel_env_variables") { + let split = key_str.split("kernel_env_variables"); + let key = split.last(); + if let Some(key) = key { + match key { + "username_registration" => { + SystemResult::Ok(ContractResult::Ok(to_json_binary(&!fake).unwrap())) + } + "andromeda_distribution" => { + SystemResult::Ok(ContractResult::Ok(to_json_binary(&!fake).unwrap())) + } + _ => panic!("Invalid Kernel Address Key"), + } + } else { + panic!("Invalid Kernel Address Raw Query") + } } else if key_str.contains("channel") { SystemResult::Ok(ContractResult::Ok( to_json_binary(&ChannelInfo { diff --git a/tests-integration/Cargo.toml b/tests-integration/Cargo.toml index 50940b47d..d81c29190 100644 --- a/tests-integration/Cargo.toml +++ b/tests-integration/Cargo.toml @@ -165,7 +165,7 @@ name = "validator_staking" name = "shunting" [dependencies] -rstest = "0.23.0" +rstest = { workspace = true } # [[test]] # name = "cw20_staking_app" From c8e1b5bfb746a7f92694327d049b2040cdf395ba Mon Sep 17 00:00:00 2001 From: Connor Barr Date: Thu, 2 Jan 2025 20:34:57 +0000 Subject: [PATCH 14/21] feat: added a query for pending packets to kernel (#740) --- CHANGELOG.md | 1 + Cargo.lock | 12 +- Cargo.toml | 2 +- contracts/os/andromeda-kernel/Cargo.toml | 2 +- contracts/os/andromeda-kernel/src/contract.rs | 3 + contracts/os/andromeda-kernel/src/query.rs | 38 ++++++- .../os/andromeda-kernel/src/testing/tests.rs | 107 ++++++++++++++++-- packages/std/src/os/kernel.rs | 13 +++ 8 files changed, 158 insertions(+), 20 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 5a2ecc540..4b42fb061 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -20,6 +20,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 - feat: kernel environment variables [#738](https://github.com/andromedaprotocol/andromeda-core/pull/738) - Flat Rate denom can be a VFS path [(#727)](https://github.com/andromedaprotocol/andromeda-core/pull/727) - Auction ADO: Added buy_now_price option in Update Auction [(#730)](https://github.com/andromedaprotocol/andromeda-core/pull/730) +- feat: added a query for pending packets to kernel [(#740)](https://github.com/andromedaprotocol/andromeda-core/pull/740) ### Changed diff --git a/Cargo.lock b/Cargo.lock index ba65e03c4..63f33b49c 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -605,7 +605,7 @@ dependencies = [ [[package]] name = "andromeda-kernel" -version = "1.2.0-b.2" +version = "1.2.0-b.3" dependencies = [ "andromeda-std", "cosmwasm-schema", @@ -4212,21 +4212,21 @@ dependencies = [ [[package]] name = "rstest" -version = "0.23.0" +version = "0.24.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0a2c585be59b6b5dd66a9d2084aa1d8bd52fbdb806eafdeffb52791147862035" +checksum = "03e905296805ab93e13c1ec3a03f4b6c4f35e9498a3d5fa96dc626d22c03cd89" dependencies = [ - "futures", "futures-timer", + "futures-util", "rstest_macros", "rustc_version", ] [[package]] name = "rstest_macros" -version = "0.23.0" +version = "0.24.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "825ea780781b15345a146be27eaefb05085e337e869bff01b4306a4fd4a9ad5a" +checksum = "ef0053bbffce09062bee4bcc499b0fbe7a57b879f1efe088d6d8d4c7adcdef9b" dependencies = [ "cfg-if", "glob", diff --git a/Cargo.toml b/Cargo.toml index bfd9175a9..3ddc059a5 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -69,4 +69,4 @@ test-case = { version = "3.3.1" } cw-orch = "=0.24.1" jsonschema-valid = { version = "0.5.2" } serde_json = { version = "1.0.134" } -rstest = "0.23.0" +rstest = "0.24.0" diff --git a/contracts/os/andromeda-kernel/Cargo.toml b/contracts/os/andromeda-kernel/Cargo.toml index 5d0662234..485719b04 100644 --- a/contracts/os/andromeda-kernel/Cargo.toml +++ b/contracts/os/andromeda-kernel/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "andromeda-kernel" -version = "1.2.0-b.2" +version = "1.2.0-b.3" authors = ["Connor Barr "] edition = "2021" rust-version = "1.65.0" diff --git a/contracts/os/andromeda-kernel/src/contract.rs b/contracts/os/andromeda-kernel/src/contract.rs index a8db17cbb..a5eed9c3d 100644 --- a/contracts/os/andromeda-kernel/src/contract.rs +++ b/contracts/os/andromeda-kernel/src/contract.rs @@ -176,6 +176,9 @@ pub fn query(deps: Deps, _env: Env, msg: QueryMsg) -> Result { encode_binary(&query::chain_name_by_channel(deps, channel)?) } + QueryMsg::PendingPackets { channel_id } => { + encode_binary(&query::pending_packets(deps, channel_id)?) + } QueryMsg::GetEnv { variable } => encode_binary(&query::get_env(deps, variable)?), } } diff --git a/contracts/os/andromeda-kernel/src/query.rs b/contracts/os/andromeda-kernel/src/query.rs index 683a4e2aa..cb5988b0e 100644 --- a/contracts/os/andromeda-kernel/src/query.rs +++ b/contracts/os/andromeda-kernel/src/query.rs @@ -3,14 +3,17 @@ use andromeda_std::{ error::ContractError, os::{ aos_querier::AOSQuerier, - kernel::{ChainNameResponse, ChannelInfoResponse, EnvResponse, VerifyAddressResponse}, + kernel::{ + ChainNameResponse, ChannelInfoResponse, EnvResponse, Ics20PacketInfo, + PacketInfoAndSequence, PendingPacketResponse, VerifyAddressResponse, + }, }, }; -use cosmwasm_std::{Addr, Coin, Deps}; +use cosmwasm_std::{Addr, Coin, Deps, Order}; use crate::state::{ - CHAIN_TO_CHANNEL, CHANNEL_TO_CHAIN, CURR_CHAIN, ENV_VARIABLES, IBC_FUND_RECOVERY, - KERNEL_ADDRESSES, + CHAIN_TO_CHANNEL, CHANNEL_TO_CHAIN, CHANNEL_TO_EXECUTE_MSG, CURR_CHAIN, ENV_VARIABLES, + IBC_FUND_RECOVERY, KERNEL_ADDRESSES, }; pub fn key_address(deps: Deps, key: String) -> Result { @@ -70,6 +73,33 @@ pub fn chain_name(deps: Deps) -> Result { }) } +pub fn pending_packets( + deps: Deps, + channel_id: Option, +) -> Result { + let packets: Vec = if let Some(channel_id) = channel_id { + CHANNEL_TO_EXECUTE_MSG + .prefix(channel_id) + .range(deps.storage, None, None, Order::Ascending) + .filter_map(|item| item.ok()) + .map(|(sequence, packet)| PacketInfoAndSequence { + packet_info: packet, + sequence, + }) + .collect() + } else { + CHANNEL_TO_EXECUTE_MSG + .range(deps.storage, None, None, Order::Ascending) + .filter_map(|item| item.ok()) + .map(|((_, sequence), packet)| PacketInfoAndSequence { + packet_info: packet, + sequence, + }) + .collect() + }; + Ok(PendingPacketResponse { packets }) +} + pub fn get_env(deps: Deps, variable: String) -> Result { Ok(EnvResponse { value: ENV_VARIABLES.may_load(deps.storage, &variable.to_ascii_uppercase())?, diff --git a/contracts/os/andromeda-kernel/src/testing/tests.rs b/contracts/os/andromeda-kernel/src/testing/tests.rs index af356b016..255f97445 100644 --- a/contracts/os/andromeda-kernel/src/testing/tests.rs +++ b/contracts/os/andromeda-kernel/src/testing/tests.rs @@ -1,27 +1,32 @@ use crate::{ - contract::{execute, instantiate}, + contract::{execute, instantiate, query}, ibc::PACKET_LIFETIME, state::{ - ADO_OWNER, CHAIN_TO_CHANNEL, CHANNEL_TO_CHAIN, CURR_CHAIN, ENV_VARIABLES, KERNEL_ADDRESSES, + ADO_OWNER, CHAIN_TO_CHANNEL, CHANNEL_TO_CHAIN, CHANNEL_TO_EXECUTE_MSG, CURR_CHAIN, + ENV_VARIABLES, KERNEL_ADDRESSES, }, }; use andromeda_std::{ amp::{ messages::{AMPMsg, AMPPkt}, - ADO_DB_KEY, VFS_KEY, + AndrAddr, ADO_DB_KEY, VFS_KEY, }, error::ContractError, - os::kernel::{ChannelInfo, ExecuteMsg, IbcExecuteMsg, InstantiateMsg, InternalMsg}, + os::kernel::{ + ChannelInfo, ExecuteMsg, IbcExecuteMsg, Ics20PacketInfo, InstantiateMsg, InternalMsg, + PendingPacketResponse, QueryMsg, + }, testing::mock_querier::{ mock_dependencies_custom, MOCK_ADODB_CONTRACT, MOCK_FAKE_KERNEL_CONTRACT, MOCK_KERNEL_CONTRACT, MOCK_VFS_CONTRACT, }, }; use cosmwasm_std::{ - testing::{mock_dependencies, mock_env, mock_info}, - to_json_binary, Addr, Binary, CosmosMsg, IbcMsg, + coin, from_json, + testing::{mock_dependencies, mock_env, mock_info, MockApi, MockQuerier, MockStorage}, + to_json_binary, Addr, Binary, CosmosMsg, Env, IbcMsg, OwnedDeps, }; -use rstest::rstest; +use rstest::*; #[test] fn proper_initialization() { @@ -468,7 +473,6 @@ fn test_set_unset_env( }, ) .unwrap(); - let send_info = mock_info(sender, &[]); if let Some(value) = value { @@ -510,3 +514,90 @@ fn test_set_unset_env( .unwrap(); assert!(stored_value.is_none()); } + +#[fixture] +fn setup_pending_packets() -> (OwnedDeps, Env) { + let mut deps = mock_dependencies(); + let env = mock_env(); + let info = mock_info("sender", &[]); + + // Instantiate contract + instantiate( + deps.as_mut(), + env.clone(), + info, + InstantiateMsg { + owner: None, + chain_name: "andromeda".to_string(), + }, + ) + .unwrap(); + // Set up channel info for both channels + let channel_info = ChannelInfo { + kernel_address: MOCK_FAKE_KERNEL_CONTRACT.to_string(), + ics20_channel_id: Some("channel-1".to_string()), + direct_channel_id: Some("channel-2".to_string()), + supported_modules: vec![], + }; + CHAIN_TO_CHANNEL + .save(deps.as_mut().storage, "andromeda", &channel_info) + .unwrap(); + + (deps, env) +} + +#[rstest] +#[case(None, 3)] // Query all channels +#[case(Some("channel-1".to_string()), 2)] // Query channel-1 only +#[case(Some("channel-2".to_string()), 1)] // Query channel-2 only +fn test_query_pending_packets( + setup_pending_packets: (OwnedDeps, Env), + #[case] channel_id: Option, + #[case] expected_count: usize, +) { + let (mut deps, env) = setup_pending_packets; + + // Save multiple pending packets across different channels + let packets = vec![ + ("channel-1", 1, "recipient1", 100), + ("channel-1", 2, "recipient2", 200), + ("channel-2", 1, "recipient3", 300), + ]; + + for (channel, sequence, recipient, amount) in packets { + let packet_info = Ics20PacketInfo { + sender: "sender".to_string(), + recipient: AndrAddr::from_string(recipient), + message: to_json_binary(&"test message").unwrap(), + funds: coin(amount, "ucosm"), + channel: channel.to_string(), + }; + CHANNEL_TO_EXECUTE_MSG + .save( + deps.as_mut().storage, + (channel.to_string(), sequence), + &packet_info, + ) + .unwrap(); + } + + // Query pending packets + let res = query( + deps.as_ref(), + env, + QueryMsg::PendingPackets { + channel_id: channel_id.clone(), + }, + ) + .unwrap(); + + let pending_packets: PendingPacketResponse = from_json(&res).unwrap(); + assert_eq!(pending_packets.packets.len(), expected_count); + + // Verify packets are from the correct channel if channel_id is specified + if let Some(channel) = channel_id { + for packet in pending_packets.packets { + assert_eq!(packet.packet_info.channel, channel); + } + } +} diff --git a/packages/std/src/os/kernel.rs b/packages/std/src/os/kernel.rs index f8756f8c1..f6a084d86 100644 --- a/packages/std/src/os/kernel.rs +++ b/packages/std/src/os/kernel.rs @@ -114,6 +114,17 @@ pub struct ChainNameResponse { pub chain_name: String, } +#[cw_serde] +pub struct PendingPacketResponse { + pub packets: Vec, +} + +#[cw_serde] +pub struct PacketInfoAndSequence { + pub packet_info: Ics20PacketInfo, + pub sequence: u64, +} + #[cw_serde] pub struct EnvResponse { pub value: Option, @@ -143,6 +154,8 @@ pub enum QueryMsg { AdoType {}, #[returns(crate::ado_base::ownership::ContractOwnerResponse)] Owner {}, + #[returns(PendingPacketResponse)] + PendingPackets { channel_id: Option }, #[returns(EnvResponse)] GetEnv { variable: String }, } From f364bad083df0d5b2b86350efe79f578734e3182 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Fri, 3 Jan 2025 14:26:47 +0000 Subject: [PATCH 15/21] build(deps): bump cosmwasm-schema from 1.5.8 to 1.5.9 (#745) Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- Cargo.lock | 8 ++++---- Cargo.toml | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 63f33b49c..c84231d8d 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1542,9 +1542,9 @@ dependencies = [ [[package]] name = "cosmwasm-schema" -version = "1.5.8" +version = "1.5.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "93d388adfa9cb449557a92e9318121ac1a481fc4f599213b03a5b62699b403b4" +checksum = "13bf06bf1c7ea737f6b3d955d9cabeb8cbbe4dcb8dea392e30f6fab4493a4b7a" dependencies = [ "cosmwasm-schema-derive", "schemars", @@ -1555,9 +1555,9 @@ dependencies = [ [[package]] name = "cosmwasm-schema-derive" -version = "1.5.8" +version = "1.5.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2411b389e56e6484f81ba955b758d02522d620c98fc960c4bd2251d48b7aa19f" +checksum = "077fe378f16b54e3d0a57adb3f39a65bcf7bdbda6a5eade2f8ba7755c2fb1250" dependencies = [ "proc-macro2", "quote", diff --git a/Cargo.toml b/Cargo.toml index 3ddc059a5..9cf8845cf 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -60,7 +60,7 @@ cw4 = "1.1.2" cw721 = "0.18.0" cw721-base = { version = "0.18.0", features = ["library"] } cw-asset = "=3.0.0" -cosmwasm-schema = "1.5.8" +cosmwasm-schema = "1.5.9" semver = "1.0.24" enum-repr = "0.2.6" cw-multi-test = { version = "1.0.0", features = ["cosmwasm_1_2"] } From 76bfa27502d6a709af51451e8d76b6befa09d1e8 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Fri, 3 Jan 2025 14:26:59 +0000 Subject: [PATCH 16/21] build(deps): bump cosmwasm-std from 1.5.8 to 1.5.9 (#746) Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- Cargo.lock | 12 ++++++------ Cargo.toml | 2 +- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index c84231d8d..78e4e6bae 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1520,9 +1520,9 @@ dependencies = [ [[package]] name = "cosmwasm-crypto" -version = "1.5.8" +version = "1.5.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "58535cbcd599b3c193e3967c8292fe1dbbb5de7c2a2d87380661091dd4744044" +checksum = "eba94b9f3fb79b9f1101b3e0c61995a557828e2c0d3f5579c1d0bfbea333c19e" dependencies = [ "digest 0.10.7", "ed25519-zebra", @@ -1533,9 +1533,9 @@ dependencies = [ [[package]] name = "cosmwasm-derive" -version = "1.5.8" +version = "1.5.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a8e07de16c800ac82fd188d055ecdb923ead0cf33960d3350089260bb982c09f" +checksum = "d67457e4acb04e738788d3489e343957455df2c4643f2b53050eb052ca631d19" dependencies = [ "syn 1.0.109", ] @@ -1566,9 +1566,9 @@ dependencies = [ [[package]] name = "cosmwasm-std" -version = "1.5.8" +version = "1.5.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c21fde95ccd20044a23c0ac6fd8c941f3e8c158169dc94b5aa6491a2d9551a8d" +checksum = "3745e9fd9aad96236c3d6f1a6d844249ed3bb6b92fcdae16d8fe067c7a5121e8" dependencies = [ "base64 0.21.7", "bech32 0.9.1", diff --git a/Cargo.toml b/Cargo.toml index 9cf8845cf..25fef5e07 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -49,7 +49,7 @@ andromeda-testing-e2e = { path = "./packages/andromeda-testing-e2e", version = " strum_macros = "0.24.3" -cosmwasm-std = "1.5.8" +cosmwasm-std = "1.5.9" cw-utils = "1.0.3" cw-storage-plus = "1.2.0" cw2 = "1.1.2" From 3d864b8636150b8373ea5e9a96de8f855d8b6dc8 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 7 Jan 2025 12:07:42 +0200 Subject: [PATCH 17/21] build(deps): bump itertools from 0.13.0 to 0.14.0 (#750) Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- Cargo.lock | 11 ++++++++++- contracts/os/andromeda-kernel/Cargo.toml | 2 +- 2 files changed, 11 insertions(+), 2 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 78e4e6bae..437d9ad15 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -614,7 +614,7 @@ dependencies = [ "cw-orch", "cw-storage-plus 1.2.0", "hex", - "itertools 0.13.0", + "itertools 0.14.0", "osmosis-std", "osmosis-std-derive 0.15.3", "prost 0.11.9", @@ -3371,6 +3371,15 @@ dependencies = [ "either", ] +[[package]] +name = "itertools" +version = "0.14.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2b192c782037fadd9cfa75548310488aabdbf3d2da73885b31bd0abd03351285" +dependencies = [ + "either", +] + [[package]] name = "itoa" version = "1.0.14" diff --git a/contracts/os/andromeda-kernel/Cargo.toml b/contracts/os/andromeda-kernel/Cargo.toml index 485719b04..23beb19bf 100644 --- a/contracts/os/andromeda-kernel/Cargo.toml +++ b/contracts/os/andromeda-kernel/Cargo.toml @@ -35,7 +35,7 @@ prost = { version = "0.11.2", default-features = false, features = [ serde = { workspace = true } schemars = "0.8.10" hex = "0.4.3" -itertools = "0.13" +itertools = "0.14" andromeda-std = { workspace = true } From 876044597fbd357f5d680cb2599e4fffc78cf94e Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Tue, 7 Jan 2025 12:08:04 +0200 Subject: [PATCH 18/21] build(deps): bump reqwest from 0.12.11 to 0.12.12 (#751) Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- Cargo.lock | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 437d9ad15..1e10514fd 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -424,7 +424,7 @@ dependencies = [ "lazy_static", "log", "regex", - "reqwest 0.12.11", + "reqwest 0.12.12", "schemars", "semver", "serde", @@ -4142,9 +4142,9 @@ dependencies = [ [[package]] name = "reqwest" -version = "0.12.11" +version = "0.12.12" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7fe060fe50f524be480214aba758c71f99f90ee8c83c5a36b5e9e1d568eb4eb3" +checksum = "43e734407157c3c2034e0258f5e4473ddb361b1e85f95a66690d67264d7cd1da" dependencies = [ "base64 0.22.1", "bytes", From 1a6f458e0d1ee46a59e494b774917d07bf75eb1f Mon Sep 17 00:00:00 2001 From: Connor Barr Date: Tue, 7 Jan 2025 20:13:06 +0000 Subject: [PATCH 19/21] feat: IBC packet tracking adjustments (#748) --- CHANGELOG.md | 1 + Cargo.lock | 173 +++++++++--------- .../finance/andromeda-splitter/Cargo.toml | 2 +- .../andromeda-splitter/src/contract.rs | 15 +- contracts/os/andromeda-kernel/Cargo.toml | 2 +- contracts/os/andromeda-kernel/src/execute.rs | 72 +++++--- tests-integration/tests/splitter.rs | 31 +++- 7 files changed, 169 insertions(+), 127 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 4b42fb061..ebd139cc7 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -27,6 +27,7 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0 - Rates: Limit rates recipient to only one address [(#669)](https://github.com/andromedaprotocol/andromeda-core/pull/669) - Address Validation: Cross-chain recipients don't need to be registered in VFS [(#725)](https://github.com/andromedaprotocol/andromeda-core/pull/725) - Weighted Splitter: Replace Recipient with AndrAddr in RemoveRecipient and GetUserWeight [(#739)](https://github.com/andromedaprotocol/andromeda-core/pull/739) +- feat: IBC packet tracking adjustments [#748](https://github.com/andromedaprotocol/andromeda-core/pull/748) ### Fixed diff --git a/Cargo.lock b/Cargo.lock index 1e10514fd..c473f910c 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -605,7 +605,7 @@ dependencies = [ [[package]] name = "andromeda-kernel" -version = "1.2.0-b.3" +version = "1.2.0-b.4" dependencies = [ "andromeda-std", "cosmwasm-schema", @@ -866,7 +866,7 @@ dependencies = [ [[package]] name = "andromeda-splitter" -version = "2.3.0-b.1" +version = "2.3.0-b.2" dependencies = [ "andromeda-app", "andromeda-finance", @@ -1131,7 +1131,7 @@ checksum = "3b43422f69d8ff38f95f1b2bb76517c91589a924d1559a0e935d7c8ce0274c11" dependencies = [ "proc-macro2", "quote", - "syn 2.0.90", + "syn 2.0.94", ] [[package]] @@ -1153,18 +1153,18 @@ checksum = "c7c24de15d275a1ecfd47a380fb4d5ec9bfe0933f309ed5e705b775596a3574d" dependencies = [ "proc-macro2", "quote", - "syn 2.0.90", + "syn 2.0.94", ] [[package]] name = "async-trait" -version = "0.1.83" +version = "0.1.84" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "721cae7de5c34fbb2acd27e21e6d2cf7b886dce0c27388d46c4e6c47ea4318dd" +checksum = "1b1244b10dcd56c92219da4e14caa97e312079e185f04ba3eea25061561dc0a0" dependencies = [ "proc-macro2", "quote", - "syn 2.0.90", + "syn 2.0.94", ] [[package]] @@ -1192,7 +1192,7 @@ dependencies = [ "futures-util", "http 0.2.12", "http-body 0.4.6", - "hyper 0.14.31", + "hyper 0.14.32", "itoa", "matchit", "memchr", @@ -1399,9 +1399,9 @@ dependencies = [ [[package]] name = "cc" -version = "1.2.3" +version = "1.2.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "27f657647bcff5394bf56c7317665bbf790a137a50eaaa5c6bfbb9e27a518f2d" +checksum = "a012a0df96dd6d06ba9a1b29d6402d1a5d77c6befd2566afdc26e10603dc93d7" dependencies = [ "shlex", ] @@ -1669,7 +1669,7 @@ checksum = "f46882e17999c6cc590af592290432be3bce0428cb0d5f8b6715e4dc7b383eb3" dependencies = [ "proc-macro2", "quote", - "syn 2.0.90", + "syn 2.0.94", ] [[package]] @@ -1784,7 +1784,7 @@ checksum = "bad52865e313bb7ed3f3938f7ad9d566e430fb6143a63476c22bed505ea78cd7" dependencies = [ "convert_case", "quote", - "syn 2.0.90", + "syn 2.0.94", ] [[package]] @@ -2254,7 +2254,7 @@ checksum = "5f33878137e4dafd7fa914ad4e259e18a4e8e532b9617a2d0150262bf53abfce" dependencies = [ "proc-macro2", "quote", - "syn 2.0.90", + "syn 2.0.94", ] [[package]] @@ -2307,7 +2307,7 @@ checksum = "97369cbbc041bc366949bc74d34658d6cda5621039731c6310521892a3a20ae0" dependencies = [ "proc-macro2", "quote", - "syn 2.0.90", + "syn 2.0.94", ] [[package]] @@ -2436,9 +2436,9 @@ dependencies = [ [[package]] name = "env_filter" -version = "0.1.2" +version = "0.1.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4f2c92ceda6ceec50f43169f9ee8424fe2db276791afde7b2cd8bc084cb376ab" +checksum = "186e05a59d4c50738528153b83b0b0194d3a29507dfec16eccd4b342903397d0" dependencies = [ "log", "regex", @@ -2646,7 +2646,7 @@ checksum = "162ee34ebcb7c64a8abebc059ce0fee27c2262618d7b60ed8faf72fef13c3650" dependencies = [ "proc-macro2", "quote", - "syn 2.0.90", + "syn 2.0.94", ] [[package]] @@ -2717,9 +2717,9 @@ checksum = "07e28edb80900c19c28f1072f2e8aeca7fa06b23cd4169cefe1af5aa3260783f" [[package]] name = "glob" -version = "0.3.1" +version = "0.3.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d2fabcfbdc87f4758337ca535fb41a6d701b65693ce38287d856d1674551ec9b" +checksum = "a8d1add55171497b4705a648c6b583acafb01d58050a51727785f0b2c8e0a2b2" [[package]] name = "group" @@ -2903,9 +2903,9 @@ checksum = "9a3a5bfb195931eeb336b2a7b4d761daec841b97f947d34394601737a7bba5e4" [[package]] name = "hyper" -version = "0.14.31" +version = "0.14.32" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8c08302e8fa335b151b788c775ff56e7a03ae64ff85c548ee820fecb70356e85" +checksum = "41dfc780fdec9373c01bae43289ea34c972e40ee3c9f6b3c8801a35f35586ce7" dependencies = [ "bytes", "futures-channel", @@ -2927,9 +2927,9 @@ dependencies = [ [[package]] name = "hyper" -version = "1.5.1" +version = "1.5.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "97818827ef4f364230e16705d4706e2897df2bb60617d6ca15d598025a3c481f" +checksum = "256fb8d4bd6413123cc9d91832d78325c48ff41677595be797d90f42969beae0" dependencies = [ "bytes", "futures-channel", @@ -2953,7 +2953,7 @@ checksum = "ec3efd23720e2049821a693cbc7e65ea87c72f1c58ff2f9522ff332b1491e590" dependencies = [ "futures-util", "http 0.2.12", - "hyper 0.14.31", + "hyper 0.14.32", "rustls 0.21.12", "tokio", "tokio-rustls 0.24.1", @@ -2961,15 +2961,15 @@ dependencies = [ [[package]] name = "hyper-rustls" -version = "0.27.3" +version = "0.27.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "08afdbb5c31130e3034af566421053ab03787c640246a446327f550d11bcb333" +checksum = "2d191583f3da1305256f22463b9bb0471acad48a4e534a5218b9963e9c1f59b2" dependencies = [ "futures-util", "http 1.2.0", - "hyper 1.5.1", + "hyper 1.5.2", "hyper-util", - "rustls 0.23.19", + "rustls 0.23.20", "rustls-pki-types", "tokio", "tokio-rustls 0.26.1", @@ -2982,7 +2982,7 @@ version = "0.4.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "bbb958482e8c7be4bc3cf272a766a2b0bf1a6755e7a6ae777f017a31d11b13b1" dependencies = [ - "hyper 0.14.31", + "hyper 0.14.32", "pin-project-lite", "tokio", "tokio-io-timeout", @@ -2995,7 +2995,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d6183ddfa99b85da61a140bea0efc93fdf56ceaa041b37d553518030827f9905" dependencies = [ "bytes", - "hyper 0.14.31", + "hyper 0.14.32", "native-tls", "tokio", "tokio-native-tls", @@ -3009,7 +3009,7 @@ checksum = "70206fc6890eaca9fde8a0bf71caa2ddfc9fe045ac9e5c70df101a7dbde866e0" dependencies = [ "bytes", "http-body-util", - "hyper 1.5.1", + "hyper 1.5.2", "hyper-util", "native-tls", "tokio", @@ -3028,7 +3028,7 @@ dependencies = [ "futures-util", "http 1.2.0", "http-body 1.0.1", - "hyper 1.5.1", + "hyper 1.5.2", "pin-project-lite", "socket2", "tokio", @@ -3263,7 +3263,7 @@ checksum = "1ec89e9337638ecdc08744df490b221a7399bf8d164eb52a665454e60e075ad6" dependencies = [ "proc-macro2", "quote", - "syn 2.0.90", + "syn 2.0.94", ] [[package]] @@ -3433,9 +3433,9 @@ checksum = "82de9bb5d9e8ff5e13532a45583ea972e220b8a6efef755daad1f285333a8afa" [[package]] name = "libc" -version = "0.2.168" +version = "0.2.169" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5aaeb2981e0606ca11d79718f8bb01164f1d6ed75080182d3abf017e6d244b6d" +checksum = "b5aba8db14291edd000dfcc4d620c7ebfb122c613afb886ca8803fa4e128a20a" [[package]] name = "libm" @@ -3501,9 +3501,9 @@ checksum = "6877bb514081ee2a7ff5ef9de3281f14a4dd4bceac4c09388074a6b5df8a139a" [[package]] name = "miniz_oxide" -version = "0.8.0" +version = "0.8.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e2d80299ef12ff69b16a84bb182e3b9df68b5a91574d3d4fa6e41b65deec4df1" +checksum = "4ffbe83022cedc1d264172192511ae958937694cd57ce297164951b8b3568394" dependencies = [ "adler2", ] @@ -3605,7 +3605,7 @@ checksum = "ed3955f1a9c7c0c15e092f9c887db08b1fc683305fdf6eb6684f22555355e202" dependencies = [ "proc-macro2", "quote", - "syn 2.0.90", + "syn 2.0.94", ] [[package]] @@ -3650,9 +3650,9 @@ dependencies = [ [[package]] name = "object" -version = "0.36.5" +version = "0.36.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "aedf0a2d09c573ed1d8d85b30c119153926a2b36dce0ab28322c09a117a4683e" +checksum = "62948e14d923ea95ea2c7c86c71013138b66525b86bdc08d2dcc262bdb497b87" dependencies = [ "memchr", ] @@ -3692,7 +3692,7 @@ checksum = "a948666b637a0f465e8564c73e89d4dde00d72d4d473cc972f390fc3dcee7d9c" dependencies = [ "proc-macro2", "quote", - "syn 2.0.90", + "syn 2.0.94", ] [[package]] @@ -3845,7 +3845,7 @@ checksum = "3c0f5fad0874fc7abcd4d750e76917eaebbecaa2c20bde22e1dbeeba8beb758c" dependencies = [ "proc-macro2", "quote", - "syn 2.0.90", + "syn 2.0.94", ] [[package]] @@ -3975,7 +3975,7 @@ dependencies = [ "itertools 0.12.1", "proc-macro2", "quote", - "syn 2.0.90", + "syn 2.0.94", ] [[package]] @@ -3998,9 +3998,9 @@ dependencies = [ [[package]] name = "quote" -version = "1.0.37" +version = "1.0.38" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b5b9d34b8991d19d98081b46eacdd8eb58c6f2b201139f7c5f643cc155a633af" +checksum = "0e4dccaaaf89514f546c693ddc140f729f958c247918a13380cccc6078391acc" dependencies = [ "proc-macro2", ] @@ -4043,9 +4043,9 @@ dependencies = [ [[package]] name = "redox_syscall" -version = "0.5.7" +version = "0.5.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9b6dfecf2c74bce2466cabf93f6664d6998a69eb21e39f4207930065b27b771f" +checksum = "03a862b389f93e68874fbf580b9de08dd02facb9a788ebadaf4a3fd33cf58834" dependencies = [ "bitflags 2.6.0", ] @@ -4110,7 +4110,7 @@ dependencies = [ "h2 0.3.26", "http 0.2.12", "http-body 0.4.6", - "hyper 0.14.31", + "hyper 0.14.32", "hyper-rustls 0.24.2", "hyper-tls 0.5.0", "ipnet", @@ -4156,8 +4156,8 @@ dependencies = [ "http 1.2.0", "http-body 1.0.1", "http-body-util", - "hyper 1.5.1", - "hyper-rustls 0.27.3", + "hyper 1.5.2", + "hyper-rustls 0.27.5", "hyper-tls 0.6.0", "hyper-util", "ipnet", @@ -4245,7 +4245,7 @@ dependencies = [ "regex", "relative-path", "rustc_version", - "syn 2.0.90", + "syn 2.0.94", "unicode-ident", ] @@ -4291,9 +4291,9 @@ dependencies = [ [[package]] name = "rustls" -version = "0.23.19" +version = "0.23.20" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "934b404430bb06b3fae2cba809eb45a1ab1aecd64491213d7c3301b88393f8d1" +checksum = "5065c3f250cbd332cd894be57c40fa52387247659b14a2d6041d121547903b1b" dependencies = [ "once_cell", "rustls-pki-types", @@ -4334,9 +4334,9 @@ dependencies = [ [[package]] name = "rustls-pki-types" -version = "1.10.0" +version = "1.10.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "16f1201b3c9a7ee8039bcadc17b7e605e2945b27eee7631788c1bd2b0643674b" +checksum = "d2bf47e6ff922db3825eb750c4e2ff784c6ff8fb9e13046ef6a1d1c5401b0b37" [[package]] name = "rustls-webpki" @@ -4361,9 +4361,9 @@ dependencies = [ [[package]] name = "rustversion" -version = "1.0.18" +version = "1.0.19" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0e819f2bc632f285be6d7cd36e25940d45b2391dd6d9b939e79de557f7014248" +checksum = "f7c45b9784283f1b2e7fb61b42047c2fd678ef0960d4f6f1eba131594cc369d4" [[package]] name = "ryu" @@ -4410,7 +4410,7 @@ dependencies = [ "proc-macro2", "quote", "serde_derive_internals", - "syn 2.0.90", + "syn 2.0.94", ] [[package]] @@ -4477,9 +4477,9 @@ dependencies = [ [[package]] name = "security-framework-sys" -version = "2.12.1" +version = "2.13.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fa39c7303dc58b5543c94d22c1766b0d31f2ee58306363ea622b10bbc075eaa2" +checksum = "1863fd3768cd83c56a7f60faa4dc0d403f1b6df0a38c3c25f44b7894e45370d5" dependencies = [ "core-foundation-sys", "libc", @@ -4544,7 +4544,7 @@ checksum = "5a9bf7cf98d04a2b28aead066b7496853d4779c9cc183c440dbac457641e19a0" dependencies = [ "proc-macro2", "quote", - "syn 2.0.90", + "syn 2.0.94", ] [[package]] @@ -4555,7 +4555,7 @@ checksum = "18d26a20a969b9e3fdf2fc2d9f21eda6c40e2de84c9408bb5d3b05d499aae711" dependencies = [ "proc-macro2", "quote", - "syn 2.0.90", + "syn 2.0.94", ] [[package]] @@ -4578,7 +4578,7 @@ checksum = "6c64451ba24fc7a6a2d60fc75dd9c83c90903b19028d4eff35e88fc1e86564e9" dependencies = [ "proc-macro2", "quote", - "syn 2.0.90", + "syn 2.0.94", ] [[package]] @@ -4780,9 +4780,9 @@ dependencies = [ [[package]] name = "syn" -version = "2.0.90" +version = "2.0.94" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "919d3b74a5dd0ccd15aeb8f93e7006bd9e14c295087c9896a110f490752bcf31" +checksum = "987bc0be1cdea8b10216bd06e2ca407d40b9543468fafd3ddfb02f36e77f71f3" dependencies = [ "proc-macro2", "quote", @@ -4812,7 +4812,7 @@ checksum = "c8af7666ab7b6390ab78131fb5b0fce11d6b7a6951602017c35fa82800708971" dependencies = [ "proc-macro2", "quote", - "syn 2.0.90", + "syn 2.0.94", ] [[package]] @@ -4859,12 +4859,13 @@ dependencies = [ [[package]] name = "tempfile" -version = "3.14.0" +version = "3.15.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "28cce251fcbc87fac86a866eeb0d6c2d536fc16d06f184bb61aeae11aa4cee0c" +checksum = "9a8a559c81686f576e8cd0290cd2a24a2a9ad80c98b3478856500fcbd7acd704" dependencies = [ "cfg-if", "fastrand", + "getrandom", "once_cell", "rustix", "windows-sys 0.59.0", @@ -5062,7 +5063,7 @@ dependencies = [ "cfg-if", "proc-macro2", "quote", - "syn 2.0.90", + "syn 2.0.94", ] [[package]] @@ -5073,7 +5074,7 @@ checksum = "5c89e72a01ed4c579669add59014b9a524d609c0c88c6a585ce37485879f6ffb" dependencies = [ "proc-macro2", "quote", - "syn 2.0.90", + "syn 2.0.94", "test-case-core", ] @@ -5155,7 +5156,7 @@ checksum = "4fee6c4efc90059e10f81e6d42c60a18f76588c3d74cb83a0b242a2b6c7504c1" dependencies = [ "proc-macro2", "quote", - "syn 2.0.90", + "syn 2.0.94", ] [[package]] @@ -5166,7 +5167,7 @@ checksum = "7b50fa271071aae2e6ee85f842e2e28ba8cd2c5fb67f11fcb1fd70b276f9e7d4" dependencies = [ "proc-macro2", "quote", - "syn 2.0.90", + "syn 2.0.94", ] [[package]] @@ -5256,7 +5257,7 @@ checksum = "693d596312e88961bc67d7f1f97af8a70227d9f90c31bba5806eec004978d752" dependencies = [ "proc-macro2", "quote", - "syn 2.0.90", + "syn 2.0.94", ] [[package]] @@ -5285,7 +5286,7 @@ version = "0.26.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "5f6d0975eaace0cf0fcadee4e4aaa5da15b5c079146f2cffb67c113be122bf37" dependencies = [ - "rustls 0.23.19", + "rustls 0.23.20", "tokio", ] @@ -5371,7 +5372,7 @@ dependencies = [ "h2 0.3.26", "http 0.2.12", "http-body 0.4.6", - "hyper 0.14.31", + "hyper 0.14.32", "hyper-timeout", "percent-encoding", "pin-project", @@ -5398,7 +5399,7 @@ dependencies = [ "h2 0.3.26", "http 0.2.12", "http-body 0.4.6", - "hyper 0.14.31", + "hyper 0.14.32", "hyper-timeout", "percent-encoding", "pin-project", @@ -5481,7 +5482,7 @@ checksum = "395ae124c09f9e6918a2310af6038fba074bcf474ac352496d5910dd59a2226d" dependencies = [ "proc-macro2", "quote", - "syn 2.0.90", + "syn 2.0.94", ] [[package]] @@ -5640,7 +5641,7 @@ dependencies = [ "log", "proc-macro2", "quote", - "syn 2.0.90", + "syn 2.0.94", "wasm-bindgen-shared", ] @@ -5675,7 +5676,7 @@ checksum = "30d7a95b763d3c45903ed6c81f156801839e5ee968bb07e534c44df0fcd330c2" dependencies = [ "proc-macro2", "quote", - "syn 2.0.90", + "syn 2.0.94", "wasm-bindgen-backend", "wasm-bindgen-shared", ] @@ -5916,9 +5917,9 @@ checksum = "589f6da84c646204747d1270a2a5661ea66ed1cced2631d546fdfb155959f9ec" [[package]] name = "winnow" -version = "0.6.20" +version = "0.6.22" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "36c1fec1a2bb5866f07c25f68c26e565c4c200aebb96d7e55710c19d3e8ac49b" +checksum = "39281189af81c07ec09db316b302a3e67bf9bd7cbf6c820b50e35fee9c2fa980" dependencies = [ "memchr", ] @@ -5965,7 +5966,7 @@ checksum = "2380878cad4ac9aac1e2435f3eb4020e8374b5f13c296cb75b4620ff8e229154" dependencies = [ "proc-macro2", "quote", - "syn 2.0.90", + "syn 2.0.94", "synstructure", ] @@ -5987,7 +5988,7 @@ checksum = "fa4f8080344d4671fb4e831a13ad1e68092748387dfc4f55e356242fae12ce3e" dependencies = [ "proc-macro2", "quote", - "syn 2.0.90", + "syn 2.0.94", ] [[package]] @@ -6007,7 +6008,7 @@ checksum = "595eed982f7d355beb85837f651fa22e90b3c044842dc7f2c2842c086f295808" dependencies = [ "proc-macro2", "quote", - "syn 2.0.90", + "syn 2.0.94", "synstructure", ] @@ -6028,7 +6029,7 @@ checksum = "ce36e65b0d2999d2aafac989fb249189a141aee1f53c612c1f37d72631959f69" dependencies = [ "proc-macro2", "quote", - "syn 2.0.90", + "syn 2.0.94", ] [[package]] @@ -6050,5 +6051,5 @@ checksum = "6eafa6dfb17584ea3e2bd6e76e0cc15ad7af12b09abdd1ca55961bed9b1063c6" dependencies = [ "proc-macro2", "quote", - "syn 2.0.90", + "syn 2.0.94", ] diff --git a/contracts/finance/andromeda-splitter/Cargo.toml b/contracts/finance/andromeda-splitter/Cargo.toml index 3c6d6fad6..dd8b45534 100644 --- a/contracts/finance/andromeda-splitter/Cargo.toml +++ b/contracts/finance/andromeda-splitter/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "andromeda-splitter" -version = "2.3.0-b.1" +version = "2.3.0-b.2" edition = "2021" rust-version = "1.75.0" diff --git a/contracts/finance/andromeda-splitter/src/contract.rs b/contracts/finance/andromeda-splitter/src/contract.rs index 151c58394..3de38cc16 100644 --- a/contracts/finance/andromeda-splitter/src/contract.rs +++ b/contracts/finance/andromeda-splitter/src/contract.rs @@ -199,7 +199,6 @@ fn execute_send( for recipient_addr in splitter_recipients { let recipient_percent = recipient_addr.percent; - let mut vec_coin: Vec = Vec::new(); for (i, coin) in info.funds.clone().iter().enumerate() { let amount_owed = coin.amount.mul_floor(recipient_percent); if !amount_owed.is_zero() { @@ -207,16 +206,14 @@ fn execute_send( recip_coin.amount = amount_owed; remainder_funds[i].amount = remainder_funds[i].amount.checked_sub(recip_coin.amount)?; - vec_coin.push(recip_coin.clone()); - amp_funds.push(recip_coin); + amp_funds.push(recip_coin.clone()); + + let amp_msg = recipient_addr + .recipient + .generate_amp_msg(&deps.as_ref(), Some(vec![recip_coin.clone()]))?; + pkt = pkt.add_message(amp_msg); } } - if !vec_coin.is_empty() { - let amp_msg = recipient_addr - .recipient - .generate_amp_msg(&deps.as_ref(), Some(vec_coin))?; - pkt = pkt.add_message(amp_msg); - } } remainder_funds.retain(|x| x.amount > Uint128::zero()); diff --git a/contracts/os/andromeda-kernel/Cargo.toml b/contracts/os/andromeda-kernel/Cargo.toml index 23beb19bf..07ef25a84 100644 --- a/contracts/os/andromeda-kernel/Cargo.toml +++ b/contracts/os/andromeda-kernel/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "andromeda-kernel" -version = "1.2.0-b.3" +version = "1.2.0-b.4" authors = ["Connor Barr "] edition = "2021" rust-version = "1.65.0" diff --git a/contracts/os/andromeda-kernel/src/execute.rs b/contracts/os/andromeda-kernel/src/execute.rs index 892c8ca8d..b4bf2bb2e 100644 --- a/contracts/os/andromeda-kernel/src/execute.rs +++ b/contracts/os/andromeda-kernel/src/execute.rs @@ -4,8 +4,8 @@ use andromeda_std::amp::addresses::AndrAddr; use andromeda_std::amp::messages::{AMPCtx, AMPMsg, AMPPkt}; use andromeda_std::amp::{ADO_DB_KEY, VFS_KEY}; use andromeda_std::common::context::ExecuteContext; -use andromeda_std::common::has_coins_merged; use andromeda_std::common::reply::ReplyId; +use andromeda_std::common::{has_coins_merged, merge_coins}; use andromeda_std::error::ContractError; use andromeda_std::os::aos_querier::AOSQuerier; #[cfg(not(target_arch = "wasm32"))] @@ -44,7 +44,7 @@ pub fn trigger_relay( ContractError::Unauthorized {} ); let ics20_packet_info = CHANNEL_TO_EXECUTE_MSG - .load(ctx.deps.storage, (channel_id, packet_sequence)) + .load(ctx.deps.storage, (channel_id.clone(), packet_sequence)) .expect("No packet found for channel_id and sequence"); let chain = @@ -68,7 +68,7 @@ pub fn trigger_relay( ctx.info, ctx.env, ctx.amp_ctx, - 0, + packet_sequence, channel_info, ics20_packet_info, ), @@ -80,7 +80,11 @@ pub fn trigger_relay( }); Ok(Response::default() .add_message(refund_msg) - .add_attribute("action", "refund") + .add_attribute("action", "relay_packet") + .add_attribute("relay_outcome", "refund") + .add_attribute("relay_sequence", packet_sequence.to_string()) + .add_attribute("relay_channel", channel_id) + .add_attribute("relay_chain", chain) .add_attribute("recipient", ics20_packet_info.sender) .add_attribute("amount", ics20_packet_info.funds.to_string())) } @@ -156,10 +160,12 @@ fn handle_ibc_transfer_funds_reply( Ok(Response::default() .add_message(CosmosMsg::Ibc(msg)) - .add_attribute(format!("method:{sequence}"), "execute_send_message") - .add_attribute(format!("channel:{sequence}"), channel) - .add_attribute("receiving_kernel_address:{}", channel_info.kernel_address) - .add_attribute("chain:{}", chain)) + .add_attribute("action", "relay_packet") + .add_attribute("relay_outcome", "success") + .add_attribute("relay_sequence", sequence.to_string()) + .add_attribute("relay_channel", ics20_packet_info.channel) + .add_attribute("relay_chain", chain) + .add_attribute("receiving_kernel_address", channel_info.kernel_address)) } pub fn amp_receive( @@ -170,7 +176,8 @@ pub fn amp_receive( ) -> Result { // Only verified ADOs can access this function ensure!( - query::verify_address(deps.as_ref(), info.sender.to_string())?.verify_address, + info.sender == env.contract.address + || query::verify_address(deps.as_ref(), info.sender.to_string())?.verify_address, ContractError::Unauthorized {} ); ensure!( @@ -188,18 +195,39 @@ pub fn amp_receive( } ); + let msg = packet.messages.first().unwrap(); + let mut handler = MsgHandler::new(msg.clone()); + let msg_res = handler.handle( + deps.branch(), + info.clone(), + env.clone(), + Some(packet.clone()), + 0, + )?; + + res.messages.extend_from_slice(&msg_res.messages); + res.attributes.extend_from_slice(&msg_res.attributes); + res.events.extend_from_slice(&msg_res.events); + + let mut new_pkt = AMPPkt::from_ctx(Some(packet.clone()), env.contract.address.to_string()); + for (idx, message) in packet.messages.iter().enumerate() { - let mut handler = MsgHandler::new(message.clone()); - let msg_res = handler.handle( - deps.branch(), - info.clone(), - env.clone(), - Some(packet.clone()), - idx as u64, - )?; - res.messages.extend_from_slice(&msg_res.messages); - res.attributes.extend_from_slice(&msg_res.attributes); - res.events.extend_from_slice(&msg_res.events); + if idx == 0 { + continue; + } + new_pkt = new_pkt.add_message(message.clone()); + } + + if !new_pkt.messages.is_empty() { + let new_funds = new_pkt + .messages + .iter() + .flat_map(|m| m.funds.clone()) + .collect::>(); + + let new_pkt_msg = + new_pkt.to_sub_msg(env.contract.address.to_string(), Some(new_funds), 0)?; + res.messages.extend_from_slice(&[new_pkt_msg]); } let message_funds = packet @@ -825,8 +853,10 @@ impl MsgHandler { error: Some(format!("Channel not found for chain {chain}")), }); }?; + deps.api.debug(&format!("info.funds: {:?}", info.funds)); + deps.api.debug(&format!("funds: {:?}", funds)); ensure!( - funds.len() == 1 && info.funds.len() == 1, + funds.len() == 1, ContractError::InvalidFunds { msg: "Number of funds should be exactly one".to_string() } diff --git a/tests-integration/tests/splitter.rs b/tests-integration/tests/splitter.rs index 9badd969e..73ae7d711 100644 --- a/tests-integration/tests/splitter.rs +++ b/tests-integration/tests/splitter.rs @@ -614,14 +614,27 @@ fn test_splitter_cross_chain_recipient() { splitter_juno .instantiate( &SplitterInstantiateMsg { - recipients: vec![AddressPercent { - recipient: Recipient { - address: AndrAddr::from_string(format!("ibc://osmosis/{}", recipient)), - msg: None, - ibc_recovery_address: None, + recipients: vec![ + AddressPercent { + recipient: Recipient { + address: AndrAddr::from_string(format!("ibc://osmosis/{}", recipient)), + msg: None, + ibc_recovery_address: None, + }, + percent: Decimal::from_ratio(Uint128::from(1u128), Uint128::from(2u128)), }, - percent: Decimal::one(), - }], + AddressPercent { + recipient: Recipient { + address: AndrAddr::from_string(format!( + "ibc://osmosis/{}", + kernel_osmosis.address().unwrap().into_string() + )), + msg: None, + ibc_recovery_address: None, + }, + percent: Decimal::from_ratio(Uint128::from(1u128), Uint128::from(2u128)), + }, + ], lock_time: None, kernel_address: kernel_osmosis.address().unwrap().into_string(), owner: None, @@ -638,7 +651,7 @@ fn test_splitter_cross_chain_recipient() { &SplitterExecuteMsg::Send { config: None }, Some(&[Coin { denom: "juno".to_string(), - amount: Uint128::new(100), + amount: Uint128::new(200), }]), ) .unwrap(); @@ -658,7 +671,7 @@ fn test_splitter_cross_chain_recipient() { .unwrap(); assert_eq!(balances.len(), 1); assert_eq!(balances[0].denom, ibc_denom); - assert_eq!(balances[0].amount.u128(), 100); + assert_eq!(balances[0].amount.u128(), 200); } else { panic!("packet timed out"); // There was a decode error or the packet timed out From 13988a85167ff780a06b990e87a0b347aa0852c2 Mon Sep 17 00:00:00 2001 From: Mitar Djakovic Date: Tue, 7 Jan 2025 22:52:58 +0200 Subject: [PATCH 20/21] Bump version (#700) Co-authored-by: Anshudhar Kumar Singh --- Cargo.lock | 28 +++++++++++-------- .../andromeda-fixed-multisig/Cargo.toml | 2 +- .../data-storage/andromeda-boolean/Cargo.toml | 2 +- .../data-storage/andromeda-form/Cargo.toml | 2 +- .../andromeda-string-storage/Cargo.toml | 2 +- contracts/math/andromeda-counter/Cargo.toml | 2 +- contracts/math/andromeda-curve/Cargo.toml | 2 +- contracts/math/andromeda-date-time/Cargo.toml | 2 +- contracts/math/andromeda-graph/Cargo.toml | 4 ++- .../math/andromeda-graph/src/contract.rs | 15 +++++++++- .../math/andromeda-graph/src/interface.rs | 6 ++++ contracts/math/andromeda-graph/src/lib.rs | 5 ++++ contracts/math/andromeda-matrix/Cargo.toml | 2 +- contracts/math/andromeda-point/Cargo.toml | 3 +- .../math/andromeda-point/src/contract.rs | 13 ++++++++- .../math/andromeda-point/src/interface.rs | 6 ++++ contracts/math/andromeda-point/src/lib.rs | 5 ++++ contracts/math/andromeda-shunting/Cargo.toml | 2 +- contracts/modules/andromeda-schema/Cargo.toml | 2 +- packages/deploy/Cargo.toml | 2 ++ packages/deploy/src/contracts.rs | 4 +++ 21 files changed, 85 insertions(+), 26 deletions(-) create mode 100644 contracts/math/andromeda-graph/src/interface.rs create mode 100644 contracts/math/andromeda-point/src/interface.rs diff --git a/Cargo.lock b/Cargo.lock index c473f910c..3e9d5f67c 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -166,7 +166,7 @@ dependencies = [ [[package]] name = "andromeda-boolean" -version = "0.1.0-beta" +version = "0.1.0-b.1" dependencies = [ "andromeda-data-storage", "andromeda-std", @@ -198,7 +198,7 @@ dependencies = [ [[package]] name = "andromeda-counter" -version = "0.1.0-beta" +version = "0.1.0-b.1" dependencies = [ "andromeda-math", "andromeda-std", @@ -249,7 +249,7 @@ dependencies = [ [[package]] name = "andromeda-curve" -version = "0.1.1-beta" +version = "0.1.0-b.1" dependencies = [ "andromeda-app", "andromeda-math", @@ -349,7 +349,7 @@ dependencies = [ [[package]] name = "andromeda-date-time" -version = "0.1.0-beta" +version = "0.1.0-b.1" dependencies = [ "andromeda-app", "andromeda-math", @@ -384,12 +384,14 @@ dependencies = [ "andromeda-date-time", "andromeda-distance", "andromeda-economics", + "andromeda-graph", "andromeda-ibc-registry", "andromeda-kernel", "andromeda-lockdrop", "andromeda-macros", "andromeda-marketplace", "andromeda-merkle-airdrop", + "andromeda-point", "andromeda-primitive", "andromeda-rate-limiting-withdrawals", "andromeda-rates", @@ -497,7 +499,7 @@ dependencies = [ [[package]] name = "andromeda-fixed-multisig" -version = "0.1.0-beta" +version = "0.1.0-b.1" dependencies = [ "andromeda-accounts", "andromeda-app", @@ -515,7 +517,7 @@ dependencies = [ [[package]] name = "andromeda-form" -version = "0.1.0-beta" +version = "0.1.0-b.1" dependencies = [ "andromeda-data-storage", "andromeda-modules", @@ -552,7 +554,7 @@ dependencies = [ [[package]] name = "andromeda-graph" -version = "0.1.0-beta" +version = "0.1.0-b.1" dependencies = [ "andromeda-math", "andromeda-std", @@ -560,6 +562,7 @@ dependencies = [ "cosmwasm-schema", "cosmwasm-std", "cw-multi-test", + "cw-orch", "cw-storage-plus 1.2.0", "cw-utils 1.0.3", "cw20", @@ -681,7 +684,7 @@ dependencies = [ [[package]] name = "andromeda-matrix" -version = "0.1.0-beta" +version = "0.1.0-b.1" dependencies = [ "andromeda-math", "andromeda-std", @@ -747,7 +750,7 @@ dependencies = [ [[package]] name = "andromeda-point" -version = "0.1.0-beta" +version = "0.1.0-b.1" dependencies = [ "andromeda-math", "andromeda-std", @@ -755,6 +758,7 @@ dependencies = [ "cosmwasm-schema", "cosmwasm-std", "cw-multi-test", + "cw-orch", "cw-storage-plus 1.2.0", "cw-utils 1.0.3", ] @@ -811,7 +815,7 @@ dependencies = [ [[package]] name = "andromeda-schema" -version = "0.1.0-beta" +version = "0.1.0-b.1" dependencies = [ "andromeda-app", "andromeda-modules", @@ -846,7 +850,7 @@ dependencies = [ [[package]] name = "andromeda-shunting" -version = "0.2.3" +version = "0.1.0-b.1" dependencies = [ "andromeda-app", "andromeda-math", @@ -915,7 +919,7 @@ dependencies = [ [[package]] name = "andromeda-string-storage" -version = "0.1.0-beta" +version = "0.1.0-b.1" dependencies = [ "andromeda-data-storage", "andromeda-std", diff --git a/contracts/accounts/andromeda-fixed-multisig/Cargo.toml b/contracts/accounts/andromeda-fixed-multisig/Cargo.toml index 0e7eaa090..889b36a17 100644 --- a/contracts/accounts/andromeda-fixed-multisig/Cargo.toml +++ b/contracts/accounts/andromeda-fixed-multisig/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "andromeda-fixed-multisig" -version = "0.1.0-beta" +version = "0.1.0-b.1" edition = "2021" rust-version = "1.75.0" diff --git a/contracts/data-storage/andromeda-boolean/Cargo.toml b/contracts/data-storage/andromeda-boolean/Cargo.toml index bc3e88075..9313105ce 100644 --- a/contracts/data-storage/andromeda-boolean/Cargo.toml +++ b/contracts/data-storage/andromeda-boolean/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "andromeda-boolean" -version = "0.1.0-beta" +version = "0.1.0-b.1" authors = ["Mitar Djakovic "] edition = "2021" rust-version = "1.75.0" diff --git a/contracts/data-storage/andromeda-form/Cargo.toml b/contracts/data-storage/andromeda-form/Cargo.toml index 4dc5d3727..c5f62eb1c 100644 --- a/contracts/data-storage/andromeda-form/Cargo.toml +++ b/contracts/data-storage/andromeda-form/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "andromeda-form" -version = "0.1.0-beta" +version = "0.1.0-b.1" authors = ["Mitar Djakovic "] edition = "2021" rust-version = "1.75.0" diff --git a/contracts/data-storage/andromeda-string-storage/Cargo.toml b/contracts/data-storage/andromeda-string-storage/Cargo.toml index eed757632..4be025bcf 100644 --- a/contracts/data-storage/andromeda-string-storage/Cargo.toml +++ b/contracts/data-storage/andromeda-string-storage/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "andromeda-string-storage" -version = "0.1.0-beta" +version = "0.1.0-b.1" authors = ["Mitar Djakovic "] edition = "2021" rust-version = "1.75.0" diff --git a/contracts/math/andromeda-counter/Cargo.toml b/contracts/math/andromeda-counter/Cargo.toml index e2f1740e4..ff2a5074c 100644 --- a/contracts/math/andromeda-counter/Cargo.toml +++ b/contracts/math/andromeda-counter/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "andromeda-counter" -version = "0.1.0-beta" +version = "0.1.0-b.1" authors = ["Mitar Djakovic "] edition = "2021" rust-version = "1.75.0" diff --git a/contracts/math/andromeda-curve/Cargo.toml b/contracts/math/andromeda-curve/Cargo.toml index 5c7f608a3..99973054e 100644 --- a/contracts/math/andromeda-curve/Cargo.toml +++ b/contracts/math/andromeda-curve/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "andromeda-curve" -version = "0.1.1-beta" +version = "0.1.0-b.1" edition = "2021" rust-version = "1.75.0" diff --git a/contracts/math/andromeda-date-time/Cargo.toml b/contracts/math/andromeda-date-time/Cargo.toml index 56d5f5631..6f9bfddd3 100644 --- a/contracts/math/andromeda-date-time/Cargo.toml +++ b/contracts/math/andromeda-date-time/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "andromeda-date-time" -version = "0.1.0-beta" +version = "0.1.0-b.1" edition = "2021" rust-version = "1.75.0" diff --git a/contracts/math/andromeda-graph/Cargo.toml b/contracts/math/andromeda-graph/Cargo.toml index 1ce4c3aa4..2b23444af 100644 --- a/contracts/math/andromeda-graph/Cargo.toml +++ b/contracts/math/andromeda-graph/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "andromeda-graph" -version = "0.1.0-beta" +version = "0.1.0-b.1" edition = "2021" rust-version = "1.75.0" @@ -33,5 +33,7 @@ andromeda-std = { workspace = true } andromeda-math = { workspace = true } [target.'cfg(not(target_arch = "wasm32"))'.dependencies] +cw-orch = { workspace = true } cw-multi-test = { workspace = true, optional = true } andromeda-testing = { workspace = true, optional = true } + diff --git a/contracts/math/andromeda-graph/src/contract.rs b/contracts/math/andromeda-graph/src/contract.rs index a36c12b14..a65a65ac0 100644 --- a/contracts/math/andromeda-graph/src/contract.rs +++ b/contracts/math/andromeda-graph/src/contract.rs @@ -1,6 +1,8 @@ #[cfg(not(feature = "library"))] use cosmwasm_std::entry_point; -use cosmwasm_std::{attr, ensure, Binary, Deps, DepsMut, Env, MessageInfo, Response, Storage}; +use cosmwasm_std::{ + attr, ensure, Binary, Deps, DepsMut, Env, MessageInfo, Reply, Response, StdError, Storage, +}; use andromeda_math::graph::{ Coordinate, CoordinateInfo, ExecuteMsg, GetAllPointsResponse, GetMapInfoResponse, @@ -420,3 +422,14 @@ pub fn get_user_coordinate(deps: Deps, user: AndrAddr) -> Result Result { ADOContract::default().migrate(deps, CONTRACT_NAME, CONTRACT_VERSION) } + +#[cfg_attr(not(feature = "library"), entry_point)] +pub fn reply(_deps: DepsMut, _env: Env, msg: Reply) -> Result { + if msg.result.is_err() { + return Err(ContractError::Std(StdError::generic_err( + msg.result.unwrap_err(), + ))); + } + + Ok(Response::default()) +} diff --git a/contracts/math/andromeda-graph/src/interface.rs b/contracts/math/andromeda-graph/src/interface.rs new file mode 100644 index 000000000..499ad9d27 --- /dev/null +++ b/contracts/math/andromeda-graph/src/interface.rs @@ -0,0 +1,6 @@ +use andromeda_math::graph::{ExecuteMsg, InstantiateMsg, QueryMsg}; +use andromeda_std::{ado_base::MigrateMsg, contract_interface, deploy::ADOMetadata}; + +pub const CONTRACT_ID: &str = "graph"; + +contract_interface!(GraphContract, CONTRACT_ID, "andromeda_graph.wasm"); diff --git a/contracts/math/andromeda-graph/src/lib.rs b/contracts/math/andromeda-graph/src/lib.rs index abf4af66c..55c70b355 100644 --- a/contracts/math/andromeda-graph/src/lib.rs +++ b/contracts/math/andromeda-graph/src/lib.rs @@ -6,3 +6,8 @@ pub mod mock; #[cfg(test)] mod testing; + +#[cfg(not(target_arch = "wasm32"))] +mod interface; +#[cfg(not(target_arch = "wasm32"))] +pub use crate::interface::GraphContract; diff --git a/contracts/math/andromeda-matrix/Cargo.toml b/contracts/math/andromeda-matrix/Cargo.toml index d6975192f..627897ccb 100644 --- a/contracts/math/andromeda-matrix/Cargo.toml +++ b/contracts/math/andromeda-matrix/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "andromeda-matrix" -version = "0.1.0-beta" +version = "0.1.0-b.1" edition = "2021" rust-version = "1.75.0" diff --git a/contracts/math/andromeda-point/Cargo.toml b/contracts/math/andromeda-point/Cargo.toml index 149355a48..4cc71afd8 100644 --- a/contracts/math/andromeda-point/Cargo.toml +++ b/contracts/math/andromeda-point/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "andromeda-point" -version = "0.1.0-beta" +version = "0.1.0-b.1" authors = ["Mitar Djakovic "] edition = "2021" rust-version = "1.75.0" @@ -33,5 +33,6 @@ andromeda-std = { workspace = true, features = ["rates"] } andromeda-math = { workspace = true } [target.'cfg(not(target_arch = "wasm32"))'.dependencies] +cw-orch = { workspace = true } cw-multi-test = { workspace = true, optional = true } andromeda-testing = { workspace = true, optional = true } diff --git a/contracts/math/andromeda-point/src/contract.rs b/contracts/math/andromeda-point/src/contract.rs index 87827c0cd..106d422db 100644 --- a/contracts/math/andromeda-point/src/contract.rs +++ b/contracts/math/andromeda-point/src/contract.rs @@ -1,6 +1,6 @@ #[cfg(not(feature = "library"))] use cosmwasm_std::entry_point; -use cosmwasm_std::{Binary, Deps, DepsMut, Env, MessageInfo, Response}; +use cosmwasm_std::{Binary, Deps, DepsMut, Env, MessageInfo, Reply, Response, StdError}; use crate::{ execute::handle_execute, @@ -72,3 +72,14 @@ pub fn query(deps: Deps, env: Env, msg: QueryMsg) -> Result Result { ADOContract::default().migrate(deps, CONTRACT_NAME, CONTRACT_VERSION) } + +#[cfg_attr(not(feature = "library"), entry_point)] +pub fn reply(_deps: DepsMut, _env: Env, msg: Reply) -> Result { + if msg.result.is_err() { + return Err(ContractError::Std(StdError::generic_err( + msg.result.unwrap_err(), + ))); + } + + Ok(Response::default()) +} diff --git a/contracts/math/andromeda-point/src/interface.rs b/contracts/math/andromeda-point/src/interface.rs new file mode 100644 index 000000000..de21c387d --- /dev/null +++ b/contracts/math/andromeda-point/src/interface.rs @@ -0,0 +1,6 @@ +use andromeda_math::point::{ExecuteMsg, InstantiateMsg, QueryMsg}; +use andromeda_std::{ado_base::MigrateMsg, contract_interface, deploy::ADOMetadata}; + +pub const CONTRACT_ID: &str = "point"; + +contract_interface!(PointContract, CONTRACT_ID, "andromeda_point.wasm"); diff --git a/contracts/math/andromeda-point/src/lib.rs b/contracts/math/andromeda-point/src/lib.rs index 36553fb8f..a1bd6ec55 100644 --- a/contracts/math/andromeda-point/src/lib.rs +++ b/contracts/math/andromeda-point/src/lib.rs @@ -7,3 +7,8 @@ mod state; #[cfg(test)] mod testing; + +#[cfg(not(target_arch = "wasm32"))] +mod interface; +#[cfg(not(target_arch = "wasm32"))] +pub use crate::interface::PointContract; diff --git a/contracts/math/andromeda-shunting/Cargo.toml b/contracts/math/andromeda-shunting/Cargo.toml index 25f6efe14..fdddb9d0c 100644 --- a/contracts/math/andromeda-shunting/Cargo.toml +++ b/contracts/math/andromeda-shunting/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "andromeda-shunting" -version = "0.2.3" +version = "0.1.0-b.1" edition = "2021" [lib] diff --git a/contracts/modules/andromeda-schema/Cargo.toml b/contracts/modules/andromeda-schema/Cargo.toml index cee6c91a8..4459a0081 100644 --- a/contracts/modules/andromeda-schema/Cargo.toml +++ b/contracts/modules/andromeda-schema/Cargo.toml @@ -1,6 +1,6 @@ [package] name = "andromeda-schema" -version = "0.1.0-beta" +version = "0.1.0-b.1" edition = "2021" rust-version = "1.75.0" diff --git a/packages/deploy/Cargo.toml b/packages/deploy/Cargo.toml index 27704dac7..6d66a2230 100644 --- a/packages/deploy/Cargo.toml +++ b/packages/deploy/Cargo.toml @@ -83,6 +83,8 @@ andromeda-curve = { path = "../../contracts/math/andromeda-curve" } andromeda-distance = { path = "../../contracts/math/andromeda-distance" } andromeda-date-time = { path = "../../contracts/math/andromeda-date-time" } andromeda-shunting = { path = "../../contracts/math/andromeda-shunting" } +andromeda-graph = { path = "../../contracts/math/andromeda-graph" } +andromeda-point = { path = "../../contracts/math/andromeda-point" } andromeda-std = { workspace = true } env_logger = "0.11.6" diff --git a/packages/deploy/src/contracts.rs b/packages/deploy/src/contracts.rs index 52ae094af..fc723ef37 100644 --- a/packages/deploy/src/contracts.rs +++ b/packages/deploy/src/contracts.rs @@ -13,6 +13,7 @@ use andromeda_cw20_staking::CW20StakingContract; use andromeda_cw721::CW721Contract; use andromeda_distance::DistanceContract; use andromeda_economics::EconomicsContract; +use andromeda_graph::GraphContract; use andromeda_ibc_registry::IBCRegistryContract; use andromeda_kernel::KernelContract; use andromeda_lockdrop::LockdropContract; @@ -31,6 +32,7 @@ use andromeda_validator_staking::ValidatorStakingContract; use andromeda_vesting::VestingContract; use andromeda_vfs::VFSContract; use andromeda_weighted_distribution_splitter::WeightedDistributionSplitterContract; +use andromeda_point::PointContract; use cw_orch::prelude::*; use cw_orch_daemon::{DaemonBase, Wallet}; @@ -84,6 +86,8 @@ pub fn all_contracts() -> Vec { deployable!(CrowdfundContract), deployable!(MarketplaceContract), deployable!(DistanceContract), + deployable!(GraphContract), + deployable!(PointContract), ] } From 5a371f2be71e223add80e52de858781f57b45117 Mon Sep 17 00:00:00 2001 From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com> Date: Wed, 8 Jan 2025 08:14:43 +0000 Subject: [PATCH 21/21] build(deps): bump softprops/action-gh-release from 2.2.0 to 2.2.1 (#753) Signed-off-by: dependabot[bot] Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com> --- .github/workflows/release.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 91557a0e9..336088a47 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -26,7 +26,7 @@ jobs: run: tar -czf contracts.tar.gz artifacts/ - name: Create Release - uses: softprops/action-gh-release@v2.2.0 + uses: softprops/action-gh-release@v2.2.1 with: files: | contracts.tar.gz