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.
cw-abc: Updated hatch phase mechanics, donations, queries (DA0-DA0#699)
* Separate hatcher allowlist * Donation feature * Initial sell exit tax * Hatchers to amount * Hatch phase exit tax * TokenMsg methods * Format * Hatchers query * Fix bug where float was not taken into account in supply * Buy and sell refactoring * Update hatch phase config * Update phase config enum * Add adairrr to authors * Initial boot integration with custom msgs * Initial testing infrastructure * Abstract-OS to AbstractSDK
- Loading branch information
Showing
11 changed files
with
973 additions
and
416 deletions.
There are no files selected for viewing
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 |
---|---|---|
@@ -1,7 +1,7 @@ | ||
[package] | ||
name = "cw-abc" | ||
version = "0.0.1" | ||
authors = ["Ethan Frey <[email protected]>", "Jake Hartnell"] | ||
authors = ["Ethan Frey <[email protected]>", "Jake Hartnell", "Adair <[email protected]>"] | ||
edition = { workspace = true } | ||
description = "Implements an Augmented Bonding Curve" | ||
license = "Apache-2.0" | ||
|
@@ -16,6 +16,7 @@ crate-type = ["cdylib", "rlib"] | |
backtraces = ["cosmwasm-std/backtraces"] | ||
# use library feature to disable all instantiate/execute/query exports | ||
library = [] | ||
boot = ["dep:boot-core"] | ||
|
||
[dependencies] | ||
cw-utils = { workspace = true } | ||
|
@@ -32,7 +33,23 @@ integer-cbrt = "0.1.2" | |
# TODO publish this | ||
token-bindings = { git = "https://github.com/CosmosContracts/token-bindings", rev = "1412b94" } | ||
cw-ownable = { workspace = true } | ||
cw-paginate-storage = { workspace = true } | ||
boot-core = { version = "0.10.0", optional = true, git = "https://github.com/AbstractSDK/BOOT", branch = "fix/custom_binding_contract_wrapper" } | ||
|
||
[dev-dependencies] | ||
# TODO move to workspace | ||
speculoos = "0.11.0" | ||
#cw-multi-test = { version = "0.16.0" } | ||
anyhow = { workspace = true } | ||
cw-abc = { path = ".", features = ["boot"] } | ||
|
||
[profile.release] | ||
rpath = false | ||
lto = true | ||
overflow-checks = true | ||
opt-level = 3 | ||
debug = false | ||
debug-assertions = false | ||
codegen-units = 1 | ||
panic = 'abort' | ||
incremental = false |
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,43 @@ | ||
use crate::msg::*; | ||
use boot_core::{contract, Contract, CwEnv}; | ||
#[cfg(feature = "daemon")] | ||
use boot_core::{ArtifactsDir, Daemon, WasmPath}; | ||
use boot_core::{ContractWrapper, Mock, MockState, TxHandler, Uploadable}; | ||
use cosmwasm_std::Empty; | ||
use token_bindings::{TokenFactoryMsg, TokenFactoryQuery}; | ||
|
||
#[contract(InstantiateMsg, ExecuteMsg, QueryMsg, Empty)] | ||
pub struct CwAbc<Chain>; | ||
|
||
impl<Chain: CwEnv> CwAbc<Chain> { | ||
pub fn new(name: &str, chain: Chain) -> Self { | ||
let contract = Contract::new(name, chain); | ||
Self(contract) | ||
} | ||
} | ||
|
||
/// Basic app for the token factory contract | ||
/// TODO: should be in the bindings, along with custom handler for multi-test | ||
pub(crate) type TokenFactoryBasicApp = boot_core::BasicApp<TokenFactoryMsg, TokenFactoryQuery>; | ||
|
||
type TokenFactoryMock = Mock<MockState, TokenFactoryMsg, TokenFactoryQuery>; | ||
|
||
impl Uploadable<TokenFactoryMock> for CwAbc<TokenFactoryMock> { | ||
fn source(&self) -> <TokenFactoryMock as TxHandler>::ContractSource { | ||
Box::new(ContractWrapper::new( | ||
crate::contract::execute, | ||
crate::contract::instantiate, | ||
crate::contract::query, | ||
)) | ||
} | ||
} | ||
|
||
#[cfg(feature = "daemon")] | ||
impl Uploadable<Daemon> for CwAbc<Daemon> { | ||
fn source(&self) -> <Daemon as TxHandler>::ContractSource { | ||
ArtifactsDir::env() | ||
.expect("Expected ARTIFACTS_DIR in env") | ||
.find_wasm_path("cw_abc") | ||
.unwrap() | ||
} | ||
} |
Oops, something went wrong.