Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
141 commits
Select commit Hold shift + click to select a range
31dd49b
wip
pileks Jan 8, 2026
a303f5c
wip
pileks Jan 9, 2026
81064fd
implementation of initiation of new optimistic governance proposal
pileks Jan 9, 2026
2e85455
add finalize optimistic proposal ix
pileks Jan 9, 2026
7f458ea
launch_proposal should only be able to challenge an optimistic propos…
pileks Jan 9, 2026
63ed333
minor cleanups
pileks Jan 9, 2026
8606360
tests for optimistic vault transaction proposal initiation
pileks Jan 10, 2026
6702eaf
optimistic proposal finalization tests
pileks Jan 10, 2026
69a4b61
prevent initialization of futarchy proposal when optimistic governanc…
pileks Jan 10, 2026
27962d0
add missing check
pileks Jan 10, 2026
2aa4420
team can't sponsor a challenge to an optimistic governance proposal
pileks Jan 10, 2026
0d55d11
work-in-progress PR comments
pileks Jan 16, 2026
5d012b1
Merge remote-tracking branch 'origin/develop' into pileks/met-5-optim…
pileks Jan 16, 2026
c98ce2e
address review comments
pileks Jan 17, 2026
484e7ad
reintroduce resize_dao crankable instruction with scripts
pileks Jan 17, 2026
62e4d8a
reintroduce resize_dao crankable instruction with scripts (#400)
pileks Jan 17, 2026
a1acfaf
Merge branch 'pileks/met-5-optimistic-governance' of github.com:metaD…
pileks Jan 17, 2026
4731cf6
Merge remote-tracking branch 'origin/develop' into pileks/met-5-optim…
pileks Jan 17, 2026
d05c432
Merge remote-tracking branch 'origin/develop' into pileks/met-5-optim…
pileks Jan 18, 2026
98dfe15
remove duplicate optimistic proposal check
pileks Jan 23, 2026
ea1879c
Merge remote-tracking branch 'origin/develop' into pileks/met-5-optim…
pileks Feb 9, 2026
d31f514
initiate vault spend optimistic proposal won't fail due to reentrancy…
pileks Feb 10, 2026
56cf9eb
increase payer usdc balance to prevent tests from depleting entire ba…
pileks Feb 10, 2026
684fda6
Merge remote-tracking branch 'origin/develop' into pileks/met-5-optim…
pileks Feb 12, 2026
92875b1
prevent udapte_dao during active optimistic proposal
pileks Feb 12, 2026
cf0facc
prevent admin execution of multisig proposals when there is an active…
pileks Feb 17, 2026
3c85ce4
prevent deadlock from optimistic proposal staleness
pileks Feb 18, 2026
846dbee
Merge remote-tracking branch 'origin/develop' into pileks/met-5-optim…
pileks Feb 26, 2026
8717302
ensure squads vault transaction is created by permissionless account
pileks Mar 11, 2026
b067bd2
merge with develop
pileks Mar 12, 2026
4337ae8
additional checks for proper transaction in vault spend optimistic pr…
pileks Mar 14, 2026
9536ada
Merge remote-tracking branch 'origin/develop' into pileks/met-5-optim…
pileks Mar 19, 2026
e05d565
finalize resize dao logic, add scripts for dumping and resizing daos
pileks Mar 20, 2026
a026d83
Merge remote-tracking branch 'origin/develop' into pileks/met-5-optim…
pileks Mar 23, 2026
9bb28ac
initial layout for v2 SDK
pileks Mar 24, 2026
03ca7d4
add more programs to new SDK
pileks Mar 24, 2026
303c9cf
new sdk - performance package v2
pileks Mar 24, 2026
353eed4
new sdk - launchpad v6 program
pileks Mar 24, 2026
038496a
proper exports for all sdk v2 types
pileks Mar 25, 2026
5aeef0e
proper re-exports
pileks Mar 28, 2026
1f41716
add pricemath
pileks Mar 28, 2026
be9e06e
move tests to v2 sdk
pileks Mar 28, 2026
8be31d0
fix minor ts issues
pileks Mar 28, 2026
3ceac1e
add relevant 0.5 clients to sdk v2
pileks Mar 28, 2026
922da4f
add 0.4 clients to sdk v2
pileks Mar 28, 2026
ab72b2f
merge with origin/develop
pileks Apr 6, 2026
57ed79b
Merge branch 'pileks/met-5-optimistic-governance' into pileks/met-49-…
pileks Apr 7, 2026
470bd44
update all new functionality to sdk v2
pileks Apr 7, 2026
d708284
init launchpad v8
pileks Apr 9, 2026
1841481
launchpad v8 scaffolding
pileks Apr 9, 2026
04c6499
sdk scaffolding
pileks Apr 9, 2026
356c841
tests scaffolding
pileks Apr 9, 2026
97c25c5
initialize launch ix
pileks Apr 9, 2026
dd58c2a
init launch sdk
pileks Apr 9, 2026
13f87e0
init launch tests
pileks Apr 9, 2026
51c0a8e
start launch ix
pileks Apr 9, 2026
4c10c10
fund ix
pileks Apr 9, 2026
b3550e1
close launch ix
pileks Apr 10, 2026
61e57ea
update sdk ixs
pileks Apr 10, 2026
6db8ebc
start launch test
pileks Apr 10, 2026
9d3e61a
fund tests
pileks Apr 10, 2026
a72ace5
close launch tests
pileks Apr 10, 2026
1b48e00
set funding record approval ix
pileks Apr 10, 2026
723031c
set funding record approval sdk
pileks Apr 10, 2026
8bb156b
set funding record tests
pileks Apr 10, 2026
22a197e
settle launch ix
pileks Apr 10, 2026
40f48f3
settle launch sdk
pileks Apr 10, 2026
e275470
settle launch ix tests + finalization
pileks Apr 10, 2026
aab6f52
return of the set funding record approval test
pileks Apr 11, 2026
963793f
claim ix
pileks Apr 11, 2026
cafbb44
refund ix
pileks Apr 11, 2026
4412403
claim additional tokens ix
pileks Apr 11, 2026
891801c
claim refund and claim addtional ixs
pileks Apr 11, 2026
4d3bb1d
claim tests
pileks Apr 11, 2026
19a1447
refund tests
pileks Apr 11, 2026
1a27284
claim additional tokens tests
pileks Apr 11, 2026
558fcb5
finalize launch ix
pileks Apr 11, 2026
a6b3497
finalize launch ix
pileks Apr 11, 2026
d424b19
finalize launch tests
pileks Apr 11, 2026
5a85297
extend launch ix
pileks Apr 11, 2026
4e302bc
exten launch sdk
pileks Apr 11, 2026
4a99d95
extend launch tests
pileks Apr 11, 2026
1ce54c1
launchpad v8 integration test
pileks Apr 11, 2026
cce35a2
kill vibes dir
pileks Apr 11, 2026
1ac1065
kill vibes dir
pileks Apr 11, 2026
e550109
merge with origin/develop
pileks Apr 14, 2026
a85c296
Merge remote-tracking branch 'origin/pileks/met-5-optimistic-governan…
pileks Apr 15, 2026
16a79a0
apply latest program changes to new SDK
pileks Apr 15, 2026
8d16c77
Merge remote-tracking branch 'origin/pileks/met-49-restructure-sdk' i…
pileks Apr 15, 2026
c3a60d0
remove unnecessary logic from initialize_launch
pileks Apr 15, 2026
f5ce8b0
remove unnecessary event field, formatting
pileks Apr 15, 2026
d534e55
proper naming, more checks
pileks Apr 15, 2026
fc9876f
add immediate ability to mint to dao's squads multisig vault
pileks Apr 15, 2026
4833ac5
add sdk2 to CI
pileks Apr 16, 2026
7709172
Merge remote-tracking branch 'origin/pileks/met-49-restructure-sdk' i…
pileks Apr 16, 2026
25af8ef
enable optimistic governance by default for DAOs initialized with a t…
pileks Apr 16, 2026
5d0bf2f
Merge remote-tracking branch 'origin/pileks/met-5-optimistic-governan…
pileks Apr 16, 2026
0c4f99a
Merge remote-tracking branch 'origin/pileks/met-49-restructure-sdk' i…
pileks Apr 16, 2026
8a07998
remove unused account
pileks Apr 17, 2026
aa962ba
reintroduce disabling of optimistic governance on dao initialization …
pileks Apr 17, 2026
c70de22
final cleanup pass
pileks Apr 20, 2026
0ea8edf
update with latest optimistic governance changes
pileks Apr 20, 2026
4649ee3
Merge remote-tracking branch 'origin/pileks/met-49-restructure-sdk' i…
pileks Apr 20, 2026
656352f
update sdk
pileks Apr 20, 2026
a8cf73d
Merge remote-tracking branch 'origin/pileks/met-5-optimistic-governan…
pileks Apr 20, 2026
88f270c
merge with develop
pileks Apr 23, 2026
abeedcd
Merge remote-tracking branch 'origin/develop' into pileks/met-49-rest…
pileks Apr 23, 2026
73509ad
update sdkv2 with changes from old sdk
pileks Apr 23, 2026
ad9ce82
Merge branch 'pileks/met-49-restructure-sdk' into pileks/launchpad-v8
pileks Apr 23, 2026
53ac376
rename autocrat to futarchy in v0.6 clients
pileks Apr 23, 2026
93e9d7b
Merge remote-tracking branch 'origin/pileks/met-49-restructure-sdk' i…
pileks Apr 23, 2026
f05e451
rename autocratClient to futarchyClient
pileks Apr 23, 2026
03f3d76
sdk2 is now main sdk
pileks Apr 24, 2026
4d34c7d
fix up typescript errors in tests
pileks Apr 24, 2026
1b670c8
add v0.3 clients, fix autocomplete behavior for imports
pileks Apr 24, 2026
02014af
update scripts
pileks Apr 24, 2026
71a317b
restore legacy v0.6.0 IDLs and v0.5 simulateSwap helper
pileks Apr 27, 2026
2cd2a14
replace old SDK dir with new one
pileks Apr 28, 2026
22b51b3
update workflow to not include sdk2 anymore
pileks Apr 28, 2026
b790914
redeploy SDK under new name
pileks Apr 29, 2026
67f7c38
update with latest sdkv2 changes
pileks Apr 29, 2026
01ae38e
remove unused dependencies
pileks Apr 29, 2026
93be94a
update sdk package version
pileks Apr 29, 2026
55842fd
Merge remote-tracking branch 'origin/pileks/met-49-restructure-sdk' i…
pileks Apr 29, 2026
6661a66
Merge remote-tracking branch 'origin/develop' into pileks/launchpad-v8
pileks Apr 29, 2026
7b0f009
remove unused files
pileks Apr 29, 2026
0f10d8f
adds full lifecycle launchpad_v8 -> performance_package_v2 + mint_gov…
pileks Apr 30, 2026
eeba18a
prepare specs and ralph loop
pileks May 1, 2026
af1a2f1
init gated_token
pileks May 1, 2026
8f1e5fd
gated_token scaffold
pileks May 1, 2026
a378019
init gated mint
pileks May 1, 2026
980f57e
add whitelisted user
pileks May 1, 2026
55276ec
disable gating
pileks May 1, 2026
c3c02bb
permissionless account thaw
pileks May 1, 2026
13f3f05
gated invoke
pileks May 1, 2026
658a989
add launchpad_v8 support, clean up tests
pileks May 1, 2026
a614211
merge with latest launchpad_v8 changes
pileks May 1, 2026
e1374cd
rename to gated_mint
pileks May 5, 2026
89978de
add gh workflows
pileks May 5, 2026
6a51aea
Merge remote-tracking branch 'origin/pileks/launchpad-v8' into pileks…
pileks May 5, 2026
d1f1a94
Merge remote-tracking branch 'origin/develop' into pileks/met-339-pri…
pileks May 6, 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
1 change: 1 addition & 0 deletions Anchor.toml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ skip-lint = false
bid_wall = "WALL8ucBuUyL46QYxwYJjidaFYhdvxUFrgvBxPshERx"
conditional_vault = "VLTX1ishMBbcX3rdBWGssxawAo1Q2X2qxYFYqiGodVg"
futarchy = "FUTARELBfJfQ8RDGhg1wdhddq1odMAJUePHFuBYfUxKq"
gated_mint = "GaTEjZy6eMdHg2BcL8dk3iE78jkJ9sPtyw1q2tMNi8PA"
launchpad = "MooNyh4CBUYEKyXVnjGYQ8mEiJDpGvJMdvrZx1iGeHV"
launchpad_v7 = "moontUzsdepotRGe5xsfip7vLPTJnVuafqdUWexVnPM"
launchpad_v8 = "moonDJUoHteKkGATejA5bdJVwJ6V6Dg74gyqyJTx73n"
Expand Down
12 changes: 12 additions & 0 deletions Cargo.lock

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

24 changes: 24 additions & 0 deletions programs/gated_mint/Cargo.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
[package]
name = "gated_mint"
version = "0.1.0"
description = "Created with Anchor"
edition = "2021"

[lib]
crate-type = ["cdylib", "lib"]
name = "gated_mint"

[features]
no-entrypoint = []
no-idl = []
no-log-ix-name = []
cpi = ["no-entrypoint"]
default = []
production = []

[dependencies]
anchor-lang = { version = "0.29.0", features = ["init-if-needed", "event-cpi"] }
anchor-spl = "0.29.0"
solana-program = "=1.17.14"
spl-token = "=4.0.0"
solana-security-txt = "1.1.1"
20 changes: 20 additions & 0 deletions programs/gated_mint/src/constants.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
use anchor_lang::prelude::Pubkey;
use anchor_lang::solana_program::pubkey;

pub const WHITELISTED_PROGRAMS: &[Pubkey] = &[
pubkey!("TokenkegQfeZyiNwAJbNbGKPFXCWuBvf9Ss623VQ5DA"),
pubkey!("FUTARELBfJfQ8RDGhg1wdhddq1odMAJUePHFuBYfUxKq"),
pubkey!("moonDJUoHteKkGATejA5bdJVwJ6V6Dg74gyqyJTx73n"),
pubkey!("VLTX1ishMBbcX3rdBWGssxawAo1Q2X2qxYFYqiGodVg"),
pubkey!("WALL8ucBuUyL46QYxwYJjidaFYhdvxUFrgvBxPshERx"),
pubkey!("gvnr27cVeyW3AVf3acL7VCJ5WjGAphytnsgcK1feHyH"),
pubkey!("cpamdpZCGKUy5JxQXB4dcpGPiikHawvSWAd6mEn1sGG"),
];

pub const TOKEN_ACCOUNT_LEN: usize = 165;
pub const TOKEN_ACCOUNT_MINT_OFFSET: usize = 0;
pub const TOKEN_ACCOUNT_STATE_OFFSET: usize = 108;

pub const TOKEN_STATE_UNINITIALIZED: u8 = 0;
pub const TOKEN_STATE_INITIALIZED: u8 = 1;
pub const TOKEN_STATE_FROZEN: u8 = 2;
21 changes: 21 additions & 0 deletions programs/gated_mint/src/error.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
use anchor_lang::prelude::*;

#[error_code]
pub enum GatedMintError {
#[msg("Unauthorized: signer is not the gated mint admin")]
UnauthorizedAdmin,
#[msg("Unauthorized: signer is not the current freeze authority of the mint")]
UnauthorizedFreezeAuthority,
#[msg("Mint mismatch: account does not match the expected gated mint")]
MintMismatch,
#[msg("Gating is already disabled for this mint")]
GatingDisabled,
#[msg("Gating must be disabled to call this instruction")]
GatingNotDisabled,
#[msg("Target program is not on the gated_mint whitelist")]
TargetProgramNotWhitelisted,
#[msg("Target program may not be the gated_mint program itself")]
SelfInvocation,
#[msg("Invalid token account: account is not a valid SPL Token account of the gated mint")]
InvalidTokenAccount,
}
63 changes: 63 additions & 0 deletions programs/gated_mint/src/events.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
use anchor_lang::prelude::*;

#[derive(AnchorSerialize, AnchorDeserialize, Clone)]
pub struct CommonFields {
pub slot: u64,
pub unix_timestamp: i64,
pub gated_mint_config_seq_num: u64,
}

impl CommonFields {
pub fn new(clock: &Clock, seq_num: u64) -> Self {
Self {
slot: clock.slot,
unix_timestamp: clock.unix_timestamp,
gated_mint_config_seq_num: seq_num,
}
}
}

#[event]
pub struct GatedMintInitializedEvent {
pub common: CommonFields,
pub gated_mint_config: Pubkey,
pub mint: Pubkey,
pub admin: Pubkey,
pub previous_freeze_authority: Pubkey,
pub pda_bump: u8,
}

#[event]
pub struct WhitelistedUserAddedEvent {
pub common: CommonFields,
pub gated_mint_config: Pubkey,
pub whitelisted_user: Pubkey,
pub mint: Pubkey,
pub user: Pubkey,
}

#[event]
pub struct GatedInvokeEvent {
pub common: CommonFields,
pub gated_mint_config: Pubkey,
pub mint: Pubkey,
pub caller: Pubkey,
pub target_program: Pubkey,
pub thawed_count: u32,
pub frozen_count: u32,
}

#[event]
pub struct GatingDisabledEvent {
pub common: CommonFields,
pub gated_mint_config: Pubkey,
pub mint: Pubkey,
}

#[event]
pub struct AccountThawedEvent {
pub common: CommonFields,
pub gated_mint_config: Pubkey,
pub mint: Pubkey,
pub token_account: Pubkey,
}
68 changes: 68 additions & 0 deletions programs/gated_mint/src/instructions/add_whitelisted_user.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,68 @@
use anchor_lang::prelude::*;
use anchor_spl::token::Mint;

use crate::{
CommonFields, GatedMintConfig, GatedMintError, WhitelistedUser, WhitelistedUserAddedEvent,
WHITELISTED_USER_SEED,
};

#[event_cpi]
#[derive(Accounts)]
pub struct AddWhitelistedUser<'info> {
#[account(
mut,
has_one = mint @ GatedMintError::MintMismatch,
constraint = !gated_mint_config.gating_disabled @ GatedMintError::GatingDisabled,
)]
pub gated_mint_config: Account<'info, GatedMintConfig>,

