Skip to content

Various small documentation fixes. #18

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 7 commits into from
Jun 17, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions .trunk/trunk.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -45,6 +45,10 @@ lint:
- zq1/docs/developers/transaction-lifecycle # Contains examples.
- zq1/docs/developers/developer-toolings
- zq1/docs/exchanges
- linters: [markdownlint]
paths:
- zq2/docs/ecosystem/index.md # multiple headers
- zq2/docs/zilevm/tools/remix.md # Don't care about line length
- linters: [ALL]
paths:
- Dockerfile # Annoying, but trunk is now very opinionated on how you write dockerfiles.
Expand Down
2 changes: 1 addition & 1 deletion requirements.txt
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ Pygments==2.15.0
pymdown-extensions==10.0
pyparsing==3.0.9
python-dateutil==2.8.2
PyYAML==6.0
PyYAML==6.0.1
pyyaml_env_tag==0.1
requests==2.31.0
six==1.16.0
Expand Down
Binary file added zq2/docs/assets/img/chainlink/remix-compiler.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added zq2/docs/assets/img/evm/compile_contract.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added zq2/docs/assets/img/evm/deploy_contract.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added zq2/docs/assets/img/evm/metamask_deploy.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added zq2/docs/assets/img/evm/setup_metamask.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
18 changes: 2 additions & 16 deletions zq2/docs/changes.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,11 +12,11 @@ There are a number of differences between Zilliqa 1.0 and Zilliqa 2.0 that you s
- Zilliqa 2.0 uses proof of stake based Fast-Hotstuff as a consensus algorithm. Mining is no longer necessary.
- Zilliqa 2.0 has many fewer nodes, and is thus far cheaper to run, than Zilliqa 1.0 - a typical Zilliqa 2.0 mainnet can run comfortably in 32 nodes.
- Zilliqa 2.0 has a much faster block time (there is typically a hardwired minimum of 1s/block); dApp operators will need to make sure that where they use block number as a proxy for a timestamp, they allow sufficient blocks for users to react.
- Zilliqa 2 upgrades are seamless and relatively quick; you don't need to redownload persistence and there is an auto-upgrader you can run if you wish which will run the newer version of zq2 and cut over when ready. We hope this will enable us to eliminate upgrade downtime and to make more frequent bug fixes.
- Zilliqa 2 upgrades are seamless and relatively quick; you don't need to redownload persistence and there will be an auto-upgrader you can run if you wish which will run the newer version of zq2 and cut over when ready. We hope this will enable us to eliminate upgrade downtime and to make more frequent bug fixes.

## API differences

- There are no DS epochs any longer (though some are faked to allow
- There are no DS epochs any more (though some are faked to allow
existing applications that retrieve the current DS epoch to work),
so the transaction pool is no longer cleared wat the start of a DS
epoch.
Expand All @@ -28,17 +28,3 @@ There are a number of differences between Zilliqa 1.0 and Zilliqa 2.0 that you s
There are also a number of things that have not changed:

- Zilliqa 2.0 is (or should be!) compatible with all the same dApps, tokens and sites as Zilliqa 1.

## Transition plan

Zilliqa 2.0 will being by running a prototype devnet. This is an empty developer test network that you can use to try out your code.

There will then be:

- A `prototestnet` network - this periodically (once every few days) imports existing Zilliqa 1 testnet persistence and starts a network on it; this allows you to test against existing testnet persistence.
- A `protomainnet` network - which does the same with mainnet persistence.
- Existing SSNs will be invited to become validators on the Zilliqa 2 network (bringing their delegated stake with them). We'll contact you individually about this.
- We will then cut `testnet` over to Zilliqa 2
- Then `mainnet`

Note that the `proto` networks will have different chain IDs to the networks they import their state from; this is necessary to avoid replay attacks, but means that you will find the chain ids of old transactions are not the same as the chain ids for new ones.
10 changes: 5 additions & 5 deletions zq2/docs/ecosystem/chainlink.md
Original file line number Diff line number Diff line change
Expand Up @@ -125,11 +125,11 @@ Now that we have inspected the smart contracts, let’s deploy FeedConsumer.

Go to [Remix IDE](https://remix.ethereum.org/). In the File Explorer tab, add both of the contracts under the contracts folder like this:

<img alt="Remix File Explorer" width="1600" src="../../../../assets/img/chainlink/remix-file-explorer.png" />
<img alt="Remix File Explorer" width="1600" src="../../assets/img/chainlink/remix-file-explorer.png" />

The next thing to do is to compile our contracts with the built-in compiler. Do this for both contracts:

<img alt="Remix File Explorer" width="800" src="../../../../assets/img/chainlink/remix-compiler.png" />
<img alt="Remix File Explorer" width="800" src="../../assets/img/chainlink/remix-compiler.png" />

Now we are ready to deploy the contract! Go to the Remix Deployer. Make sure you have selected Zilliqa Testnet in Metamask from the earlier step.

Expand All @@ -139,15 +139,15 @@ There are three actions we need to take here:
2. Copy the EVM address from above that belongs to “ZIL / USD (Testnet)” and paste it in the input field that says “address feedAddress”
3. Click deploy and accept the transaction in your Metamask wallet. Normally it takes around one minute for deployment to complete.

<img alt="Remix File Explorer" width="1600" src="../../../../assets/img/chainlink/remix-transactions-0.png" />
<img alt="Remix File Explorer" width="1600" src="../..//assets/img/chainlink/remix-transactions-0.png" />

If all went well you should now see your FeedConsumer contract appear under “Deployed Contracts”:
<img alt="Remix File Explorer" width="800" src="../../../../assets/img/chainlink/remix-transactions-1.png" />
<img alt="Remix File Explorer" width="800" src="../../assets/img/chainlink/remix-transactions-1.png" />

If so, great! Let’s open this up and call a few of its functions:

Let’s call the description function: after a couple of seconds you should see “ZIL / USD”. Do the same with decimals and getLatestAnswer() and you should see a similar result as below:
<img alt="Remix File Explorer" width="800" src="../../../../assets/img/chainlink/remix-deployed-contracts.png" />
<img alt="Remix File Explorer" width="800" src="../../assets/img/chainlink/remix-deployed-contracts.png" />

Remember since this is on-chain data, there are no floats / decimal numbers. So to get the nominal value in a more human readable format, you divide the answer with the decimal points as follows:

Expand Down
12 changes: 12 additions & 0 deletions zq2/docs/ecosystem/index.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
---
id: ecosystem-index
title: Ecosystem
keywords:
- ecosystem
- index
description: Ecosystem index page
---

# Zilliqa ecosystem

These pages contain developer information about the Zilliqa ecosystem
4 changes: 1 addition & 3 deletions zq2/docs/endpoints.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,7 @@ description: Zilliqa API Endpoints

Chain ids can be found at [chainlist](https://chainlist.org/?search=zilliqa&testnets=true).

Uptime can be found at [status.zilliqa.com](https://status.zilliqa.com) and you can get API examples from the [api](/api) pages.

We have several blockchains running.
Uptime can be found at [status.zilliqa.com](https://status.zilliqa.com) and you can get API examples from the `versions` pages in the navbar.

## devnet

Expand Down
110 changes: 80 additions & 30 deletions zq2/docs/faq.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,15 @@ description: Frequently asked questions

They are the same, though EVM ZIL are scaled to accomodate the differing precisions of EVM and Zilliqa ZIL (18 vs 12 decimal places).

#### Does this mean that transfers will produce dust?
#### Does this mean that ZIL transfers will produce dust?

No. The internal representation of value is in ZIL, not EVM units, but dust may not transfer as you were expecting it to.
Zilliqa 1 used to track value in Qa, and Wei were produced by multiplying this value by 1_000_000.

Zilliqa 2 tracks value in Wei and divides by 1_000_000 to produce Qa,
so whilst Zilliqa-native API interactions will not produce dust, they
may perpetuate it. Unless you have a whole number of Qa in your
account, you will not be able to zero your balance using the Zilliqa
native API.

#### Can I use the same address for EVM and ZIL API (eg. for Metamask and ZilPay/Torch)?

Expand All @@ -28,9 +34,9 @@ In practice, no. The way your address is chosen is that:
2. You derive a public key from that.
3. Derive an address from the public key, usually by hashing.

Zilliqa and Ethereum have different ways of performing the second
step, so the Zilliqa address derived from a given private key is
different from the Ethereum address for that key.
Zilliqa and Ethereum have different ways of performing step 3, so the
Zilliqa address derived from a given private key is different from the
Ethereum address for that key.

If you were to want a single address for both EVM and ZIL, you would
need to know eg. the ethereum private key for the ZIL address you had
Expand All @@ -43,48 +49,63 @@ can't have the same address for EVM and ZIL APIs.
If there is enough interest, it might be possible to work around this
by allowing EVM transactions to have Schnorr signatures (so that you
could submit them via the ZIL API) and vice versa, but this would need
explicit support in DApps, and we judged the extra complexity surface
probably wasn't worth it for now.
explicit support in DApps, and we judged the extra complexity probably
wasn't worth it for now.

#### Will I be able to restore a Zilliqa account in Metamask using my private key or seed phrase?

No. You can only restore Zilliqa accounts in a Zilliqa wallet (eg. ZilPay or Torch) or EVM accounts in an EVM wallet (like Metamask).
No. You can only restore Zilliqa accounts in a Zilliqa wallet
(eg. ZilPay or Torch) or EVM accounts in an EVM wallet like
Metamask.

#### Will I be able to store ZRC fungible tokens in Metamask?

Not directly; you will be able to store them via our [ERC-20-to-ZRC-2 gateway contract](https://github.com/Zilliqa/zilliqa-developer/tree/main/contracts/experimental/ERC20ProxyForZRC2), which will let you see your ZRC-2 tokens as though they were ERC-20 tokens.
Not directly; you will be able to store them via our [ERC-20-to-ZRC-2
gateway
contract](https://github.com/Zilliqa/zilliqa-developer/tree/main/contracts/experimental/ERC20ProxyForZRC2),
which will let you see your ZRC-2 tokens as though they were ERC-20
tokens.

#### Will I be able to store ZRC non-fungible tokens in Metamask?

Not initially; we hope to be able to provide this in a future release, though you could also write a gateway contract (similar to our ZRC-2/ERC-20 gateway) yourself.
Not initially; we hope to be able to provide this in a future release,
though you could also write a gateway contract (similar to our
ZRC-2/ERC-20 gateway) yourself.

#### Will I be able to use my Zil on Dex like Uniwap, Sushiswap to trade?

If and when those DEXes deploy to Zilliqa, yes.
If and when those DEXes deploy to Zilliqa, yes. In the meantime, there
are other Zilliqa EVM DEXes such as Plunderswap -
[https://plunderswap.com/](https://plunderswap.com/).

#### Will Devs be able to deploy Uniswap/Sushiswap/1inch on Zilliqa?

Developers should be able to deploy your contracts to EVM on Zilliqa just like any other EVM-compatible chain.
Developers should be able to deploy your contracts to EVM on Zilliqa
just like any other EVM-compatible chain.

#### Will I be able to sell my NFTs on NFT marketplace like Opensea/Blur?

Not until they add support for the Zilliqa chain (and even then, you will either need an ERC-721 gateway, or to have EVM NFTs on Zilliqa)
Not until they add support for the Zilliqa chain (and even then, you
will either need an ERC-721 gateway, or to have EVM NFTs on Zilliqa)

#### Will I be able to buy a NFT using Zil on Opensea/Blur?

Not until they add support for Zilliqa.

#### Will I be able to use stake.zilliqa.com with Metamask & stake my Zil?

Not directly; please let us know if this is functionality you'd like (or you can write a gateway contract yourself, of course). In the meantime, you'll need to transfer your ZIL to a Zilliqa wallet and stake them from there.
Not directly; please let us know if this is functionality you'd like
(or you can write a gateway contract yourself, of course). In the
meantime, you'll need to transfer your ZIL to a Zilliqa wallet and
stake them from there.

#### Will I be able to connect Metamask with Zilswap & buy tokens listed on Zilswap with native Zil?

Not until Zilswap supports EVM wallets.

#### Which Dex can I use to connect with Metamask & use my Native Zil to trade?

This is a new release, so there aren't currently any EVM dexes that we know of. We'll update this answer when some have tested and deployed.
Plunderswap - [https://plunderswap.com/](https://plunderswap.com/) is a native EVM DEX on Zilliqa.

#### Will NFTs created under ZRC1 have EVM interoperability or this apply only to ZRC6?

Expand All @@ -95,36 +116,65 @@ facilities if you really need it).

#### What happens if I send ZIL via Torch or ZilPay to my EVM address, or Metamask to my ZIL address?

These transfers should execute normally, and your ZIL will arrive safely in the "other" wallet.
These transfers should execute normally, and your ZIL will arrive safely in the EVM wallet.

#### What happens if I send ZIL to a random address via Metamask?

They will be lost, just as they are today - in fact, they'll turn up just fine at the address you sent them to, but since no-one has the private key for that address, it won't be possible to do anything with them once they get there.

#### How about ZRC-2, ERC-20 and other contract-wrapped tokens?

This is trickier. Suppose you send some ZRC-2 tokens (such as `XCAD` or `ZWAP`) to your EVM address. They'll arrive just fine, but you will now want to send them elsewhere.

In order to do so, you will need to call the ZRC-2 contract with `_sender` equal to your EVM address. But, in order to make that call you need to submit a Zilliqa API transaction from your EVM address, which we've just agreed you can't do. So your funds will be stuck.

This is not optimal, and you can get out of it using [Scilla->EVM interwork](https://github.com/Zilliqa/ZIP/blob/master/zips/zip-21.md); create a solidity contract which calls the Scilla contract using the `call scilla contract with _sender unchanged` precompile. You can now send a Scilla call from an EVM transaction, and there is a contract available in the
[zilliqa-developer](https://github.com/zilliqa/zilliqa-developer) repository which does this by building an ERC-20 facade for ZRC-2 assets.

This will recover your funds, but might be quite tricky to operate for arbitrary contracts; our roadmap contains a more generic mechanism for arbitrary contracts (though you will still need to know what transition/calldata you need to call).

If you didn't understand the above, please contact your the dApp maintainer, or your developers, who will hopefully be able to help you.
This is trickier. Suppose you send some ZRC-2 tokens (such as `XCAD`
or `ZWAP`) to your EVM address. They'll arrive just fine, but you will
now want to send them elsewhere.

In order to do so, you will need to call the ZRC-2 contract with
`_sender` equal to your EVM address. But, in order to make that call
you need to submit a Zilliqa API transaction from your EVM address,
which we've just agreed you can't do. So your funds will be stuck.

This is not optimal, and you can get out of it using [Scilla->EVM
interwork](https://github.com/Zilliqa/ZIP/blob/master/zips/zip-21.md);
create a solidity contract which calls the Scilla contract using the
`call scilla contract with _sender unchanged` precompile. You can now
send a Scilla call from an EVM transaction, and there is a contract
available in the
[zilliqa-developer](https://github.com/zilliqa/zilliqa-developer)
repository which does this by building an ERC-20 facade for ZRC-2
assets.

This will recover your funds, but might be quite tricky to operate for
arbitrary contracts; our roadmap contains a more generic mechanism for
arbitrary contracts (though you will still need to know what
transition/calldata you need to call).

If you didn't understand the above, please contact your the dApp
maintainer, or your developers, who will hopefully be able to help
you.

#### What about NFTs?

Please don't transfer your Zilliqa NFTs to EVM addresses for now! They are (probably) rescuable using the interwork protocol right now, and we will address this in our next release, but it's best not to test that.
Please don't transfer your ZRC-1 or ZRC-6 Zilliqa NFTs to EVM
addresses for now! You will be unable to do anything with them when
they have been transferred and, though you are likely to be able to
transfer them back to your Zilliqa wallet via the interop route
described above, doing so is risky.

#### How about transferring ERC-20s and other tokens to ZIL API address?

Please don't do that either! Rescuing trapped tokens in EVM contracts is significantly harder than for Scilla contracts, because Scilla contracts have self-describing storage encoding and source is always available.
Please don't do that either! Rescuing trapped tokens in EVM contracts
is significantly harder than for Scilla contracts, because Scilla
contracts have self-describing storage encoding and source is always
available.

Whilst the interop mechanism can be used to transfer these back to EVM addresses, it is substantially harder to write the code to do so, and probably impossible unless you have the source code (or at least the interface) of the contract in question. Again, the maintainers of the dApp may be able to help, or if you are sophisticated, you may be able to do this yourself.
Whilst the interop mechanism can be used to transfer these back to EVM
addresses, it is substantially harder to write the code to do so, and
probably impossible unless you have the source code (or at least the
interface) of the contract in question. Again, the maintainers of the
dApp may be able to help, or if you are sophisticated, you may be able
to do this yourself.

We will try to provide assistance with the most common cases as they arise, but Zilliqa doesn't have the resources to support every use case.
We will try to provide assistance with the most common cases as they arise.

#### How do I get started with development using hardhat?

Expand Down
6 changes: 3 additions & 3 deletions zq2/docs/home.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,11 @@ hide:

This is the developer documentation for [Zilliqa](https://www.zilliqa.com/) 2.0, a fast-finality scalable blockchain.

You can read the white paper and get an overview of Zilliqa 2.0 and how it works from TODO.
You can read the white paper and get an overview of Zilliqa 2.0 and how it works from [https://roadmap.zilliqa.com](https://roadmap.zilliqa.com).

Zilliqa supports both an EVM compatible execution layer and a custom execution layer based on the [Scilla](https://scilla.readthdocs.io/latest) smart contract language. Standards for the blockchain itself are recorded in [Zilliqa Improvement Proposals](https://github.com/zilliqa/zip) and for Scilla smart contracts, in [Zilliqa Reference Contracts](https://github.com/zilliqa/zrc). Chain governance can be discussed on [the governance forum](https://gov.zilliqa.com) and votes are held on [snapshot](https://governance.zilliqa.com), and staking information can be obtained from [zillion](https://stake.zilliqa.com).
Zilliqa supports both an EVM compatible execution layer and a custom execution layer based on the [Scilla](https://scilla.readthedocs.io/) smart contract language. Standards for the blockchain itself are recorded in [Zilliqa Improvement Proposals](https://github.com/zilliqa/zip) and for Scilla smart contracts, in [Zilliqa Reference Contracts](https://github.com/zilliqa/zrc). Chain governance can be discussed on [the governance forum](https://gov.zilliqa.com) and votes are held on [snapshot](https://governance.zilliqa.com), and staking information can be obtained from [zillion](https://stake.zilliqa.com).

You can find out more about how EVM and Scilla [interoperate](/interop.md).
You can find out more about how EVM and Scilla [interoperate](zilevm/interop.md).

Zilliqa supports most standard EVM development tools and wallets, including [metamask](https://metamask.io).

Expand Down
2 changes: 1 addition & 1 deletion zq2/docs/sdk.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ title: Zilliqa SDKs

# Zilliqa SDKs, repositories, and tools

Note that a list of useful on-chain facilities (contracts, etc.) can be found via the [ecosystem](ecosystem/ecosystem.md) pages.
Note that a list of useful on-chain facilities (contracts, etc.) can be found via the [ecosystem](ecosystem/index.md) pages.

## Zilliqa SDKs

Expand Down
Loading
Loading