Skip to content

Latest commit

 

History

History
62 lines (38 loc) · 1.93 KB

Interact.md

File metadata and controls

62 lines (38 loc) · 1.93 KB

Here are some useful commands that can help you to interact with zkLink contract when development.

Deploy faucet token

For local devnet or testnet, you could use this command to deploy some erc20 tokens.

NET=LOCAL1 npx hardhat deployFaucetToken --help

Hardhat version 2.10.1

Usage: hardhat [GLOBAL OPTIONS] deployFaucetToken [--decimals <INT>] --name <STRING> --symbol <STRING>

OPTIONS:

  --decimals                    The token decimals (default: 18)
  --name                        The token name 
  --symbol                      The token symbol 

deployFaucetToken: Deploy faucet token for testnet

Set auth pubkey hash

For local devnet, you could use this command to set auth pubkey hash of account that generated by the local hardhat node.

NET=LOCAL1 npx hardhat setAuthPubkeyHash --help

Hardhat version 2.10.1

Usage: hardhat [GLOBAL OPTIONS] setAuthPubkeyHash --address <STRING> --nonce <STRING> --pubkey-hash <STRING> [--zk-link <STRING>]

OPTIONS:

  --address     The account address 
  --nonce       The account latest nonce 
  --pubkey-hash The new pubkey hash that will be set to account 
  --zk-link     The zkLink contract address (default get from deploy log) 

setAuthPubkeyHash: Set auth pubkey hash for ChangePubKey on devnet or testnet

Deploy account mock

For local devnet, you could use this command to create an eip1271 account to test ChangePubKey which eth auth type is Create2.

NET=LOCAL1 npx hardhat --config hardhat.config.devnet.js help deployAccountMock
Hardhat version 2.10.1

Usage: hardhat [GLOBAL OPTIONS] deployAccountMock --owner <STRING> --pubkey-hash <STRING> [--salt-arg <STRING>]

OPTIONS:

  --owner       The account owner 
  --pubkey-hash The new pubkey hash that will be set to account 
  --salt-arg    The salt arg of create2 data (default: "0x0000000000000000000000000000000000000000000000000000000000000000")

deployAccountMock: Deploy eip1271 account mock for testnet