From 1afee7b8022df07e591be77b9a4ee34c6e162c97 Mon Sep 17 00:00:00 2001 From: Jarett Dunn Date: Wed, 10 Jan 2024 14:24:30 -0400 Subject: [PATCH 1/8] Update process_remove_member.rs plz sers, I will earn so much of my hydra wasted efforts back if we can fix the remove Member ix. expected behavior: feed it a member (which is seeded as mint of membership voucher) and a destination (native account) and it works actual behavior: it does a check to see if member is owned by spl token, errors if so with "InvalidCloseAccountDestination. Error Number: 6024. Error Message: Sending Sol to a SPL token destination will render the sol unusable." fix: this check is meant for the destination, to see if it is a native account. do a switcheroo and the checks should pass. --- .../src/processors/remove_member/process_remove_member.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hydra/program/src/processors/remove_member/process_remove_member.rs b/hydra/program/src/processors/remove_member/process_remove_member.rs index 3751ecf746..9155efb77b 100644 --- a/hydra/program/src/processors/remove_member/process_remove_member.rs +++ b/hydra/program/src/processors/remove_member/process_remove_member.rs @@ -38,7 +38,7 @@ pub fn remove_member(ctx: Context) -> Result<()> { assert_owned_by(&fanout.to_account_info(), &crate::ID)?; assert_owned_by(&member_voucher.to_account_info(), &crate::ID)?; update_fanout_for_remove(fanout)?; - if assert_owned_by(&ctx.accounts.member, &spl_token::id()).is_ok() { + if assert_owned_by(&ctx.accounts.destination, &spl_token::id()).is_ok() { return Err(HydraError::InvalidCloseAccountDestination.into()); } if fanout.membership_model != MembershipModel::NFT From db2c9bd58292d0b5651be09e10d6a8922170605e Mon Sep 17 00:00:00 2001 From: Jarett Dunn Date: Wed, 10 Jan 2024 14:32:29 -0400 Subject: [PATCH 2/8] Update process_remove_member.rs it's actually better like this, tbf. --- .../src/processors/remove_member/process_remove_member.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hydra/program/src/processors/remove_member/process_remove_member.rs b/hydra/program/src/processors/remove_member/process_remove_member.rs index 9155efb77b..667ec039f5 100644 --- a/hydra/program/src/processors/remove_member/process_remove_member.rs +++ b/hydra/program/src/processors/remove_member/process_remove_member.rs @@ -38,7 +38,7 @@ pub fn remove_member(ctx: Context) -> Result<()> { assert_owned_by(&fanout.to_account_info(), &crate::ID)?; assert_owned_by(&member_voucher.to_account_info(), &crate::ID)?; update_fanout_for_remove(fanout)?; - if assert_owned_by(&ctx.accounts.destination, &spl_token::id()).is_ok() { + if assert_owned_by(&ctx.accounts.destination, &solana_program::system_program:::id()).is_err() { return Err(HydraError::InvalidCloseAccountDestination.into()); } if fanout.membership_model != MembershipModel::NFT From 7980d599687323a51d32a6791c6afb5fb676a77b Mon Sep 17 00:00:00 2001 From: Jarett Dunn Date: Wed, 10 Jan 2024 14:33:35 -0400 Subject: [PATCH 3/8] Update error.rs --- hydra/program/src/error.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hydra/program/src/error.rs b/hydra/program/src/error.rs index 3d30d1b5db..2750d7ffa2 100644 --- a/hydra/program/src/error.rs +++ b/hydra/program/src/error.rs @@ -92,6 +92,6 @@ pub enum HydraError { #[msg("Before you remove a wallet or NFT member please transfer the shares to another member")] RemoveSharesMustBeZero, - #[msg("Sending Sol to a SPL token destination will render the sol unusable")] + #[msg("Sending Sol to a non-Native Account destination will render the sol unusable")] InvalidCloseAccountDestination, } From 8a6e022279098c556d039995cd719de1b7ef5b70 Mon Sep 17 00:00:00 2001 From: stacc Date: Tue, 26 Mar 2024 09:18:44 -0400 Subject: [PATCH 4/8] too many :s --- .../src/processors/remove_member/process_remove_member.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hydra/program/src/processors/remove_member/process_remove_member.rs b/hydra/program/src/processors/remove_member/process_remove_member.rs index 667ec039f5..5d9967efd0 100644 --- a/hydra/program/src/processors/remove_member/process_remove_member.rs +++ b/hydra/program/src/processors/remove_member/process_remove_member.rs @@ -38,7 +38,7 @@ pub fn remove_member(ctx: Context) -> Result<()> { assert_owned_by(&fanout.to_account_info(), &crate::ID)?; assert_owned_by(&member_voucher.to_account_info(), &crate::ID)?; update_fanout_for_remove(fanout)?; - if assert_owned_by(&ctx.accounts.destination, &solana_program::system_program:::id()).is_err() { + if assert_owned_by(&ctx.accounts.destination, &solana_program::system_program::id()).is_err() { return Err(HydraError::InvalidCloseAccountDestination.into()); } if fanout.membership_model != MembershipModel::NFT From 39e6609d1dc5497631a9053c1a295fada2236032 Mon Sep 17 00:00:00 2001 From: stacc Date: Tue, 26 Mar 2024 09:19:04 -0400 Subject: [PATCH 5/8] solana program doesn't exist --- .../src/processors/remove_member/process_remove_member.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hydra/program/src/processors/remove_member/process_remove_member.rs b/hydra/program/src/processors/remove_member/process_remove_member.rs index 5d9967efd0..402a849472 100644 --- a/hydra/program/src/processors/remove_member/process_remove_member.rs +++ b/hydra/program/src/processors/remove_member/process_remove_member.rs @@ -38,7 +38,7 @@ pub fn remove_member(ctx: Context) -> Result<()> { assert_owned_by(&fanout.to_account_info(), &crate::ID)?; assert_owned_by(&member_voucher.to_account_info(), &crate::ID)?; update_fanout_for_remove(fanout)?; - if assert_owned_by(&ctx.accounts.destination, &solana_program::system_program::id()).is_err() { + if assert_owned_by(&ctx.accounts.destination, &anchor_lang::solana_program::system_program::id()).is_err() { return Err(HydraError::InvalidCloseAccountDestination.into()); } if fanout.membership_model != MembershipModel::NFT From 37ab3975c8d11b028a93c2c6e9018e379d0cc319 Mon Sep 17 00:00:00 2001 From: Jarett Dunn Date: Sat, 24 Aug 2024 23:06:43 +0100 Subject: [PATCH 6/8] whitespace --- README.md | 1 + 1 file changed, 1 insertion(+) diff --git a/README.md b/README.md index 82a3110b82..84aeb67ebc 100644 --- a/README.md +++ b/README.md @@ -231,3 +231,4 @@ under either the [MIT][mit-license] or the [Apache][apache-license] licenses. [apache-license]: https://www.apache.org/licenses/LICENSE-2.0.txt [mit-license]: https://www.mit.edu/~amini/LICENSE.md + From 5712707e556c33154b6128ca4f2e7f730adf0365 Mon Sep 17 00:00:00 2001 From: Blockiosaurus Date: Sat, 24 Aug 2024 18:16:57 -0400 Subject: [PATCH 7/8] Fixing lint. --- .../src/processors/remove_member/process_remove_member.rs | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/hydra/program/src/processors/remove_member/process_remove_member.rs b/hydra/program/src/processors/remove_member/process_remove_member.rs index 402a849472..cfb61dbfa3 100644 --- a/hydra/program/src/processors/remove_member/process_remove_member.rs +++ b/hydra/program/src/processors/remove_member/process_remove_member.rs @@ -38,7 +38,12 @@ pub fn remove_member(ctx: Context) -> Result<()> { assert_owned_by(&fanout.to_account_info(), &crate::ID)?; assert_owned_by(&member_voucher.to_account_info(), &crate::ID)?; update_fanout_for_remove(fanout)?; - if assert_owned_by(&ctx.accounts.destination, &anchor_lang::solana_program::system_program::id()).is_err() { + if assert_owned_by( + &ctx.accounts.destination, + &anchor_lang::solana_program::system_program::id(), + ) + .is_err() + { return Err(HydraError::InvalidCloseAccountDestination.into()); } if fanout.membership_model != MembershipModel::NFT From 26bf8fbb387db252ac97d71c722aa75d1fb7fcde Mon Sep 17 00:00:00 2001 From: Blockiosaurus Date: Mon, 26 Aug 2024 14:48:23 -0400 Subject: [PATCH 8/8] Bump cli version. --- .github/workflows/apply-version-update.yml | 2 +- .github/workflows/publish-on-pr-merge.yml | 2 +- .github/workflows/verify-lib-on-pr-open.yml | 2 +- 3 files changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/apply-version-update.yml b/.github/workflows/apply-version-update.yml index 8906edd857..dc3c7183c9 100644 --- a/.github/workflows/apply-version-update.yml +++ b/.github/workflows/apply-version-update.yml @@ -13,7 +13,7 @@ permissions: env: NODE_VERSION: 17.0.1 - ANCHOR_VERSION: 0.26.0 + ANCHOR_VERSION: 0.27.0 SOLANA_VERSION_STABLE: 1.14.13 RUST_TOOLCHAIN: stable diff --git a/.github/workflows/publish-on-pr-merge.yml b/.github/workflows/publish-on-pr-merge.yml index 0240fbffc8..20f05c877a 100644 --- a/.github/workflows/publish-on-pr-merge.yml +++ b/.github/workflows/publish-on-pr-merge.yml @@ -10,7 +10,7 @@ permissions: env: NODE_VERSION: 17.0.1 - ANCHOR_VERSION: 0.26.0 + ANCHOR_VERSION: 0.27.0 SOLANA_VERSION_STABLE: 1.14.13 RUST_TOOLCHAIN: stable diff --git a/.github/workflows/verify-lib-on-pr-open.yml b/.github/workflows/verify-lib-on-pr-open.yml index 3ceb1f96e3..fd7d572d4c 100644 --- a/.github/workflows/verify-lib-on-pr-open.yml +++ b/.github/workflows/verify-lib-on-pr-open.yml @@ -14,7 +14,7 @@ permissions: env: NODE_VERSION: 17.0.1 - ANCHOR_VERSION: 0.26.0 + ANCHOR_VERSION: 0.27.0 SOLANA_VERSION_STABLE: 1.14.13 RUST_TOOLCHAIN: stable