Skip to content

Commit cf27125

Browse files
authored
Merge pull request #189 from quicknode/claude/affectionate-turing-4owvhb
Remove false re-entry claims from checks-effects-interactions comments
2 parents 3291560 + 5f5cb67 commit cf27125

30 files changed

Lines changed: 52 additions & 72 deletions

File tree

‎finance/fundraiser/anchor-v1/README.md‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,7 @@ All token accounts use `anchor_spl::token_interface` types (`InterfaceAccount<Mi
8181

8282
### Onchain math
8383

84-
All balance and counter arithmetic uses `checked_*` operations and returns `FundraiserError::MathOverflow` on overflow. Both handlers that move tokens out of the vault update program state before issuing the transfer CPI (checks-effects-interactions).
84+
All balance and counter arithmetic uses `checked_*` operations and returns `FundraiserError::MathOverflow` on overflow.
8585

8686
## Lifecycle
8787

‎finance/fundraiser/anchor-v1/programs/fundraiser/src/instructions/contribute.rs‎

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,6 @@ pub fn handle_contribute(
9191
.checked_add(amount)
9292
.ok_or(FundraiserError::MathOverflow)?;
9393

94-
// Checks-effects-interactions: update state before the transfer CPI.
9594
accounts.fundraiser.current_amount = accounts
9695
.fundraiser
9796
.current_amount

‎finance/fundraiser/anchor-v1/programs/fundraiser/src/instructions/refund.rs‎

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,6 @@ pub fn handle_refund(accounts: &mut RefundAccountConstraints) -> Result<()> {
8080
FundraiserError::TargetMet
8181
);
8282

83-
// Checks-effects-interactions: update state before the transfer CPI.
8483
let refund_amount = accounts.contribution.amount;
8584
accounts.fundraiser.current_amount = accounts
8685
.fundraiser

‎finance/fundraiser/anchor/README.md‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -82,7 +82,7 @@ All token accounts use `anchor_spl::token_interface` types (`InterfaceAccount<Mi
8282

8383
### Onchain math
8484

85-
All balance and counter arithmetic uses `checked_*` operations and returns `FundraiserError::MathOverflow` on overflow. Both handlers that move tokens out of the vault update program state before issuing the transfer CPI (checks-effects-interactions).
85+
All balance and counter arithmetic uses `checked_*` operations and returns `FundraiserError::MathOverflow` on overflow.
8686

8787
## Lifecycle
8888

‎finance/fundraiser/anchor/programs/fundraiser/src/instructions/contribute.rs‎

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,6 @@ pub fn handle_contribute(
9191
.checked_add(amount)
9292
.ok_or(FundraiserError::MathOverflow)?;
9393

94-
// Checks-effects-interactions: update state before the transfer CPI.
9594
accounts.fundraiser.current_amount = accounts
9695
.fundraiser
9796
.current_amount

‎finance/fundraiser/anchor/programs/fundraiser/src/instructions/refund.rs‎

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,6 @@ pub fn handle_refund(accounts: &mut RefundAccountConstraints) -> Result<()> {
8080
FundraiserError::TargetMet
8181
);
8282

83-
// Checks-effects-interactions: update state before the transfer CPI.
8483
let refund_amount = accounts.contribution.amount;
8584
accounts.fundraiser.current_amount = accounts
8685
.fundraiser

‎finance/fundraiser/quasar/src/instructions/check_contributions.rs‎

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,6 @@ pub fn handle_check_contributions(
5959
FundraiserError::TargetNotMet
6060
);
6161

62-
// Update state before the transfer CPI (checks-effects-interactions).
6362
accounts.fundraiser.claimed = PodBool::from(true);
6463

6564
// Fundraiser PDA signer seeds: ["fundraiser", maker, bump].

‎finance/fundraiser/quasar/src/instructions/contribute.rs‎

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,6 @@ pub fn handle_contribute(
6969
)?;
7070
require!(now < deadline, FundraiserError::FundraiserEnded);
7171

72-
// Update state before the transfer CPI (checks-effects-interactions).
7372
let current_amount: u64 = accounts.fundraiser.current_amount.into();
7473
accounts.fundraiser.current_amount = PodU64::from(
7574
current_amount

‎finance/fundraiser/quasar/src/instructions/refund.rs‎

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -74,7 +74,6 @@ pub fn handle_refund(
7474

7575
let refund_amount: u64 = accounts.contribution.amount.into();
7676

77-
// Update state before the transfer CPI (checks-effects-interactions).
7877
accounts.fundraiser.current_amount = PodU64::from(
7978
current_amount
8079
.checked_sub(refund_amount)

‎finance/managed-fund/anchor-v1/programs/managed-fund/src/instructions/collect_fees.rs‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -80,7 +80,7 @@ pub fn handle_collect_fees(context: Context<CollectFeesAccountConstraints>) -> R
8080
return Ok(());
8181
}
8282

83-
// Checks-effects-interactions: update total_shares before CPI
83+
// Add the fee shares to the recorded supply
8484
context.accounts.fund.total_shares = total_shares
8585
.checked_add(fee_shares)
8686
.ok_or(FundError::MathOverflow)?;

0 commit comments

Comments
 (0)