Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
36 changes: 18 additions & 18 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

4 changes: 2 additions & 2 deletions contracts/comp_prefs/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
[package]
name = "ymos-comp-prefs"
authors = ["Marc <marc@yieldmos.com>"]
version = { workspace = true }
edition = { workspace = true }
version = "1.0.0"
edition = "2021"
description = "Yieldmos Compounding Prefs Store"

exclude = [
Expand Down
5 changes: 4 additions & 1 deletion contracts/comp_prefs/src/contract.rs
Original file line number Diff line number Diff line change
Expand Up @@ -289,7 +289,10 @@ pub fn query(deps: Deps, env: Env, msg: QueryMsg) -> Result<Binary, ContractErro

Ok(to_json_binary(&user_prefs)?)
}
QueryMsg::StrategyPreferencesByPubkey { pubkey: _, status: _ } => {
QueryMsg::StrategyPreferencesByPubkey {
pubkey: _,
status: _,
} => {
let user_prefs: Vec<CompPref> = vec![];
// look up the pubkey in state
// PREFS_BY_PUBKEY.prefix(&pubkey.as_str()).range(deps.storage, None, None, Order::Ascending).filter_map(|strat_keys|
Expand Down
3 changes: 1 addition & 2 deletions contracts/comp_prefs/src/tests/integration_tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,9 @@ use crate::{
CompPref, CompoundingFrequency, EndType, InactiveStatus, StoreSettings,
UnverifiedUserCompPref, UserCompPref,
},
ContractError,
};
use cosmwasm_schema::cw_serde;
use cosmwasm_std::{to_json_binary, Addr, Decimal, StdError, Timestamp, Uint64};
use cosmwasm_std::{to_json_binary, Addr, Decimal, Timestamp, Uint64};
use cw_orch::{anyhow, prelude::*};

#[cw_serde]
Expand Down
4 changes: 2 additions & 2 deletions contracts/junodca/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
[package]
name = "ymos-junodca-outpost"
authors = ["Marc <marc@yieldmos.com>"]
version = { workspace = true }
edition = { workspace = true }
version = "1.0.0"
edition = "2021"
description = "Yieldmos Juno DCAing Outpost"

exclude = [
Expand Down
42 changes: 21 additions & 21 deletions contracts/junodca/src/execute.rs
Original file line number Diff line number Diff line change
@@ -1,22 +1,23 @@
use std::iter;

use cosmwasm_std::{Addr, Attribute, Decimal, Deps, DepsMut, Env, Event, MessageInfo, Response, SubMsg};
use juno_destinations::comp_prefs::{JunoCompPrefs, JunoDestinationProject, StakingDao};
use juno_destinations::dest_project_gen::{
balance_dao_msgs, gelotto_lottery_msgs, mint_juno_lsd_msgs, racoon_bet_msgs, send_tokens_msgs, wynd_staking_msgs,
};
use outpost_utils::{
comp_prefs::DestinationAction,
helpers::{
calc_additional_tax_split, calculate_compound_amounts, is_authorized_compounder, prefs_sum_to_one, DestProjectMsgs,
TaxSplitResult,
},

msg_gen::create_exec_msg,
};
use sail_destinations::dest_project_gen::{spark_ibc_msgs, white_whale_satellite_msgs};
use terraswap_helpers::terraswap_swap::create_terraswap_swap_msg_with_simulation;
use universal_destinations::dest_project_gen::{daodao_cw20_staking_msg, native_staking_msg};
use wynd_helpers::wynd_swap::{create_wyndex_swap_msg_with_simulation, simulate_and_swap_wynd_pair, wynd_pair_swap_msg};
use wyndex::asset::{Asset, AssetInfo};
use juno_destinations::comp_prefs::{JunoCompPrefs, JunoDestinationProject, StakingDao};
use juno_destinations::dest_project_gen::{balance_dao_msgs, gelotto_lottery_msgs, mint_juno_lsd_msgs, racoon_bet_msgs, send_tokens_msgs, wynd_staking_msgs};
use sail_destinations::dest_project_gen::{spark_ibc_msgs, white_whale_satellite_msgs};
use universal_destinations::dest_project_gen::{daodao_cw20_staking_msg, native_staking_msg};

use crate::{
msg::{ContractAddrs, DcaPrefs},
Expand Down Expand Up @@ -167,9 +168,11 @@ pub fn prefs_to_msgs(
if let StakingDao::Kleomedes = dao {
let mut noop_resp = DestProjectMsgs::default();

noop_resp.events.push(Event::new("dao_stake")
.add_attribute("dao", dao.to_string())
.add_attribute("status", "disabled"));
noop_resp.events.push(
Event::new("dao_stake")
.add_attribute("dao", dao.to_string())
.add_attribute("status", "disabled"),
);

return Ok(noop_resp);
}
Expand Down Expand Up @@ -197,7 +200,7 @@ pub fn prefs_to_msgs(
AssetInfo::Native(dca_denom.clone()),
AssetInfo::Token(dao_addresses.cw20.to_string()),
project_addrs.destination_projects.wynd.multihop.to_string(),
None
None,
)?
};

Expand Down Expand Up @@ -249,14 +252,7 @@ pub fn prefs_to_msgs(
sub_msgs: vec![],
events: vec![],
}),
JunoDestinationProject::WyndLp {
..
// contract_address,
// bonding_period,
} => {

Ok(DestProjectMsgs::default())
}
JunoDestinationProject::WyndLp { .. } => Ok(DestProjectMsgs::default()),
JunoDestinationProject::GelottoLottery { lottery, lucky_phrase } => Ok(gelotto_lottery_msgs(
user_addr,
project_addrs.take_rate_addr.clone(),
Expand All @@ -277,7 +273,10 @@ pub fn prefs_to_msgs(
&project_addrs.destination_projects.racoon_bet.game,
)?),
JunoDestinationProject::WhiteWhaleSatellite { asset } => {
let (swap_ops, denom) = project_addrs.destination_projects.white_whale.get_juno_swap_operations(asset)?;
let (swap_ops, denom) = project_addrs
.destination_projects
.white_whale
.get_juno_swap_operations(asset)?;

let (swap_msgs, sim) = create_terraswap_swap_msg_with_simulation(
&deps.querier,
Expand Down Expand Up @@ -322,7 +321,8 @@ pub fn prefs_to_msgs(
comp_token_amount,
compounding_asset.info,
project_addrs.usdc.clone(),
project_addrs.destination_projects.wynd.multihop.to_string(),None
project_addrs.destination_projects.wynd.multihop.to_string(),
None,
)?;

let mut spark_msgs = spark_ibc_msgs(
Expand All @@ -349,7 +349,8 @@ pub fn prefs_to_msgs(
comp_token_amount,
AssetInfo::Native(dca_denom.clone()),
target_asset.clone(),
project_addrs.destination_projects.wynd.multihop.to_string(),None
project_addrs.destination_projects.wynd.multihop.to_string(),
None,
)
.map_err(ContractError::Std)?;

Expand All @@ -369,7 +370,6 @@ pub fn prefs_to_msgs(
}
JunoDestinationProject::Unallocated {} => Ok(DestProjectMsgs::default()),
}

},
)
.collect::<Result<Vec<_>, ContractError>>()?;
Expand Down
15 changes: 3 additions & 12 deletions contracts/junodca/src/msg.rs
Original file line number Diff line number Diff line change
Expand Up @@ -94,22 +94,13 @@ pub struct ContractAddresses {

#[cw_serde]
#[derive(Default)]
pub struct AuthzppAddresses {
// pub withdraw_tax: String,
// pub allowlist_send: String,
}
pub struct AuthzppAddresses {}

#[cw_serde]
pub struct AuthzppAddrs {
// pub withdraw_tax: Addr,
// pub allowlist_send: Addr,
}
pub struct AuthzppAddrs {}
impl AuthzppAddresses {
pub fn validate_addrs(&self, _api: &dyn Api) -> Result<AuthzppAddrs, ContractError> {
Ok(AuthzppAddrs {
// withdraw_tax: api.addr_validate(&self.withdraw_tax)?,
// allowlist_send: api.addr_validate(&self.allowlist_send)?,
})
Ok(AuthzppAddrs {})
}
}

Expand Down
Loading