@@ -11,25 +11,27 @@ use clap_complete::{
11
11
use colored:: Colorize ;
12
12
use colored_json:: to_colored_json_auto;
13
13
use cosm_utils:: chain:: coin:: Denom ;
14
+ use cosm_utils:: cosmrs;
14
15
use cosm_utils:: modules:: bank:: model:: SendRequest ;
15
16
use cosm_utils:: prelude:: * ;
16
17
use cosm_utils:: {
17
18
chain:: { coin:: Coin , request:: TxOptions } ,
18
19
modules:: { auth:: model:: Address , cosmwasm:: model:: ExecRequest } ,
19
20
} ;
21
+ use cosmrs:: rpc:: client:: CompatMode ;
22
+ use cosmrs:: rpc:: { HttpClient , HttpClientUrl } ;
20
23
#[ cfg( feature = "wasm_opt" ) ]
21
24
use futures:: future:: join_all;
22
25
use inquire:: { MultiSelect , Select } ;
23
26
use interactive_parse:: InteractiveParseObj ;
24
27
use log:: info;
25
- use tendermint_rpc:: client:: CompatMode ;
26
- use tendermint_rpc:: { HttpClient , HttpClientUrl } ;
27
28
#[ cfg( feature = "wasm_opt" ) ]
28
29
use tokio:: task:: spawn_blocking;
29
30
#[ cfg( feature = "wasm_opt" ) ]
30
31
use wasm_opt:: integration:: run_from_command_args;
31
32
32
33
use crate :: config:: WorkspaceSettings ;
34
+ use crate :: cw20:: cw20_transfer;
33
35
use crate :: query:: query;
34
36
use crate :: utils:: print_res;
35
37
#[ cfg( wasm_cli) ]
90
92
Commands :: Instantiate {
91
93
contracts,
92
94
interactive,
95
+ coins,
93
96
dry_run,
94
- } => instantiate ( settings, contracts, * interactive, * dry_run) . await ?,
97
+ } => instantiate ( settings, contracts, * interactive, * coins , * dry_run) . await ?,
95
98
Commands :: Migrate {
96
99
contracts,
97
100
interactive,
@@ -116,6 +119,11 @@ where
116
119
cw20_query ( * dry_run) . await ?;
117
120
}
118
121
Commands :: Cw20Instantiate { dry_run } => cw20_instantiate ( * dry_run) . await ?,
122
+ Commands :: Cw20Transfer {
123
+ recipient,
124
+ contract_addr,
125
+ amount,
126
+ } => cw20_transfer ( recipient. clone ( ) , contract_addr. clone ( ) , * amount) . await ?,
119
127
Commands :: ExecutePayload { address, payload } => custom_execute ( address, payload) . await ?,
120
128
Commands :: QueryPayload { address, payload } => custom_query ( address, payload) . await ?,
121
129
Commands :: SetConfig { contracts, dry_run } => {
@@ -261,7 +269,7 @@ pub async fn deploy(
261
269
build ( settings, contracts, cargo_args) . await ?;
262
270
}
263
271
store_code ( settings, contracts, dry_run) . await ?;
264
- instantiate ( settings, contracts, dry_run , false ) . await ?;
272
+ instantiate ( settings, contracts, false , false , dry_run ) . await ?;
265
273
set_config ( settings, contracts, dry_run) . await ?;
266
274
set_up ( settings, contracts, dry_run) . await ?;
267
275
Ok ( ( ) )
@@ -582,7 +590,7 @@ pub async fn store_code(
582
590
let chunk_size = CONFIG . read ( ) . await . settings . store_code_chunk_size ;
583
591
let chunks = contracts. chunks ( chunk_size) ;
584
592
for chunk in chunks {
585
- execute_deployment ( settings, chunk, dry_run, DeploymentStage :: StoreCode ) . await ?;
593
+ execute_deployment ( settings, chunk, false , dry_run, DeploymentStage :: StoreCode ) . await ?;
586
594
}
587
595
Ok ( ( ) )
588
596
}
@@ -591,18 +599,21 @@ pub async fn instantiate(
591
599
settings : & WorkspaceSettings ,
592
600
contracts : & [ impl Deploy ] ,
593
601
interactive : bool ,
602
+ coins : bool ,
594
603
dry_run : bool ,
595
604
) -> anyhow:: Result < ( ) > {
596
605
execute_deployment (
597
606
settings,
598
607
contracts,
608
+ coins,
599
609
dry_run,
600
610
DeploymentStage :: Instantiate { interactive } ,
601
611
)
602
612
. await ?;
603
613
execute_deployment (
604
614
settings,
605
615
contracts,
616
+ coins,
606
617
dry_run,
607
618
DeploymentStage :: ExternalInstantiate ,
608
619
)
@@ -627,6 +638,7 @@ pub async fn migrate(
627
638
execute_deployment (
628
639
settings,
629
640
contracts,
641
+ false ,
630
642
dry_run,
631
643
DeploymentStage :: Migrate { interactive } ,
632
644
)
@@ -640,7 +652,14 @@ pub async fn set_config(
640
652
contracts : & [ impl Deploy ] ,
641
653
dry_run : bool ,
642
654
) -> anyhow:: Result < ( ) > {
643
- execute_deployment ( settings, contracts, dry_run, DeploymentStage :: SetConfig ) . await ?;
655
+ execute_deployment (
656
+ settings,
657
+ contracts,
658
+ false ,
659
+ dry_run,
660
+ DeploymentStage :: SetConfig ,
661
+ )
662
+ . await ?;
644
663
Ok ( ( ) )
645
664
}
646
665
@@ -649,7 +668,7 @@ pub async fn set_up(
649
668
contracts : & [ impl Deploy ] ,
650
669
dry_run : bool ,
651
670
) -> anyhow:: Result < ( ) > {
652
- execute_deployment ( settings, contracts, dry_run, DeploymentStage :: SetUp ) . await ?;
671
+ execute_deployment ( settings, contracts, false , dry_run, DeploymentStage :: SetUp ) . await ?;
653
672
Ok ( ( ) )
654
673
}
655
674
0 commit comments