Deploying Token
In this example we show how to deploy a PANDAS-based Token using Brownie
Prerequisites
Install Brownie: pip install eth-brownie
Add your custom token contract to the contracts folder in your Brownie project.
Add your private key to the brownie project
If you have already a private key, use:
brownie accounts new <id>If you don't have a private key, use:
brownie accounts generate <id>Do not forget to request testnet funds from the faucets
Modify the networks-config.yaml to include the desired testnets.
Step 1: Configure the networks-config.yaml
Update the networks-config.yaml file to include the testnet configurations for Ethereum (Goerli), BNB Chain (Testnet), Avalanche (Fuji), Fantom (Testnet), Celo (Alfajores), and Cronos (Testnet).
networks:
- name: Goerli
networks:
- name: Testnet
chainid: 5
id: goerli-test
host: https://goerli.infura.io/v3/YOUR-PROJECT-ID
explorer: https://goerli.etherscan.io/api
- name: BNB Chain
networks:
- name: Testnet
chainid: 97
id: bnb-test
host: https://data-seed-prebsc-1-s1.binance.org:8545
explorer: https://testnet.bscscan.com/api
- name: Avalanche
networks:
- name: Testnet
chainid: 43113
id: avalanche-fuji
host: https://api.avax-test.network/ext/bc/C/rpc
explorer: https://cchain.explorer.avax-test.network/api
- name: Fantom
networks:
- name: Testnet
chainid: 4002
id: fantom-test
host: https://rpc.testnet.fantom.network
explorer: https://explorer.testnet.fantom.network/api
- name: Celo
networks:
- name: Testnet
chainid: 44787
id: celo-alfajores
host: https://alfajores-forno.celo-testnet.org
explorer: https://alfajores-blockscout.celo-testnet.org/api
- name: Cronos
networks:
- name: Testnet
chainid: 338
id: cronos-test
host: https://evm-t3.cronos.org/
explorer: https://cronos-explorer.crypto.org/api
Step 2: Add OpenZeppelin dependencies to brownie-config.yaml
Add the following lines to your brownie-config.yaml file in order to be able to download the OpenZeppelin dependencies:
Step 3: Deploy and register your token on each supported testnet
In your Brownie project, create a scripts directory and add a file named deploy_token.py and add the following code:
Set the FORWARDER_ADDRESS, HUB_ADDRESS & PAN_ADDRESS with the appropriate addresses for each testnet.
Run the script on each testnet using Brownie:
Step 4: Register external tokens on each Pantos Hub
registerExternalToken is a function used in the Pantos ecosystem to establish a connection between a token on one blockchain and its corresponding token on another blockchain. This function enables the PantosHub to recognize the token's presence across multiple blockchains and helps facilitate cross-chain token transfers.
Create a file named register_external_tokens.py in the scripts directory of your Brownie project and add the following code:
Replace <address of token on chain>, <chain id> & <address of token on different chain> with the appropriate addresses for each testnet.
Run the script on each testnet using Brownie:
Once you have completed these steps, your token will be deployed on all the supported testnets and registered with the Pantos Hubs. This will enable your token to be transferred across these networks seamlessly.
To summarize, this step-by-step guide will help you deploy your token on multiple testnets and register it with the Pantos Hubs. You will need to create a Brownie project, configure the necessary networks, deploy your token, and run the appropriate scripts to register your token and external tokens on each Pantos Hub. By following these steps, you'll have a multichain token that can be used across different blockchain networks.
Feel free to add your registered tokens to this list: https://github.com/pantos-io/testnet-token-list
Overview of Pantos Blockchain IDs & Contract Addresses
All addresses and ids can be found here: Testnet Addresses
Last updated