Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Prepare for BelieveAthon #548

Merged
merged 46 commits into from
Dec 16, 2024
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
Show all changes
46 commits
Select commit Hold shift + click to select a range
a1b7787
Deployed scripts, standardized apps deploy scripts
Kayanski Nov 26, 2024
ca55736
add ANS update script
Kayanski Nov 26, 2024
b5d5125
Remove ans deploy logic
Kayanski Nov 27, 2024
dab2123
Merge remote-tracking branch 'origin/main' into deploy/apps-adapters-…
Kayanski Nov 27, 2024
02a8439
Tests upload the dex adapter now
Kayanski Nov 27, 2024
00f8e71
Some more corrections and remove deps
Kayanski Nov 27, 2024
920d560
Modified workflows
Kayanski Nov 27, 2024
10b2873
Corrections
Kayanski Nov 27, 2024
05e4607
Another fix
Kayanski Nov 27, 2024
bdfffe5
Update module action
Kayanski Nov 27, 2024
4bfca3b
Framework machete
Kayanski Nov 27, 2024
0a3f662
machete test
Kayanski Nov 27, 2024
49366ea
Same syntax with modules ?
Kayanski Nov 27, 2024
5719ee6
Nochmal
Kayanski Nov 27, 2024
c8e261c
Framework
Kayanski Nov 27, 2024
a9f45d7
Modules ci
Kayanski Nov 27, 2024
194ad41
Fix other tests
Kayanski Nov 28, 2024
484a35b
Lint
Kayanski Nov 28, 2024
2630eb3
Lint
Kayanski Nov 28, 2024
d0741f0
Clippy and test fix
Kayanski Nov 28, 2024
3c17e26
Fix features on client
Kayanski Nov 28, 2024
b971af4
Some clippy fixes
Kayanski Nov 28, 2024
bcbab6d
Clippy
Kayanski Nov 29, 2024
317a04a
Added cw2 adapters updated
Kayanski Nov 29, 2024
bd9768c
Reactivation of adapters
Kayanski Nov 29, 2024
7923995
Clippy
Kayanski Nov 30, 2024
2c1474f
Remove unused dep
Kayanski Nov 30, 2024
0223d70
Started adding neutron dex adapter
Kayanski Dec 1, 2024
3968da3
Updated to cosmwasm 2.0, dex adapter on neutron
Kayanski Dec 2, 2024
67e77b1
Neutron and osmosis tests
Kayanski Dec 2, 2024
cc7bd0c
Added local for testing on dex adapter
Kayanski Dec 2, 2024
34cd097
Added payment app + corrected local chain
Kayanski Dec 2, 2024
06fadd6
Merge remote-tracking branch 'origin/main' into deploy/apps-adapters-…
Kayanski Dec 16, 2024
4c8a301
Fix merges
Kayanski Dec 16, 2024
be1bc09
Unused deps
Kayanski Dec 16, 2024
94e273c
Better deps
Kayanski Dec 16, 2024
c00665b
Fixed tests and features
Kayanski Dec 16, 2024
da5fd94
Update WASM & Schemas [skip ci]
Kayanski Dec 16, 2024
b0707be
trigger ci
Kayanski Dec 16, 2024
29af530
Merge branch 'deploy/apps-adapters-believathon' of github.com:Abstrac…
Kayanski Dec 16, 2024
59f89e5
Merge remote-tracking branch 'origin/main' into deploy/apps-adapters-…
Kayanski Dec 16, 2024
b39f050
Fix CI
Kayanski Dec 16, 2024
71a3550
Update integrations/neutron-dex-adapter/Cargo.toml
Kayanski Dec 16, 2024
74640eb
Update integrations/neutron-dex-adapter/Cargo.toml
Kayanski Dec 16, 2024
054c244
CLI
Kayanski Dec 16, 2024
553c207
Merge branch 'deploy/apps-adapters-believathon' of github.com:Abstrac…
Kayanski Dec 16, 2024
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
6 changes: 1 addition & 5 deletions interchain/scripts/src/bin/deploy_modules.rs
Original file line number Diff line number Diff line change
Expand Up @@ -17,18 +17,14 @@ pub const ABSTRACT_VERSION: &str = env!("CARGO_PKG_VERSION");

