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

chore: cleanup comments #74

Merged
merged 6 commits into from
Sep 26, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
56 changes: 28 additions & 28 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion contracts/subdaos/cwd-subdao-core/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
//! [this](https://!github.com/DA0-DA0/dao-contracts/wiki/DAO-DAO-v1-Contracts-Design)
//! wiki page.
//!
//! In additon to the wiki spec this contract may also pause. To do so a
//! In addition to the wiki spec this contract may also pause. To do so a
//! `Pause` message must by executed by a proposal module. Pausing the
//! core module will stop all actions on the module for the duration of
//! the pause.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
],
"properties": {
"denom": {
"description": "Denom used for rewards distribution. All funds in any other denoms will be ignored.",
"type": "string"
},
"main_dao_address": {
Expand Down Expand Up @@ -43,6 +44,7 @@
"additionalProperties": false
},
{
"description": "Alter shareholder's weights",
"type": "object",
"required": [
"set_shares"
Expand Down Expand Up @@ -76,7 +78,7 @@
"additionalProperties": false
},
{
"description": "Distribute funds between share holders. It is called from reserve contract only when part of the fund is going to distribution betrween share holders.",
"description": "Distribute funds between share holders. It is called from reserve contract only when part of the fund is going to distribution between share holders.",
"type": "object",
"required": [
"fund"
Expand Down Expand Up @@ -162,6 +164,7 @@
"additionalProperties": false
},
{
"description": "List of pending funds to addresses (to be distributed); returns [`Vec<(Addr, Uint128)>`]",
"type": "object",
"required": [
"pending"
Expand All @@ -175,6 +178,7 @@
"additionalProperties": false
},
{
"description": "List of current shareholder weights; returns [`Vec<(Addr, Uint128)>`]",
"type": "object",
"required": [
"shares"
Expand Down
3 changes: 2 additions & 1 deletion contracts/tokenomics/distribution/schema/raw/execute.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@
"additionalProperties": false
},
{
"description": "Alter shareholder's weights",
"type": "object",
"required": [
"set_shares"
Expand Down Expand Up @@ -49,7 +50,7 @@
"additionalProperties": false
},
{
"description": "Distribute funds between share holders. It is called from reserve contract only when part of the fund is going to distribution betrween share holders.",
"description": "Distribute funds between share holders. It is called from reserve contract only when part of the fund is going to distribution between share holders.",
"type": "object",
"required": [
"fund"
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@
],
"properties": {
"denom": {
"description": "Denom used for rewards distribution. All funds in any other denoms will be ignored.",
"type": "string"
},
"main_dao_address": {
Expand Down
2 changes: 2 additions & 0 deletions contracts/tokenomics/distribution/schema/raw/query.json
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@
"additionalProperties": false
},
{
"description": "List of pending funds to addresses (to be distributed); returns [`Vec<(Addr, Uint128)>`]",
"type": "object",
"required": [
"pending"
Expand All @@ -30,6 +31,7 @@
"additionalProperties": false
},
{
"description": "List of current shareholder weights; returns [`Vec<(Addr, Uint128)>`]",
"type": "object",
"required": [
"shares"
Expand Down
10 changes: 6 additions & 4 deletions contracts/tokenomics/distribution/src/msg.rs
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ use serde::{Deserialize, Serialize};

#[derive(Serialize, Deserialize, Clone, Debug, PartialEq, Eq, JsonSchema)]
pub struct InstantiateMsg {
/// Denom used for rewards distribution. All funds in any other denoms will be ignored.
pub denom: String,
/// The address of the main DAO. It's capable of pausing and unpausing the contract
pub main_dao_address: String,
Expand All @@ -21,12 +22,11 @@ pub enum ExecuteMsg {
/// Transfer the contract's ownership to another account
TransferOwnership(String),

SetShares {
shares: Vec<(String, Uint128)>,
},
/// Alter shareholder's weights
SetShares { shares: Vec<(String, Uint128)> },

/// Distribute funds between share holders. It is called from reserve contract only
/// when part of the fund is going to distribution betrween share holders.
/// when part of the fund is going to distribution between share holders.
Fund {},

/// Claim the funds that have been distributed to the contract's account
Expand All @@ -40,8 +40,10 @@ pub enum QueryMsg {
/// The contract's configurations; returns [`ConfigResponse`]
#[returns(crate::state::Config)]
Config {},
/// List of pending funds to addresses (to be distributed); returns [`Vec<(Addr, Uint128)>`]
#[returns(Vec<(Addr, Uint128)>)]
Pending {},
/// List of current shareholder weights; returns [`Vec<(Addr, Uint128)>`]
#[returns(Vec<(Addr, Uint128)>)]
Shares {},
}
4 changes: 4 additions & 0 deletions contracts/tokenomics/distribution/src/state.rs
Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,15 @@ pub struct Config {

/// Map to store the amount of funds that are pending distribution to a given address
pub const PENDING_DISTRIBUTION: Map<Addr, Uint128> = Map::new("pending_distribution");

/// Map to store the amount of shares that a given address has
pub const SHARES: Map<Addr, Uint128> = Map::new("shares");

/// Stores contract's configuration
pub const CONFIG: Item<Config> = Item::new("config");

/// Counts times `Fund` has been called successfully.
/// Used to determine what address to fund non-dividable remainder after weight distribution.
pub const FUND_COUNTER: Item<u64> = Item::new("fund_counter");

/// The height the contract is paused until. If it's None, the contract is not paused.
Expand Down
25 changes: 22 additions & 3 deletions contracts/tokenomics/reserve/schema/neutron-reserve.json
Original file line number Diff line number Diff line change
Expand Up @@ -18,6 +18,7 @@
],
"properties": {
"denom": {
"description": "Denom of the main coin",
"type": "string"
},
"distribution_contract": {
Expand All @@ -33,6 +34,7 @@
]
},
"main_dao_address": {
"description": "Address of the Neutron DAO contract",
"type": "string"
},
"min_period": {
Expand Down Expand Up @@ -94,6 +96,7 @@
"additionalProperties": false
},
{
"description": "Update config",
"type": "object",
"required": [
"update_config"
Expand Down Expand Up @@ -212,6 +215,7 @@
"additionalProperties": false
},
{
"description": "The contract's current stats; returns [`StatsResponse`]",
"type": "object",
"required": [
"stats"
Expand Down Expand Up @@ -375,13 +379,28 @@
],
"properties": {
"total_distributed": {
"$ref": "#/definitions/Uint128"
"description": "Amount of coins distributed since contract instantiation",
"allOf": [
{
"$ref": "#/definitions/Uint128"
}
]
},
"total_processed_burned_coins": {
"$ref": "#/definitions/Uint128"
"description": "Total amount of burned coins processed by reserve contract",
"allOf": [
{
"$ref": "#/definitions/Uint128"
}
]
},
"total_reserved": {
"$ref": "#/definitions/Uint128"
"description": "Amount of coins reserved since contract instantiation",
"allOf": [
{
"$ref": "#/definitions/Uint128"
}
]
}
},
"definitions": {
Expand Down
1 change: 1 addition & 0 deletions contracts/tokenomics/reserve/schema/raw/execute.json
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@
"additionalProperties": false
},
{
"description": "Update config",
"type": "object",
"required": [
"update_config"
Expand Down
2 changes: 2 additions & 0 deletions contracts/tokenomics/reserve/schema/raw/instantiate.json
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
],
"properties": {
"denom": {
"description": "Denom of the main coin",
"type": "string"
},
"distribution_contract": {
Expand All @@ -29,6 +30,7 @@
]
},
"main_dao_address": {
"description": "Address of the Neutron DAO contract",
"type": "string"
},
"min_period": {
Expand Down
Loading