# Token Operations
Learn how to deploy, manage, and interact with ERC20 and ERC721 (NFT) tokens on Hyperion.
## Overview
The Hyperion MCP Server provides comprehensive token management:
- Deploy ERC20 tokens with custom parameters
- Deploy ERC721 (NFT) collections
- Mint additional tokens (for mintable contracts)
- Query token information and metadata
- Transfer tokens between addresses
## ERC20 Token Operations
### Deploy ERC20 Token
**Tool**: `deploy_erc20_token`
Deploy a new ERC20 token contract.
**Parameters**:
- `name` (string, required): Token name (e.g., "My Token")
- `symbol` (string, required): Token symbol (e.g., "MTK")
- `initialSupply` (string, required): Initial token supply
- `decimals` (number, optional): Token decimals (default: 18)
- `mintable` (boolean, optional): Allow minting more tokens (default: false)
- `gasLimit` (string, optional): Custom gas limit
- `gasPrice` (string, optional): Custom gas price
**Example - Basic Token**:
```
Deploy an ERC20 token named "MyToken" with symbol "MTK" and initial supply of 1000000
```
**Response**:
```
ERC20 Token Deployed Successfully!
Contract Address: 0xabc123...def456
Transaction Hash: 0xtx123...hash456
Token Name: MyToken
Token Symbol: MTK
Initial Supply: 1,000,000 MTK
Decimals: 18
Deployer: 0x1234567890123456789012345678901234567890
Gas Used: 850,000
Block Number: 1234567
Transaction Explorer: https://hyperion-testnet.metisdevops.link/tx/0xtx123...hash456
Contract Explorer: https://hyperion-testnet.metisdevops.link/address/0xabc123...def456
```
**Example - Mintable Token**:
```
Deploy a mintable ERC20 token named "GrowToken" with symbol "GROW", initial supply 500000, and 18 decimals
```
### Get Token Information
**Tool**: `get_token_info`
Get comprehensive information about an ERC20 token.
**Parameters**:
- `tokenAddress` (string, required): Token contract address
**Example**:
```
Get information for token at 0xabc123...def456
```
**Response**:
```
ERC20 Token Information:
Contract Address: 0xabc123...def456
Name: MyToken
Symbol: MTK
Decimals: 18
Total Supply: 1,000,000 MTK
Owner: 0x1234567890123456789012345678901234567890
Contract Explorer: https://hyperion-testnet.metisdevops.link/address/0xabc123...def456
```
### Mint ERC20 Tokens
**Tool**: `mint_tokens`
Mint additional tokens for mintable ERC20 contracts (owner only).
**Parameters**:
- `tokenAddress` (string, required): Token contract address
- `to` (string, required): Recipient address
- `amount` (string, required): Amount to mint
- `gasLimit` (string, optional): Custom gas limit
- `gasPrice` (string, optional): Custom gas price
**Example**:
```
Mint 10000 tokens from contract 0xabc...def to address 0x742d35...
```
**Response**:
```
Tokens Minted Successfully!
Transaction Hash: 0xmint123...hash456
Token Contract: 0xabc123...def456
Minted To: 0x742d35Cc6634C0532925a3b844Bc9e7595f0bEb
Amount: 10,000 tokens
Status: Success
Gas Used: 65,000
Transaction Explorer: https://hyperion-testnet.metisdevops.link/tx/0xmint123...hash456
Contract Explorer: https://hyperion-testnet.metisdevops.link/address/0xabc123...def456
```
**Requirements**:
- Token must be mintable
- Caller must be the contract owner
- Sufficient gas for transaction
## ERC721 (NFT) Operations
### Deploy ERC721 Collection
**Tool**: `deploy_erc721_token`
Deploy a new ERC721 (NFT) token contract.
**Parameters**:
- `name` (string, required): Collection name (e.g., "My NFT Collection")
- `symbol` (string, required): Collection symbol (e.g., "MNFT")
- `mintable` (boolean, optional): Allow minting NFTs (default: false)
- `gasLimit` (string, optional): Custom gas limit
- `gasPrice` (string, optional): Custom gas price
**Example - Basic NFT**:
```
Deploy an ERC721 collection named "CoolNFTs" with symbol "COOL"
```
**Response**:
```
ERC721 Token Deployed Successfully!
Contract Address: 0xnft123...abc456
Transaction Hash: 0xtx789...hash012
Token Name: CoolNFTs
Token Symbol: COOL
Deployer: 0x1234567890123456789012345678901234567890
Gas Used: 1,200,000
Block Number: 1234568
Transaction Explorer: https://hyperion-testnet.metisdevops.link/tx/0xtx789...hash012
Contract Explorer: https://hyperion-testnet.metisdevops.link/address/0xnft123...abc456
```
**Example - Mintable NFT**:
```
Deploy a mintable ERC721 collection named "ArtCollection" with symbol "ART"
```
### Get NFT Information
**Tool**: `get_nft_info`
Get comprehensive information about an ERC721 collection.
**Parameters**:
- `tokenAddress` (string, required): NFT contract address
- `tokenId` (string, optional): Specific token ID to query
**Example - Collection Info**:
```
Get NFT collection info for 0xnft123...abc456
```
**Response**:
```
ERC721 Collection Information:
Contract Address: 0xnft123...abc456
Name: CoolNFTs
Symbol: COOL
Owner: 0x1234567890123456789012345678901234567890
Contract Explorer: https://hyperion-testnet.metisdevops.link/address/0xnft123...abc456
```
**Example - Specific Token**:
```
Get NFT info for token ID 1 at contract 0xnft123...abc456
```
**Response**:
```
ERC721 Token Information:
Collection: CoolNFTs (COOL)
Token ID: 1
Owner: 0x9876543210987654321098765432109876543210
Token URI: ipfs://QmX...abc123
Contract Explorer: https://hyperion-testnet.metisdevops.link/address/0xnft123...abc456
```
### Mint NFT
**Tool**: `mint_nft`
Mint a new NFT for mintable ERC721 contracts (owner only).
**Parameters**:
- `tokenAddress` (string, required): NFT contract address
- `to` (string, required): Recipient address
- `tokenId` (string, required): Token ID to mint
- `tokenURI` (string, optional): Metadata URI (IPFS or HTTP)
- `gasLimit` (string, optional): Custom gas limit
- `gasPrice` (string, optional): Custom gas price
**Example**:
```
Mint NFT with token ID 1 from contract 0xnft123...abc456 to 0x742d35... with URI ipfs://QmX...
```
**Response**:
```
NFT Minted Successfully!
Transaction Hash: 0xmint456...def789
NFT Contract: 0xnft123...abc456
Minted To: 0x742d35Cc6634C0532925a3b844Bc9e7595f0bEb
Token ID: 1
Token URI: ipfs://QmX...abc123
Status: Success
Gas Used: 85,000
Transaction Explorer: https://hyperion-testnet.metisdevops.link/tx/0xmint456...def789
Contract Explorer: https://hyperion-testnet.metisdevops.link/address/0xnft123...abc456
```
## Best Practices
### Token Deployment
1. **Choose Appropriate Parameters**
- Use clear, descriptive names
- Select standard decimals (18 for most tokens)
- Consider initial supply carefully
- Decide if minting is needed
2. **Test Before Mainnet**
- Deploy on testnet first
- Test all functionality
- Verify contract behavior
- Check gas costs
3. **Security Considerations**
- Only make tokens mintable if necessary
- Secure owner private keys
- Consider multi-sig for important tokens
- Audit contracts before deployment
### NFT Best Practices
1. **Metadata Management**
- Use IPFS for decentralized storage
- Include proper metadata standards (ERC721 metadata)
- Ensure images are permanently stored
- Test metadata URLs before minting
2. **Token ID Strategy**
- Use sequential IDs for simplicity
- Document ID ranges
- Consider reserved IDs for special purposes
3. **Minting Strategy**
- Plan total supply
- Consider batch minting for gas efficiency
- Implement proper access controls
---
**Next**: Explore the [API Reference](./api-reference.md) →