// Run "cargo run --example download_wasms" in the `abstract-interfaces` package before deploying!
fn full_deploy() -> anyhow::Result<()> {
let rt = Runtime::new()?;

let deployment = Abstract::<Daemon>::get_all_deployed_chains();
let networks: Vec<ChainInfo> = deployment
.iter()
.map(|n| parse_network(n).unwrap())
.collect();

for network in networks {
let chain = DaemonBuilder::new(network.clone())
.handle(rt.handle())
.build()?;
let chain = DaemonBuilder::new(network.clone()).build()?;

// Deploy Adapters
CwStakingAdapter::new(CW_STAKING_ADAPTER_ID, chain.clone()).deploy(
Expand Down
29 changes: 14 additions & 15 deletions interchain/scripts/src/bin/full_deploy.rs
Original file line number Diff line number Diff line change
@@ -1,34 +1,25 @@
use abstract_interface::{Abstract, AccountI};
use abstract_interface::{Abstract, AccountI, ExecuteMsgFns};
use abstract_std::objects::gov_type::GovernanceDetails;
use std::{
fs::{self, File},
io::BufReader,
net::TcpStream,
};
use cw_asset::AssetInfoUnchecked;
use cw_orch_daemon::RUNTIME;

use abstract_scripts::{assert_wallet_balance, DeploymentStatus, SUPPORTED_CHAINS};
use abstract_scripts::{assert_wallet_balance, SUPPORTED_CHAINS};

use clap::Parser;
use cw_orch::{daemon::networks::parse_network, prelude::*};
use reqwest::Url;
use tokio::runtime::Runtime;

pub const ABSTRACT_VERSION: &str = env!("CARGO_PKG_VERSION");

// Run "cargo run --example download_wasms" in the `abstract-interfaces` package before deploying!
fn full_deploy(mut networks: Vec<ChainInfoOwned>) -> anyhow::Result<()> {
let rt = Runtime::new()?;

if networks.is_empty() {
networks = SUPPORTED_CHAINS.iter().map(|x| x.clone().into()).collect();
}

let networks = rt.block_on(assert_wallet_balance(networks));
let networks = RUNTIME.block_on(assert_wallet_balance(networks));

for network in networks {
let chain = DaemonBuilder::new(network.clone())
.handle(rt.handle())
.build()?;
let chain = DaemonBuilder::new(network.clone()).build()?;

let monarch = chain.sender_addr();

Expand All @@ -50,6 +41,14 @@ fn full_deploy(mut networks: Vec<ChainInfoOwned>) -> anyhow::Result<()> {
monarch: monarch.to_string(),
},
)?;

// We register the gas asset of the chain to make sure there is a base asset there
let asset_denom = network.gas_denom;
let chain_name = network.network_info.chain_name;
Kayanski marked this conversation as resolved.
Show resolved Hide resolved
deployment.ans_host.update_asset_addresses(
vec![(chain_name, AssetInfoUnchecked::Native(asset_denom))],
vec![],
)?;
}

// fs::copy(Path::new("~/.cw-orchestrator/state.json"), to)
Expand Down
9 changes: 4 additions & 5 deletions interchain/scripts/src/bin/manual_deploy.rs
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ use abstract_scripts::assert_wallet_balance;
use abstract_std::objects::gov_type::GovernanceDetails;
use clap::Parser;
use cw_orch::{environment::NetworkInfoOwned, prelude::*};
use cw_orch_daemon::RUNTIME;
use reqwest::Url;
use tokio::runtime::Runtime;

Expand All @@ -16,17 +17,15 @@ pub const ABSTRACT_VERSION: &str = env!("CARGO_PKG_VERSION");
/// Script to deploy Abstract & polytone to a new network provided by commmand line arguments
/// Run "cargo run --example download_wasms" in the `abstract-interfaces` package before deploying!
fn manual_deploy(network: ChainInfoOwned) -> anyhow::Result<()> {
let rt = Runtime::new()?;

rt.block_on(assert_wallet_balance(vec![network.clone()]));
RUNTIME.block_on(assert_wallet_balance(vec![network.clone()]));

let urls = network.grpc_urls.to_vec();
for url in urls {
rt.block_on(ping_grpc(&url))?;
RUNTIME.block_on(ping_grpc(&url))?;
}

let chain = DaemonBuilder::new(network.clone())
.handle(rt.handle())
.handle(RUNTIME.handle())
.build()?;

let monarch = chain.sender_addr();
Expand Down
3 changes: 1 addition & 2 deletions interchain/scripts/src/bin/migrate.rs
Original file line number Diff line number Diff line change
Expand Up @@ -9,9 +9,8 @@ use tokio::runtime::Runtime;
pub const ABSTRACT_VERSION: &str = env!("CARGO_PKG_VERSION");

fn migrate(networks: Vec<ChainInfo>) -> anyhow::Result<()> {
let rt = Runtime::new()?;
for network in networks {
let chain = DaemonBuilder::new(network).handle(rt.handle()).build()?;
let chain = DaemonBuilder::new(network).build()?;

let deployment = Abstract::load_from(chain.clone())?;

Expand Down
17 changes: 17 additions & 0 deletions interchain/scripts/state.json
Original file line number Diff line number Diff line change
Expand Up @@ -3,17 +3,20 @@
"code_ids": {
"abstract:account": 11529,
"abstract:ans-host": 11528,
"abstract:cw-staking": 11559,
"abstract:dex": 11532,
"abstract:ibc-client": 11530,
"abstract:ibc-host": 11531,
"abstract:module-factory": 11526,
"abstract:ping-pong": 11558,
"abstract:registry": 11527,
"cw:blob": 11289
},
"default": {
"abstract:account-local-0": "osmo1hafge5xucuc03ar5lkwac0n9yctnxq6xrgygftdl9xl3tzncgghshnykry",
"abstract:account-local-1": "osmo1v9dl0fw5s3jujn6emmlgch7w4ynt02nykj75pnzk8mdw7nmu3p4q65tczp",
"abstract:ans-host": "osmo1wx0qjtlz799pfxl73y2f4dv28nukztpmq2ztavk60v534tat9cdsepnezp",
"abstract:cw-staking": "osmo13kp8fv0t869zcwjh9q52eygxf8w0d8anmzhgrrz5tjju9uw3fscq9mhw4u",
"abstract:dex": "osmo1s8nvehqc0jf99ac2qqg0sqja5ydzxlvht3eml9swl3n736tz9dsqfc4wa4",
"abstract:ibc-client": "osmo1vnt8tpxrnukcydma2x6gy2zzawl9uxmc6las8cak9sd87q67n00qn0wkj7",
"abstract:ibc-host": "osmo1zzgxwn88a3ec34fw4mu8ppsh9eth746l3tl8w5l7qvknrmtldldqz7saee",
Expand All @@ -25,16 +28,19 @@
"code_ids": {
"abstract:account": 8232,
"abstract:ans-host": 8231,
"abstract:dex": 8326,
"abstract:ibc-client": 8233,
"abstract:ibc-host": 8234,
"abstract:module-factory": 8229,
"abstract:ping-pong": 8327,
"abstract:registry": 8230,
"cw:blob": 7399
},
"default": {
"abstract:account-local-0": "neutron12x9fcuwl382vv9l22dkcvcx6uxpeqy9rq5fe3jt8cgvqkyjnj2hs5da0m4",
"abstract:account-local-1": "neutron1mxahhvpj467088td8lvysyw7m8v880tzls0sxk0zuljn6tsufqksy8whnv",
"abstract:ans-host": "neutron1wx0qjtlz799pfxl73y2f4dv28nukztpmq2ztavk60v534tat9cdsdn69ty",
"abstract:dex": "neutron1tfnw5arga534563m04aap52f6m7ug8frdpesjhlth89r0jakphps25xug7",
"abstract:ibc-client": "neutron1n9la68zja4l76plwffedj24ar3f6e5kg7j92r26hhzewncghypvs9vk28k",
"abstract:ibc-host": "neutron1c67x66rln9mgrjum5urrgn0tjvup5k9uke8hgdm8tu7hztwrjy4s5ecrmu",
"abstract:module-factory": "neutron1vnj802lyyupfaez73w7axfs3xveraxen370vhcnumaufj29r5rxqv5yh44",
Expand All @@ -61,20 +67,31 @@
"abstract:registry": "cosmos1cag6cwygef6fuddgq2l44py7crpscufrza4mt3rum2axueemenmq7u74fa"
}
},
"uni-6": {
"code_ids": {},
"default": {}
},
"xion-testnet-1": {
"code_ids": {
"abstract:account": 1373,
"abstract:ans-host": 1372,
"abstract:calendar": 1389,
"abstract:challenge": 1390,
"abstract:dex": 1393,
"abstract:ibc-client": 1374,
"abstract:ibc-host": 1375,
"abstract:module-factory": 1370,
"abstract:payment": 1394,
"abstract:ping-pong": 1391,
"abstract:registry": 1371,
"abstract:subscription": 1392,
"cw:blob": 1278
},
"default": {
"abstract:account-local-0": "xion10wvm0t3de2k23x6da6whwy30p3prt4gx3fx3klcjw36hgrjd44wsf86jwl",
"abstract:account-local-1": "xion1dnymc7khmeq9ya3hjs45cthwp3gnvpl2gynw0dvw6hyxv7enj6uqj8mf9p",
"abstract:ans-host": "xion1wx0qjtlz799pfxl73y2f4dv28nukztpmq2ztavk60v534tat9cdskfcdvu",
"abstract:dex": "xion1rx2pvplyue5u2slmxkpzans0htmhansl47k3fk4yl6anha0nvs4qr800c3",
Kayanski marked this conversation as resolved.
Show resolved Hide resolved
"abstract:ibc-client": "xion1e74x0upzwsjvt6p8t5wu33cdnavsn5kcl6ndf8l2hpeah9c94tfqs6lx3w",
"abstract:ibc-host": "xion14rwy72dckjtpvtw26yppgfr6jqw4y06tf68axefzk5xjplm9ue6qvtqxjl",
"abstract:module-factory": "xion1vnj802lyyupfaez73w7axfs3xveraxen370vhcnumaufj29r5rxqhwxljd",
Expand Down
24 changes: 10 additions & 14 deletions modules/contracts/adapters/cw-staking/examples/deploy.rs
Original file line number Diff line number Diff line change
@@ -1,13 +1,12 @@
use abstract_adapter::abstract_interface::{
AdapterDeployer, DeployStrategy, Registry, RegistryExecFns,
Abstract, AdapterDeployer, DeployStrategy, RegistryExecFns,
};
use abstract_adapter::std::{
adapter,
objects::module::{Module, ModuleInfo, ModuleVersion},
REGISTRY,
};
use abstract_cw_staking::{interface::CwStakingAdapter, CW_STAKING_ADAPTER_ID};
use cosmwasm_std::{Addr, Empty};
use cosmwasm_std::Empty;
use cw_orch::{daemon::DaemonBuilder, prelude::*};

const CONTRACT_VERSION: &str = env!("CARGO_PKG_VERSION");
Expand All @@ -17,17 +16,12 @@ fn deploy_cw_staking(
prev_version: Option<String>,
code_id: Option<u64>,
) -> anyhow::Result<()> {
let rt = tokio::runtime::Runtime::new().unwrap();
let chain = DaemonBuilder::new(network).handle(rt.handle()).build()?;
let chain = DaemonBuilder::new(network).build()?;

let registry = Registry::new(REGISTRY, chain.clone());
// TODO: it's known address
registry.set_address(&Addr::unchecked(
std::env::var("REGISTRY").expect("REGISTRY not set"),
));
let abstr = Abstract::load_from(chain.clone())?;

if let Some(prev_version) = prev_version {
let Module { info, reference } = registry.module(ModuleInfo::from_id(
let Module { info, reference } = abstr.registry.module(ModuleInfo::from_id(
CW_STAKING_ADAPTER_ID,
ModuleVersion::from(prev_version),
)?)?;
Expand All @@ -36,21 +30,23 @@ fn deploy_cw_staking(
version: ModuleVersion::from(CONTRACT_VERSION),
..info
};
registry.propose_modules(vec![(new_info, reference)])?;
abstr
.registry
.propose_modules(vec![(new_info, reference)])?;
} else if let Some(code_id) = code_id {
let mut cw_staking = CwStakingAdapter::new(CW_STAKING_ADAPTER_ID, chain);
cw_staking.set_code_id(code_id);
let init_msg = adapter::InstantiateMsg {
module: Empty {},
base: adapter::BaseInstantiateMsg {
registry_address: registry.addr_str()?,
registry_address: abstr.registry.addr_str()?,
},
};
cw_staking
.as_instance_mut()
.instantiate(&init_msg, None, &[])?;

registry.register_adapters(vec![(
abstr.registry.register_adapters(vec![(
cw_staking.as_instance_mut(),
CONTRACT_VERSION.to_string(),
)])?;
Expand Down
48 changes: 26 additions & 22 deletions modules/contracts/adapters/dex/examples/deploy.rs
Original file line number Diff line number Diff line change
@@ -1,37 +1,38 @@
use abstract_dex_adapter::{interface::DexAdapter, msg::DexInstantiateMsg, DEX_ADAPTER_ID};
use abstract_dex_adapter::{
contract::CONTRACT_VERSION, interface::DexAdapter, msg::DexInstantiateMsg, DEX_ADAPTER_ID,
};
use abstract_interface::{AdapterDeployer, DeployStrategy};
use cosmwasm_std::Decimal;
use cw_orch::daemon::networks::parse_network;
use cw_orch::prelude::*;
use semver::Version;

const CONTRACT_VERSION: &str = env!("CARGO_PKG_VERSION");

fn deploy_dex(network: ChainInfo) -> anyhow::Result<()> {
let rt = Runtime::new()?;
let version: Version = CONTRACT_VERSION.parse().unwrap();
let chain = DaemonBuilder::new(network).handle(rt.handle()).build()?;
let dex = DexAdapter::new(DEX_ADAPTER_ID, chain);
dex.deploy(
version,
DexInstantiateMsg {
swap_fee: Decimal::percent(1),
recipient_account: 0,
},
DeployStrategy::Try,
)?;
fn deploy_dex(networks: Vec<ChainInfo>) -> anyhow::Result<()> {
// run for each requested network
for network in networks {
let version: Version = CONTRACT_VERSION.parse().unwrap();
let chain = DaemonBuilder::new(network).build()?;
let dex = DexAdapter::new(DEX_ADAPTER_ID, chain);
dex.deploy(
version,
DexInstantiateMsg {
swap_fee: Decimal::percent(1),
recipient_account: 0,
},
DeployStrategy::Try,
)?;
}
Ok(())
}

use clap::Parser;
use tokio::runtime::Runtime;

#[derive(Parser, Default, Debug)]
#[command(author, version, about, long_about = None)]
struct Arguments {
/// Network Id to deploy on
#[arg(short, long)]
network_id: String,
#[arg(short, long, value_delimiter = ' ', num_args = 1..)]
network_ids: Vec<String>,
}

fn main() -> anyhow::Result<()> {
Expand All @@ -41,8 +42,11 @@ fn main() -> anyhow::Result<()> {
use dotenv::dotenv;

let args = Arguments::parse();
let networks = args
.network_ids
.iter()
.map(|n| parse_network(n).unwrap())
.collect();

let network = parse_network(&args.network_id).unwrap();

deploy_dex(network)
deploy_dex(networks)
}
Kayanski marked this conversation as resolved.
Show resolved Hide resolved
4 changes: 1 addition & 3 deletions modules/contracts/adapters/money-market/examples/deploy.rs
Original file line number Diff line number Diff line change
Expand Up @@ -10,9 +10,8 @@ use semver::Version;
const CONTRACT_VERSION: &str = env!("CARGO_PKG_VERSION");

fn deploy_dex(network: ChainInfo) -> anyhow::Result<()> {
let rt = Runtime::new()?;
let version: Version = CONTRACT_VERSION.parse().unwrap();
let chain = DaemonBuilder::new(network).handle(rt.handle()).build()?;
let chain = DaemonBuilder::new(network).build()?;
let dex = MoneyMarketAdapter::new(MONEY_MARKET_ADAPTER_ID, chain);
dex.deploy(
version,
Expand All @@ -26,7 +25,6 @@ fn deploy_dex(network: ChainInfo) -> anyhow::Result<()> {
}

use clap::Parser;
use tokio::runtime::Runtime;

#[derive(Parser, Default, Debug)]
#[command(author, version, about, long_about = None)]
Expand Down
4 changes: 1 addition & 3 deletions modules/contracts/apps/calendar/examples/deploy.rs
Original file line number Diff line number Diff line change
Expand Up @@ -23,16 +23,14 @@ use clap::Parser;
use cw_orch::{
anyhow,
prelude::{networks::parse_network, *},
tokio::runtime::Runtime,
};
use semver::Version;

fn deploy(networks: Vec<ChainInfo>) -> anyhow::Result<()> {
// run for each requested network
for network in networks {
let version: Version = APP_VERSION.parse().unwrap();
let rt = Runtime::new()?;
let chain = DaemonBuilder::new(network).handle(rt.handle()).build()?;
let chain = DaemonBuilder::new(network).build()?;

let app = CalendarAppInterface::new(APP_ID, chain);
app.deploy(version, DeployStrategy::Try)?;
Expand Down
Loading
Loading