Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
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
22 changes: 21 additions & 1 deletion control/preimage/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,10 @@ pub enum Command {
/// Upgrade to FiatShamir on Polkadot
#[command(alias = "upgrade-202603")]
Upgrade202603,
/// Treasury proposal 2026
TreasuryProposal2026(TreasuryProposal2026Args),
/// Bug bounty proposal 2026
BugBountyProposal2026(BugBountyProposal2026Args),
}

#[derive(Debug, Args)]
Expand Down Expand Up @@ -233,6 +237,20 @@ pub struct TreasuryProposal2024Args {
beneficiary: FixedBytes<32>,
}

#[derive(Debug, Args)]
pub struct TreasuryProposal2026Args {
/// Beneficiary address
#[arg(long, value_name = "ADDRESS", value_parser=parse_hex_bytes32)]
beneficiary: FixedBytes<32>,
}

#[derive(Debug, Args)]
pub struct BugBountyProposal2026Args {
/// Beneficiary address
#[arg(long, value_name = "ADDRESS", value_parser=parse_hex_bytes32)]
beneficiary: FixedBytes<32>,
}

#[derive(Debug, Args)]
pub struct GovUpdate202501Args {
#[command(flatten)]
Expand Down Expand Up @@ -462,7 +480,9 @@ async fn run() -> Result<(), Box<dyn std::error::Error>> {
let (register_ether_call, set_ether_metadata_call) = commands::register_ether(&params);
send_xcm_asset_hub(&context, vec![register_ether_call, set_ether_metadata_call]).await?
}
Command::TreasuryProposal2024(params) => treasury_commands::treasury_proposal(&params),
Command::TreasuryProposal2024(params) => treasury_commands::treasury_proposal_2024(&params),
Command::TreasuryProposal2026(params) => treasury_commands::treasury_proposal_2026(&params),
Command::BugBountyProposal2026(params) => treasury_commands::bug_bounty_proposal_2026(&params),
Command::GovUpdate202501(GovUpdate202501Args {
pricing_parameters,
register_ether,
Expand Down
54 changes: 52 additions & 2 deletions control/preimage/src/treasury_commands.rs
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
use crate::TreasuryProposal2024Args;
use crate::{BugBountyProposal2026Args, TreasuryProposal2024Args, TreasuryProposal2026Args};

use crate::asset_hub_runtime::runtime_types::{
pallet_treasury,
Expand Down Expand Up @@ -174,7 +174,7 @@ const SPENDS: [Spend; 23] = [

pub const LAUNCH_BLOCK: u32 = 21292000;

pub fn treasury_proposal(params: &TreasuryProposal2024Args) -> AssetHubRuntimeCall {
pub fn treasury_proposal_2024(params: &TreasuryProposal2024Args) -> AssetHubRuntimeCall {
let mut calls: Vec<AssetHubRuntimeCall> = vec![];

for spend in SPENDS.iter() {
Expand All @@ -192,6 +192,56 @@ pub fn treasury_proposal(params: &TreasuryProposal2024Args) -> AssetHubRuntimeCa
utility_force_batch(calls)
}

const SPENDS_2026: [Spend; 2] = [
Spend {
name: "Payment 1",
asset: TreasuryAsset::USDC(182100),
delay: None,
},
Spend {
name: "Payment 2",
asset: TreasuryAsset::USDC(182100),
delay: Some(180 * DAYS),
},
];

// Approximate Asset Hub block at proposal submission time (April 2026)
pub const PROPOSAL_2026_BASE_BLOCK: u32 = 14636636;

pub fn treasury_proposal_2026(params: &TreasuryProposal2026Args) -> AssetHubRuntimeCall {
let mut calls: Vec<AssetHubRuntimeCall> = vec![];

for spend in SPENDS_2026.iter() {
let (asset_id, asset_location, asset_amount) = spend.asset.into();
let call = make_treasury_spend(
params.beneficiary.into(),
asset_location,
asset_amount,
spend.delay.map(|delay| PROPOSAL_2026_BASE_BLOCK + delay),
);
calls.push(call);
println!("Spend: {}, {}({})", spend.name, asset_id, asset_amount);
}

utility_force_batch(calls)
}

// Approximate Asset Hub block number for 1 Aug 2026
pub const AUG_1_2026_BLOCK: u32 = 16177436;

pub fn bug_bounty_proposal_2026(params: &BugBountyProposal2026Args) -> AssetHubRuntimeCall {
let (asset_id, asset_location, asset_amount) = TreasuryAsset::USDC(355000).into();
let call = make_treasury_spend(
params.beneficiary.into(),
asset_location,
asset_amount,
Some(AUG_1_2026_BLOCK),
);
println!("Spend: Bug Bounty, {}({})", asset_id, asset_amount);

utility_force_batch(vec![call])
}

fn make_treasury_spend(
beneficiary: [u8; 32],
asset: Location,
Expand Down
Loading