Socket
Book a DemoInstallSign in
Socket

@blessnetwork/bless-time-contract

Package Overview
Dependencies
Maintainers
3
Versions
2
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@blessnetwork/bless-time-contract

A Solana program that manages the Bless token airdrop process, vault reserves, administrator governance, and Merkle tree–based eligibility verification. Built with Anchor.

0.0.2
latest
npmnpm
Version published
Maintainers
3
Created
Source

bls-time-contract

A Solana program that manages the Bless token airdrop process, vault reserves, administrator governance, and Merkle tree–based eligibility verification. Built with Anchor.

Features

  • Program State Initialization

    • Create and configure the Bless Time state account.

    • Create a secure token vault controlled by the program.

  • Administrator Management

    • Secure proposal and acceptance of new admin accounts.
  • Vault Management

    • Recharge vault with additional BLESS tokens.

    • Track recharge records.

  • Merkle Tree Airdrop

    • Off-chain generated Merkle root for participant eligibility.

    • On-chain proof verification to ensure only eligible users can claim.

    • Prevent duplicate claims with per-user claim records.

Instructions

1. initialize_bless_time_state

Creates the Bless Time State and its vault account.

Context: InitBlessTimeState Parameters:

  • bump: u8 – PDA bump for bls_time_state.

  • vault_bump: u8 – PDA bump for vault_account.

Flow:

  • Creates bls_time_state PDA.

  • Creates token vault_account PDA with bls_time_state as authority.

  • Sets the admin to the payer.

2. set_pending_admin_account

Proposes a new admin account.

Context: BlsTimeProposeAdmin

Notes:

  • Callable only by the current admin_account.

  • Stores pending_admin in bls_time_state.

  • Rejects if proposed admin is the same as current or already pending.

3. accept_admin

Finalizes admin transfer.

Context: BlsTimeAcceptAdmin Notes:

Callable only by the pending_admin.

Updates admin_account to pending_admin.

Clears pending_admin after acceptance.

4. set_merkle_tree_root

Sets the Merkle root for airdrop eligibility.

Context: BlessTimeSetMerkleTreeRoot Parameters:

  • root: [u8; 32] – The new Merkle root.

Notes:

  • Only callable by admin_account.

  • Rejects default [0u8; 32] and unchanged roots.

5. recharge_vault_account

Transfers tokens into the program’s vault.

Context: InitVaultRechargeRecord Parameters:

amount: u64 – Number of tokens to transfer.

Flow:

  • Uses CPI to SPL Token program.

  • Transfers from recharge_account to vault_account.

6. bless_token_claim

Claims tokens via Merkle proof.

Context: BlsTokenClaim Parameters:

  • amount: u64 – Claim amount.

  • locked_time: i64 – Unix timestamp when claim can be made.

  • proof: Vec<[u8; 32]> – Merkle proof.

  • record_bump: u8 – PDA bump for user_claim_record.

Flow:

  • Checks claim_paused flag.

  • Verifies Merkle proof with payer address, amount, and locked time.

  • Ensures vault has sufficient balance.

  • Checks that the current block time ≥ locked_time.

  • Creates user_claim_record PDA to prevent reclaims.

  • Transfers tokens from vault to user via CPI with PDA signing.

Security

  • All admin-sensitive actions require correct signer checks.

  • Claim verification is backed by off-chain Merkle tree generation.

  • Duplicate claims prevented via PDA-bound UserClaimRecord.

  • Vault account is owned by program state PDA to prevent unauthorized transfers.

FAQs

Package last updated on 14 Aug 2025

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

About

Packages

Stay in touch

Get open source security insights delivered straight into your inbox.

  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc

U.S. Patent No. 12,346,443 & 12,314,394. Other pending.