A Solana program implementation of sRFC 37 that provides an Allow/Block List (ABL) system for token access control. This program implements the can_thaw_permissionless instruction according to the sRFC037 specification.
This ABL program is written in Pinocchio and generates clients using Codama. It provides a flexible token access control system that allows token issuers to manage which wallets can have their token accounts thawed through different operational modes.
- Program: Core Solana program written in Pinocchio
- SDK: Generated TypeScript and Rust clients using Codama
- CLI: Command-line interface for program interaction
The program supports three distinct operational modes:
- Purpose: Blocks wallets in the list from having token accounts thawed
- Behavior: Only wallets NOT in the list can have their token accounts thawed
- Use Case: Blacklist approach for preventing specific wallets from accessing tokens
- Purpose: Only wallets in the list can have their token accounts thawed
- Behavior: Wallets must be explicitly added to the list to access tokens
- Use Case: Whitelist approach for restricted token access
- Purpose: All EOAs can be thawed by default, plus any manually added wallets
- Behavior:
- All EOAs are allowed by default
- PDAs (Program Derived Addresses) must be explicitly added to the list
- Use Case: Open access for EOAs with selective PDA (Smart Contracts) control
- Create List: Initialize a new allow/block list with specified mode
- Delete List: Remove an existing list (only when empty)
- Add Wallet: Add a wallet address to a specific list
- Remove Wallet: Remove a wallet address from a specific list
- Setup Extra Metas: Configure which lists are used for a given token mint
- Multiple List Support: Token issuers can subscribe to multiple allow or block lists
- Conjunctive Logic: Wallets must be allowed by ALL configured lists to be thawed
| Instruction | Discriminator | Description |
|---|---|---|
can_thaw_permissionless |
0x8 |
Gate program instruction called by Token ACL |
create_list |
0x1 |
Create a new list configuration |
delete_list |
0x2 |
Delete an empty list |
add_wallet |
0x3 |
Add wallet to a list |
remove_wallet |
0x4 |
Remove wallet from a list |
setup_extra_metas |
0x5 |
Configure lists for a token mint |
This program serves as a gate program for the Token ACL system. The Token ACL program calls can_thaw_permissionless to determine if a wallet should be allowed to thaw their token account.
- Create one or more lists with desired modes
- Add/remove wallets as needed
- Use
setup_extra_metasto configure which lists apply to a token mint - Create a Token ACL mint config account and define this program as the gate program
- Enable the permissionless thaw operation
- The Token ACL program will call this gate program during thaw operations
- Rust 1.70+
- Solana CLI 2.2.0+
- Node.js 20.18.0+
- pnpm 9.1.0+
# Build the program
cargo build-sbf --manifest-path=program/Cargo.toml
# Build CLI
cargo build --manifest-path=cli/Cargo.toml
# Generate SDKs
pnpm run generate-sdks
# Run tests
cargo test-sbf --manifest-path=sdk/rust/Cargo.tomlGATEzzqxhJnsWF6vHRsgtixxSB8PaQdcqGEVTEHWiULz
MIT License - see LICENSE file for details