Open7

zkEVM を試す

odanodan

ネットワークの追加

MetaMask のこの機能使えるの便利

odanodan

サイト内に faucet がある。ツイートしなくてももらえたけどツイートしておいた

odanodan

言われるがままに署名すると swap できるみたい

odanodan

RPC の URL は https://stage2-api.zksync.dev/web3

適当にメソッドを呼び出してみる

$ curl https://stage2-api.zksync.dev/web3 -X POST --data '{"jsonrpc":"2.0","method":"web3_clientVersion","params":[],"id":67}' -H 'Content-Type: application/json'
{"jsonrpc":"2.0","error":{"code":-32601,"message":"Method not found"},"id":67}
curl https://stage2-api.zksync.dev/web3 -X POST --data '{"jsonrpc":"2.0","method":"eth_blockNumber","params":[],"id":67}' -H 'Content-Type: application/json'
{"jsonrpc":"2.0","result":"0x8cf","id":67}
curl https://stage2-api.zksync.dev/web3 -X POST --data '{"jsonrpc":"2.0","method":"eth_getBalance","params":["0xa802b07c1B5dd0e0E57911c3fB7911a7BCff6622"],"id":67}' -H 'Content-Type: application/json'
{"jsonrpc":"2.0","result":"0x0","id":67}
odanodan

https://github.com/odan-sandbox/hardhat-zkevm-sandbox
hardhat を試したらエラーが出た

yarn hardhat run --network zksync scripts/deploy.ts
yarn run v1.22.10
warning package.json: No license field
$ /Users/odan/source/github.com/odan-sandbox/hardhat-zkevm-sandbox/node_modules/.bin/hardhat run --network zksync scripts/deploy.ts
Downloading compiler 0.8.4
Compiling 2 files with 0.8.4
Generating typings for: 2 artifacts in dir: typechain for target: ethers-v5
Successfully generated 5 typings!
Compilation finished successfully
ProviderError: Method not found
    at HttpProvider.request (/Users/odan/source/github.com/odan-sandbox/hardhat-zkevm-sandbox/node_modules/hardhat/src/internal/core/providers/http.ts:49:19)
    at LocalAccountsProvider.request (/Users/odan/source/github.com/odan-sandbox/hardhat-zkevm-sandbox/node_modules/hardhat/src/internal/core/providers/accounts.ts:168:34)
    at async GanacheGasMultiplierProvider._isGanache (/Users/odan/source/github.com/odan-sandbox/hardhat-zkevm-sandbox/node_modules/hardhat/src/internal/core/providers/gas-providers.ts:315:30)
    at async GanacheGasMultiplierProvider.request (/Users/odan/source/github.com/odan-sandbox/hardhat-zkevm-sandbox/node_modules/hardhat/src/internal/core/providers/gas-providers.ts:304:23)
    at async EthersProviderWrapper.send (/Users/odan/source/github.com/odan-sandbox/hardhat-zkevm-sandbox/node_modules/@nomiclabs/hardhat-ethers/src/internal/ethers-provider-wrapper.ts:13:20)
    at async Object.getSigners (/Users/odan/source/github.com/odan-sandbox/hardhat-zkevm-sandbox/node_modules/@nomiclabs/hardhat-ethers/src/internal/helpers.ts:23:20)
    at async getContractFactoryByAbiAndBytecode (/Users/odan/source/github.com/odan-sandbox/hardhat-zkevm-sandbox/node_modules/@nomiclabs/hardhat-ethers/src/internal/helpers.ts:250:21)
    at async main (/Users/odan/source/github.com/odan-sandbox/hardhat-zkevm-sandbox/scripts/deploy.ts:17:19)
error Command failed with exit code 1.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.

コードを読む感じだと eth_accounts を叩いてエラーになったみたい