===========================================
POP CONVERT
===========================================

Convert between different formats

Usage: pop convert
       pop convert <COMMAND>

Commands:
  address  Convert an Ethereum address into a Substrate address and vice versa
  help     Print this message or the help of the given subcommand(s)

Options:
  -h, --help  Print help

===========================================
WHAT IT DOES
===========================================

Converts between address formats:
- Substrate SS58 (32 bytes) ↔ Ethereum H160 (20 bytes)

Address Types:
- Substrate: 5GrwvaEF5zXb26Fz9rcQpDWS57CtERHpNehXCPcNoHGKutQY (SS58)
- Ethereum: 0x1234567890123456789012345678901234567890 (H160)

===========================================
USAGE
===========================================

# Convert Substrate to Ethereum
pop convert address 5GrwvaEF5zXb26Fz9rcQpDWS57CtERHpNehXCPcNoHGKutQY

# Convert Ethereum to Substrate
pop convert address 0x1234567890123456789012345678901234567890

===========================================
WHEN TO USE
===========================================

- Contract requires different address format
- Cross-chain interactions
- Wallet compatibility issues
- EVM and Substrate interoperability

===========================================
EXAMPLES
===========================================

# Simple conversion
pop convert address 5GrwvaEF5zXb26Fz9rcQpDWS57CtERHpNehXCPcNoHGKutQY

# Use in contract call
USER_ADDR="5GrwvaEF5zXb26Fz9rcQpDWS57CtERHpNehXCPcNoHGKutQY"
ETH_ADDR=$(pop convert address $USER_ADDR | grep "Ethereum" | awk '{print $3}')

pop call contract \
  --contract 0xABC... \
  --message transfer \
  --args $ETH_ADDR 1000 \
  --use-wallet

# Batch conversion
while read addr; do
  pop convert address $addr
done < addresses.txt

===========================================
IMPORTANT
===========================================

- Substrate → Ethereum: Safe, deterministic
- Ethereum → Substrate: May not be reversible
- Network-specific conversions may differ
- Verify converted addresses before use

===========================================
NEXT STEPS
===========================================

pop call contract --message transfer --args <address> 1000

See: call/contract.txt
