A verified GLD reference deployment is available on chain 771002, built with the Hardhat starter. This guide uses Remix; deploy your own instance and retain its original source and compiler input for verification.
Before you begin
Connect MetaMask to Tavchain Testnet, chain ID 771002, and obtain Test TAV. Use a second public address you control for the token transfer.Create the contract
In Remix, createGLDToken.sol and paste:
GLDToken.sol
Deploy 1,000 example tokens
ERC-20 amounts are integers in the token’s smallest unit. OpenZeppelin’s defaultdecimals() is 18, so:
- In Deploy & Run Transactions, choose Browser Extension → MetaMask and confirm the network is Custom (771002).
- Select GLDToken.
- Enter
1000000000000000000000for the constructor’sinitialSupply. - Leave Value at 0. You are creating tokens, not buying them with TAV.
- Click Deploy once, review the deployment and fee in MetaMask, and confirm.
- Wait for a successful receipt. Save the contract address and transaction hash.
Read the supply and balance
Expand your deployed GLDToken in Remix. Read:
These reads do not require a wallet transaction or gas payment.
Transfer 10 GLD
- Expand transfer.
- Enter your second account’s public address in
to. - Enter
10000000000000000000invalue. - Keep Remix’s separate transaction Value at 0.
- Click Transact once. Review and confirm the interaction in MetaMask.
- Wait for a successful receipt and check the Transfer event for the sender, recipient and raw amount.