-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
e5f6576
commit 59458a5
Showing
5 changed files
with
96 additions
and
0 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
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,11 @@ | ||
root = true | ||
|
||
[*] | ||
indent_style = space | ||
indent_size = 2 | ||
charset = utf-8 | ||
trim_trailing_whitespace = true | ||
insert_final_newline = true | ||
|
||
[*.rs] | ||
indent_size = 4 |
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,23 @@ | ||
[package] | ||
name = "pfc-dust-collector" | ||
version = "0.1.0" | ||
authors = ["PFC"] | ||
edition = "2021" | ||
description = "Common helpers for other contracts to use pfc-fee-split" | ||
license = "Apache-2.0" | ||
repository = "https://github.com/PFC-Validator/pfc-fee-split" | ||
keywords = ["cosmos", "cosmwasm"] | ||
[features] | ||
backtraces = ["cosmwasm-std/backtraces"] | ||
|
||
[dependencies] | ||
cosmwasm-std = "1.0.0" | ||
schemars = "0.8.10" | ||
serde = { version = "1.0.103", default-features = false, features = ["derive"] } | ||
pfc-dust-collector-derive = {version ="0.1.0"} | ||
pfc-whitelist-derive = {version ="0.1.0"} | ||
pfc-whitelist={version="0.1.0"} | ||
|
||
cosmwasm-schema = "1.2.1" | ||
cw-ownable = "0.5.0" | ||
cw-ownable-derive = "0.5.0" |
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,60 @@ | ||
use cosmwasm_schema::{cw_serde, QueryResponses}; | ||
use cosmwasm_std::Uint128; | ||
use cw_ownable_derive::{cw_ownable_execute, cw_ownable_query}; | ||
|
||
use pfc_dust_collector_derive::pfc_dust_collect; | ||
|
||
use pfc_whitelist_derive::{pfc_whitelist_exec, pfc_whitelist_query}; | ||
#[cw_serde] | ||
pub struct CollectorResponse<T> { | ||
pub entries: Vec<T>, | ||
} | ||
|
||
#[pfc_dust_collect] | ||
#[pfc_whitelist_exec] | ||
#[cw_ownable_execute] | ||
#[cw_serde] | ||
pub enum ExecuteMsg { | ||
/// get some dust | ||
SetTokenRouter { contract: String }, | ||
/// Set Base denom | ||
SetBaseDenom { denom: String }, | ||
/// minimum of zero | ||
SetAssetMinimum { denom: String, minimum: Uint128 }, | ||
/// passing this asset moving forward will just hold it, and not attempt to convert it. a 'Flush' will send it back (to avoid loops) | ||
ClearAsset { denom: String }, | ||
} | ||
|
||
#[cw_ownable_query] | ||
#[pfc_whitelist_query] | ||
#[cw_serde] | ||
#[derive(QueryResponses)] | ||
pub enum QueryMsg { | ||
#[returns(CollectorResponse<AssetHolding>)] | ||
Assets { | ||
start_after: Option<String>, | ||
limit: Option<u32>, | ||
}, | ||
#[returns(AssetHolding)] | ||
Asset { denom: String }, | ||
#[returns(ConfigResponse)] | ||
Config {}, | ||
} | ||
|
||
#[cw_serde] | ||
pub struct ConfigResponse { | ||
pub token_router: String, | ||
pub base_denom: String, | ||
pub return_contract: String, | ||
} | ||
#[cw_serde] | ||
pub struct AssetMinimum { | ||
pub denom: String, | ||
pub minimum: Uint128, | ||
} | ||
#[cw_serde] | ||
pub struct AssetHolding { | ||
pub denom: String, | ||
pub minimum: Uint128, // only send $ after we have this amount in this coin | ||
pub balance: Uint128, | ||
} |
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 @@ | ||
pub mod dust_collector; |