#[account(address = gated_mint_config.admin @ GatedMintError::UnauthorizedAdmin)]
pub admin: Signer<'info>,

pub mint: Account<'info, Mint>,

/// CHECK: any pubkey may be whitelisted; not signed.
pub user: UncheckedAccount<'info>,

#[account(
init,
payer = payer,
space = 8 + WhitelistedUser::INIT_SPACE,
seeds = [WHITELISTED_USER_SEED, mint.key().as_ref(), user.key().as_ref()],
bump,
)]
pub whitelisted_user: Account<'info, WhitelistedUser>,

#[account(mut)]
pub payer: Signer<'info>,

pub system_program: Program<'info, System>,
}

impl AddWhitelistedUser<'_> {
pub fn validate(&self) -> Result<()> {
Ok(())
}

pub fn handle(ctx: Context<Self>) -> Result<()> {
let cfg = &mut ctx.accounts.gated_mint_config;
cfg.seq_num += 1;

ctx.accounts.whitelisted_user.set_inner(WhitelistedUser {
mint: ctx.accounts.mint.key(),
user: ctx.accounts.user.key(),
bump: ctx.bumps.whitelisted_user,
});

let clock = Clock::get()?;
emit_cpi!(WhitelistedUserAddedEvent {
common: CommonFields::new(&clock, cfg.seq_num),
gated_mint_config: cfg.key(),
whitelisted_user: ctx.accounts.whitelisted_user.key(),
mint: ctx.accounts.mint.key(),
user: ctx.accounts.user.key(),
});

Ok(())
}
}
37 changes: 37 additions & 0 deletions programs/gated_mint/src/instructions/disable_gating.rs
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
use anchor_lang::prelude::*;

use crate::{CommonFields, GatedMintConfig, GatedMintError, GatingDisabledEvent};

#[event_cpi]
#[derive(Accounts)]
pub struct DisableGating<'info> {
#[account(
mut,
constraint = !gated_mint_config.gating_disabled @ GatedMintError::GatingDisabled,
)]
pub gated_mint_config: Account<'info, GatedMintConfig>,

#[account(address = gated_mint_config.admin @ GatedMintError::UnauthorizedAdmin)]
pub admin: Signer<'info>,
}

impl DisableGating<'_> {
pub fn validate(&self) -> Result<()> {
Ok(())
}

pub fn handle(ctx: Context<Self>) -> Result<()> {
let cfg = &mut ctx.accounts.gated_mint_config;
cfg.gating_disabled = true;
cfg.seq_num += 1;

let clock = Clock::get()?;
emit_cpi!(GatingDisabledEvent {
common: CommonFields::new(&clock, cfg.seq_num),
gated_mint_config: cfg.key(),
mint: cfg.mint,
});

Ok(())
}
}
Loading
Loading