Skip to content
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
35 commits
Select commit Hold shift + click to select a range
b12937d
feat: new program interaction policy creation format
0xLeo-sqds Nov 26, 2025
6a66c2f
feat: add builtin programs
0xLeo-sqds Nov 26, 2025
7139abf
feat: improved builtins and added index to spendingLimits
0xLeo-sqds Nov 26, 2025
7ecb5d0
Changed Indexed to Compiled
0xLeo-sqds Nov 26, 2025
2dee83a
Use SmallVec in the Compiled version
0xLeo-sqds Nov 26, 2025
0def404
Added some unit test for all new helpers
0xLeo-sqds Nov 27, 2025
6cf4ca5
added a cleanup function for SmallVec and added tests
0xLeo-sqds Nov 27, 2025
cfd49f0
Changed naming of the struct
0xLeo-sqds Nov 27, 2025
fd7fe27
Fixed some nits
0xLeo-sqds Dec 9, 2025
cd3ce98
Nits
0xLeo-sqds Dec 9, 2025
ee728b5
Merge pull request #21 from Squads-Protocol/create-program-interactio…
0xLeo-sqds Dec 17, 2025
9e8ec6d
Missing mut Constraint on CloseTransactionBuffer.creator fixed
0xLeo-sqds Dec 17, 2025
45f180d
Lack of Token Account Ownership Checks Allows Spending Limit Bypass f…
0xLeo-sqds Dec 17, 2025
ecbd65d
Missing close_authority Check On Token Account Allows Spending Limit …
0xLeo-sqds Dec 17, 2025
a826669
Incorrect policy_data_length Used During Reallocation in SettingsActi…
0xLeo-sqds Dec 17, 2025
0e513c2
Unable to Close TransactionBuffer When Policy Account Is Closed fixed
0xLeo-sqds Dec 17, 2025
12322f8
Creation-Time SettingsAction Validation Gaps Can Lead to Governance/A…
0xLeo-sqds Dec 17, 2025
b90f5c3
a little CU shaving on checks
0xLeo-sqds Dec 17, 2025
1852e2a
Inconsistent Implementation of Delegation Amount Check fixed
0xLeo-sqds Dec 17, 2025
75c2cc9
Missing Update to time_constraints.start in SettingsAction::PolicyUpd…
0xLeo-sqds Dec 17, 2025
3ea991d
Incorrect Account Size Calculation in SpendingLimitPolicyCreationPayl…
0xLeo-sqds Dec 17, 2025
d0e3358
Incorrect Account Size Calculation in LimitedTimeConstraints.size fixed
0xLeo-sqds Dec 17, 2025
8b5661c
Redundant Account Size in Transaction Account fixed
0xLeo-sqds Dec 17, 2025
1cee789
Possible Unhandled Panics fixed (token account deserialization)
0xLeo-sqds Dec 17, 2025
1e78d95
SpendingLimit Bypass via Unsynced WSOL Token Accounts fixed
0xLeo-sqds Dec 17, 2025
f79a514
Fix compilation error in validate_settings_actions (remove to_policy_…
0xLeo-sqds Dec 17, 2025
f484e48
Fix CompiledHook.instructionData serialization to use u16 length prefix
0xLeo-sqds Dec 17, 2025
1c62f7d
Add regression tests for spending limit balance tracking
0xLeo-sqds Dec 17, 2025
3887306
Settings Account Changes Not Saved to On-Chain Storage fixed
0xLeo-sqds Dec 17, 2025
a5d3bb3
Feat: general cleanup
0xLeo-sqds Jan 14, 2026
bba31a1
Merge pull request #24 from Squads-Protocol/cleanup/general-cleanup
0xRigel-squads Jan 27, 2026
6bc529a
Revert "Creation-Time SettingsAction Validation Gaps Can Lead to Gove…
0xLeo-sqds Jan 27, 2026
3d744a5
merge: resolve conflicts with origin/policies
0xLeo-sqds Mar 3, 2026
91dbdf9
Merge pull request #22 from Squads-Protocol/policies-offside-remediation
0xLeo-sqds Mar 3, 2026
b961e49
Merge remote-tracking branch 'origin/main' into policies
leo-sqds Apr 15, 2026
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
503 changes: 440 additions & 63 deletions README.md

Large diffs are not rendered by default.

4 changes: 4 additions & 0 deletions programs/squads_smart_account_program/src/errors.rs
Original file line number Diff line number Diff line change
Expand Up @@ -170,6 +170,10 @@ pub enum SmartAccountError {
ProgramInteractionTooManyInstructionConstraints,
#[msg("Program interaction constraint violation: too many spending limits. Max is 10")]
ProgramInteractionTooManySpendingLimits,
#[msg("Program interaction constraint violation: invalid pubkey table index")]
ProgramInteractionInvalidPubkeyTableIndex,
#[msg("Program interaction constraint violation: too many unique pubkeys. Max is 240 (indices 240-255 reserved for builtin programs)")]
ProgramInteractionTooManyUniquePubkeys,
#[msg("Program interaction hook violation: template hook error")]
ProgramInteractionTemplateHookError,
#[msg("Program interaction hook violation: hook authority cannot be part of hook accounts")]
Expand Down
Original file line number Diff line number Diff line change
@@ -1,17 +1,10 @@
use anchor_lang::prelude::*;

use crate::consensus_trait::Consensus;
use crate::errors::*;
use crate::interface::consensus::ConsensusAccount;
use crate::state::*;

#[derive(Accounts)]
pub struct CloseTransactionBuffer<'info> {
#[account(
constraint = consensus_account.check_derivation(consensus_account.key()).is_ok()
)]
pub consensus_account: InterfaceAccount<'info, ConsensusAccount>,

#[account(
mut,
// Rent gets returned to the creator
Expand All @@ -20,9 +13,11 @@ pub struct CloseTransactionBuffer<'info> {
constraint = transaction_buffer.creator == creator.key() @ SmartAccountError::Unauthorized,
// Account can be closed anytime by the creator, regardless of the
// current settings transaction index
// Use the stored settings key for seed verification to allow closing
// even if the consensus account (e.g., Policy) has been closed
seeds = [
SEED_PREFIX,
consensus_account.key().as_ref(),
transaction_buffer.settings.as_ref(),
SEED_TRANSACTION_BUFFER,
creator.key().as_ref(),
&transaction_buffer.buffer_index.to_le_bytes()
Expand All @@ -32,6 +27,7 @@ pub struct CloseTransactionBuffer<'info> {
pub transaction_buffer: Account<'info, TransactionBuffer>,

/// The signer on the smart account that created the TransactionBuffer.
#[account(mut)]
pub creator: Signer<'info>,
}

Expand Down
Loading