forked from DA0-DA0/dao-contracts
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
add btsg-ft-factory to cw-orch setup
- Loading branch information
hard-nett
authored and
Jake Hartnell
committed
Aug 14, 2024
1 parent
e836dd1
commit 65091bd
Showing
19 changed files
with
252 additions
and
153 deletions.
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
use cw_orch::{interface, prelude::*}; | ||
|
||
use cw_payroll_factory::contract::{execute, instantiate, query, reply}; | ||
use cw_payroll_factory::msg::{ExecuteMsg, InstantiateMsg, QueryMsg}; | ||
|
||
#[interface(InstantiateMsg, ExecuteMsg, QueryMsg, Empty)] | ||
pub struct DaoExternalFantokenFactory; | ||
|
||
impl<Chain> Uploadable for DaoExternalFantokenFactory<Chain> { | ||
/// Return the path to the wasm file corresponding to the contract | ||
fn wasm(_chain: &ChainInfoOwned) -> WasmPath { | ||
artifacts_dir_from_workspace!() | ||
.find_wasm_path("btsg_ft_factory") | ||
.unwrap() | ||
} | ||
/// Returns a CosmWasm contract wrapper | ||
fn wrapper() -> Box<dyn MockContract<Empty>> { | ||
Box::new(ContractWrapper::new_with_empty(execute, instantiate, query).with_reply(reply)) | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,152 @@ | ||
use cw_orch::prelude::*; | ||
use dao_cw_orch::*; | ||
|
||
// admin factory | ||
pub struct AdminFactorySuite<Chain> { | ||
pub factory: DaoExternalAdminFactory<Chain>, | ||
} | ||
impl<Chain: CwEnv> AdminFactorySuite<Chain> { | ||
pub fn new(chain: Chain) -> AdminFactorySuite<Chain> { | ||
AdminFactorySuite::<Chain> { | ||
factory: DaoExternalAdminFactory::new("cw_admin_factory", chain.clone()), | ||
} | ||
} | ||
|
||
pub fn upload(&self) -> Result<(), CwOrchError> { | ||
self.factory.upload()?; | ||
|
||
Ok(()) | ||
} | ||
} | ||
|
||
// bitsong fantoken factory | ||
pub struct FantokenFactorySuite<Chain> { | ||
pub factory: DaoExternalFantokenFactory<Chain>, | ||
} | ||
|
||
impl<Chain: CwEnv> DaoExternalFantokenFactory<Chain> { | ||
pub fn new(chain: Chain) -> DaoExternalFantokenFactory<Chain> { | ||
DaoExternalFantokenFactory::<Chain> { | ||
factory: DaoExternalFantokenFactory::new("btsg_ft_factory", chain.clone()), | ||
} | ||
} | ||
|
||
pub fn upload(&self) -> Result<(), CwOrchError> { | ||
self.factory.upload()?; | ||
|
||
Ok(()) | ||
} | ||
} | ||
|
||
// payroll factory | ||
pub struct PayrollSuite<Chain> { | ||
pub payroll: DaoExternalPayrollFactory<Chain>, | ||
pub vesting: DaoExternalCwVesting<Chain>, | ||
} | ||
impl<Chain: CwEnv> PayrollSuite<Chain> { | ||
pub fn new(chain: Chain) -> PayrollSuite<Chain> { | ||
PayrollSuite::<Chain> { | ||
payroll: DaoExternalPayrollFactory::new("cw_payroll", chain.clone()), | ||
vesting: DaoExternalCwVesting::new("cw_vesting", chain.clone()), | ||
} | ||
} | ||
|
||
pub fn upload(&self) -> Result<(), CwOrchError> { | ||
self.payroll.upload()?; | ||
self.vesting.upload()?; | ||
Ok(()) | ||
} | ||
} | ||
|
||
// cw tokenswap | ||
pub struct TokenSwapSuite<Chain> { | ||
pub tokenswap: DaoExternalTokenSwap<Chain>, | ||
} | ||
impl<Chain: CwEnv> TokenSwapSuite<Chain> { | ||
pub fn new(chain: Chain) -> TokenSwapSuite<Chain> { | ||
TokenSwapSuite::<Chain> { | ||
tokenswap: DaoExternalTokenSwap::new("cw_tokenswap", chain.clone()), | ||
} | ||
} | ||
|
||
pub fn upload(&self) -> Result<(), CwOrchError> { | ||
self.tokenswap.upload()?; | ||
|
||
Ok(()) | ||
} | ||
} | ||
|
||
// cw-tokenfactory issuer | ||
pub struct TokenFactorySuite<Chain> { | ||
pub tokenfactory: DaoExternalTokenfactoryIssuer<Chain>, | ||
} | ||
impl<Chain: CwEnv> TokenFactorySuite<Chain> { | ||
pub fn new(chain: Chain) -> TokenFactorySuite<Chain> { | ||
TokenFactorySuite::<Chain> { | ||
tokenfactory: DaoExternalTokenfactoryIssuer::new("cw_tokenfactory", chain.clone()), | ||
} | ||
} | ||
|
||
pub fn upload(&self) -> Result<(), CwOrchError> { | ||
self.tokenfactory.upload()?; | ||
|
||
Ok(()) | ||
} | ||
} | ||
|
||
// cw-vesting | ||
pub struct VestingSuite<Chain> { | ||
pub vesting: DaoExternalCwVesting<Chain>, | ||
} | ||
|
||
impl<Chain: CwEnv> VestingSuite<Chain> { | ||
pub fn new(chain: Chain) -> VestingSuite<Chain> { | ||
VestingSuite::<Chain> { | ||
vesting: DaoExternalCwVesting::new("dao_dao_core", chain.clone()), | ||
} | ||
} | ||
|
||
pub fn upload(&self) -> Result<(), CwOrchError> { | ||
self.vesting.upload()?; | ||
|
||
Ok(()) | ||
} | ||
} | ||
|
||
// cw721 roles | ||
pub struct Cw721RolesSuite<Chain> { | ||
pub roles: DaoExternalCw721Roles<Chain>, | ||
} | ||
|
||
impl<Chain: CwEnv> Cw721RolesSuite<Chain> { | ||
pub fn new(chain: Chain) -> Cw721RolesSuite<Chain> { | ||
Cw721RolesSuite::<Chain> { | ||
roles: DaoExternalCw721Roles::new("cw721_roles", chain.clone()), | ||
} | ||
} | ||
|
||
pub fn upload(&self) -> Result<(), CwOrchError> { | ||
self.roles.upload()?; | ||
|
||
Ok(()) | ||
} | ||
} | ||
|
||
// migrator | ||
pub struct DaoMigrationSuite<Chain> { | ||
pub migrator: DaoExternalMigrator<Chain>, | ||
} | ||
|
||
impl<Chain: CwEnv> DaoMigrationSuite<Chain> { | ||
pub fn new(chain: Chain) -> DaoMigrationSuite<Chain> { | ||
DaoMigrationSuite::<Chain> { | ||
migrator: DaoExternalMigrator::new("dao_migrator", chain.clone()), | ||
} | ||
} | ||
|
||
pub fn upload(&self) -> Result<(), CwOrchError> { | ||
self.migrator.upload()?; | ||
|
||
Ok(()) | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.