Skip to content

Thirdweb Integration - Complete Token, NFT & Smart Contract Management#291

Open
soloking1412 wants to merge 8 commits intorsksmart:mainfrom
soloking1412:Thirdweb-Soloking
Open

Thirdweb Integration - Complete Token, NFT & Smart Contract Management#291
soloking1412 wants to merge 8 commits intorsksmart:mainfrom
soloking1412:Thirdweb-Soloking

Conversation

@soloking1412
Copy link
Copy Markdown

Description

This PR adds comprehensive Thirdweb integration to rsk-cli, enabling users to deploy, manage, and interact with ERC20 tokens, ERC721 NFTs, and arbitrary smart contracts on the Rootstock blockchain.

Features Added

ERC20 Token Management

  • Deploy ERC20 tokens with custom name and symbol
  • Mint tokens to specified addresses
  • Transfer tokens between addresses
  • Check balances for any address

ERC721 NFT Management

  • Deploy NFT collections with custom metadata
  • Mint NFTs with name, description, and image URL
  • Transfer NFTs between addresses
  • Check NFT balances with detailed metadata display

Arbitrary Contract Deployment

  • Deploy any smart contract using ABI and bytecode files
  • Support for constructor arguments
  • Interactive prompts for missing parameters

IPFS Storage Integration

  • Upload files to IPFS using Thirdweb storage
  • Download files from IPFS with automatic file type detection
  • Multiple gateway support for reliable downloads

Security & UX Features

  • Secure storage of API keys and private keys in encrypted rootstock-wallet.json
  • Interactive prompts for all commands with validation
  • Consistent emoji usage for better visual feedback
  • Progress indicators and transaction confirmations
  • Comprehensive error handling with helpful messages

Usage Examples

# Deploy ERC20 token
rsk-cli thirdweb erc20 --testnet --name "My Token" --symbol "MTK"

# Mint tokens
rsk-cli thirdweb mint --testnet --address "CONTRACT_ADDRESS" --to "RECIPIENT" --amount "1000"

# Deploy NFT collection
rsk-cli thirdweb erc721 --testnet --name "My Collection" --symbol "MC"

# Deploy arbitrary contract
rsk-cli thirdweb deploy-custom --testnet --abi "abi.json" --bytecode "bytecode.bin"

# Upload to IPFS
rsk-cli thirdweb ipfs --upload "file.jpg"

Technical Implementation

  • Thirdweb SDK integration for seamless blockchain interactions
  • Modular command structure for maintainability
  • Type-safe implementation with proper error handling
  • Automatic balance checking before deployments
  • Transaction confirmation with explorer links

Dependencies Added

  • @thirdweb-dev/sdk: Core Thirdweb SDK
  • commander: CLI framework
  • inquirer: Interactive prompts
  • chalk: Colored output
  • ora: Progress spinners

Testing

  • ✅ Tested on Rootstock testnet and mainnet
  • ✅ Verified all token operations (deploy, mint, transfer, balance)
  • ✅ Confirmed NFT operations with metadata
  • ✅ Tested arbitrary contract deployment
  • ✅ Validated IPFS upload/download operations
  • ✅ Tested interactive mode for all commands
    




@scguaquetam
Copy link
Copy Markdown
Member

Hi, you have conflicts to resolve.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants