This project implements a custom SPL token on the Solana blockchain using the Anchor framework. It includes a smart contract (program) for token creation and management, a Rust client for interaction, and comprehensive integration tests.
- Smart Contract Completo:
- Metadados Integrados:
- Cliente Rust:
- Testes Abrangentes:
- Segurança:
- Documentação:
solanarust/
├── Anchor.toml # Configuração do Anchor
├── Cargo.toml # Workspace Cargo
├── README.md # Este arquivo
├── programs/
│ └── token_creator/ # Smart contract
│ ├── Cargo.toml
│ ├── Xargo.toml
│ └── src/
│ └── lib.rs # Código principal do programa
├── client/ # Cliente Rust
│ ├── Cargo.toml
│ └── src/
│ └── main.rs # Aplicação cliente
└── tests/ # Testes de integração
└── integration_test.rs
Before running the project, make sure you have the following installed:
-
Rust (ver 1.70+)
curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh source ~/.cargo/env
-
Solana CLI (ver 1.17+)
sh -c "$(curl -sSfL https://release.solana.com/v1.17.0/install)" export PATH="~/.local/share/solana/install/active_release/bin:$PATH"
-
Anchor CLI (ver 0.29+)
cargo install --git https://github.com/coral-xyz/anchor avm --locked --force avm install latest avm use latest
Separate Terminal:
solana-test-validatorDont close him!
anchor buildanchor deploycd client
cargo runcargo test --manifest-path tests/Cargo.tomlpub struct InitTokenParams {
pub name: String, // Nome do token
pub symbol: String, // Símbolo do token
pub uri: String, // URI dos metadados
pub decimals: u8, // Número de casas decimais
}Try with:
cargo testThe project implements several security measures:
- PDAs (Program Derived Addresses)
- Verificação de Autoridade
- Validação de Contas
- Constraints do Anchor
This project is licensed under the MIT License. See the LICENSE file for details.