Zilliqa Wallet with Meteor

I plan to create a zilliqa wallet using the Meteor framework and Zilliqa-JavaScript-Library . I have three questions:

  1. Is it ok to connect to Zilliqa node through https://api.zilliqa.com/ for production use?
  2. Is there any limitation requests to that API
  3. I want to create Fungible Token. But, I do not know how to send and receive token. Is there any doc to follow?

Hi @sengtha,

Welcome!

  1. Yes, you can directly connect to api.zilliqa.com for production.
  2. The rate limit to that API is 50 requests per second. Any further requirements will require you to host a seed node.
  3. Fungible token follows the ERC20 framework. All functions in the contract is exactly the same. You can read from this document: https://eips.ethereum.org/EIPS/eip-20

Thank for your great response.

@snowsledge Do you know why a transaction cost on https://savant-ide.zilliqa.com/ is expensive? For example Transaction cost: 512 ZIL Is it standard price?

Oh that’s a display bug. Divide it by a 1,000 and you will get the correct gas price.

1 gas = 1,000 Li = 0.001 Zil

1 Like

@snowsledge When we want to show token balance on wallet, based on smart contract, we need to call BalanceOf function for any address. Doing this, gas is charged. Is there anyway, we can get token balance without gas? I am using https://etherscan.io/ to check balance of my holding tokens. I am not sure, https://etherscan.io/ need to pay gas for just viewing token balance or not.

Thanks

Hey, in order to get the token_balance state for a single account, for now you have to use the GetSmartContractState method to get the whole contract state, then parse out the key-value pair for the token_balance in the Map.

@snowsledge thank for the guide.

@snowsledge I have two questions:

  1. I am writing Smart Contract to allow only approved address can be sent or received token. And plan to save those approved address in Maps type. My question is, is there any limitation for Maps type? Example: Size limit, Storage limit, Array number limit, etc…

  2. If I send token to many addresses in one Smart Contract execution, is gas charged based on number of address sent or just one charge?

Thanks you.

  1. There is no storage limit for the Map. However, inserting new entries into a large Map will be expensive, but this gas fee is capped for now. (Can’t remember the exact figure off my head now)

  2. In order to send tokens to multiple addresses at once, your smart contract must be capable of sending multiple messages for the blockchain to take it into account. Therefore, you will be charged for these multiple separate messages.

@snowsledge
Thank for the reply

In order to send tokens to multiple addresses at once, your smart contract must be capable of sending multiple messages for the blockchain to take it into account. Therefore, you will be charged for these multiple separate messages.

The message you mentioned here is below command?
send msgs

Yes, msgs in this case is a List of messages. Do note though that on the Zilliqa blockchain, batch messages sending is not yet enabled.

@snowsledge Thank and sorry to ask many questions. I am still new to Scilla.

  1. In examples, sometime they use Event, and sometime use Send message. What is the different between Event and Send?

  2. In my smart contract, I plan to transfer token to four addresses per transition. Is it possible to use only one event or send.

Thank and sorry for taking your time.

  1. Events are used when you need to listen to it in your dApp (off-chain interaction). They have the similar concept to Javascript event. While Message sending is for on-chain interaction with other accounts. You will do message sending when you need to call another transition in another contract or send ZILs to another User account.

  2. Currently, you cannot do batch transactions (or message sending) yet. Hence, you cannot send tokens to 4 addresses at once.

@snowsledge any timeline to implement batch transactions?

No clear timeline yet, we are in the process of stabilising the mainnet before going ahead with enabling more of such features. The best estimate for this implementation will be Q3 '19.

1 Like

@snowsledge hello! I have written a smart contract. It works well on https://savant-ide.zilliqa.com . And I have tried to deploy it to testnet by using https://github.com/Zilliqa/Zilliqa-JavaScript-Library

But, the code is stuck at

const [deployTx, hello] = await contract.deploy({
version: VERSION,
gasPrice: myGasPrice,
gasLimit: Long.fromNumber(10000)
});

No error message. Do you know any way to debug the problem?

@snowsledge I got below error message in few minutes later.

I20190506-13:31:08.394(7)? Error: The transaction is still not confirmed after 33 attempts.

Do you know the problem?

And I have tried to deploy my smart contract with https://zilpay.xyz/scilla-editor/
Always got this error “Transaction is not completed” and if I deploy with Javascript code, it always got “The transaction is still not confirmed after 33 attempts.”

Do not know why it is so hard to deploy to testnet.

Hi there, if you have this error, it is very likely to be an issue with the Scilla code, init parameters or insufficient gasLimit.

It will be helpful if I can take a look at your Javascript deploy script so we can understand the problem.