From 382fb71ca6fe86bf72c752e5b09897aa1c452155 Mon Sep 17 00:00:00 2001 From: Noah Saso Date: Thu, 7 Nov 2024 19:31:37 -0500 Subject: [PATCH] fix package dependency collision and clean up stuff --- Cargo.lock | 30 +++++++-------- Cargo.toml | 2 +- README.md | 37 ------------------- .../voting/dao-voting-cw721-staked/Cargo.toml | 2 +- .../dao-voting-cw721-staked/src/error.rs | 2 +- .../dao-voting-cw721-staked/src/state.rs | 2 +- .../voting/dao-voting-onft-staked/Cargo.toml | 2 +- .../dao-voting-onft-staked/src/error.rs | 2 +- .../dao-voting-onft-staked/src/state.rs | 2 +- packages/cw721-controllers/README.md | 6 --- .../Cargo.toml | 6 +-- packages/nft-controllers/README.md | 8 ++++ .../src/lib.rs | 0 .../src/nft_claim.rs | 0 scripts/publish.sh | 4 +- 15 files changed, 35 insertions(+), 70 deletions(-) delete mode 100644 packages/cw721-controllers/README.md rename packages/{cw721-controllers => nft-controllers}/Cargo.toml (68%) create mode 100644 packages/nft-controllers/README.md rename packages/{cw721-controllers => nft-controllers}/src/lib.rs (100%) rename packages/{cw721-controllers => nft-controllers}/src/nft_claim.rs (100%) diff --git a/Cargo.lock b/Cargo.lock index 79a71d9af..be53a5c71 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1634,17 +1634,6 @@ dependencies = [ "thiserror", ] -[[package]] -name = "cw721-controllers" -version = "2.6.0" -dependencies = [ - "cosmwasm-schema", - "cosmwasm-std", - "cw-storage-plus 1.2.0", - "cw-utils 1.0.3", - "thiserror", -] - [[package]] name = "cw721-roles" version = "2.6.0" @@ -2535,8 +2524,7 @@ dependencies = [ "cw2 1.1.2", "cw721 0.18.0", "cw721-base 0.18.0", - "cw721-controllers 2.5.0", - "cw721-controllers 2.6.0", + "cw721-controllers", "dao-dao-macros 2.6.0", "dao-hooks 2.6.0", "dao-interface 2.6.0", @@ -2545,6 +2533,7 @@ dependencies = [ "dao-test-custom-factory", "dao-testing", "dao-voting 2.6.0", + "nft-controllers", "osmosis-std", "osmosis-test-tube", "serde", @@ -2564,8 +2553,7 @@ dependencies = [ "cw-storage-plus 1.2.0", "cw-utils 1.0.3", "cw2 1.1.2", - "cw721-controllers 2.5.0", - "cw721-controllers 2.6.0", + "cw721-controllers", "dao-dao-macros 2.6.0", "dao-hooks 2.6.0", "dao-interface 2.6.0", @@ -2574,6 +2562,7 @@ dependencies = [ "dao-test-custom-factory", "dao-testing", "dao-voting 2.6.0", + "nft-controllers", "omniflix-std", "osmosis-test-tube", "prost 0.12.3", @@ -3493,6 +3482,17 @@ dependencies = [ "windows-sys 0.48.0", ] +[[package]] +name = "nft-controllers" +version = "2.6.0" +dependencies = [ + "cosmwasm-schema", + "cosmwasm-std", + "cw-storage-plus 1.2.0", + "cw-utils 1.0.3", + "thiserror", +] + [[package]] name = "nom" version = "7.1.3" diff --git a/Cargo.toml b/Cargo.toml index e2e18cab5..72f0b9baa 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -101,7 +101,6 @@ cw-wormhole = { path = "./packages/cw-wormhole", version = "2.6.0" } cw20-stake = { path = "./contracts/staking/cw20-stake", version = "2.6.0" } cw20-stake-external-rewards = { path = "./contracts/staking/cw20-stake-external-rewards", version = "2.6.0" } cw20-stake-reward-distributor = { path = "./contracts/staking/cw20-stake-reward-distributor", version = "2.6.0" } -cw721-controllers = { path = "./packages/cw721-controllers", version = "2.6.0" } cw721-roles = { path = "./contracts/external/cw721-roles", version = "2.6.0" } dao-cw721-extensions = { path = "./packages/dao-cw721-extensions", version = "2.6.0" } dao-dao-core = { path = "./contracts/dao-dao-core", version = "2.6.0" } @@ -131,6 +130,7 @@ dao-voting-cw721-roles = { path = "./contracts/voting/dao-voting-cw721-roles", v dao-voting-cw721-staked = { path = "./contracts/voting/dao-voting-cw721-staked", version = "2.6.0" } dao-voting-onft-staked = { path = "./contracts/voting/dao-voting-onft-staked", version = "2.6.0" } dao-voting-token-staked = { path = "./contracts/voting/dao-voting-token-staked", version = "2.6.0" } +nft-controllers = { path = "./packages/nft-controllers", version = "2.6.0" } # v1 dependencies. used for state migrations. cw-core-v1 = { package = "cw-core", version = "0.1.0" } diff --git a/README.md b/README.md index f2f1f7e75..375d542ce 100644 --- a/README.md +++ b/README.md @@ -11,7 +11,6 @@ [![DAO DAO DAO](https://img.shields.io/badge/DAO%20DAO%20DAO-gray?logo=data%3Aimage%2Fpng%3Bbase64%2CiVBORw0KGgoAAAANSUhEUgAAAHAAAABwCAMAAADxPgR5AAAABGdBTUEAALGPC%2FxhBQAAAAFzUkdCAK7OHOkAAAAgY0hSTQAAeiYAAICEAAD6AAAAgOgAAHUwAADqYAAAOpgAABdwnLpRPAAAAR1QTFRF%2F%2F%2F%2F7%2FDw0NDRoaOjgoSFY2VmREdIJSgpFhgaBgkLNTc4sbKz0dHRREZINTc54ODgwMHCwMLCJSgpREZIoqOjNTc5VFZXoqOksbKz0dHRwcHCkpOUsbKyoqKjJikqc3V2g4SFoaGiwMDB7%2FDwoaKjFxkb39%2FfkZKTFhgaY2VnZGZnZGVn7u%2FvgoOEdHZ3BwoM%2Fv7%2BwcLCRUhJNjg5NTc4gYOENTg5cnR2c3V3sLGy7%2B%2Fv0NHR0NDRU1ZXoaOkgoSFY2VmREdIz9DQJSgqoaKiFhkaBgkL3%2BDgv8DBNDc5z8%2FQsLKzVVdY7u7uwMHBkpSUFxobZWZodHV3sbGyc3R2Njg6RUdJoKKiv8HBr7GykZOT3t%2Ff%2F%2F%2F%2FcnR1oaOjFOTQHAAAAA90Uk5T%2Fv7%2B%2Fv7%2B%2Fv7%2B%2Fv7%2B%2Fv7%2B6a2FXwAABrRJREFUaN7Vm%2BtjmzYQwNnWx7ZuUwq1jU0Dbp04LM0CTWu3pWnBdXHjuY9kXV8b5P%2F%2FM4aFAElIIAH5sPsWk%2BjnO%2B4hnS5KJCPe6Us%2FWCyX4SqRcLleBP7mVGoFRRGHvYzXK6asg0vQNXDH58ByaHy7O6DnhysBUWPQCXBHWwnLYtMaeKdHrLjsxwN9CDyoOBiNjF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%2FB4DdwwTKovbigfCkhiIpv9y6dv3X37JcutQCfzCUGgtR%2FgO61zuwRnnviwAAAABJRU5ErkJggg%3D%3D)](https://daodao.zone/dao/juno10h0hc64jv006rr8qy0zhlu4jsxct8qwa0vtaleayh0ujz0zynf2s2r7v8q) - This is a collection of smart contracts for building composable, modular, and upgradable DAOs. For a detailed look at how these contracts work, see [our wiki](https://github.com/DA0-DA0/dao-contracts/wiki/DAO-DAO-Contracts-Design). @@ -38,42 +37,6 @@ If you believe you have found a problem, please [let us know](SECURITY.md). DAO DAO has been audited by [Oak Security](https://www.oaksecurity.io/) on multiple occasions. You can find all the audit reports [here](https://github.com/oak-security/audit-reports/tree/master/DAO%20DAO). -`v2.3.0` is the most recent DAO DAO release; only new feautres related to tokenfactory and improved NFT DAOs have been [audited](https://github.com/oak-security/audit-reports/blob/master/DAO%20DAO/2023-10-16%20Audit%20Report%20-%20DAO%20DAO%20Updates%20v1.0.pdf). Our most recently [full audited](https://github.com/oak-security/audit-reports/blob/master/DAO%20DAO/2023-02-06%20Audit%20Report%20-%20DAO%20DAO%202%20v1.0.pdf) release is `v2.0.0`. Vesting and payroll were added and [audited](https://github.com/oak-security/audit-reports/blob/master/DAO%20DAO/2023-03-22%20Audit%20Report%20-%20DAO%20DAO%20Vesting%20and%20Payroll%20Factory%20v1.0.pdf) in `v2.1.0`. - -Audited contracts include: -- [cw-payroll-factory](https://crates.io/crates/cw-payroll-factory) -- [cw-tokenfactory-issuer](https://crates.io/crates/cw-tokenfactory-issuer) -- [cw-token-swap](https://crates.io/crates/cw-token-swap) -- [cw-vesting](https://crates.io/crates/cw-vesting) -- [dao-dao-core](https://crates.io/crates/dao-dao-core) -- [dao-pre-propose-approval-single](https://crates.io/crates/dao-pre-propose-approval-single) -- [dao-pre-propose-approver](https://crates.io/crates/dao-pre-propose-approver) -- [dao-pre-propose-multiple](https://crates.io/crates/dao-pre-propose-multiple) -- [dao-pre-propose-single](https://crates.io/crates/dao-pre-propose-single) -- [dao-proposal-condorcet](https://crates.io/crates/dao-proposal-condorcet) -- [dao-proposal-multiple](https://crates.io/crates/dao-proposal-multiple) -- [dao-proposal-single](https://crates.io/crates/dao-proposal-single) -- [cw20-stake](https://crates.io/crates/cw20-stake) -- [cw20-stake-external-rewards](https://crates.io/crates/cw20-stake-external-rewards) -- [cw20-stake-reward-distributor](https://crates.io/crates/cw20-stake-reward-distributor) -- [dao-voting-cw4](https://crates.io/crates/dao-voting-cw4) -- [dao-voting-cw20-staked](https://crates.io/crates/dao-voting-cw20-staked) -- [dao-voting-cw721-staked](https://crates.io/crates/dao-voting-cw721-staked) -- [dao-voting-token-staked](https://crates.io/crates/dao-voting-token-staked) - -Audited packages include: -- [cw721-controllers](https://crates.io/crates/cw721-controllers) -- [cw-denom](https://crates.io/crates/cw-denom) -- [cw-hooks](https://crates.io/crates/cw-hooks) -- [cw-paginate-storage](https://crates.io/crates/cw-paginate-storage) -- [cw-stake-tracker](https://crates.io/crates/cw-stake-tracker) -- [cw-wormhole](https://crates.io/crates/cw-wormhole) -- [dao-dao-macros](https://crates.io/crates/dao-dao-macros) -- [dao-hooks](https://crates.io/crates/dao-hooks) -- [dao-interface](https://crates.io/crates/dao-interface) -- [dao-pre-propose-based](https://crates.io/crates/dao-pre-propose-based) -- [dao-voting](https://crates.io/crates/dao-voting) - ## Why? Our institutions grew rapidly after 1970, but as time passed their priorities shifted from growth, to protectionism. We're fighting this. We believe The Internet is where the organizations of tomorrow will be built. diff --git a/contracts/voting/dao-voting-cw721-staked/Cargo.toml b/contracts/voting/dao-voting-cw721-staked/Cargo.toml index f63e4dc12..4b90662ae 100644 --- a/contracts/voting/dao-voting-cw721-staked/Cargo.toml +++ b/contracts/voting/dao-voting-cw721-staked/Cargo.toml @@ -30,7 +30,6 @@ cw-controllers = { workspace = true } cw-hooks = { workspace = true } cw721 = { workspace = true } cw721-base = { workspace = true, features = ["library"] } -cw721-controllers = { workspace = true } cw721-controllers-v250 = { workspace = true } cw-utils = { workspace = true } cw2 = { workspace = true } @@ -38,6 +37,7 @@ dao-dao-macros = { workspace = true } dao-hooks = { workspace = true } dao-interface = { workspace = true } dao-voting = { workspace = true } +nft-controllers = { workspace = true } thiserror = { workspace = true } [dev-dependencies] diff --git a/contracts/voting/dao-voting-cw721-staked/src/error.rs b/contracts/voting/dao-voting-cw721-staked/src/error.rs index 97f41436b..4b3c6baf7 100644 --- a/contracts/voting/dao-voting-cw721-staked/src/error.rs +++ b/contracts/voting/dao-voting-cw721-staked/src/error.rs @@ -21,7 +21,7 @@ pub enum ContractError { UnstakingDurationError(#[from] dao_voting::duration::UnstakingDurationError), #[error(transparent)] - NftClaimError(#[from] cw721_controllers::NftClaimError), + NftClaimError(#[from] nft_controllers::NftClaimError), #[error("Can not stake that which has already been staked")] AlreadyStaked {}, diff --git a/contracts/voting/dao-voting-cw721-staked/src/state.rs b/contracts/voting/dao-voting-cw721-staked/src/state.rs index 99341499a..77a3a11a5 100644 --- a/contracts/voting/dao-voting-cw721-staked/src/state.rs +++ b/contracts/voting/dao-voting-cw721-staked/src/state.rs @@ -1,10 +1,10 @@ use cosmwasm_schema::cw_serde; use cosmwasm_std::{Addr, Binary, Empty, StdError, StdResult, Storage, Uint128}; -use cw721_controllers::NftClaims; use cw_hooks::Hooks; use cw_storage_plus::{Item, Map, SnapshotItem, SnapshotMap, Strategy}; use cw_utils::Duration; use dao_voting::threshold::ActiveThreshold; +use nft_controllers::NftClaims; use crate::ContractError; diff --git a/contracts/voting/dao-voting-onft-staked/Cargo.toml b/contracts/voting/dao-voting-onft-staked/Cargo.toml index eaf1f53fa..a4b660bad 100644 --- a/contracts/voting/dao-voting-onft-staked/Cargo.toml +++ b/contracts/voting/dao-voting-onft-staked/Cargo.toml @@ -32,7 +32,6 @@ cosmwasm-schema = { workspace = true } cw-storage-plus = { workspace = true } cw-controllers = { workspace = true } cw-hooks = { workspace = true } -cw721-controllers = { workspace = true } cw721-controllers-v250 = { workspace = true } cw-utils = { workspace = true } cw2 = { workspace = true } @@ -41,6 +40,7 @@ dao-hooks = { workspace = true } dao-interface = { workspace = true } dao-voting = { workspace = true } omniflix-std = { workspace = true } +nft-controllers = { workspace = true } serde = { workspace = true } thiserror = { workspace = true } diff --git a/contracts/voting/dao-voting-onft-staked/src/error.rs b/contracts/voting/dao-voting-onft-staked/src/error.rs index a57d785b5..92abacd2e 100644 --- a/contracts/voting/dao-voting-onft-staked/src/error.rs +++ b/contracts/voting/dao-voting-onft-staked/src/error.rs @@ -17,7 +17,7 @@ pub enum ContractError { UnstakingDurationError(#[from] dao_voting::duration::UnstakingDurationError), #[error(transparent)] - NftClaimError(#[from] cw721_controllers::NftClaimError), + NftClaimError(#[from] nft_controllers::NftClaimError), #[error("Nothing to claim")] NothingToClaim {}, diff --git a/contracts/voting/dao-voting-onft-staked/src/state.rs b/contracts/voting/dao-voting-onft-staked/src/state.rs index 0fab86f74..e9cd77dde 100644 --- a/contracts/voting/dao-voting-onft-staked/src/state.rs +++ b/contracts/voting/dao-voting-onft-staked/src/state.rs @@ -1,10 +1,10 @@ use cosmwasm_schema::cw_serde; use cosmwasm_std::{Addr, Empty, StdError, StdResult, Storage, Uint128}; -use cw721_controllers::NftClaims; use cw_hooks::Hooks; use cw_storage_plus::{Item, Map, SnapshotItem, SnapshotMap, Strategy}; use cw_utils::Duration; use dao_voting::threshold::ActiveThreshold; +use nft_controllers::NftClaims; use crate::ContractError; diff --git a/packages/cw721-controllers/README.md b/packages/cw721-controllers/README.md deleted file mode 100644 index 455c591f7..000000000 --- a/packages/cw721-controllers/README.md +++ /dev/null @@ -1,6 +0,0 @@ -# CW721 Controllers: Common cw721 controllers for many contracts - -This is an implementation of cw-plus' -[cw-controllers](https://github.com/CosmWasm/cw-plus/tree/72afcde846b907fac5c0394ce86ed5a59ce47524/packages/controllers) -package for CW721 NFTs. It manages claims for our [cw721 staking -contract](../../contracts/voting/dao-voting-cw721-staked). diff --git a/packages/cw721-controllers/Cargo.toml b/packages/nft-controllers/Cargo.toml similarity index 68% rename from packages/cw721-controllers/Cargo.toml rename to packages/nft-controllers/Cargo.toml index b497f17c0..c96c57c90 100644 --- a/packages/cw721-controllers/Cargo.toml +++ b/packages/nft-controllers/Cargo.toml @@ -1,7 +1,7 @@ [package] -name = "cw721-controllers" -authors = ["CypherApe cypherape@protonmail.com"] -description = "A package for managing cw721 claims." +name = "nft-controllers" +authors = ["CypherApe cypherape@protonmail.com", "Noah "] +description = "A package for managing NFT claims." edition = { workspace = true } license = { workspace = true } repository = { workspace = true } diff --git a/packages/nft-controllers/README.md b/packages/nft-controllers/README.md new file mode 100644 index 000000000..80363a899 --- /dev/null +++ b/packages/nft-controllers/README.md @@ -0,0 +1,8 @@ +# NFT Controllers + +This is an implementation of cw-plus' +[cw-controllers](https://github.com/CosmWasm/cw-plus/tree/72afcde846b907fac5c0394ce86ed5a59ce47524/packages/controllers) +package for NFTs. It manages claims for our NFT staking contracts: + +- [dao-voting-cw721-staked](../../contracts/voting/dao-voting-cw721-staked) +- [dao-voting-onft-staked](../../contracts/voting/dao-voting-onft-staked) diff --git a/packages/cw721-controllers/src/lib.rs b/packages/nft-controllers/src/lib.rs similarity index 100% rename from packages/cw721-controllers/src/lib.rs rename to packages/nft-controllers/src/lib.rs diff --git a/packages/cw721-controllers/src/nft_claim.rs b/packages/nft-controllers/src/nft_claim.rs similarity index 100% rename from packages/cw721-controllers/src/nft_claim.rs rename to packages/nft-controllers/src/nft_claim.rs diff --git a/scripts/publish.sh b/scripts/publish.sh index 9864f3ae4..aa5e3c973 100755 --- a/scripts/publish.sh +++ b/scripts/publish.sh @@ -50,7 +50,7 @@ cd packages/cw-paginate-storage cargo publish cd "$START_DIR" -cd packages/cw721-controllers +cd packages/nft-controllers cargo publish cd "$START_DIR" @@ -93,7 +93,7 @@ cd "$START_DIR" sleep 120 cd contracts/test/dao-voting-cw20-balance -cargo publish +cargo hack publish --no-dev-deps --allow-dirty cd "$START_DIR" cd contracts/test/dao-proposal-hook-counter