Where communities thrive


  • Join over 1.5M+ people
  • Join over 100K+ communities
  • Free without limits
  • Create your own community
People
Activity
    Dennis Gearon
    @kwince
    @hedgar2017 (1) do you know an effective way to search on gitter to find previous post? (2) the only link I found for a source for token pricing from within a zinc contract is a dead link on your website now. Can you give me some sort of documentation or example of the current source of token pricing from within a zinc contract? (3) This is pretty exciting stuff 😀
    Alex Z
    @hedgar2017
    @kwince
    1) No, it doesn’t seem like it’s possible)
    2) Our old examples shouldn’t be relied on at the moment. In the Turing-complete version contracts will be slightly different. Also, if something is not in the Zinc book, it does not exist in Zinc yet :)
    3) thanks :heart_eyes_cat:
    Dennis Gearon
    @kwince
    Thx @hedgar2017
    JamesRay
    @james-ray
    Can you shed some light on how L1 can verify the post-state of some Zinc contract, whether Turing-complete or not complete.
    You said production design will be different, how does the verification work? @hedgar2017
    Lasse Herskind
    @LHerskind
    Hi, is the solidity transpiler up somewhere, cannot find it? If not, will it be available with the testnet or do we have to wait for main? :)
    Dennis Gearon
    @kwince
    @hedgar2017 Is the next version of zinc going to be 1.0? Or will it be less? Also is there going to be a pragma or some other mechanism that tells the validator running the contract which version of zinc it is set for? And how long will the versions pre 1.0 continue to run on the validator networks? Is there any point in making anything production level before like 1.0 or 1.01?
    Alex Z
    @hedgar2017
    @james-ray hi. This information will be available in our docs, when we are close to the release.
    @LHerskind hi. Actually, we suspended the Solidity-to-Zinc transpiler support, as we are going to support Solidity directly. You’ll need only to make some minor changes to compile a contract into our VM bytecode.
    Alex Z
    @hedgar2017

    @kwince the testnet Turing-complete release is likely to be 0.3. Perhaps, the mainnet one will be 1.0 - not decided yet.

    Concerning pragmas, Zinc is only a language with its compiler.
    There are several abstraction layers between the compiler and VM, like LLVM IR and the bytecode (or assembly text).
    Thus, pragma will be needed only for the package manager like zargo to check whether there is the correct version of the Zinc compiler in PATH.

    Dennis Gearon
    @kwince
    Thx Alex @hedgar2017
    hanakomodo
    @hanakomodo
    turing complete zinc and testnet are both targeting may right? excited to try developing for zksync but seems like the correct thing to do is wait for that?
    Alex Z
    @hedgar2017
    @hanakomodo yeah, exactly :)
    85
    @eightyfive
    👋 there. How much cheaper is running some SC on zkSync L2? Is there some
    *docs someone could point to?
    Alex Z
    @hedgar2017
    @eightyfive hi!
    There were some talks about orders of magnitude, but there zkSync guys should give more precise info :)
    https://gitter.im/matter-labs/zksync
    85
    @eightyfive
    🙏
    Is there some public vyper-to-zinc transpiler ? I guess the team did not translate all the Curve vyper contracts by hand, or did you?
    Alex Z
    @hedgar2017
    @eightyfive nope, just rewrote this part by hand.
    https://github.com/matter-labs/curve-zinc
    85
    @eightyfive
    Ok. Why not 🙂
    JamesRay
    @james-ray
    I am trying to use CLion to debug the server and the prover, however the sever started and soon panicked:
    thread 'main' panicked at 'Cannot drop a runtime in a context where blocking is not allowed. This happens when a runtime is dropped from within an asynchronous context.'
    24: 0x562d3a2c60ba - zksync_api::fee_ticker::ticker_api::coingecko::CoinGeckoAPI::new::hb7540c35664399f4
    at /home/james/workspace/zksync/core/bin/zksync_api/src/fee_ticker/ticker_api/coingecko.rs:27:26
    25: 0x562d3a3c1127 - zksync_api::fee_ticker::run_ticker_task::h47c3c743da9dc809
    at /home/james/workspace/zksync/core/bin/zksync_api/src/fee_ticker/mod.rs:282:17
    26: 0x562d3a6efd54 - zksync_api::run_api::h550531807cbf1995
    at /home/james/workspace/zksync/core/bin/zksync_api/src/lib.rs:25:23
    I found it tries to connect http://127.0.0.1:9876/api/v3/coins/list, I open the url in internet explorer, the url is fine.
    Alex Z
    @hedgar2017
    @james-ray please, address zkSync issues to the zkSync chat :)
    Dennis Gearon
    @kwince
    @hedgar2017 Do you know how to get the private_key needed for transactions? Is it a ZKSYNC private key derived from an Ethereum wallet private key, or is it just he Ethereum private key. I am doing the 'minimal example' here. https://zinc.zksync.io/07-smart-contracts/02-minimal-example.html
    Madis Nõmme
    @madis

    Hello. First of all, amazing technology. I'm happy to be a pioneer and bringing it to the masses. Sorry for my n00b questions in case this is something obvious to the more knowledgeable people here.

    1. When deploying a contract written in Zinc using zargo to rinkeby, do the rinkeby EVM nodes execute it? Or where and how does the L2 come into play (e.g. when and where is the actual zkSync storage kept)?

    2. To call the Zinc contract methods, should I use the same web3 workflow (e.g. new web3.eth.Contract(...) etc.)? Or something else is needed? (the tutorial on Contract Workflow suggests zargo call ...). If it's the latter, what options there are (e.g. to do it using JavaScript)?

    Madis Nõmme
    @madis

    Another question. I followed the minimal-example to the dot (https://zinc.zksync.io/07-smart-contracts/02-minimal-example.html), added private_key but during deployment I get the following error.

    ❯ zargo publish --network rinkeby --instance default
       Compiling vorsti_hind v0.1.0
        Finished release [optimized] target
      Setting up key pair `./data/proving_key` and `./data/verifying_key`
       Uploading the instance `default` of `vorsti_hind v0.1.0` to network `rinkeby`
         Address 0xa87b7674c7e7f1e46e880542b15d4c6857893bfc
    [ERROR zargo] Invalid character 'x' at position 1

    Any hints what could be causing the [ERROR zargo] Invalid character 'x' at position 1?

    Alex Z
    @hedgar2017
    @kwince L1 and L2 share the private key, so I think it is both :)
    Alex Z
    @hedgar2017
    @madis hi! Thank you, welcome here :)
    1. The current version of Zinc and Zargo interact with the Zandbox server, which resides on rinkeby and interacts with its zkSync node (sends transactions and executing contract methods). The release you are using now (0.2.3) is half a year old demo, so the contract storage (except balances) is kept in PostgreSQL, but the balances are stored in zkSync.
    2. There is no JS client for Zandbox, but I wrote the endpoint specification a while ago, so you are free to use it: https://www.notion.so/matterlabs/Endpoint-documentation-f9841e45616f4c0d85275cd72812b540.
      However, there is an upcoming Turing-complete release soon, and all the functionality I'm talking about is already deprecated and removed. So it is worth to wait for this release :)
    3. Ah, just remove the 0x prefix from the private key.
    Madis Nõmme
    @madis

    Thanks for the help! Can't wait for the next release. The private key change worked. I was also able to deploy & call my contract on rinkeby using zargo.

    Tried the API endpoints but so far to no avail (gives 404). Is the root url I got from https://github.com/matter-labs/zinc/blob/main/zargo/src/network.rs#L23 correct (https://rinkeby3-zandbox.zksync.dev)?

    I tried with

    curl -v -X PUT "https://rinkeby3-zandbox.zksync.dev/api/v1/query?address=0x6f5c9eaa40f5ca1b5fb0913d59a85beb4aa721d9&method=get_fee"
    Alex Z
    @hedgar2017
    @madis sorry, the document got a little outdated :) https://github.com/matter-labs/zinc/blob/main/zinc-const/src/zandbox.rs
    Updated!
    Dennis Gearon
    @kwince
    Thx Alex very much
    Holy cow! If there's no network connection, my android gitter does not terminate the msg and buffer it for sending. It just accepts the CR/EOL! That, and my android gitter keeps crashing, and there's no decent search on mobile. Hmmm, gitter underwhelms.
    Dennis Gearon
    @kwince
    @madis I should be getting close to doing that myself soon. Congratulations! I'm looking forward to the getting this test version done before zinc comes out with its latest version
    Husen Wang
    @wanghs09
    @hedgar2017 Is it possible to start a localhost network to deploy Zinc contract? rinkeby is not stable enough
    Madis Nõmme
    @madis

    Good morning. What's the preferred approach to testing contract methods of Zinc code? The examples I've found so far all call individual methods (outside a contract) e.g. https://github.com/matter-labs/curve-zinc/blob/main/src/exchange.zn#L74-L83

    Is that the only way? I.e. extract and delegate from contract to pure methods outside the contract and test these? Or is there a way to instantiate the contract object itself (with some state) and call its methods (via zargo test for example)?

    4 replies
    Husen Wang
    @wanghs09
    @hedgar2017 is there any bytecode size limit? the compiled main.znb is 105k and reported error when zargo publish [ERROR zargo] contract uploading request: HTTP error (422 Unprocessable Entity) Runtime: MalformedBytecode(StackUnderflow)
    Alex Z
    @hedgar2017
    @kwince thanks!
    Alex Z
    @hedgar2017

    @madis it is possible by running zvm manually using zargo run.
    @wanghs09 that might indicate a bug in the old VM.

    Sorry, we do not support that version anymore, as we are extremely focused on the upcoming Turing-complete contracts release.
    Please, look forward to the testnet release in May :)

    Husen Wang
    @wanghs09

    @wanghs09 that might indicate a bug in the old VM.

    Sorry, we do not support that version anymore, as we are extremely focused on the upcoming Turing-complete contracts release.
    Please, look forward to the testnet release in May :)

    would that be a new language? is it compatible with the zinc contract?
    Alex Z
    @hedgar2017
    @wanghs09 all the same, but Turing-complete (like Solidity).
    Husen Wang
    @wanghs09
    Thanks! that would be great!:D
    Kristof Gazso
    @kristofgazso
    Hey! I was wondering what is the best way of getting a user on a website to sign a mutable zinc transaction without installing zargo themselves and without copy-pasting their private key into the website.
    Kristof Gazso
    @kristofgazso
    1. There is no JS client for Zandbox, but I wrote the endpoint specification a while ago, so you are free to use it: https://www.notion.so/matterlabs/Endpoint-documentation-f9841e45616f4c0d85275cd72812b540.
    How would you create valid signatures for the call transaction in the required format using web3.js?
    Madis Nõmme
    @madis
    :point_up: I'd be interested in it too. The urls posted in https://github.com/matter-labs/zinc/blob/main/zinc-const/src/zandbox.rs are missing the root url also. The closest I got was with the following, which gave me 400 error (from CloudFlare) instead of 404
    curl -v -X PUT "https://rinkeby3-zandbox.zksync.dev/api/v1/contract/query?address=0x6f5c9eaa40f5ca1b5fb0913d59a85beb4aa721d9&method=get_fee"

    Post to the same url gives 405, so something is happening.

    Grepped the zargo binary and got the following urls

    https://rinkeby3-zandbox.zksync.dev
    https://ropsten-api.zksync.io/jsrpc
    https://rinkeby-api.zksync.io/jsrpc
    https://api.zksync.io/jsrpc
    Kristof Gazso
    @kristofgazso
    1. There is no JS client for Zandbox, but I wrote the endpoint specification a while ago, so you are free to use it: https://www.notion.so/matterlabs/Endpoint-documentation-f9841e45616f4c0d85275cd72812b540.

    How would you create valid signatures for the call transaction in the required format using web3.js?

    As an example, what would be the best way of generating this following JSON code?

    {
      "arguments": {
        "value": "42"
      },
      "transaction": {
        "tx": {
          "type": "Transfer",
          "accountId": 1,
          "from": "0x36615cf349d7f6344891b1e7ca7c72883f5dc049",
          "to": "0x1234567812345678123456781234567812345678",
          "token": 0,
          "amount": "0",
          "fee": "37500000000000",
          "nonce": 2,
          "signature": {
            "pubKey": "07f86efb9bf58d5ebf23042406cb43e9363879ff79223be05b7feac1dbc58c86",
            "signature": "042c7356c3970c5ab620e1eaf0a9e39563edc9383072ac33a29398f11678b2a3acdc40ff05acd225b6a71962cfabfa6012fae8492106987bcd48135fefa09c02"
          }
        },
        "ethereumSignature": {
          "type": "EthereumSignature",
          "signature": "0xbe7a011c0b03a2ab8eceb3f51ec3055e5998b025e3e41a320f6b00532a4c49604608fe7b9c36d837c36817bbaf5570197484281dd45d83f2d9ef867b7454b91e1b"
        }
      }
    }