Tolar HashNET
Published in

Tolar HashNET

Tolar Swap Instructions

Brief manual on how to swap your ERC 20 TOL Token

1. Import your key from account that is holding ERC20 TOL Tokens.

For security reasons, it’s recommended that this account contains only ERC20 tokens you’ll swap. For compatibility with bigger number of wallets, you can import both keystore file and raw private key.

KEYSTORE FILE:

  1. Export keystore file from your wallet as .json (Almost all popular wallets give you this option. If you need help, you can ask on our Telegram support group.)
  2. Import keyfile to Tolar wallet
  • You can import it in settings, by clicking on import and selecting .json file
  • If you use CLI node binary, you can access it through ImportKeyFile API See Appendix A for API information

RAW PRIVATE KEY:

  1. Export raw private key from your wallet
  2. Import keyfile to Tolar wallet
  • You can import it in settings, by clicking on import private key and copy-pasting it
  • If you use CLI node binary, you can access it through ImportPrivateKey API See Appendix B for API information

2. Once you’ve imported key, you should see new Tolar address for that key (54……)

If you want to double check you’ve done this correctly, there will be form on https://tolar.io/download where you can copy-paste your Tolar address and check if it corresponds to native Ethereum address where ERC20 Tolar tokens are held.

3. To execute swap, call ‘burn’ method on Tolar smart contract 0xd07d9fe2d2cc067015e2b4917d24933804f42cfa for your tokens.

If you require raw ABI you can download it here.

Only argument that burn method takes is amount that you want to swap (usually it’s all on your account). Keep in mind that TOL has 18 decimals (same as ETH), so for example if you want to burn 1230,45 TOL, you’ll invoke: burn(1230450000000000000000)

- If you have Web3 enabled wallet (ie. Metamask) you can use interface at MyCrypto:

  • Go to https://mycrypto.com/contracts/interact
  • Copy-paste Tolar token contract address (0xd07d9fe2d2cc067015e2b4917d24933804f42cfa) into ‘Contract Address’ field
  • Copy-paste Tolar token contract ABI (here) into ABI/JSON interface
  • Click ‘Access’
  • Select ‘burn’ from Read/Write contract dropdown
  • Enter _value (amount of tokens that you want to burn for swap)
  • Then select your wallet (if you’re using Metamask, this will be Web3, but can be any of offered ways to access it).
  • Execute transaction

- or at Etherscan

- or alternatively, you can invoke method directly through your wallet CLI/API or use any preferred tool that can invoke method on smart contract

4. Once your burn method is processed ERC20 tokens will be destroyed on Ethereum network and equivalent amount of tokens will appear on Tolar native network on corresponding address (from step 1).

This might take up to 24h for transactions, also depending on speed and congestion on Ethereum network, but will usually be much faster.

APPENDIX A

Method name: ImportKeyFile

Method description: Imports key file to keystore attached to master or light node

Request parameters: [json_key_file: string]
Key file in encrypted JSON format
[name: string]
Optional name for imported address
[lock_password: string]
Provide lock password if original key file was password protected

Response parameters: [result: boolean]
Returns true if import successful, false otherwise

Response code descriptions:

  • OK — request successful
  • PERMISSION_DENIED — not able to access keystore

Faulty scenarios: Keystore not found or not previously opened/unlocked Key file can’t be unlocked with provided password

APPENDIX B

Method name: ImportRawPrivateKey

Method description: Imports raw private key to keystore

Request parameters: [raw_private_key: string]

Raw private key, should be 64 chars long

[name: string]

Optional name for imported address

[lock_password: string]

Provide lock password if you want to encrypt the imported private key

[lock_hint: string]
Optional lock hint for lock password

Response parameters: [result: boolean]
Returns true if import successful, false otherwise

Response code descriptions:

  • OK — request successful
  • PERMISSION_DENIED — not able to access keystore

Faulty scenarios: Keystore not found or not previously opened/unlocked Incorrect private key length

--

--

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store
Tolar HashNET

Editorial team of Tolar HashNET — DLT that keeps all positive characteristics of blockchain while increasing throughput to 200,000 TPS.