A Solana smart contract implementation of a thawing gate program that integrates with sRFC-37, enabling permissionless thawing of token accounts as defined by a gating program.
This program implements a thawing gate that controls when token accounts can be thawed (unfrozen) in a permissionless manner. It supports three different modes of operation and integrates with the EBALTS (Efficient Block/Allow List Token Standard) interface to provide flexible token account management.
- Three Operation Modes: Allow, AllowWithPermissionlessEOAs, and Block
- Whitelist/Blacklist Management: Add and remove wallets from the list
- sRFC-37 Integration: Implements the required interface for permissionless thawing
- PDA-based List Configuration: Uses Program Derived Addresses for management of multiple lists
CMKdNTip9w21wNxfwN6J9pdRGMosNDx9KjpKMVuLPQVu
ListConfig
: Main configuration account containing authority, seed, mode, and bump. Represents an allow / block list.ABWallet
: Individual wallet accounts that represent allowlisted/blocklisted addresses
Allow
: Only wallets that have been explicitly allowlisted can thawAllowWithPermissionlessEOAs
: All wallets that can sign can thaw, otherwise requires allowlisting (for PDAs)Block
: Only wallets that have been blocklisted cannot thaw
initialize_list_config
: Initialize the main list configurationset_list_mode
: Change the operation modeadd_wallet_to_list
: Add a wallet to the allowlist/blocklistremove_wallet_from_list
: Remove a wallet from the listset_extra_metas_thaw
: Set additional metadata for thawing operations
can_thaw_permissionless
: Main gating function that determines if thawing is allowedcan_freeze_permissionless
: Returns error (not supported in this implementation)
- Solana CLI tools
- Anchor Framework
- Node.js and Yarn
- Clone the repository:
git clone <repository-url>
cd abl-srfc37
- Install dependencies:
yarn install
- Build the program:
anchor build
- Configure your Solana cluster in
Anchor.toml
- Deploy the program:
anchor deploy
Run the test suite:
yarn test
This program implements the sRFC-37 interface by providing the can_thaw_permissionless
instruction that:
- Validates the calling context
- Checks the current operation mode
- Verifies wallet permissions based on the mode
- Returns success or failure to allow/deny thawing
programs/abl-srfc37/
├── src/
│ ├── lib.rs # Main program entry point
│ ├── state.rs # Account structures and enums
│ ├── errors.rs # Custom error definitions
│ ├── constants.rs # Program constants
│ └── instructions/ # Individual instruction implementations
│ ├── mod.rs
│ ├── initialize_list_config.rs
│ ├── add_wallet_to_list.rs
│ ├── remove_wallet_from_list.rs
│ ├── set_list_mode.rs
│ ├── can_thaw_permissionless.rs
│ ├── can_freeze_permissionless.rs
│ └── set_extra_metas_thaw.rs
├── Cargo.toml
└── Xargo.toml