Skip to content

Latest commit

 

History

History
55 lines (35 loc) · 1.67 KB

README.md

File metadata and controls

55 lines (35 loc) · 1.67 KB

Daily Spending Limit

This repository is the submission to the zkSync bounty of the daily spending limit tutorial.

TUTORIAL.md is the tutorial documentation.

Deployed Account contract that has the daily spending limit feature: 0x6b6B8ea196a6F27EFE408288a4FEeBE9A9e12005 and owner pk:0x957aff65500eda28beb7130b7c1bc48f783556bb84fa6874d2204c1d66a0ddc7

Deployment & Test

zkSync2.0 testnet

As for deployment and simple test on zkSync2.0 testnet, please take a look at the tutorial doc, TUTORIAL.md.

zkSync local network.

spend-limit.test.ts in the test folder offers more detailed tests for each functionality of the SpendLimit contract.

git clone [email protected]:porco-rosso-j/daily-spendlimit-tutorial.git
  • Enter the repo and install dependencies.
cd daily-spendlimit-tutorial
yarn
  • To set up a local environment, Docker and docker-compose should be installed.
    If they are not installed on your computer: Install.

  • To run zkSync local chain, do:

git clone https://github.com/matter-labs/local-setup.git
cd local-setup
./start.sh

*check details and common errors for running local zksync chain here.

  • Compile:
yarn hardhat compile
  • Additional configuration: rename .env.example to .env and add NODE_ENV=test.

Then run:

yarn hardhat test